@arcgis/core 4.34.0-next.72 → 4.34.0-next.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/11acefc48c0354e675df.js +1 -0
- package/assets/esri/core/workers/chunks/433c4dc666a6b2c99063.js +353 -0
- package/assets/esri/core/workers/chunks/{1f51c94d392826fdbdf4.js → 8ce653c3c5dde10ccbcf.js} +46 -46
- package/assets/esri/core/workers/chunks/8d91e2d185be4a4e8598.js +1 -0
- package/assets/esri/core/workers/chunks/{bcc233a86e01ff1eac16.js → ae7b86bd08a44e26b339.js} +1 -1
- package/assets/esri/core/workers/chunks/be9edd9791a00cab9c2b.js +1 -0
- package/assets/esri/core/workers/chunks/e8d25d4ca9b335883f34.js +1 -0
- package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
- package/chunks/Fog.glsl.js +5 -10
- package/chunks/GlowComposition.glsl.js +4 -4
- package/chunks/Terrain.glsl.js +29 -43
- package/chunks/boundedPlane.js +1 -1
- package/config.js +1 -1
- package/geometry/support/boundedPlane.js +1 -1
- package/interfaces.d.ts +26 -3
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/support/gaussianSplatUtils.js +1 -1
- package/package.json +3 -3
- package/support/basemapDefinitions.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/flow/FlowDisplayData.js +1 -1
- package/views/2d/engine/flow/FlowStrategy.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/flow/utils.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/Slice/SliceController.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/environment/Fog.glsl.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
- package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
- package/views/3d/interactive/support/viewUtils.js +1 -1
- package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/state/ScreenSizePerspective.js +5 -0
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/SharedSymbolResources.js +1 -1
- package/views/3d/support/ViewSlice.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/flow/FlowWorker.js +1 -1
- package/views/3d/support/flow/geometryUtils.js +1 -1
- package/views/3d/support/geometryUtils/ray.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +4 -4
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/raymarching/RayDistanceFalloff.glsl.js +10 -0
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/SliceHelper.js +1 -1
- package/views/3d/webgl-engine/lib/screenSizePerspectiveUtils.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +28 -10
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/support/tooltipUtils.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
- package/views/support/GroundViewElevationSampler.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/VisibleElements.js +1 -1
- package/widgets/Sketch/support/OperationHandle.js +1 -1
- package/widgets/Sketch/support/sketchUtils.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/16cfbe7bedf75d3a86e5.js +0 -1
- package/assets/esri/core/workers/chunks/226833d408eb1225e168.js +0 -1
- package/assets/esri/core/workers/chunks/cf69f6afeaf1229e032c.js +0 -1
- package/assets/esri/core/workers/chunks/e21eeb4e78a46fb7e32e.js +0 -1
- package/assets/esri/core/workers/chunks/f87a6b32292c1464b7b7.js +0 -353
- package/views/3d/webgl-engine/materials/ScaleInfo.js +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2883],{1843:(e,t,r)=>{r.d(t,{BP:()=>u,l5:()=>h});var i=r(20498),n=r(13030),o=r(90239),a=r(4431),s=r(620),l=r(85079);class c{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new c(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get usedMemory(){return this.byteLength}dispose(){}}class d{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:f(e[1].constructor)})))}freeze(){return this}get locations(){return(0,l.Xk)((0,a.U)(this))}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,s.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new c(this,e)}createView(e){return new c(this,e)}clone(){const e=new d;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function u(){return new d}class h{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:m(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const p=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function m(e){return`${e.ElementType}_${e.ElementCount}`}function f(e){return g.get(e)}const g=new Map;p.forEach(e=>g.set(m(e),e))},2495:(e,t,r)=>{r.d(t,{$U:()=>Ee,fs:()=>Ie,ty:()=>Re});var i=r(38954),n=r(51850),o=r(49255),a=r(25634),s=r(11725),l=r(33524),c=r(70328),d=r(620);class u{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const h=(0,c.vt)();function p(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(S,n,r),l=(e,t,r)=>{a(e,r,t)},c=new u(!1,t.options.normalRequired);if(e.boundingInfo){(0,d.vA)(0===e.type);const i=t.tolerance;f(e.boundingInfo,r,s,i,o,c,l)}else{const t=e.attributes.get("position"),n=t.indices;!function(e,t,r,n,o,a,s,l,c,d){const u=t,h=E,p=Math.abs(u[0]),m=Math.abs(u[1]),f=Math.abs(u[2]),g=p>=m?p>=f?0:2:m>=f?1:2,w=g,y=u[w]<0?2:1,M=(g+y)%3,T=(g+(3-y))%3,C=u[M]/u[w],S=u[T]/u[w],A=1/u[w],I=v,R=_,F=x,{normalRequired:O}=c;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.i)(h[0],a[n+0],a[n+1],a[n+2]);const c=s*o[r+1];(0,i.i)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*o[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.c)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(I,h[0],e),(0,i.a)(R,h[1],e),(0,i.a)(F,h[2],e);const p=I[M]-C*I[w],m=I[T]-S*I[w],f=R[M]-C*R[w],g=R[T]-S*R[w],v=F[M]-C*F[w],_=F[T]-S*F[w],x=v*g-_*f,y=p*_-m*v,E=f*m-g*p;if((x<0||y<0||E<0)&&(x>0||y>0||E>0))continue;const P=x+y+E;if(0===P)continue;const D=x*(A*I[w])+y*(A*R[w])+E*(A*F[w]);if(D*Math.sign(P)<0)continue;const N=D/P;N>=0&&d(N,t,O?b(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,c,l)}}const m=(0,n.vt)();function f(e,t,r,n,o,a,s){if(null==e)return;const l=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,m);if((0,c.Ne)(h,e.bbMin),(0,c.vI)(h,e.bbMax),null!=o&&o.applyToAabb(h),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(h,t,l,n)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>T){const i=e.getChildren();if(void 0!==i){for(const e of i)f(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,l,c,d){const u=e[0],h=e[1],p=e[2],m=t[0],f=t[1],v=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let c=o[i],x=o[i+1],b=o[i+2];const y=a*n[r+1];let M=o[y],T=o[y+1],S=o[y+2];const E=a*n[r+2];let A=o[E],I=o[E+1],R=o[E+2];null!=l&&([c,x,b]=l.applyToVertex(c,x,b,e),[M,T,S]=l.applyToVertex(M,T,S,e),[A,I,R]=l.applyToVertex(A,I,R,e));const F=M-c,O=T-x,P=S-b,D=A-c,N=I-x,H=R-b,L=f*H-N*v,z=v*D-H*m,B=m*N-D*f,G=F*L+O*z+P*B;if(Math.abs(G)<=C)continue;const U=u-c,V=h-x,j=p-b,W=U*L+V*z+j*B;if(G>0){if(W<0||W>G)continue}else if(W>0||W<G)continue;const k=V*P-O*j,$=j*F-P*U,q=U*O-F*V,Z=m*k+f*$+v*q;if(G>0){if(Z<0||W+Z>G)continue}else if(Z>0||W+Z<G)continue;const Y=(D*k+N*$+H*q)/G;Y>=0&&d(Y,t,_?w(F,O,P,D,N,H,g):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,o,a,s)}}const g=(0,n.vt)();const v=(0,n.vt)(),_=(0,n.vt)(),x=(0,n.vt)();function w(e,t,r,n,o,a,s){return(0,i.i)(y,e,t,r),(0,i.i)(M,n,o,a),(0,i.h)(s,y,M),(0,i.n)(s,s),s}function b(e){return(0,i.a)(y,e[1],e[0]),(0,i.a)(M,e[2],e[0]),(0,i.h)(g,y,M),(0,i.n)(g,g),g}const y=(0,n.vt)(),M=(0,n.vt)(),T=1e3,C=1e-7,S=(0,n.vt)(),E=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var A=r(16396),I=r(13030),R=r(59907);class F{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return(0,R.vJ)(r,i,this.layout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const l=this.layout.createView(e).getField("position",I.xs);if(null==l)return;const c=(0,i.a)(O,a,o),d=l.count/3,u=n.options.normalRequired;!function(e,t,r,i,n,o,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],p=t[2];for(let e=0;e<i;++e){const t=3*e,r=t+1,i=t+2,m=o*t,f=n[m],v=n[m+1],_=n[m+2],x=o*r,b=o*i,y=n[x]-f,M=n[x+1]-v,T=n[x+2]-_,S=n[b]-f,E=n[b+1]-v,A=n[b+2]-_,I=h*A-E*p,R=p*S-A*u,F=u*E-S*h,O=y*I+M*R+T*F;if(Math.abs(O)<=C)continue;const P=l-f,D=c-v,N=d-_,H=P*I+D*R+N*F;if(O>0){if(H<0||H>O)continue}else if(H>0||H<O)continue;const L=D*T-M*N,z=N*y-T*P,B=P*M-y*D,G=u*L+h*z+p*B;if(O>0){if(G<0||H+G>O)continue}else if(G>0||H+G<O)continue;const U=(S*L+E*z+A*B)/O;U>=0&&s(U,e,a?w(y,M,T,S,E,A,g):null)}}(o,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>s(e,r,t))}}const O=(0,n.vt)();var P=r(43616),D=r(91829),N=r(4431),H=r(1843),L=r(72824),z=r(97220),B=r(98958),G=r(16943);const U={mask:255},V={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},j={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var W=r(4576),k=r(44208);r(53966),r(34275),r(94656),r(63907),(0,k.A)("esri-tests-disable-gpu-memory-measurements");var $=r(31635),q=r(65008),Z=r(65529),Y=r(10107),X=r(40608),J=r(77690),K=r(29242),Q=r(58083),ee=r(9093),te=r(32728);class re{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",I.Eq),this.color=e.getField("instanceColor",I.XP),this.olidColor=e.getField("instanceOlidColor",I.XP),this.state=e.getField("state",I.SL),this.lodLevel=e.getField("lodLevel",I.SL)}}let ie=class extends q.A{constructor(e,t){super(e),this.events=new Z.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return oe(ne.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=de,this._buffer=this._layout.createBuffer(this._capacity),this._view=new re(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,d.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,d.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=ae,n=se;t.localTransform.getMat(e,le),t.globalTransform.getMat(e,ce);const o=(0,Q.lw)(ce,ce,le);(0,i.i)(r,o[12],o[13],o[14]),t.modelOrigin.setVec(e,r),(0,J.z0)(n,o),t.model.setMat(e,n);const a=(0,te.wp)(ae,o);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,J.B8)(n,n),(0,J.mg)(n,n),t.modelNormal.setMat(e,n),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,se),r.modelOrigin.getVec(e,ae),t[0]=se[0],t[1]=se[1],t[2]=se[2],t[3]=0,t[4]=se[3],t[5]=se[4],t[6]=se[5],t[7]=0,t[8]=se[6],t[9]=se[7],t[10]=se[8],t[11]=0,t[12]=ae[0],t[13]=ae[1],t[14]=ae[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ae,this,e),t*=Math.max(ae[0],ae[1],ae[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ae,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(ae[0],ae[1],ae[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(de,Math.floor(this._capacity*W.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new re(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,$.Cg)([(0,Y.MZ)({constructOnly:!0})],ie.prototype,"shaderTransformation",void 0),(0,$.Cg)([(0,Y.MZ)()],ie.prototype,"_size",void 0),(0,$.Cg)([(0,Y.MZ)({readOnly:!0})],ie.prototype,"size",null),ie=(0,$.Cg)([(0,X.$)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],ie);const ne=(0,H.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function oe(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,G.E)()&&e.vec4u8("instanceOlidColor"),e}const ae=(0,n.vt)(),se=(0,K.vt)(),le=(0,ee.vt)(),ce=(0,ee.vt)(),de=64,ue=(0,H.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var he=r(74810),pe=r(28491),me=r(90644),fe=r(85079),ge=r(49788);class ve extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=he.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=n.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,n.CN)(.2,.2,.2),this.diffuse=(0,n.CN)(.8,.8,.8),this.externalColor=(0,D.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,n.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=ge.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}L.gy;class _e extends B.w{constructor(e,t,i=new z.$(pe.D,()=>r.e(5141).then(r.bind(r,5141)))){const n=[(0,N.U)(be(t))];t.instanced&&t.instancedDoublePrecision&&n.push((0,N.U)(function(e){return oe(ue.clone(),e)}(t))),super(e,t,i,(0,fe._u)(n))}_makePipeline(e,t){const{oitPass:r,output:i,transparent:n,cullFace:a,customDepthTest:s,hasOccludees:c}=e;return(0,me.Ey)({blending:(0,o.RN)(i)&&n?(0,l.Yf)(r):null,culling:we(e)?(0,me.Xt)(a):null,depthTest:{func:(0,l.K_)(r,xe(s))},depthWrite:(0,l.z5)(e),drawBuffers:(0,B.L)(i,(0,l.m6)(r,i)),colorWrite:me.kn,stencilWrite:c?U:null,stencilTest:c?t?j:V:null,polygonOffset:(0,l.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function xe(e){return 1===e?515:513}function we(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function be(e){const t=(0,H.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,G.E)()&&t.vec4u8("olidColor"),t}var ye=r(51976),Me=r(35256);class Te extends Me.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasGlow=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,$.Cg)([(0,ye.W)({count:4})],Te.prototype,"alphaDiscardMode",void 0),(0,$.Cg)([(0,ye.W)({count:3})],Te.prototype,"doubleSidedMode",void 0),(0,$.Cg)([(0,ye.W)({count:7})],Te.prototype,"pbrMode",void 0),(0,$.Cg)([(0,ye.W)({count:3})],Te.prototype,"cullFace",void 0),(0,$.Cg)([(0,ye.W)({count:3})],Te.prototype,"normalType",void 0),(0,$.Cg)([(0,ye.W)({count:2})],Te.prototype,"customDepthTest",void 0),(0,$.Cg)([(0,ye.W)({count:8})],Te.prototype,"emissionSource",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasVertexColors",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasSymbolColors",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasVerticalOffset",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasColorTexture",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasMetallicRoughnessTexture",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasOcclusionTexture",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasNormalTexture",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasScreenSizePerspective",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasVertexTangents",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasOccludees",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"instanced",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"instancedDoublePrecision",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasModelTransformation",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"offsetBackfaces",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasVVSize",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasVVColor",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"receiveShadows",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"receiveAmbientOcclusion",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"textureAlphaPremultiplied",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"instancedFeatureAttribute",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"instancedColor",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"writeDepth",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"transparent",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"enableOffset",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"terrainDepthTest",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"cullAboveTerrain",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"snowCover",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasGlow",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasColorTextureTransform",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasEmissionTextureTransform",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasNormalTextureTransform",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasOcclusionTextureTransform",void 0),(0,$.Cg)([(0,ye.W)()],Te.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Ce=r(57323);class Se extends _e{constructor(e,t){super(e,t,new z.$(Ce.R,()=>r.e(9933).then(r.bind(r,39933))))}}class Ee extends s.i{constructor(e,t){super(e,Ie),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,o.iq)(e)||(0,o.PJ)(e))&&!this.transparent],[4,e=>((0,o.iq)(e)||(0,o.PJ)(e))&&this.transparent&&this.parameters.writeDepth],[8,e=>((0,o.iq)(e)||(0,o.PJ)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=be(this.parameters),this._configuration=new Te(t.spherical)}isVisibleForOutput(e){return 4!==e&&6!==e&&5!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=ge.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.q)(this.parameters.emissiveBaseColor,n.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?2:a&&"normal"===s?1:a&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,o.RN)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.camera.relativeElevation<l.xt,i.snowCover=t.snowCover>0,i.hasGlow=(0,o.LG)(e),i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,n,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(He,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(De,He);break;case 2:a=(0,i.c)(De,Pe)}let s=0;const l=(0,i.d)(Le,He,e.eye),c=(0,i.l)(l),d=(0,i.g)(l,l,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,i.e)(a,d)),s+=(0,P.kE)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,i.g)(a,a,s),(0,i.o)(Ne,a,r.transform.inverseRotation),n=(0,i.d)(Fe,n,Ne),o=(0,i.d)(Oe,o,Ne)}p(e,r,n,o,(0,A.ou)(r.verticalOffset),a)}createGLMaterial(e){return new Ae(e)}createBufferWriter(){return new F(this._layout)}get transparent(){return Re(this.parameters)}}class Ae extends a.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Se:_e,e)}}class Ie extends ve{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function Re(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=o||null!=a)&&1!==s&&2!==s&&"replace"!==l}const Fe=(0,n.vt)(),Oe=(0,n.vt)(),Pe=(0,n.fA)(0,0,1),De=(0,n.vt)(),Ne=(0,n.vt)(),He=(0,n.vt)(),Le=(0,n.vt)()},4431:(e,t,r)=>{r.d(t,{U:()=>o}),r(44208);var i=r(63907),n=r(74038);function o(e,t=0){const r=e.stride;return Array.from(e.fields.keys()).map(o=>{const a=e.fields.get(o),s=a.constructor.ElementCount,l=function(e){switch(e){case"u8":return i.pe.UNSIGNED_BYTE;case"u16":return i.pe.UNSIGNED_SHORT;case"u32":return i.pe.UNSIGNED_INT;case"i8":return i.pe.BYTE;case"i16":return i.pe.SHORT;case"i32":return i.pe.INT;case"f16":return i.pe.HALF_FLOAT;case"f32":return i.pe.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}(a.constructor.ElementType),c=a.offset,d=a.optional?.glNormalized??!1;return new n._(o,s,l,c,r,d,t)})}},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.g)(h,this.ray.direction,this.distance),(0,o.l)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,o.g)(h,this.ray.direction,this.distance),(0,o.f)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,o.c)(p,this.normal),p[3]=0,(0,s.t)(p,p,this.transformation),(0,o.c)(e,p),(0,o.n)(e,e)}constructor(e){this.intersector=0,this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=0,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,o.c)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??n.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.c)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),p=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>o});var i=r(33094),n=r(31821);function o(e,t){t.snowCover&&(e.uniforms.add(new i.U("snowCover",e=>e.snowCover)).code.add(n.H`float getSnow(vec3 normal, vec3 groundNormal) {
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2883],{1843:(e,t,r)=>{r.d(t,{BP:()=>u,l5:()=>h});var i=r(20498),n=r(13030),o=r(90239),a=r(4431),s=r(620),l=r(85079);class c{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new c(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get usedMemory(){return this.byteLength}dispose(){}}class d{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:f(e[1].constructor)})))}freeze(){return this}get locations(){return(0,l.Xk)((0,a.U)(this))}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,s.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new c(this,e)}createView(e){return new c(this,e)}clone(){const e=new d;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function u(){return new d}class h{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:m(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const p=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function m(e){return`${e.ElementType}_${e.ElementCount}`}function f(e){return g.get(e)}const g=new Map;p.forEach(e=>g.set(m(e),e))},2495:(e,t,r)=>{r.d(t,{$U:()=>Ee,fs:()=>Re,ty:()=>Ie});var i=r(38954),n=r(51850),o=r(49255),a=r(25634),s=r(11725),l=r(33524),c=r(70328),d=r(620);class u{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const h=(0,c.vt)();function p(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(S,n,r),l=(e,t,r)=>{a(e,r,t)},c=new u(!1,t.options.normalRequired);if(e.boundingInfo){(0,d.vA)(0===e.type);const i=t.tolerance;f(e.boundingInfo,r,s,i,o,c,l)}else{const t=e.attributes.get("position"),n=t.indices;!function(e,t,r,n,o,a,s,l,c,d){const u=t,h=E,p=Math.abs(u[0]),m=Math.abs(u[1]),f=Math.abs(u[2]),g=p>=m?p>=f?0:2:m>=f?1:2,w=g,b=u[w]<0?2:1,M=(g+b)%3,T=(g+(3-b))%3,C=u[M]/u[w],S=u[T]/u[w],A=1/u[w],R=v,I=_,F=x,{normalRequired:O}=c;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.i)(h[0],a[n+0],a[n+1],a[n+2]);const c=s*o[r+1];(0,i.i)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*o[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.c)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(R,h[0],e),(0,i.a)(I,h[1],e),(0,i.a)(F,h[2],e);const p=R[M]-C*R[w],m=R[T]-S*R[w],f=I[M]-C*I[w],g=I[T]-S*I[w],v=F[M]-C*F[w],_=F[T]-S*F[w],x=v*g-_*f,b=p*_-m*v,E=f*m-g*p;if((x<0||b<0||E<0)&&(x>0||b>0||E>0))continue;const P=x+b+E;if(0===P)continue;const D=x*(A*R[w])+b*(A*I[w])+E*(A*F[w]);if(D*Math.sign(P)<0)continue;const N=D/P;N>=0&&d(N,t,O?y(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,c,l)}}const m=(0,n.vt)();function f(e,t,r,n,o,a,s){if(null==e)return;const l=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,m);if((0,c.Ne)(h,e.bbMin),(0,c.vI)(h,e.bbMax),null!=o&&o.applyToAabb(h),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(h,t,l,n)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>T){const i=e.getChildren();if(void 0!==i){for(const e of i)f(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,l,c,d){const u=e[0],h=e[1],p=e[2],m=t[0],f=t[1],v=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let c=o[i],x=o[i+1],y=o[i+2];const b=a*n[r+1];let M=o[b],T=o[b+1],S=o[b+2];const E=a*n[r+2];let A=o[E],R=o[E+1],I=o[E+2];null!=l&&([c,x,y]=l.applyToVertex(c,x,y,e),[M,T,S]=l.applyToVertex(M,T,S,e),[A,R,I]=l.applyToVertex(A,R,I,e));const F=M-c,O=T-x,P=S-y,D=A-c,N=R-x,H=I-y,L=f*H-N*v,z=v*D-H*m,B=m*N-D*f,G=F*L+O*z+P*B;if(Math.abs(G)<=C)continue;const U=u-c,V=h-x,j=p-y,W=U*L+V*z+j*B;if(G>0){if(W<0||W>G)continue}else if(W>0||W<G)continue;const k=V*P-O*j,$=j*F-P*U,Z=U*O-F*V,q=m*k+f*$+v*Z;if(G>0){if(q<0||W+q>G)continue}else if(q>0||W+q<G)continue;const Y=(D*k+N*$+H*Z)/G;Y>=0&&d(Y,t,_?w(F,O,P,D,N,H,g):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,o,a,s)}}const g=(0,n.vt)();const v=(0,n.vt)(),_=(0,n.vt)(),x=(0,n.vt)();function w(e,t,r,n,o,a,s){return(0,i.i)(b,e,t,r),(0,i.i)(M,n,o,a),(0,i.h)(s,b,M),(0,i.n)(s,s),s}function y(e){return(0,i.a)(b,e[1],e[0]),(0,i.a)(M,e[2],e[0]),(0,i.h)(g,b,M),(0,i.n)(g,g),g}const b=(0,n.vt)(),M=(0,n.vt)(),T=1e3,C=1e-7,S=(0,n.vt)(),E=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var A=r(16396),R=r(13030),I=r(59907);class F{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return(0,I.vJ)(r,i,this.layout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const l=this.layout.createView(e).getField("position",R.xs);if(null==l)return;const c=(0,i.a)(O,a,o),d=l.count/3,u=n.options.normalRequired;!function(e,t,r,i,n,o,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],p=t[2];for(let e=0;e<i;++e){const t=3*e,r=t+1,i=t+2,m=o*t,f=n[m],v=n[m+1],_=n[m+2],x=o*r,y=o*i,b=n[x]-f,M=n[x+1]-v,T=n[x+2]-_,S=n[y]-f,E=n[y+1]-v,A=n[y+2]-_,R=h*A-E*p,I=p*S-A*u,F=u*E-S*h,O=b*R+M*I+T*F;if(Math.abs(O)<=C)continue;const P=l-f,D=c-v,N=d-_,H=P*R+D*I+N*F;if(O>0){if(H<0||H>O)continue}else if(H>0||H<O)continue;const L=D*T-M*N,z=N*b-T*P,B=P*M-b*D,G=u*L+h*z+p*B;if(O>0){if(G<0||H+G>O)continue}else if(G>0||H+G<O)continue;const U=(S*L+E*z+A*B)/O;U>=0&&s(U,e,a?w(b,M,T,S,E,A,g):null)}}(o,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>s(e,r,t))}}const O=(0,n.vt)();var P=r(43616),D=r(91829),N=r(4431),H=r(1843),L=r(72824),z=r(97220),B=r(98958),G=r(16943);const U={mask:255},V={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},j={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var W=r(4576),k=r(44208);r(53966),r(34275),r(94656),r(63907),(0,k.A)("esri-tests-disable-gpu-memory-measurements");var $=r(31635),Z=r(65008),q=r(65529),Y=r(10107),X=r(40608),J=r(77690),K=r(29242),Q=r(58083),ee=r(9093),te=r(32728);class re{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",R.Eq),this.color=e.getField("instanceColor",R.XP),this.olidColor=e.getField("instanceOlidColor",R.XP),this.state=e.getField("state",R.SL),this.lodLevel=e.getField("lodLevel",R.SL)}}let ie=class extends Z.A{constructor(e,t){super(e),this.events=new q.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return oe(ne.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=de,this._buffer=this._layout.createBuffer(this._capacity),this._view=new re(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,d.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,d.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=ae,n=se;t.localTransform.getMat(e,le),t.globalTransform.getMat(e,ce);const o=(0,Q.lw)(ce,ce,le);(0,i.i)(r,o[12],o[13],o[14]),t.modelOrigin.setVec(e,r),(0,J.z0)(n,o),t.model.setMat(e,n);const a=(0,te.wp)(ae,o);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,J.B8)(n,n),(0,J.mg)(n,n),t.modelNormal.setMat(e,n),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,se),r.modelOrigin.getVec(e,ae),t[0]=se[0],t[1]=se[1],t[2]=se[2],t[3]=0,t[4]=se[3],t[5]=se[4],t[6]=se[5],t[7]=0,t[8]=se[6],t[9]=se[7],t[10]=se[8],t[11]=0,t[12]=ae[0],t[13]=ae[1],t[14]=ae[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ae,this,e),t*=Math.max(ae[0],ae[1],ae[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ae,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(ae[0],ae[1],ae[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(de,Math.floor(this._capacity*W.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new re(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,$.Cg)([(0,Y.MZ)({constructOnly:!0})],ie.prototype,"shaderTransformation",void 0),(0,$.Cg)([(0,Y.MZ)()],ie.prototype,"_size",void 0),(0,$.Cg)([(0,Y.MZ)({readOnly:!0})],ie.prototype,"size",null),ie=(0,$.Cg)([(0,X.$)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],ie);const ne=(0,H.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function oe(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,G.E)()&&e.vec4u8("instanceOlidColor"),e}const ae=(0,n.vt)(),se=(0,K.vt)(),le=(0,ee.vt)(),ce=(0,ee.vt)(),de=64,ue=(0,H.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var he=r(74810),pe=r(28491),me=r(90644),fe=r(85079),ge=r(49788);class ve extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=he.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=n.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,n.CN)(.2,.2,.2),this.diffuse=(0,n.CN)(.8,.8,.8),this.externalColor=(0,D.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,n.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=ge.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}L.gy;class _e extends B.w{constructor(e,t,i=new z.$(pe.D,()=>r.e(5141).then(r.bind(r,5141)))){const n=[(0,N.U)(ye(t))];t.instanced&&t.instancedDoublePrecision&&n.push((0,N.U)(function(e){return oe(ue.clone(),e)}(t))),super(e,t,i,(0,fe._u)(n))}_makePipeline(e,t){const{oitPass:r,output:i,transparent:n,cullFace:a,customDepthTest:s,hasOccludees:c}=e;return(0,me.Ey)({blending:(0,o.RN)(i)&&n?(0,l.Yf)(r):null,culling:we(e)?(0,me.Xt)(a):null,depthTest:{func:(0,l.K_)(r,xe(s))},depthWrite:(0,l.z5)(e),drawBuffers:(0,B.L)(i,(0,l.m6)(r,i)),colorWrite:me.kn,stencilWrite:c?U:null,stencilTest:c?t?j:V:null,polygonOffset:(0,l.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function xe(e){return 1===e?515:513}function we(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function ye(e){const t=(0,H.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,G.E)()&&t.vec4u8("olidColor"),t}var be=r(51976),Me=r(35256);class Te extends Me.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasGlow=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,$.Cg)([(0,be.W)({count:4})],Te.prototype,"alphaDiscardMode",void 0),(0,$.Cg)([(0,be.W)({count:3})],Te.prototype,"doubleSidedMode",void 0),(0,$.Cg)([(0,be.W)({count:7})],Te.prototype,"pbrMode",void 0),(0,$.Cg)([(0,be.W)({count:3})],Te.prototype,"cullFace",void 0),(0,$.Cg)([(0,be.W)({count:3})],Te.prototype,"normalType",void 0),(0,$.Cg)([(0,be.W)({count:2})],Te.prototype,"customDepthTest",void 0),(0,$.Cg)([(0,be.W)({count:8})],Te.prototype,"emissionSource",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasVertexColors",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasSymbolColors",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasVerticalOffset",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasColorTexture",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasMetallicRoughnessTexture",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasOcclusionTexture",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasNormalTexture",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasScreenSizePerspective",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasVertexTangents",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasOccludees",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"instanced",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"instancedDoublePrecision",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasModelTransformation",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"offsetBackfaces",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasVVSize",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasVVColor",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"receiveShadows",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"receiveAmbientOcclusion",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"textureAlphaPremultiplied",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"instancedFeatureAttribute",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"instancedColor",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"writeDepth",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"transparent",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"enableOffset",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"terrainDepthTest",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"cullAboveTerrain",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"snowCover",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasGlow",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasColorTextureTransform",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasEmissionTextureTransform",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasNormalTextureTransform",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasOcclusionTextureTransform",void 0),(0,$.Cg)([(0,be.W)()],Te.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Ce=r(57323);class Se extends _e{constructor(e,t){super(e,t,new z.$(Ce.R,()=>r.e(9933).then(r.bind(r,39933))))}}class Ee extends s.i{constructor(e,t){super(e,Re),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,o.iq)(e)||(0,o.PJ)(e))&&!this.transparent],[4,e=>((0,o.iq)(e)||(0,o.PJ)(e))&&this.transparent&&this.parameters.writeDepth],[8,e=>((0,o.iq)(e)||(0,o.PJ)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=ye(this.parameters),this._configuration=new Te(t.spherical)}isVisibleForOutput(e){return 4!==e&&6!==e&&5!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=ge.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.q)(this.parameters.emissiveBaseColor,n.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?2:a&&"normal"===s?1:a&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,o.RN)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.camera.relativeElevation<l.xt,i.snowCover=t.snowCover>0,i.hasGlow=(0,o.LG)(e),i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,n,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(He,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(De,He);break;case 2:a=(0,i.c)(De,Pe)}let s=0;const l=(0,i.d)(Le,He,e.eye),c=(0,i.l)(l),d=(0,i.g)(l,l,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,i.e)(a,d)),s+=(0,P.kE)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective,null),(0,i.g)(a,a,s),(0,i.o)(Ne,a,r.transform.inverseRotation),n=(0,i.d)(Fe,n,Ne),o=(0,i.d)(Oe,o,Ne)}p(e,r,n,o,(0,A.ou)(r.verticalOffset),a)}createGLMaterial(e){return new Ae(e)}createBufferWriter(){return new F(this._layout)}get transparent(){return Ie(this.parameters)}}class Ae extends a.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Se:_e,e)}}class Re extends ve{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function Ie(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=o||null!=a)&&1!==s&&2!==s&&"replace"!==l}const Fe=(0,n.vt)(),Oe=(0,n.vt)(),Pe=(0,n.fA)(0,0,1),De=(0,n.vt)(),Ne=(0,n.vt)(),He=(0,n.vt)(),Le=(0,n.vt)()},4431:(e,t,r)=>{r.d(t,{U:()=>o}),r(44208);var i=r(63907),n=r(74038);function o(e,t=0){const r=e.stride;return Array.from(e.fields.keys()).map(o=>{const a=e.fields.get(o),s=a.constructor.ElementCount,l=function(e){switch(e){case"u8":return i.pe.UNSIGNED_BYTE;case"u16":return i.pe.UNSIGNED_SHORT;case"u32":return i.pe.UNSIGNED_INT;case"i8":return i.pe.BYTE;case"i16":return i.pe.SHORT;case"i32":return i.pe.INT;case"f16":return i.pe.HALF_FLOAT;case"f32":return i.pe.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}(a.constructor.ElementType),c=a.offset,d=a.optional?.glNormalized??!1;return new n._(o,s,l,c,r,d,t)})}},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.g)(h,this.ray.direction,this.distance),(0,o.l)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,o.g)(h,this.ray.direction,this.distance),(0,o.f)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,o.c)(p,this.normal),p[3]=0,(0,s.t)(p,p,this.transformation),(0,o.c)(e,p),(0,o.n)(e,e)}constructor(e){this.intersector=0,this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=0,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,o.c)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??n.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.c)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),p=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>o});var i=r(33094),n=r(31821);function o(e,t){t.snowCover&&(e.uniforms.add(new i.U("snowCover",e=>e.snowCover)).code.add(n.H`float getSnow(vec3 normal, vec3 groundNormal) {
|
|
2
2
|
return smoothstep(0.5, 0.55, dot(normal, groundNormal)) * snowCover;
|
|
3
3
|
}
|
|
4
4
|
float getRealisticTreeSnow(vec3 faceNormal, vec3 shadingNormal, vec3 groundNormal) {
|
|
@@ -93,7 +93,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
93
93
|
A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2;
|
|
94
94
|
|
|
95
95
|
fragOcclusion = A;
|
|
96
|
-
`),e}function v(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const _=(0,n.vt)(),x=Object.freeze(Object.defineProperty({__proto__:null,build:g,getRadius:v},Symbol.toStringTag,{value:"Module"}))},16396:(e,t,r)=>{r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(38954),n=r(51850),o=r(97937),a=r(57005);const s=new class{constructor(e=0){this.offset=e,this.sphere=(0,o.c)(),this.tmpVertex=(0,n.vt)()}applyToVertex(e,t,r){const n=this.objectTransform.transform,o=(0,i.i)(c,e,t,r),a=(0,i.t)(o,o,n),s=this.offset/(0,i.l)(a);(0,i.b)(a,a,a,s);const l=this.objectTransform.inverse;return(0,i.t)(this.tmpVertex,a,l),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.l)(e);(0,i.b)(e,e,e,r);const n=this.offset/(0,i.l)(t);(0,i.b)(t,t,t,n)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,o.a)(e),r=(0,i.l)(t),n=this.offset/r,a=(0,i.b)(m,t,t,n),s=e[3]+e[3]*this.offset/r;return(0,o.e)(this.sphere,a,s),this.sphere}};function l(e){return null!=e?(s.offset=e,s):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=(0,o.c)(),this._tmpObb=new a.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.l)(e)}applyToVertex(e,t,r){const n=(0,i.i)(c,e,t,r),o=(0,i.i)(d,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,i.l)(o);return(0,i.b)(this._tmpVertex,n,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(n),u=Math.abs(o),h=Math.abs(a),p=Math.abs(s),m=.5*(1+Math.sign(r*o))*Math.min(l,u),f=.5*(1+Math.sign(i*a))*Math.min(c,h),g=.5*(1+Math.sign(n*s))*Math.min(d,p),v=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,p),w=Math.sqrt(m*m+f*f+g*g),
|
|
96
|
+
`),e}function v(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const _=(0,n.vt)(),x=Object.freeze(Object.defineProperty({__proto__:null,build:g,getRadius:v},Symbol.toStringTag,{value:"Module"}))},16396:(e,t,r)=>{r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(38954),n=r(51850),o=r(97937),a=r(57005);const s=new class{constructor(e=0){this.offset=e,this.sphere=(0,o.c)(),this.tmpVertex=(0,n.vt)()}applyToVertex(e,t,r){const n=this.objectTransform.transform,o=(0,i.i)(c,e,t,r),a=(0,i.t)(o,o,n),s=this.offset/(0,i.l)(a);(0,i.b)(a,a,a,s);const l=this.objectTransform.inverse;return(0,i.t)(this.tmpVertex,a,l),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.l)(e);(0,i.b)(e,e,e,r);const n=this.offset/(0,i.l)(t);(0,i.b)(t,t,t,n)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,o.a)(e),r=(0,i.l)(t),n=this.offset/r,a=(0,i.b)(m,t,t,n),s=e[3]+e[3]*this.offset/r;return(0,o.e)(this.sphere,a,s),this.sphere}};function l(e){return null!=e?(s.offset=e,s):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,n.vt)(),this._tmpMbs=(0,o.c)(),this._tmpObb=new a.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.l)(e)}applyToVertex(e,t,r){const n=(0,i.i)(c,e,t,r),o=(0,i.i)(d,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,i.l)(o);return(0,i.b)(this._tmpVertex,n,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(n),u=Math.abs(o),h=Math.abs(a),p=Math.abs(s),m=.5*(1+Math.sign(r*o))*Math.min(l,u),f=.5*(1+Math.sign(i*a))*Math.min(c,h),g=.5*(1+Math.sign(n*s))*Math.min(d,p),v=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,p),w=Math.sqrt(m*m+f*f+g*g),y=Math.sign(l+r),b=Math.sign(c+i),M=Math.sign(d+n),T=Math.sign(u+o),C=Math.sign(h+a),S=Math.sign(p+s),E=this._totalOffset;if(w<E)return e[0]-=(1-y)*E,e[1]-=(1-b)*E,e[2]-=(1-M)*E,e[3]+=T*E,e[4]+=C*E,e[5]+=S*E,e;const A=E/Math.sqrt(v*v+_*_+x*x),R=E/w,I=R-A,F=-I;return e[0]+=r*(y*F+R),e[1]+=i*(b*F+R),e[2]+=n*(M*F+R),e[3]+=o*(T*I+A),e[4]+=a*(C*I+A),e[5]+=s*(S*I+A),e}applyToMbs(e){const t=(0,o.a)(e),r=(0,i.l)(t),n=this._totalOffset/r,a=(0,i.b)(m,t,t,n),s=e[3]+e[3]*this._totalOffset/r;return(0,o.e)(this._tmpMbs,a,s),this._tmpMbs}applyToObb(e){return(0,a.gm)(e,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,n.vt)()}applyToVertex(e,t,r){const n=(0,i.i)(c,e,t,r),o=(0,i.f)(d,n,this.localOrigin),a=this.offset/(0,i.l)(o);return(0,i.b)(this.tmpVertex,n,o,a),this.tmpVertex}applyToAabb(e){const t=u,r=h,i=p;for(let n=0;n<3;++n)t[n]=e[0+n]+this.localOrigin[n],r[n]=e[3+n]+this.localOrigin[n],i[n]=t[n];const n=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=n[t],e[t+3]=n[t];const o=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let n=0;n<3;++n)i[n]=e&1<<n?r[n]:t[n];o(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0===(a&e)){for(let n=0;n<3;++n)i[n]=a&1<<n?0:e&1<<n?t[n]:r[n];o(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const c=(0,n.vt)(),d=(0,n.vt)(),u=(0,n.vt)(),h=(0,n.vt)(),p=(0,n.vt)(),m=(0,n.vt)()},16943:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(44208);function n(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},22393:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(31821);function n(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
|
|
97
97
|
return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
|
|
98
98
|
}`),e.code.add(i.H`float integratedRadiance(float cosTheta2, float roughness) {
|
|
99
99
|
return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
|
|
@@ -193,7 +193,7 @@ return dpDummy * hiD + loD;
|
|
|
193
193
|
// multiply or tint (or something invalid)
|
|
194
194
|
return allMixed;
|
|
195
195
|
}
|
|
196
|
-
`)}},28491:(e,t,r)=>{r.d(t,{D:()=>V,b:()=>U});var i=r(32680),n=r(49255),o=r(76591),a=r(76597),s=r(24321),l=r(60864),c=r(43519),d=r(96336),u=r(71955),h=r(53466),p=r(92700),m=r(72824),f=r(35640),g=r(40261),v=r(77695),_=r(65836),x=r(89390),w=r(98619),
|
|
196
|
+
`)}},28491:(e,t,r)=>{r.d(t,{D:()=>V,b:()=>U});var i=r(32680),n=r(49255),o=r(76591),a=r(76597),s=r(24321),l=r(60864),c=r(43519),d=r(96336),u=r(71955),h=r(53466),p=r(92700),m=r(72824),f=r(35640),g=r(40261),v=r(77695),_=r(65836),x=r(89390),w=r(98619),y=r(62602),b=r(22393),M=r(59469),T=r(32482),C=r(96598),S=r(51406),E=r(42398),A=r(58614),R=r(27950),I=r(25178),F=r(33079),O=r(71988),P=r(20304),D=r(31821),N=r(63761),H=r(10906),L=r(43616),z=r(60517),B=r(14113),G=r(49788);function U(e){const t=new B.N5,{attributes:r,vertex:U,fragment:V,varyings:j}=t,{output:W,normalType:k,offsetBackfaces:$,spherical:Z,snowCover:q,pbrMode:Y,textureAlphaPremultiplied:X,instancedDoublePrecision:J,hasVertexColors:K,hasVertexTangents:Q,hasColorTexture:ee,hasNormalTexture:te,hasNormalTextureTransform:re,hasColorTextureTransform:ie,hasGlow:ne}=e;if((0,I.NB)(U,e),r.add("position","vec3"),j.add("vpos","vec3",{invariant:!0}),t.include(E.A,e),t.include(l.B,e),t.include(f.Ge,e),t.include(S.q2,e),!(0,n.RN)(W))return t.include(g.E,e),t;t.include(S.Sx,e),t.include(S.MU,e),t.include(S.O1,e),t.include(S.QM,e),(0,I.yu)(U,e),t.include(d.Y,e),t.include(a.d);const oe=0===k||1===k;return oe&&$&&t.include(i.M),t.include(v.W,e),t.include(m.Mh,e),t.include(s.v,e),j.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(u.K,e),t.include(p.c,e),U.uniforms.add(new O.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),j.add("vcolorExt","vec4"),t.include(C.Z,e),U.include(c.WD),U.include(c.oF),t.include(J?T.G:T.Bz,e),U.main.add(D.H`
|
|
197
197
|
forwardNormalizedVertexColor();
|
|
198
198
|
|
|
199
199
|
MaskedColor maskedColor =
|
|
@@ -223,7 +223,7 @@ return dpDummy * hiD + loD;
|
|
|
223
223
|
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
224
224
|
}
|
|
225
225
|
forwardLinearDepthToReadShadowMap();
|
|
226
|
-
`),t.include(x.kA,e),V.include(_.n,e),t.include(A.S,e),V.include(o.HQ,e),t.include(z.z,e),(0,
|
|
226
|
+
`),t.include(x.kA,e),V.include(_.n,e),t.include(A.S,e),V.include(o.HQ,e),t.include(z.z,e),(0,I.yu)(V,e),V.uniforms.add(U.uniforms.get("localOrigin"),new F.t("ambient",e=>e.ambient),new F.t("diffuse",e=>e.diffuse),new P.m("opacity",e=>e.opacity),new P.m("layerOpacity",e=>e.layerOpacity)),ee&&V.uniforms.add(new N.N("tex",e=>e.texture)),t.include(M._,e),V.include(b.c,e),V.include(R.N),t.include(y.r,e),V.include(H.b,e),(0,x.a8)(V),(0,x.eU)(V),(0,w.O4)(V),V.main.add(D.H`
|
|
227
227
|
discardBySlice(vpos);
|
|
228
228
|
discardByTerrainDepth();
|
|
229
229
|
${ee?D.H`
|
|
@@ -246,9 +246,9 @@ return dpDummy * hiD + loD;
|
|
|
246
246
|
float opacity_ = layerOpacity * mixExternalOpacity(${(0,D.If)(K,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
|
|
247
247
|
|
|
248
248
|
${te?`mat3 tangentSpace = computeTangentSpace(${Q?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${re?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
|
|
249
|
-
vec3 normalGround = ${
|
|
249
|
+
vec3 normalGround = ${Z?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
|
|
250
250
|
|
|
251
|
-
${(0,D.If)(
|
|
251
|
+
${(0,D.If)(q,D.H`
|
|
252
252
|
float snow = getSnow(normal, normalGround);
|
|
253
253
|
albedo = mix(albedo, vec3(1), snow);
|
|
254
254
|
shadingNormal = mix(shadingNormal, normal, snow);
|
|
@@ -259,10 +259,10 @@ return dpDummy * hiD + loD;
|
|
|
259
259
|
${1===Y||2===Y?D.H`
|
|
260
260
|
float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
261
261
|
vec4 emission = ${ne?"vec4(0.0)":"getEmissions(albedo)"};
|
|
262
|
-
${(0,D.If)(
|
|
262
|
+
${(0,D.If)(q,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}
|
|
263
263
|
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:D.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
264
264
|
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
265
|
-
outputColorHighlightOID(finalColor, vpos, albedo ${(0,D.If)(
|
|
265
|
+
outputColorHighlightOID(finalColor, vpos, albedo ${(0,D.If)(q,", snow")});
|
|
266
266
|
`),t}const V=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(15142),n=r(38954),o=r(51850),a=r(620);class s{get center(){return(0,o.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,o.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,o.fA)(this._data[7],this._data[8],this._data[9])}constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:c}=r;(0,a.vA)(c.length%this._numIndexPerPrimitive===0),(0,a.vA)(c.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*c[this._numIndexPerPrimitive*e[0]];l.clear(),l.push(u);const h=(0,o.fA)(i[u],i[u+1],i[u+2]),p=(0,o.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*c[r+e],l.push(u);let t=i[u];h[0]=Math.min(t,h[0]),p[0]=Math.max(t,p[0]),t=i[u+1],h[1]=Math.min(t,h[1]),p[1]=Math.max(t,p[1]),t=i[u+2],h[2]=Math.min(t,h[2]),p[2]=Math.max(t,p[2])}}for(let e=0;e<3;++e)this._data[4+e]=h[e],this._data[7+e]=p[e];const m=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5);let f=.5*Math.max(Math.max(p[0]-h[0],p[1]-h[1]),p[2]-h[2]),g=f*f;for(let e=0;e<l.length;++e){u=l.at(e);const t=i[u]-m[0],r=i[u+1]-m[1],n=i[u+2]-m[2],o=t*t+r*r+n*n;if(o<=g)continue;const a=Math.sqrt(o),s=.5*(a-f);f+=s,g=f*f;const c=s/a;m[0]+=t*c,m[1]+=r*c,m[2]+=n*c}this._data[3]=f;for(let e=0;e<3;++e)this._data[0+e]=m[e];l.clear()}getChildren(){if(this._children||(0,n.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:l,indices:c}=this.position;for(let n=0;n<t;++n){let t=0;const o=this._numIndexPerPrimitive*this.primitiveIndices[n];let s=l*c[o],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=l*c[o+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[n]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){l.prune()}}const l=new i.A({deallocator:null})},32482:(e,t,r)=>{r.d(t,{Bz:()=>w,G:()=>x}),r(51850);var i=r(46686),n=r(49255),o=r(31821);function a(e,t){const r=(0,n.RN)(t.output)&&t.receiveShadows;r&&(0,i.o)(e,!0),e.vertex.code.add(o.H`
|
|
267
267
|
void forwardLinearDepthToReadShadowMap() { ${(0,o.If)(r,"forwardLinearDepth(gl_Position.w);")} }
|
|
268
268
|
`)}var s=r(14314),l=r(35818),c=r(74333);class d extends c.n{constructor(e,t,r,i){super(e,"mat4",2,(r,n,o,a)=>r.setUniformMatrices4fv(e,t(n,o,a),i),r)}}class u extends c.n{constructor(e,t,r,i){super(e,"mat4",1,(r,n,o)=>r.setUniformMatrices4fv(e,t(n,o),i),r)}}var h=r(65786);function p(e){e.fragment.uniforms.add(new u("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),f(e)}function m(e){e.fragment.uniforms.add(new d("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),f(e)}function f(e){const{fragment:t}=e;t.uniforms.add(new s.I("cascadeDistances",e=>e.shadowMap.cascadeDistances),new l.W("numCascades",e=>e.shadowMap.numCascades)),t.code.add(o.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
|
|
@@ -289,11 +289,11 @@ vec2 uvShadow = cascadeCoordinates(i, shadowMapSize, lvpos);
|
|
|
289
289
|
return vec3(uvShadow, lvpos.z);
|
|
290
290
|
}`)}function g(e){e.fragment.code.add(o.H`float readShadowMapUVZ(vec3 uvzShadow, sampler2DShadow _shadowMap) {
|
|
291
291
|
return texture(_shadowMap, uvzShadow);
|
|
292
|
-
}`)}h.Y;var v=r(33094);class _ extends c.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}function x(e,t){t.receiveShadows&&e.include(p),
|
|
292
|
+
}`)}h.Y;var v=r(33094);class _ extends c.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}function x(e,t){t.receiveShadows&&e.include(p),y(e,t)}function w(e,t){t.receiveShadows&&e.include(m),y(e,t)}function y(e,t){e.fragment.uniforms.add(new v.U("lightingGlobalFactor",e=>e.lighting.globalFactor));const{receiveShadows:r,spherical:i}=t;e.include(a,t),r&&b(e),e.fragment.code.add(o.H`
|
|
293
293
|
float readShadow(float additionalAmbientScale, vec3 vpos) {
|
|
294
294
|
return ${r?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,o.If)(i,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
|
|
295
295
|
}
|
|
296
|
-
`)}function
|
|
296
|
+
`)}function b(e){e.include(g),e.fragment.uniforms.add(new _("shadowMap",({shadowMap:e})=>e.depthTexture)).code.add(o.H`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
|
|
297
297
|
vec3 uvzShadow = calculateUVZShadow(_worldPos, _linearDepth, textureSize(shadowMap,0));
|
|
298
298
|
if (uvzShadow.z < 0.0) {
|
|
299
299
|
return 0.0;
|
|
@@ -342,23 +342,23 @@ float fragDepth = _calculateFragDepth(_linearDepth);
|
|
|
342
342
|
gl_FragDepth = fragDepth;
|
|
343
343
|
}`);break;case 8:e.fragment.code.add(d.H`void outputDepth(float _linearDepth){
|
|
344
344
|
gl_FragDepth = _linearDepth;
|
|
345
|
-
}`)}}var h=r(42593),p=r(42398),m=r(58614),f=r(25178),g=r(63761);function v(e,t){const{vertex:r,fragment:v,varyings:_}=e,{hasColorTexture:x,alphaDiscardMode:w}=t,
|
|
345
|
+
}`)}}var h=r(42593),p=r(42398),m=r(58614),f=r(25178),g=r(63761);function v(e,t){const{vertex:r,fragment:v,varyings:_}=e,{hasColorTexture:x,alphaDiscardMode:w}=t,y=x&&1!==w,{output:b,normalType:M,hasColorTextureTransform:T}=t;switch(b){case 2:(0,f.NB)(r,t),e.include(o.d),v.include(n.HQ,t),e.include(l.U,t),y&&v.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
|
|
346
346
|
vpos = subtractOrigin(vpos);
|
|
347
347
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
348
348
|
gl_Position = transformPosition(proj, view, vpos);
|
|
349
349
|
forwardTextureCoordinates();`),e.include(m.S,t),v.main.add(d.H`
|
|
350
350
|
discardBySlice(vpos);
|
|
351
|
-
${(0,d.If)(
|
|
352
|
-
discardOrAdjustAlpha(texColor);`)}`);break;case 4:case 5:case 6:case 7:case 10:(0,f.NB)(r,t),e.include(o.d),e.include(l.U,t),e.include(p.A,t),e.include(u,t),v.include(n.HQ,t),e.include(s.g,t),(0,i.xJ)(e),_.add("depth","float",{invariant:!0}),
|
|
351
|
+
${(0,d.If)(y,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
352
|
+
discardOrAdjustAlpha(texColor);`)}`);break;case 4:case 5:case 6:case 7:case 10:(0,f.NB)(r,t),e.include(o.d),e.include(l.U,t),e.include(p.A,t),e.include(u,t),v.include(n.HQ,t),e.include(s.g,t),(0,i.xJ)(e),_.add("depth","float",{invariant:!0}),y&&v.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
|
|
353
353
|
vpos = subtractOrigin(vpos);
|
|
354
354
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
355
355
|
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
|
|
356
356
|
forwardTextureCoordinates();
|
|
357
357
|
forwardObjectAndLayerIdColor();`),e.include(m.S,t),v.main.add(d.H`
|
|
358
358
|
discardBySlice(vpos);
|
|
359
|
-
${(0,d.If)(
|
|
359
|
+
${(0,d.If)(y,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
360
360
|
discardOrAdjustAlpha(texColor);`)}
|
|
361
|
-
${10===
|
|
361
|
+
${10===b?d.H`outputObjectAndLayerIdColor();`:d.H`outputDepth(depth);`}`);break;case 3:{(0,f.NB)(r,t),e.include(o.d),e.include(a.Y,t),e.include(c.Mh,t),e.include(l.U,t),e.include(p.A,t),y&&v.uniforms.add(new g.N("tex",e=>e.texture)),2===M&&_.add("vPositionView","vec3",{invariant:!0});const i=0===M||1===M;r.main.add(d.H`
|
|
362
362
|
vpos = getVertexInLocalOriginSpace();
|
|
363
363
|
${i?d.H`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:d.H`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
|
|
364
364
|
vpos = subtractOrigin(vpos);
|
|
@@ -366,20 +366,20 @@ forwardObjectAndLayerIdColor();`),e.include(m.S,t),v.main.add(d.H`
|
|
|
366
366
|
gl_Position = transformPosition(proj, view, vpos);
|
|
367
367
|
forwardTextureCoordinates();`),v.include(n.HQ,t),e.include(m.S,t),v.main.add(d.H`
|
|
368
368
|
discardBySlice(vpos);
|
|
369
|
-
${(0,d.If)(
|
|
369
|
+
${(0,d.If)(y,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
370
370
|
discardOrAdjustAlpha(texColor);`)}
|
|
371
371
|
|
|
372
372
|
${2===M?d.H`vec3 normal = screenDerivativeNormal(vPositionView);`:d.H`vec3 normal = normalize(vNormalWorld);
|
|
373
373
|
if (gl_FrontFacing == false){
|
|
374
374
|
normal = -normal;
|
|
375
375
|
}`}
|
|
376
|
-
fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 9:(0,f.NB)(r,t),e.include(o.d),e.include(l.U,t),e.include(p.A,t),
|
|
376
|
+
fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 9:(0,f.NB)(r,t),e.include(o.d),e.include(l.U,t),e.include(p.A,t),y&&v.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
|
|
377
377
|
vpos = subtractOrigin(vpos);
|
|
378
378
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
379
379
|
gl_Position = transformPosition(proj, view, vpos);
|
|
380
380
|
forwardTextureCoordinates();`),v.include(n.HQ,t),e.include(m.S,t),e.include(h.Q,t),v.main.add(d.H`
|
|
381
381
|
discardBySlice(vpos);
|
|
382
|
-
${(0,d.If)(
|
|
382
|
+
${(0,d.If)(y,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
383
383
|
discardOrAdjustAlpha(texColor);`)}
|
|
384
384
|
calculateOcclusionAndOutputHighlight();`)}}},42293:(e,t,r)=>{r.d(t,{I:()=>n}),r(44208),r(94656);var i=r(63907);function n(e){switch(e){case 6406:case 6409:case 6403:case 36244:case i.H0.R8:case i.H0.R8I:case i.H0.R8UI:case i.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case i.H0.RGBA4:case i.H0.R16F:case i.H0.R16I:case i.H0.R16UI:case i.H0.RG8:case i.H0.RG8I:case i.H0.RG8UI:case i.H0.RG8_SNORM:case i.H0.RGB565:case i.H0.RGB5_A1:case i.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case i.H0.RGB8:case i.H0.RGB8I:case i.H0.RGB8UI:case i.H0.RGB8_SNORM:case i.H0.SRGB8:case i.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case i.H0.RGBA8:case i.H0.R32F:case i.H0.R11F_G11F_B10F:case i.H0.RG16F:case i.H0.R32I:case i.H0.R32UI:case i.H0.RG16I:case i.H0.RG16UI:case i.H0.RGBA8I:case i.H0.RGBA8UI:case i.H0.RGBA8_SNORM:case i.H0.SRGB8_ALPHA8:case i.H0.RGB9_E5:case i.H0.RGB10_A2UI:case i.H0.RGB10_A2:case i.SB.DEPTH_COMPONENT32F:case i.iE.DEPTH24_STENCIL8:return 4;case i.iE.DEPTH32F_STENCIL8:return 5;case i.H0.RGB16F:case i.H0.RGB16I:case i.H0.RGB16UI:return 6;case i.H0.RG32F:case i.H0.RG32I:case i.H0.RG32UI:case i.H0.RGBA16F:case i.H0.RGBA16I:case i.H0.RGBA16UI:return 8;case i.H0.RGB32F:case i.H0.RGB32I:case i.H0.RGB32UI:return 12;case i.H0.RGBA32F:case i.H0.RGBA32I:case i.H0.RGBA32UI:return 16;case i.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.CQ.COMPRESSED_R11_EAC:case i.CQ.COMPRESSED_SIGNED_R11_EAC:case i.CQ.COMPRESSED_RGB8_ETC2:case i.CQ.COMPRESSED_SRGB8_ETC2:case i.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.CQ.COMPRESSED_RG11_EAC:case i.CQ.COMPRESSED_SIGNED_RG11_EAC:case i.CQ.COMPRESSED_RGBA8_ETC2_EAC:case i.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},42398:(e,t,r)=>{r.d(t,{A:()=>h});var i=r(43519),n=r(33079),o=r(71988),a=r(74333);class s extends a.n{constructor(e,t,r,i){super(e,"vec4",1,(r,n,o)=>r.setUniform4fv(e,t(n,o),i),r)}}class l extends a.n{constructor(e,t,r,i){super(e,"float",1,(r,n,o)=>r.setUniform1fv(e,t(n,o),i),r)}}var c=r(31821),d=r(35644);r(78662).Gd;const u=8;function h(e,t){const{vertex:r,attributes:a}=e;t.hasVVInstancing&&(t.hasVVSize||t.hasVVColor)&&a.add("instanceFeatureAttribute","vec4"),t.hasVVSize?(r.uniforms.add(new n.t("vvSizeMinSize",e=>e.vvSize.minSize)),r.uniforms.add(new n.t("vvSizeMaxSize",e=>e.vvSize.maxSize)),r.uniforms.add(new n.t("vvSizeOffset",e=>e.vvSize.offset)),r.uniforms.add(new n.t("vvSizeFactor",e=>e.vvSize.factor)),r.uniforms.add(new n.t("vvSizeFallback",e=>e.vvSize.fallback)),r.uniforms.add(new d.k("vvSymbolRotationMatrix",e=>e.vvSymbolRotationMatrix)),r.uniforms.add(new n.t("vvSymbolAnchor",e=>e.vvSymbolAnchor)),r.code.add(c.H`vec3 vvScale(vec4 _featureAttribute) {
|
|
385
385
|
if (isnan(_featureAttribute.x)) {
|
|
@@ -503,9 +503,9 @@ vec4 masked2 = mix(color2.color, vec4(1), color2.mask);
|
|
|
503
503
|
return MaskedColor(masked1 * masked2, bvec4(ivec4(color1.mask) & ivec4(color2.mask)));
|
|
504
504
|
}`)}function s(e){e.include(n),e.code.add(i.H`MaskedColor createMaskedFromNaNColor(vec4 color) {
|
|
505
505
|
return MaskedColor(color, isnan(color));
|
|
506
|
-
}`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>l,Um:()=>c,kE:()=>a});var i=r(4576),n=r(34727),o=r(77194);function a(e,t,r,i,a){let s=r.screenLength*e.pixelRatio;null!=
|
|
506
|
+
}`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>l,Um:()=>c,kE:()=>a});var i=r(4576),n=r(34727),o=r(77194);function a(e,t,r,i,o,a){let s=r.screenLength*e.pixelRatio;null!=o&&(d.update(i,t,o,a),s=d.apply(s));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(l*t,r.minWorldLength,r.maxWorldLength)}const s=(0,i.VO)();function l(e,t){let r=!1;for(const i in t){const n=t[i];void 0!==n&&(Array.isArray(n)?Array.isArray(e[i])&&s(n,e[i])||(e[i]=n.slice(),r=!0):e[i]!==n&&(r=!0,e[i]=n))}return r}const c={multiply:1,ignore:2,replace:3,tint:4},d=new o.PS},46686:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(31821);function n(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
|
|
507
507
|
void forwardLinearDepth(float _linearDepth) { ${(0,i.If)(t,"linearDepth = _linearDepth;")} }
|
|
508
|
-
`)}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,n,o)=>i.setUniform2fv(e,t(n,o),r))}}},48833:(e,t,r)=>{r.d(t,{g:()=>B}),r(44208);var i=r(49186),n=r(65529),o=r(97768),a=r(74887),s=r(34275),l=r(24326),c=r(84952),d=r(38969),u=r(99677),h=r(56058),p=r(2741);let m;var f=r(63907),g=r(76284),v=r(42293);let _=null,x=null;async function w(){return null==x&&(m??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,p.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=m,_=await x),x}function b(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=T(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function y(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=C(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function M(e,t,r,i,n){const o=(0,v.I)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function T(e){return e.getNumImages()>=1&&!e.isUASTC()}function C(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),p=[];for(let e=0;e<h;e++)p.push(new Uint8Array(a(e,d))),s(e,d,p[e]);return t.internalFormat=u,t.hasMipmap=p.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new g.g(e,t,{type:"compressed",levels:p})}var E=r(53966);const A=()=>E.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function I(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const R=I("DXT1"),F=I("DXT3"),O=I("DXT5");function P(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return A().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return A().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case R:n=8,o=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case F:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case O:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return A().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let p=e.byteOffset+r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,u=new Uint8Array(e.buffer,p,h),m.push(u),p+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:o,width:c,height:d}}function D(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function N(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const a=Math.min(Math.sqrt(r/o),i/n);return[D(Math.round(e*a),i),D(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:H(e,r,i)}function H(e,t,r){if(e instanceof ImageData)return H(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const n=document.createElement("canvas");return n.width=t,n.height=r,n.getContext("2d").drawImage(e,0,0,n.width,n.height),n}var L=r(620),z=r(67171);class B{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new n.bk,this._parameters={...U,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,c.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,c.DB)(e.src)||(0,c.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new z.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture??this._emptyTexture}get loaded(){return null!=this._glTexture}get usedMemory(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return"image/ktx2"===t.encoding?y(e,!!t.mipmap):"image/x.basis"===t.encoding?b(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?G(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._glTexture)return this._glTexture;const t=this._data;return null==t?(this._glTexture=new g.g(e,this._createDescriptor(e),null),this._glTexture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,s.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,s.mg)(t)?this._loadFromPixelData(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_update(e,t){return null==this._glTexture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=P(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new g.g(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._glTexture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.KTX2File(new Uint8Array(r));if(!C(i))return null;i.startTranscoding();const n=S(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.BasisFile(new Uint8Array(r));if(!T(i))return null;i.startTranscoding();const n=S(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromPixelData(e,t){(0,L.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?6409:3===this._parameters.components?6407:6408,6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new g.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.Sx)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((n,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,o.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),n(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=N(r,e.parameters));const i=G(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this._parameters.components?6407:6408,n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._glTexture=new g.g(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._glTexture=(0,o.WD)(this._glTexture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function G(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const U={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},49718:(e,t,r)=>{r(51850),r(6867).i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51406:(e,t,r)=>{r.d(t,{MU:()=>l,O1:()=>c,QM:()=>d,Sx:()=>s,q2:()=>a});var i=r(29242),n=r(31821),o=r(35644);function a(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new o.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(n.H`void forwardColorUV(){
|
|
508
|
+
`)}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,n,o)=>i.setUniform2fv(e,t(n,o),r))}}},48833:(e,t,r)=>{r.d(t,{g:()=>B}),r(44208);var i=r(49186),n=r(65529),o=r(97768),a=r(74887),s=r(34275),l=r(24326),c=r(84952),d=r(38969),u=r(99677),h=r(56058),p=r(2741);let m;var f=r(63907),g=r(76284),v=r(42293);let _=null,x=null;async function w(){return null==x&&(m??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,p.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=m,_=await x),x}function y(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=T(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function b(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=C(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function M(e,t,r,i,n){const o=(0,v.I)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*a)}function T(e){return e.getNumImages()>=1&&!e.isUASTC()}function C(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,n,o,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),p=[];for(let e=0;e<h;e++)p.push(new Uint8Array(a(e,d))),s(e,d,p[e]);return t.internalFormat=u,t.hasMipmap=p.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new g.g(e,t,{type:"compressed",levels:p})}var E=r(53966);const A=()=>E.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const I=R("DXT1"),F=R("DXT3"),O=R("DXT5");function P(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return A().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return A().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case I:n=8,o=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case F:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case O:n=16,o=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return A().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let p=e.byteOffset+r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*n,u=new Uint8Array(e.buffer,p,h),m.push(u),p+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:o,width:c,height:d}}function D(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function N(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const a=Math.min(Math.sqrt(r/o),i/n);return[D(Math.round(e*a),i),D(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:H(e,r,i)}function H(e,t,r){if(e instanceof ImageData)return H(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const n=document.createElement("canvas");return n.width=t,n.height=r,n.getContext("2d").drawImage(e,0,0,n.width,n.height),n}var L=r(620),z=r(67171);class B{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new n.bk,this._parameters={...U,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,c.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,c.DB)(e.src)||(0,c.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new z.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture??this._emptyTexture}get loaded(){return null!=this._glTexture}get usedMemory(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return"image/ktx2"===t.encoding?b(e,!!t.mipmap):"image/x.basis"===t.encoding?y(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?G(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._glTexture)return this._glTexture;const t=this._data;return null==t?(this._glTexture=new g.g(e,this._createDescriptor(e),null),this._glTexture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,s.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,s.mg)(t)?this._loadFromPixelData(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_update(e,t){return null==this._glTexture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=P(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:a,height:s}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=a,t.height=s,new g.g(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._glTexture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.KTX2File(new Uint8Array(r));if(!C(i))return null;i.startTranscoding();const n=S(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.BasisFile(new Uint8Array(r));if(!T(i))return null;i.startTranscoding();const n=S(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._glTexture=e,e)))}_loadFromPixelData(e,t){(0,L.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?6409:3===this._parameters.components?6407:6408,6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new g.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.Sx)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((n,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,o.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),n(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=N(r,e.parameters));const i=G(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.pixelFormat=3===this._parameters.components?6407:6408,n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._glTexture=new g.g(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._glTexture=(0,o.WD)(this._glTexture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function G(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const U={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},49718:(e,t,r)=>{r(51850),r(6867).i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51406:(e,t,r)=>{r.d(t,{MU:()=>l,O1:()=>c,QM:()=>d,Sx:()=>s,q2:()=>a});var i=r(29242),n=r(31821),o=r(35644);function a(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new o.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(n.H`void forwardColorUV(){
|
|
509
509
|
colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
510
510
|
}`)):e.vertex.code.add(n.H`void forwardColorUV(){}`)}function s(e,t){t.hasNormalTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new o.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK)).code.add(n.H`void forwardNormalUV(){
|
|
511
511
|
normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
@@ -541,17 +541,17 @@ screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
|
|
|
541
541
|
params.z
|
|
542
542
|
);
|
|
543
543
|
}`),e.vertex.code.add(a.H`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) {
|
|
544
|
-
return
|
|
544
|
+
return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
|
|
545
545
|
}`),e.vertex.code.add(a.H`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
546
546
|
return applyScreenSizePerspectiveScaleFactorFloat(
|
|
547
547
|
size,
|
|
548
548
|
screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
|
|
549
549
|
);
|
|
550
550
|
}`),e.vertex.code.add(a.H`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) {
|
|
551
|
-
return
|
|
551
|
+
return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
|
|
552
552
|
}`),e.vertex.code.add(a.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
553
553
|
return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
|
|
554
|
-
}`)}function l(e){e.uniforms.add(new o.t("screenSizePerspective",e=>d(e.screenSizePerspective)))}function c(e){e.uniforms.add(new o.t("screenSizePerspectiveAlignment",e=>d(e.screenSizePerspectiveAlignment||e.screenSizePerspective)))}function d(e){return(0,i.i)(u,e.
|
|
554
|
+
}`)}function l(e){e.uniforms.add(new o.t("screenSizePerspective",e=>d(e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize)))}function c(e){e.uniforms.add(new o.t("screenSizePerspectiveAlignment",e=>d(e.screenSizePerspectiveAlignment||e.screenSizePerspective,e.screenSizePerspectiveAlignment?null:e.screenSizePerspectiveMinPixelReferenceSize)))}function d(e,t){const r=null!=t&&null!=e?Math.min(e.minPixelSize/t,1):0;return e?(0,i.i)(u,e.divisor,e.offset,r):(0,i.i)(u,0,0,0)}const u=(0,n.vt)()},57323:(e,t,r)=>{r.d(t,{R:()=>z,b:()=>L});var i=r(32680),n=r(49255),o=r(76591),a=r(76597),s=r(24321),l=r(60864),c=r(43519),d=r(96336),u=r(71955),h=r(53466),p=r(92700),m=r(35640),f=r(40261),g=r(65836),v=r(89390),_=r(98619),x=r(22393),w=r(59469),y=r(32482),b=r(96598),M=r(42398),T=r(58614),C=r(27950),S=r(25178),E=r(33079),A=r(71988),R=r(20304),I=r(31821),F=r(63761),O=r(10906),P=r(43616),D=r(60517),N=r(14113),H=r(49788);function L(e){const t=new N.N5,{attributes:r,vertex:L,fragment:z,varyings:B}=t,{output:G,offsetBackfaces:U,pbrMode:V,snowCover:j,spherical:W,hasGlow:k}=e,$=1===V||2===V;if((0,S.NB)(L,e),r.add("position","vec3"),B.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(l.B,e),t.include(m.Ge,e),t.include(b.Z,e),!(0,n.RN)(G))return t.include(f.E,e),t;(0,S.yu)(t.vertex,e),t.include(d.Y,e),t.include(a.d),U&&t.include(i.M),B.add("vNormalWorld","vec3"),B.add("localvpos","vec3",{invariant:!0}),t.include(h.U,e),t.include(u.K,e),t.include(s.v,e),t.include(p.c,e),L.include(c.WD),L.include(c.oF),L.uniforms.add(new A.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),B.add("vcolorExt","vec4"),t.include(e.instancedDoublePrecision?y.G:y.Bz,e),L.main.add(I.H`
|
|
555
555
|
forwardNormalizedVertexColor();
|
|
556
556
|
|
|
557
557
|
MaskedColor maskedColorExt =
|
|
@@ -560,7 +560,7 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
|
|
|
560
560
|
vcolorExt = maskedColorExt.color;
|
|
561
561
|
forwardColorMixMode(maskedColorExt.mask);
|
|
562
562
|
|
|
563
|
-
bool alphaCut = opacityMixMode != ${
|
|
563
|
+
bool alphaCut = opacityMixMode != ${I.H.int(P.Um.ignore)} && vcolorExt.a < ${I.H.float(H.Q)};
|
|
564
564
|
vpos = getVertexInLocalOriginSpace();
|
|
565
565
|
|
|
566
566
|
localvpos = vpos - view[3].xyz;
|
|
@@ -573,12 +573,12 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
|
|
|
573
573
|
forwardTextureCoordinates();
|
|
574
574
|
forwardLinearDepthToReadShadowMap();
|
|
575
575
|
gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
|
|
576
|
-
${(0,
|
|
577
|
-
`);const{hasColorTexture:
|
|
576
|
+
${(0,I.If)(U,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
|
|
577
|
+
`);const{hasColorTexture:Z,hasColorTextureTransform:q}=e;return t.include(v.kA,e),z.include(g.n,e),t.include(T.S,e),z.include(o.HQ,e),t.include(D.z,e),(0,S.yu)(z,e),(0,_.Gc)(z),(0,v.a8)(z),(0,v.eU)(z),z.uniforms.add(L.uniforms.get("localOrigin"),L.uniforms.get("view"),new E.t("ambient",e=>e.ambient),new E.t("diffuse",e=>e.diffuse),new R.m("opacity",e=>e.opacity),new R.m("layerOpacity",e=>e.layerOpacity)),Z&&z.uniforms.add(new F.N("tex",e=>e.texture)),t.include(w._,e),z.include(x.c,e),z.include(C.N),z.include(O.b,e),(0,_.O4)(z),z.main.add(I.H`
|
|
578
578
|
discardBySlice(vpos);
|
|
579
579
|
discardByTerrainDepth();
|
|
580
|
-
vec4 texColor = ${
|
|
581
|
-
${(0,
|
|
580
|
+
vec4 texColor = ${Z?`texture(tex, ${q?"colorUV":"vuv0"})`:" vec4(1.0)"};
|
|
581
|
+
${(0,I.If)(Z,`${(0,I.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
|
|
582
582
|
vec3 viewDirection = normalize(vpos - cameraPosition);
|
|
583
583
|
applyPBRFactors();
|
|
584
584
|
float ssao = evaluateAmbientOcclusionInverse();
|
|
@@ -588,16 +588,16 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
|
|
|
588
588
|
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
589
589
|
float shadow = readShadow(additionalAmbientScale, vpos);
|
|
590
590
|
vec3 matColor = max(ambient, diffuse);
|
|
591
|
-
${e.hasVertexColors?
|
|
592
|
-
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, opacityMixMode);`:
|
|
591
|
+
${e.hasVertexColors?I.H`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
|
|
592
|
+
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, opacityMixMode);`:I.H`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
|
|
593
593
|
float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, opacityMixMode);`}
|
|
594
594
|
|
|
595
595
|
vec3 shadingNormal = normalize(vNormalWorld);
|
|
596
596
|
vec3 groundNormal = ${W?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};
|
|
597
597
|
|
|
598
|
-
${(0,
|
|
598
|
+
${(0,I.If)(j,"vec3 faceNormal = screenDerivativeNormal(vpos);\n float snow = getRealisticTreeSnow(faceNormal, shadingNormal, groundNormal);\n albedo = mix(albedo, vec3(1), snow);")}
|
|
599
599
|
|
|
600
|
-
${
|
|
600
|
+
${I.H`albedo *= 1.2;
|
|
601
601
|
vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
|
|
602
602
|
float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
|
|
603
603
|
float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);
|
|
@@ -605,12 +605,12 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
|
|
|
605
605
|
float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
|
|
606
606
|
additionalLight += backLightFactor * mainLightIntensity;`}
|
|
607
607
|
|
|
608
|
-
${$?
|
|
609
|
-
${(0,
|
|
608
|
+
${$?I.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
609
|
+
${(0,I.If)(j,"mrr = applySnowToMRR(mrr, snow);")}
|
|
610
610
|
vec4 emission = ${j||k?"vec4(0.0)":"getEmissions(albedo)"};
|
|
611
|
-
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, groundNormal, mrr, additionalAmbientIrradiance);`:
|
|
611
|
+
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, groundNormal, mrr, additionalAmbientIrradiance);`:I.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
612
612
|
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
613
|
-
outputColorHighlightOID(finalColor, vpos, albedo ${(0,
|
|
613
|
+
outputColorHighlightOID(finalColor, vpos, albedo ${(0,I.If)(j,", 1.0")});`),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:L},Symbol.toStringTag,{value:"Module"}))},57917:(e,t,r)=>{r.d(t,{S:()=>o});var i=r(34275),n=r(20498);function o(e){if(e.length<i.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,i.LW)(e)?(0,n.pX)().from(e):(0,i.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}},58614:(e,t,r)=>{r.d(t,{S:()=>a}),r(28421);var i=r(20304),n=r(31821),o=r(49788);function a(e,t){!function(e,t,r){const i=e.fragment,a=t.alphaDiscardMode,s=0===a;2!==a&&3!==a||i.uniforms.add(r),i.code.add(n.H`
|
|
614
614
|
void discardOrAdjustAlpha(inout vec4 color) {
|
|
615
615
|
${1===a?"color.a = 1.0;":`if (color.a < ${s?n.H.float(o.Q):"textureAlphaCutoff"}) {\n discard;\n } ${(0,n.If)(2===a,"else { color.a = 1.0; }")}`}
|
|
616
616
|
}
|
|
@@ -639,7 +639,7 @@ float occlusion;`),d&&c.uniforms.add(1===m?new l.N("texMetallicRoughness",e=>e.t
|
|
|
639
639
|
${(0,a.If)(d,`applyMetallicRoughness(${u?"metallicRoughnessUV":"vuv0"});`)}
|
|
640
640
|
${(0,a.If)(h,`applyOcclusion(${p?"occlusionUV":"vuv0"});`)}
|
|
641
641
|
}
|
|
642
|
-
`)}(r(74810),r(65786)).Y},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>u,Ut:()=>d,p1:()=>p,tb:()=>m,uO:()=>s,vJ:()=>g,vx:()=>f}),r(38954);var i=r(51850),n=r(58083),o=r(13030),a=r(620);function s(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e)a[r]=n[o[e]],r+=s;else for(let e=0;e<l;++e){const t=n[o[e]];for(let e=0;e<i;e++)a[r]=t,r+=s}}function l(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function c(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function d(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}function u(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride;t*=n;for(let e=0;e<r;++e)i[t]=0,i[t+1]=0,i[t+2]=0,i[t+3]=0,t+=n}function h(e,t,r,i,o=1){if(!t)return void c(e,r,i,o);const{data:a,indices:s}=e,l=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=t[0],p=t[1],m=t[2],f=t[4],g=t[5],v=t[6],_=t[8],x=t[9],w=t[10],
|
|
642
|
+
`)}(r(74810),r(65786)).Y},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>u,Ut:()=>d,p1:()=>p,tb:()=>m,uO:()=>s,vJ:()=>g,vx:()=>f}),r(38954);var i=r(51850),n=r(58083),o=r(13030),a=r(620);function s(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e)a[r]=n[o[e]],r+=s;else for(let e=0;e<l;++e){const t=n[o[e]];for(let e=0;e<i;e++)a[r]=t,r+=s}}function l(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length;r*=a;for(let e=0;e<s;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=a}}function c(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=3*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],r+=s}}function d(e,t,r,i=1){const{data:n,indices:o}=e,a=t.typedBuffer,s=t.typedBufferStride,l=o.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*o[e];a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*o[e];for(let e=0;e<i;++e)a[r]=n[t],a[r+1]=n[t+1],a[r+2]=n[t+2],a[r+3]=n[t+3],r+=s}}function u(e,t,r){const i=e.typedBuffer,n=e.typedBufferStride;t*=n;for(let e=0;e<r;++e)i[t]=0,i[t+1]=0,i[t+2]=0,i[t+3]=0,t+=n}function h(e,t,r,i,o=1){if(!t)return void c(e,r,i,o);const{data:a,indices:s}=e,l=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=t[0],p=t[1],m=t[2],f=t[4],g=t[5],v=t[6],_=t[8],x=t[9],w=t[10],y=t[12],b=t[13],M=t[14];i*=d;let T=0,C=0,S=0;const E=(0,n.tZ)(t)?e=>{T=a[e]+y,C=a[e+1]+b,S=a[e+2]+M}:e=>{const t=a[e],r=a[e+1],i=a[e+2];T=h*t+f*r+_*i+y,C=p*t+g*r+x*i+b,S=m*t+v*r+w*i+M};if(1===o)for(let e=0;e<u;++e)E(3*s[e]),l[i]=T,l[i+1]=C,l[i+2]=S,i+=d;else for(let e=0;e<u;++e){E(3*s[e]);for(let e=0;e<o;++e)l[i]=T,l[i+1]=C,l[i+2]=S,i+=d}}function p(e,t,r,i,o=1){if(!t)return void c(e,r,i,o);const{data:a,indices:s}=e,l=t,d=r.typedBuffer,u=r.typedBufferStride,h=s.length,p=l[0],m=l[1],f=l[2],g=l[4],v=l[5],_=l[6],x=l[8],w=l[9],y=l[10],b=!(0,n.ut)(l),M=1e-6,T=1-M;i*=u;let C=0,S=0,E=0;const A=(0,n.tZ)(l)?e=>{C=a[e],S=a[e+1],E=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];C=p*t+g*r+x*i,S=m*t+v*r+w*i,E=f*t+_*r+y*i};if(1===o)if(b)for(let e=0;e<h;++e){A(3*s[e]);const t=C*C+S*S+E*E;if(t<T&&t>M){const e=1/Math.sqrt(t);d[i]=C*e,d[i+1]=S*e,d[i+2]=E*e}else d[i]=C,d[i+1]=S,d[i+2]=E;i+=u}else for(let e=0;e<h;++e)A(3*s[e]),d[i]=C,d[i+1]=S,d[i+2]=E,i+=u;else for(let e=0;e<h;++e){if(A(3*s[e]),b){const e=C*C+S*S+E*E;if(e<T&&e>M){const t=1/Math.sqrt(e);C*=t,S*=t,E*=t}}for(let e=0;e<o;++e)d[i]=C,d[i+1]=S,d[i+2]=E,i+=u}}function m(e,t,r,i,n=1){const{data:o,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t===o.length&&4===t){s[i]=o[0],s[i+1]=o[1],s[i+2]=o[2],s[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const d=c*n;for(let r=1;r<d;++r)e[i]=a,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<n;++e)s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=o[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=o[t],s[i+1]=o[t+1],s[i+2]=o[t+2],s[i+3]=255,i+=l}}}function f(e,t,r,i,n=1){const o=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=a}function g(e,t,r,i,n,a,s){let l={numItems:0,numVerticesPerItem:0};for(const c of r.fields.keys()){const r=e.get(c),d=r?.indices;if(r&&d)"position"===c&&(l={numItems:1,numVerticesPerItem:d.length}),v(c,r,i,n,a,s);else if("olidColor"===c&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;f(t,a.getField(c,o.XP),e,s)}}}return l}function v(e,t,r,i,s,u){switch(e){case"position":{(0,a.vA)(3===t.size);const i=s.getField(e,o.xs);(0,a.vA)(!!i,`No buffer view for ${e}`),h(t,r,i,u);break}case"normal":{(0,a.vA)(3===t.size);const r=s.getField(e,o.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),p(t,i,r,u);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,a.vA)(2===t.size);const r=s.getField(e,o.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,u);break}case"uv0":{(0,a.vA)(2===t.size);const r=s.getField(e,o.ZD)??s.getField(e,o.gH);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,u);break}case"uvi":{(0,a.vA)(2===t.size);const r=s.getField(e,o.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,u);break}case"color":case"symbolColor":{const r=s.getField(e,o.XP);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(3===t.size||4===t.size),m(t,t.size,r,u);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=s.getField(e,o.Y$)??s.getField(e,o.Y$);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,a=t.typedBufferStride,s=n.length,l=i[0];r*=a;for(let e=0;e<s;++e)o[r]=l,r+=a}(t,r,u);break}case"tangent":{(0,a.vA)(4===t.size);const i=s.getField(e,o.Eq);(0,a.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void d(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,h=s.length,p=l[0],m=l[1],f=l[2],g=l[4],v=l[5],_=l[6],x=l[8],w=l[9],y=l[10],b=!(0,n.ut)(l),M=1e-6,T=1-M;if(i*=u,1===o)for(let e=0;e<h;++e){const t=4*s[e],r=a[t],n=a[t+1],o=a[t+2],l=a[t+3];let d=p*r+g*n+x*o,h=m*r+v*n+w*o,C=f*r+_*n+y*o;if(b){const e=d*d+h*h+C*C;if(e<T&&e>M){const t=1/Math.sqrt(e);d*=t,h*=t,C*=t}}c[i]=d,c[i+1]=h,c[i+2]=C,c[i+3]=l,i+=u}else for(let e=0;e<h;++e){const t=4*s[e],r=a[t],n=a[t+1],l=a[t+2],d=a[t+3];let h=p*r+g*n+x*l,C=m*r+v*n+w*l,S=f*r+_*n+y*l;if(b){const e=h*h+C*C+S*S;if(e<T&&e>M){const t=1/Math.sqrt(e);h*=t,C*=t,S*=t}}for(let e=0;e<o;++e)c[i]=h,c[i+1]=C,c[i+2]=S,c[i+3]=d,i+=u}}(t,r,i,u);break}case"profileVertexAndNormal":{(0,a.vA)(4===t.size);const r=s.getField(e,o.jz)??s.getField(e,o.Eq);(0,a.vA)(!!r,`No buffer view for ${e}`),d(t,r,u);break}case"profileAuxData":{(0,a.vA)(3===t.size);const r=s.getField(e,o.EC)??s.getField(e,o.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,u);break}}}(0,i.vt)()},60517:(e,t,r)=>{r.d(t,{z:()=>c});var i=r(49255),n=r(63201),o=r(42593),a=r(63365),s=r(31821),l=r(49788);function c(e,t){e.include(o.Q,t),e.include(n.NL,t),e.fragment.include(a.a);const{output:r,oitPass:c,discardInvisibleFragments:d,snowCover:u}=t,h=10===r,p=(0,i.LG)(r),m=(0,i.RN)(r)&&1===c,f=(0,i.RN)(r)&&1!==c;let g=0;(f||p||m)&&e.outputs.add("fragColor","vec4",g++),p&&e.outputs.add("fragEmission","vec4",g++),m&&e.outputs.add("fragAlpha","float",g++),e.fragment.code.add(s.H`
|
|
643
643
|
void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition, vec3 emissiveSymbolColor ${(0,s.If)(u,", float snow")}) {
|
|
644
644
|
${(0,s.If)(h,"finalColor.a = 1.0;")}
|
|
645
645
|
|
|
@@ -702,7 +702,7 @@ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
|
|
702
702
|
}
|
|
703
703
|
float rgb2v(vec3 c) {
|
|
704
704
|
return max(c.x, max(c.y, c.z));
|
|
705
|
-
}`)}},63907:(e,t,r)=>{r.d(t,{CQ:()=>f,Fq:()=>p,H0:()=>o,SB:()=>l,WR:()=>i,XN:()=>a,iE:()=>s,ld:()=>c,nI:()=>m,pe:()=>n,r6:()=>u,vt:()=>d,yI:()=>h});const i={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},n={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,HALF_FLOAT:5131},o={RGBA4:32854,R16F:33325,RG16F:33327,RGB32F:34837,RGBA16F:34842,R32F:33326,RG32F:33328,RGBA32F:34836,R11F_G11F_B10F:35898,RGB8:32849,RGBA8:32856,RGB5_A1:32855,R8:33321,RG8:33323,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,RGB16F:34843,RGB9_E5:35901,SRGB8:35905,SRGB8_ALPHA8:35907,RGB565:36194,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2:32857,RGB10_A2UI:36975},a=Object.values(o),s={DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},l={DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},c={FLOAT:n.FLOAT,UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_INT_24_8:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,BYTE:n.BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,SHORT:n.SHORT,UNSIGNED_INT:n.UNSIGNED_INT,INT:n.INT,HALF_FLOAT:5131,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269},d={Texture:0,TileTexture:1,BufferObject:2,VertexArrayObject:3,Shader:4,Program:5,FramebufferObject:6,Renderbuffer:7,TransformFeedback:8,Sync:9,UNCOUNTED:10,LinesOfCode:10,Uniform:11,COUNT:12},u=36064,h=36065,p=36066,m=33306,f={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497}},65836:(e,t,r)=>{r.d(t,{n:()=>_t});var i=r(31821),n=r(12791),o=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(10107),u=(r(44208),r(53966)),h=(r(87811),r(40608)),p=r(37585),m=r(69540);let f=class extends m.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"rows",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"columns",void 0),f=(0,o.Cg)([(0,h.$)("esri.CameraLayout")],f);const g=f;var v=r(69052),_=r(25482),x=r(79901),w=r(36005),b=r(43937),y=r(56507),M=r(86738);let T=class extends((0,m.OU)(_.o)){constructor(...e){super(...e),this.position=new M.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new g}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,y.GB)(e.x||0),n.y=(0,y.GB)(e.y||0),n.z=e.hasZ?(0,y.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new M.A;return r.read(e,t),r.x=(0,y.GB)(r.x||0),r.y=(0,y.GB)(r.y||0),r.z=r.hasZ?(0,y.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o.Cg)([(0,d.MZ)({type:M.A,json:{write:{isRequired:!0}}})],T.prototype,"position",void 0),(0,o.Cg)([(0,b.K)("position")],T.prototype,"writePosition",null),(0,o.Cg)([(0,w.w)("position")],T.prototype,"readPosition",null),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>v.ie.normalize((0,y.GB)(e)))],T.prototype,"heading",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>(0,a.qE)((0,y.GB)(e),-180,180))],T.prototype,"tilt",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,x.w)(e=>(0,a.qE)((0,y.GB)(e,55),1,170))],T.prototype,"fov",void 0),(0,o.Cg)([(0,d.MZ)({type:g,nonNullable:!0,json:{read:!1,write:!1}})],T.prototype,"layout",void 0),T=(0,o.Cg)([(0,h.$)("esri.Camera")],T);var C,S=r(9093),E=r(38954),A=r(51850),I=r(16930),R=(r(48353),r(9762),r(65806)),F=r(27993),O=r(73941),P=(r(19419),r(65008)),D=r(90629),N=r(58083),H=r(48163),L=r(87317),z=r(91829),B=r(82919),G=r(71351),U=r(44280);let V=C=class extends P.A{constructor(e){super(e),this._ray=(0,G.vt)(),this._viewport=(0,z.fA)(0,0,1,1),this._padding=(0,z.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,H.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,S.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,S.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,S.vt)(),this._frustumDirty=!0,this._frustum=(0,B.vt)(),this._fullViewport=(0,z.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,A.vt)(),this._up=(0,A.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,E.d)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,N.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,L.c)((0,z.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,L.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,L.c)((0,z.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,L.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,L.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,L.d)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,N.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,N.B8)((0,S.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,S.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,E.j)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,N.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,N.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,l=-r/2+this.row*n,c=l+n,d=(0,N.$h)((0,S.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,N.aI)(u,d)?u:d}copyFrom(e){(0,E.c)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,L.d)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,L.d)(this._padding,e.padding),this.notifyChange("_padding"),(0,p.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,N.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,B.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,N.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,L.d)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new C).copyFrom(this)}equals(e){return(0,E.q)(this.eye,e.eye)&&(0,E.q)(this.center,e.center)&&(0,E.q)(this.up,e.up)&&(0,L.a)(this._viewport,e.viewport)&&(0,L.a)(this._padding,e.padding)&&(0,p.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,L.f)(e.screenPadding,this.screenPadding)>=t||(0,L.f)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,E.a)(k,e.eye,e.center),(0,E.a)($,this.eye,this.center);const r=(0,E.e)(k,$),i=(0,E.y)(k),n=(0,E.y)($),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,E.x)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,U.gr)(this.viewForward,(0,E.d)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,D.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,E.c)(j,e),j[3]=1,(0,L.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,E.g)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,L.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,q),this.renderToScreen(q,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,L.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,E.g)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,n=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,q),t)}unprojectFromRenderScreen(e,t){if((0,N.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,N.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,L.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),d=r-l- -Math.min(this.fullWidth-n-r/2,0),u=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}_computeUpGlobal(){(0,E.d)(k,this.center,this.eye);const e=(0,E.l)(this.center);e<1?(0,E.q)(this._up,A.Cb)&&((0,E.c)(this._up,A.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,E.e)(k,this.center))>.9999*(0,E.l)(k)*e||((0,E.h)($,k,this.center),(0,E.h)($,$,k),(0,E.n)($,$),(0,E.q)(this._up,$)||((0,E.c)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,E.E)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,E.g)(k,k,k[2]),(0,E.i)(k,-k[0],-k[1],1-k[2]),(0,E.n)(k,k),(0,E.q)(this._up,k)||((0,E.c)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,E.q)(e,t)||((0,E.c)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):u.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,B.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,N.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewport",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_padding",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_fov",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_nearFar",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"pixelRatio",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_rows",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"rows",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_columns",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"columns",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"eye",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"center",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_center",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"up",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_up",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewForward",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewUp",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewRight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"nearFar",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"near",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"far",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenViewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenPadding",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"x",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"y",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"width",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"height",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullWidth",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullHeight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_aspect",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"padding",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"projectionMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fov",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovX",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovY",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"relativeElevation",void 0),V=C=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderCamera")],V);const j=(0,z.vt)(),W=(0,S.vt)(),k=(0,A.vt)(),$=(0,A.vt)(),q=(0,D.r_)();class Z{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far))}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Z(0,0)}static{this.Infinite=new Z}}r(49718),r(6867),r(16396),(0,A.vt)(),(0,A.vt)(),(0,A.vt)(),new WeakMap;var Y=r(5443),X=r(39829),J=r(95108);function K(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),l=t[o]+s*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,H.o8)(ee));break;case 2:Q(e,(0,H.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,p.aI)(e.at(-1),t)||e.push(t)}const ee=(0,H.vt)();var te=r(11964),re=r(27921);const ie=(0,A.vt)(),ne=(0,A.vt)();function oe(){return{direction:(0,A.vt)(),up:(0,A.vt)()}}function ae(e,t,r,i,n){let o=(0,E.n)(ie,e),s=(0,E.e)(o,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,E.e)(t,i)),s<.99?((0,E.c)(o,t),l&&(0,E.g)(o,o,-1)):o=null);let c=0;if(o){(0,E.g)(ne,i,(0,E.e)(i,o)),(0,E.d)(o,o,ne);const e=(0,E.e)(o,n)/((0,E.l)(o)*(0,E.l)(n));(0,E.h)(ne,o,n),c=((0,E.e)(ne,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,E.e)(i,e)/(0,E.l)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function se(e,t,r,i){(0,E.d)(le,r,t),(0,re.T7)(i,(0,te.LV)(t,le),e)||e===r||(0,E.c)(e,r)}const le=(0,A.vt)(),ce=(0,A.fA)(0,1,0),de=(0,A.fA)(0,0,1),ue=(0,S.vt)(),he=(0,A.vt)(),pe=(0,A.vt)();function me(e,t,r,i=oe()){const{direction:n,up:o}=i;return(0,N.N9)(ue,-(0,a.kU)(t)),(0,N.eL)(ue,ue,(0,a.kU)(r)),(0,E.t)(n,de,ue),(0,E.g)(n,n,-1),(0,E.t)(o,ce,ue),i}function fe(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,E.b)(e,i,o,a)}const ge=(0,A.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ae(t,r,i,de,ce)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=me(0,r,i),o=(0,A.vt)();return(0,E.g)(o,n.direction,-t),(0,E.f)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:me,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,G.LV)(t.origin,t.direction),n,ge)||fe(ge,r,i,t.endpoint,n),se(ge,a,ge,l),s.push((0,H.fA)(ge[0],ge[1]))}return function(e,t,r){const i=e.map(e=>((0,E.i)(ge,e[0],e[1],0),t.fromRenderCoords(ge,ge,r),[ge[0],ge[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,J.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,R.g)(t,he,o),(0,R.g)(t,pe,o),he[0]-=r/2,pe[0]+=r/2,he[1]-=i/2,pe[1]+=i/2,(0,F.F)(he,o,he,a),(0,F.F)(pe,o,pe,a),n?(n.xmin=he[0],n.ymin=he[1],n.xmax=pe[0],n.ymax=pe[1],n.spatialReference=a):n=new Y.A(he[0],he[1],pe[0],pe[1],a),n}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),_e=r(97937),xe=r(28735);class we{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,B.vt)(),this._points=(0,B.Qy)(),this.lines=new Array(12),this._origin=(0,A.vt)(),this._direction=(0,A.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,A.vt)(),endpoint:null}}update(e){(0,B.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,E.c)(this._origin,e.eye),(0,E.c)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,E.c)(this._points[t],e[t]);(0,B.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,B.m7)(this.frustum,e)}intersectsRay(e){return(0,B.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,B.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,B.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;be(this.lines[t],e[t],e[r]),be(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),be(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=B.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function be(e,t,r){e.origin=t,e.endpoint=r,(0,E.E)(e.direction,t,r)}r(83047);const ye=(0,A.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Me=(0,A.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,A.fA)(parseFloat(Number(ye[0]+Me[0]).toFixed(6)),parseFloat(Number(ye[1]+Me[1]).toFixed(6)),parseFloat(Number(ye[2]+Me[2]).toFixed(6)));(0,A.vt)(),(0,A.vt)(),(0,_e.c)(),(0,G.vt)();const Te=(0,A.vt)(),Ce=(0,A.vt)();var Se=r(32728);const Ee=(0,A.fA)(0,0,1),Ae=(0,E.n)((0,A.vt)(),(0,A.fA)(1,1,1)),Ie=new v.hr(-180,180),Re=(0,S.vt)(),Fe=(0,A.vt)(),Oe=(0,A.vt)();function Pe(e,t,r,i=oe()){(0,E.h)(Fe,e,Ee),0===(0,E.e)(Fe,Fe)&&(0,E.h)(Fe,e,Ae),(0,N.$0)(Re,-(0,a.kU)(t),e),(0,N.e$)(Re,Re,-(0,a.kU)(r),Fe);const{up:n,direction:o}=i;return(0,E.h)(n,Fe,e),(0,E.n)(n,n),(0,E.t)(n,n,Re),(0,E.n)(o,e),(0,E.u)(o,o),(0,E.t)(o,o,Re),i}function De(e){const t=e[1];e[1]=-e[2],e[2]=t}function Ne(e,t){const r=Pe(t,e.heading,e.tilt);return e.up=r.up,e}function He(e,t){const r=[],i=[],n=(0,ve.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,te.Cr)(a,s,We),c=(0,re.vE)(t,l.origin,l.vector,0,Ve);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,re.Qj)(t),d=(0,E.b)((0,A.vt)(),Ve,l,e*n),u=(0,E.b)((0,A.vt)(),Ve,l,e*-n);o.push(a),o.push(d),s.push(u)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Le={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},ze=(0,A.fA)(1,0,0),Be=(0,A.fA)(0,1,0),Ge=(0,A.vt)(),Ue=(0,A.vt)(),Ve=(0,A.vt)(),je=(0,_e.c)(),We=(0,te.vt)(),ke=(0,z.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Fe,o=Oe;return(0,E.n)(n,e),(0,E.h)(Oe,n,Ee),0===(0,E.e)(Oe,Oe)&&(0,E.h)(Oe,n,Ae),(0,E.h)(o,Oe,n),ae(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,A.vt)(),up:null,tilt:i,heading:r},o=Fe;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),p=Math.cos(c),m=(0,E.l)(o);let f;if(Math.abs(c)<1e-8)f=s+m;else{const e=m/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const g=p*s,v=s*s*(h*h),_=u*u*v,x=f-g,w=x*x,b=_*(_+w-o[1]*o[1]);if(b<0)return(0,E.g)(n.eye,o,f/m),n.tilt=0,Ne(n,e);const y=Math.sqrt(b),M=o[1]*x,T=_+w;let C;if(C=u>0?-y+M:y+M,Math.abs(T)<1e-8)return m<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,E.g)(n.eye,o,f/m),n.tilt=0,De(n.eye),Ne(n,e);n.eye[1]=C/T;const S=d*d*v,I=h*s,R=u*I*n.eye[1],F=n.eye[1]*n.eye[1],O=1-F,P=Math.sqrt(O),D=_*F+S-2*R*P*x+O*w;return Math.abs(D)<1e-8?((0,E.g)(n.eye,o,f/m),n.tilt=0,De(n.eye),Ne(n,e)):(n.eye[0]=(O*(f*o[0]-g*o[0])-I*P*(o[0]*n.eye[1]*u+o[2]*d))/D,n.eye[2]=(O*(f*o[2]-g*o[2])-I*P*(o[2]*n.eye[1]*u-o[0]*d))/D,(0,E.g)(n.eye,n.eye,f),De(n.eye),Ne(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),n=(0,E.l)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:Pe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,E.l)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,a.YN)(r/(n/Math.sin(e)));return(0,a.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new we(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,E.j)(c,t)/(l+o),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:p,minSamples:m,maxSamples:f}=Le,g=function(e){const{renderCoordsHelper:t,state:{camera:r}}=e,{center:i,eye:n}=r,o=Math.abs(t.getAltitude(i)),s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,Te),(0,E.d)(Ce,r,t);const i=(0,E.l)(Ce);return 0===i?0:(0,a.XM)((0,E.e)(Ce,Te)/i)}(t,i,n));return(0,_e.b)(je,t.referenceEllipsoid.radius+o),(0,_e.d)(je,s,r.distance,r.fovY)}(e),v=(0,a.qE)((u-h)/(p-h),0,1),_=Math.round((0,a.Cc)(m,f,v)),x=i.aboveGround,w=n.planes[5],b=[],y=(0,re.O_)(A.uY,ze,(0,re.vt)()),M=(0,re.O_)(A.uY,Be,(0,re.vt)());(0,L.s)(ke,0,0,0,0);const T=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-g:0,i=1===e&&x||3===e&&!x?g:1,s=n.lines[e],l=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const d=n/_,u=0===n?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,E.m)(Ue,s.origin,l.origin,u),p=(0,Se.nu)(s.direction,l.direction,u,Ge);r.intersectManifoldClosestSilhouette((0,G.LV)(h,p),o,Ve),se(Ve,c,Ve,w),b.push((0,A.o8)(Ve)),0!==b.length&&T((0,E.x)(b.at(-1),Ve));const m=((0,re.Tj)(y,Ve)?1:0)|((0,re.Tj)(M,Ve)?2:0);ke[m]=1}}b.length>2&&(0,E.x)(b[0],b.at(-1));const C=function(e,t,r){const i=2*(0,ve.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,Ve,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,Ve[1]]),n.push([null,Ve[1]]),o=!0):n.push([Ve[0],Ve[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,J.$3)(n)||n.reverse(),n})}((0,L.b)(ke)>1?function(e,t){const r=[];for(const i of e)r.push(...He(i,t));return r}(He(b,y),M):[b],r,s);return new X.A({rings:C,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,l,c;const d=t.latitude,u=(0,O.tO)(e.spatialReference).radius,h=t.longitude,p=function(e,t,r){const i=t/r,n=(0,a.kU)(e),o=Math.sin(i/2),s=Math.cos(n),l=2*(0,a.YN)(Math.sqrt(o*o/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;o=h-p,s=h+p;const m=(0,a.kU)(d),f=(1+Math.sin(m))/(1-Math.sin(m)),g=(f+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=v.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*f+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=Ie.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:I.A.WGS84;return n?(n.xmin=o,n.ymin=l,n.xmax=s,n.ymax=c,n.spatialReference=w):n=new Y.A(o,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,xe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const $e="ssao";(0,A.vt)();var qe=r(49186);let Ze=class extends P.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new qe.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){1===e&&this.view.stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],Ze.prototype,"view",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],Ze.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],Ze.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],Ze.prototype,"techniques",null),Ze=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderNode")],Ze);var Ye=r(97220),Xe=r(98958),Je=r(63907),Ke=r(85079),Qe=r(74038);const et=[new Qe._("position",3,Je.pe.FLOAT,0,12)],tt=[new Qe._("position",2,Je.pe.FLOAT,0,8)],rt=(0,Ke.Xk)(tt);(0,Ke.Xk)(et),new Qe._("position",2,Je.pe.FLOAT,0,12),new Qe._("uv0",2,Je.pe.HALF_FLOAT,8,12),new Qe._("position",2,Je.pe.FLOAT,0,16),new Qe._("uv0",2,Je.pe.FLOAT,8,16);var it=r(95774),nt=r(90644);class ot extends Xe.w{constructor(e,t){super(e,t,new Ye.$(it.S,()=>r.e(9384).then(r.bind(r,59384))),rt)}initializePipeline(){return(0,nt.Ey)({colorWrite:nt.kn})}}var at=r(65786);class st extends at.Y{constructor(){super(...arguments),this.projScale=1}}class lt extends st{constructor(){super(...arguments),this.intensity=1}}class ct extends at.Y{}class dt extends ct{constructor(){super(...arguments),this.blurSize=(0,H.vt)()}}var ut=r(15581);class ht extends Xe.w{constructor(e,t){super(e,t,new Ye.$(ut.S,()=>r.e(191).then(r.bind(r,90191))),rt)}initializePipeline(){return(0,nt.Ey)({colorWrite:nt.kn})}}var pt=r(76284),mt=r(67171);const ft=2;let gt=class extends Ze{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=$e,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new lt,this._drawParameters=new dt}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new mt.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new pt.g(this.renderingContext,t,e),this.techniques.precompile(ht),this.techniques.precompile(ot),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(Je.nI);if(!r||!i)return;const n=this.techniques.get(ht),o=this.techniques.get(ot);if(!n.compiled||!o.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,u=d.camera,h=u.relativeElevation,m=(0,a.qE)((5e5-h)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,g=f*m;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/u.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*vt/(0,ut.g)(u)**6*g;const v=u.fullViewport[2],_=u.fullViewport[3],x=this.fboCache.acquire(v,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,v,_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(v/ft),b=Math.round(_/ft),y=this.fboCache.acquire(w,b,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,0,ft/_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,b,$e,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,v,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,ft/v,0),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),s.setViewport4fv(u.fullViewport),y.release(),f<1&&this.requestRender(1),M}};(0,o.Cg)([(0,d.MZ)()],gt.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],gt.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],gt.prototype,"isEnabled",void 0),gt=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],gt);const vt=.5;function _t(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/ft),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
705
|
+
}`)}},63907:(e,t,r)=>{r.d(t,{CQ:()=>f,Fq:()=>p,H0:()=>o,SB:()=>l,WR:()=>i,XN:()=>a,iE:()=>s,ld:()=>c,nI:()=>m,pe:()=>n,r6:()=>u,vt:()=>d,yI:()=>h});const i={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},n={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,HALF_FLOAT:5131},o={RGBA4:32854,R16F:33325,RG16F:33327,RGB32F:34837,RGBA16F:34842,R32F:33326,RG32F:33328,RGBA32F:34836,R11F_G11F_B10F:35898,RGB8:32849,RGBA8:32856,RGB5_A1:32855,R8:33321,RG8:33323,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,RGB16F:34843,RGB9_E5:35901,SRGB8:35905,SRGB8_ALPHA8:35907,RGB565:36194,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2:32857,RGB10_A2UI:36975},a=Object.values(o),s={DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},l={DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},c={FLOAT:n.FLOAT,UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_INT_24_8:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,BYTE:n.BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,SHORT:n.SHORT,UNSIGNED_INT:n.UNSIGNED_INT,INT:n.INT,HALF_FLOAT:5131,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269},d={Texture:0,TileTexture:1,BufferObject:2,VertexArrayObject:3,Shader:4,Program:5,FramebufferObject:6,Renderbuffer:7,TransformFeedback:8,Sync:9,UNCOUNTED:10,LinesOfCode:10,Uniform:11,COUNT:12},u=36064,h=36065,p=36066,m=33306,f={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497}},65836:(e,t,r)=>{r.d(t,{n:()=>_t});var i=r(31821),n=r(12791),o=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(10107),u=(r(44208),r(53966)),h=(r(87811),r(40608)),p=r(37585),m=r(69540);let f=class extends m.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"rows",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"columns",void 0),f=(0,o.Cg)([(0,h.$)("esri.CameraLayout")],f);const g=f;var v=r(69052),_=r(25482),x=r(79901),w=r(36005),y=r(43937),b=r(56507),M=r(86738);let T=class extends((0,m.OU)(_.o)){constructor(...e){super(...e),this.position=new M.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new g}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,b.GB)(e.x||0),n.y=(0,b.GB)(e.y||0),n.z=e.hasZ?(0,b.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new M.A;return r.read(e,t),r.x=(0,b.GB)(r.x||0),r.y=(0,b.GB)(r.y||0),r.z=r.hasZ?(0,b.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o.Cg)([(0,d.MZ)({type:M.A,json:{write:{isRequired:!0}}})],T.prototype,"position",void 0),(0,o.Cg)([(0,y.K)("position")],T.prototype,"writePosition",null),(0,o.Cg)([(0,w.w)("position")],T.prototype,"readPosition",null),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>v.ie.normalize((0,b.GB)(e)))],T.prototype,"heading",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>(0,a.qE)((0,b.GB)(e),-180,180))],T.prototype,"tilt",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,x.w)(e=>(0,a.qE)((0,b.GB)(e,55),1,170))],T.prototype,"fov",void 0),(0,o.Cg)([(0,d.MZ)({type:g,nonNullable:!0,json:{read:!1,write:!1}})],T.prototype,"layout",void 0),T=(0,o.Cg)([(0,h.$)("esri.Camera")],T);var C,S=r(9093),E=r(38954),A=r(51850),R=r(16930),I=(r(48353),r(9762),r(65806)),F=r(27993),O=r(73941),P=(r(19419),r(65008)),D=r(90629),N=r(58083),H=r(48163),L=r(87317),z=r(91829),B=r(82919),G=r(71351),U=r(44280);let V=C=class extends P.A{constructor(e){super(e),this._ray=(0,G.vt)(),this._viewport=(0,z.fA)(0,0,1,1),this._padding=(0,z.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,H.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,S.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,S.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,S.vt)(),this._frustumDirty=!0,this._frustum=(0,B.vt)(),this._fullViewport=(0,z.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,A.vt)(),this._up=(0,A.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,E.d)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,N.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,E.i)((0,A.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,L.c)((0,z.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,L.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,L.c)((0,z.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,L.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,L.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,L.d)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,N.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,N.B8)((0,S.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,S.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,E.j)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,N.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,N.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,l=-r/2+this.row*n,c=l+n,d=(0,N.$h)((0,S.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,N.aI)(u,d)?u:d}copyFrom(e){(0,E.c)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,L.d)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,L.d)(this._padding,e.padding),this.notifyChange("_padding"),(0,p.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,N.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,B.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,N.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,L.d)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new C).copyFrom(this)}equals(e){return(0,E.q)(this.eye,e.eye)&&(0,E.q)(this.center,e.center)&&(0,E.q)(this.up,e.up)&&(0,L.a)(this._viewport,e.viewport)&&(0,L.a)(this._padding,e.padding)&&(0,p.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,L.f)(e.screenPadding,this.screenPadding)>=t||(0,L.f)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,E.a)(k,e.eye,e.center),(0,E.a)($,this.eye,this.center);const r=(0,E.e)(k,$),i=(0,E.y)(k),n=(0,E.y)($),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,E.x)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,U.gr)(this.viewForward,(0,E.d)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,D.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,E.c)(j,e),j[3]=1,(0,L.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,E.g)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,L.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,L.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,E.g)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,n=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,N.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,N.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,L.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),d=r-l- -Math.min(this.fullWidth-n-r/2,0),u=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}_computeUpGlobal(){(0,E.d)(k,this.center,this.eye);const e=(0,E.l)(this.center);e<1?(0,E.q)(this._up,A.Cb)&&((0,E.c)(this._up,A.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,E.e)(k,this.center))>.9999*(0,E.l)(k)*e||((0,E.h)($,k,this.center),(0,E.h)($,$,k),(0,E.n)($,$),(0,E.q)(this._up,$)||((0,E.c)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,E.E)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,E.g)(k,k,k[2]),(0,E.i)(k,-k[0],-k[1],1-k[2]),(0,E.n)(k,k),(0,E.q)(this._up,k)||((0,E.c)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,E.q)(e,t)||((0,E.c)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):u.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,B.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,N.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewport",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_padding",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_fov",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_nearFar",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"pixelRatio",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_rows",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"rows",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_columns",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"columns",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"eye",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"center",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_center",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"up",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"_up",void 0),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewForward",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewUp",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"viewRight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"nearFar",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"near",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"far",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenViewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"screenPadding",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"x",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"y",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"width",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"height",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullWidth",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fullHeight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_aspect",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"padding",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"projectionMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fov",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovX",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"fovY",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],V.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,d.MZ)()],V.prototype,"relativeElevation",void 0),V=C=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderCamera")],V);const j=(0,z.vt)(),W=(0,S.vt)(),k=(0,A.vt)(),$=(0,A.vt)(),Z=(0,D.r_)();class q{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far))}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new q(0,0)}static{this.Infinite=new q}}r(49718),r(6867),r(16396),(0,A.vt)(),(0,A.vt)(),(0,A.vt)(),new WeakMap;var Y=r(5443),X=r(39829),J=r(95108);function K(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),l=t[o]+s*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,H.o8)(ee));break;case 2:Q(e,(0,H.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,p.aI)(e.at(-1),t)||e.push(t)}const ee=(0,H.vt)();var te=r(11964),re=r(27921);const ie=(0,A.vt)(),ne=(0,A.vt)();function oe(){return{direction:(0,A.vt)(),up:(0,A.vt)()}}function ae(e,t,r,i,n){let o=(0,E.n)(ie,e),s=(0,E.e)(o,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,E.e)(t,i)),s<.99?((0,E.c)(o,t),l&&(0,E.g)(o,o,-1)):o=null);let c=0;if(o){(0,E.g)(ne,i,(0,E.e)(i,o)),(0,E.d)(o,o,ne);const e=(0,E.e)(o,n)/((0,E.l)(o)*(0,E.l)(n));(0,E.h)(ne,o,n),c=((0,E.e)(ne,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,E.e)(i,e)/(0,E.l)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function se(e,t,r,i){(0,E.d)(le,r,t),(0,re.T7)(i,(0,te.LV)(t,le),e)||e===r||(0,E.c)(e,r)}const le=(0,A.vt)(),ce=(0,A.fA)(0,1,0),de=(0,A.fA)(0,0,1),ue=(0,S.vt)(),he=(0,A.vt)(),pe=(0,A.vt)();function me(e,t,r,i=oe()){const{direction:n,up:o}=i;return(0,N.N9)(ue,-(0,a.kU)(t)),(0,N.eL)(ue,ue,(0,a.kU)(r)),(0,E.t)(n,de,ue),(0,E.g)(n,n,-1),(0,E.t)(o,ce,ue),i}function fe(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,E.b)(e,i,o,a)}const ge=(0,A.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ae(t,r,i,de,ce)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=me(0,r,i),o=(0,A.vt)();return(0,E.g)(o,n.direction,-t),(0,E.f)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:me,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,G.LV)(t.origin,t.direction),n,ge)||fe(ge,r,i,t.endpoint,n),se(ge,a,ge,l),s.push((0,H.fA)(ge[0],ge[1]))}return function(e,t,r){const i=e.map(e=>((0,E.i)(ge,e[0],e[1],0),t.fromRenderCoords(ge,ge,r),[ge[0],ge[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,J.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,I.g)(t,he,o),(0,I.g)(t,pe,o),he[0]-=r/2,pe[0]+=r/2,he[1]-=i/2,pe[1]+=i/2,(0,F.F)(he,o,he,a),(0,F.F)(pe,o,pe,a),n?(n.xmin=he[0],n.ymin=he[1],n.xmax=pe[0],n.ymax=pe[1],n.spatialReference=a):n=new Y.A(he[0],he[1],pe[0],pe[1],a),n}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),_e=r(97937),xe=r(28735);class we{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,B.vt)(),this._points=(0,B.Qy)(),this.lines=new Array(12),this._origin=(0,A.vt)(),this._direction=(0,A.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,A.vt)(),endpoint:null}}update(e){(0,B.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,E.c)(this._origin,e.eye),(0,E.c)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,E.c)(this._points[t],e[t]);(0,B.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,B.m7)(this.frustum,e)}intersectsRay(e){return(0,B.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,B.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,B.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;ye(this.lines[t],e[t],e[r]),ye(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ye(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=B.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ye(e,t,r){e.origin=t,e.endpoint=r,(0,E.E)(e.direction,t,r)}r(83047);const be=(0,A.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Me=(0,A.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,A.fA)(parseFloat(Number(be[0]+Me[0]).toFixed(6)),parseFloat(Number(be[1]+Me[1]).toFixed(6)),parseFloat(Number(be[2]+Me[2]).toFixed(6)));(0,A.vt)(),(0,A.vt)(),(0,_e.c)(),(0,G.vt)();const Te=(0,A.vt)(),Ce=(0,A.vt)();var Se=r(32728);const Ee=(0,A.fA)(0,0,1),Ae=(0,E.n)((0,A.vt)(),(0,A.fA)(1,1,1)),Re=new v.hr(-180,180),Ie=(0,S.vt)(),Fe=(0,A.vt)(),Oe=(0,A.vt)();function Pe(e,t,r,i=oe()){(0,E.h)(Fe,e,Ee),0===(0,E.e)(Fe,Fe)&&(0,E.h)(Fe,e,Ae),(0,N.$0)(Ie,-(0,a.kU)(t),e),(0,N.e$)(Ie,Ie,-(0,a.kU)(r),Fe);const{up:n,direction:o}=i;return(0,E.h)(n,Fe,e),(0,E.n)(n,n),(0,E.t)(n,n,Ie),(0,E.n)(o,e),(0,E.u)(o,o),(0,E.t)(o,o,Ie),i}function De(e){const t=e[1];e[1]=-e[2],e[2]=t}function Ne(e,t){const r=Pe(t,e.heading,e.tilt);return e.up=r.up,e}function He(e,t){const r=[],i=[],n=(0,ve.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,te.Cr)(a,s,We),c=(0,re.vE)(t,l.origin,l.vector,0,Ve);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,re.Qj)(t),d=(0,E.b)((0,A.vt)(),Ve,l,e*n),u=(0,E.b)((0,A.vt)(),Ve,l,e*-n);o.push(a),o.push(d),s.push(u)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Le={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},ze=(0,A.fA)(1,0,0),Be=(0,A.fA)(0,1,0),Ge=(0,A.vt)(),Ue=(0,A.vt)(),Ve=(0,A.vt)(),je=(0,_e.c)(),We=(0,te.vt)(),ke=(0,z.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Fe,o=Oe;return(0,E.n)(n,e),(0,E.h)(Oe,n,Ee),0===(0,E.e)(Oe,Oe)&&(0,E.h)(Oe,n,Ae),(0,E.h)(o,Oe,n),ae(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,A.vt)(),up:null,tilt:i,heading:r},o=Fe;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),p=Math.cos(c),m=(0,E.l)(o);let f;if(Math.abs(c)<1e-8)f=s+m;else{const e=m/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const g=p*s,v=s*s*(h*h),_=u*u*v,x=f-g,w=x*x,y=_*(_+w-o[1]*o[1]);if(y<0)return(0,E.g)(n.eye,o,f/m),n.tilt=0,Ne(n,e);const b=Math.sqrt(y),M=o[1]*x,T=_+w;let C;if(C=u>0?-b+M:b+M,Math.abs(T)<1e-8)return m<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,E.g)(n.eye,o,f/m),n.tilt=0,De(n.eye),Ne(n,e);n.eye[1]=C/T;const S=d*d*v,R=h*s,I=u*R*n.eye[1],F=n.eye[1]*n.eye[1],O=1-F,P=Math.sqrt(O),D=_*F+S-2*I*P*x+O*w;return Math.abs(D)<1e-8?((0,E.g)(n.eye,o,f/m),n.tilt=0,De(n.eye),Ne(n,e)):(n.eye[0]=(O*(f*o[0]-g*o[0])-R*P*(o[0]*n.eye[1]*u+o[2]*d))/D,n.eye[2]=(O*(f*o[2]-g*o[2])-R*P*(o[2]*n.eye[1]*u-o[0]*d))/D,(0,E.g)(n.eye,n.eye,f),De(n.eye),Ne(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),n=(0,E.l)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:Pe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,E.l)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,a.YN)(r/(n/Math.sin(e)));return(0,a.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new we(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,E.j)(c,t)/(l+o),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:p,minSamples:m,maxSamples:f}=Le,g=function(e){const{renderCoordsHelper:t,state:{camera:r}}=e,{center:i,eye:n}=r,o=Math.abs(t.getAltitude(i)),s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,Te),(0,E.d)(Ce,r,t);const i=(0,E.l)(Ce);return 0===i?0:(0,a.XM)((0,E.e)(Ce,Te)/i)}(t,i,n));return(0,_e.b)(je,t.referenceEllipsoid.radius+o),(0,_e.d)(je,s,r.distance,r.fovY)}(e),v=(0,a.qE)((u-h)/(p-h),0,1),_=Math.round((0,a.Cc)(m,f,v)),x=i.aboveGround,w=n.planes[5],y=[],b=(0,re.O_)(A.uY,ze,(0,re.vt)()),M=(0,re.O_)(A.uY,Be,(0,re.vt)());(0,L.s)(ke,0,0,0,0);const T=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-g:0,i=1===e&&x||3===e&&!x?g:1,s=n.lines[e],l=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const d=n/_,u=0===n?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,E.m)(Ue,s.origin,l.origin,u),p=(0,Se.nu)(s.direction,l.direction,u,Ge);r.intersectManifoldClosestSilhouette((0,G.LV)(h,p),o,Ve),se(Ve,c,Ve,w),y.push((0,A.o8)(Ve)),0!==y.length&&T((0,E.x)(y.at(-1),Ve));const m=((0,re.Tj)(b,Ve)?1:0)|((0,re.Tj)(M,Ve)?2:0);ke[m]=1}}y.length>2&&(0,E.x)(y[0],y.at(-1));const C=function(e,t,r){const i=2*(0,ve.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,Ve,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,Ve[1]]),n.push([null,Ve[1]]),o=!0):n.push([Ve[0],Ve[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,J.$3)(n)||n.reverse(),n})}((0,L.b)(ke)>1?function(e,t){const r=[];for(const i of e)r.push(...He(i,t));return r}(He(y,b),M):[y],r,s);return new X.A({rings:C,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,l,c;const d=t.latitude,u=(0,O.tO)(e.spatialReference).radius,h=t.longitude,p=function(e,t,r){const i=t/r,n=(0,a.kU)(e),o=Math.sin(i/2),s=Math.cos(n),l=2*(0,a.YN)(Math.sqrt(o*o/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;o=h-p,s=h+p;const m=(0,a.kU)(d),f=(1+Math.sin(m))/(1-Math.sin(m)),g=(f+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=v.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*f+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=Re.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:R.A.WGS84;return n?(n.xmin=o,n.ymin=l,n.xmax=s,n.ymax=c,n.spatialReference=w):n=new Y.A(o,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,xe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const $e="ssao";(0,A.vt)();var Ze=r(49186);let qe=class extends P.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new Ze.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){1===e&&this.view.stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],qe.prototype,"view",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],qe.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],qe.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],qe.prototype,"techniques",null),qe=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl.RenderNode")],qe);var Ye=r(97220),Xe=r(98958),Je=r(63907),Ke=r(85079),Qe=r(74038);const et=[new Qe._("position",3,Je.pe.FLOAT,0,12)],tt=[new Qe._("position",2,Je.pe.FLOAT,0,8)],rt=(0,Ke.Xk)(tt);(0,Ke.Xk)(et),new Qe._("position",2,Je.pe.FLOAT,0,12),new Qe._("uv0",2,Je.pe.HALF_FLOAT,8,12),new Qe._("position",2,Je.pe.FLOAT,0,16),new Qe._("uv0",2,Je.pe.FLOAT,8,16);var it=r(95774),nt=r(90644);class ot extends Xe.w{constructor(e,t){super(e,t,new Ye.$(it.S,()=>r.e(9384).then(r.bind(r,59384))),rt)}initializePipeline(){return(0,nt.Ey)({colorWrite:nt.kn})}}var at=r(65786);class st extends at.Y{constructor(){super(...arguments),this.projScale=1}}class lt extends st{constructor(){super(...arguments),this.intensity=1}}class ct extends at.Y{}class dt extends ct{constructor(){super(...arguments),this.blurSize=(0,H.vt)()}}var ut=r(15581);class ht extends Xe.w{constructor(e,t){super(e,t,new Ye.$(ut.S,()=>r.e(191).then(r.bind(r,90191))),rt)}initializePipeline(){return(0,nt.Ey)({colorWrite:nt.kn})}}var pt=r(76284),mt=r(67171);const ft=2;let gt=class extends qe{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=$e,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new lt,this._drawParameters=new dt}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new mt.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new pt.g(this.renderingContext,t,e),this.techniques.precompile(ht),this.techniques.precompile(ot),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(Je.nI);if(!r||!i)return;const n=this.techniques.get(ht),o=this.techniques.get(ot);if(!n.compiled||!o.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,u=d.camera,h=u.relativeElevation,m=(0,a.qE)((5e5-h)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,g=f*m;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/u.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*vt/(0,ut.g)(u)**6*g;const v=u.fullViewport[2],_=u.fullViewport[3],x=this.fboCache.acquire(v,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,v,_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(v/ft),y=Math.round(_/ft),b=this.fboCache.acquire(w,y,"ssao blur",0);s.bindFramebuffer(b.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,0,ft/_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,y),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,y,$e,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,v,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=b.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,ft/v,0),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,y),s.screen.draw(),s.setViewport4fv(u.fullViewport),b.release(),f<1&&this.requestRender(1),M}};(0,o.Cg)([(0,d.MZ)()],gt.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],gt.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],gt.prototype,"isEnabled",void 0),gt=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],gt);const vt=.5;function _t(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/ft),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
706
706
|
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
707
707
|
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
708
708
|
}
|
|
@@ -723,7 +723,7 @@ return color;
|
|
|
723
723
|
`)}},71988:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,n,o)=>i.setUniform4fv(e,t(n,o),r))}}},72824:(e,t,r)=>{r.d(t,{Mh:()=>u,Zo:()=>h,gy:()=>p});var i=r(21818),n=r(29242),o=r(91829),a=r(96336),s=r(33752),l=r(31821),c=r(98353),d=r(35644);function u(e,t){switch(t.normalType){case 0:case 1:e.include(a.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new c.h("transformNormalGlobalFromModel",e=>e.transformNormalGlobalFromModel),new d.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)).code.add(l.H`void forwardNormal() {
|
|
724
724
|
vNormalWorld = transformNormalGlobalFromModel * normalModel();
|
|
725
725
|
vNormalView = transformNormalViewFromGlobal * vNormalWorld;
|
|
726
|
-
}`);break;case 2:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,n.vt)()}}class p extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,n.vt)(),this.toMapSpace=(0,o.vt)()}}},74038:(e,t,r)=>{r.d(t,{_:()=>i});class i{constructor(e,t,r,i,n,o=!1,a=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=a}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>o,SY:()=>l,mb:()=>a});var i=r(38954),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.q)(s,n.uY))&&null==l&&(null==o||1===o)&&(null==r||1===r)}const a=(0,n.CN)(1,1,.5),s=(0,n.CN)(0,.6,.2),l=(0,n.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>T});var i=r(49186),n=r(44208),o=r(53966),a=r(97768),s=r(93637),l=r(74887),c=r(94656),d=r(63907),u=r(67171);const h=()=>o.A.getLogger("esri/views/webgl/textureUtils");function p(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(m(n)||f(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function m(e){return(0,s.a4)(d.SB,e)}function f(e){return(0,s.a4)(d.iE,e)}function g(e){return null!=e&&"type"in e&&"compressed"===e.type}function v(e){return null!=e&&!g(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let n=Math.max(t,r);return 32879===e&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function w(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case d.ld.FLOAT:switch(e.pixelFormat){case 6408:return d.H0.RGBA32F;case 6407:return d.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case d.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return d.H0.RGBA8;case 6407:return d.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?d.iE.DEPTH24_STENCIL8:6402===t?d.SB.DEPTH_COMPONENT24:t,e.internalFormat}class b extends u.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case d.H0.R16F:case d.H0.R32F:case d.H0.R8_SNORM:case d.H0.R8:this.pixelFormat=6403;break;case d.H0.R8I:case d.H0.R8UI:case d.H0.R16I:case d.H0.R16UI:case d.H0.R32I:case d.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new b(e,t)}}const y=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),M=()=>o.A.getLogger("esri/views/webgl/Texture");let T=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=b.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return y?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(d.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!g(e)&&this._descriptor.internalFormat&&(0,s.a4)(d.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!g(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(t,r,n,o,a,s,l=0){s||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=w(c);const{context:d,pixelFormat:u,dataType:h,target:p,isImmutable:m}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const f=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||n<0||r+o>c.width||n+a>c.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=d;l&&(o&&a||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),_.pixelStorei(_.UNPACK_SKIP_ROWS,l)),v(s)?_.texSubImage2D(p,t,r,n,o,a,u,h,s):g(s)?_.compressedTexSubImage2D(p,t,r,n,o,a,c.internalFormat,s.levels[t]):_.texSubImage2D(p,t,r,n,o,a,u,h,s),l&&_.pixelStorei(_.UNPACK_SKIP_ROWS,0),d.bindTexture(f,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,n,o,a,s,l,c){c||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=w(d);const{context:u,pixelFormat:h,dataType:p,isImmutable:m,target:f}=d;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(f)||M().warn("Attempting to set 3D texture data on a non-3D texture");const v=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||n<0||o<0||r+a>d.width||n+s>d.height||o+l>d.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=u;if(g(c))c=c.levels[t],x.compressedTexSubImage3D(f,t,r,n,o,a,s,l,d.internalFormat,c);else{const e=c;x.texSubImage3D(f,t,r,n,o,a,s,l,h,p,e)}u.bindTexture(v,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,p(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,p(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,p(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),p(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(t,r){const n=this._descriptor,o=n.context?.gl;if(!o)return;(0,c.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),n.context.instanceCounter.increment(d.vt.Texture,this)),p(n);const a=n.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);n.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(o);const l=r??n.target,u=_(l);if(v(t))this._setDataFromTexImageSource(t,l);else{const{width:e,height:r,depth:a}=n;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(u&&null==a)throw new i.A("texture:missing-depth","Depth must be specified!");if(n.internalFormat=w(n),n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,n.internalFormat,n.hasMipmap,e,r,a),g(t)){if(!function(e){return null!=e&&(0,s.a4)(d.CQ,e)}(n.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,n.internalFormat,l)}else this._texImage(l,0,n.internalFormat,e,r,a,t),(0,c.Y2)(o),n.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),n.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=w(i);const n=_(t),{width:o,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,s),this._texImage(t,0,i.internalFormat,o,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,l=x(r,n,o,a),c=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)},c)}_texStorage(e,t,r,n,o,a){const{gl:s}=this._descriptor.context;if(!function(e){return d.XN.includes(e)}(t)&&!m(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,n,o,a):1;if(_(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,n,o,a)}else s.texStorage2D(e,l,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=_(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,n,o,a,u,h,r)}else l.texSubImage2D(e,t,0,0,n,o,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,n,o,a,0,u,h,d)}else l.texImage2D(e,t,r,n,o,0,u,h,d)}}_compressedTexImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,n,o,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,n,o,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,n,o,a,0,s)}else l.compressedTexImage2D(e,t,r,n,o,0,s)}async _compressOnWorker(t){const{width:r,height:i,context:n,flipped:o,preMultiplyAlpha:a,hasMipmap:s}=this._descriptor,c=this._descriptor.compress?.compressionTracker,d=this._descriptor.compress?.compressionCallback,{compressedTextureETC:u,compressedTextureS3TC:h}=n.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!u&&!h)return;this.abortCompression();const p=new AbortController;this._compressionAbortController=p,c?.increment();try{let n;t instanceof Uint8Array?n=t.buffer:(n=await createImageBitmap(t,{imageOrientation:o?"flipY":"none"}),(0,l.Te)(p));const c={data:n,width:r,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:a,hasMipmap:s,hasETC:!!u,hasS3TC:!!h},m=await e.compressionWorkerHandle.invoke(c,p.signal,"low");if((0,l.Te)(p),m.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=m.internalFormat,this._setData(m.compressedTexture),d?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||M().error("Texture compression failed!")}finally{c?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null)}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:a,target:s}=this._descriptor;const l=32879===s;if(null==r||null==n||l&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),a&&(1!==r||1!==n||l&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
|
|
726
|
+
}`);break;case 2:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,n.vt)()}}class p extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,n.vt)(),this.toMapSpace=(0,o.vt)()}}},74038:(e,t,r)=>{r.d(t,{_:()=>i});class i{constructor(e,t,r,i,n,o=!1,a=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=a}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>o,SY:()=>l,mb:()=>a});var i=r(38954),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.q)(s,n.uY))&&null==l&&(null==o||1===o)&&(null==r||1===r)}const a=(0,n.CN)(1,1,.5),s=(0,n.CN)(0,.6,.2),l=(0,n.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>T});var i=r(49186),n=r(44208),o=r(53966),a=r(97768),s=r(93637),l=r(74887),c=r(94656),d=r(63907),u=r(67171);const h=()=>o.A.getLogger("esri/views/webgl/textureUtils");function p(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(m(n)||f(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function m(e){return(0,s.a4)(d.SB,e)}function f(e){return(0,s.a4)(d.iE,e)}function g(e){return null!=e&&"type"in e&&"compressed"===e.type}function v(e){return null!=e&&!g(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let n=Math.max(t,r);return 32879===e&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function w(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case d.ld.FLOAT:switch(e.pixelFormat){case 6408:return d.H0.RGBA32F;case 6407:return d.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case d.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return d.H0.RGBA8;case 6407:return d.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?d.iE.DEPTH24_STENCIL8:6402===t?d.SB.DEPTH_COMPONENT24:t,e.internalFormat}class y extends u.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case d.H0.R16F:case d.H0.R32F:case d.H0.R8_SNORM:case d.H0.R8:this.pixelFormat=6403;break;case d.H0.R8I:case d.H0.R8UI:case d.H0.R16I:case d.H0.R16UI:case d.H0.R32I:case d.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new y(e,t)}}const b=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),M=()=>o.A.getLogger("esri/views/webgl/Texture");let T=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=y.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return b?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(d.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!g(e)&&this._descriptor.internalFormat&&(0,s.a4)(d.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!g(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(t,r,n,o,a,s,l=0){s||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=w(c);const{context:d,pixelFormat:u,dataType:h,target:p,isImmutable:m}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const f=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||n<0||r+o>c.width||n+a>c.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=d;l&&(o&&a||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),_.pixelStorei(_.UNPACK_SKIP_ROWS,l)),v(s)?_.texSubImage2D(p,t,r,n,o,a,u,h,s):g(s)?_.compressedTexSubImage2D(p,t,r,n,o,a,c.internalFormat,s.levels[t]):_.texSubImage2D(p,t,r,n,o,a,u,h,s),l&&_.pixelStorei(_.UNPACK_SKIP_ROWS,0),d.bindTexture(f,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,n,o,a,s,l,c){c||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=w(d);const{context:u,pixelFormat:h,dataType:p,isImmutable:m,target:f}=d;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(f)||M().warn("Attempting to set 3D texture data on a non-3D texture");const v=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||n<0||o<0||r+a>d.width||n+s>d.height||o+l>d.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=u;if(g(c))c=c.levels[t],x.compressedTexSubImage3D(f,t,r,n,o,a,s,l,d.internalFormat,c);else{const e=c;x.texSubImage3D(f,t,r,n,o,a,s,l,h,p,e)}u.bindTexture(v,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,p(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,p(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,p(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),p(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(t,r){const n=this._descriptor,o=n.context?.gl;if(!o)return;(0,c.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),n.context.instanceCounter.increment(d.vt.Texture,this)),p(n);const a=n.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);n.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(o);const l=r??n.target,u=_(l);if(v(t))this._setDataFromTexImageSource(t,l);else{const{width:e,height:r,depth:a}=n;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(u&&null==a)throw new i.A("texture:missing-depth","Depth must be specified!");if(n.internalFormat=w(n),n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,n.internalFormat,n.hasMipmap,e,r,a),g(t)){if(!function(e){return null!=e&&(0,s.a4)(d.CQ,e)}(n.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,n.internalFormat,l)}else this._texImage(l,0,n.internalFormat,e,r,a,t),(0,c.Y2)(o),n.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),n.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=w(i);const n=_(t),{width:o,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=a),n&&i.depth,n&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,a,s),this._texImage(t,0,i.internalFormat,o,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:a}=i,s=e.levels,l=x(r,n,o,a),c=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,n,o)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,n,o,a)},c)}_texStorage(e,t,r,n,o,a){const{gl:s}=this._descriptor.context;if(!function(e){return d.XN.includes(e)}(t)&&!m(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,n,o,a):1;if(_(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,n,o,a)}else s.texStorage2D(e,l,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=_(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,n,o,a,u,h,r)}else l.texSubImage2D(e,t,0,0,n,o,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,n,o,a,0,u,h,d)}else l.texImage2D(e,t,r,n,o,0,u,h,d)}}_compressedTexImage(e,t,r,n,o,a,s){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,n,o,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,n,o,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,n,o,a,0,s)}else l.compressedTexImage2D(e,t,r,n,o,0,s)}async _compressOnWorker(t){const{width:r,height:i,context:n,flipped:o,preMultiplyAlpha:a,hasMipmap:s}=this._descriptor,c=this._descriptor.compress?.compressionTracker,d=this._descriptor.compress?.compressionCallback,{compressedTextureETC:u,compressedTextureS3TC:h}=n.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!u&&!h)return;this.abortCompression();const p=new AbortController;this._compressionAbortController=p,c?.increment();try{let n;t instanceof Uint8Array?n=t.buffer:(n=await createImageBitmap(t,{imageOrientation:o?"flipY":"none"}),(0,l.Te)(p));const c={data:n,width:r,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:a,hasMipmap:s,hasETC:!!u,hasS3TC:!!h},m=await e.compressionWorkerHandle.invoke(c,p.signal,"low");if((0,l.Te)(p),m.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=m.internalFormat,this._setData(m.compressedTexture),d?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||M().error("Texture compression failed!")}finally{c?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null)}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:a,target:s}=this._descriptor;const l=32879===s;if(null==r||null==n||l&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),a&&(1!==r||1!==n||l&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),l&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
|
|
727
727
|
vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,new s.W("slicePlaneOrigin",(e,r)=>g(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>v(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>v(t,e,r,r.slicePlane?.basis2)))}function d(e,t){h(e,t,new s.W("slicePlaneOrigin",(e,r)=>g(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>v(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>v(t,e,r,r.slicePlane?.basis2)))}r(65786).Y;const u=l.H`struct SliceFactors {
|
|
728
728
|
float front;
|
|
729
729
|
float side0;
|
|
@@ -762,13 +762,13 @@ return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
|
|
|
762
762
|
}
|
|
763
763
|
bool rejectBySlice(vec3 pos) {
|
|
764
764
|
return sliceByPlane(pos);
|
|
765
|
-
}`;function h(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(u)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function p(e,t,r){return e.instancedDoublePrecision?(0,o.i)(_,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function m(e,t){return null!=e?(0,o.d)(x,t.origin,e):t.origin}function f(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.Tl)(
|
|
765
|
+
}`;function h(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(u)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function p(e,t,r){return e.instancedDoublePrecision?(0,o.i)(_,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function m(e,t){return null!=e?(0,o.d)(x,t.origin,e):t.origin}function f(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.Tl)(y,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function g(e,t,r){if(null==r.slicePlane)return a.uY;const i=p(e,t,r),n=m(i,r.slicePlane),s=f(e,i,r);return null!=s?(0,o.t)(x,n,s):n}function v(e,t,r,i){if(null==i||null==r.slicePlane)return a.uY;const n=p(e,t,r),s=m(n,r.slicePlane),l=f(e,n,r);return null!=l?((0,o.f)(w,i,s),(0,o.t)(x,s,l),(0,o.t)(w,w,l),(0,o.d)(w,w,x)):i}const _=(0,a.vt)(),x=(0,a.vt)(),w=(0,a.vt)(),y=(0,n.vt)()},76597:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(33120),n=r(31821);function o(e){(0,i.i$)(e),e.vertex.code.add(n.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
|
|
766
766
|
vec4 eye = view * vec4(pos, 1.0);
|
|
767
767
|
depth = calculateLinearDepth(nearFar,eye.z);
|
|
768
768
|
return proj * eye;
|
|
769
769
|
}`),e.vertex.code.add(n.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
|
|
770
770
|
return proj * (view * vec4(pos, 1.0));
|
|
771
|
-
}`)}},77108:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,n)=>i.setUniform2fv(e,t(n),r))}}},77194:(e,t,r)=>{r.d(t,{
|
|
771
|
+
}`)}},77108:(e,t,r)=>{r.d(t,{E:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,n)=>i.setUniform2fv(e,t(n),r))}}},77194:(e,t,r)=>{r.d(t,{PS:()=>n,fc:()=>o}),r(44208);var i=r(34727);class n{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(e,t,r,i){r?(this._scale=Math.min(r.divisor/(t-r.offset),1),this._angleFactor=function(e){return Math.abs(e)**3}(e),this._minScale=null!=i?Math.min(r.minPixelSize/i,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(e){const{_scale:t,_angleFactor:r,_minScale:n}=this;return e*(0,i.qE)((0,i.Cc)(t,1,r),n,1)}applyVec2(e,t){e[0]=this.apply(t[0]),e[1]=this.apply(t[1])}}class o{constructor(){this.evaluator=new n,this.alignmentEvaluator=new n}update(e,t,r,i,n,o){this.evaluator.update(e,t,r,i),this.alignmentEvaluator.update(e,t,n??r,(n?o:null)??i)}}},77695:(e,t,r)=>{r.d(t,{W:()=>u});var i=r(29242),n=r(48163),o=r(99208),a=r(47286),s=r(31821),l=r(35644),c=r(15976),d=r(63761);function u(e,t){const r=e.fragment,{hasVertexTangents:u,doubleSidedMode:h,hasNormalTexture:p,textureCoordinateType:m,bindType:f,hasNormalTextureTransform:g}=t;u?(e.attributes.add("tangent","vec4"),e.varyings.add("vTangent","vec4"),2===h?r.code.add(s.H`mat3 computeTangentSpace(vec3 normal) {
|
|
772
772
|
float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
|
|
773
773
|
vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
|
|
774
774
|
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
|
|
@@ -797,7 +797,7 @@ rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.co
|
|
|
797
797
|
}`))}},78662:(e,t,r)=>{r.d(t,{Gd:()=>l,VC:()=>c}),r(44208);var i=r(34727),n=(r(77690),r(29242),r(58083),r(9093)),o=r(38954),a=r(51850),s=(r(87317),r(91829),r(31756),r(26857),r(16943),r(65786));class l extends s.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}function c(e,t,r){if(!t.vvSize)return(0,o.i)(e,1,1,1),e;if(Number.isNaN(r[0]))return(0,o.c)(e,t.vvSize.fallback);for(let n=0;n<3;++n){const o=t.vvSize.offset[n]+r[0]*t.vvSize.factor[n];e[n]=(0,i.qE)(o,t.vvSize.minSize[n],t.vvSize.maxSize[n])}return e}(0,n.vt)(),(0,a.vt)(),(0,n.vt)()},82048:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821);function n(e,t=!0){e.attributes.add("position","vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
|
|
798
798
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
799
799
|
${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
|
|
800
|
-
`)}},82919:(e,t,r)=>{r.d(t,{DV:()=>v,C:()=>f,vt:()=>p,Qy:()=>m,ui:()=>g,ST:()=>w,bU:()=>
|
|
800
|
+
`)}},82919:(e,t,r)=>{r.d(t,{DV:()=>v,C:()=>f,vt:()=>p,Qy:()=>m,ui:()=>g,ST:()=>w,bU:()=>y,pw:()=>x,m7:()=>_,c8:()=>M});var i=r(4341),n=r(58083),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);function d(e){return e?{ray:(0,c.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,c.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>d());var u=r(27921),h=r(32114);function p(e){return e?[(0,u.vt)(e[0]),(0,u.vt)(e[1]),(0,u.vt)(e[2]),(0,u.vt)(e[3]),(0,u.vt)(e[4]),(0,u.vt)(e[5])]:[(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)(),(0,u.vt)()]}function m(){return[(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)()]}function f(e,t){for(let r=0;r<T;r++)(0,u.C)(e[r],t[r]);return e}function g(e,t,r,i=A){const a=(0,n.lw)(h.Rc.get(),t,e);(0,n.B8)(a,a);for(let e=0;e<C;++e){const t=(0,s.t)(h.Km.get(),S[e],a);(0,o.i)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}v(r,i)}function v(e,t){(0,u.Cr)(t[4],t[0],t[3],e[0]),(0,u.Cr)(t[1],t[5],t[6],e[1]),(0,u.Cr)(t[4],t[5],t[1],e[2]),(0,u.Cr)(t[3],t[2],t[6],e[3]),(0,u.Cr)(t[0],t[1],t[2],e[4]),(0,u.Cr)(t[5],t[4],t[7],e[5])}function _(e,t){for(let r=0;r<T;r++){const i=e[r];if(i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]>=t[3])return!1}return!0}function x(e,t){return b(e,function(e,t=d()){return(0,c.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,E.get()))}function w(e,t,r){return b(e,function(e,t,r=d()){const i=(0,o.l)(e.vector);return(0,c.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,E.get()))}function y(e,t){for(let r=0;r<T;r++)if((0,u.mN)(e[r],t)>0)return!1;return!0}function b(e,t){for(let r=0;r<T;r++)if(!(0,u.$Q)(e[r],t))return!1;return!0}const M={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},T=6,C=8,S=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],E=new i.I(d),A=m()},85079:(e,t,r)=>{function i(e){let t=0;return new Map(e.map(({name:e,count:r})=>{const i=[e,t];return 16===r?t+=4:9===r?t+=3:++t,i}))}function n(e){const t=new Map;let r=0;return e.forEach(e=>e.forEach(({name:e,count:i})=>{t.set(e,r),16===i?r+=4:9===i?r+=3:++r})),t}r.d(t,{Xk:()=>i,_u:()=>n})},87170:(e,t,r)=>{r.d(t,{V:()=>M});var i=r(24326),n=r(9093),o=r(38954),a=r(97146),s=r(57917),l=r(29920),c=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,o.d)(p,t,e),(0,o.d)(m,r,e),.5*(0,o.l)((0,o.h)(p,p,m))}r(32114),new d.I(u.vt),new d.I(()=>function(e){return e?{p0:(0,c.o8)(e.p0),p1:(0,c.o8)(e.p1),p2:(0,c.o8)(e.p2)}:{p0:(0,c.vt)(),p1:(0,c.vt)(),p2:(0,c.vt)()}}());const p=(0,c.vt)(),m=(0,c.vt)(),f=(0,c.vt)(),g=(0,c.vt)(),v=(0,c.vt)(),_=(0,c.vt)();class x{constructor(){this.uid=(0,i.c)()}}class w extends x{constructor(e){super(),this.highlightName=e,this.channel=0}}var y=r(620),b=r(94656);class M{constructor(e,t,r=null,n=0,o=null,s=-1){this.material=e,this.mapPositions=r,this.type=n,this.olidColor=o,this.edgeIndicesLength=s,this._highlights=null,this._highlightOptionsCounts=null,this.id=(0,i.c)(),this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,a.Dg)(r.indices)}),"position"===e&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new M(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,s.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,b.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.t)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.i)(t,0,0,0),(0,o.i)(_,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const l=n[e]*r,c=n[e+1]*r,d=n[e+2]*r;(0,o.i)(f,i[l],i[l+1],i[l+2]),(0,o.i)(g,i[c],i[c+1],i[c+2]),(0,o.i)(v,i[d],i[d+1],i[d+2]);const u=h(f,g,v);u?((0,o.f)(f,f,g),(0,o.f)(f,f,v),(0,o.g)(f,f,1/3*u),(0,o.f)(t,t,f),a+=u):((0,o.f)(_,_,f),(0,o.f)(_,_,g),(0,o.f)(_,_,v),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.g)(t,t,1/a),0):0===s||((0,o.g)(t,_,1/s),0)))}(this.attributes.get("position"),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get("position");return function(e,t,r){if(!e)return!1;(0,o.i)(r,0,0,0),(0,o.i)(_,0,0,0);let i=0,n=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],g[0]=s[u],g[1]=s[u+1],g[2]=s[u+2],(0,o.g)(f,(0,o.f)(f,f,g),.5);const h=(0,o.F)(f,g);h>0?((0,o.f)(r,r,(0,o.g)(f,f,h)),i+=h):0===i&&((0,o.f)(_,_,f),n++)}return 0!==i?((0,o.g)(r,r,1/i),!0):0!==n&&((0,o.g)(r,_,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.i)(t,0,0,0);let a=-1,s=0;for(let e=0;e<n.length;e++){const o=n[e]*r;a!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),a=o}return s>1&&(0,o.g)(t,t,1/s),s>0}(this.attributes.get("position"),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get("position");if(!e||0===e.indices.length)return null;const t=0===this.type?3:1;(0,y.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,a.tM)(e.indices.length/t);return new l.j(r,t,e)}get transformation(){return this._transformation??n.zK}set transformation(e){this._transformation=e&&e!==n.zK?(0,n.o8)(e):null}get highlights(){return this._highlights||T}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new w(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const T=new Set},89390:(e,t,r)=>{r.d(t,{kA:()=>C,a8:()=>M,eU:()=>T});var i=r(40876),n=(r(44208),r(38954)),o=r(51850),a=r(87317),s=r(91829),l=r(23205),c=r(14314),d=r(31821);function u(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new l.d("lightingAmbientSH0",({lighting:e})=>(0,n.i)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
801
801
|
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
802
802
|
return ambientLight * (1.0 - ambientOcclusion);
|
|
803
803
|
}`)):1===i?(r.uniforms.add(new c.I("lightingAmbientSH_R",({lighting:e})=>(0,a.s)(p,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3])),new c.I("lightingAmbientSH_G",({lighting:e})=>(0,a.s)(p,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3])),new c.I("lightingAmbientSH_B",({lighting:e})=>(0,a.s)(p,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
@@ -843,14 +843,14 @@ vec3 calculateAmbientRadiance(float ambientOcclusion)
|
|
|
843
843
|
{
|
|
844
844
|
vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
|
|
845
845
|
return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
|
|
846
|
-
}`))}const h=(0,o.vt)(),p=(0,s.vt)();var m=r(65836),f=r(98619),g=r(22393),v=r(89786),_=r(32976),x=r(33094);r(34727),(0,o.vt)();const w=.4;function
|
|
846
|
+
}`))}const h=(0,o.vt)(),p=(0,s.vt)();var m=r(65836),f=r(98619),g=r(22393),v=r(89786),_=r(32976),x=r(33094);r(34727),(0,o.vt)();const w=.4;function y(e){e.code.add(d.H`float mapChannel(float x, vec2 p) {
|
|
847
847
|
return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
|
|
848
848
|
}`),e.code.add(d.H`vec3 blackLevelSoftCompression(vec3 color, float averageAmbientRadiance) {
|
|
849
849
|
vec2 p = vec2(0.02, 0.0075) * averageAmbientRadiance;
|
|
850
850
|
return vec3(mapChannel(color.x, p), mapChannel(color.y, p), mapChannel(color.z, p));
|
|
851
|
-
}`)}function
|
|
851
|
+
}`)}function b(e){e.code.add(d.H`vec3 tonemapACES(vec3 x) {
|
|
852
852
|
return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
|
|
853
|
-
}`)}function M(e){e.constants.add("ambientBoostFactor","float",w)}function T(e){e.uniforms.add(new x.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function C(e,t){const r=e.fragment,{pbrMode:n,spherical:o,hasColorTexture:a}=t;r.include(m.n,t),0!==n&&r.include(g.c,t),e.include(u,t),r.include(v.p),r.include(
|
|
853
|
+
}`)}function M(e){e.constants.add("ambientBoostFactor","float",w)}function T(e){e.uniforms.add(new x.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function C(e,t){const r=e.fragment,{pbrMode:n,spherical:o,hasColorTexture:a}=t;r.include(m.n,t),0!==n&&r.include(g.c,t),e.include(u,t),r.include(v.p),r.include(b,t);const s=!(2===n&&!a);switch(s&&r.include(y),r.code.add(d.H`
|
|
854
854
|
const float GAMMA_SRGB = ${d.H.float(i.Tf)};
|
|
855
855
|
const float INV_GAMMA_SRGB = 0.4761904;
|
|
856
856
|
${(0,d.If)(0!==n,"const float GROUND_REFLECTANCE = 0.2;")}
|
|
@@ -938,7 +938,7 @@ vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceC
|
|
|
938
938
|
vec3 outColorLinear = outDiffColor + specularComponent;
|
|
939
939
|
vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
|
|
940
940
|
return outColor;
|
|
941
|
-
}`)}}(0,o.vt)()},89786:(e,t,r)=>{function i(e){const t=.3183098861837907;e.constants.add("PI","float",3.141592653589793),e.constants.add("LIGHT_NORMALIZATION","float",t),e.constants.add("INV_PI","float",t),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("TWO_PI","float",6.28318530717958)}r.d(t,{p:()=>i})},90239:(e,t,r)=>{function i(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>i})},90644:(e,t,r)=>{function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,n=32774,o=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>
|
|
941
|
+
}`)}}(0,o.vt)()},89786:(e,t,r)=>{function i(e){const t=.3183098861837907;e.constants.add("PI","float",3.141592653589793),e.constants.add("LIGHT_NORMALIZATION","float",t),e.constants.add("INV_PI","float",t),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("TWO_PI","float",6.28318530717958)}r.d(t,{p:()=>i})},90239:(e,t,r)=>{function i(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>i})},90644:(e,t,r)=>{function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,n=32774,o=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>y,RC:()=>o,T8:()=>a,Uy:()=>d,Xt:()=>c,kn:()=>u,p3:()=>n}),i(0,771),i(1,0),i(1,1);const o=i(1,771),a=n(770,1,771,771),s={face:1029,mode:2305},l={face:1028,mode:2305},c=e=>2===e?s:1===e?l:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return T.intern(e)}function p(e){return S.intern(e)}function m(e){return A.intern(e)}function f(e){return I.intern(e)}function g(e){return O.intern(e)}function v(e){return D.intern(e)}function _(e){return H.intern(e)}function x(e){return z.intern(e)}function w(e){return G.intern(e)}function y(e){return V.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function M(e){return"["+e.join(",")+"]"}const T=new b(C,e=>({__tag:"Blending",...e}));function C(e){return e?M([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const S=new b(E,e=>({__tag:"Culling",...e}));function E(e){return e?M([e.face,e.mode]):null}const A=new b(R,e=>({__tag:"PolygonOffset",...e}));function R(e){return e?M([e.factor,e.units]):null}const I=new b(F,e=>({__tag:"DepthTest",...e}));function F(e){return e?M([e.func]):null}const O=new b(P,e=>({__tag:"StencilTest",...e}));function P(e){return e?M([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const D=new b(N,e=>({__tag:"DepthWrite",...e}));function N(e){return e?M([e.zNear,e.zFar]):null}const H=new b(L,e=>({__tag:"ColorWrite",...e}));function L(e){return e?M([e.r,e.g,e.b,e.a]):null}const z=new b(B,e=>({__tag:"StencilWrite",...e}));function B(e){return e?M([e.mask]):null}const G=new b(U,e=>({__tag:"DrawBuffers",...e}));function U(e){return e?M(e.buffers):null}const V=new b(function(e){return e?M([C(e.blending),E(e.culling),R(e.polygonOffset),F(e.depthTest),P(e.stencilTest),N(e.depthWrite),L(e.colorWrite),B(e.stencilWrite),U(e.drawBuffers)]):null},e=>({blending:h(e.blending),culling:p(e.culling),polygonOffset:m(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:x(e.stencilWrite),drawBuffers:w(e.drawBuffers)}))},92700:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821);function n(e,t){t.hasVertexColors?(e.attributes.add("color","vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`
|
|
942
942
|
void forwardNormalizedVertexColor() { vColor = color * ${i.H.float(1/255)}; }
|
|
943
943
|
`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
|
|
944
944
|
void forwardNormalizedVertexColor() {}`)}},94656:(e,t,r)=>{r.d(t,{Y2:()=>c,en:()=>l});var i=r(49186),n=r(44208),o=r(53966);const a=()=>o.A.getLogger("esri.views.webgl.checkWebGLError"),s=!!(0,n.A)("enable-feature:webgl-debug");function l(){return s}function c(e,t=l()){if(t){const t=function(e){switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e);if(t){const e=(new Error).stack;a().error(new i.A("webgl-error","WebGL error occurred",{message:t,stack:e}))}}}},95774:(e,t,r)=>{r.d(t,{S:()=>p,b:()=>h});var i=r(82048),n=r(52540),o=r(68259),a=r(20304),s=r(31821),l=r(15976),c=r(63761),d=r(14113);const u=4;function h(){const e=new d.N5,t=e.fragment;e.include(i.c);const r=(u+1)/2,h=1/(2*r*r);return t.include(n.E),t.uniforms.add(new c.N("depthMap",e=>e.depthTexture),new l.o("tex",e=>e.colorTexture),new o.t("blurSize",e=>e.blurSize),new a.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(s.H`
|