// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("exports ../../../chunks/tslib.es6 ../../../assets ../../../core/Accessor ../../../core/asyncUtils ../../../core/Error ../../../core/Logger ../../../core/maybe ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../core/libs/gl-matrix-2/math/mat4 ../../../core/libs/gl-matrix-2/factories/mat4f64 ../../../core/support/UpdatingHandles ./StarsTechnique ../support/buffer/glUtil ../support/buffer/InterleavedLayout ../webgl-engine/lib/DefaultVertexAttributeLocations ../webgl-engine/lib/VertexArrayObject ../webgl-engine/lib/VertexAttribute ../../webgl/BufferObject ../../webgl/enums".split(" "), function(g,l,A,B,C,v,D,r,E,F,m,S,T,G,n,w,H,x,I,J,K,L,t,M,y){function N(a,b,c,h){const p=z.createBuffer(h),u=p.position,q=p.color,O=p.size;for(let e=0;e"virtual"!==this.view.environment.lighting.type? this.view.environment.lighting.date:null,h=>this._update(h),F.initial)}}_update(a){if(a){var b=a.getHours()/12,c=a.getMinutes()/60*(2/24),h=a.getSeconds()/60*(2/1440);b=(b+c+h-.9972222)%2;c=new Date(a.getFullYear(),0,1,11,58,56);h=new Date(a.getFullYear()+1,0,1,11,58,55);a=(+a-+c)/(+h-+c)*2;c=n.copy(this._passParameters.modelMatrix,Q);n.rotateZ(c,c,-a*Math.PI);n.multiply(c,R,c);n.rotateZ(c,c,-b*Math.PI);this.requestRender()}}_createLoadDataTask(){if(null!=k)return null;const a=C.createTask(async b=> {({data:b}=await A.fetchAsset("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:b}));if(!b)throw new v("stars:no-data-received","Failed to create stars because star catalogue is missing");const c=b.byteLength/9;if(0!==c%1||5E4c)throw new v("stars:invalid-data","Failed to create stars because star catalogue data is invalid");k=b});a.promise.catch(b=>{E.isAbortError(b)||D.getLogger(this).error(b)}).then(()=>{this.destroyed||(this.requestRender(),this.notifyChange("updating"))}); return a}};l.__decorate([m.property({constructOnly:!0})],g.Stars.prototype,"view",void 0);l.__decorate([m.property({constructOnly:!0})],g.Stars.prototype,"requestRender",void 0);l.__decorate([m.property({readOnly:!0})],g.Stars.prototype,"updating",null);l.__decorate([m.property()],g.Stars.prototype,"_loadDataTask",void 0);l.__decorate([m.property()],g.Stars.prototype,"_updatingTracking",void 0);g.Stars=l.__decorate([G.subclass("esri.views.3d.environment.Stars")],g.Stars);const P="9bb2ff;9eb5ff;aabfff;bbccff;ccd8ff ;dae2ff;e4e9ff;eeefff;f8f6ff;fff9fb;fff5ef;fff1e5;ffeddb;ffe9d2;ffe6ca;ffe3c3;ffe0bb;ffddb4;ffdaad;ffd6a5;ffd29c;ffcc8f;ffc178;ffa94b;ff7b00".split(";"), R=w.fromValues(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),Q=w.fromValues(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),z=J.newLayout().vec3f(t.VertexAttribute.POSITION).vec4u8(t.VertexAttribute.COLOR).f32(t.VertexAttribute.SIZE);let k=null;Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});