@arcgis/core 4.34.0-next.48 → 4.34.0-next.49
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/analysis/ElevationProfileUnits.js +1 -1
- package/analysis/support/elevationProfileLineTypes.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{6ce2f86b9b1d2f2b8675.js → 0874b88d5ae7c2b78b3b.js} +1 -1
- package/assets/esri/core/workers/chunks/{90a97ffba604c1c35532.js → 0b52c0ca432761076076.js} +65 -65
- package/assets/esri/core/workers/chunks/0c129b78e5cfe96795e1.js +1 -0
- package/assets/esri/core/workers/chunks/{9f869b331dff505b6b55.js → 1d234c057a6671acc59f.js} +1 -1
- package/assets/esri/core/workers/chunks/4cc982c99d84e896d535.js +1 -0
- package/assets/esri/core/workers/chunks/4e2b125e6e3945985a54.js +1 -0
- package/assets/esri/core/workers/chunks/5a016dcd3192d42d363e.js +1 -0
- package/assets/esri/core/workers/chunks/{574ea32d6c257e0d2079.js → 5b0c42bb95d81085061d.js} +1 -1
- package/assets/esri/core/workers/chunks/72ecf49d03bb24bf0998.js +1 -0
- package/assets/esri/core/workers/chunks/781b59ba0cabe78bc122.js +1 -0
- package/assets/esri/core/workers/chunks/{28a85997c9003cacdefb.js → 8e3c09c3524654830b14.js} +1 -1
- package/assets/esri/core/workers/chunks/bd7e303dd64a27ba6846.js +1 -0
- package/assets/esri/core/workers/chunks/cb8f2ce22274990b359c.js +1 -0
- package/assets/esri/core/workers/chunks/{0b67b16d7e6c030bcfc7.js → d4766c97d97554b3b408.js} +1 -1
- package/assets/esri/core/workers/chunks/ddd6597a66ec6b972f9c.js +1 -0
- package/chunks/LineSeries.js +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/config.js +1 -1
- package/core/lang.js +1 -1
- package/core/timeUtils.js +1 -1
- package/editing/sharedTemplates/support/sharedTemplateErrors.js +1 -1
- package/interfaces.d.ts +44 -10
- package/kernel.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/support/rasterDatasets/pixelReader.js +1 -1
- package/libs/linkchartlayout/LinkChartLayout.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/UtilityNetworkLookupHelper.js +1 -1
- package/networks/support/networkFieldUtils.js +1 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +4 -4
- package/rest/networks/support/CircuitLocation.js +5 -0
- package/rest/networks/support/CircuitSection.js +5 -0
- package/rest/support/Query.js +1 -1
- package/rest/support/RelationshipQuery.js +1 -1
- package/rest/utils.js +1 -1
- package/support/revision.js +1 -1
- package/support/webSceneUtils.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/LabelManager.js +1 -1
- package/views/2d/engine/flow/utils.js +1 -1
- package/views/2d/engine/imagery/RasterBitmap.js +1 -1
- package/views/2d/engine/webgl/DisplayId.js +1 -1
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
- package/views/2d/interactive/editingTools.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +5 -0
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/environment/SunLighting.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayerFactory.js +1 -1
- package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Matrix4sDrawUniform.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/Matrix4sPassUniform.js +1 -1
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileLineQueryComputation.js +5 -0
- package/views/analysis/ElevationProfile/ProfileGenerationError.js +5 -0
- package/views/analysis/ElevationProfile/constants.js +5 -0
- package/views/analysis/ElevationProfile/elevationQuerySourceUtils.js +5 -0
- package/views/analysis/ElevationProfile/geometryUtils.js +5 -0
- package/views/analysis/ElevationProfile/profileUtils.js +5 -0
- package/views/analysis/ElevationProfile/statisticsUtils.js +5 -0
- package/views/analysis/ElevationProfile/traversalUtils.js +5 -0
- package/views/analysis/ElevationProfile/unitUtils.js +5 -0
- package/views/analysis/ElevationProfileResult.js +1 -1
- package/views/support/LayerLayerViewInfo.js +1 -1
- package/views/support/highlightOptionsUtils.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/webscene/SunLighting.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Daylight/support/daylightUtils.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/errors.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/ShadowCast/css.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
- package/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/arcade/credentials.js +0 -5
- package/arcade/featureset/support/Guid.js +0 -5
- package/arcade/request.js +0 -5
- package/arcade/serviceAreaMetaData.js +0 -5
- package/assets/esri/core/workers/chunks/45b450c045d5fadf71b6.js +0 -1
- package/assets/esri/core/workers/chunks/4f5e72993a4f5180d703.js +0 -1
- package/assets/esri/core/workers/chunks/516b30778cd54d29e362.js +0 -1
- package/assets/esri/core/workers/chunks/576792b5e1e13084adba.js +0 -1
- package/assets/esri/core/workers/chunks/5f7dc9657803ae3140a6.js +0 -1
- package/assets/esri/core/workers/chunks/8d51b6823ef5d290c670.js +0 -1
- package/assets/esri/core/workers/chunks/947085d176bd3a930e6f.js +0 -1
- package/assets/esri/core/workers/chunks/d09ded9fb621491e2466.js +0 -1
- package/assets/esri/core/workers/chunks/eb61b47df99a54a364c8.js +0 -1
- package/rest/versionManagement/support/GetVersionInfosResult.js +0 -5
- package/symbols/cim/quantizeTime.js +0 -5
- package/undoredo/support/DataEditingContext.js +0 -5
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/WriterRegistry.js +0 -5
- package/views/2d/interactive/editingTools/MediaTransformToolsWrapper.js +0 -5
- package/views/2d/layers/features/sources/strategies/chunks/FeatureSourceEndChunk.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloat16Encoding.glsl.js +0 -25
- package/webscene/spec-certification/index.js +0 -5
- package/widgets/HighlightConfigurator.js +0 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[998],{1843:(e,t,r)=>{r.d(t,{BP:()=>d,l5:()=>h});var i=r(20498),n=r(13030),o=r(90239),s=r(4431),a=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 cachedMemory(){return this.byteLength}dispose(){}}class u{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,s.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,a.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 u;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 d(){return new u}class h{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:p(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const m=[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 p(e){return`${e.ElementType}_${e.ElementCount}`}function f(e){return g.get(e)}const g=new Map;m.forEach(e=>g.set(p(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),s=r(25634),a=r(11725),l=r(33524),c=r(70328),u=r(620);class d{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const h=(0,c.vt)();function m(e,t,r,n,o,s){if(!e.visible)return;const a=(0,i.a)(S,n,r),l=(e,t,r)=>{s(e,r,t)},c=new d(!1,t.options.normalRequired);if(e.boundingInfo){(0,u.vA)(0===e.type);const i=t.tolerance;f(e.boundingInfo,r,a,i,o,c,l)}else{const t=e.attributes.get("position"),n=t.indices;!function(e,t,r,n,o,s,a,l,c,u){const d=t,h=E,m=Math.abs(d[0]),p=Math.abs(d[1]),f=Math.abs(d[2]),g=m>=p?m>=f?0:2:p>=f?1:2,b=g,y=d[b]<0?2:1,M=(g+y)%3,T=(g+(3-y))%3,C=d[M]/d[b],S=d[T]/d[b],A=1/d[b],I=v,R=_,F=x,{normalRequired:O}=c;for(let t=r;t<n;++t){const r=3*t,n=a*o[r];(0,i.i)(h[0],s[n+0],s[n+1],s[n+2]);const c=a*o[r+1];(0,i.i)(h[1],s[c+0],s[c+1],s[c+2]);const d=a*o[r+2];(0,i.i)(h[2],s[d+0],s[d+1],s[d+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 m=I[M]-C*I[b],p=I[T]-S*I[b],f=R[M]-C*R[b],g=R[T]-S*R[b],v=F[M]-C*F[b],_=F[T]-S*F[b],x=v*g-_*f,y=m*_-p*v,E=f*p-g*m;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[b])+y*(A*R[b])+E*(A*F[b]);if(D*Math.sign(P)<0)continue;const N=D/P;N>=0&&u(N,t,O?w(h):null)}}(r,a,0,n.length/3,n,t.data,t.stride,o,c,l)}}const p=(0,n.vt)();function f(e,t,r,n,o,s,a){if(null==e)return;const l=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,p);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 s=Math.min(n,o),a=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(a=Math.min(a,Math.max(l,c)),a<0)return!1;if(s=Math.max(s,Math.min(l,c)),s>a)return!1;const u=(e[2]-i-t[2])*r[2],d=(e[5]+i-t[2])*r[2];return a=Math.min(a,Math.max(u,d)),!(a<0)&&(s=Math.max(s,Math.min(u,d)),!(s>a)&&s<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,s,a);return}}!function(e,t,r,i,n,o,s,a,l,c,u){const d=e[0],h=e[1],m=e[2],p=t[0],f=t[1],v=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=a[e],r=3*t,i=s*n[r];let c=o[i],x=o[i+1],w=o[i+2];const y=s*n[r+1];let M=o[y],T=o[y+1],S=o[y+2];const E=s*n[r+2];let A=o[E],I=o[E+1],R=o[E+2];null!=l&&([c,x,w]=l.applyToVertex(c,x,w,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-w,D=A-c,N=I-x,H=R-w,L=f*H-N*v,z=v*D-H*p,B=p*N-D*f,G=F*L+O*z+P*B;if(Math.abs(G)<=C)continue;const U=d-c,V=h-x,j=m-w,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=p*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&&u(Y,t,_?b(F,O,P,D,N,H,g):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,o,s,a)}}const g=(0,n.vt)();const v=(0,n.vt)(),_=(0,n.vt)(),x=(0,n.vt)();function b(e,t,r,n,o,s,a){return(0,i.i)(y,e,t,r),(0,i.i)(M,n,o,s),(0,i.h)(a,y,M),(0,i.n)(a,a),a}function w(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,s,a){const l=this.layout.createView(e).getField("position",I.xs);if(null==l)return;const c=(0,i.a)(O,s,o),u=l.count/3,d=n.options.normalRequired;!function(e,t,r,i,n,o,s,a){const l=e[0],c=e[1],u=e[2],d=t[0],h=t[1],m=t[2];for(let e=0;e<i;++e){const t=3*e,r=t+1,i=t+2,p=o*t,f=n[p],v=n[p+1],_=n[p+2],x=o*r,w=o*i,y=n[x]-f,M=n[x+1]-v,T=n[x+2]-_,S=n[w]-f,E=n[w+1]-v,A=n[w+2]-_,I=h*A-E*m,R=m*S-A*d,F=d*E-S*h,O=y*I+M*R+T*F;if(Math.abs(O)<=C)continue;const P=l-f,D=c-v,N=u-_,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=d*L+h*z+m*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&&a(U,e,s?b(y,M,T,S,E,A,g):null)}}(o,c,0,u,l.typedBuffer,l.typedBufferStride,d,(e,t,r)=>a(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=ue,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,u.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,u.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=se,n=ae;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 s=(0,te.wp)(se,o);s.sort(),t.modelScaleFactors.set(e,0,s[1]),t.modelScaleFactors.set(e,1,s[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,ae),r.modelOrigin.getVec(e,se),t[0]=ae[0],t[1]=ae[1],t[2]=ae[2],t[3]=0,t[4]=ae[3],t[5]=ae[4],t[6]=ae[5],t[7]=0,t[8]=ae[6],t[9]=ae[7],t[10]=ae[8],t[11]=0,t[12]=se[0],t[13]=se[1],t[14]=se[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(se,this,e),t*=Math.max(se[0],se[1],se[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(se,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(se[0],se[1],se[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(ue,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 se=(0,n.vt)(),ae=(0,K.vt)(),le=(0,ee.vt)(),ce=(0,ee.vt)(),ue=64,de=(0,H.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var he=r(74810),me=r(28491),pe=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.$(me.D,()=>r.e(5141).then(r.bind(r,5141)))){const n=[(0,N.U)(we(t))];t.instanced&&t.instancedDoublePrecision&&n.push((0,N.U)(function(e){return oe(de.clone(),e)}(t))),super(e,t,i,(0,fe._u)(n))}_makePipeline(e,t){const{oitPass:r,output:i,transparent:n,cullFace:s,customDepthTest:a,hasOccludees:c}=e;return(0,pe.Ey)({blending:(0,o.RN)(i)&&n?(0,l.Yf)(r):null,culling:be(e)?(0,pe.Xt)(s):null,depthTest:{func:(0,l.K_)(r,xe(a))},depthWrite:(0,l.z5)(e),drawBuffers:(0,B.L)(i,(0,l.m6)(r,i)),colorWrite:pe.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 be(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function we(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.hasBloom=!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,"hasBloom",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 a.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=we(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:s,doubleSidedType:a}=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:s&&"normal"===a?1:s&&"winding-order"===a?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,i.hasBloom=(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,s){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(He,t[12],t[13],t[14]);let s=null;switch(r.viewingMode){case 1:s=(0,i.n)(De,He);break;case 2:s=(0,i.c)(De,Pe)}let a=0;const l=(0,i.d)(Le,He,e.eye),c=(0,i.l)(l),u=(0,i.g)(l,l,1/c);let d=null;this.parameters.screenSizePerspective&&(d=(0,i.e)(s,u)),a+=(0,P.kE)(e,c,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective),(0,i.g)(s,s,a),(0,i.o)(Ne,s,r.transform.inverseRotation),n=(0,i.d)(Fe,n,Ne),o=(0,i.d)(Oe,o,Ne)}m(e,r,n,o,(0,A.ou)(r.verticalOffset),s)}createGLMaterial(e){return new Ae(e)}createBufferWriter(){return new F(this._layout)}get transparent(){return Re(this.parameters)}}class Ae extends s.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:s,textureAlphaMode:a,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=o||null!=s)&&1!==a&&2!==a&&"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 s=e.fields.get(o),a=s.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")}}(s.constructor.ElementType),c=s.offset,u=s.optional?.glNormalized??!1;return new n._(o,a,l,c,r,u,t)})}},6867:(e,t,r)=>{r.d(t,{i:()=>u});var i=r(58083),n=r(9093),o=r(38954),s=r(51850),a=r(87317),l=r(91829),c=r(71351);class u{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!!d(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!d(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)(m,this.normal),m[3]=0,(0,a.t)(m,m,this.transformation),(0,o.c)(e,m),(0,o.n)(e,e)}constructor(e){this.intersector=0,this.normal=(0,s.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,a,l,c,u){this.intersector=e,this.distance=r,(0,o.c)(this.normal,a??s.Cb),(0,i.C)(this.transformation,l??n.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=u}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 d(e){return null!=e?.distance}const h=(0,s.vt)(),m=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>n});var i=r(31821);function n(e,t){t.snowCover&&(e.code.add(i.H`float getSnow(vec3 normal, vec3 normalGround) {
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[998],{1843:(e,t,r)=>{r.d(t,{BP:()=>d,l5:()=>h});var i=r(20498),n=r(13030),o=r(90239),s=r(4431),a=r(620),c=r(85079);class l{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 l(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 cachedMemory(){return this.byteLength}dispose(){}}class u{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,c.Xk)((0,s.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,a.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 l(this,e)}createView(e){return new l(this,e)}clone(){const e=new u;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 d(){return new u}class h{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:p(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const m=[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 p(e){return`${e.ElementType}_${e.ElementCount}`}function f(e){return g.get(e)}const g=new Map;m.forEach(e=>g.set(p(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),s=r(25634),a=r(11725),c=r(33524),l=r(70328),u=r(620);class d{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const h=(0,l.vt)();function m(e,t,r,n,o,s){if(!e.visible)return;const a=(0,i.a)(S,n,r),c=(e,t,r)=>{s(e,r,t)},l=new d(!1,t.options.normalRequired);if(e.boundingInfo){(0,u.vA)(0===e.type);const i=t.tolerance;f(e.boundingInfo,r,a,i,o,l,c)}else{const t=e.attributes.get("position"),n=t.indices;!function(e,t,r,n,o,s,a,c,l,u){const d=t,h=E,m=Math.abs(d[0]),p=Math.abs(d[1]),f=Math.abs(d[2]),g=m>=p?m>=f?0:2:p>=f?1:2,b=g,y=d[b]<0?2:1,M=(g+y)%3,T=(g+(3-y))%3,C=d[M]/d[b],S=d[T]/d[b],A=1/d[b],I=v,R=_,F=x,{normalRequired:O}=l;for(let t=r;t<n;++t){const r=3*t,n=a*o[r];(0,i.i)(h[0],s[n+0],s[n+1],s[n+2]);const l=a*o[r+1];(0,i.i)(h[1],s[l+0],s[l+1],s[l+2]);const d=a*o[r+2];(0,i.i)(h[2],s[d+0],s[d+1],s[d+2]),c&&((0,i.c)(h[0],c.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],c.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],c.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 m=I[M]-C*I[b],p=I[T]-S*I[b],f=R[M]-C*R[b],g=R[T]-S*R[b],v=F[M]-C*F[b],_=F[T]-S*F[b],x=v*g-_*f,y=m*_-p*v,E=f*p-g*m;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[b])+y*(A*R[b])+E*(A*F[b]);if(D*Math.sign(P)<0)continue;const N=D/P;N>=0&&u(N,t,O?w(h):null)}}(r,a,0,n.length/3,n,t.data,t.stride,o,l,c)}}const p=(0,n.vt)();function f(e,t,r,n,o,s,a){if(null==e)return;const c=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,p);if((0,l.Ne)(h,e.bbMin),(0,l.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 s=Math.min(n,o),a=Math.max(n,o);const c=(e[1]-i-t[1])*r[1],l=(e[4]+i-t[1])*r[1];if(a=Math.min(a,Math.max(c,l)),a<0)return!1;if(s=Math.max(s,Math.min(c,l)),s>a)return!1;const u=(e[2]-i-t[2])*r[2],d=(e[5]+i-t[2])*r[2];return a=Math.min(a,Math.max(u,d)),!(a<0)&&(s=Math.max(s,Math.min(u,d)),!(s>a)&&s<1/0)}(e,t,r,i)}(h,t,c,n)){const{primitiveIndices:i,position:c}=e,l=i?i.length:c.indices.length/3;if(l>T){const i=e.getChildren();if(void 0!==i){for(const e of i)f(e,t,r,n,o,s,a);return}}!function(e,t,r,i,n,o,s,a,c,l,u){const d=e[0],h=e[1],m=e[2],p=t[0],f=t[1],v=t[2],{normalRequired:_}=l;for(let e=0;e<i;++e){const t=a[e],r=3*t,i=s*n[r];let l=o[i],x=o[i+1],w=o[i+2];const y=s*n[r+1];let M=o[y],T=o[y+1],S=o[y+2];const E=s*n[r+2];let A=o[E],I=o[E+1],R=o[E+2];null!=c&&([l,x,w]=c.applyToVertex(l,x,w,e),[M,T,S]=c.applyToVertex(M,T,S,e),[A,I,R]=c.applyToVertex(A,I,R,e));const F=M-l,O=T-x,P=S-w,D=A-l,N=I-x,H=R-w,L=f*H-N*v,z=v*D-H*p,B=p*N-D*f,G=F*L+O*z+P*B;if(Math.abs(G)<=C)continue;const U=d-l,V=h-x,j=m-w,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=p*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&&u(Y,t,_?b(F,O,P,D,N,H,g):null)}}(t,r,0,l,c.indices,c.data,c.stride,i,o,s,a)}}const g=(0,n.vt)();const v=(0,n.vt)(),_=(0,n.vt)(),x=(0,n.vt)();function b(e,t,r,n,o,s,a){return(0,i.i)(y,e,t,r),(0,i.i)(M,n,o,s),(0,i.h)(a,y,M),(0,i.n)(a,a),a}function w(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,s,a){const c=this.layout.createView(e).getField("position",I.xs);if(null==c)return;const l=(0,i.a)(O,s,o),u=c.count/3,d=n.options.normalRequired;!function(e,t,r,i,n,o,s,a){const c=e[0],l=e[1],u=e[2],d=t[0],h=t[1],m=t[2];for(let e=0;e<i;++e){const t=3*e,r=t+1,i=t+2,p=o*t,f=n[p],v=n[p+1],_=n[p+2],x=o*r,w=o*i,y=n[x]-f,M=n[x+1]-v,T=n[x+2]-_,S=n[w]-f,E=n[w+1]-v,A=n[w+2]-_,I=h*A-E*m,R=m*S-A*d,F=d*E-S*h,O=y*I+M*R+T*F;if(Math.abs(O)<=C)continue;const P=c-f,D=l-v,N=u-_,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=d*L+h*z+m*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&&a(U,e,s?b(y,M,T,S,E,A,g):null)}}(o,l,0,u,c.typedBuffer,c.typedBufferStride,d,(e,t,r)=>a(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=ue,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,u.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,u.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=se,n=ae;t.localTransform.getMat(e,ce),t.globalTransform.getMat(e,le);const o=(0,Q.lw)(le,le,ce);(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 s=(0,te.wp)(se,o);s.sort(),t.modelScaleFactors.set(e,0,s[1]),t.modelScaleFactors.set(e,1,s[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,ae),r.modelOrigin.getVec(e,se),t[0]=ae[0],t[1]=ae[1],t[2]=ae[2],t[3]=0,t[4]=ae[3],t[5]=ae[4],t[6]=ae[5],t[7]=0,t[8]=ae[6],t[9]=ae[7],t[10]=ae[8],t[11]=0,t[12]=se[0],t[13]=se[1],t[14]=se[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(se,this,e),t*=Math.max(se[0],se[1],se[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(se,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(se[0],se[1],se[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(ue,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 se=(0,n.vt)(),ae=(0,K.vt)(),ce=(0,ee.vt)(),le=(0,ee.vt)(),ue=64,de=(0,H.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var he=r(74810),me=r(28491),pe=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.$(me.D,()=>r.e(5141).then(r.bind(r,5141)))){const n=[(0,N.U)(we(t))];t.instanced&&t.instancedDoublePrecision&&n.push((0,N.U)(function(e){return oe(de.clone(),e)}(t))),super(e,t,i,(0,fe._u)(n))}_makePipeline(e,t){const{oitPass:r,output:i,transparent:n,cullFace:s,customDepthTest:a,hasOccludees:l}=e;return(0,pe.Ey)({blending:(0,o.RN)(i)&&n?(0,c.Yf)(r):null,culling:be(e)?(0,pe.Xt)(s):null,depthTest:{func:(0,c.K_)(r,xe(a))},depthWrite:(0,c.z5)(e),drawBuffers:(0,B.L)(i,(0,c.m6)(r,i)),colorWrite:pe.kn,stencilWrite:l?U:null,stencilTest:l?t?j:V:null,polygonOffset:(0,c.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 be(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function we(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.hasBloom=!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,"hasBloom",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 a.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=we(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:s,doubleSidedType:a}=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:s&&"normal"===a?1:s&&"winding-order"===a?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<c.xt,i.snowCover=t.snowCover,i.hasBloom=(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,s){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(He,t[12],t[13],t[14]);let s=null;switch(r.viewingMode){case 1:s=(0,i.n)(De,He);break;case 2:s=(0,i.c)(De,Pe)}let a=0;const c=(0,i.d)(Le,He,e.eye),l=(0,i.l)(c),u=(0,i.g)(c,c,1/l);let d=null;this.parameters.screenSizePerspective&&(d=(0,i.e)(s,u)),a+=(0,P.kE)(e,l,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective),(0,i.g)(s,s,a),(0,i.o)(Ne,s,r.transform.inverseRotation),n=(0,i.d)(Fe,n,Ne),o=(0,i.d)(Oe,o,Ne)}m(e,r,n,o,(0,A.ou)(r.verticalOffset),s)}createGLMaterial(e){return new Ae(e)}createBufferWriter(){return new F(this._layout)}get transparent(){return Re(this.parameters)}}class Ae extends s.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:s,textureAlphaMode:a,colorMixMode:c}=e,l=i[3];return t||r<1&&"replace"!==c||l<1&&"ignore"!==c||n<1||(null!=o||null!=s)&&1!==a&&2!==a&&"replace"!==c}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 s=e.fields.get(o),a=s.constructor.ElementCount,c=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")}}(s.constructor.ElementType),l=s.offset,u=s.optional?.glNormalized??!1;return new n._(o,a,c,l,r,u,t)})}},6867:(e,t,r)=>{r.d(t,{i:()=>u});var i=r(58083),n=r(9093),o=r(38954),s=r(51850),a=r(87317),c=r(91829),l=r(71351);class u{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!!d(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!d(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)(m,this.normal),m[3]=0,(0,a.t)(m,m,this.transformation),(0,o.c)(e,m),(0,o.n)(e,e)}constructor(e){this.intersector=0,this.normal=(0,s.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,l.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=0,(0,l.C)(e,this._ray)}set(e,t,r,a,c,l,u){this.intersector=e,this.distance=r,(0,o.c)(this.normal,a??s.Cb),(0,i.C)(this.transformation,c??n.zK),this.target=t,this.drapedLayerOrder=l,this.renderPriority=u}copy(e){(0,l.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 d(e){return null!=e?.distance}const h=(0,s.vt)(),m=(0,c.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>n});var i=r(31821);function n(e,t){t.snowCover&&(e.code.add(i.H`float getSnow(vec3 normal, vec3 normalGround) {
|
|
2
2
|
return smoothstep(0.5, 0.55, dot(normal, normalGround));
|
|
3
3
|
}`),e.code.add(i.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
|
|
4
4
|
return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
|
|
5
5
|
}
|
|
6
6
|
vec4 snowCoverForEmissions(vec4 emission, float snow) {
|
|
7
7
|
return mix(emission, vec4(0.0), snow);
|
|
8
|
-
}`))}},11725:(e,t,r)=>{r.d(t,{i:()=>a});var i=r(24326),n=r(35256),o=r(43616),s=r(65786);class a{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,o.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,o.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new n.E){return r.output=e,r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},11868:(e,t,r)=>{r.d(t,{Wz:()=>o,oe:()=>n});var i=r(34275);function n(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function o(e){return(Array.isArray(e)?e.length:e.byteLength/8)<=i.y9?Array.from(e):new Float32Array(e)}},11964:(e,t,r)=>{r.d(t,{Cr:()=>u,H6:()=>m,LV:()=>c,_I:()=>h,kb:()=>d,vt:()=>l});var i=r(34727),n=r(4341),o=r(38954),s=r(51850),a=r(32114);function l(e){return e?{origin:(0,s.o8)(e.origin),vector:(0,s.o8)(e.vector)}:{origin:(0,s.vt)(),vector:(0,s.vt)()}}function c(e,t){const r=p.get();return r.origin=e,r.vector=t,r}function u(e,t,r=l()){return(0,o.c)(r.origin,e),(0,o.d)(r.vector,t,e),r}function d(e,t){const r=(0,o.d)(a.rq.get(),t,e.origin),n=(0,o.e)(e.vector,r),s=(0,o.e)(e.vector,e.vector),l=(0,i.qE)(n/s,0,1),c=(0,o.d)(a.rq.get(),(0,o.g)(a.rq.get(),e.vector,l),r);return(0,o.e)(c,c)}function h(e,t,r){return m(e,t,0,1,r)}function m(e,t,r,n,s){const{vector:l,origin:c}=e,u=(0,o.d)(a.rq.get(),t,c),d=(0,o.e)(l,u)/(0,o.k)(l);return(0,o.g)(s,l,(0,i.qE)(d,r,n)),(0,o.f)(s,s,e.origin)}(0,s.vt)(),(0,s.vt)();const p=new n.I(()=>l())},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},14113:(e,t,r)=>{r.d(t,{N5:()=>a});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class a extends s{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new h,this.varyings=new m,this.extensions=new p,this.outputs=new f}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,s=o.uniforms.generateSource(),a=o.code.generateSource(),l=o.main.generateSource(t),c="vertex"===e?_:v,u=o.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${r.join("\n")}\n${c}\n${u.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${n.join("\n")}\n${d.join("\n")}\n${a.join("\n")}\n${l.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let s=0;s<i;++s)r[s](e,o,t,n)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class d extends s{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new u(this),this.constants=new g(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1,flat:r?.flat??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+(r.flat||"int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?p.ALLOWLIST_VERTEX:p.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(e=>t.includes(e)).map(e=>`#extension ${e} : enable`)}static{this.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"]}static{this.ALLOWLIST_VERTEX=[]}}class f{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:f.DEFAULT_NAME,type:f.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class g{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=g._numberToFloatStr(r);break;case"int":i=g._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])}, ${g._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>g._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",_="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},15581:(e,t,r)=>{r.d(t,{S:()=>x,b:()=>g,g:()=>v});var i=r(37585),n=r(48163),o=r(82048),s=r(52540),a=r(34845),l=r(77108),c=r(47286),u=r(33094),d=r(20304),h=r(31821),m=r(63761),p=r(14113);const f=16;function g(){const e=new p.N5,t=e.fragment;return e.include(o.c),e.include(a.Ir),t.include(s.E),t.uniforms.add(new u.U("radius",e=>v(e.camera))).code.add(h.H`vec3 sphere[16] = vec3[16](
|
|
8
|
+
}`))}},11725:(e,t,r)=>{r.d(t,{i:()=>a});var i=r(24326),n=r(35256),o=r(43616),s=r(65786);class a{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,o.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,o.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new n.E){return r.output=e,r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},11868:(e,t,r)=>{r.d(t,{Wz:()=>o,oe:()=>n});var i=r(34275);function n(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function o(e){return(Array.isArray(e)?e.length:e.byteLength/8)<=i.y9?Array.from(e):new Float32Array(e)}},11964:(e,t,r)=>{r.d(t,{Cr:()=>u,H6:()=>m,LV:()=>l,_I:()=>h,kb:()=>d,vt:()=>c});var i=r(34727),n=r(4341),o=r(38954),s=r(51850),a=r(32114);function c(e){return e?{origin:(0,s.o8)(e.origin),vector:(0,s.o8)(e.vector)}:{origin:(0,s.vt)(),vector:(0,s.vt)()}}function l(e,t){const r=p.get();return r.origin=e,r.vector=t,r}function u(e,t,r=c()){return(0,o.c)(r.origin,e),(0,o.d)(r.vector,t,e),r}function d(e,t){const r=(0,o.d)(a.rq.get(),t,e.origin),n=(0,o.e)(e.vector,r),s=(0,o.e)(e.vector,e.vector),c=(0,i.qE)(n/s,0,1),l=(0,o.d)(a.rq.get(),(0,o.g)(a.rq.get(),e.vector,c),r);return(0,o.e)(l,l)}function h(e,t,r){return m(e,t,0,1,r)}function m(e,t,r,n,s){const{vector:c,origin:l}=e,u=(0,o.d)(a.rq.get(),t,l),d=(0,o.e)(c,u)/(0,o.k)(c);return(0,o.g)(s,c,(0,i.qE)(d,r,n)),(0,o.f)(s,s,e.origin)}(0,s.vt)(),(0,s.vt)();const p=new n.I(()=>c())},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},14113:(e,t,r)=>{r.d(t,{N5:()=>a});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class a extends s{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new h,this.varyings=new m,this.extensions=new p,this.outputs=new f}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,s=o.uniforms.generateSource(),a=o.code.generateSource(),c=o.main.generateSource(t),l="vertex"===e?_:v,u=o.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${r.join("\n")}\n${l}\n${u.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${n.join("\n")}\n${d.join("\n")}\n${a.join("\n")}\n${c.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let s=0;s<i;++s)r[s](e,o,t,n)}}}class c{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class l{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class d extends s{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new g(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1,flat:r?.flat??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+(r.flat||"int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?p.ALLOWLIST_VERTEX:p.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(e=>t.includes(e)).map(e=>`#extension ${e} : enable`)}static{this.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"]}static{this.ALLOWLIST_VERTEX=[]}}class f{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:f.DEFAULT_NAME,type:f.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class g{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=g._numberToFloatStr(r);break;case"int":i=g._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])}, ${g._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>g._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",_="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},15581:(e,t,r)=>{r.d(t,{S:()=>x,b:()=>g,g:()=>v});var i=r(37585),n=r(48163),o=r(82048),s=r(52540),a=r(34845),c=r(77108),l=r(47286),u=r(33094),d=r(20304),h=r(31821),m=r(63761),p=r(14113);const f=16;function g(){const e=new p.N5,t=e.fragment;return e.include(o.c),e.include(a.Ir),t.include(s.E),t.uniforms.add(new u.U("radius",e=>v(e.camera))).code.add(h.H`vec3 sphere[16] = vec3[16](
|
|
9
9
|
vec3(0.186937, 0.0, 0.0),
|
|
10
10
|
vec3(0.700542, 0.0, 0.0),
|
|
11
11
|
vec3(-0.864858, -0.481795, -0.111713),
|
|
@@ -31,7 +31,7 @@ vec3 v = Q - C;
|
|
|
31
31
|
float vv = dot(v, v);
|
|
32
32
|
float vn = dot(normalize(v), n_C);
|
|
33
33
|
return fallOffFunction(vv, vn, 0.1);
|
|
34
|
-
}`),e.outputs.add("fragOcclusion","float"),t.uniforms.add(new m.N("normalMap",e=>e.normalTexture),new m.N("depthMap",e=>e.depthTexture),new d.m("projScale",e=>e.projScale),new m.N("rnm",e=>e.noiseTexture),new
|
|
34
|
+
}`),e.outputs.add("fragOcclusion","float"),t.uniforms.add(new m.N("normalMap",e=>e.normalTexture),new m.N("depthMap",e=>e.depthTexture),new d.m("projScale",e=>e.projScale),new m.N("rnm",e=>e.noiseTexture),new l.G("rnmScale",(e,t)=>(0,i.hZ)(_,t.camera.fullWidth/e.noiseTexture.descriptor.width,t.camera.fullHeight/e.noiseTexture.descriptor.height)),new d.m("intensity",e=>e.intensity),new c.E("screenSize",e=>(0,i.hZ)(_,e.camera.fullWidth,e.camera.fullHeight))).main.add(h.H`
|
|
35
35
|
float depth = depthFromTexture(depthMap, uv);
|
|
36
36
|
|
|
37
37
|
// Early out if depth is out of range, such as in the sky
|
|
@@ -87,7 +87,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
87
87
|
A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2;
|
|
88
88
|
|
|
89
89
|
fragOcclusion = A;
|
|
90
|
-
`),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"}))},15976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",2,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},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),s=r(57005);const a=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),s=(0,i.t)(o,o,n),a=this.offset/(0,i.l)(s);(0,i.b)(s,s,s,a);const l=this.objectTransform.inverse;return(0,i.t)(this.tmpVertex,s,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,i.l)((0,o.a)(e)),r=this.offset/t;return(0,i.b)((0,o.a)(this.sphere),(0,o.a)(e),(0,o.a)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};function l(e){return null!=e?(a.offset=e,a):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 s.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)(u,e,t,r+this.componentLocalOriginLength),s=this._totalOffset/(0,i.l)(o);return(0,i.b)(this._tmpVertex,n,o,s),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],s=e[4],a=e[5]+t,l=Math.abs(r),c=Math.abs(i),u=Math.abs(n),d=Math.abs(o),h=Math.abs(s),m=Math.abs(a),p=.5*(1+Math.sign(r*o))*Math.min(l,d),f=.5*(1+Math.sign(i*s))*Math.min(c,h),g=.5*(1+Math.sign(n*a))*Math.min(u,m),v=Math.max(l,d),_=Math.max(c,h),x=Math.max(u,m),b=Math.sqrt(p*p+f*f+g*g),w=Math.sign(l+r),y=Math.sign(c+i),M=Math.sign(u+n),T=Math.sign(d+o),C=Math.sign(h+s),S=Math.sign(m+a),E=this._totalOffset;if(b<E)return e[0]-=(1-w)*E,e[1]-=(1-y)*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),I=E/b,R=I-A,F=-R;return e[0]+=r*(w*F+I),e[1]+=i*(y*F+I),e[2]+=n*(M*F+I),e[3]+=o*(T*R+A),e[4]+=s*(C*R+A),e[5]+=a*(S*R+A),e}applyToMbs(e){const t=(0,i.l)((0,o.a)(e)),r=this._totalOffset/t;return(0,i.b)((0,o.a)(this._tmpMbs),(0,o.a)(e),(0,o.a)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,s.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)(u,n,this.localOrigin),s=this.offset/(0,i.l)(o);return(0,i.b)(this.tmpVertex,n,o,s),this.tmpVertex}applyToAabb(e){const t=d,r=h,i=m;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 s=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(s|=1<<e);if(0!==s&&7!==s)for(let e=0;e<8;++e)if(0===(s&e)){for(let n=0;n<3;++n)i[n]=s&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)(),u=(0,n.vt)(),d=(0,n.vt)(),h=(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")}},17352:(e,t,r)=>{r.d(t,{b:()=>j,f:()=>x}),r(44208);var i=r(53966),n=r(34727),o=r(4341),s=r(58083),a=r(9093),l=r(38954),c=r(51850),u=r(19419),d=r(11964),h=r(27921),m=r(71351),p=r(44280),f=r(32114);const g=()=>i.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function v(e=N){return{plane:(0,h.vt)(e.plane),origin:(0,c.o8)(e.origin),basis1:(0,c.o8)(e.basis1),basis2:(0,c.o8)(e.basis2)}}function _(e,t=v()){return x(e.origin,e.basis1,e.basis2,t)}function x(e,t,r,i=v()){return(0,l.c)(i.origin,e),(0,l.c)(i.basis1,t),(0,l.c)(i.basis2,r),b(i),function(e,t){Math.abs((0,l.e)(e.basis1,e.basis2)/((0,l.l)(e.basis1)*(0,l.l)(e.basis2)))>1e-6&&g().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,l.e)(e.basis1,R(e)))>1e-6&&g().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,l.e)(R(e),e.origin)-e.plane[3])>1e-6&&g().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function b(e){(0,h.mR)(e.basis2,e.basis1,e.origin,e.plane)}function w(e,t,r){e!==r&&_(e,r);const i=(0,l.g)(f.rq.get(),R(e),t);return(0,l.f)(r.origin,r.origin,i),r.plane[3]-=t,r}function y(e,t=v()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,l.i)(t.origin,e[0]+r,e[1]+i,0),(0,l.i)(t.basis1,r,0,0),(0,l.i)(t.basis2,0,i,0),(0,h.fA)(0,0,1,0,t.plane),t}function M(e,t,r){return!!(0,h.Ui)(e.plane,t,r)&&F(e,r)}function T(e,t,r){const i=H.get();D(e,t,i,H.get());let o=Number.POSITIVE_INFINITY;for(const s of G){const a=P(e,s,L.get()),c=f.rq.get();if((0,h.T7)(i,a,c)){const e=(0,l.E)(f.rq.get(),t.origin,c),i=Math.abs((0,n.XM)((0,l.e)(t.direction,e)));i<o&&(o=i,(0,l.c)(r,c))}}return o===Number.POSITIVE_INFINITY?C(e,t,r):r}function C(e,t,r){if(M(e,t,r))return r;const i=H.get(),n=H.get();D(e,t,i,n);let o=Number.POSITIVE_INFINITY;for(const s of G){const a=P(e,s,L.get()),c=f.rq.get();if((0,h.gv)(i,a,c)){const e=(0,m.kb)(t,c);if(!(0,h.Tj)(n,c))continue;e<o&&(o=e,(0,l.c)(r,c))}}return A(e,t.origin)<o&&S(e,t.origin,r),r}function S(e,t,r){const i=(0,h._I)(e.plane,t,f.rq.get()),n=(0,d.H6)(O(e,e.basis1),i,-1,1,f.rq.get()),o=(0,d.H6)(O(e,e.basis2),i,-1,1,f.rq.get());return(0,l.d)(r,(0,l.f)(f.rq.get(),n,o),e.origin),r}function E(e,t,r){const{origin:i,basis1:n,basis2:o}=e,s=(0,l.d)(f.rq.get(),t,i),a=(0,p.gr)(n,s),c=(0,p.gr)(o,s),u=(0,p.gr)(R(e),s);return(0,l.i)(r,a,c,u)}function A(e,t){const r=E(e,t,f.rq.get()),{basis1:i,basis2:n}=e,o=(0,l.l)(i),s=(0,l.l)(n),a=Math.max(Math.abs(r[0])-o,0),c=Math.max(Math.abs(r[1])-s,0),u=r[2];return a*a+c*c+u*u}function I(e,t){const r=-e.plane[3];return(0,p.gr)(R(e),t)-r}function R(e){return(0,h.Qj)(e.plane)}function F(e,t){const r=(0,l.d)(f.rq.get(),t,e.origin),i=(0,l.k)(e.basis1),n=(0,l.k)(e.basis2),o=(0,l.e)(e.basis1,r),s=(0,l.e)(e.basis2,r);return-o-i<0&&o-i<0&&-s-n<0&&s-n<0}function O(e,t){const r=L.get();return(0,l.c)(r.origin,e.origin),(0,l.c)(r.vector,t),r}function P(e,t,r){const{basis1:i,basis2:n,origin:o}=e,s=(0,l.g)(f.rq.get(),i,t.origin[0]),a=(0,l.g)(f.rq.get(),n,t.origin[1]);(0,l.f)(r.origin,s,a),(0,l.f)(r.origin,r.origin,o);const c=(0,l.g)(f.rq.get(),i,t.direction[0]),u=(0,l.g)(f.rq.get(),n,t.direction[1]);return(0,l.g)(r.vector,(0,l.f)(c,c,u),2),r}function D(e,t,r,i){const n=R(e);(0,h.mR)(n,t.direction,t.origin,r),(0,h.mR)((0,h.Qj)(r),n,t.origin,i)}const N={plane:(0,h.vt)(),origin:(0,c.fA)(0,0,0),basis1:(0,c.fA)(1,0,0),basis2:(0,c.fA)(0,1,0)},H=new o.I(h.vt),L=new o.I(d.vt),z=(0,c.vt)(),B=new o.I(()=>v()),G=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],U=(0,a.vt)(),V=(0,a.vt)(),j=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:class{constructor(){this.plane=(0,h.vt)(),this.origin=(0,c.vt)(),this.basis1=(0,c.vt)(),this.basis2=(0,c.vt)()}},altitudeAt:I,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case 0:(0,l.c)(r,e.basis1),(0,l.n)(r,r);break;case 1:(0,l.c)(r,e.basis2),(0,l.n)(r,r);break;case 2:(0,l.c)(r,R(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:C,closestPointOnSilhouette:T,copy:_,copyWithoutVerify:function(e,t){(0,l.c)(t.origin,e.origin),(0,l.c)(t.basis1,e.basis1),(0,l.c)(t.basis2,e.basis2),(0,h.C)(t.plane,e.plane)},create:v,distance:function(e,t){return Math.sqrt(A(e,t))},distance2:A,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of G){const n=P(e,i,L.get()),o=(0,d.kb)(n,t);o>r&&(r=o)}return Math.sqrt(r)},elevate:w,equals:function(e,t){return(0,l.q)(e.basis1,t.basis1)&&(0,l.q)(e.basis2,t.basis2)&&(0,l.q)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,h.Tj)(e.plane,t)&&F(e,t)},fromAABoundingRect:y,fromValues:x,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[n,o]=e.origin;return(0,u.fA)(n-r,o-i,n+r,o+i,t)},intersectRay:M,intersectRayClosestSilhouette:function(e,t,r){if(M(e,t,r))return r;const i=T(e,t,f.rq.get());return(0,l.f)(r,t.origin,(0,l.g)(f.rq.get(),t.direction,(0,l.j)(t.origin,i)/(0,l.l)(t.direction))),r},normal:R,projectPoint:S,projectPointLocal:E,rotate:function(e,t,r,i){return e!==i&&_(e,i),(0,s.$0)(V,t,r),(0,l.t)(i.basis1,e.basis1,V),(0,l.t)(i.basis2,e.basis2,V),b(i),i},setAltitudeAt:function(e,t,r,i){const n=I(e,t),o=(0,l.g)(z,R(e),r-n);return(0,l.f)(i,t,o),i},setExtent:function(e,t,r){return y(t,r),w(r,I(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&_(e,r),(0,s.B8)(U,t),(0,s.mg)(U,U),(0,l.t)(r.basis1,e.basis1,U),(0,l.t)(r.basis2,e.basis2,U),(0,l.t)((0,h.Qj)(r.plane),(0,h.Qj)(e.plane),U),(0,l.t)(r.origin,e.origin,t),(0,h.mP)(r.plane,r.plane,r.origin),r},up:N,updateUnboundedPlane:b,wrap:function(e,t,r){const i=B.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,h.LV)(0,0,0,0),b(i),i}},Symbol.toStringTag,{value:"Module"}))},20304:(e,t,r)=>{r.d(t,{m:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",1,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},22393:(e,t,r)=>{r.d(t,{c:()=>s});var i=r(31821);function n(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
|
|
90
|
+
`),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"}))},15976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",2,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},16396:(e,t,r)=>{r.d(t,{ou:()=>c}),r(77690),r(29242),r(58083),r(9093);var i=r(38954),n=r(51850),o=r(97937),s=r(57005);const a=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)(l,e,t,r),s=(0,i.t)(o,o,n),a=this.offset/(0,i.l)(s);(0,i.b)(s,s,s,a);const c=this.objectTransform.inverse;return(0,i.t)(this.tmpVertex,s,c),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,i.l)((0,o.a)(e)),r=this.offset/t;return(0,i.b)((0,o.a)(this.sphere),(0,o.a)(e),(0,o.a)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};function c(e){return null!=e?(a.offset=e,a):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 s.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)(l,e,t,r),o=(0,i.i)(u,e,t,r+this.componentLocalOriginLength),s=this._totalOffset/(0,i.l)(o);return(0,i.b)(this._tmpVertex,n,o,s),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],n=e[2]+t,o=e[3],s=e[4],a=e[5]+t,c=Math.abs(r),l=Math.abs(i),u=Math.abs(n),d=Math.abs(o),h=Math.abs(s),m=Math.abs(a),p=.5*(1+Math.sign(r*o))*Math.min(c,d),f=.5*(1+Math.sign(i*s))*Math.min(l,h),g=.5*(1+Math.sign(n*a))*Math.min(u,m),v=Math.max(c,d),_=Math.max(l,h),x=Math.max(u,m),b=Math.sqrt(p*p+f*f+g*g),w=Math.sign(c+r),y=Math.sign(l+i),M=Math.sign(u+n),T=Math.sign(d+o),C=Math.sign(h+s),S=Math.sign(m+a),E=this._totalOffset;if(b<E)return e[0]-=(1-w)*E,e[1]-=(1-y)*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),I=E/b,R=I-A,F=-R;return e[0]+=r*(w*F+I),e[1]+=i*(y*F+I),e[2]+=n*(M*F+I),e[3]+=o*(T*R+A),e[4]+=s*(C*R+A),e[5]+=a*(S*R+A),e}applyToMbs(e){const t=(0,i.l)((0,o.a)(e)),r=this._totalOffset/t;return(0,i.b)((0,o.a)(this._tmpMbs),(0,o.a)(e),(0,o.a)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,s.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)(l,e,t,r),o=(0,i.f)(u,n,this.localOrigin),s=this.offset/(0,i.l)(o);return(0,i.b)(this.tmpVertex,n,o,s),this.tmpVertex}applyToAabb(e){const t=d,r=h,i=m;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 s=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(s|=1<<e);if(0!==s&&7!==s)for(let e=0;e<8;++e)if(0===(s&e)){for(let n=0;n<3;++n)i[n]=s&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 l=(0,n.vt)(),u=(0,n.vt)(),d=(0,n.vt)(),h=(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")}},17352:(e,t,r)=>{r.d(t,{b:()=>j,f:()=>x}),r(44208);var i=r(53966),n=r(34727),o=r(4341),s=r(58083),a=r(9093),c=r(38954),l=r(51850),u=r(19419),d=r(11964),h=r(27921),m=r(71351),p=r(44280),f=r(32114);const g=()=>i.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function v(e=N){return{plane:(0,h.vt)(e.plane),origin:(0,l.o8)(e.origin),basis1:(0,l.o8)(e.basis1),basis2:(0,l.o8)(e.basis2)}}function _(e,t=v()){return x(e.origin,e.basis1,e.basis2,t)}function x(e,t,r,i=v()){return(0,c.c)(i.origin,e),(0,c.c)(i.basis1,t),(0,c.c)(i.basis2,r),b(i),function(e,t){Math.abs((0,c.e)(e.basis1,e.basis2)/((0,c.l)(e.basis1)*(0,c.l)(e.basis2)))>1e-6&&g().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,c.e)(e.basis1,R(e)))>1e-6&&g().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,c.e)(R(e),e.origin)-e.plane[3])>1e-6&&g().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function b(e){(0,h.mR)(e.basis2,e.basis1,e.origin,e.plane)}function w(e,t,r){e!==r&&_(e,r);const i=(0,c.g)(f.rq.get(),R(e),t);return(0,c.f)(r.origin,r.origin,i),r.plane[3]-=t,r}function y(e,t=v()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,c.i)(t.origin,e[0]+r,e[1]+i,0),(0,c.i)(t.basis1,r,0,0),(0,c.i)(t.basis2,0,i,0),(0,h.fA)(0,0,1,0,t.plane),t}function M(e,t,r){return!!(0,h.Ui)(e.plane,t,r)&&F(e,r)}function T(e,t,r){const i=H.get();D(e,t,i,H.get());let o=Number.POSITIVE_INFINITY;for(const s of G){const a=P(e,s,L.get()),l=f.rq.get();if((0,h.T7)(i,a,l)){const e=(0,c.E)(f.rq.get(),t.origin,l),i=Math.abs((0,n.XM)((0,c.e)(t.direction,e)));i<o&&(o=i,(0,c.c)(r,l))}}return o===Number.POSITIVE_INFINITY?C(e,t,r):r}function C(e,t,r){if(M(e,t,r))return r;const i=H.get(),n=H.get();D(e,t,i,n);let o=Number.POSITIVE_INFINITY;for(const s of G){const a=P(e,s,L.get()),l=f.rq.get();if((0,h.gv)(i,a,l)){const e=(0,m.kb)(t,l);if(!(0,h.Tj)(n,l))continue;e<o&&(o=e,(0,c.c)(r,l))}}return A(e,t.origin)<o&&S(e,t.origin,r),r}function S(e,t,r){const i=(0,h._I)(e.plane,t,f.rq.get()),n=(0,d.H6)(O(e,e.basis1),i,-1,1,f.rq.get()),o=(0,d.H6)(O(e,e.basis2),i,-1,1,f.rq.get());return(0,c.d)(r,(0,c.f)(f.rq.get(),n,o),e.origin),r}function E(e,t,r){const{origin:i,basis1:n,basis2:o}=e,s=(0,c.d)(f.rq.get(),t,i),a=(0,p.gr)(n,s),l=(0,p.gr)(o,s),u=(0,p.gr)(R(e),s);return(0,c.i)(r,a,l,u)}function A(e,t){const r=E(e,t,f.rq.get()),{basis1:i,basis2:n}=e,o=(0,c.l)(i),s=(0,c.l)(n),a=Math.max(Math.abs(r[0])-o,0),l=Math.max(Math.abs(r[1])-s,0),u=r[2];return a*a+l*l+u*u}function I(e,t){const r=-e.plane[3];return(0,p.gr)(R(e),t)-r}function R(e){return(0,h.Qj)(e.plane)}function F(e,t){const r=(0,c.d)(f.rq.get(),t,e.origin),i=(0,c.k)(e.basis1),n=(0,c.k)(e.basis2),o=(0,c.e)(e.basis1,r),s=(0,c.e)(e.basis2,r);return-o-i<0&&o-i<0&&-s-n<0&&s-n<0}function O(e,t){const r=L.get();return(0,c.c)(r.origin,e.origin),(0,c.c)(r.vector,t),r}function P(e,t,r){const{basis1:i,basis2:n,origin:o}=e,s=(0,c.g)(f.rq.get(),i,t.origin[0]),a=(0,c.g)(f.rq.get(),n,t.origin[1]);(0,c.f)(r.origin,s,a),(0,c.f)(r.origin,r.origin,o);const l=(0,c.g)(f.rq.get(),i,t.direction[0]),u=(0,c.g)(f.rq.get(),n,t.direction[1]);return(0,c.g)(r.vector,(0,c.f)(l,l,u),2),r}function D(e,t,r,i){const n=R(e);(0,h.mR)(n,t.direction,t.origin,r),(0,h.mR)((0,h.Qj)(r),n,t.origin,i)}const N={plane:(0,h.vt)(),origin:(0,l.fA)(0,0,0),basis1:(0,l.fA)(1,0,0),basis2:(0,l.fA)(0,1,0)},H=new o.I(h.vt),L=new o.I(d.vt),z=(0,l.vt)(),B=new o.I(()=>v()),G=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],U=(0,a.vt)(),V=(0,a.vt)(),j=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:class{constructor(){this.plane=(0,h.vt)(),this.origin=(0,l.vt)(),this.basis1=(0,l.vt)(),this.basis2=(0,l.vt)()}},altitudeAt:I,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case 0:(0,c.c)(r,e.basis1),(0,c.n)(r,r);break;case 1:(0,c.c)(r,e.basis2),(0,c.n)(r,r);break;case 2:(0,c.c)(r,R(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:C,closestPointOnSilhouette:T,copy:_,copyWithoutVerify:function(e,t){(0,c.c)(t.origin,e.origin),(0,c.c)(t.basis1,e.basis1),(0,c.c)(t.basis2,e.basis2),(0,h.C)(t.plane,e.plane)},create:v,distance:function(e,t){return Math.sqrt(A(e,t))},distance2:A,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of G){const n=P(e,i,L.get()),o=(0,d.kb)(n,t);o>r&&(r=o)}return Math.sqrt(r)},elevate:w,equals:function(e,t){return(0,c.q)(e.basis1,t.basis1)&&(0,c.q)(e.basis2,t.basis2)&&(0,c.q)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,h.Tj)(e.plane,t)&&F(e,t)},fromAABoundingRect:y,fromValues:x,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[n,o]=e.origin;return(0,u.fA)(n-r,o-i,n+r,o+i,t)},intersectRay:M,intersectRayClosestSilhouette:function(e,t,r){if(M(e,t,r))return r;const i=T(e,t,f.rq.get());return(0,c.f)(r,t.origin,(0,c.g)(f.rq.get(),t.direction,(0,c.j)(t.origin,i)/(0,c.l)(t.direction))),r},normal:R,projectPoint:S,projectPointLocal:E,rotate:function(e,t,r,i){return e!==i&&_(e,i),(0,s.$0)(V,t,r),(0,c.t)(i.basis1,e.basis1,V),(0,c.t)(i.basis2,e.basis2,V),b(i),i},setAltitudeAt:function(e,t,r,i){const n=I(e,t),o=(0,c.g)(z,R(e),r-n);return(0,c.f)(i,t,o),i},setExtent:function(e,t,r){return y(t,r),w(r,I(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&_(e,r),(0,s.B8)(U,t),(0,s.mg)(U,U),(0,c.t)(r.basis1,e.basis1,U),(0,c.t)(r.basis2,e.basis2,U),(0,c.t)((0,h.Qj)(r.plane),(0,h.Qj)(e.plane),U),(0,c.t)(r.origin,e.origin,t),(0,h.mP)(r.plane,r.plane,r.origin),r},up:N,updateUnboundedPlane:b,wrap:function(e,t,r){const i=B.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,h.LV)(0,0,0,0),b(i),i}},Symbol.toStringTag,{value:"Module"}))},20304:(e,t,r)=>{r.d(t,{m:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",1,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},22393:(e,t,r)=>{r.d(t,{c:()=>s});var i=r(31821);function n(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
|
|
91
91
|
return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
|
|
92
92
|
}`),e.code.add(i.H`float integratedRadiance(float cosTheta2, float roughness) {
|
|
93
93
|
return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
|
|
@@ -143,11 +143,11 @@ return (diffuseComponent + specularComponent);
|
|
|
143
143
|
}
|
|
144
144
|
`)):e.vertex.code.add(n.H`MaskedColor applyInstanceColor(MaskedColor color) {
|
|
145
145
|
return color;
|
|
146
|
-
}`)}},25178:(e,t,r)=>{r.d(t,{yu:()=>m,Nz:()=>_,NB:()=>p,S7:()=>v});var i=r(58083),n=r(9093),o=r(38954),s=r(51850),a=r(23205),
|
|
146
|
+
}`)}},25178:(e,t,r)=>{r.d(t,{yu:()=>m,Nz:()=>_,NB:()=>p,S7:()=>v});var i=r(58083),n=r(9093),o=r(38954),s=r(51850),a=r(23205),c=r(40710),l=r(33094),u=r(74333);class d extends u.n{constructor(e,t,r){super(e,"mat4",0,(i,n)=>i.setUniformMatrix4fv(e,t(n),r))}}class h extends u.n{constructor(e,t,r){super(e,"mat4",2,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",s.uY):e.uniforms.add(new c.W("cameraPosition",(e,t)=>(0,o.i)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2])))}function p(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new d("proj",e=>e.camera.projectionMatrix),new h("view",(e,t)=>(0,i.Tl)(f,t.camera.viewMatrix,e.origin)),new c.W("localOrigin",e=>e.origin));const r=({camera:e})=>(0,o.i)(g,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(new d("proj",e=>e.camera.projectionMatrix),new d("view",e=>(0,i.Tl)(f,e.camera.viewMatrix,r(e))),new a.d("localOrigin",e=>r(e)))}const f=(0,n.vt)(),g=(0,s.vt)();function v(e){e.uniforms.add(new d("viewNormal",e=>e.camera.viewInverseTransposeMatrix))}function _(e){e.uniforms.add(new l.U("pixelRatio",e=>e.camera.pixelRatio/e.overlayStretch))}},25634:(e,t,r)=>{r.d(t,{m8:()=>a,NV:()=>l});var i=r(97768),n=r(74887);class o{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return 2}}var s=r(65786);class a extends o{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,i.Gz)(this._texture),this._textureNormal=(0,i.Gz)(this._textureNormal),this._textureEmissive=(0,i.Gz)(this._textureEmissive),this._textureOcclusion=(0,i.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new l(this._texture?.glTexture??null,this._textureNormal?.glTexture??null,this._textureEmissive?.glTexture??null,this._textureOcclusion?.glTexture??null,this._textureMetallicRoughness?.glTexture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,n.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,i.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class c extends s.Y{constructor(e=null){super(),this.textureEmissive=e}}class l extends c{constructor(e,t,r,i,n,o,s){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=s}}},26425:(e,t,r)=>{r.d(t,{u:()=>o});var i=r(33094),n=r(31821);function o({code:e,uniforms:t},r){t.add(new i.U("dpDummy",()=>1)),e.add(n.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
|
|
147
147
|
vec3 hiD = hiA + hiB;
|
|
148
148
|
vec3 loD = loA + loB;
|
|
149
149
|
return dpDummy * hiD + loD;
|
|
150
|
-
}`)}},26857:(e,t,r)=>{r.d(t,{b:()=>
|
|
150
|
+
}`)}},26857:(e,t,r)=>{r.d(t,{b:()=>c});var i=r(31635),n=r(65008),o=r(10107),s=(r(44208),r(53966),r(87811),r(40608));let a=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};(0,i.Cg)([(0,o.MZ)()],a.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,o.MZ)()],a.prototype,"LINE_WIREFRAMES",void 0),a=(0,i.Cg)([(0,s.$)("esri.views.3d.support.debugFlags")],a);const c=new a},27950:(e,t,r)=>{r.d(t,{N:()=>o});var i=r(63365),n=r(31821);function o(e){e.include(i.a),e.code.add(n.H`
|
|
151
151
|
vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
|
|
152
152
|
// workaround for artifacts in macOS using Intel Iris Pro
|
|
153
153
|
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
|
|
@@ -187,7 +187,7 @@ return dpDummy * hiD + loD;
|
|
|
187
187
|
// multiply or tint (or something invalid)
|
|
188
188
|
return allMixed;
|
|
189
189
|
}
|
|
190
|
-
`)}},27993:(e,t,r)=>{r.d(t,{F:()=>o}),r(98988);var i=r(16930),n=r(65806);function o(e,t,r,i,o){return!(null==t||null==i||e.length<2)&&(s.x=e[0],s.y=e[1],s.z=e[2],s.spatialReference=t,(0,n.g)(s,r,i,o))}const s={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:i.A.WGS84,type:"point"}},28421:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",2,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},28491:(e,t,r)=>{r.d(t,{D:()=>V,b:()=>U});var i=r(32680),n=r(49255),o=r(76591),s=r(76597),a=r(24321),
|
|
190
|
+
`)}},27993:(e,t,r)=>{r.d(t,{F:()=>o}),r(98988);var i=r(16930),n=r(65806);function o(e,t,r,i,o){return!(null==t||null==i||e.length<2)&&(s.x=e[0],s.y=e[1],s.z=e[2],s.spatialReference=t,(0,n.g)(s,r,i,o))}const s={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:i.A.WGS84,type:"point"}},28421:(e,t,r)=>{r.d(t,{J:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",2,(i,n,o)=>i.setUniform1f(e,t(n,o),r))}}},28491:(e,t,r)=>{r.d(t,{D:()=>V,b:()=>U});var i=r(32680),n=r(49255),o=r(76591),s=r(76597),a=r(24321),c=r(60864),l=r(43519),u=r(96336),d=r(71955),h=r(53466),m=r(92700),p=r(72824),f=r(35640),g=r(40261),v=r(77695),_=r(65836),x=r(89390),b=r(98619),w=r(62602),y=r(22393),M=r(59469),T=r(32482),C=r(96598),S=r(51406),E=r(42398),A=r(58614),I=r(27950),R=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:q,snowCover:Z,pbrMode:Y,textureAlphaPremultiplied:X,instancedDoublePrecision:J,hasVertexColors:K,hasVertexTangents:Q,hasColorTexture:ee,hasNormalTexture:te,hasNormalTextureTransform:re,hasColorTextureTransform:ie,hasBloom:ne}=e;if((0,R.NB)(U,e),r.add("position","vec3"),j.add("vpos","vec3",{invariant:!0}),t.include(E.A,e),t.include(c.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,R.yu)(U,e),t.include(u.Y,e),t.include(s.d,e);const oe=0===k||1===k;return oe&&$&&t.include(i.M),t.include(v.W,e),t.include(p.Mh,e),t.include(a.v,e),j.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(d.K,e),t.include(m.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(l.WD),U.include(l.oF),t.include(J?T.G:T.Bz,e),U.main.add(D.H`
|
|
191
191
|
forwardNormalizedVertexColor();
|
|
192
192
|
|
|
193
193
|
MaskedColor maskedColor =
|
|
@@ -257,9 +257,9 @@ return dpDummy * hiD + loD;
|
|
|
257
257
|
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:D.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
258
258
|
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
259
259
|
outputColorHighlightOID(finalColor, vpos, albedo ${(0,D.If)(Z,", snow")});
|
|
260
|
-
`),t}const V=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>a});var i=r(15142),n=r(38954),o=r(51850),s=r(620);class a{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,s.vA)(e.length>=1),(0,s.vA)(3===r.size||4===r.size);const{data:i,size:a,indices:
|
|
260
|
+
`),t}const V=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>a});var i=r(15142),n=r(38954),o=r(51850),s=r(620);class a{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,s.vA)(e.length>=1),(0,s.vA)(3===r.size||4===r.size);const{data:i,size:a,indices:l}=r;(0,s.vA)(l.length%this._numIndexPerPrimitive===0),(0,s.vA)(l.length>=e.length*this._numIndexPerPrimitive);const u=e.length;let d=a*l[this._numIndexPerPrimitive*e[0]];c.clear(),c.push(d);const h=(0,o.fA)(i[d],i[d+1],i[d+2]),m=(0,o.o8)(h);for(let t=0;t<u;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){d=a*l[r+e],c.push(d);let t=i[d];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[d+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[d+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}for(let e=0;e<3;++e)this._data[4+e]=h[e],this._data[7+e]=m[e];const p=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5);let f=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]),g=f*f;for(let e=0;e<c.length;++e){d=c.at(e);const t=i[d]-p[0],r=i[d+1]-p[1],n=i[d+2]-p[2],o=t*t+r*r+n*n;if(o<=g)continue;const s=Math.sqrt(o),a=.5*(s-f);f+=a,g=f*f;const l=a/s;p[0]+=t*l,p[1]+=r*l,p[2]+=n*l}this._data[3]=f;for(let e=0;e<3;++e)this._data[0+e]=p[e];c.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:s,size:c,indices:l}=this.position;for(let n=0;n<t;++n){let t=0;const o=this._numIndexPerPrimitive*this.primitiveIndices[n];let a=c*l[o],u=s[a],d=s[a+1],h=s[a+2];for(let e=1;e<this._numIndexPerPrimitive;++e){a=c*l[o+e];const t=s[a],r=s[a+1],i=s[a+2];t<u&&(u=t),r<d&&(d=r),i<h&&(h=i)}u<e[0]&&(t|=1),d<e[1]&&(t|=2),h<e[2]&&(t|=4),r[n]=t,++i[t]}let u=0;for(let e=0;e<8;++e)i[e]>0&&++u;if(u<2)return;const d=new Array(8);for(let e=0;e<8;++e)d[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];d[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==d[e]&&this._children.push(new a(d[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){c.prune()}}const c=new i.A({deallocator:null})},31821:(e,t,r)=>{r.d(t,{H:()=>i,If:()=>n});const i=(e,...t)=>{let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r};function n(e,t,r=""){return e?t:r}i.int=e=>Math.round(e).toString(),i.float=e=>e.toPrecision(8)},32482:(e,t,r)=>{r.d(t,{Bz:()=>b,G:()=>x}),r(51850);var i=r(46686),n=r(49255),o=r(31821);function s(e,t){const r=(0,n.RN)(t.output)&&t.receiveShadows;r&&(0,i.o)(e,!0),e.vertex.code.add(o.H`
|
|
261
261
|
void forwardLinearDepthToReadShadowMap() { ${(0,o.If)(r,"forwardLinearDepth(gl_Position.w);")} }
|
|
262
|
-
`)}var a=r(14314),
|
|
262
|
+
`)}var a=r(14314),c=r(35818),l=r(74333);class u extends l.n{constructor(e,t,r,i){super(e,"mat4",2,(r,n,o,s)=>r.setUniformMatrices4fv(e,t(n,o,s),i),r)}}class d extends l.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 m(e){e.fragment.uniforms.add(new d("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),f(e)}function p(e){e.fragment.uniforms.add(new u("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),f(e)}function f(e){const{fragment:t}=e;t.uniforms.add(new a.I("cascadeDistances",e=>e.shadowMap.cascadeDistances),new c.W("numCascades",e=>e.shadowMap.numCascades)),t.code.add(o.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
|
|
263
263
|
vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
|
|
264
264
|
vec4 lv = mat * vec4(_vpos, 1.0);
|
|
265
265
|
lv.xy /= lv.w;
|
|
@@ -283,7 +283,7 @@ vec2 uvShadow = cascadeCoordinates(i, shadowMapSize, lvpos);
|
|
|
283
283
|
return vec3(uvShadow, lvpos.z);
|
|
284
284
|
}`)}function g(e){e.fragment.code.add(o.H`float readShadowMapUVZ(vec3 uvzShadow, sampler2DShadow _shadowMap) {
|
|
285
285
|
return texture(_shadowMap, uvzShadow);
|
|
286
|
-
}`)}h.Y;var v=r(33094);class _ extends
|
|
286
|
+
}`)}h.Y;var v=r(33094);class _ extends l.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}function x(e,t){t.receiveShadows&&e.include(m),w(e,t)}function b(e,t){t.receiveShadows&&e.include(p),w(e,t)}function w(e,t){e.fragment.uniforms.add(new v.U("lightingGlobalFactor",e=>e.lighting.globalFactor));const{receiveShadows:r,spherical:i}=t;e.include(s,t),r&&y(e),e.fragment.code.add(o.H`
|
|
287
287
|
float readShadow(float additionalAmbientScale, vec3 vpos) {
|
|
288
288
|
return ${r?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,o.If)(i,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
|
|
289
289
|
}
|
|
@@ -302,15 +302,15 @@ posClip.z += 0.0000003 * posClip.w;
|
|
|
302
302
|
return posClip;
|
|
303
303
|
}`)}},32976:(e,t,r)=>{r.d(t,{o:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"bool",0,(r,i)=>r.setUniform1b(e,t(i)))}}},33079:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",1,(i,n,o)=>i.setUniform3fv(e,t(n,o),r))}}},33094:(e,t,r)=>{r.d(t,{U:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"float",0,(i,n)=>i.setUniform1f(e,t(n),r))}}},33120:(e,t,r)=>{r.d(t,{i$:()=>s,xJ:()=>o}),r(46686),r(33752);var i=r(77108),n=r(31821);function o(e){e.vertex.uniforms.add(new i.E("nearFar",e=>e.camera.nearFar))}function s(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
304
304
|
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
305
|
-
}`)}},33524:(e,t,r)=>{r.d(t,{K_:()=>m,Yf:()=>
|
|
305
|
+
}`)}},33524:(e,t,r)=>{r.d(t,{K_:()=>m,Yf:()=>c,ez:()=>a,m6:()=>p,mE:()=>h,xt:()=>u,z5:()=>l});var i=r(49255),n=r(63907),o=r(90644);const s=(0,o.p3)(1,0,1,771);function a(e){return 2===e?null:s}function c(e){switch(e){case 0:return o.T8;case 1:return s;case 2:case 3:return null}}function l(e){if(e.draped)return null;switch(e.oitPass){case 0:case 2:return e.writeDepth?o.Uy:null;case 1:case 3:return null}}const u=5e5,d={factor:-1,units:-2};function h({oitPass:e,enableOffset:t}){return t&&1===e?d:null}function m(e,t=513){return 0===e||2===e?t:515}function p(e,t){const r=(0,i.LG)(t);return 1===e?r?{buffers:[n.r6,n.yI,n.Fq]}:{buffers:[n.r6,n.yI]}:r?{buffers:[n.r6,n.yI]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>c,dO:()=>a});var i=r(29242),n=r(9093),o=r(51850),s=(r(26425),r(40710),r(33079),r(31821),r(98353),r(35644),r(40095),r(65786));class a extends s.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,o.vt)(),this.transformWorldFromViewTL=(0,o.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)(),this.transformProjFromView=(0,n.vt)()}}class c extends s.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,o.vt)(),this.transformWorldFromModelTL=(0,o.vt)()}}},34845:(e,t,r)=>{r.d(t,{Ir:()=>u});var i=r(37585),n=r(48163),o=r(87317),s=r(91829),a=r(77108),c=r(14314),l=r(31821);function u(e){e.fragment.uniforms.add(new c.I("projInfo",e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,o.s)(d,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,o.s)(d,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera))),e.fragment.uniforms.add(new a.E("zScale",e=>0===e.camera.projectionMatrix[11]?(0,i.hZ)(h,0,1):(0,i.hZ)(h,1,0))),e.fragment.code.add(l.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
|
|
306
306
|
return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
|
|
307
|
-
}`)}const d=(0,s.vt)(),h=(0,n.vt)()},35256:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(31635),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}class s extends o{constructor(){super(...arguments),this.output=0,this.oitPass=0,this.hasSlicePlane=!1,this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0}}(0,i.Cg)([(0,n.W)({count:10})],s.prototype,"output",void 0),(0,i.Cg)([(0,n.W)({count:3})],s.prototype,"oitPass",void 0),(0,i.Cg)([(0,n.W)()],s.prototype,"hasSlicePlane",void 0),(0,i.Cg)([(0,n.W)()],s.prototype,"hasHighlightMixTexture",void 0)},35640:(e,t,r)=>{r.d(t,{Ge:()=>
|
|
307
|
+
}`)}const d=(0,s.vt)(),h=(0,n.vt)()},35256:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(31635),n=r(51976);class o extends n.K{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}class s extends o{constructor(){super(...arguments),this.output=0,this.oitPass=0,this.hasSlicePlane=!1,this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0}}(0,i.Cg)([(0,n.W)({count:10})],s.prototype,"output",void 0),(0,i.Cg)([(0,n.W)({count:3})],s.prototype,"oitPass",void 0),(0,i.Cg)([(0,n.W)()],s.prototype,"hasSlicePlane",void 0),(0,i.Cg)([(0,n.W)()],s.prototype,"hasHighlightMixTexture",void 0)},35640:(e,t,r)=>{r.d(t,{Ge:()=>l,VQ:()=>d});var i=r(87317),n=r(91829),o=r(52587),s=r(25178),a=r(71988),c=r(31821);function l(e,t){const r=e.vertex;t.hasVerticalOffset?(d(r),t.hasScreenSizePerspective&&(e.include(o.Y6),(0,o.OH)(r),(0,s.yu)(e.vertex,t)),r.code.add(c.H`
|
|
308
308
|
vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
309
309
|
float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
|
|
310
|
-
${t.spherical?
|
|
311
|
-
${t.hasScreenSizePerspective?
|
|
310
|
+
${t.spherical?c.H`vec3 worldNormal = normalize(worldPos + localOrigin);`:c.H`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
|
|
311
|
+
${t.hasScreenSizePerspective?c.H`
|
|
312
312
|
float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
|
|
313
|
-
float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:
|
|
313
|
+
float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:c.H`
|
|
314
314
|
float verticalOffsetScreenHeight = verticalOffset.x;`}
|
|
315
315
|
// Screen sized offset in world space, used for example for line callouts
|
|
316
316
|
float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
|
|
@@ -320,12 +320,12 @@ return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale
|
|
|
320
320
|
vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
321
321
|
return worldPos + calculateVerticalOffset(worldPos, localOrigin);
|
|
322
322
|
}
|
|
323
|
-
`)):r.code.add(
|
|
323
|
+
`)):r.code.add(c.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const u=(0,n.vt)();function d(e){e.uniforms.add(new a.E("verticalOffset",(e,t)=>{const{minWorldLength:r,maxWorldLength:n,screenLength:o}=e.verticalOffset,s=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),a=t.camera.pixelRatio||1;return(0,i.s)(u,o*a,s,r,n)}))}},35644:(e,t,r)=>{r.d(t,{k:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat3",1,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},35818:(e,t,r)=>{r.d(t,{W:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"int",0,(r,i)=>r.setUniform1i(e,t(i)))}}},36782:(e,t,r)=>{r.d(t,{g:()=>n});var i=r(31821);function n(e,t){if(9!==t.output)return e.vertex.code.add(i.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(i.H`void outputObjectAndLayerIdColor() {}`);const r=t.instanced;e.varyings.add("objectAndLayerIdColorVarying","vec4");const n=r?"instanceOlidColor":"olidColor";e.attributes.add(n,"vec4"),e.vertex.code.add(i.H`
|
|
324
324
|
void forwardObjectAndLayerIdColor() {
|
|
325
325
|
objectAndLayerIdColorVarying = ${n} * 0.003921568627451;
|
|
326
326
|
}`),e.fragment.code.add(i.H`void outputObjectAndLayerIdColor() {
|
|
327
327
|
fragColor = objectAndLayerIdColorVarying;
|
|
328
|
-
}`)}},38969:(e,t,r)=>{r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},40095:(e,t,r)=>{r.d(t,{X:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat4",1,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}},40261:(e,t,r)=>{r.d(t,{E:()=>v});var i=r(33120),n=r(76591),o=r(76597),s=r(96336),a=r(36782),
|
|
328
|
+
}`)}},38969:(e,t,r)=>{r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},40095:(e,t,r)=>{r.d(t,{X:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat4",1,(i,n,o)=>i.setUniformMatrix4fv(e,t(n,o),r))}}},40261:(e,t,r)=>{r.d(t,{E:()=>v});var i=r(33120),n=r(76591),o=r(76597),s=r(96336),a=r(36782),c=r(53466),l=r(72824),u=r(31821);function d(e,t){switch(t.output){case 4:case 5:case 6:case 7:e.fragment.code.add(u.H`float _calculateFragDepth(const in float depth) {
|
|
329
329
|
const float SLOPE_SCALE = 2.0;
|
|
330
330
|
const float BIAS = 20.0 * .000015259;
|
|
331
331
|
float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
|
|
@@ -334,14 +334,14 @@ return depth + SLOPE_SCALE * m + BIAS;
|
|
|
334
334
|
void outputDepth(float _linearDepth){
|
|
335
335
|
float fragDepth = _calculateFragDepth(_linearDepth);
|
|
336
336
|
gl_FragDepth = fragDepth;
|
|
337
|
-
}`)}}var h=r(42593),m=r(42398),p=r(58614),f=r(25178),g=r(63761);function v(e,t){const{vertex:r,fragment:v,varyings:_}=e,{hasColorTexture:x,alphaDiscardMode:b}=t,w=x&&1!==b,{output:y,normalType:M,hasColorTextureTransform:T}=t;switch(y){case 2:(0,f.NB)(r,t),e.include(o.d,t),v.include(n.HQ,t),e.include(
|
|
337
|
+
}`)}}var h=r(42593),m=r(42398),p=r(58614),f=r(25178),g=r(63761);function v(e,t){const{vertex:r,fragment:v,varyings:_}=e,{hasColorTexture:x,alphaDiscardMode:b}=t,w=x&&1!==b,{output:y,normalType:M,hasColorTextureTransform:T}=t;switch(y){case 2:(0,f.NB)(r,t),e.include(o.d,t),v.include(n.HQ,t),e.include(c.U,t),w&&v.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
|
|
338
338
|
vpos = subtractOrigin(vpos);
|
|
339
339
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
340
340
|
gl_Position = transformPosition(proj, view, vpos);
|
|
341
341
|
forwardTextureCoordinates();`),e.include(p.S,t),v.main.add(u.H`
|
|
342
342
|
discardBySlice(vpos);
|
|
343
343
|
${(0,u.If)(w,u.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
344
|
-
discardOrAdjustAlpha(texColor);`)}`);break;case 4:case 5:case 6:case 7:case 9:(0,f.NB)(r,t),e.include(o.d,t),e.include(
|
|
344
|
+
discardOrAdjustAlpha(texColor);`)}`);break;case 4:case 5:case 6:case 7:case 9:(0,f.NB)(r,t),e.include(o.d,t),e.include(c.U,t),e.include(m.A,t),e.include(d,t),v.include(n.HQ,t),e.include(a.g,t),(0,i.xJ)(e),_.add("depth","float",{invariant:!0}),w&&v.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
|
|
345
345
|
vpos = subtractOrigin(vpos);
|
|
346
346
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
347
347
|
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
|
|
@@ -350,7 +350,7 @@ forwardObjectAndLayerIdColor();`),e.include(p.S,t),v.main.add(u.H`
|
|
|
350
350
|
discardBySlice(vpos);
|
|
351
351
|
${(0,u.If)(w,u.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
352
352
|
discardOrAdjustAlpha(texColor);`)}
|
|
353
|
-
${9===y?u.H`outputObjectAndLayerIdColor();`:u.H`outputDepth(depth);`}`);break;case 3:{(0,f.NB)(r,t),e.include(o.d,t),e.include(s.Y,t),e.include(
|
|
353
|
+
${9===y?u.H`outputObjectAndLayerIdColor();`:u.H`outputDepth(depth);`}`);break;case 3:{(0,f.NB)(r,t),e.include(o.d,t),e.include(s.Y,t),e.include(l.Mh,t),e.include(c.U,t),e.include(m.A,t),w&&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(u.H`
|
|
354
354
|
vpos = getVertexInLocalOriginSpace();
|
|
355
355
|
${i?u.H`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:u.H`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
|
|
356
356
|
vpos = subtractOrigin(vpos);
|
|
@@ -365,7 +365,7 @@ forwardObjectAndLayerIdColor();`),e.include(p.S,t),v.main.add(u.H`
|
|
|
365
365
|
if (gl_FrontFacing == false){
|
|
366
366
|
normal = -normal;
|
|
367
367
|
}`}
|
|
368
|
-
fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 8:(0,f.NB)(r,t),e.include(o.d,t),e.include(
|
|
368
|
+
fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 8:(0,f.NB)(r,t),e.include(o.d,t),e.include(c.U,t),e.include(m.A,t),w&&v.uniforms.add(new g.N("tex",e=>e.texture)),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
|
|
369
369
|
vpos = subtractOrigin(vpos);
|
|
370
370
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
371
371
|
gl_Position = transformPosition(proj, view, vpos);
|
|
@@ -373,7 +373,7 @@ forwardTextureCoordinates();`),v.include(n.HQ,t),e.include(p.S,t),e.include(h.Q,
|
|
|
373
373
|
discardBySlice(vpos);
|
|
374
374
|
${(0,u.If)(w,u.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
375
375
|
discardOrAdjustAlpha(texColor);`)}
|
|
376
|
-
calculateOcclusionAndOutputHighlight();`)}}},40710:(e,t,r)=>{r.d(t,{W:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",2,(i,n,o,s)=>i.setUniform3fv(e,t(n,o,s),r))}}},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),s=r(74333);class a extends s.n{constructor(e,t,r,i){super(e,"vec4",1,(r,n,o)=>r.setUniform4fv(e,t(n,o),i),r)}}class
|
|
376
|
+
calculateOcclusionAndOutputHighlight();`)}}},40710:(e,t,r)=>{r.d(t,{W:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec3",2,(i,n,o,s)=>i.setUniform3fv(e,t(n,o,s),r))}}},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),s=r(74333);class a extends s.n{constructor(e,t,r,i){super(e,"vec4",1,(r,n,o)=>r.setUniform4fv(e,t(n,o),i),r)}}class c extends s.n{constructor(e,t,r,i){super(e,"float",1,(r,n,o)=>r.setUniform1fv(e,t(n,o),i),r)}}var l=r(31821),u=r(35644);r(78662).Gd;const d=8;function h(e,t){const{vertex:r,attributes:s}=e;t.hasVVInstancing&&(t.hasVVSize||t.hasVVColor)&&s.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 u.k("vvSymbolRotationMatrix",e=>e.vvSymbolRotationMatrix)),r.uniforms.add(new n.t("vvSymbolAnchor",e=>e.vvSymbolAnchor)),r.code.add(l.H`vec3 vvScale(vec4 _featureAttribute) {
|
|
377
377
|
if (isnan(_featureAttribute.x)) {
|
|
378
378
|
return vvSizeFallback;
|
|
379
379
|
}
|
|
@@ -381,14 +381,14 @@ return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, v
|
|
|
381
381
|
}
|
|
382
382
|
vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
|
|
383
383
|
return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
|
|
384
|
-
}`),r.code.add(
|
|
384
|
+
}`),r.code.add(l.H`
|
|
385
385
|
const float eps = 1.192092896e-07;
|
|
386
386
|
vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
|
|
387
387
|
vec3 scale = max(vvScale(_featureAttribute), eps);
|
|
388
388
|
return vec4(vvSymbolRotationMatrix * _normal / scale, 1.0);
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
${t.hasVVInstancing?
|
|
391
|
+
${t.hasVVInstancing?l.H`
|
|
392
392
|
vec4 vvLocalNormal(vec3 _normal) {
|
|
393
393
|
return vvTransformNormal(_normal, instanceFeatureAttribute);
|
|
394
394
|
}
|
|
@@ -396,8 +396,8 @@ return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position +
|
|
|
396
396
|
vec4 localPosition() {
|
|
397
397
|
return vvTransformPosition(position, instanceFeatureAttribute);
|
|
398
398
|
}`:""}
|
|
399
|
-
`)):r.code.add(
|
|
400
|
-
vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vertex.include(i.WD),t.hasVVColor?(r.constants.add("vvColorNumber","int",d),r.uniforms.add(new
|
|
399
|
+
`)):r.code.add(l.H`vec4 localPosition() { return vec4(position, 1.0); }
|
|
400
|
+
vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vertex.include(i.WD),t.hasVVColor?(r.constants.add("vvColorNumber","int",d),r.uniforms.add(new c("vvColorValues",e=>e.vvColor.values,d),new a("vvColorColors",e=>e.vvColor.colors,d),new o.E("vvColorFallback",e=>e.vvColor.fallback,{supportsNaN:!0})),t.hasVVInstancing&&(e.vertex.include(i.ML),e.vertex.include(i.oF)),r.code.add(l.H`
|
|
401
401
|
vec4 interpolateVVColor(float value) {
|
|
402
402
|
if (isnan(value)) {
|
|
403
403
|
return vvColorFallback;
|
|
@@ -420,7 +420,7 @@ vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vertex.inclu
|
|
|
420
420
|
return interpolateVVColor(featureAttribute.y);
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
-
${t.hasVVInstancing?
|
|
423
|
+
${t.hasVVInstancing?l.H`
|
|
424
424
|
vec4 vvColor() {
|
|
425
425
|
return vvGetColor(instanceFeatureAttribute);
|
|
426
426
|
}
|
|
@@ -428,7 +428,7 @@ vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vertex.inclu
|
|
|
428
428
|
MaskedColor applyVVColor(MaskedColor color) {
|
|
429
429
|
return multiplyMaskedColors(color, createMaskedFromNaNColor(vvColor()));
|
|
430
430
|
}
|
|
431
|
-
`:
|
|
431
|
+
`:l.H`
|
|
432
432
|
vec4 vvColor() {
|
|
433
433
|
return vec4(1.0);
|
|
434
434
|
}
|
|
@@ -437,7 +437,7 @@ vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vertex.inclu
|
|
|
437
437
|
return color;
|
|
438
438
|
}
|
|
439
439
|
`}
|
|
440
|
-
`)):r.code.add(
|
|
440
|
+
`)):r.code.add(l.H`vec4 vvColor() {
|
|
441
441
|
return vec4(1.0);
|
|
442
442
|
}
|
|
443
443
|
MaskedColor applyVVColor(MaskedColor color) {
|
|
@@ -452,7 +452,7 @@ return texel[lic];
|
|
|
452
452
|
}
|
|
453
453
|
uint readLevelBits(uvec2 texel, int highlightLevel) {
|
|
454
454
|
return readChannelBits(readChannel(texel, highlightLevel), highlightLevel);
|
|
455
|
-
}`)}var o=r(74333);class s extends o.n{constructor(e,t){super(e,"ivec2",0,(r,i)=>r.setUniform2iv(e,t(i)))}}var a=r(35818),
|
|
455
|
+
}`)}var o=r(74333);class s extends o.n{constructor(e,t){super(e,"ivec2",0,(r,i)=>r.setUniform2iv(e,t(i)))}}var a=r(35818),c=r(12791);class l extends o.n{constructor(e,t){super(e,"usampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}function u(e,t){const{fragment:r}=e,{output:o,draped:u,hasHighlightMixTexture:d}=t;8===o?(r.uniforms.add(new a.W("highlightLevel",e=>e.highlightLevel??0),new s("highlightMixOrigin",e=>e.highlightMixOrigin)),e.outputs.add("fragHighlight","uvec2",0),e.include(n),d?r.uniforms.add(new l("highlightMixTexture",e=>e.highlightMixTexture)).code.add(i.H`uvec2 getAccumulatedHighlight() {
|
|
456
456
|
return texelFetch(highlightMixTexture, ivec2(gl_FragCoord.xy) - highlightMixOrigin, 0).rg;
|
|
457
457
|
}
|
|
458
458
|
void outputHighlight(bool occluded) {
|
|
@@ -477,7 +477,7 @@ uint bits = occluded ? 3u : 1u;
|
|
|
477
477
|
fragHighlight = uvec2(bits, 0);
|
|
478
478
|
}`),u?r.code.add(i.H`bool isHighlightOccluded() {
|
|
479
479
|
return false;
|
|
480
|
-
}`):r.uniforms.add(new
|
|
480
|
+
}`):r.uniforms.add(new c.x("depthTexture",e=>e.mainDepth)).code.add(i.H`bool isHighlightOccluded() {
|
|
481
481
|
float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x;
|
|
482
482
|
return gl_FragCoord.z > sceneDepth + 5e-7;
|
|
483
483
|
}`),r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {
|
|
@@ -495,19 +495,19 @@ vec4 masked2 = mix(color2.color, vec4(1), color2.mask);
|
|
|
495
495
|
return MaskedColor(masked1 * masked2, bvec4(ivec4(color1.mask) & ivec4(color2.mask)));
|
|
496
496
|
}`)}function a(e){e.include(n),e.code.add(i.H`MaskedColor createMaskedFromNaNColor(vec4 color) {
|
|
497
497
|
return MaskedColor(color, isnan(color));
|
|
498
|
-
}`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>a,Um:()=>
|
|
498
|
+
}`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>a,Um:()=>c,kE:()=>s});var i=r(4576),n=r(34727),o=r(77194);function s(e,t,r,i,s){let a=r.screenLength*e.pixelRatio;null!=s&&(a=(0,o.hs)(a,i,t,s));const c=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,n.qE)(c*t,r.minWorldLength,r.maxWorldLength)}function a(e,t){let r=!1;for(const n in t){const o=t[n];void 0!==o&&(Array.isArray(o)?Array.isArray(e[n])&&(0,i.aI)(o,e[n])||(e[n]=o.slice(),r=!0):e[n]!==o&&(r=!0,e[n]=o))}return r}const c={multiply:1,ignore:2,replace:3,tint:4}},46140:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(49186);let n=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[n,o]=t.split("."),s=/^\s*\d+\s*$/;if(!n?.match||!s.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!o?.match||!s.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const a=parseInt(n,10),c=parseInt(o,10);return new e(a,c,r)}}},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`
|
|
499
499
|
void forwardLinearDepth(float _linearDepth) { ${(0,i.If)(t,"linearDepth = _linearDepth;")} }
|
|
500
|
-
`)}},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),s=r(74887),a=r(34275),l=r(24326),c=r(84952),u=r(38969),d=r(99677),h=r(56058),m=r(2741);let p;var f=r(63907),g=r(76284),v=r(42293);let _=null,x=null;async function b(){return null==x&&(p??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,m.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=p,_=await x),x}function w(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),s=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*s)}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,s,a){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=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),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(s(e,u))),a(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new g.g(e,t,{type:"compressed",levels:m})}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 s=1,a=r[4],l=r[3];(3&a||3&l)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,l=l+3&-4);const c=a,u=l;let d,h;131072&r[2]&&!1!==t&&(s=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<s;++t)h=(a+3>>2)*(l+3>>2)*n,d=new Uint8Array(e.buffer,m,h),p.push(d),m+=h,a=Math.max(1,a>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:o,width:c,height:u}}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 s=Math.min(Math.sqrt(r/o),i/n);return[D(Math.round(e*s),i),D(Math.round(t*s),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,u.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,a.mw)(e)||(0,a.mg)(e))return"image/ktx2"===t.encoding?y(e,!!t.mipmap):"image/x.basis"===t.encoding?w(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,a.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,a.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,a.mw)(t)||(0,a.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,a.mw)(t)||(0,a.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,a.mg)(t)?this._loadFromPixelData(e,t):(0,a.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:s,height:a}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=s,t.height=a,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 b());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 b());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,d.D)(t,{signal:r});return(0,s.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,s.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,a)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",u),(0,o.xt)(d)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),n(this._loadFromImage(e,t)))},u=e=>{l(),a(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",u);const d=(0,s.u7)(r,()=>u((0,s.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}},49255:(e,t,r)=>{function i(e){return 4===e||5===e||6===e||7===e}function n(e){return function(e){return s(e)||function(e){return 2===e}(e)}(e)||3===e}function o(e){return function(e){return 0===e}(e)||a(e)}function s(e){return o(e)||function(e){return 8===e||9===e}(e)}function a(e){return 1===e}function l(e){switch(e){case 2:case 4:case 5:case 6:case 7:return!0}return!1}r.d(t,{LG:()=>a,Mb:()=>s,PJ:()=>i,RN:()=>o,Vg:()=>l,iq:()=>n})},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:()=>u,Sx:()=>a,q2:()=>s});var i=r(29242),n=r(31821),o=r(35644);function s(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(){
|
|
500
|
+
`)}},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),s=r(74887),a=r(34275),c=r(24326),l=r(84952),u=r(38969),d=r(99677),h=r(56058),m=r(2741);let p;var f=r(63907),g=r(76284),v=r(42293);let _=null,x=null;async function b(){return null==x&&(p??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,m.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=p,_=await x),x}function w(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),s=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*s)}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,s,a){const{compressedTextureETC:c,compressedTextureS3TC:l}=e.capabilities,[u,d]=c?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:l?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),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(s(e,u))),a(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new g.g(e,t,{type:"compressed",levels:m})}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 s=1,a=r[4],c=r[3];(3&a||3&c)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const l=a,u=c;let d,h;131072&r[2]&&!1!==t&&(s=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<s;++t)h=(a+3>>2)*(c+3>>2)*n,d=new Uint8Array(e.buffer,m,h),p.push(d),m+=h,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:p},internalFormat:o,width:l,height:u}}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 s=Math.min(Math.sqrt(r/o),i/n);return[D(Math.round(e*s),i),D(Math.round(t*s),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,c.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,l.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,u.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,l.DB)(e.src)||(0,l.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,a.mw)(e)||(0,a.mg)(e))return"image/ktx2"===t.encoding?y(e,!!t.mipmap):"image/x.basis"===t.encoding?w(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,a.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,a.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,a.mw)(t)||(0,a.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,a.mw)(t)||(0,a.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,a.mg)(t)?this._loadFromPixelData(e,t):(0,a.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:s,height:a}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=s,t.height=a,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 b());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 b());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,d.D)(t,{signal:r});return(0,s.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,s.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,a)=>{const c=()=>{t.removeEventListener("loadeddata",l),t.removeEventListener("error",u),(0,o.xt)(d)},l=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),n(this._loadFromImage(e,t)))},u=e=>{c(),a(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",l),t.addEventListener("error",u);const d=(0,s.u7)(r,()=>u((0,s.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}},49255:(e,t,r)=>{function i(e){return 4===e||5===e||6===e||7===e}function n(e){return function(e){return s(e)||function(e){return 2===e}(e)}(e)||3===e}function o(e){return function(e){return 0===e}(e)||a(e)}function s(e){return o(e)||function(e){return 8===e||9===e}(e)}function a(e){return 1===e}function c(e){switch(e){case 2:case 4:case 5:case 6:case 7:return!0}return!1}r.d(t,{LG:()=>a,Mb:()=>s,PJ:()=>i,RN:()=>o,Vg:()=>c,iq:()=>n})},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:()=>c,O1:()=>l,QM:()=>u,Sx:()=>a,q2:()=>s});var i=r(29242),n=r(31821),o=r(35644);function s(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(){
|
|
501
501
|
colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
502
502
|
}`)):e.vertex.code.add(n.H`void forwardColorUV(){}`)}function a(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(){
|
|
503
503
|
normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
504
|
-
}`)):e.vertex.code.add(n.H`void forwardNormalUV(){}`)}function
|
|
504
|
+
}`)):e.vertex.code.add(n.H`void forwardNormalUV(){}`)}function c(e,t){t.hasEmissionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("emissiveUV","vec2"),e.vertex.uniforms.add(new o.k("emissiveTextureTransformMatrix",e=>e.emissiveTextureTransformMatrix??i.zK)).code.add(n.H`void forwardEmissiveUV(){
|
|
505
505
|
emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
506
|
-
}`)):e.vertex.code.add(n.H`void forwardEmissiveUV(){}`)}function
|
|
506
|
+
}`)):e.vertex.code.add(n.H`void forwardEmissiveUV(){}`)}function l(e,t){t.hasOcclusionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("occlusionUV","vec2"),e.vertex.uniforms.add(new o.k("occlusionTextureTransformMatrix",e=>e.occlusionTextureTransformMatrix??i.zK)).code.add(n.H`void forwardOcclusionUV(){
|
|
507
507
|
occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
508
508
|
}`)):e.vertex.code.add(n.H`void forwardOcclusionUV(){}`)}function u(e,t){t.hasMetallicRoughnessTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new o.k("metallicRoughnessTextureTransformMatrix",e=>e.metallicRoughnessTextureTransformMatrix??i.zK)).code.add(n.H`void forwardMetallicRoughnessUV(){
|
|
509
509
|
metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
510
|
-
}`)):e.vertex.code.add(n.H`void forwardMetallicRoughnessUV(){}`)}},51976:(e,t,r)=>{r.d(t,{K:()=>a,W:()=>
|
|
510
|
+
}`)):e.vertex.code.add(n.H`void forwardMetallicRoughnessUV(){}`)}},51976:(e,t,r)=>{r.d(t,{K:()=>a,W:()=>c});var i=r(49186),n=r(4576);class o{constructor(e){this._bits=[...e]}equals(e){return(0,n.aI)(this._bits,e.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var s=r(65786);class a extends s.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new o(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map(e=>` ${e}: ${this[e]}`).join("\n");return this._parameterBits=t,r}}function c(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const n=e.count||2,o=Math.ceil(Math.log2(n)),s=t._parameterBits;let a=0;for(;s[a]+o>16;)a++,a>=s.length&&s.push(0);const c=s[a],l=(1<<o)-1<<c;s[a]+=o,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[a]&l)>>c},set(t){if(this[r]!==t){if(this._key=null,this._parameterBits[a]=this._parameterBits[a]&~l|+t<<c&l,"number"!=typeof t)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be a number, got ${typeof t}`);if(null==e.count)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must provide a count option`)}}}):Object.defineProperty(t,r,{get(){return!!((this._parameterBits[a]&l)>>c)},set(e){if(this[r]!==e&&(this._key=null,this._parameterBits[a]=this._parameterBits[a]&~l|+e<<c&l,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},52540:(e,t,r)=>{r.d(t,{E:()=>a});var i=r(37585),n=r(48163),o=r(77108),s=r(31821);function a(e){e.uniforms.add(new o.E("zProjectionMap",e=>function(e){const t=e.projectionMatrix;return(0,i.hZ)(c,t[14],t[10])}(e.camera))),e.code.add(s.H`float linearizeDepth(float depth) {
|
|
511
511
|
float depthNdc = depth * 2.0 - 1.0;
|
|
512
512
|
float c1 = zProjectionMap[0];
|
|
513
513
|
float c2 = zProjectionMap[1];
|
|
@@ -518,7 +518,7 @@ float depth = texelFetch(depthTexture, iuv, 0).r;
|
|
|
518
518
|
return depth;
|
|
519
519
|
}`),e.code.add(s.H`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) {
|
|
520
520
|
return linearizeDepth(depthFromTexture(depthTexture, uv));
|
|
521
|
-
}`)}const
|
|
521
|
+
}`)}const c=(0,n.vt)()},52587:(e,t,r)=>{r.d(t,{OH:()=>l,Y6:()=>a,pM:()=>c});var i=r(38954),n=r(51850),o=r(33079),s=r(31821);function a(e){e.vertex.code.add(s.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
|
|
522
522
|
return absCosAngle * absCosAngle * absCosAngle;
|
|
523
523
|
}`),e.vertex.code.add(s.H`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) {
|
|
524
524
|
return vec3(
|
|
@@ -537,10 +537,10 @@ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
|
|
|
537
537
|
return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
|
|
538
538
|
}`),e.vertex.code.add(s.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
539
539
|
return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
|
|
540
|
-
}`)}function
|
|
540
|
+
}`)}function c(e){e.uniforms.add(new o.t("screenSizePerspective",e=>u(e.screenSizePerspective)))}function l(e){e.uniforms.add(new o.t("screenSizePerspectiveAlignment",e=>u(e.screenSizePerspectiveAlignment||e.screenSizePerspective)))}function u(e){return(0,i.i)(d,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}const d=(0,n.vt)()},53466:(e,t,r)=>{r.d(t,{U:()=>o});var i=r(21818),n=r(31821);function o(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(n.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(n.H`void forwardTextureCoordinates() {
|
|
541
541
|
vuv0 = uv0;
|
|
542
542
|
vuvRegion = uvRegion;
|
|
543
|
-
}`);default:(0,i.Xb)(t.textureCoordinateType);case 0:return void e.vertex.code.add(n.H`void forwardTextureCoordinates() {}`);case 3:return}}},57323:(e,t,r)=>{r.d(t,{R:()=>L,b:()=>H});var i=r(32680),n=r(49255),o=r(76591),s=r(76597),a=r(24321),
|
|
543
|
+
}`);default:(0,i.Xb)(t.textureCoordinateType);case 0:return void e.vertex.code.add(n.H`void forwardTextureCoordinates() {}`);case 3:return}}},57323:(e,t,r)=>{r.d(t,{R:()=>L,b:()=>H});var i=r(32680),n=r(49255),o=r(76591),s=r(76597),a=r(24321),c=r(60864),l=r(43519),u=r(96336),d=r(71955),h=r(53466),m=r(92700),p=r(35640),f=r(40261),g=r(65836),v=r(89390),_=r(98619),x=r(22393),b=r(59469),w=r(32482),y=r(96598),M=r(42398),T=r(58614),C=r(27950),S=r(25178),E=r(33079),A=r(71988),I=r(20304),R=r(31821),F=r(63761),O=r(43616),P=r(60517),D=r(14113),N=r(49788);function H(e){const t=new D.N5,{attributes:r,vertex:H,fragment:L,varyings:z}=t,{output:B,offsetBackfaces:G,pbrMode:U,snowCover:V,spherical:j,hasBloom:W}=e,k=1===U||2===U;if((0,S.NB)(H,e),r.add("position","vec3"),z.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(c.B,e),t.include(p.Ge,e),t.include(y.Z,e),!(0,n.RN)(B))return t.include(f.E,e),t;(0,S.yu)(t.vertex,e),t.include(u.Y,e),t.include(s.d,e),G&&t.include(i.M),z.add("vNormalWorld","vec3"),z.add("localvpos","vec3",{invariant:!0}),t.include(h.U,e),t.include(d.K,e),t.include(a.v,e),t.include(m.c,e),H.include(l.WD),H.include(l.oF),H.uniforms.add(new A.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),z.add("vcolorExt","vec4"),t.include(e.instancedDoublePrecision?w.G:w.Bz,e),H.main.add(R.H`
|
|
544
544
|
forwardNormalizedVertexColor();
|
|
545
545
|
|
|
546
546
|
MaskedColor maskedColorExt =
|
|
@@ -599,12 +599,12 @@ vuvRegion = uvRegion;
|
|
|
599
599
|
void discardOrAdjustAlpha(inout vec4 color) {
|
|
600
600
|
${1===s?"color.a = 1.0;":`if (color.a < ${a?n.H.float(o.Q):"textureAlphaCutoff"}) {\n discard;\n } ${(0,n.If)(2===s,"else { color.a = 1.0; }")}`}
|
|
601
601
|
}
|
|
602
|
-
`)}(e,t,new i.m("textureAlphaCutoff",e=>e.textureAlphaCutoff))}},59469:(e,t,r)=>{r.d(t,{_:()=>
|
|
603
|
-
float getBakedOcclusion() { return 1.0; }`);if(2===r)return void
|
|
602
|
+
`)}(e,t,new i.m("textureAlphaCutoff",e=>e.textureAlphaCutoff))}},59469:(e,t,r)=>{r.d(t,{_:()=>l});var i=r(99208),n=r(40710),o=r(33079),s=r(31821),a=r(15976),c=r(63761);function l(e,t){const r=t.pbrMode,l=e.fragment;if(2!==r&&0!==r&&1!==r)return void l.code.add(s.H`void applyPBRFactors() {}`);if(0===r)return void l.code.add(s.H`void applyPBRFactors() {}
|
|
603
|
+
float getBakedOcclusion() { return 1.0; }`);if(2===r)return void l.code.add(s.H`vec3 mrr = vec3(0.0, 0.6, 0.2);
|
|
604
604
|
float occlusion = 1.0;
|
|
605
605
|
void applyPBRFactors() {}
|
|
606
|
-
float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:u,hasMetallicRoughnessTextureTransform:d,hasOcclusionTexture:h,hasOcclusionTextureTransform:m,bindType:p}=t;(u||h)&&e.include(i.r,t),
|
|
607
|
-
float occlusion;`),u&&
|
|
606
|
+
float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:u,hasMetallicRoughnessTextureTransform:d,hasOcclusionTexture:h,hasOcclusionTextureTransform:m,bindType:p}=t;(u||h)&&e.include(i.r,t),l.code.add(s.H`vec3 mrr;
|
|
607
|
+
float occlusion;`),u&&l.uniforms.add(1===p?new c.N("texMetallicRoughness",e=>e.textureMetallicRoughness):new a.o("texMetallicRoughness",e=>e.textureMetallicRoughness)),h&&l.uniforms.add(1===p?new c.N("texOcclusion",e=>e.textureOcclusion):new a.o("texOcclusion",e=>e.textureOcclusion)),l.uniforms.add(1===p?new o.t("mrrFactors",e=>e.mrrFactors):new n.W("mrrFactors",e=>e.mrrFactors)),l.code.add(s.H`
|
|
608
608
|
${(0,s.If)(u,s.H`void applyMetallicRoughness(vec2 uv) {
|
|
609
609
|
vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
|
|
610
610
|
mrr[0] *= metallicRoughness.b;
|
|
@@ -624,11 +624,11 @@ float occlusion;`),u&&c.uniforms.add(1===p?new l.N("texMetallicRoughness",e=>e.t
|
|
|
624
624
|
${(0,s.If)(u,`applyMetallicRoughness(${d?"metallicRoughnessUV":"vuv0"});`)}
|
|
625
625
|
${(0,s.If)(h,`applyOcclusion(${m?"occlusionUV":"vuv0"});`)}
|
|
626
626
|
}
|
|
627
|
-
`)}(r(74810),r(65786)).Y},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>d,Ut:()=>u,p1:()=>m,tb:()=>p,uO:()=>a,vJ:()=>g,vx:()=>f}),r(38954);var i=r(51850),n=r(58083),o=r(13030),s=r(620);function a(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,
|
|
627
|
+
`)}(r(74810),r(65786)).Y},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>d,Ut:()=>u,p1:()=>m,tb:()=>p,uO:()=>a,vJ:()=>g,vx:()=>f}),r(38954);var i=r(51850),n=r(58083),o=r(13030),s=r(620);function a(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,c=o.length;if(r*=a,1===i)for(let e=0;e<c;++e)s[r]=n[o[e]],r+=a;else for(let e=0;e<c;++e){const t=n[o[e]];for(let e=0;e<i;e++)s[r]=t,r+=a}}function c(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,s=t.typedBufferStride,a=n.length;r*=s;for(let e=0;e<a;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=s}}function l(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,c=o.length;if(r*=a,1===i)for(let e=0;e<c;++e){const t=3*o[e];s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],r+=a}else for(let e=0;e<c;++e){const t=3*o[e];for(let e=0;e<i;++e)s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],r+=a}}function u(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,c=o.length;if(r*=a,1===i)for(let e=0;e<c;++e){const t=4*o[e];s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],s[r+3]=n[t+3],r+=a}else for(let e=0;e<c;++e){const t=4*o[e];for(let e=0;e<i;++e)s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],s[r+3]=n[t+3],r+=a}}function d(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 l(e,r,i,o);const{data:s,indices:a}=e,c=r.typedBuffer,u=r.typedBufferStride,d=a.length,h=t[0],m=t[1],p=t[2],f=t[4],g=t[5],v=t[6],_=t[8],x=t[9],b=t[10],w=t[12],y=t[13],M=t[14];i*=u;let T=0,C=0,S=0;const E=(0,n.tZ)(t)?e=>{T=s[e]+w,C=s[e+1]+y,S=s[e+2]+M}:e=>{const t=s[e],r=s[e+1],i=s[e+2];T=h*t+f*r+_*i+w,C=m*t+g*r+x*i+y,S=p*t+v*r+b*i+M};if(1===o)for(let e=0;e<d;++e)E(3*a[e]),c[i]=T,c[i+1]=C,c[i+2]=S,i+=u;else for(let e=0;e<d;++e){E(3*a[e]);for(let e=0;e<o;++e)c[i]=T,c[i+1]=C,c[i+2]=S,i+=u}}function m(e,t,r,i,o=1){if(!t)return void l(e,r,i,o);const{data:s,indices:a}=e,c=t,u=r.typedBuffer,d=r.typedBufferStride,h=a.length,m=c[0],p=c[1],f=c[2],g=c[4],v=c[5],_=c[6],x=c[8],b=c[9],w=c[10],y=!(0,n.ut)(c),M=1e-6,T=1-M;i*=d;let C=0,S=0,E=0;const A=(0,n.tZ)(c)?e=>{C=s[e],S=s[e+1],E=s[e+2]}:e=>{const t=s[e],r=s[e+1],i=s[e+2];C=m*t+g*r+x*i,S=p*t+v*r+b*i,E=f*t+_*r+w*i};if(1===o)if(y)for(let e=0;e<h;++e){A(3*a[e]);const t=C*C+S*S+E*E;if(t<T&&t>M){const e=1/Math.sqrt(t);u[i]=C*e,u[i+1]=S*e,u[i+2]=E*e}else u[i]=C,u[i+1]=S,u[i+2]=E;i+=d}else for(let e=0;e<h;++e)A(3*a[e]),u[i]=C,u[i+1]=S,u[i+2]=E,i+=d;else for(let e=0;e<h;++e){if(A(3*a[e]),y){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)u[i]=C,u[i+1]=S,u[i+2]=E,i+=d}}function p(e,t,r,i,n=1){const{data:o,indices:s}=e,a=r.typedBuffer,c=r.typedBufferStride,l=s.length;if(i*=c,t===o.length&&4===t){a[i]=o[0],a[i+1]=o[1],a[i+2]=o[2],a[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=c/4,s=e[i/=4];i+=t;const u=l*n;for(let r=1;r<u;++r)e[i]=s,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<l;++e){const t=3*s[e];for(let e=0;e<n;++e)a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=255,i+=c}else for(let e=0;e<l;++e){const t=4*s[e];for(let e=0;e<n;++e)a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=o[t+3],i+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=o[t+3],i+=c}return}for(let e=0;e<l;++e){const t=3*s[e];a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=255,i+=c}}}function f(e,t,r,i,n=1){const o=t.typedBuffer,s=t.typedBufferStride;if(i*=s,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+=s;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+=s}function g(e,t,r,i,n,s,a){let c={numItems:0,numVerticesPerItem:0};for(const l of r.fields.keys()){const r=e.get(l),u=r?.indices;if(r&&u)"position"===l&&(c={numItems:1,numVerticesPerItem:u.length}),v(l,r,i,n,s,a);else if("olidColor"===l&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;f(t,s.getField(l,o.XP),e,a)}}}return c}function v(e,t,r,i,a,d){switch(e){case"position":{(0,s.vA)(3===t.size);const i=a.getField(e,o.xs);(0,s.vA)(!!i,`No buffer view for ${e}`),h(t,r,i,d);break}case"normal":{(0,s.vA)(3===t.size);const r=a.getField(e,o.xs);(0,s.vA)(!!r,`No buffer view for ${e}`),m(t,i,r,d);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,s.vA)(2===t.size);const r=a.getField(e,o.mJ);(0,s.vA)(!!r,`No buffer view for ${e}`),c(t,r,d);break}case"uv0":{(0,s.vA)(2===t.size);const r=a.getField(e,o.ZD)??a.getField(e,o.gH);(0,s.vA)(!!r,`No buffer view for ${e}`),c(t,r,d);break}case"uvi":{(0,s.vA)(2===t.size);const r=a.getField(e,o.mJ);(0,s.vA)(!!r,`No buffer view for ${e}`),c(t,r,d);break}case"color":case"symbolColor":{const r=a.getField(e,o.XP);(0,s.vA)(!!r,`No buffer view for ${e}`),(0,s.vA)(3===t.size||4===t.size),p(t,t.size,r,d);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=a.getField(e,o.Y$)??a.getField(e,o.Y$);(0,s.vA)(!!r,`No buffer view for ${e}`),(0,s.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,s=t.typedBufferStride,a=n.length,c=i[0];r*=s;for(let e=0;e<a;++e)o[r]=c,r+=s}(t,r,d);break}case"tangent":{(0,s.vA)(4===t.size);const i=a.getField(e,o.Eq);(0,s.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void u(e,r,i,o);const{data:s,indices:a}=e,c=t,l=r.typedBuffer,d=r.typedBufferStride,h=a.length,m=c[0],p=c[1],f=c[2],g=c[4],v=c[5],_=c[6],x=c[8],b=c[9],w=c[10],y=!(0,n.ut)(c),M=1e-6,T=1-M;if(i*=d,1===o)for(let e=0;e<h;++e){const t=4*a[e],r=s[t],n=s[t+1],o=s[t+2],c=s[t+3];let u=m*r+g*n+x*o,h=p*r+v*n+b*o,C=f*r+_*n+w*o;if(y){const e=u*u+h*h+C*C;if(e<T&&e>M){const t=1/Math.sqrt(e);u*=t,h*=t,C*=t}}l[i]=u,l[i+1]=h,l[i+2]=C,l[i+3]=c,i+=d}else for(let e=0;e<h;++e){const t=4*a[e],r=s[t],n=s[t+1],c=s[t+2],u=s[t+3];let h=m*r+g*n+x*c,C=p*r+v*n+b*c,S=f*r+_*n+w*c;if(y){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)l[i]=h,l[i+1]=C,l[i+2]=S,l[i+3]=u,i+=d}}(t,r,i,d);break}case"profileVertexAndNormal":{(0,s.vA)(4===t.size);const r=a.getField(e,o.jz)??a.getField(e,o.Eq);(0,s.vA)(!!r,`No buffer view for ${e}`),u(t,r,d);break}case"profileAuxData":{(0,s.vA)(3===t.size);const r=a.getField(e,o.EC)??a.getField(e,o.xs);(0,s.vA)(!!r,`No buffer view for ${e}`),l(t,r,d);break}}}(0,i.vt)()},60517:(e,t,r)=>{r.d(t,{z:()=>l});var i=r(49255),n=r(63201),o=r(42593),s=r(63365),a=r(31821),c=r(49788);function l(e,t){e.include(o.Q,t),e.include(n.NL,t),e.fragment.include(s.a);const{output:r,oitPass:l,discardInvisibleFragments:u,snowCover:d}=t,h=9===r,m=(0,i.LG)(r),p=(0,i.RN)(r)&&1===l,f=(0,i.RN)(r)&&1!==l;let g=0;(f||m||p)&&e.outputs.add("fragColor","vec4",g++),m&&e.outputs.add("fragEmission","vec4",g++),p&&e.outputs.add("fragAlpha","float",g++),e.fragment.code.add(a.H`
|
|
628
628
|
void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition, vec3 emissiveSymbolColor ${(0,a.If)(d,", float snow")}) {
|
|
629
629
|
${(0,a.If)(h,"finalColor.a = 1.0;")}
|
|
630
630
|
|
|
631
|
-
${(0,a.If)(u,`if (finalColor.a < ${a.H.float(
|
|
631
|
+
${(0,a.If)(u,`if (finalColor.a < ${a.H.float(c.Q)}) { discard; }`)}
|
|
632
632
|
|
|
633
633
|
finalColor = applySlice(finalColor, vWorldPosition);
|
|
634
634
|
${(0,a.If)(p,a.H`fragColor = premultiplyAlpha(finalColor);
|
|
@@ -638,7 +638,7 @@ float occlusion;`),u&&c.uniforms.add(1===p?new l.N("texMetallicRoughness",e=>e.t
|
|
|
638
638
|
calculateOcclusionAndOutputHighlight();
|
|
639
639
|
${(0,a.If)(h,"outputObjectAndLayerIdColor();")}
|
|
640
640
|
}
|
|
641
|
-
`)}},60864:(e,t,r)=>{r.d(t,{B:()=>_});var i=r(77690),n=r(29242),o=r(9093),s=r(38954),a=r(51850),
|
|
641
|
+
`)}},60864:(e,t,r)=>{r.d(t,{B:()=>_});var i=r(77690),n=r(29242),o=r(9093),s=r(38954),a=r(51850),c=r(26425),l=r(25178),u=r(23205),d=r(31821),h=r(35644),m=r(40095);function p(e,t){const r=e.length;for(let i=0;i<r;++i)g[0]=e[i],t[i]=g[0];return t}function f(e,t){const r=e.length;for(let i=0;i<r;++i)g[0]=e[i],g[1]=e[i]-g[0],t[i]=g[1];return t}const g=new Float32Array(2);r(65786).Y;const v=(0,n.vt)();function _(e,t){const{hasModelTransformation:r,instancedDoublePrecision:n,instanced:a,output:g,hasVertexTangents:_}=t;r&&(e.vertex.uniforms.add(new m.X("model",e=>e.modelTransformation??o.zK)),e.vertex.uniforms.add(new h.k("normalLocalOriginFromModel",e=>((0,i.Ge)(v,e.modelTransformation??o.zK),v)))),a&&n&&(e.attributes.add("instanceModelOriginHi","vec3"),e.attributes.add("instanceModelOriginLo","vec3"),e.attributes.add("instanceModel","mat3"),e.attributes.add("instanceModelNormal","mat3"));const b=e.vertex;n&&(b.include(c.u,t),b.uniforms.add(new u.d("viewOriginHi",e=>p((0,s.i)(x,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),x)),new u.d("viewOriginLo",e=>f((0,s.i)(x,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),x)))),b.code.add(d.H`
|
|
642
642
|
vec3 getVertexInLocalOriginSpace() {
|
|
643
643
|
return ${r?n?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":n?"instanceModel * localPosition().xyz":"localPosition().xyz"};
|
|
644
644
|
}
|
|
@@ -653,7 +653,7 @@ float occlusion;`),u&&c.uniforms.add(1===p?new l.N("texMetallicRoughness",e=>e.t
|
|
|
653
653
|
vec3 dpNormal(vec4 _normal) {
|
|
654
654
|
return normalize(${r?n?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":n?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
|
|
655
655
|
}
|
|
656
|
-
`),3===g&&((0,
|
|
656
|
+
`),3===g&&((0,l.S7)(b),b.code.add(d.H`
|
|
657
657
|
vec3 dpNormalView(vec4 _normal) {
|
|
658
658
|
return normalize((viewNormal * ${r?n?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":n?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
|
|
659
659
|
}
|
|
@@ -680,7 +680,7 @@ return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalV
|
|
|
680
680
|
vec3 linearizeGamma(vec3 color) {
|
|
681
681
|
return pow(color, vec3(GAMMA));
|
|
682
682
|
}
|
|
683
|
-
`)}var
|
|
683
|
+
`)}var c=r(40710),l=r(33079),u=r(28421),d=r(20304),h=r(15976),m=r(63761);function p(e,t){if(!(0,i.RN)(t.output))return;e.fragment.include(a);const{emissionSource:r,hasEmissiveTextureTransform:o,bindType:p}=t,f=3===r||4===r||5===r;f&&(e.include(n.r,t),e.fragment.uniforms.add(1===p?new m.N("texEmission",e=>e.textureEmissive):new h.o("texEmission",e=>e.textureEmissive)));const g=2===r||f;g&&e.fragment.uniforms.add(1===p?new l.t("emissiveBaseColor",e=>e.emissiveBaseColor):new c.W("emissiveBaseColor",e=>e.emissiveBaseColor));const v=0!==r;v&&7!==r&&6!==r&&4!==r&&5!==r&&e.fragment.uniforms.add(1===p?new d.m("emissiveStrength",e=>e.emissiveStrength):new u.J("emissiveStrength",e=>e.emissiveStrength));const _=7===r,x=5===r,b=1===r||6===r||_;e.fragment.code.add(s.H`
|
|
684
684
|
vec4 getEmissions(vec3 symbolColor) {
|
|
685
685
|
vec4 emissions = ${g?x?"emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(emissiveBaseColor, 1.0)":b?_?"emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(linearizeGamma(symbolColor), 1.0)":"vec4(0.0)"};
|
|
686
686
|
${(0,s.If)(f,`${(0,s.If)(x,`if(emissiveSource == 0) {\n vec4 emissiveFromTex = textureLookup(texEmission, ${o?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);\n }`,`vec4 emissiveFromTex = textureLookup(texEmission, ${o?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`)}\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
|
|
@@ -705,14 +705,14 @@ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
|
|
705
705
|
}
|
|
706
706
|
float rgb2v(vec3 c) {
|
|
707
707
|
return max(c.x, max(c.y, c.z));
|
|
708
|
-
}`)}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},63907:(e,t,r)=>{r.d(t,{CQ:()=>f,Fq:()=>m,H0:()=>o,SB:()=>l,WR:()=>i,XN:()=>s,iE:()=>a,ld:()=>c,nI:()=>p,pe:()=>n,r6:()=>d,vt:()=>u,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},s=Object.values(o),a={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},u={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},d=36064,h=36065,m=36066,p=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}},65786:(e,t,r)=>{r.d(t,{Y:()=>i});const i=class{};new i},65806:(e,t,r)=>{r.d(t,{g:()=>s});var i=r(51850),n=r(98988),o=r(9762);function s(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r)){a[0]=e.x,a[1]=e.y;const n=e.z;return a[2]=n??i??0,(0,o.projectBuffer)(a,e.spatialReference,0,t,r,0)}const s=(0,n.tryProjectWithZConversion)(e,r);return!!s&&(t[0]=s?.x,t[1]=s?.y,t[2]=s?.z??i??0,!0)}const a=(0,i.vt)()},65836:(e,t,r)=>{r.d(t,{n:()=>vt});var i=r(31821),n=r(12791),o=r(31635),s=r(34727),a=r(97768),l=r(36708),c=r(78659),u=r(10107),d=(r(44208),r(53966)),h=(r(87811),r(40608)),m=r(37585),p=r(69540);let f=class extends p.P{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,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"row",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"column",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"rows",void 0),(0,o.Cg)([(0,u.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),b=r(36005),w=r(43937),y=r(56507),M=r(86738);let T=class extends((0,p.O)(_.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,u.MZ)({type:M.A,json:{write:{isRequired:!0}}})],T.prototype,"position",void 0),(0,o.Cg)([(0,w.K)("position")],T.prototype,"writePosition",null),(0,o.Cg)([(0,b.w)("position")],T.prototype,"readPosition",null),(0,o.Cg)([(0,u.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,u.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>(0,s.qE)((0,y.GB)(e),-180,180))],T.prototype,"tilt",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,x.w)(e=>(0,s.qE)((0,y.GB)(e,55),1,170))],T.prototype,"fov",void 0),(0,o.Cg)([(0,u.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.d)((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.d)((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.c)(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,s=-i/2+this.column*o,a=s+o,l=-r/2+this.row*n,c=l+n,u=(0,N.$h)((0,S.vt)(),s*(1+2*this._padding[3]/e),a*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),d=this._get("projectionMatrix");return d&&(0,N.aI)(d,u)?d:u}copyFrom(e){(0,E.c)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,L.c)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,L.c)(this._padding,e.padding),this.notifyChange("_padding"),(0,m.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.c)(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,m.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,s.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,s.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,s.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,s.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,s=Math.max(n-r/2,0),a=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),u=r-l- -Math.min(this.fullWidth-n-r/2,0),d=i-c- -Math.min(o-i/2,0);return[Math.round(s),Math.round(a),Math.round(u),Math.round(d)]}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.i)(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,E.e)(k,this.center))>.9999*(0,E.l)(k)*e||((0,E.h)(this._up,k,this.center),(0,E.h)(this._up,this._up,k),(0,E.n)(this._up,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)(this._up,-k[0],-k[1],1-k[2]),(0,E.n)(this._up,this._up),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)):d.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,u.MZ)()],V.prototype,"_viewport",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_padding",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_fov",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_nearFar",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"pixelRatio",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"row",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"column",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_rows",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"rows",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_columns",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"columns",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"eye",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"center",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_center",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"up",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_up",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"viewMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"viewForward",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"viewUp",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"viewRight",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"nearFar",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"near",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"far",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"viewport",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"screenViewport",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"screenPadding",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"x",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"y",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"width",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"height",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"fullWidth",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"fullHeight",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"_aspect",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"padding",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"projectionMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"fov",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"fovX",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"fovY",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,u.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,s)=>{if(t[r]<i&&s[r]<i)return 1===n?0:1;if(t[r]>i&&s[r]>i)return 1===n?1:0;const a=(s[o]-t[o])/(s[r]-t[r]),l=t[o]+a*(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,m.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 se(e,t,r,i,n){let o=(0,E.n)(ie,e),a=(0,E.e)(o,i);const l=a>0;a=Math.abs(a),a>.99&&(a=Math.abs((0,E.e)(t,i)),a<.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,s.KJ)((0,s.XM)(e))}const u=(0,s.KJ)((0,s.XM)(-(0,E.e)(i,e)/(0,E.l)(e)));return r?(r.heading=c,r.tilt=u,r):{heading:c,tilt:u}}function ae(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),ue=(0,A.fA)(0,0,1),de=(0,S.vt)(),he=(0,A.vt)(),me=(0,A.vt)();function pe(e,t,r,i=oe()){const{direction:n,up:o}=i;return(0,N.N9)(de,-(0,s.kU)(t)),(0,N.eL)(de,de,(0,s.kU)(r)),(0,E.t)(n,ue,de),(0,E.g)(n,n,-1),(0,E.t)(o,ce,de),i}function fe(e,t,r,i,n){const o=t.lines[11].direction,s=(n-r.getAltitude(i))/o[2];(0,E.b)(e,i,o,s)}const ge=(0,A.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return se(t,r,i,ue,ce)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=pe(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,s.kU)(e)},headingTiltToDirectionUp:pe,lookAtTiltToEyeTilt:function(e){return(0,s.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,s=e.state.camera.eye,a=[],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),ae(ge,s,ge,l),a.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}(a,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,s=e.spatialReference??t.spatialReference;return(0,R.g)(t,he,o),(0,R.g)(t,me,o),he[0]-=r/2,me[0]+=r/2,he[1]-=i/2,me[1]+=i/2,(0,F.F)(he,o,he,s),(0,F.F)(me,o,me,s),n?(n.xmin=he[0],n.ymin=he[1],n.xmax=me[0],n.ymax=me[1],n.spatialReference=s):n=new Y.A(he[0],he[1],me[0],me[1],s),n}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),_e=r(97937),xe=r(28735);class be{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;we(this.lines[t],e[t],e[r]),we(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),we(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 we(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,s.kU)(t),e),(0,N.e$)(Re,Re,-(0,s.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 s=e[o],a=o===e.length-1?e[0]:e[o+1],l=(0,te.Cr)(s,a,We),c=(0,re.vE)(t,l.origin,l.vector,0,Ve);switch(c){case 2:r.push(s);break;case 3:i.push(s);break;case 0:case 1:{const[e,o,a]=0===c?[1,r,i]:[-1,i,r],l=(0,re.Qj)(t),u=(0,E.b)((0,A.vt)(),Ve,l,e*n),d=(0,E.b)((0,A.vt)(),Ve,l,e*-n);o.push(s),o.push(u),a.push(d)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Le={minCurvature:(0,s.kU)(5),maxCurvature:(0,s.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),se(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 a=t,l=(0,s.kU)(r),c=(0,s.kU)(i),u=Math.sin(l),d=Math.cos(l),h=Math.sin(c),m=Math.cos(c),p=(0,E.l)(o);let f;if(Math.abs(c)<1e-8)f=a+p;else{const e=p/h,t=(0,s.YN)(a/e),r=Math.PI-c-t;f=e*Math.sin(r)}const g=m*a,v=a*a*(h*h),_=d*d*v,x=f-g,b=x*x,w=_*(_+b-o[1]*o[1]);if(w<0)return(0,E.g)(n.eye,o,f/p),n.tilt=0,Ne(n,e);const y=Math.sqrt(w),M=o[1]*x,T=_+b;let C;if(C=d>0?-y+M:y+M,Math.abs(T)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=a):(0,E.g)(n.eye,o,f/p),n.tilt=0,De(n.eye),Ne(n,e);n.eye[1]=C/T;const S=u*u*v,I=h*a,R=d*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*b;return Math.abs(D)<1e-8?((0,E.g)(n.eye,o,f/p),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]*d+o[2]*u))/D,n.eye[2]=(O*(f*o[2]-g*o[2])-I*P*(o[2]*n.eye[1]*d-o[0]*u))/D,(0,E.g)(n.eye,n.eye,f),De(n.eye),Ne(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,s.kU)(e),n=(0,E.l)(t);return(0,s.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,s.YN)(r/(n/Math.sin(e)));return(0,s.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new be(r);i.near=2,n.update(i);const o=r.getAltitude(t),a=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,u=1+(0,E.j)(c,t)/(l+o),d=Math.sqrt(u*u-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=Le,g=function(e){const{renderCoordsHelper:t,state:{camera:r}}=e,{center:i,eye:n}=r,o=Math.abs(t.getAltitude(i)),a=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,s.XM)((0,E.e)(Ce,Te)/i)}(t,i,n));return(0,_e.b)(je,t.referenceEllipsoid.radius+o),(0,_e.d)(je,a,r.distance,r.fovY)}(e),v=(0,s.qE)((d-h)/(m-h),0,1),_=Math.round((0,s.Cc)(p,f,v)),x=i.aboveGround,b=n.planes[5],w=[],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,a=n.lines[e],l=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const u=n/_,d=0===n?0:(0,s.Cc)(t,i,1===e?1-(1-u)**2:3===e?u**2:u),h=(0,E.m)(Ue,a.origin,l.origin,d),m=(0,Se.nu)(a.direction,l.direction,d,Ge);r.intersectManifoldClosestSilhouette((0,G.LV)(h,m),o,Ve),ae(Ve,c,Ve,b),w.push((0,A.o8)(Ve)),0!==w.length&&T((0,E.x)(w.at(-1),Ve));const p=((0,re.Tj)(y,Ve)?1:0)|((0,re.Tj)(M,Ve)?2:0);ke[p]=1}}w.length>2&&(0,E.x)(w[0],w.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 s of e)t.fromRenderCoords(s,Ve,r),Math.abs(s[0])<i&&Math.abs(s[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(w,y),M):[w],r,a);return new X.A({rings:C,spatialReference:a})},toExtent:function(e,t,r,i,n){let o,a,l,c;const u=t.latitude,d=(0,O.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,n=(0,s.kU)(e),o=Math.sin(i/2),a=Math.cos(n),l=2*(0,s.YN)(Math.sqrt(o*o/(a*a)));return(0,s.KJ)(l)}(u,r,d)/2;o=h-m,a=h+m;const p=(0,s.kU)(u),f=(1+Math.sin(p))/(1-Math.sin(p)),g=(f+1)*Math.tan(i/d/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/d,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,s.KJ)(l),-90),c=Math.min((0,s.KJ)(c),90),a=Ie.monotonic(o,a),a-o>180){const e=(a-o-180)/2;o+=e,a-=e}const b=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:I.A.WGS84;return n?(n.xmin=o,n.ymin=l,n.xmax=a,n.ymax=c,n.spatialReference=b):n=new Y.A(o,l,a,c,b),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,u.MZ)({constructOnly:!0})],Ze.prototype,"view",void 0),(0,o.Cg)([(0,u.MZ)({constructOnly:!0})],Ze.prototype,"consumes",void 0),(0,o.Cg)([(0,u.MZ)()],Ze.prototype,"produces",void 0),(0,o.Cg)([(0,u.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);new Qe._("position",3,Je.pe.FLOAT,0,12);const et=[new Qe._("position",2,Je.pe.FLOAT,0,8)],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 rt=r(95774),it=r(90644);class nt extends Xe.w{constructor(e,t){super(e,t,new Ye.$(rt.S,()=>r.e(9384).then(r.bind(r,59384))),tt)}initializePipeline(){return(0,it.Ey)({colorWrite:it.kn})}}var ot=r(65786);class st extends ot.Y{constructor(){super(...arguments),this.projScale=1}}class at extends st{constructor(){super(...arguments),this.intensity=1}}class lt extends ot.Y{}class ct extends lt{constructor(){super(...arguments),this.blurSize=(0,H.vt)()}}var ut=r(15581);class dt extends Xe.w{constructor(e,t){super(e,t,new Ye.$(ut.S,()=>r.e(191).then(r.bind(r,90191))),tt)}initializePipeline(){return(0,it.Ey)({colorWrite:it.kn})}}var ht=r(76284),mt=r(67171);const pt=2;let ft=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 at,this._drawParameters=new ct}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 ht.g(this.renderingContext,t,e),this.techniques.precompile(dt),this.techniques.precompile(nt),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,a.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(dt),o=this.techniques.get(nt);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 a=this.renderingContext,l=this.view.qualitySettings.fadeDuration,u=this.bindParameters,d=u.camera,h=d.relativeElevation,p=(0,s.qE)((5e5-h)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,g=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*gt/(0,ut.g)(d)**6*g;const v=d.fullViewport[2],_=d.fullViewport[3],x=this.fboCache.acquire(v,_,"ssao input",2);a.bindFramebuffer(x.fbo),a.setViewport(0,0,v,_),a.bindTechnique(n,u,this._passParameters,this._drawParameters),a.screen.draw();const b=Math.round(v/pt),w=Math.round(_/pt),y=this.fboCache.acquire(b,w,"ssao blur",0);a.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,m.hZ)(this._drawParameters.blurSize,0,pt/_),a.bindTechnique(o,u,this._passParameters,this._drawParameters),a.setViewport(0,0,b,w),a.screen.draw(),x.release();const M=this.fboCache.acquire(b,w,$e,0);return a.bindFramebuffer(M.fbo),a.setViewport(0,0,v,_),a.setClearColor(1,1,1,0),a.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,m.hZ)(this._drawParameters.blurSize,pt/v,0),a.bindTechnique(o,u,this._passParameters,this._drawParameters),a.setViewport(0,0,b,w),a.screen.draw(),a.setViewport4fv(d.fullViewport),y.release(),f<1&&this.requestRender(1),M}};(0,o.Cg)([(0,u.MZ)()],ft.prototype,"consumes",void 0),(0,o.Cg)([(0,u.MZ)()],ft.prototype,"produces",void 0),(0,o.Cg)([(0,u.MZ)({constructOnly:!0})],ft.prototype,"isEnabled",void 0),ft=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ft);const gt=.5;function vt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/pt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
708
|
+
}`)}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,n)=>r.bindTexture(e,t(i,n)))}}},63907:(e,t,r)=>{r.d(t,{CQ:()=>f,Fq:()=>m,H0:()=>o,SB:()=>c,WR:()=>i,XN:()=>s,iE:()=>a,ld:()=>l,nI:()=>p,pe:()=>n,r6:()=>d,vt:()=>u,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},s=Object.values(o),a={DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},c={DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},l={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},u={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},d=36064,h=36065,m=36066,p=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}},65786:(e,t,r)=>{r.d(t,{Y:()=>i});const i=class{};new i},65806:(e,t,r)=>{r.d(t,{g:()=>s});var i=r(51850),n=r(98988),o=r(9762);function s(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r)){a[0]=e.x,a[1]=e.y;const n=e.z;return a[2]=n??i??0,(0,o.projectBuffer)(a,e.spatialReference,0,t,r,0)}const s=(0,n.tryProjectWithZConversion)(e,r);return!!s&&(t[0]=s?.x,t[1]=s?.y,t[2]=s?.z??i??0,!0)}const a=(0,i.vt)()},65836:(e,t,r)=>{r.d(t,{n:()=>vt});var i=r(31821),n=r(12791),o=r(31635),s=r(34727),a=r(97768),c=r(36708),l=r(78659),u=r(10107),d=(r(44208),r(53966)),h=(r(87811),r(40608)),m=r(37585),p=r(69540);let f=class extends p.P{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,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"row",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"column",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],f.prototype,"rows",void 0),(0,o.Cg)([(0,u.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),b=r(36005),w=r(43937),y=r(56507),M=r(86738);let T=class extends((0,p.O)(_.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,u.MZ)({type:M.A,json:{write:{isRequired:!0}}})],T.prototype,"position",void 0),(0,o.Cg)([(0,w.K)("position")],T.prototype,"writePosition",null),(0,o.Cg)([(0,b.w)("position")],T.prototype,"readPosition",null),(0,o.Cg)([(0,u.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,u.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,x.w)(e=>(0,s.qE)((0,y.GB)(e),-180,180))],T.prototype,"tilt",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,x.w)(e=>(0,s.qE)((0,y.GB)(e,55),1,170))],T.prototype,"fov",void 0),(0,o.Cg)([(0,u.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.d)((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.d)((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.c)(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,s=-i/2+this.column*o,a=s+o,c=-r/2+this.row*n,l=c+n,u=(0,N.$h)((0,S.vt)(),s*(1+2*this._padding[3]/e),a*(1+2*this._padding[1]/e),c*(1+2*this._padding[2]/t),l*(1+2*this._padding[0]/t),this.near,this.far),d=this._get("projectionMatrix");return d&&(0,N.aI)(d,u)?d:u}copyFrom(e){(0,E.c)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,L.c)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,L.c)(this._padding,e.padding),this.notifyChange("_padding"),(0,m.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.c)(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,m.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,s.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,s.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,s.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,s.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,s=Math.max(n-r/2,0),a=Math.max(this.fullHeight-o-i/2,0),c=-Math.min(n-r/2,0),l=-Math.min(this.fullHeight-o-i/2,0),u=r-c- -Math.min(this.fullWidth-n-r/2,0),d=i-l- -Math.min(o-i/2,0);return[Math.round(s),Math.round(a),Math.round(u),Math.round(d)]}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.i)(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,E.e)(k,this.center))>.9999*(0,E.l)(k)*e||((0,E.h)(this._up,k,this.center),(0,E.h)(this._up,this._up,k),(0,E.n)(this._up,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)(this._up,-k[0],-k[1],1-k[2]),(0,E.n)(this._up,this._up),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)):d.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,u.MZ)()],V.prototype,"_viewport",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_padding",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_fov",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_nearFar",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"pixelRatio",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"row",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"column",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_rows",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"rows",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_columns",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"columns",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"eye",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"center",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_center",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"up",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"_up",void 0),(0,o.Cg)([(0,u.MZ)()],V.prototype,"viewMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"viewForward",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"viewUp",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"viewRight",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"nearFar",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"near",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"far",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"viewport",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"screenViewport",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"screenPadding",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"x",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"y",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"width",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"height",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"fullWidth",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"fullHeight",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"_aspect",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"padding",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"projectionMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"fov",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"fovX",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"fovY",null),(0,o.Cg)([(0,u.MZ)()],V.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],V.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,u.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,s)=>{if(t[r]<i&&s[r]<i)return 1===n?0:1;if(t[r]>i&&s[r]>i)return 1===n?1:0;const a=(s[o]-t[o])/(s[r]-t[r]),c=t[o]+a*(i-t[r]);return e[r]=i,e[o]=c,(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,m.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 se(e,t,r,i,n){let o=(0,E.n)(ie,e),a=(0,E.e)(o,i);const c=a>0;a=Math.abs(a),a>.99&&(a=Math.abs((0,E.e)(t,i)),a<.99?((0,E.c)(o,t),c&&(0,E.g)(o,o,-1)):o=null);let l=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),l=((0,E.e)(ne,i)>0?1:-1)*(0,s.KJ)((0,s.XM)(e))}const u=(0,s.KJ)((0,s.XM)(-(0,E.e)(i,e)/(0,E.l)(e)));return r?(r.heading=l,r.tilt=u,r):{heading:l,tilt:u}}function ae(e,t,r,i){(0,E.d)(ce,r,t),(0,re.T7)(i,(0,te.LV)(t,ce),e)||e===r||(0,E.c)(e,r)}const ce=(0,A.vt)(),le=(0,A.fA)(0,1,0),ue=(0,A.fA)(0,0,1),de=(0,S.vt)(),he=(0,A.vt)(),me=(0,A.vt)();function pe(e,t,r,i=oe()){const{direction:n,up:o}=i;return(0,N.N9)(de,-(0,s.kU)(t)),(0,N.eL)(de,de,(0,s.kU)(r)),(0,E.t)(n,ue,de),(0,E.g)(n,n,-1),(0,E.t)(o,le,de),i}function fe(e,t,r,i,n){const o=t.lines[11].direction,s=(n-r.getAltitude(i))/o[2];(0,E.b)(e,i,o,s)}const ge=(0,A.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return se(t,r,i,ue,le)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=pe(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,s.kU)(e)},headingTiltToDirectionUp:pe,lookAtTiltToEyeTilt:function(e){return(0,s.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,s=e.state.camera.eye,a=[],c=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),ae(ge,s,ge,c),a.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}(a,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,s=e.spatialReference??t.spatialReference;return(0,R.g)(t,he,o),(0,R.g)(t,me,o),he[0]-=r/2,me[0]+=r/2,he[1]-=i/2,me[1]+=i/2,(0,F.F)(he,o,he,s),(0,F.F)(me,o,me,s),n?(n.xmin=he[0],n.ymin=he[1],n.xmax=me[0],n.ymax=me[1],n.spatialReference=s):n=new Y.A(he[0],he[1],me[0],me[1],s),n}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),_e=r(97937),xe=r(28735);class be{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;we(this.lines[t],e[t],e[r]),we(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),we(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 we(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,s.kU)(t),e),(0,N.e$)(Re,Re,-(0,s.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 s=e[o],a=o===e.length-1?e[0]:e[o+1],c=(0,te.Cr)(s,a,We),l=(0,re.vE)(t,c.origin,c.vector,0,Ve);switch(l){case 2:r.push(s);break;case 3:i.push(s);break;case 0:case 1:{const[e,o,a]=0===l?[1,r,i]:[-1,i,r],c=(0,re.Qj)(t),u=(0,E.b)((0,A.vt)(),Ve,c,e*n),d=(0,E.b)((0,A.vt)(),Ve,c,e*-n);o.push(s),o.push(u),a.push(d)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Le={minCurvature:(0,s.kU)(5),maxCurvature:(0,s.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),se(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 a=t,c=(0,s.kU)(r),l=(0,s.kU)(i),u=Math.sin(c),d=Math.cos(c),h=Math.sin(l),m=Math.cos(l),p=(0,E.l)(o);let f;if(Math.abs(l)<1e-8)f=a+p;else{const e=p/h,t=(0,s.YN)(a/e),r=Math.PI-l-t;f=e*Math.sin(r)}const g=m*a,v=a*a*(h*h),_=d*d*v,x=f-g,b=x*x,w=_*(_+b-o[1]*o[1]);if(w<0)return(0,E.g)(n.eye,o,f/p),n.tilt=0,Ne(n,e);const y=Math.sqrt(w),M=o[1]*x,T=_+b;let C;if(C=d>0?-y+M:y+M,Math.abs(T)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=a):(0,E.g)(n.eye,o,f/p),n.tilt=0,De(n.eye),Ne(n,e);n.eye[1]=C/T;const S=u*u*v,I=h*a,R=d*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*b;return Math.abs(D)<1e-8?((0,E.g)(n.eye,o,f/p),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]*d+o[2]*u))/D,n.eye[2]=(O*(f*o[2]-g*o[2])-I*P*(o[2]*n.eye[1]*d-o[0]*u))/D,(0,E.g)(n.eye,n.eye,f),De(n.eye),Ne(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,s.kU)(e),n=(0,E.l)(t);return(0,s.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,s.YN)(r/(n/Math.sin(e)));return(0,s.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new be(r);i.near=2,n.update(i);const o=r.getAltitude(t),a=e.spatialReference,c=r.referenceEllipsoid.radius,l=i.eye,u=1+(0,E.j)(l,t)/(c+o),d=Math.sqrt(u*u-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=Le,g=function(e){const{renderCoordsHelper:t,state:{camera:r}}=e,{center:i,eye:n}=r,o=Math.abs(t.getAltitude(i)),a=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,s.XM)((0,E.e)(Ce,Te)/i)}(t,i,n));return(0,_e.b)(je,t.referenceEllipsoid.radius+o),(0,_e.d)(je,a,r.distance,r.fovY)}(e),v=(0,s.qE)((d-h)/(m-h),0,1),_=Math.round((0,s.Cc)(p,f,v)),x=i.aboveGround,b=n.planes[5],w=[],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,a=n.lines[e],c=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const u=n/_,d=0===n?0:(0,s.Cc)(t,i,1===e?1-(1-u)**2:3===e?u**2:u),h=(0,E.m)(Ue,a.origin,c.origin,d),m=(0,Se.nu)(a.direction,c.direction,d,Ge);r.intersectManifoldClosestSilhouette((0,G.LV)(h,m),o,Ve),ae(Ve,l,Ve,b),w.push((0,A.o8)(Ve)),0!==w.length&&T((0,E.x)(w.at(-1),Ve));const p=((0,re.Tj)(y,Ve)?1:0)|((0,re.Tj)(M,Ve)?2:0);ke[p]=1}}w.length>2&&(0,E.x)(w[0],w.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 s of e)t.fromRenderCoords(s,Ve,r),Math.abs(s[0])<i&&Math.abs(s[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(w,y),M):[w],r,a);return new X.A({rings:C,spatialReference:a})},toExtent:function(e,t,r,i,n){let o,a,c,l;const u=t.latitude,d=(0,O.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,n=(0,s.kU)(e),o=Math.sin(i/2),a=Math.cos(n),c=2*(0,s.YN)(Math.sqrt(o*o/(a*a)));return(0,s.KJ)(c)}(u,r,d)/2;o=h-m,a=h+m;const p=(0,s.kU)(u),f=(1+Math.sin(p))/(1-Math.sin(p)),g=(f+1)*Math.tan(i/d/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(c=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*f+_))),l=c+i/d,c=x(c),l=x(l),l<c){const e=l;l=c,c=e}if(c=Math.max((0,s.KJ)(c),-90),l=Math.min((0,s.KJ)(l),90),a=Ie.monotonic(o,a),a-o>180){const e=(a-o-180)/2;o+=e,a-=e}const b=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:I.A.WGS84;return n?(n.xmin=o,n.ymin=c,n.xmax=a,n.ymax=l,n.spatialReference=b):n=new Y.A(o,c,a,l,b),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,c.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},c.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,u.MZ)({constructOnly:!0})],Ze.prototype,"view",void 0),(0,o.Cg)([(0,u.MZ)({constructOnly:!0})],Ze.prototype,"consumes",void 0),(0,o.Cg)([(0,u.MZ)()],Ze.prototype,"produces",void 0),(0,o.Cg)([(0,u.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);new Qe._("position",3,Je.pe.FLOAT,0,12);const et=[new Qe._("position",2,Je.pe.FLOAT,0,8)],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 rt=r(95774),it=r(90644);class nt extends Xe.w{constructor(e,t){super(e,t,new Ye.$(rt.S,()=>r.e(9384).then(r.bind(r,59384))),tt)}initializePipeline(){return(0,it.Ey)({colorWrite:it.kn})}}var ot=r(65786);class st extends ot.Y{constructor(){super(...arguments),this.projScale=1}}class at extends st{constructor(){super(...arguments),this.intensity=1}}class ct extends ot.Y{}class lt extends ct{constructor(){super(...arguments),this.blurSize=(0,H.vt)()}}var ut=r(15581);class dt extends Xe.w{constructor(e,t){super(e,t,new Ye.$(ut.S,()=>r.e(191).then(r.bind(r,90191))),tt)}initializePipeline(){return(0,it.Ey)({colorWrite:it.kn})}}var ht=r(76284),mt=r(67171);const pt=2;let ft=class extends Ze{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=$e,this.isEnabled=()=>!1,this._enableTime=(0,l.l5)(0),this._passParameters=new at,this._drawParameters=new lt}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 ht.g(this.renderingContext,t,e),this.techniques.precompile(dt),this.techniques.precompile(nt),this.addHandles((0,c.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,l.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,a.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(dt),o=this.techniques.get(nt);if(!n.compiled||!o.compiled)return this._enableTime=(0,l.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,l.l5)(performance.now()));const a=this.renderingContext,c=this.view.qualitySettings.fadeDuration,u=this.bindParameters,d=u.camera,h=d.relativeElevation,p=(0,s.qE)((5e5-h)/2e5,0,1),f=c>0?Math.min(c,performance.now()-this._enableTime)/c:1,g=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*gt/(0,ut.g)(d)**6*g;const v=d.fullViewport[2],_=d.fullViewport[3],x=this.fboCache.acquire(v,_,"ssao input",2);a.bindFramebuffer(x.fbo),a.setViewport(0,0,v,_),a.bindTechnique(n,u,this._passParameters,this._drawParameters),a.screen.draw();const b=Math.round(v/pt),w=Math.round(_/pt),y=this.fboCache.acquire(b,w,"ssao blur",0);a.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,m.hZ)(this._drawParameters.blurSize,0,pt/_),a.bindTechnique(o,u,this._passParameters,this._drawParameters),a.setViewport(0,0,b,w),a.screen.draw(),x.release();const M=this.fboCache.acquire(b,w,$e,0);return a.bindFramebuffer(M.fbo),a.setViewport(0,0,v,_),a.setClearColor(1,1,1,0),a.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,m.hZ)(this._drawParameters.blurSize,pt/v,0),a.bindTechnique(o,u,this._passParameters,this._drawParameters),a.setViewport(0,0,b,w),a.screen.draw(),a.setViewport4fv(d.fullViewport),y.release(),f<1&&this.requestRender(1),M}};(0,o.Cg)([(0,u.MZ)()],ft.prototype,"consumes",void 0),(0,o.Cg)([(0,u.MZ)()],ft.prototype,"produces",void 0),(0,o.Cg)([(0,u.MZ)({constructOnly:!0})],ft.prototype,"isEnabled",void 0),ft=(0,o.Cg)([(0,h.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ft);const gt=.5;function vt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/pt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
709
709
|
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
710
710
|
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
711
711
|
}
|
|
712
712
|
float evaluateAmbientOcclusion() {
|
|
713
713
|
return 1.0 - evaluateAmbientOcclusionInverse();
|
|
714
714
|
}`)):e.code.add(i.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
|
|
715
|
-
float evaluateAmbientOcclusion() { return 0.0; }`)}},67171:(e,t,r)=>{r.d(t,{R:()=>o,e:()=>s});var i=r(63907),n=r(42293);class o{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function s(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.I)(e.internalFormat))*(34067===e.target?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,n,o,s)=>i.setUniform2fv(e,t(n,o,s),r))}}},69052:(e,t,r)=>{r.d(t,{hr:()=>n,ie:()=>
|
|
715
|
+
float evaluateAmbientOcclusion() { return 0.0; }`)}},67171:(e,t,r)=>{r.d(t,{R:()=>o,e:()=>s});var i=r(63907),n=r(42293);class o{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function s(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.I)(e.internalFormat))*(34067===e.target?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,n,o,s)=>i.setUniform2fv(e,t(n,o,s),r))}}},69052:(e,t,r)=>{r.d(t,{hr:()=>n,ie:()=>c,uC:()=>a});var i=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+s(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,i,n=0,o=!1){return(i-=n)<t?i+=s(e,t-i):i>r&&(i-=s(e,i-r)),o&&i===r&&(i=t),i+n}function s(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const a=new n(0,2*Math.PI),c=(new n(-Math.PI,Math.PI),new n(0,360))},71955:(e,t,r)=>{r.d(t,{K:()=>c});var i=r(43519),n=r(31821),o=r(74333);class s extends o.n{constructor(e,t){super(e,"int",1,(r,i,n)=>r.setUniform1i(e,t(i,n)))}}var a=r(43616);function c(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new s("symbolColorMixMode",e=>a.Um[e.colorMixMode])),t.hasSymbolColors?(e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.attributes.add("symbolColor","vec4"),e.vertex.code.add(n.H`
|
|
716
716
|
MaskedColor applySymbolColor(MaskedColor color) {
|
|
717
717
|
return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${"symbolColor"}));
|
|
718
718
|
}
|
|
@@ -723,11 +723,11 @@ return color;
|
|
|
723
723
|
colorMixMode = mask.r ? ${n.H.int(a.Um.ignore)} : symbolColorMixMode;
|
|
724
724
|
opacityMixMode = mask.a ? ${n.H.int(a.Um.ignore)} : symbolColorMixMode;
|
|
725
725
|
}
|
|
726
|
-
`)}},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:()=>d,Zo:()=>h,gy:()=>m});var i=r(21818),n=r(29242),o=r(91829),s=r(96336),a=r(33752),
|
|
726
|
+
`)}},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:()=>d,Zo:()=>h,gy:()=>m});var i=r(21818),n=r(29242),o=r(91829),s=r(96336),a=r(33752),c=r(31821),l=r(98353),u=r(35644);function d(e,t){switch(t.normalType){case 0:case 1:e.include(s.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new l.h("transformNormalGlobalFromModel",e=>e.transformNormalGlobalFromModel),new u.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)).code.add(c.H`void forwardNormal() {
|
|
727
727
|
vNormalWorld = transformNormalGlobalFromModel * normalModel();
|
|
728
728
|
vNormalView = transformNormalViewFromGlobal * vNormalWorld;
|
|
729
|
-
}`);break;case 2:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends a.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,n.vt)()}}class m extends a.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,s=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=s}}},74333:(e,t,r)=>{r.d(t,{n:()=>i}),r(44208);class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>a,Jr:()=>o,SY:()=>l,mb:()=>s});var i=r(38954),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:s,emissiveFactor:a,occlusionTexture:l}){return null==e&&null==t&&null==s&&(null==a||(0,i.q)(a,n.uY))&&null==l&&(null==o||1===o)&&(null==r||1===r)}const s=(0,n.CN)(1,1,.5),a=(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),s=r(97768),a=r(93637),l=r(74887),c=r(94656),u=r(63907),d=r(67171);const h=()=>o.A.getLogger("esri/views/webgl/textureUtils");function m(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&&(p(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 p(e){return(0,a.a4)(u.SB,e)}function f(e){return(0,a.a4)(u.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 b(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case u.ld.FLOAT:switch(e.pixelFormat){case 6408:return u.H0.RGBA32F;case 6407:return u.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case u.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return u.H0.RGBA8;case 6407:return u.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?u.iE.DEPTH24_STENCIL8:6402===t?u.SB.DEPTH_COMPONENT24:t,e.internalFormat}class w extends d.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R32F:case u.H0.R8_SNORM:case u.H0.R8:this.pixelFormat=6403;break;case u.H0.R8I:case u.H0.R8UI:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32I:case u.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new w(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=w.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,d.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}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(u.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,a.a4)(u.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,s,a,l=0){a||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=b(c);const{context:u,pixelFormat:d,dataType:h,target:m,isImmutable:p}=c;if(p&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const f=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||n<0||r+o>c.width||n+s>c.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=u;l&&(o&&s||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),_.pixelStorei(_.UNPACK_SKIP_ROWS,l)),v(a)?_.texSubImage2D(m,t,r,n,o,s,d,h,a):g(a)?_.compressedTexSubImage2D(m,t,r,n,o,s,c.internalFormat,a.levels[t]):_.texSubImage2D(m,t,r,n,o,s,d,h,a),l&&_.pixelStorei(_.UNPACK_SKIP_ROWS,0),u.bindTexture(f,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,n,o,s,a,l,c){c||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const u=this._descriptor;u.internalFormat=b(u);const{context:d,pixelFormat:h,dataType:m,isImmutable:p,target:f}=u;if(p&&!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=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||n<0||o<0||r+s>u.width||n+a>u.height||o+l>u.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=d;if(g(c))c=c.levels[t],x.compressedTexSubImage3D(f,t,r,n,o,s,a,l,u.internalFormat,c);else{const e=c;x.texSubImage3D(f,t,r,n,o,s,a,l,h,m,e)}d.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,m(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,m(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,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(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,s.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(u.vt.Texture,this)),m(n);const s=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,d=_(l);if(v(t))this._setDataFromTexImageSource(t,l);else{const{width:e,height:r,depth:s}=n;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(d&&null==s)throw new i.A("texture:missing-depth","Depth must be specified!");if(n.internalFormat=b(n),n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,n.internalFormat,n.hasMipmap,e,r,s),g(t)){if(!function(e){return null!=e&&(0,a.a4)(u.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,s,t),(0,c.Y2)(o),n.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),n.context.bindTexture(s,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=b(i);const n=_(t),{width:o,height:s,depth:a}=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=s),n&&i.depth,n&&(i.depth=a),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,s,a),this._texImage(t,0,i.internalFormat,o,s,a,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:s}=i,a=e.levels,l=x(r,n,o,s),c=Math.min(l,a.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,n,o)=>{const s=a[Math.min(e,a.length-1)];this._compressedTexImage(r,e,t,i,n,o,s)},c)}_texStorage(e,t,r,n,o,s){const{gl:a}=this._descriptor.context;if(!function(e){return u.XN.includes(e)}(t)&&!p(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,s):1;if(_(e)){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(e,l,t,n,o,s)}else a.texStorage2D(e,l,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,s,a){const l=this._descriptor.context.gl,c=_(e),{isImmutable:u,pixelFormat:d,dataType:h}=this._descriptor;if(u){if(null!=a){const r=a;if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,n,o,s,d,h,r)}else l.texSubImage2D(e,t,0,0,n,o,d,h,r)}}else{const u=a;if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,n,o,s,0,d,h,u)}else l.texImage2D(e,t,r,n,o,0,d,h,u)}}_compressedTexImage(e,t,r,n,o,s,a){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=a)if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,n,o,s,r,a)}else l.compressedTexSubImage2D(e,t,0,0,n,o,r,a)}else if(c){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,n,o,s,0,a)}else l.compressedTexImage2D(e,t,r,n,o,0,a)}async _compressOnWorker(t){const{width:r,height:i,context:n,flipped:o,preMultiplyAlpha:s,hasMipmap:a}=this._descriptor,c=this._descriptor.compress?.compressionTracker,u=this._descriptor.compress?.compressionCallback,{compressedTextureETC:d,compressedTextureS3TC:h}=n.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!d&&!h)return;this.abortCompression();const m=new AbortController;this._compressionAbortController=m,c?.increment();try{let n;t instanceof Uint8Array?n=t.buffer:(n=await createImageBitmap(t,{imageOrientation:o?"flipY":"none"}),(0,l.Te)(m));const c={data:n,width:r,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,hasMipmap:a,hasETC:!!d,hasS3TC:!!h},p=await e.compressionWorkerHandle.invoke(c,m.signal,"low");if((0,l.Te)(m),p.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=p.internalFormat,this._setData(p.compressedTexture),u?.(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:s,target:a}=this._descriptor;const l=32879===a;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),s&&(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:()=>u});var i=r(58083),n=r(9093),o=r(38954),s=r(51850),a=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) { }
|
|
730
|
-
vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,new a.W("slicePlaneOrigin",(e,r)=>g(t,e,r)),new a.W("slicePlaneBasis1",(e,r)=>v(t,e,r,r.slicePlane?.basis1)),new a.W("slicePlaneBasis2",(e,r)=>v(t,e,r,r.slicePlane?.basis2)))}function u(e,t){h(e,t,new a.W("slicePlaneOrigin",(e,r)=>g(t,e,r)),new a.W("slicePlaneBasis1",(e,r)=>v(t,e,r,r.slicePlane?.basis1)),new a.W("slicePlaneBasis2",(e,r)=>v(t,e,r,r.slicePlane?.basis2)))}r(65786).Y;const d=
|
|
729
|
+
}`);break;case 2:e.vertex.code.add(c.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends a.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,n.vt)()}}class m extends a.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,s=0){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=s}}},74333:(e,t,r)=>{r.d(t,{n:()=>i}),r(44208);class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>a,Jr:()=>o,SY:()=>c,mb:()=>s});var i=r(38954),n=r(51850);function o({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:s,emissiveFactor:a,occlusionTexture:c}){return null==e&&null==t&&null==s&&(null==a||(0,i.q)(a,n.uY))&&null==c&&(null==o||1===o)&&(null==r||1===r)}const s=(0,n.CN)(1,1,.5),a=(0,n.CN)(0,.6,.2),c=(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),s=r(97768),a=r(93637),c=r(74887),l=r(94656),u=r(63907),d=r(67171);const h=()=>o.A.getLogger("esri/views/webgl/textureUtils");function m(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&&(p(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 p(e){return(0,a.a4)(u.SB,e)}function f(e){return(0,a.a4)(u.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 b(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case u.ld.FLOAT:switch(e.pixelFormat){case 6408:return u.H0.RGBA32F;case 6407:return u.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case u.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return u.H0.RGBA8;case 6407:return u.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?u.iE.DEPTH24_STENCIL8:6402===t?u.SB.DEPTH_COMPONENT24:t,e.internalFormat}class w extends d.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R32F:case u.H0.R8_SNORM:case u.H0.R8:this.pixelFormat=6403;break;case u.H0.R8I:case u.H0.R8UI:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32I:case u.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new w(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=w.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,d.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}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(u.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,a.a4)(u.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,s,a,c=0){a||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=b(l);const{context:u,pixelFormat:d,dataType:h,target:m,isImmutable:p}=l;if(p&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const f=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||n<0||r+o>l.width||n+s>l.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=u;c&&(o&&s||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),_.pixelStorei(_.UNPACK_SKIP_ROWS,c)),v(a)?_.texSubImage2D(m,t,r,n,o,s,d,h,a):g(a)?_.compressedTexSubImage2D(m,t,r,n,o,s,l.internalFormat,a.levels[t]):_.texSubImage2D(m,t,r,n,o,s,d,h,a),c&&_.pixelStorei(_.UNPACK_SKIP_ROWS,0),u.bindTexture(f,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,n,o,s,a,c,l){l||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const u=this._descriptor;u.internalFormat=b(u);const{context:d,pixelFormat:h,dataType:m,isImmutable:p,target:f}=u;if(p&&!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=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||n<0||o<0||r+s>u.width||n+a>u.height||o+c>u.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=d;if(g(l))l=l.levels[t],x.compressedTexSubImage3D(f,t,r,n,o,s,a,c,u.internalFormat,l);else{const e=l;x.texSubImage3D(f,t,r,n,o,s,a,c,h,m,e)}d.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,m(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,m(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,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(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,s.DC)(this._compressionAbortController)}_setData(t,r){const n=this._descriptor,o=n.context?.gl;if(!o)return;(0,l.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),n.context.instanceCounter.increment(u.vt.Texture,this)),m(n);const s=n.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);n.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,l.Y2)(o);const c=r??n.target,d=_(c);if(v(t))this._setDataFromTexImageSource(t,c);else{const{width:e,height:r,depth:s}=n;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(d&&null==s)throw new i.A("texture:missing-depth","Depth must be specified!");if(n.internalFormat=b(n),n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,n.internalFormat,n.hasMipmap,e,r,s),g(t)){if(!function(e){return null!=e&&(0,a.a4)(u.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,c)}else this._texImage(c,0,n.internalFormat,e,r,s,t),(0,l.Y2)(o),n.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,l.Y2)(o),n.context.bindTexture(s,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=b(i);const n=_(t),{width:o,height:s,depth:a}=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=s),n&&i.depth,n&&(i.depth=a),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,s,a),this._texImage(t,0,i.internalFormat,o,s,a,e),(0,l.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,l.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:s}=i,a=e.levels,c=x(r,n,o,s),l=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,l),this._forEachMipmapLevel((e,i,n,o)=>{const s=a[Math.min(e,a.length-1)];this._compressedTexImage(r,e,t,i,n,o,s)},l)}_texStorage(e,t,r,n,o,s){const{gl:a}=this._descriptor.context;if(!function(e){return u.XN.includes(e)}(t)&&!p(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?x(e,n,o,s):1;if(_(e)){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(e,c,t,n,o,s)}else a.texStorage2D(e,c,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,s,a){const c=this._descriptor.context.gl,l=_(e),{isImmutable:u,pixelFormat:d,dataType:h}=this._descriptor;if(u){if(null!=a){const r=a;if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,n,o,s,d,h,r)}else c.texSubImage2D(e,t,0,0,n,o,d,h,r)}}else{const u=a;if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,n,o,s,0,d,h,u)}else c.texImage2D(e,t,r,n,o,0,d,h,u)}}_compressedTexImage(e,t,r,n,o,s,a){const c=this._descriptor.context.gl,l=_(e);if(this._descriptor.isImmutable){if(null!=a)if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,n,o,s,r,a)}else c.compressedTexSubImage2D(e,t,0,0,n,o,r,a)}else if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,n,o,s,0,a)}else c.compressedTexImage2D(e,t,r,n,o,0,a)}async _compressOnWorker(t){const{width:r,height:i,context:n,flipped:o,preMultiplyAlpha:s,hasMipmap:a}=this._descriptor,l=this._descriptor.compress?.compressionTracker,u=this._descriptor.compress?.compressionCallback,{compressedTextureETC:d,compressedTextureS3TC:h}=n.capabilities;if(!e.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!d&&!h)return;this.abortCompression();const m=new AbortController;this._compressionAbortController=m,l?.increment();try{let n;t instanceof Uint8Array?n=t.buffer:(n=await createImageBitmap(t,{imageOrientation:o?"flipY":"none"}),(0,c.Te)(m));const l={data:n,width:r,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,hasMipmap:a,hasETC:!!d,hasS3TC:!!h},p=await e.compressionWorkerHandle.invoke(l,m.signal,"low");if((0,c.Te)(m),p.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=p.internalFormat,this._setData(p.compressedTexture),u?.(e-this.usedMemory)}}catch(e){(0,c.zf)(e)||M().error("Texture compression failed!")}finally{l?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null)}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:s,target:a}=this._descriptor;const c=32879===a;if(null==r||null==n||c&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),s&&(1!==r||1!==n||c&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),c&&(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,l.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:()=>l,rA:()=>u});var i=r(58083),n=r(9093),o=r(38954),s=r(51850),a=r(40710),c=(r(33079),r(31821));function l(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(c.H`void discardBySlice(vec3 pos) { }
|
|
730
|
+
vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,new a.W("slicePlaneOrigin",(e,r)=>g(t,e,r)),new a.W("slicePlaneBasis1",(e,r)=>v(t,e,r,r.slicePlane?.basis1)),new a.W("slicePlaneBasis2",(e,r)=>v(t,e,r,r.slicePlane?.basis2)))}function u(e,t){h(e,t,new a.W("slicePlaneOrigin",(e,r)=>g(t,e,r)),new a.W("slicePlaneBasis1",(e,r)=>v(t,e,r,r.slicePlane?.basis1)),new a.W("slicePlaneBasis2",(e,r)=>v(t,e,r,r.slicePlane?.basis2)))}r(65786).Y;const d=c.H`struct SliceFactors {
|
|
731
731
|
float front;
|
|
732
732
|
float side0;
|
|
733
733
|
float side1;
|
|
@@ -765,13 +765,13 @@ return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
|
|
|
765
765
|
}
|
|
766
766
|
bool rejectBySlice(vec3 pos) {
|
|
767
767
|
return sliceByPlane(pos);
|
|
768
|
-
}`;function h(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(d)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function m(e,t,r){return e.instancedDoublePrecision?(0,o.i)(_,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function p(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)(w,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function g(e,t,r){if(null==r.slicePlane)return s.uY;const i=m(e,t,r),n=p(i,r.slicePlane),a=f(e,i,r);return null!=a?(0,o.t)(x,n,a):n}function v(e,t,r,i){if(null==i||null==r.slicePlane)return s.uY;const n=m(e,t,r),a=p(n,r.slicePlane),
|
|
768
|
+
}`;function h(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(d)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function m(e,t,r){return e.instancedDoublePrecision?(0,o.i)(_,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function p(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)(w,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function g(e,t,r){if(null==r.slicePlane)return s.uY;const i=m(e,t,r),n=p(i,r.slicePlane),a=f(e,i,r);return null!=a?(0,o.t)(x,n,a):n}function v(e,t,r,i){if(null==i||null==r.slicePlane)return s.uY;const n=m(e,t,r),a=p(n,r.slicePlane),c=f(e,n,r);return null!=c?((0,o.f)(b,i,a),(0,o.t)(x,a,c),(0,o.t)(b,b,c),(0,o.d)(b,b,x)):i}const _=(0,s.vt)(),x=(0,s.vt)(),b=(0,s.vt)(),w=(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) {
|
|
769
769
|
vec4 eye = view * vec4(pos, 1.0);
|
|
770
770
|
depth = calculateLinearDepth(nearFar,eye.z);
|
|
771
771
|
return proj * eye;
|
|
772
772
|
}`),e.vertex.code.add(n.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
|
|
773
773
|
return proj * (view * vec4(pos, 1.0));
|
|
774
|
-
}`)}},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,{MD:()=>
|
|
774
|
+
}`)}},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,{MD:()=>c,cJ:()=>a,hs:()=>l,m0:()=>s});var i=r(34727),n=(r(17352),r(97937));function o(e,t,r){const i=r.parameters;return u.scale=Math.min(i.divisor/(t-i.offset),1),u.factor=function(e){return Math.abs(e*e*e)}(e),u}function s(e,t){return(0,i.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}function a(e,t,r,i){i.scale=function(e,t,r){const i=o(e,t,r);return i.minScaleFactor=0,s(1,i)}(e,t,r),i.factor=0,i.minScaleFactor=r.minScaleFactor}function c(e,t,r=[0,0]){const i=Math.min(Math.max(t.scale,t.minScaleFactor),1);return r[0]=e[0]*i,r[1]=e[1]*i,r}function l(e,t,r,i){return s(e,o(t,r,i))}(0,i.kU)(10),(0,i.kU)(12),(0,i.kU)(70),(0,i.kU)(40);const u={scale:0,factor:0,minScaleFactor:0};(0,n.c)()},77695:(e,t,r)=>{r.d(t,{W:()=>d});var i=r(29242),n=r(48163),o=r(99208),s=r(47286),a=r(31821),c=r(35644),l=r(15976),u=r(63761);function d(e,t){const r=e.fragment,{hasVertexTangents:d,doubleSidedMode:h,hasNormalTexture:m,textureCoordinateType:p,bindType:f,hasNormalTextureTransform:g}=t;d?(e.attributes.add("tangent","vec4"),e.varyings.add("vTangent","vec4"),2===h?r.code.add(a.H`mat3 computeTangentSpace(vec3 normal) {
|
|
775
775
|
float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
|
|
776
776
|
vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
|
|
777
777
|
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
|
|
@@ -792,18 +792,18 @@ T = T - normal * dot(normal, T);
|
|
|
792
792
|
T *= inversesqrt(max(dot(T,T), 1.e-10));
|
|
793
793
|
vec3 B = sign(det) * cross(normal, T);
|
|
794
794
|
return mat3(T, B, normal);
|
|
795
|
-
}`),m&&0!==p&&(e.include(o.r,t),r.uniforms.add(1===f?new u.N("normalTexture",e=>e.textureNormal):new
|
|
795
|
+
}`),m&&0!==p&&(e.include(o.r,t),r.uniforms.add(1===f?new u.N("normalTexture",e=>e.textureNormal):new l.o("normalTexture",e=>e.textureNormal)),g&&(r.uniforms.add(new s.G("scale",e=>e.scale??n.Un)),r.uniforms.add(new c.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK))),r.code.add(a.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
|
|
796
796
|
vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),g&&r.code.add(a.H`mat3 normalRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0,
|
|
797
797
|
normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
|
|
798
798
|
0.0, 0.0, 0.0 );
|
|
799
799
|
rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(a.H`return tangentSpace * rawNormal;
|
|
800
|
-
}`))}},78662:(e,t,r)=>{r.d(t,{Gd:()=>
|
|
800
|
+
}`))}},78662:(e,t,r)=>{r.d(t,{Gd:()=>c,VC:()=>l}),r(44208);var i=r(34727),n=(r(77690),r(29242),r(58083),r(9093)),o=r(38954),s=r(51850),a=(r(87317),r(91829),r(31756),r(26857),r(16943),r(65786));class c extends a.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 l(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,s.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`
|
|
801
801
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
802
802
|
${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
|
|
803
|
-
`)}},82919:(e,t,r)=>{r.d(t,{DV:()=>v,C:()=>f,vt:()=>m,Qy:()=>p,ui:()=>g,ST:()=>b,bU:()=>w,pw:()=>x,m7:()=>_,c8:()=>M});var i=r(4341),n=r(58083),o=r(38954),s=r(51850),a=r(87317),
|
|
803
|
+
`)}},82919:(e,t,r)=>{r.d(t,{DV:()=>v,C:()=>f,vt:()=>m,Qy:()=>p,ui:()=>g,ST:()=>b,bU:()=>w,pw:()=>x,m7:()=>_,c8:()=>M});var i=r(4341),n=r(58083),o=r(38954),s=r(51850),a=r(87317),c=r(91829),l=r(71351);function u(e){return e?{ray:(0,l.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,l.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>u());var d=r(27921),h=r(32114);function m(e){return e?[(0,d.vt)(e[0]),(0,d.vt)(e[1]),(0,d.vt)(e[2]),(0,d.vt)(e[3]),(0,d.vt)(e[4]),(0,d.vt)(e[5])]:[(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)()]}function p(){return[(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)()]}function f(e,t){for(let r=0;r<T;r++)(0,d.C)(e[r],t[r]);return e}function g(e,t,r,i=A){const s=(0,n.lw)(h.Rc.get(),t,e);(0,n.B8)(s,s);for(let e=0;e<C;++e){const t=(0,a.t)(h.Km.get(),S[e],s);(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,d.Cr)(t[4],t[0],t[3],e[0]),(0,d.Cr)(t[1],t[5],t[6],e[1]),(0,d.Cr)(t[4],t[5],t[1],e[2]),(0,d.Cr)(t[3],t[2],t[6],e[3]),(0,d.Cr)(t[0],t[1],t[2],e[4]),(0,d.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 y(e,function(e,t=u()){return(0,l.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,E.get()))}function b(e,t,r){return y(e,function(e,t,r=u()){const i=(0,o.l)(e.vector);return(0,l.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,E.get()))}function w(e,t){for(let r=0;r<T;r++)if((0,d.mN)(e[r],t)>0)return!1;return!0}function y(e,t){for(let r=0;r<T;r++)if(!(0,d.$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,c.fA)(-1,-1,-1,1),(0,c.fA)(1,-1,-1,1),(0,c.fA)(1,1,-1,1),(0,c.fA)(-1,1,-1,1),(0,c.fA)(-1,-1,1,1),(0,c.fA)(1,-1,1,1),(0,c.fA)(1,1,1,1),(0,c.fA)(-1,1,1,1)],E=new i.I(u),A=p()},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),s=r(97146),a=r(57917),c=r(29920),l=r(51850),u=r(4341),d=r(11964);function h(e,t,r){return(0,o.d)(m,t,e),(0,o.d)(p,r,e),.5*(0,o.l)((0,o.h)(m,m,p))}r(32114),new u.I(d.vt),new u.I(()=>function(e){return e?{p0:(0,l.o8)(e.p0),p1:(0,l.o8)(e.p1),p2:(0,l.o8)(e.p2)}:{p0:(0,l.vt)(),p1:(0,l.vt)(),p2:(0,l.vt)()}}());const m=(0,l.vt)(),p=(0,l.vt)(),f=(0,l.vt)(),g=(0,l.vt)(),v=(0,l.vt)(),_=(0,l.vt)();class x{constructor(){this.uid=(0,i.c)()}}class b extends x{constructor(e){super(),this.highlightName=e,this.channel=0}}var w=r(620),y=r(94656);class M{constructor(e,t,r=null,n=0,o=null,a=-1){this.material=e,this.mapPositions=r,this.type=n,this.olidColor=o,this.edgeIndicesLength=a,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,s.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,a.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,y.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 s=0,a=0;for(let e=0;e<n.length-2;e+=3){const c=n[e]*r,l=n[e+1]*r,u=n[e+2]*r;(0,o.i)(f,i[c],i[c+1],i[c+2]),(0,o.i)(g,i[l],i[l+1],i[l+2]),(0,o.i)(v,i[u],i[u+1],i[u+2]);const d=h(f,g,v);d?((0,o.f)(f,f,g),(0,o.f)(f,f,v),(0,o.g)(f,f,1/3*d),(0,o.f)(t,t,f),s+=d):((0,o.f)(_,_,f),(0,o.f)(_,_,g),(0,o.f)(_,_,v),a+=3)}return!(0===a&&0===s||(0!==s?((0,o.g)(t,t,1/s),0):0===a||((0,o.g)(t,_,1/a),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:s,data:a,indices:c}=e,l=c.length-1,u=l+(t?2:0);for(let e=0;e<u;e+=2){const t=e<l?e+1:0,u=c[e<l?e:l]*s,d=c[t]*s;f[0]=a[u],f[1]=a[u+1],f[2]=a[u+2],g[0]=a[d],g[1]=a[d+1],g[2]=a[d+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 s=-1,a=0;for(let e=0;e<n.length;e++){const o=n[e]*r;s!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],a++),s=o}return a>1&&(0,o.g)(t,t,1/a),a>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,w.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,s.tM)(e.indices.length/t);return new c.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 b(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),s=r(87317),a=r(91829),c=r(23205),l=r(14314),u=r(31821);function d(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.d("lightingAmbientSH0",({lighting:e})=>(0,n.i)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
804
804
|
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
805
805
|
return ambientLight * (1.0 - ambientOcclusion);
|
|
806
|
-
}`)):1===i?(r.uniforms.add(new
|
|
806
|
+
}`)):1===i?(r.uniforms.add(new l.I("lightingAmbientSH_R",({lighting:e})=>(0,s.s)(m,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3])),new l.I("lightingAmbientSH_G",({lighting:e})=>(0,s.s)(m,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3])),new l.I("lightingAmbientSH_B",({lighting:e})=>(0,s.s)(m,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3]))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
807
807
|
vec4 sh0 = vec4(
|
|
808
808
|
0.282095,
|
|
809
809
|
0.488603 * normal.x,
|
|
@@ -816,7 +816,7 @@ dot(lightingAmbientSH_G, sh0),
|
|
|
816
816
|
dot(lightingAmbientSH_B, sh0)
|
|
817
817
|
);
|
|
818
818
|
return ambientLight * (1.0 - ambientOcclusion);
|
|
819
|
-
}`)):2===i&&(r.uniforms.add(new
|
|
819
|
+
}`)):2===i&&(r.uniforms.add(new c.d("lightingAmbientSH0",({lighting:e})=>(0,n.i)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0])),new l.I("lightingAmbientSH_R1",({lighting:e})=>(0,s.s)(m,e.sh.r[1],e.sh.r[2],e.sh.r[3],e.sh.r[4])),new l.I("lightingAmbientSH_G1",({lighting:e})=>(0,s.s)(m,e.sh.g[1],e.sh.g[2],e.sh.g[3],e.sh.g[4])),new l.I("lightingAmbientSH_B1",({lighting:e})=>(0,s.s)(m,e.sh.b[1],e.sh.b[2],e.sh.b[3],e.sh.b[4])),new l.I("lightingAmbientSH_R2",({lighting:e})=>(0,s.s)(m,e.sh.r[5],e.sh.r[6],e.sh.r[7],e.sh.r[8])),new l.I("lightingAmbientSH_G2",({lighting:e})=>(0,s.s)(m,e.sh.g[5],e.sh.g[6],e.sh.g[7],e.sh.g[8])),new l.I("lightingAmbientSH_B2",({lighting:e})=>(0,s.s)(m,e.sh.b[5],e.sh.b[6],e.sh.b[7],e.sh.b[8]))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
820
820
|
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
821
821
|
vec4 sh1 = vec4(
|
|
822
822
|
0.488603 * normal.x,
|
|
@@ -943,10 +943,10 @@ vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceC
|
|
|
943
943
|
vec3 outColorLinear = outDiffColor + specularComponent;
|
|
944
944
|
vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
|
|
945
945
|
return outColor;
|
|
946
|
-
}`)}}(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,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}r.d(t,{Ey:()=>w,RC:()=>o,T8:()=>s,Uy:()=>u,Xt:()=>
|
|
946
|
+
}`)}}(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,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}r.d(t,{Ey:()=>w,RC:()=>o,T8:()=>s,Uy:()=>u,Xt:()=>l,kn:()=>d,p3:()=>n}),i(0,771),i(1,0),i(1,1);const o=i(1,771),s=n(770,1,771,771),a={face:1029,mode:2305},c={face:1028,mode:2305},l=e=>2===e?a:1===e?c:null,u={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function h(e){return T.intern(e)}function m(e){return S.intern(e)}function p(e){return A.intern(e)}function f(e){return R.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 b(e){return G.intern(e)}function w(e){return V.intern(e)}class y{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 y(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 y(E,e=>({__tag:"Culling",...e}));function E(e){return e?M([e.face,e.mode]):null}const A=new y(I,e=>({__tag:"PolygonOffset",...e}));function I(e){return e?M([e.factor,e.units]):null}const R=new y(F,e=>({__tag:"DepthTest",...e}));function F(e){return e?M([e.func]):null}const O=new y(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 y(N,e=>({__tag:"DepthWrite",...e}));function N(e){return e?M([e.zNear,e.zFar]):null}const H=new y(L,e=>({__tag:"ColorWrite",...e}));function L(e){return e?M([e.r,e.g,e.b,e.a]):null}const z=new y(B,e=>({__tag:"StencilWrite",...e}));function B(e){return e?M([e.mask]):null}const G=new y(U,e=>({__tag:"DrawBuffers",...e}));function U(e){return e?M(e.buffers):null}const V=new y(function(e){return e?M([C(e.blending),E(e.culling),I(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:m(e.culling),polygonOffset:p(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:x(e.stencilWrite),drawBuffers:b(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`
|
|
947
947
|
void forwardNormalizedVertexColor() { vColor = color * ${i.H.float(1/255)}; }
|
|
948
948
|
`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
|
|
949
|
-
void forwardNormalizedVertexColor() {}`)}},94656:(e,t,r)=>{r.d(t,{Y2:()=>
|
|
949
|
+
void forwardNormalizedVertexColor() {}`)}},94656:(e,t,r)=>{r.d(t,{Y2:()=>l,en:()=>c});var i=r(49186),n=r(44208),o=r(53966);const s=()=>o.A.getLogger("esri.views.webgl.checkWebGLError"),a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function l(e,t=c()){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;s().error(new i.A("webgl-error","WebGL error occurred",{message:t,stack:e}))}}}},95774:(e,t,r)=>{r.d(t,{S:()=>m,b:()=>h});var i=r(82048),n=r(52540),o=r(68259),s=r(20304),a=r(31821),c=r(15976),l=r(63761),u=r(14113);const d=4;function h(){const e=new u.N5,t=e.fragment;e.include(i.c);const r=(d+1)/2,h=1/(2*r*r);return t.include(n.E),t.uniforms.add(new l.N("depthMap",e=>e.depthTexture),new c.o("tex",e=>e.colorTexture),new o.t("blurSize",e=>e.blurSize),new s.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(a.H`
|
|
950
950
|
void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
|
|
951
951
|
float c = texture(tex, uv).r;
|
|
952
952
|
float d = linearDepthFromTexture(depthMap, uv);
|
|
@@ -979,15 +979,15 @@ return decompressNormal(normalCompressed);
|
|
|
979
979
|
return normal;
|
|
980
980
|
}`);break;case 2:e.fragment.code.add(n.H`vec3 screenDerivativeNormal(vec3 positionView) {
|
|
981
981
|
return normalize(cross(dFdx(positionView), dFdy(positionView)));
|
|
982
|
-
}`);break;default:(0,i.Xb)(t.normalType);case 3:}}},96598:(e,t,r)=>{r.d(t,{Z:()=>s});var i=r(52540),n=r(31821),o=r(12791);function s(e,{occlusionPass:t,terrainDepthTest:r,cullAboveTerrain:s}){const{vertex:a,fragment:
|
|
982
|
+
}`);break;default:(0,i.Xb)(t.normalType);case 3:}}},96598:(e,t,r)=>{r.d(t,{Z:()=>s});var i=r(52540),n=r(31821),o=r(12791);function s(e,{occlusionPass:t,terrainDepthTest:r,cullAboveTerrain:s}){const{vertex:a,fragment:c,varyings:l}=e;if(!r)return a.code.add("void forwardViewPosDepth(vec3 pos) {}"),void c.code.add(`${t?"bool":"void"} discardByTerrainDepth() { ${(0,n.If)(t,"return false;")}}`);l.add("viewPosDepth","float",{invariant:!0}),a.code.add("void forwardViewPosDepth(vec3 pos) {\n viewPosDepth = pos.z;\n }"),c.include(i.E),c.uniforms.add(new o.x("terrainDepthTexture",e=>e.terrainDepth?.attachment)).code.add(n.H`
|
|
983
983
|
${t?"bool":"void"} discardByTerrainDepth() {
|
|
984
984
|
float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r;
|
|
985
985
|
float linearDepth = linearizeDepth(depth);
|
|
986
986
|
${t?"return viewPosDepth < linearDepth && depth < 1.0;":`if(viewPosDepth ${s?">":"<="} linearDepth) discard;`}
|
|
987
|
-
}`)}},97146:(e,t,r)=>{r.d(t,{Dg:()=>o,my:()=>s,tM:()=>u,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<i.y9)return e}else if(e.length<i.y9)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r=r&&0===e,n=n&&e===t,!r&&!n)),r?function(e){if(1===e)return
|
|
987
|
+
}`)}},97146:(e,t,r)=>{r.d(t,{Dg:()=>o,my:()=>s,tM:()=>u,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<i.y9)return e}else if(e.length<i.y9)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r=r&&0===e,n=n&&e===t,!r&&!n)),r?function(e){if(1===e)return c;if(e<i.y9)return new Array(e).fill(0);if(e>h.length){const t=Math.max(2*h.length,e);h=new Uint8Array(t)}return new Uint8Array(h.buffer,0,e)}(e.length):n?u(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function s(e){return e<=i.y9?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let a=d(131072);const c=[0],l=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function u(e){return 1===e?c:e<i.y9?Array.from(new Uint16Array(l.buffer,0,e)):e<l.length?new Uint16Array(l.buffer,0,e):(e>a.length&&(a=d(Math.max(2*a.length,e))),new Uint32Array(a.buffer,0,e))}function d(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let h=new Uint8Array(65536)},97220:(e,t,r)=>{r.d(t,{$:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98353:(e,t,r)=>{r.d(t,{h:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"mat3",2,(i,n,o)=>i.setUniformMatrix3fv(e,t(n,o),r))}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>o,O4:()=>s,Vt:()=>a});var i=r(23205),n=r(31821);function o(e){e.uniforms.add(new i.d("mainLightDirection",e=>e.lighting.mainLight.direction))}function s(e){e.uniforms.add(new i.d("mainLightIntensity",e=>e.lighting.mainLight.intensity))}function a(e){o(e.fragment),s(e.fragment),e.fragment.code.add(n.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
|
|
988
988
|
float dotVal = clamp(dot(shadingNormal, mainLightDirection), 0.0, 1.0);
|
|
989
989
|
return mainLightIntensity * ((1.0 - shadow) * dotVal);
|
|
990
|
-
}`)}},98958:(e,t,r)=>{r.d(t,{w:()=>u,L:()=>d});var i=r(53966),n=r(97768),o=r(49255),s=(r(44208),r(94656));class a{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,s.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||console.error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.acquire(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t,r){this._glProgram.setUniform1f(e,t,r)}setUniform2fv(e,t,r){this._glProgram.setUniform2fv(e,t,r)}setUniform3fv(e,t,r){this._glProgram.setUniform3fv(e,t,r)}setUniform4fv(e,t,r){this._glProgram.setUniform4fv(e,t,r)}setUniformMatrix3fv(e,t,r){this._glProgram.setUniformMatrix3fv(e,t,!1,r)}setUniformMatrix4fv(e,t,r){this._glProgram.setUniformMatrix4fv(e,t,!1,r)}setUniform1fv(e,t,r){this._glProgram.setUniform1fv(e,t,r)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e,t){let r=e.locations;if(t){const e=new Map(r);t.forEach((t,i)=>e.set(i,r.size+t)),r=e}r.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${r}, ${this.locations}`),this.locations.forEach((e,t)=>{r.get(t)!==e&&console.error(`VertexAttributeLocations are incompatible: Program has ${t} at position ${e}, VAO has it at position ${r.get(t)}.`)})}stop(){this._textures.clear()}bindTexture(e,t){t?.glName||((0,s.en)()&&console.error(`Texture sampler ${e} has no given Texture in ${(new Error).stack} `),t=this._context.emptyTexture);const r=this._ensureTextureUnit(e,t);this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var
|
|
990
|
+
}`)}},98958:(e,t,r)=>{r.d(t,{w:()=>u,L:()=>d});var i=r(53966),n=r(97768),o=r(49255),s=(r(44208),r(94656));class a{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,s.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||console.error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.acquire(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t,r){this._glProgram.setUniform1f(e,t,r)}setUniform2fv(e,t,r){this._glProgram.setUniform2fv(e,t,r)}setUniform3fv(e,t,r){this._glProgram.setUniform3fv(e,t,r)}setUniform4fv(e,t,r){this._glProgram.setUniform4fv(e,t,r)}setUniformMatrix3fv(e,t,r){this._glProgram.setUniformMatrix3fv(e,t,!1,r)}setUniformMatrix4fv(e,t,r){this._glProgram.setUniformMatrix4fv(e,t,!1,r)}setUniformMatrices4fv(e,t,r){this._glProgram.setUniformMatrices4fv(e,t,!1,r)}setUniform1fv(e,t,r){this._glProgram.setUniform1fv(e,t,r)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e,t){let r=e.locations;if(t){const e=new Map(r);t.forEach((t,i)=>e.set(i,r.size+t)),r=e}r.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${r}, ${this.locations}`),this.locations.forEach((e,t)=>{r.get(t)!==e&&console.error(`VertexAttributeLocations are incompatible: Program has ${t} at position ${e}, VAO has it at position ${r.get(t)}.`)})}stop(){this._textures.clear()}bindTexture(e,t){t?.glName||((0,s.en)()&&console.error(`Texture sampler ${e} has no given Texture in ${(new Error).stack} `),t=this._context.emptyTexture);const r=this._ensureTextureUnit(e,t);this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var c=r(63907),l=r(90644);class u{constructor(e,t,r,o){this.primitiveType=c.WR.TRIANGLES,this.key=t.key,this._program=new a(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t),this.reload=async s=>{s&&await r.reload(),this.key.equals(t.key)||i.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn("Configuration was changed after construction, cannot reload shader.",r),(0,n.WD)(this._program),this._program=new a(e.rctx,r.get().build(t),o),this._pipeline=this.initializePipeline(t)}}destroy(){this._program=(0,n.WD)(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return(0,l.Ey)({blending:l.RC,colorWrite:l.kn})}}function d(e,t){return(0,o.Vg)(e)?{buffers:[0]}:t??null}},99208:(e,t,r)=>{r.d(t,{r:()=>s});var i=r(53466),n=r(31821);function o(e){e.fragment.code.add(n.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
|
|
991
991
|
vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
|
|
992
992
|
vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
|
|
993
993
|
float maxdUV = 0.125;
|