@arcgis/core 6.0.0-next.1 → 6.0.0-next.2
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/DimensionSimpleStyle.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01803f76bc0d9f2cd566.js +1 -0
- package/assets/esri/core/workers/chunks/{a7325ebb7edf3273bb34.js → 12b84262dedc6b393136.js} +1 -1
- package/assets/esri/core/workers/chunks/261fea092ee7d27608a0.js +1 -0
- package/assets/esri/core/workers/chunks/{8af92bcc075e03e3e902.js → 512628db534605a2a93e.js} +22 -22
- package/assets/esri/core/workers/chunks/5e4d6c283c2fa28db022.js +1 -0
- package/assets/esri/core/workers/chunks/64770e2cf41211b63fd2.js +1 -0
- package/assets/esri/core/workers/chunks/{ffb3728e6ac428f62af1.js → 71103472c45928bd730c.js} +1 -1
- package/assets/esri/core/workers/chunks/73a87fb270818aa75fc5.js +1 -0
- package/assets/esri/core/workers/chunks/7ef182e24cad50815b4e.js +1 -0
- package/assets/esri/core/workers/chunks/8313c626596a76c7449d.js +1 -0
- package/assets/esri/core/workers/chunks/84e9258a57d8c365f361.js +1 -0
- package/assets/esri/core/workers/chunks/{b0cfec11c758eed8095f.js → 87b4e916b2668203a6b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{aa1054834738aef48bda.js → a0356702f2d3f787aeac.js} +1 -1
- package/assets/esri/core/workers/chunks/ac4cc49104d26c384e98.js +1 -0
- package/assets/esri/core/workers/chunks/ec28e18275d36e71b438.js +1 -0
- package/assets/esri/core/workers/chunks/{050c4b212f2b5691db34.js → f762f70e7d39634ce797.js} +1 -1
- package/assets/esri/core/workers/chunks/{32d08b571bbd996d4e6d.js → fb4ff0ac2bc445fec413.js} +1 -1
- package/chunks/RibbonLine.glsl.js +9 -11
- package/config.js +1 -1
- package/core/screenUtils.js +1 -1
- package/kernel.js +1 -1
- package/package.json +2 -2
- package/smartMapping/renderers/support/spikeUtils.js +3 -3
- package/symbols/LineSymbol3DLayer.js +1 -1
- package/symbols/callouts/LineCallout3D.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/edges/Edges3D.js +1 -1
- package/symbols/support/Symbol3DIconOutline.js +1 -1
- package/symbols/support/Symbol3DOutline.js +1 -1
- package/symbols/support/Symbol3DTextBorder.js +1 -1
- package/symbols/support/defaults3D.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +2 -0
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +2 -0
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +23 -9
- package/views/draw/support/PluginContext.js +1 -1
- package/views/draw/support/managers/TooltipManager.js +1 -1
- package/views/interactive/snapping/SnappingVisualizer.js +1 -1
- package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.d.ts +9 -2
- package/assets/esri/core/workers/chunks/084222c00d263a534952.js +0 -1
- package/assets/esri/core/workers/chunks/37a636f61cfe89c6bfd1.js +0 -1
- package/assets/esri/core/workers/chunks/4848f195eb93cc93dd15.js +0 -1
- package/assets/esri/core/workers/chunks/750a9f3cdb96b966274a.js +0 -1
- package/assets/esri/core/workers/chunks/897fc8e78a0d54a5ff5a.js +0 -1
- package/assets/esri/core/workers/chunks/9432feca48ca3e5849bd.js +0 -1
- package/assets/esri/core/workers/chunks/956a40f40bde416efe93.js +0 -1
- package/assets/esri/core/workers/chunks/985b3f18cee87c3fe022.js +0 -1
- package/assets/esri/core/workers/chunks/ca7fb75e2c62e7d37122.js +0 -1
- package/assets/esri/core/workers/chunks/e7c60bd85abbd36cdc64.js +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3354,4426],{28491(e,t,r){r.d(t,{b:()=>A});var i=r(32680),o=r(49255),a=r(34711),n=r(71020),s=r(72722),l=r(96336),c=r(53466),u=r(72824),d=r(54154),h=r(9169),m=r(12696),f=r(77695),p=r(72233),g=r(18e3),v=r(98619),x=r(62602),_=r(20598),b=r(22393),y=r(59469),w=r(56529),S=r(51406),M=r(89435),T=r(58614),C=r(20693),D=r(33079),
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3354,4426],{28491(e,t,r){r.d(t,{b:()=>A});var i=r(32680),o=r(49255),a=r(34711),n=r(71020),s=r(72722),l=r(96336),c=r(53466),u=r(72824),d=r(54154),h=r(9169),m=r(12696),f=r(77695),p=r(72233),g=r(18e3),v=r(98619),x=r(62602),_=r(20598),b=r(22393),y=r(59469),w=r(56529),S=r(51406),M=r(89435),T=r(58614),C=r(20693),D=r(33079),I=r(31821),P=r(63761),O=r(27832),E=r(47630),F=r(14113);function A(e){let t=new F.N5,{attributes:r,vertex:A,fragment:R,varyings:B}=t,{output:z,normalType:N,offsetBackfaces:j,snowCover:L,pbrMode:H,textureAlphaPremultiplied:W,instancedDoublePrecision:V,hasVertexColors:U,hasVertexTangents:G,hasColorTexture:k,hasNormalTexture:$,hasNormalTextureTransform:Z,hasColorTextureTransform:q}=e;if((0,C.NB)(A,e),r.add("position","vec3"),A.inputs.add("position",()=>"position"),B.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(s.B,e),t.include(d.Ge,e),t.include(S.q2,e),!(0,o._o)(z))return t.include(h.E,e),t;t.include(S.Sx,e),t.include(S.MU,e),t.include(S.O1,e),t.include(S.QM,e),(0,C.yu)(A,e),t.include(l.Y,e),t.include(n.d);let Y=0===N||1===N;return Y&&j&&t.include(i.M),t.include(f.J,e),t.include(u.Mh,e),B.add("vPositionLocal","vec3"),t.include(c.U,e),t.include(m.F,e),t.include(V?w.oD:w.rA,e),A.main.add(I.H`
|
|
2
2
|
forwardDefaultMaterialExternalColor();
|
|
3
3
|
|
|
4
4
|
vpos = getVertexInLocalOriginSpace();
|
|
5
5
|
vPositionLocal = vpos - view[3].xyz;
|
|
6
6
|
vpos = subtractOrigin(vpos);
|
|
7
|
-
${(0,
|
|
7
|
+
${(0,I.If)(Y,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
|
|
8
8
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
9
|
-
${(0,
|
|
9
|
+
${(0,I.If)(G,"vTangent = dpTransformVertexTangent(tangent);")}
|
|
10
10
|
gl_Position = transformPosition(proj, view, vpos);
|
|
11
|
-
${(0,
|
|
11
|
+
${(0,I.If)(Y&&j,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
|
|
12
12
|
|
|
13
13
|
forwardTextureCoordinates();
|
|
14
14
|
forwardColorUV();
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
22
22
|
}
|
|
23
23
|
forwardLinearDepthToReadShadow();
|
|
24
|
-
`),R.include(g.kA,e),R.include(p.n,e),t.include(T.SS,e),R.include(a.zM,e),t.include(E.D,e),(0,C.yu)(R,e),R.uniforms.add(A.uniforms.get("localOrigin"),new D.t("ambient",e=>e.ambient),new D.t("diffuse",e=>e.diffuse)),k&&R.uniforms.add(new
|
|
24
|
+
`),R.include(g.kA,e),R.include(p.n,e),t.include(T.SS,e),R.include(a.zM,e),t.include(E.D,e),(0,C.yu)(R,e),R.uniforms.add(A.uniforms.get("localOrigin"),new D.t("ambient",e=>e.ambient),new D.t("diffuse",e=>e.diffuse)),k&&R.uniforms.add(new P.N("tex",e=>e.texture)),t.include(y._Z,e),R.include(b.c,e),t.include(x.r,e),R.include(O.b,e),R.include(_.n,e),(0,g.a8)(R),R.uniforms.add(g.VW),R.uniforms.add(v.VK).main.add(I.H`
|
|
25
25
|
discardBySlice(vpos);
|
|
26
|
-
${k?
|
|
26
|
+
${k?I.H`
|
|
27
27
|
vec4 texColor = texture(tex, ${q?"colorUV":"vuv0"});
|
|
28
|
-
${(0,
|
|
28
|
+
${(0,I.If)(W,"texColor.rgb /= texColor.a;")}
|
|
29
29
|
discardOrAdjustAlpha(texColor);`:"vec4 texColor = vec4(1.0);"}
|
|
30
30
|
vec3 viewDirection = normalize(vpos - cameraPosition);
|
|
31
31
|
vec3 posWorld = vpos + localOrigin;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
vec3 matColor = max(ambient, diffuse);
|
|
41
41
|
vec3 albedo = mixExternalColor(
|
|
42
|
-
${(0,
|
|
42
|
+
${(0,I.If)(U,"vColor.rgb *")} matColor,
|
|
43
43
|
texColor.rgb,
|
|
44
44
|
vExternalColor.rgb,
|
|
45
45
|
colorMixMode
|
|
@@ -48,18 +48,18 @@
|
|
|
48
48
|
|
|
49
49
|
${$?`mat3 tangentSpace = computeTangentSpace(${G?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${Z?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
|
|
50
50
|
|
|
51
|
-
${(0,
|
|
51
|
+
${(0,I.If)(L,I.H`
|
|
52
52
|
float snow = getSnow(normal, upNormal);
|
|
53
53
|
albedo = mix(albedo, vec3(1), snow);
|
|
54
54
|
shadingNormal = mix(shadingNormal, normal, snow);
|
|
55
55
|
ssao = mix(ssao, 1.0, snow);`)}
|
|
56
56
|
|
|
57
57
|
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
58
|
-
${(0,
|
|
58
|
+
${(0,I.If)((1===H||2===H)&&L,"applySnowToMRR(snow);")}
|
|
59
59
|
|
|
60
60
|
vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, upNormal);
|
|
61
61
|
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
62
|
-
outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,
|
|
62
|
+
outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,I.If)(L,", snow")});
|
|
63
63
|
`),t}const R=Object.freeze(Object.defineProperty({__proto__:null,build:A},Symbol.toStringTag,{value:"Module"}));r.d(t,["D",0,R])},587(e,t,r){r.d(t,{G:()=>y,c:()=>w});var i=r(82048),o=r(92573),a=r(65261),n=r(98619),s=r(70893),l=r(34845),c=r(45324),u=r(33094),d=r(20304),h=r(31821),m=r(58029),f=r(12791),p=r(63761),g=r(94046),v=(r(72458),r(18519)),x=r(63907),_=r(65786),b=r(14113);class y extends _.Y{constructor(){super(...arguments),this.projScale=1,this.resolutionScale=1,this.accumulatedFrames=0,this.temporalSampleFrame=0,this.glowBoost=0,this.rayMarchMinReach=.15,this.rayMarchMaxReach=.5,this.rayMarchWorldReach=25,this.rayMarchMinReachEmissionWeight=1,this.rayMarchMaxReachEmissionWeight=1,this.rayMarchMaxSteps=16,this.colorBleedWeight=0,this.highQualityIdleColorBlendStart=.3,this.emissionBoostFactor=2.5,this.factorDaylightDirectional=.8}}function w(e){let t=new b.N5,r=t.fragment;t.include(i.c),t.include(l.Ir),r.include(o.V),r.include(a.C),r.include(g.R),r.include(v.b),t.include(s.O,e),r.uniforms.add(n.t_,c.Xl,new p.N("normalMap",e=>e.normalTexture),new p.N("depthMap",e=>e.depthTexture),new p.N("lastFrameGlobalIlluminationTexture",(e,t)=>e.globalIllumination??t.globalIllumination?.getTexture()),new p.N("lastFrameGlobalIlluminationWeightTexture",(e,t)=>e.globalIlluminationWeights??t.globalIllumination?.getTexture(36065)),new f.x("lastFrameColorTexture",e=>e.reprojection.lastFrameColor?.getTexture()),new f.x("lastFrameDepthTexture",e=>e.reprojection.lastFrameDepth?.attachment),new m.F("reprojectionProjectionMatrix",e=>e.reprojection.lastFrameCamera.projectionMatrix),new m.F("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new d.m("accumulatedFrames",e=>e.accumulatedFrames),new d.m("temporalSampleFrame",e=>e.temporalSampleFrame),new d.m("resolutionScale",e=>e.resolutionScale)),r.uniforms.add(new d.m("rayMarchMinReach",e=>e.rayMarchMinReach),new d.m("rayMarchMaxReach",e=>e.rayMarchMaxReach),new d.m("rayMarchWorldReach",e=>e.rayMarchWorldReach),new d.m("rayMarchMinReachEmissionWeight",e=>e.rayMarchMinReachEmissionWeight),new d.m("rayMarchMaxReachEmissionWeight",e=>e.rayMarchMaxReachEmissionWeight),new d.m("rayMarchMaxSteps",e=>e.rayMarchMaxSteps),new d.m("colorBleedWeight",e=>e.colorBleedWeight),new d.m("highQualityIdleColorBlendStart",e=>e.highQualityIdleColorBlendStart),new d.m("emissionBoostFactor",e=>e.emissionBoostFactor+e.glowBoost),new d.m("factorDaylightDirectional",e=>e.factorDaylightDirectional));let{hasEmission:_,hasColor:y}=e;return _&&(r.uniforms.add(new u.U("inputScale",e=>e.reprojection.lastFrameEmission?.getTexture()?.descriptor.internalFormat===x.H0.RGBA8?16:1),new f.x("lastFrameEmissionTexture",e=>e.reprojection.lastFrameEmission?.getTexture())),r.code.add(h.H`bool hasHitReprojectionMismatch(vec3 hit, vec2 hitReprojectedCoordinate, float colorBlendWeight) {
|
|
64
64
|
if (colorBlendWeight != 1.0) {
|
|
65
65
|
return false;
|
|
@@ -486,7 +486,7 @@ return value * 2.0 - 1.0;
|
|
|
486
486
|
) / jointBilateralWeightSum;
|
|
487
487
|
}
|
|
488
488
|
`),e.outputs.add("fragColor","vec4",0),e.outputs.add("fragWeight","vec2",1),t.main.add(l.H`sampleJointBilateralUpscale(uv, fragColor, fragWeight);
|
|
489
|
-
fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const g=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationUpscaleDrawParameters:f,build:p},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,g])},57323(e,t,r){r.d(t,{b:()=>O});var i=r(32680),o=r(49255),a=r(34711),n=r(71020),s=r(72722),l=r(96336),c=r(53466),u=r(54154),d=r(9169),h=r(12696),m=r(72233),f=r(18e3),p=r(98619),g=r(20598),v=r(22393),x=r(59469),_=r(56529),b=r(51406),y=r(89435),w=r(58614),S=r(20693),M=r(33079),T=r(31821),C=r(63761),D=r(27832),
|
|
489
|
+
fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const g=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationUpscaleDrawParameters:f,build:p},Symbol.toStringTag,{value:"Module"}));r.d(t,["a",0,g])},57323(e,t,r){r.d(t,{b:()=>O});var i=r(32680),o=r(49255),a=r(34711),n=r(71020),s=r(72722),l=r(96336),c=r(53466),u=r(54154),d=r(9169),h=r(12696),m=r(72233),f=r(18e3),p=r(98619),g=r(20598),v=r(22393),x=r(59469),_=r(56529),b=r(51406),y=r(89435),w=r(58614),S=r(20693),M=r(33079),T=r(31821),C=r(63761),D=r(27832),I=r(47630),P=r(14113);function O(e){let t=new P.N5,{attributes:r,vertex:O,fragment:E,varyings:F}=t,{output:A,offsetBackfaces:R,pbrMode:B,snowCover:z}=e,N=1===B||2===B;if((0,S.NB)(O,e),r.add("position","vec3"),O.inputs.add("position",()=>"position"),F.add("vpos","vec3",{invariant:!0}),t.include(y.A,e),t.include(s.B,e),t.include(u.Ge,e),t.include(b.q2,e),!(0,o._o)(A))return t.include(d.E,e),t;t.include(b.MU,e),(0,S.yu)(t.vertex,e),t.include(l.Y,e),t.include(n.d),R&&t.include(i.M),F.add("vNormalWorld","vec3"),F.add("localvpos","vec3",{invariant:!0}),t.include(c.U,e),t.include(h.F,e),t.include(e.instancedDoublePrecision?_.oD:_.rA,e),O.main.add(T.H`
|
|
490
490
|
forwardDefaultMaterialExternalColor();
|
|
491
491
|
|
|
492
492
|
vpos = getVertexInLocalOriginSpace();
|
|
@@ -504,7 +504,7 @@ fragColor.rgb = quantizeGlobalIlluminationColor(fragColor.rgb);`),e}const g=Obje
|
|
|
504
504
|
|
|
505
505
|
gl_Position = shouldCullByOpacity() ? vec4(1e38, 1e38, 1e38, 1.0) :
|
|
506
506
|
${(0,T.If)(R,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
|
|
507
|
-
`);let{hasColorTexture:j,hasColorTextureTransform:L}=e;return E.include(f.kA,e),E.include(m.n,e),t.include(w.SS,e),E.include(a.zM,e),t.include(
|
|
507
|
+
`);let{hasColorTexture:j,hasColorTextureTransform:L}=e;return E.include(f.kA,e),E.include(m.n,e),t.include(w.SS,e),E.include(a.zM,e),t.include(I.D,e),(0,S.yu)(E,e),(0,f.a8)(E),E.uniforms.add(p.t_,f.VW,O.uniforms.get("localOrigin"),O.uniforms.get("view"),new M.t("ambient",e=>e.ambient),new M.t("diffuse",e=>e.diffuse)),j&&E.uniforms.add(new C.N("tex",e=>e.texture)),t.include(x._Z,e),E.include(v.c,e),E.include(D.b,e),E.include(g.n,e),E.uniforms.add(p.VK).main.add(T.H`
|
|
508
508
|
discardBySlice(vpos);
|
|
509
509
|
vec4 texColor = ${j?`texture(tex, ${L?"colorUV":"vuv0"})`:" vec4(1.0)"};
|
|
510
510
|
${(0,T.If)(j,`${(0,T.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
|
|
@@ -648,7 +648,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
648
648
|
vec2 uvOffset = uv + rf * blurSize;
|
|
649
649
|
blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
|
|
650
650
|
}
|
|
651
|
-
fragBlur = b / w_total;`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}));r.d(t,["S",0,h])},43609(e,t,r){r.d(t,{a:()=>a,f:()=>n,n:()=>o});var i=r(34275);function o(e,t){a(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r=2,o=r){let a=t.length/2,n=0,s=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<a;++i)e[n]=t[s],e[n+1]=t[s+1],n+=r,s+=o;return}let l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<a;++i)e[n]=Math.max(t[s]/l,-1),e[n+1]=Math.max(t[s+1]/l,-1),n+=r,s+=o;else for(let i=0;i<a;++i)e[n]=t[s]/l,e[n+1]=t[s+1]/l,n+=r,s+=o}function n(e,t,r,i){let o=e.typedBuffer,a=e.typedBufferStride,n=i?.count??e.count,s=(i?.dstIndex??0)*a;for(let e=0;e<n;++e)o[s]=t,o[s+1]=r,s+=a}Object.freeze(Object.defineProperty({__proto__:null,fill:n,normalizeIntegerBuffer:a,normalizeIntegerBufferView:o},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>d,b:()=>s,c:()=>o,d:()=>n,e:()=>h,f:()=>u,l:()=>c,n:()=>m,t:()=>a}),r(44208);var i=r(72727);function o(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,o=3,a=o){let n=(0,i.k)(e.length,o,3),s=(0,i.k)(t.length,a,3),l=Math.min(n,s),c=r[0],u=r[1],d=r[2],h=r[4],m=r[5],f=r[6],p=r[8],g=r[9],v=r[10],x=r[12],_=r[13],b=r[14],y=0,w=0;for(let r=0;r<l;r++){let r=t[y],i=t[y+1],n=t[y+2];e[w]=c*r+h*i+p*n+x,e[w+1]=u*r+m*i+g*n+_,e[w+2]=d*r+f*i+v*n+b,y+=a,w+=o}return e}function n(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,a=o){let n=(0,i.k)(e.length,o,3),s=(0,i.k)(t.length,a,3),l=Math.min(n,s),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],f=r[5],p=r[6],g=r[7],v=r[8],x=0,_=0;for(let r=0;r<l;r++){let r=t[x],i=t[x+1],n=t[x+2];e[_]=c*r+h*i+p*n,e[_+1]=u*r+m*i+g*n,e[_+2]=d*r+f*i+v*n,x+=a,_+=o}}function l(e,t,r,i=3,o=i){let a=Math.min(e.length/i,t.length/o),n=0,s=0;for(let l=0;l<a;l++)e[s]=r*t[n],e[s+1]=r*t[n+1],e[s+2]=r*t[n+2],n+=o,s+=i;return e}function c(e,t,r,i){u(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r,i,o=3,a=o){let n=Math.min(e.length/o,t.length/a),s=0,l=0,c=1/2.2;for(let u=0;u<n;u++)e[l]=i*(r*t[s])**c,e[l+1]=i*(r*t[s+1])**c,e[l+2]=i*(r*t[s+2])**c,s+=a,l+=o}function d(e,t,r,o=3,a=o){let n=(0,i.k)(e.length,o,3),s=(0,i.k)(t.length,a,3),l=Math.min(n,s),c=0,u=0;for(let i=0;i<l;i++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=a,u+=o;return e}function h(e,t){m(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function m(e,t,r=3,i=r){let o=Math.min(e.length/r,t.length/i),a=0,n=0;for(let s=0;s<o;s++){let o=t[a],s=t[a+1],l=t[a+2],c=o*o+s*s+l*l;if(c>0){let t=1/Math.sqrt(c);e[n]=t*o,e[n+1]=t*s,e[n+2]=t*l}a+=i,n+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:u,linearToSRGBView:c,normalize:m,normalizeView:h,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){let i=Math.min(e.count,t.count),o=e.typedBuffer,a=e.typedBufferStride,n=t.typedBuffer,s=t.typedBufferStride,l=0,c=0;for(let e=0;e<i;e++)o[c]=n[l]>>r,o[c+1]=n[l+1]>>r,o[c+2]=n[l+2]>>r,l+=s,c+=a},transformMat3:s,transformMat3View:n,transformMat4:a,transformMat4View:o,translate:d},Symbol.toStringTag,{value:"Module"}))},50867(e,t,r){r.d(t,{a:()=>o,b:()=>c,l:()=>l,n:()=>n,t:()=>a}),r(44208);var i=r(72727);function o(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,o=4,a=o){let n=(0,i.k)(e.length,o,4),s=(0,i.k)(t.length,a,4),l=Math.min(n,s),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],f=r[5],p=r[6],g=r[7],v=r[8],x=0,_=0;for(let r=0;r<l;r++){let r=t[x],i=t[x+1],n=t[x+2],s=t[x+3];e[_]=c*r+h*i+p*n,e[_+1]=u*r+m*i+g*n,e[_+2]=d*r+f*i+v*n,e[_+3]=s,x+=a,_+=o}}function n(e,t){let r=Math.min(e.count,t.count),i=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,n=t.typedBufferStride;for(let e=0;e<r;e++){let t=e*o,r=e*n,s=a[r],l=a[r+1],c=a[r+2],u=s*s+l*l+c*c;if(u>0){let e=1/Math.sqrt(u);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function s(e,t,r,i=4){let o=Math.min(e.length/i,t.count),a=t.typedBuffer,n=t.typedBufferStride,s=0,l=0;for(let t=0;t<o;t++)e[l]=r*a[s],e[l+1]=r*a[s+1],e[l+2]=r*a[s+2],e[l+3]=r*a[s+3],s+=n,l+=i}function l(e,t,r,i){c(e.typedBuffer,t,r,i,e.typedBufferStride)}function c(e,t,r,i,o=4){let a=Math.min(e.length/o,t.count),n=t.typedBuffer,s=t.typedBufferStride,l=0,c=0,u=1/2.2;for(let t=0;t<a;t++)e[c]=i*(r*n[l])**u,e[c+1]=i*(r*n[l+1])**u,e[c+2]=i*(r*n[l+2])**u,e[c+3]=i*r*n[l+3],l+=s,c+=o}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:l,normalize:n,scale:s,scaleView:function(e,t,r){s(e.typedBuffer,t,r,e.typedBufferStride)},transformMat3:a,transformMat3View:o,transformMat4:function(e,t,r,o=4,a=o){let n=(0,i.k)(e.length,o,4),s=(0,i.k)(t.length,a,4),l=Math.min(n,s),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],f=r[5],p=r[6],g=r[7],v=r[8],x=r[9],_=r[10],b=r[11],y=r[12],w=r[13],S=r[14],M=r[15],T=0,C=0;for(let r=0;r<l;r++){let r=t[T],i=t[T+1],n=t[T+2],s=t[T+3];e[C]=c*r+m*i+v*n+y*s,e[C+1]=u*r+f*i+x*n+w*s,e[C+2]=d*r+p*i+_*n+S*s,e[C+3]=h*r+g*i+b*n+M*s,T+=a,C+=o}},transformMat4View:function(e,t,r){let o=e.typedBuffer,a=e.typedBufferStride,n=t.typedBuffer,s=t.typedBufferStride,l=(0,i.k)(o.length,a,4),c=(0,i.k)(n.length,s,4),u=Math.min(l,c),d=r[0],h=r[1],m=r[2],f=r[3],p=r[4],g=r[5],v=r[6],x=r[7],_=r[8],b=r[9],y=r[10],w=r[11],S=r[12],M=r[13],T=r[14],C=r[15];for(let e=0;e<u;e++){let t=e*a,r=e*s,i=n[r],l=n[r+1],c=n[r+2],u=n[r+3];o[t]=d*i+p*l+_*c+S*u,o[t+1]=h*i+g*l+b*c+M*u,o[t+2]=m*i+v*l+y*c+T*u,o[t+3]=f*i+x*l+w*c+C*u}}},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>o});var i=r(34727);class o{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return a(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+n(this.range,e-t,r)}minimalMonotonic(e,t,r){return a(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);let 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 a(e,t,r,i,o=0,a=!1){return(i-=o)<t?i+=n(e,t-i):i>r&&(i-=n(e,i-r)),a&&i===r&&(i=t),i+o}function n(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new o(0,2*Math.PI),l=(new o(-Math.PI,Math.PI),new o(0,360));r.d(t,["ie",0,l,"uC",0,s])},46140(e,t,r){r.d(t,{A:()=>o});var i=r(49186);class o{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)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){let 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 o(this.major,this.minor,this._context)}static parse(e,t=""){let[r,a]=e.split("."),n=/^\s*\d+\s*$/;if(!r?.match||!n.test(r)){let r=t&&t+":";throw new i.A(r+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e})}if(!a?.match||!n.test(a)){let r=t&&t+":";throw new i.A(r+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e})}return new o(parseInt(r,10),parseInt(a,10),t)}}},61473(e,t,r){function i(e){return e||=globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function o(e,t){return e?(t||=globalThis.location.hostname,t?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e):null}r.d(t,{EM:()=>o,b5:()=>i});const a=/^devext\.arcgis\.com$/,n=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,a,n,/^jsapps\.esri\.com$/,s,l]},18370(e,t,r){r.d(t,{z:()=>o});class i{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return this._promise??=this._import().then(async e=>(this.module=e,e)),this._promise}}function o(e){return new i(e)}},88340(e,t,r){function i(){return new Float32Array(2)}function o(e,t){let r=new Float32Array(2);return r[0]=e,r[1]=t,r}function a(){return i()}function n(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{fA:()=>o,vt:()=>i});const c=a(),u=n(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){let t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:o,ones:n,unitX:s,unitY:l,zeros:a},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,u,"uY",0,c])},69397(e,t,r){r.d(t,{Qf:()=>s,Qh:()=>a,lM:()=>o});var i=r(34275);function o(e){if(!e)return 0;let t=c;for(let r in e)e.hasOwnProperty(r)&&(t+=n(e[r],!1));return t}function a(e){if(!e)return 0;if("number"==typeof e[0])return s(e);if(Array.isArray(e))return function(e){let t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=u;for(let i=0;i<t;i++)r+=n(e[i]);return r}(e);let t=c;for(let r in e)e.hasOwnProperty(r)&&(t+=n(e[r]));return t}function n(e,t=!0){switch(typeof e){case"object":return t?a(e):c;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(...e){return e.reduce((e,t)=>e+(t?(0,i.iu)(t)?t.byteLength+d:Array.isArray(t)?l(t,16):0:0),0)}function l(e,t){return u+e.length*t}const c=32,u=16,d=145},65806(e,t,r){r.d(t,{g:()=>n});var i=r(51850),o=r(99917),a=r(9762);function n(e,t,r,i){if((0,o.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,a.projectBuffer)(s,e.spatialReference,0,t,r,0);let n=(0,o.tryProject)(e,r,i);return!!n&&(t[0]=n.x,t[1]=n.y,t[2]=n.z??0,!0)}const s=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>s});var i=r(99917),o=r(16930),a=r(9762),n=r(65806);function s(e,t,r,o){return!(null==t||null==o||e.length<2)&&((0,i.canProjectWithoutEngine)(t,o)?(0,a.projectBuffer)(e,t,0,r,o,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,n.g)(l,r,o)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:o.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>a,lC:()=>s,my:()=>n,tM:()=>d,uW:()=>o});var i=r(34275);function o(e){return a(e,!0)}function a(e,t){if(Array.isArray(e)){if(e.length<1024)return e}else if(e.length<1024)return Array.from(e);let r=!0,o=!0;return e.some((e,t)=>(r&&=0===e,o&&=e===t,!r&&!o)),r?function(e){if(1===e)return c;if(e<1024)return Array(e).fill(0);if(e>m.length){let t=Math.max(2*m.length,e);m=new Uint8Array(t)}return new Uint8Array(m.buffer,0,e)}(e.length):o?d(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(let 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 n(e,t=e){return e<=1024?Array(e):t<=65536?new Uint16Array(e):new Uint32Array(e)}function s(e,t,r){if(0===t.length)return e.slice();if(0===e.length)return t.slice();let i=n(e.length+t.length,r);for(let t=0;t<e.length;++t)i[t]=e[t];for(let r=0;r<t.length;++r)i[e.length+r]=t[r];return i}let l=h(131072);const c=[0],u=(()=>{let e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(e){return 1===e?c:e<1024?Array.from(new Uint16Array(u.buffer,0,e)):e<u.length?new Uint16Array(u.buffer,0,e):(e>l.length&&(l=h(Math.max(2*l.length,e))),new Uint32Array(l.buffer,0,e))}function h(e){let t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let m=new Uint8Array(65536)},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;let i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},65720(e,t,r){r.d(t,{C:()=>v,vt:()=>p,Qy:()=>g,ui:()=>x,ST:()=>M,bU:()=>C,pw:()=>S,m7:()=>_,ZU:()=>b,GH:()=>w,Pi:()=>y,LJ:()=>T,c8:()=>I});var i=r(4341),o=r(58083),a=r(35522),n=r(51850),s=r(78955),l=r(91829),c=r(70328),u=r(71351);function d(e){return e?{ray:(0,u.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,u.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>d());var h=r(27921);function m(e,t,r,i){let{t0:o,t1:a}=i,n=(0,h.mN)(e,t),s=(0,h.mN)(e,r);if(n>=0&&s>=0)return!1;if(n<0&&s>=0){let e=-n/(s-n);if(e<o)return!1;e<a&&(a=e)}else if(n>=0&&s<0){let e=n/(n-s);if(e>a)return!1;e>o&&(o=e)}return i.t0=o,i.t1=a,!0}var f=r(32114);function p(e){return e?[(0,h.vt)(e[0]),(0,h.vt)(e[1]),(0,h.vt)(e[2]),(0,h.vt)(e[3]),(0,h.vt)(e[4]),(0,h.vt)(e[5])]:[(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)()]}function g(){return[(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,n.vt)()]}function v(e,t){for(let r=0;r<O;r++)(0,h.C)(e[r],t[r]);return e}function x(e,t,r,i=R){let n=(0,o.lw)(f.Rc.get(),t,e);(0,o.B8)(n,n);for(let e=0;e<E;++e){let t=(0,s.Z0)(f.Km.get(),F[e],n);(0,a.hZ)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}!function(e,t){(0,h.Cr)(t[4],t[0],t[3],e[0]),(0,h.Cr)(t[1],t[5],t[6],e[1]),(0,h.Cr)(t[4],t[5],t[1],e[2]),(0,h.Cr)(t[3],t[2],t[6],e[3]),(0,h.Cr)(t[0],t[1],t[2],e[4]),(0,h.Cr)(t[5],t[4],t[7],e[5])}(r,i)}function _(e,t){return b(e,t.center,t.radius)}function b(e,t,r){for(let i=0;i<O;i++){let o=e[i];if(o[0]*t[0]+o[1]*t[1]+o[2]*t[2]+o[3]>=r)return!1}return!0}function y(e,t,r){for(let i of P)if((0,h.wE)(e[i],t,r))return!0;return!1}function w(e,t,r){let i=(0,c.gX)(t,B),o=(0,c.VL)(t)/2,n=(0,c.yr)(t)/2,s=(0,c.uJ)(t)/2;return r?function(e,t,r,i,o,n){let s=(0,a.Z0)(z,t,n);for(let t=0;t<O;t++){let a=e[t];if(a[0]*s[0]+a[1]*s[1]+a[2]*s[2]+a[3]-(Math.abs(a[0]*n[0]+a[1]*n[1]+a[2]*n[2])*r+Math.abs(a[0]*n[4]+a[1]*n[5]+a[2]*n[6])*i+Math.abs(a[0]*n[8]+a[1]*n[9]+a[2]*n[10])*o)>0)return!1}return!0}(e,i,o,n,s,r):function(e,t,r,i,o){for(let a=0;a<O;a++){let n=e[a];if(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]-(Math.abs(n[0])*r+Math.abs(n[1])*i+Math.abs(n[2])*o)>0)return!1}return!0}(e,i,o,n,s)}function S(e,t){return D(e,function(e,t=d()){return(0,u.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,A.get()))}function M(e,t,r){return D(e,function(e,t,r=d()){let i=(0,a.Bw)(e.vector);return(0,u.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,A.get()))}function T(e,t,r){return function(e,t,r,i){let o={t0:0,t1:1};for(let a of t)if(!m(e[a],r,i,o))return!1;return o.t0<o.t1}(e,P,t,r)}function C(e,t){for(let r=0;r<O;r++)if((0,h.mN)(e[r],t)>0)return!1;return!0}function D(e,t){for(let r=0;r<O;r++)if(!(0,h.$Q)(e[r],t))return!1;return!0}const P=[0,1,2,3,5],I={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]},O=6,E=8,F=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],A=new i.I(d),R=g(),B=(0,n.vt)(),z=(0,n.vt)()},52039(e,t,r){r.d(t,{O7:()=>h,el:()=>c});var i=r(69052),o=(r(49186),r(18370)),a=r(17676),n=(r(5443),r(39829)),s=(r(82799),r(16930)),l=(r(80754),r(21325));async function c(e,t,r){Array.isArray(e)||(e=[e]),"object"==typeof t&&t&&"authMode"in t&&(r=t);let i=null;for(let t of e)i??=t?.spatialReference;if(!i)return e;let o=(0,l.Vp)(i);if(!o)return e;if(1===e.length&&"extent"===e[0]?.type){let t=e[0].clone().normalizeAsSingleGeometry(o);return["xmin"in t?t:new n.A(t)]}let[s,c]=o.valid,h=!1;for(let t of e){if(!t)continue;if("point"===t.type){h||=t.x>=c,h||=t.x<=s;continue}let{extent:e}=t;if(null==e){h=!0;break}h||=e.xmin>=c,h||=e.xmin<=s,h||=e.xmax>=c,h||=e.xmax<=s}if(!h)return e;let[{foldInto360Range:m},f]=await(0,a.qr)(Promise.all([u.getImportPromise(),d.getImportPromise()]),r),p=f.fromSpatialReference(i);return e.map(e=>{if(null==e||"mesh"===e.type)return e;let t=f.fromGeometry(e),r=f.toGeometry(m(t,p),i);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const u=(0,o.z)(()=>r.e(4144).then(()=>r(4144)).then(e=>e.load().then(()=>e))),d=(0,o.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1550)]).then(()=>r(78125)));function h(e,t,r){let i=(0,l.Vp)(r);if(null==i)return e;let[o,a]=i.valid,n=2*a,s=0,c=0;t>a?s=Math.ceil(Math.abs(t-a)/n):t<o&&(s=-Math.ceil(Math.abs(t-o)/n)),e>a?c=Math.ceil(Math.abs(e-a)/n):e<o&&(c=-Math.ceil(Math.abs(e-o)/n));let u=e+(s-c)*n,d=u-t;return d>a?u-=n:d<o&&(u+=n),u}function m(e){let t=(0,l.Vp)(e);if(null==t)return null;let[r,o]=t.valid;return new i.hr(r,o)}const f=m(s.A.WGS84);m(s.A.WebMercator),r.d(t,["Y_",0,f])},48295(e,t,r){r.d(t,{BU:()=>u,Ui:()=>s,cq:()=>c,k3:()=>d,rb:()=>h});var i=r(4341),o=r(35522),a=r(51850),n=r(11964);function s(e,t,r){let{direction:i,origin:a}=t,{p0:n,p1:s,p2:l}=e,c=s[0]-n[0],u=s[1]-n[1],d=s[2]-n[2],h=l[0]-n[0],m=l[1]-n[1],f=l[2]-n[2],p=i[1]*f-m*i[2],g=i[2]*h-f*i[0],v=i[0]*m-h*i[1],x=c*p+u*g+d*v;if(x>-1e-5&&x<1e-5)return!1;let _=1/x,b=a[0]-n[0],y=a[1]-n[1],w=a[2]-n[2],S=_*(b*p+y*g+w*v);if(S<0||S>1)return!1;let M=y*d-u*w,T=w*c-d*b,C=b*u-c*y,D=_*(i[0]*M+i[1]*T+i[2]*C);if(D<0||S+D>1)return!1;if(r){let e=_*(h*M+m*T+f*C);(0,o.hs)(r,i,e),(0,o.WQ)(r,a,r)}return!0}function l(e,t,r){let[i,o]=e,[a,n]=t,[s,l]=r;return.5*((a-i)*(l-o)-(n-o)*(s-i))}function c(e,t,r,i,o=0){let a=l(i,e,t),n=l(i,t,r),s=l(i,r,e);return!((a<-o||n<-o||s<-o)&&(a>o||n>o||s>o))}function u(e,t,r){return(0,o.Re)(m,t,e),(0,o.Re)(f,r,e),.5*(0,o.Bw)((0,o.$A)(m,m,f))}function d(e,t,r,i,a){(0,o.jb)(m,i,r),(0,o.jb)(p,a,r),(0,o.jb)(f,t,r);let n=(0,o.Om)(m,f),s=(0,o.Om)(p,f);if(n<=0&&s<=0)return void(0,o.C)(e,r);(0,o.jb)(f,t,i);let l=(0,o.Om)(m,f),c=(0,o.Om)(p,f);if(l>=0&&c<=l)return void(0,o.C)(e,i);let u=n*c-l*s;if(u<=0&&n>=0&&l<=0)return void(0,o.Ln)(e,r,m,n/(n-l));(0,o.jb)(f,t,a);let d=(0,o.Om)(m,f),h=(0,o.Om)(p,f);if(h>=0&&d<=h)return void(0,o.C)(e,a);let g=d*s-n*h;if(g<=0&&s>=0&&h<=0)return void(0,o.Ln)(e,r,p,s/(s-h));let v=l*h-d*c;if(v<=0&&c-l>=0&&d-h>=0)return(0,o.jb)(f,a,i),void(0,o.Ln)(e,i,f,(c-l)/(c-l+(d-h)));let x=1/(v+g+u);(0,o.C)(e,r),(0,o.Ln)(e,e,m,g*x),(0,o.Ln)(e,e,p,u*x)}function h(e,t,r,i){(0,o.jb)(m,r,t),(0,o.jb)(f,i,t),(0,o.$A)(e,m,f);let a=(0,o.Bw)(e);return 0!==a&&((0,o.hs)(e,e,1/a),!0)}r(32114),new i.I(n.vt),new i.I(()=>{return e?{p0:(0,a.o8)(e.p0),p1:(0,a.o8)(e.p1),p2:(0,a.o8)(e.p2)}:{p0:(0,a.vt)(),p1:(0,a.vt)(),p2:(0,a.vt)()};var e});const m=(0,a.vt)(),f=(0,a.vt)(),p=(0,a.vt)()},21015(e,t,r){r.d(t,{R:()=>l});var i=r(56507),o=r(60999),a=r(49186),n=r(17676),s=r(84952);class l{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,s.DB)(e)?((0,n.Te)(t),(0,s.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);let s=await(0,o.Ke)((0,i.A)(t,{responseType:e,...r}));if(s.ok)return s.value.data;throw(0,n.QP)(s.error),new a.A("gltf-loader-request-error",`Request for resource failed: ${s.error}`)}}},84498(e,t,r){r.d(t,{x:()=>n});var i=r(34275),o=r(97146),a=r(63907);function n(e,t){switch(t){case a.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,o.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case a.WR.TRIANGLE_STRIP:return function(e){let t="number"==typeof e?e:e.length;if(t<3)return[];let r=t-2,i=(0,o.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let o=0;o<r;o+=1)o%2==0?(i[t++]=e[o],i[t++]=e[o+1],i[t++]=e[o+2]):(i[t++]=e[o+1],i[t++]=e[o],i[t++]=e[o+2])}return i}(e);case a.WR.TRIANGLE_FAN:return function(e){let t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array;let r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}let o=e[0],a=e[1],n=0;for(let t=0;t<r;++t){let r=e[t+2];i[n++]=o,i[n++]=a,i[n++]=r,a=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>n,Xi:()=>o,pn:()=>s,x3:()=>a});var i=r(44208);class o{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function a(e){return"encoded-mesh-texture"===e?.type}async function n(e){let t=await new Blob([e]).text();return JSON.parse(t)}async function s(e,t){if("image/ktx2"===t)return new o(e);let r=new Blob([e],{type:t}),a=URL.createObjectURL(r);switch(t){case"image/jpeg":a+="#.jpg";break;case"image/png":a+="#.png"}let n=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{let r=()=>{o(),e(n)},i=e=>{o(),t(e)},o=()=>{URL.revokeObjectURL(a),n.removeEventListener("load",r),n.removeEventListener("error",i)};n.addEventListener("load",r),n.addEventListener("error",i),n.src=a});try{n.src=a,await n.decode()}catch{}return URL.revokeObjectURL(a),n}},24426(e,t,r){r.d(t,{fetch:()=>wr});var i=r(40876),o=r(61473),a=r(34727),n=r(77690),s=r(29242),l=r(58083),c=r(9093),u=r(48163),d=r(35522),h=r(51850),m=r(70328);function f(e,t=!1){return e<=1024?t?Array(e).fill(0):Array(e):new Float32Array(e)}var p=r(13030),g=r(73354),v=r(50867),x=r(43609),_=r(21015),b=r(84498),y=r(51530),w=r(88340);function S(e){if(null==e)return null;let t=null==e.offset?w.uY:e.offset,r=null==e.rotation?0:e.rotation,i=null==e.scale?w.Un:e.scale,o=(0,s.fA)(1,0,0,0,1,0,t[0],t[1],1),a=(0,s.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,s.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,s.vt)();return(0,n.lw)(c,a,l),(0,n.lw)(c,o,c),c}class M{constructor(){this.geometries=[],this.materials=[],this.textures=[]}}class T{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new M,this.numberOfVertices=0}}var C=r(56507),D=r(60999),P=r(49186),I=r(53966),O=r(69397);class E{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(let t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){let i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){let r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){let r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(let e of this._outer)yield e}*values(){for(let e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(let[e,t]of this._outer)for(let[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}clone(){let e=new E;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var F=r(17676),A=r(46140),R=r(97146),B=r(31217),z=r(46610),N=r(34275);function j(e){if(e.length<1024)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,N.LW)(e)?Float16Array.from(e):(0,N.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return(0,N.vZ)(e)?Float32Array.from(e):Uint32Array.from(e);default:return Float64Array.from(e)}}var L=r(15142),H=r(94008),W=r(620);class V{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this._readPosition=r,this._children=void 0,(0,W.vA)(e.length>=1);let i=e.length;$.clear();let o=(0,m.Ie)();for(let a=0;a<i;++a){let i=t*e[a];for(let e=0;e<t;++e){let t=i+e;$.push(t),(0,m.iT)(o,r(U,t))}}this.box=o;let a=new H.iy,n=(0,m.gX)(o,a.center),s=.5*Math.max((0,m.VL)(o),(0,m.yr)(o),(0,m.uJ)(o)),l=s*s;for(let e=0;e<$.length;++e){let t=r(U,$.at(e)),i=(0,d.Re)(t,t,n),o=(0,d.uE)(i);if(o<=l)continue;let a=Math.sqrt(o),c=.5*(a-s);s+=c,l=s*s;let u=c/a;(0,d.Ln)(n,n,i,u)}a.radius=s,this.sphere=a,$.clear()}get children(){if(this._children)return this._children;let e=this.box;if((0,m.TF)(e)<=1)return;let{_readPosition:t,_numIndexPerPrimitive:r,primitiveIndices:i}=this,o=(0,m.gX)(e,U),a=i.length,n=new Uint8Array(a),s=[0,0,0,0,0,0,0,0];for(let e=0;e<a;++e){let a=r*i[e],l=t(G,a);for(let e=1;e<r;++e)(0,d.jk)(l,l,t(k,a+e));let c=+(l[0]<o[0])|(l[1]<o[1]?2:0)|(l[2]<o[2]?4:0);n[e]=c,++s[c]}let l=0;for(let e=0;e<8;++e)s[e]>0&&++l;if(l<2)return;let c=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let e=0;e<8;++e)s[e]>0&&(c[e]=new Uint32Array(s[e]));s.fill(0);for(let e=0;e<a;++e){let t=n[e];c[t][s[t]++]=i[e]}let u=[];for(let e=0;e<8;++e){let i=c[e];void 0!==i&&u.push(new V(i,r,t))}return this._children=u,this._children}static prune(){$.prune()}}const U=(0,h.vt)(),G=(0,h.vt)(),k=(0,h.vt)(),$=new L.A({deallocator:null});var Z=r(24326);class q{constructor(e){this.id=(0,Z.c)(),this.type=0,this._attributes=new Map;for(let[t,r]of e)this._attributes.set(t,{...r,indices:(0,R.Dg)(r.indices)})}get attributes(){return this._attributes}}class Y{constructor(){this.uid=(0,Z.c)()}}class X extends Y{constructor(e){super(),this.highlightName=e,this.channel=0}}var K=r(94656);class J extends q{constructor(e,t,r=null,i=-1,o,a){super(t),this.material=e,this.mapPositions=r,this.edgeIndicesLength=i,this.baseGeometry=o,this.drawIndices=a,this._readPrimitivePosition=null,this._vertexPositionIndicesCache=void 0,this._transformation=void 0,this.localOrigin=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0,this._boundingInfo=null,(0,W.vA)((e?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match"),this.edgeIndicesLength<0&&(this.edgeIndicesLength=this.indexCount)}get readPrimitivePosition(){return this._readPrimitivePosition??=function(e,t){let{data:r,indices:i,size:o,stride:a}=e;return(0,W.vA)(2===o||3===o||4===o,"Position attribute must have 2, 3 or 4 components"),2===o?null==t?(e,t)=>{let o=i[t]*a;return e[0]=r[o],e[1]=r[o+1],e[2]=-2,e}:(e,o)=>{let n=i[t[o]]*a;return e[0]=r[n],e[1]=r[n+1],e[2]=-2,e}:null==t?function(e,t,r){return(i,o)=>{let a=t[o]*r;return i[0]=e[a],i[1]=e[a+1],i[2]=e[a+2],i}}(r,i,a):(e,o)=>{let n=i[t[o]]*a;return e[0]=r[n],e[1]=r[n+1],e[2]=r[n+2],e}}(this.positionAttribute,this.drawIndices),this._readPrimitivePosition}_invalidateReadPrimitivePosition(){this._readPrimitivePosition=null}instantiate(e={}){let t=new J(e.material||this.material,[],this.mapPositions,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);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}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:j(t.data)},this._attributes.set(e,t),"position"===e&&this._invalidateReadPrimitivePosition()),t}setAttributeData(e,t){let r=this._attributes.get(e);r?(this._attributes.set(e,{...r,exclusive:!0,data:t}),"position"===e&&this._invalidateReadPrimitivePosition()):(0,K.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){return void 0===this._vertexPositionIndicesCache&&(this._vertexPositionIndicesCache=this._computePrimitivePositionIndices()),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){let{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){let r=[];for(let i of e)r.push(t.indices[i]);return r}return t?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){return(this.drawIndices??this.positionAttribute?.indices)?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!this.material.computeAttachmentOrigin(e,this.readPrimitivePosition,this.indexCount)&&(null!=this._transformation&&(0,d.Z0)(e,e,this._transformation),!0)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){let e=this.positionAttribute,t=this.indexCount;if(!e||0===t)return null;let r=this.material.primitiveVertexCount;(0,W.vA)(t%r===0,"Indexing error: "+t+" not divisible by "+r);let i=(0,R.tM)(t/r);return new V(i,r,this.readPrimitivePosition)}get transformation(){return this._transformation??c.zK}set transformation(e){this._transformation=e&&e!==c.zK?(0,c.o8)(e):null}get highlights(){return this._highlights||Q}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}forEachHighlightOption(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){let t=new X(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);let{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)){let{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const Q=new Set;var ee=r(46859),te=r(49255),re=r(97768);class ie{constructor(e){this._material=e.material,this._techniques=e.techniques}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(t))}ensureResources(e){return 2}}var oe=r(65786);class ae extends ie{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,re.Gz)(this._texture),this._textureNormal=(0,re.Gz)(this._textureNormal),this._textureEmissive=(0,re.Gz)(this._textureEmissive),this._textureOcclusion=(0,re.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,re.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new se(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){(null==this._texture||e!==this._texture.id)&&(this._texture=(0,re.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);let r=this._textures.acquire(e);(0,F.$X)(r)?(++this._numLoading,r.then(e=>{this._disposed?((0,re.Gz)(e),t(null)):t(e)}).finally(()=>--this._numLoading)):t(r)}}class ne extends oe.Y{constructor(e=null){super(),this.textureEmissive=e}}class se extends ne{constructor(e,t,r,i,o,a,n){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=o,this.scale=a,this.normalTextureTransformMatrix=n}}var le=r(48295);const ce=(0,h.vt)(),ue=(0,h.vt)(),de=(0,h.vt)(),he=(0,h.vt)();var me=r(19245);class fe{constructor(e,t){this.id=(0,Z.c)(),this.supportsEdges=!1,this.primitiveVertexCount=3,this._renderPriority=0,this._parameters=new t,(0,me.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,me.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 testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(e){return this.updateConfiguration(e),this._configuration}updateConfiguration(e){this._configuration.output=e.output,this._configuration.hasEmission=e.hasEmission&&(0,te._o)(e.output),this._configuration.hasHighlightMixTexture=10===e.output&&null!=e.highlightMixTexture,this._configuration.useFloatBlend=e.useFloatBlend.value,this._configuration.emissionDimmingPass=e.transparentWithoutDepthEmissionDimmingPass&&(0,te._o)(e.output)}computeAttachmentOrigin(e,t,r){return function(e,t,r){if(r<=0)return!1;(0,d.hZ)(e,0,0,0),(0,d.hZ)(he,0,0,0);let i=0,o=0;for(let a=0;a<r;++a){let r=3*a;t(ce,r),t(ue,r+1),t(de,r+2);let n=(0,le.BU)(ce,ue,de);n?((0,d.WQ)(ce,ce,ue),(0,d.WQ)(ce,ce,de),(0,d.hs)(ce,ce,1/3*n),(0,d.WQ)(e,e,ce),i+=n):((0,d.WQ)(he,he,ce),(0,d.WQ)(he,he,ue),(0,d.WQ)(he,he,de),o+=3)}return!(0===o&&0===i||(0===i?0===o||((0,d.hs)(e,he,1/o),0):((0,d.hs)(e,e,1/i),0)))}(e,t,r/3)}}oe.Y;var pe=r(58682),ge=r(90629),ve=r(65720),xe=r(27921),_e=r(19419),be=r(11964);function ye(e,t){return e.isRectangle?(0,_e.Uc)(e.bounds,t):function(e,t){return Se(e[0],e[1],t)}(t,e.points)}function we(e,t,r,i){let o=Math.min(t[0],r[0],i[0]),a=Math.min(t[1],r[1],i[1]),n=Math.max(t[0],r[0],i[0]),s=Math.max(t[1],r[1],i[1]);if(!function(e,t){if(!(0,_e.HY)(e.bounds,t))return!1;if(e.isRectangle)return!0;for(let r of e.points)if((0,_e.Uc)(t,r))return!0;if(function(e,t){let r=e[0],i=e[1],o=e[2],a=e[3];return Se(r,i,t)||Se(o,i,t)||Se(o,a,t)||Se(r,a,t)}(t,e.points))return!0;for(let r=0;r<e.points.length;r++)if(Me(e.points[r],r===e.points.length-1?e.points[0]:e.points[r+1],t))return!0;return!1}(e,(0,_e.fA)(o,a,n,s,Oe)))return!1;if(ye(e,t)||ye(e,r)||ye(e,i))return!0;for(let o of e.points)if((0,le.cq)(t,r,i,o,Ee))return!0;for(let o=0;o<e.points.length;o++){let a=e.points[o],n=e.points[(o+1)%e.points.length];if(Ce(t,r,a,n)||Ce(r,i,a,n)||Ce(i,t,a,n))return!0}return!1}function Se(e,t,r){let i=!1;for(let o=0,a=r.length-1;o<r.length;a=o++){let n=r[o],s=r[a];n[1]>t!=s[1]>t&&e<(s[0]-n[0])*(t-n[1])/(s[1]-n[1])+n[0]&&(i=!i)}return i}function Me(e,t,r){let i=r[0],o=r[1],a=r[2],n=r[3],s=e[0],l=e[1],c=t[0],u=t[1];return!(s<i&&c<i||s>a&&c>a||l<o&&u<o||l>n&&u>n)&&(!(!(0,_e.Rj)(r,s,l)&&!(0,_e.Rj)(r,c,u))||Te(e,t,i,o,a,o)||Te(e,t,a,o,a,n)||Te(e,t,a,n,i,n)||Te(e,t,i,n,i,o))}function Te(e,t,r,i,o,a){let n=De(e[0],e[1],t[0],t[1],r,i),s=De(e[0],e[1],t[0],t[1],o,a),l=De(r,i,o,a,e[0],e[1]),c=De(r,i,o,a,t[0],t[1]);return n!==s&&l!==c||0===n&&Pe(e,t,r,i)||0===s&&Pe(e,t,o,a)||0===l&&Ie(r,i,o,a,e[0],e[1])||0===c&&Ie(r,i,o,a,t[0],t[1])}function Ce(e,t,r,i){return Te(e,t,r[0],r[1],i[0],i[1])}function De(e,t,r,i,o,a){let n=(i-t)*(o-r)-(r-e)*(a-i);return Math.abs(n)<=Ee?0:Math.sign(n)}function Pe(e,t,r,i){return Ie(e[0],e[1],t[0],t[1],r,i)}function Ie(e,t,r,i,o,a){return o>=Math.min(e,r)-Ee&&o<=Math.max(e,r)+Ee&&a>=Math.min(t,i)-Ee&&a<=Math.max(t,i)+Ee}const Oe=(0,_e.vt)(),Ee=((0,ge.r_)(),(0,ge.r_)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,be.vt)(),1e-9);class Fe{constructor(e){this.type=e,this.distance=1/0,this.renderDistance=1/0,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,h.vt)(),this.normal=(0,h.vt)()}reset(){this.distance=1/0,this.renderDistance=1/0,this.hasNormal=!1}update(e,t,r,i,o=e){this.distance=e,this.renderDistance=o,this.primitiveIndex=t,(0,d.C)(this.point,r),this.hasNormal=null!=i,null!=i&&(0,d.C)(this.normal,i)}updateIfCloserFromValues(e,t,r,i,o=e){o<this.renderDistance&&this.update(e,t,r,i,o)}updateIfCloser(e){let{distance:t,renderDistance:r,primitiveIndex:i,point:o,normal:a}=e;this.updateIfCloserFromValues(t,i,o,e.hasNormal?a:null,r)}get valid(){return Number.isFinite(this.distance)}}function Ae(e,t,r,i,o){if(!e.visible)return null;let a,n=new Fe(4);a=e.boundingInfo?Be(e.readPrimitivePosition,e.boundingInfo,t,r,i,o):Re(t,r,i,0,e.faceCount,e.readPrimitivePosition,o,null,0);for(let e of a)n.updateIfCloser(e);return n.valid?n:null}function*Re(e,t,r,i,o,a,n,s=null,l=0){if(null==e.camera)return;let{camera:c,screenPolygonPrimitiveProcessor:u}=e;for(let e=i;e<o;++e){let i=(s?.[e]??e)+l,o=null==s?i:e,h=3*i;ze(He[0],a,h+0,n,o,t),ze(He[1],a,h+1,n,o,t),ze(He[2],a,h+2,n,o,t);let m,f=Ge;$e.reset();let p=We;for(let e of u.processTriangle(He))if(p.length=0,(0,xe.H)(c.frustum[4],e,()=>p.pushNew(),!1),!(p.length<3)){for(let e=0;e<p.length;e++)c.projectToScreen(p.at(e),Ve[e]);Ne(r,Ve,p.length)&&(je(c.eye,p,Ue),m??=(0,le.rb)(Ge,He[0],He[1],He[2]),$e.updateIfCloserFromValues((0,d.Io)(c.eye,Ue),i,Ue,m?f:null))}$e.valid&&(yield $e)}}function*Be(e,t,r,i,o,a){let n;if(null==a?n=(0,ve.GH)(o.broadPhaseFrustum,t.box,i):((0,m.C)(Le,t.box),a.applyToAabb(Le),n=(0,ve.GH)(o.broadPhaseFrustum,Le,i)),!n)return;let{primitiveIndices:s}=t,l=s.length;if(l>1e3){let n=t.children;if(void 0!==n){for(let t of n)yield*Be(e,t,r,i,o,a);return}}yield*Re(r,i,o,0,l,e,a,s,0)}function ze(e,t,r,i,o,a){let[n,s,l]=t(e,r);null==i?(0,d.hZ)(e,n,s,l):i.applyToVertex(e,n,s,l,o),a&&(0,d.Z0)(e,e,a)}function Ne(e,t,r){for(let i=1;i<r-1;i++)if(we(e,t[0],t[i],t[i+1]))return!0;return!1}function je(e,t,r){let i=1/0,o=t.at(0);for(let a=1;a<t.length-1;a++){(0,le.k3)(ke,e,o,t.at(a),t.at(a+1));let n=(0,d.hG)(e,ke);n<i&&(i=n,(0,d.C)(r,ke))}}const Le=(0,m.vt)(),He=[(0,h.vt)(),(0,h.vt)(),(0,h.vt)()],We=new L.A({allocator:e=>e??(0,h.vt)()}),Ve=Array.from({length:12},()=>(0,ge.gs)()),Ue=(0,h.vt)(),Ge=(0,h.vt)(),ke=(0,h.vt)(),$e=new Fe(4);var Ze=r(16396);function qe(e,t,r){let{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length;r*=n;for(let e=0;e<s;++e){let t=2*o[e];a[r]=i[t],a[r+1]=i[t+1],r+=n}}function Ye(e,t,r,i=1){let{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,1===i)for(let e=0;e<l;++e){let t=3*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){let t=3*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}}function Xe(e,t,r,i,o=1){let{data:a,indices:n}=e,s=r.typedBuffer,l=r.typedBufferStride,c=n.length;if(i*=l,t===a.length&&4===t){s[i]=a[0],s[i+1]=a[1],s[i+2]=a[2],s[i+3]=a[3];let e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,n=e[i/=4];i+=t;let u=c*o;for(let r=1;r<u;++r)e[i]=n,i+=t}else if(1===o){if(4===t){for(let e=0;e<c;++e){let t=4*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}return}for(let e=0;e<c;++e){let t=3*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}}else if(4===t)for(let e=0;e<c;++e){let t=4*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}else for(let e=0;e<c;++e){let t=3*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}}function Ke(e,t,r,i,o,a){switch(e){case"position":{(0,W.vA)(3===t.size);let i=o.getField(e,p.xs);(0,W.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void Ye(e,r,i,o);let{data:a,indices:n}=e,s=r.typedBuffer,c=r.typedBufferStride,u=n.length,d=t[0],h=t[1],m=t[2],f=t[4],p=t[5],g=t[6],v=t[8],x=t[9],_=t[10],b=t[12],y=t[13],w=t[14];i*=c;let S=0,M=0,T=0,C=(0,l.tZ)(t)?e=>{S=a[e]+b,M=a[e+1]+y,T=a[e+2]+w}:e=>{let t=a[e],r=a[e+1],i=a[e+2];S=d*t+f*r+v*i+b,M=h*t+p*r+x*i+y,T=m*t+g*r+_*i+w};if(1===o)for(let e=0;e<u;++e)C(3*n[e]),s[i]=S,s[i+1]=M,s[i+2]=T,i+=c;else for(let e=0;e<u;++e){C(3*n[e]);for(let e=0;e<o;++e)s[i]=S,s[i+1]=M,s[i+2]=T,i+=c}}(t,r,i,a);break}case"normal":{(0,W.vA)(3===t.size);let r=o.getField(e,p.xs);(0,W.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void Ye(e,r,i,o);let{data:a,indices:n}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,d=n.length,h=s[0],m=s[1],f=s[2],p=s[4],g=s[5],v=s[6],x=s[8],_=s[9],b=s[10],y=!(0,l.ut)(s),w=1e-6,S=.999999;i*=u;let M=0,T=0,C=0,D=(0,l.tZ)(s)?e=>{M=a[e],T=a[e+1],C=a[e+2]}:e=>{let t=a[e],r=a[e+1],i=a[e+2];M=h*t+p*r+x*i,T=m*t+g*r+_*i,C=f*t+v*r+b*i};if(1===o)if(y)for(let e=0;e<d;++e){D(3*n[e]);let t=M*M+T*T+C*C;if(t<S&&t>w){let e=1/Math.sqrt(t);c[i]=M*e,c[i+1]=T*e,c[i+2]=C*e}else c[i]=M,c[i+1]=T,c[i+2]=C;i+=u}else for(let e=0;e<d;++e)D(3*n[e]),c[i]=M,c[i+1]=T,c[i+2]=C,i+=u;else for(let e=0;e<d;++e){if(D(3*n[e]),y){let e=M*M+T*T+C*C;if(e<S&&e>w){let t=1/Math.sqrt(e);M*=t,T*=t,C*=t}}for(let e=0;e<o;++e)c[i]=M,c[i+1]=T,c[i+2]=C,i+=u}}(t,i,r,a);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,W.vA)(2===t.size);let r=o.getField(e,p.mJ);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,a);break}case"uv0":{(0,W.vA)(2===t.size);let r=o.getField(e,p.ZD)??o.getField(e,p.gH);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,a);break}case"uvi":{(0,W.vA)(2===t.size);let r=o.getField(e,p.mJ);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,a);break}case"color":case"symbolColor":{let r=o.getField(e,p.XP);(0,W.vA)(!!r,`No buffer view for ${e}`),(0,W.vA)(3===t.size||4===t.size),Xe(t,t.size,r,a);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{let r=o.getField(e,p.Y$)??o.getField(e,p.Y$);(0,W.vA)(!!r,`No buffer view for ${e}`),(0,W.vA)(1===t.size),function(e,t,r){let{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length,l=i[0];r*=n;for(let e=0;e<s;++e)a[r]=l,r+=n}(t,r,a);break}case"tangent":{(0,W.vA)(4===t.size);let i=o.getField(e,p.Eq);(0,W.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void function(e,t,r,i=1){let{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,1===i)for(let e=0;e<l;++e){let t=4*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){let t=4*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}}(e,r,i,o);let{data:a,indices:n}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,d=n.length,h=s[0],m=s[1],f=s[2],p=s[4],g=s[5],v=s[6],x=s[8],_=s[9],b=s[10],y=!(0,l.ut)(s),w=1e-6,S=.999999;if(i*=u,1===o)for(let e=0;e<d;++e){let t=4*n[e],r=a[t],o=a[t+1],s=a[t+2],l=a[t+3],d=h*r+p*o+x*s,M=m*r+g*o+_*s,T=f*r+v*o+b*s;if(y){let e=d*d+M*M+T*T;if(e<S&&e>w){let t=1/Math.sqrt(e);d*=t,M*=t,T*=t}}c[i]=d,c[i+1]=M,c[i+2]=T,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){let t=4*n[e],r=a[t],s=a[t+1],l=a[t+2],d=a[t+3],M=h*r+p*s+x*l,T=m*r+g*s+_*l,C=f*r+v*s+b*l;if(y){let e=M*M+T*T+C*C;if(e<S&&e>w){let t=1/Math.sqrt(e);M*=t,T*=t,C*=t}}for(let e=0;e<o;++e)c[i]=M,c[i+1]=T,c[i+2]=C,c[i+3]=d,i+=u}}(t,r,i,a);break}case"olidColor":(0,W.vA)(4===t.size),Xe(t,4,o.getField(e,p.XP),a)}}(0,h.vt)();class Je{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i){null!=i&&function(e,t,r,i,o){let{buffer:a,offset:n}=o;for(let o of t.fields.keys()){let t=e.get(o),s=t?.indices;t&&s&&Ke(o,t,r,i,a,n)}}(r,this.layout,e,t,i)}}const Qe=at(-1),et=at(1),tt=Qe,rt=[];rt[0]=null,rt[1]=et,rt[2]=Qe,rt[3]=at(-2),rt[4]=at(-3);const it=rt.map(e=>function(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}(tt,e));function ot({output:e,enableOITOffset:t,polygonOffset:r}){return(0,te._$)(e)&&t?it[r]:rt[r]}function at(e){return{factor:1*e,units:2*e}}rt[1]=et;var nt=r(32198),st=r(51976),lt=r(34711);class ct extends lt.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,nt.Cg)([(0,st.W)()],ct.prototype,"hasHighlightMixTexture",void 0),(0,nt.Cg)([(0,st.W)()],ct.prototype,"emissionDimmingPass",void 0);class ut extends ct{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}function dt(e){return mt.output=+!!e.transparent,mt.polygonOffset=e.polygonOffset,mt.enableOITOffset=e.enableOITOffset,ot(mt)}function ht({units:e,factor:t},r,i,o){let a=pt*e;return i+((o?1-Math.abs((0,d.Om)(r,o)):0)*t*ft+a)}(0,nt.Cg)([(0,st.W)({count:5})],ut.prototype,"polygonOffset",void 0),(0,nt.Cg)([(0,st.W)()],ut.prototype,"transparent",void 0),(0,nt.Cg)([(0,st.W)()],ut.prototype,"enableOITOffset",void 0);const mt=new ut,ft=2e-5,pt=2e-6,gt=(0,h.vt)();var vt=r(91429),xt=r(91829),_t=r(4431),bt=r(1843),yt=r(72824),wt=r(13840),St=r(42958),Mt=r(16943),Tt=r(90644);const Ct=(0,Tt.p3)(1,0,1,771);function Dt(e,t=!1,r=!1){if(r)return Tt.uR;switch(e){case 0:return t?Tt.RC:Tt.T8;case 1:return Ct;default:return null}}function Pt(e){if(e.draped)return null;switch(e.output){case 0:case 2:default:return e.writeDepth?Tt.Uy:null;case 1:return null}}function It(e,t=513){return{func:(0,te._$)(e)?515:t}}(0,xt._Y)();const Ot={mask:255},Et=(0,Tt.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),Ft=(0,Tt.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681});(0,Tt.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),(0,Tt.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680}),r(4576),r(66289);var At=r(69622),Rt=r(65529),Bt=r(32728);class zt{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",p.Eq),this.color=e.getField("instanceColor",p.XP),this.olidColor=e.getField("instanceOlidColor",p.XP),this.state=e.getField("state",p.SL),this.lodLevel=e.getField("lodLevel",p.SL)}}let Nt=class extends At.A{constructor(e,t){super(e),this.events=new Rt.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return Lt(jt.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=Gt,this._buffer=this._layout.createBuffer(this._capacity),this._view=new zt(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();let e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){let t=this._view.state;(0,W.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){let t=this._view.state;(0,W.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){let t=this._view,r=Ht,i=Wt;t.localTransform.getMat(e,Vt),t.globalTransform.getMat(e,Ut);let o=(0,l.lw)(Ut,Ut,Vt);(0,d.hZ)(r,o[12],o[13],o[14]),t.modelOrigin.setVec(e,r),(0,n.z0)(i,o),t.model.setMat(e,i);let a=(0,Bt.wp)(Ht,o);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,n.B8)(i,i),(0,n.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){let r=this._view;r.model.getMat(e,Wt),r.modelOrigin.getVec(e,Ht),t[0]=Wt[0],t[1]=Wt[1],t[2]=Wt[2],t[3]=0,t[4]=Wt[3],t[5]=Wt[4],t[6]=Wt[5],t[7]=0,t[8]=Wt[6],t[9]=Wt[7],t[10]=Wt[8],t[11]=0,t[12]=Ht[0],t[13]=Ht[1],t[14]=Ht[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(Ht,this,e),t*=Math.max(Ht[0],Ht[1],Ht[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Ht,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Ht[0],Ht[1],Ht[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){let{_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){let t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){let 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){let r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){let 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(Gt,Math.floor(1.5*this._capacity)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new zt(this._buffer)}_findSlot(){let e=this._view.state,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,nt.Cg)([(0,vt.MZ)({constructOnly:!0})],Nt.prototype,"shaderTransformation",void 0),(0,nt.Cg)([(0,vt.MZ)()],Nt.prototype,"_size",void 0),(0,nt.Cg)([(0,vt.MZ)({readOnly:!0})],Nt.prototype,"size",null),Nt=(0,nt.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],Nt);const jt=(0,bt.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function Lt(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Mt.E)()&&e.vec4u8("instanceOlidColor"),e}const Ht=(0,h.vt)(),Wt=(0,s.vt)(),Vt=(0,c.vt)(),Ut=(0,c.vt)(),Gt=64,kt=(0,bt.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var $t=r(74810),Zt=r(28491),qt=r(49788);class Yt extends yt.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=$t.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.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=h.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,h.CN)(.2,.2,.2),this.diffuse=(0,h.CN)(.8,.8,.8),this.externalColor=(0,xt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,h.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=qt.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}yt.gy;let Xt=class extends St.w{constructor(e,t){let i=(0,_t.U)(Qt(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,_t.U)(function(e){return Lt(kt.clone(),e)}(t)))),super(e,t,i),this.shader=new wt.r(Zt.D,()=>r.e(5141).then(()=>r(5141))),this.ignoreUnused=!0}_makePipeline(e,t){let{output:r,transparent:i,cullFace:o,customDepthTest:a,hasOccludees:n}=e;return(0,Tt.Ey)({blending:i?Dt(r,!1,e.emissionDimmingPass):null,culling:Jt(e)?(0,Tt.Xt)(o):null,depthTest:It(r,Kt(a)),depthWrite:Pt(e),colorWrite:Tt.kn,stencilWrite:n?Ot:null,stencilTest:n?t?Ft:Et:null,polygonOffset:ot(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,r){return r?this._occludeePipelineState:super.getPipeline(e,t,r)}};function Kt(e){switch(e){case 1:return 515;case 0:case 4:return 513;case 2:return 516;case 3:return 514}}function Jt(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Qt(e){let t=(0,bt.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",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,Mt.E)()&&t.vec4u8("olidColor"),t}Xt=(0,nt.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],Xt);class er extends ut{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.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return+!!this.hasTextures}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}(0,nt.Cg)([(0,st.W)({count:4})],er.prototype,"alphaDiscardMode",void 0),(0,nt.Cg)([(0,st.W)({count:3})],er.prototype,"doubleSidedMode",void 0),(0,nt.Cg)([(0,st.W)({count:8})],er.prototype,"pbrMode",void 0),(0,nt.Cg)([(0,st.W)({count:3})],er.prototype,"cullFace",void 0),(0,nt.Cg)([(0,st.W)({count:3})],er.prototype,"normalType",void 0),(0,nt.Cg)([(0,st.W)({count:4})],er.prototype,"customDepthTest",void 0),(0,nt.Cg)([(0,st.W)({count:8})],er.prototype,"emissionSource",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasVertexColors",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasSymbolColors",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasVerticalOffset",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasColorTexture",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasMetallicRoughnessTexture",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasOcclusionTexture",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasNormalTexture",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasScreenSizePerspective",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasVertexTangents",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasOccludees",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"instanced",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"instancedDoublePrecision",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasModelTransformation",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"offsetBackfaces",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasVVSize",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasVVColor",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"receiveShadows",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasShadowHighlights",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"receiveAmbientOcclusion",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"receiveGlobalIllumination",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"textureAlphaPremultiplied",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"instancedFeatureAttribute",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"instancedColor",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"writeDepth",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"snowCover",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasColorTextureTransform",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasEmissionTextureTransform",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasNormalTextureTransform",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasOcclusionTextureTransform",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasMetallicRoughnessTextureTransform",void 0);var tr=r(57323);let rr=class extends Xt{constructor(){super(...arguments),this.shader=new wt.r(tr.R,()=>r.e(9933).then(()=>r(39933)))}};rr=(0,nt.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],rr);class ir extends st.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,nt.Cg)([(0,st.W)()],ir.prototype,"receiveShadows",void 0);class or extends fe{constructor(e,t){super(e,nr),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>(0,te.uw)(e)&&!this.transparent],[4,e=>(0,te.uw)(e)&&this.transparent]]),this._layout=Qt(this.parameters),this._configuration=new er(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){let{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=qt.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,d.t2)(this.parameters.emissiveBaseColor,h.uY)}get emissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);let{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;let{treeRendering:i,doubleSided:o,doubleSidedType:a}=t;r.hasVertexTangents=!i&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=i?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!i&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=i?2:o&&"normal"===a?1:o&&"winding-order"===a?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,(0,te._o)(e.output)?(r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=function(e,t){return e.receiveShadows&&null!=t.shadowHighlight?.getTexture()}(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&e.globalIlluminationEnabled):r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=r.receiveGlobalIllumination=!1,r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.unlit?7:t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,t,r,i,o,a){let n=this._getMaterialVerticalOffset(t,r);null!=n&&(i=(0,d.Re)(sr,i,n),o=(0,d.Re)(lr,o,n)),a=function(e,t,r,i){let o=dt(t);if(!o)return e;let a=(0,d.oW)(gt,i,r);return(t,r,i,n)=>e(t,ht(o,a,r,i),i,n)}(a,this._configuration,i,o),(0,pe.Uy)(e,r,i,o,(0,Ze.ou)(r.verticalOffset),a)}intersectScreenPolygon(e,t,r,i){return function(e,t,r){return null==e?null:(e.renderDistance=function(e,t,r,i,o){let a=dt(r);return a?ht(a,(0,d.oW)(gt,o,i),e,t):e}(e.renderDistance,e.hasNormal?e.normal:null,t,r,e.point),e)}(Ae(e,r,t,i,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera.eye)}createGLMaterial(e){return new ar(e)}createBufferWriter(){return new Je(this._layout)}get transparent(){let{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:i,texture:o,textureId:a,textureAlphaMode:n,colorMixMode:s}=this.parameters,l=r[3];return e||t<1&&"replace"!==s||l<1&&"ignore"!==s||i<1||(null!=o||null!=a)&&1!==n&&2!==n&&"replace"!==s}_createScreenPolygonVertexDisplacement(e,t){let r=this._getMaterialVerticalOffset(e,t);return null==r?null:{applyToVertex:(e,t,i,o)=>(e[0]=t+r[0],e[1]=i+r[1],e[2]=o+r[2],e),applyToAabb:e=>((0,m.Ne)(e,(0,d.WQ)(fr,(0,m.pg)(e,fr),r)),(0,m.vI)(e,(0,d.WQ)(fr,(0,m.Lu)(e,fr),r)),e)}}_getMaterialVerticalOffset(e,t){if(null==this.parameters.verticalOffset)return null;let r=t.camera;(0,d.hZ)(dr,e[12],e[13],e[14]);let i=null;switch(t.viewingMode){case 1:i=(0,d.S8)(ur,dr);break;case 2:i=(0,d.C)(ur,cr)}let o=(0,d.Re)(hr,dr,r.eye),a=(0,d.Bw)(o),n=(0,d.hs)(o,o,1/a),s=null;this.parameters.screenSizePerspective&&(s=(0,d.Om)(i,n));let l=(0,me.kE)(r,a,this.parameters.verticalOffset,s??0,this.parameters.screenSizePerspective,null);return(0,d.hs)(i,i,l),(0,d.ei)(mr,i,t.transform.inverseRotation)}}class ar extends ae{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});let t=this._material.parameters;this.updateTexture(t.textureId);let r=e.camera.viewInverseTransposeMatrix;return(0,d.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?rr:Xt,e)}}class nr extends Yt{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!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 null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const sr=(0,h.vt)(),lr=(0,h.vt)(),cr=(0,h.fA)(0,0,1),ur=(0,h.vt)(),dr=(0,h.vt)(),hr=(0,h.vt)(),mr=(0,h.vt)(),fr=(0,h.vt)(),pr=()=>I.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class gr{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function vr(e){let t=e.params,r=t.topology,i=!0;switch(t.vertexAttributes||(pr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{let e=t.faces;if(e){if(t.vertexAttributes)for(let r in t.vertexAttributes){let t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(pr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(pr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(pr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else pr().warn("Indexed geometries must specify faces"),i=!1;break}default:pr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(pr().warn("Geometry requires material"),i=!1);let o=e.params.vertexAttributes;for(let e in o)o[e].values||(pr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function xr(e){let t=(0,m.Ie)();return e.forEach(e=>{let r=e.boundingInfo;null!=r&&(0,m.RF)(t,r.box)}),t}function _r(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function br(e){let t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const yr=new A.A(1,2,"wosr");async function wr(e,t){let s,w=function(e){let t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null==t[4]?null:Number(t[4])}:{fileType:e.match(/(.*\.(json|json\.gz))$/)?"wosr":"unknown",url:e,specifiedLodIndex:null}}((0,o.EM)(e));if("wosr"===w.fileType){let e=await(t.cache?t.cache.loadWOSR(w.url,t):async function(e,t){let r=await async function(e,t){let r=await(0,D.Ke)((0,C.A)(e,t));if(r.ok)return r.value.data;(0,F.QP)(r.error),function(e){throw new P.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){let r=[];for(let i in e){let o=e[i],a=o.images[0].data;if(!a){pr().warn("Externally referenced texture data is not yet supported");continue}let n=o.encoding+";base64,"+a,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==_r(l)},u=t?.disableTextures?Promise.resolve(null):(0,B.D)(n,t);r.push(u.then(e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l})))}let i=await Promise.all(r),o={};for(let e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t),o=0;for(let e in i)if(i.hasOwnProperty(e)){let t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return new gr(r,i,o+(0,O.Qh)(r))}(w.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){let r=[],i=[],o=[],a=new E,n=e.resource,s=A.A.parse(n.version||"1.0","wosr");yr.validate(s);let l=n.model.name,c=n.model.geometries,u=n.materialDefinitions??{},d=e.textures,m=0,f=new Map;for(let e=0;e<c.length;e++){let n=c[e];if(!vr(n))continue;let s=br(n),l=n.params.vertexAttributes,p=[],g=e=>{if("PerAttributeArray"===n.params.topology)return null;let t=n.params.faces;for(let r in t)if(r===e)return t[r].values;return null},v=l.position,x=v.values.length/v.valuesPerElement;for(let e in l){let t=l[e],r=t.values,i=g(e)??(0,R.tM)(x);p.push([e,new z.n(r,i,t.valuesPerElement,!0)])}let _=s.texture,b=d&&d[_];if(b&&!f.has(_)){let{image:e,parameters:t}=b,r=new ee.h(e,t);i.push(r),f.set(_,r)}let y=f.get(_),w=y?y.id:void 0,S=s.material,M=a.get(S,_);if(null==M){let e=u[S.slice(S.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);let r=b?_r(b.alphaChannelUsage):void 0,i={ambient:(0,h.ci)(e.diffuse),diffuse:(0,h.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:w,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:b?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),M=new or(i,t),a.set(S,_,M)}o.push(M);let T=new J(M,p);m+=p.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(T)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:xr(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}if(t.cache)s=await t.cache.loadGLTF(w.url,t,!!t.usePBR,!!t.useEmissive);else{let{loadGLTF:e}=await r.e(1698).then(()=>r(51698));s=await e(new _.R,w.url,t,t.usePBR,t.useEmissive)}let{engineResources:M,referenceBoundingBox:I}=function(e,t,r){let o=e.model,s=e.meta,_=o.meta?.ESRI_proxyEllipsoid,w=s.isEsriSymbolResource&&null!=_&&"EsriRealisticTreesStyle"===s.ESRI_webstyle;w&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){let i=e.model.lods[r];for(let o of i.parts){let i=o.attributes.normal;if(null==i)return;let a=o.attributes.position,n=a.count,s=(0,h.vt)(),u=(0,h.vt)(),m=(0,h.vt)(),f=new Float32Array(4*n),g=new Float32Array(3*n),v=(0,l.B8)((0,c.vt)(),o.transform),x=0,_=0;for(let l=0;l<n;l++){a.getVec(l,u),i.getVec(l,s),(0,d.Z0)(u,u,o.transform),(0,d.Re)(m,u,t.center),(0,d.Qr)(m,m,t.radius);let n=m[2],c=(0,d.Bw)(m),h=Math.min(.45+.55*c*c,1)**2.2;(0,d.Qr)(m,m,t.radius),null!==v&&(0,d.Z0)(m,m,v),(0,d.S8)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(n>-1?(0,d.Cc)(m,m,s,.2):(0,d.Cc)(m,m,s,Math.min(-4*n-3.8,1))),g[x]=m[0],g[x+1]=m[1],g[x+2]=m[2],x+=3,f[_]=h,f[_+1]=h,f[_+2]=h,f[_+3]=1,_+=4}o.attributes.normal=new p.xs(g.buffer),o.attributes.color=new p.Eq(f.buffer)}}}(e,_));let M=!!t.usePBR,C=s.isEsriSymbolResource?{usePBR:M,isSchematic:!1,treeRendering:w,mrrFactors:$t.SY}:{usePBR:M,isSchematic:!1,treeRendering:!1,mrrFactors:$t.mb},D={...t.materialParameters,treeRendering:w},P=[],I=new Map,O=new Map,E=o.lods.length,F=(0,m.Ie)();return o.lods.forEach((e,s)=>{let l=!0===t.skipHighLods&&(E>1&&0===s||E>3&&1===s)||!1===t.skipHighLods&&null!=r&&s!==r;if(l&&0!==s)return;let c=new T(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{let r=l?new or({},t):function(e,t,r,o,a,n,s,l,c){let d=e.materials.get(t.material);if(null==d)return null;let{normal:m,color:f,texCoord0:p,tangent:g}=t.attributes,v=t.material+(m?"_normal":"")+(f?"_color":"")+(p?"_texCoord0":"")+(g?"_tangent":""),x=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,b=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(d.alphaMode);if(!n.has(v)){if(x){let t=(t,r=!1,i=!1)=>{if(null!=t&&!s.has(t)){let o=e.textures.get(t);if(o){let e=o.data,a=r&&!(0,y.x3)(e)?l.compressionOptions:void 0;s.set(t,new ee.h((0,y.x3)(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&i,encoding:(0,y.x3)(e)?e.encoding:void 0,compressionOptions:a}))}}},r=1!==b&&!c;t(d.colorTexture,r,1!==b),t(d.normalTexture),t(d.occlusionTexture,!0),t(d.emissiveTexture),t(d.metallicRoughnessTexture,!0)}let r=(0,i.xV)(d.color[0]),m=(0,i.xV)(d.color[1]),f=(0,i.xV)(d.color[2]),p=null!=d.colorTexture&&x?s.get(d.colorTexture):null,g=(0,$t.Jr)(d),w=null==d.normalTextureTransform?.scale?u.Un:d.normalTextureTransform?.scale;n.set(v,new or({...o,customDepthTest:1,textureAlphaMode:b,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,m,f],ambient:[r,m,f],opacity:"OPAQUE"===d.alphaMode?1:d.opacity,doubleSided:d.doubleSided,doubleSidedType:"winding-order",cullFace:d.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:d.receiveShadows,receiveAmbientOcclusion:d.receiveAmbientOcclusion,unlit:d.unlit,textureId:p?.id,colorMixMode:d.colorMixMode,normalTextureId:null!=d.normalTexture&&x?s.get(d.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.occlusionTexture&&x?s.get(d.occlusionTexture).id:void 0,emissiveTextureId:null!=d.emissiveTexture&&x&&!d.unlit?s.get(d.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=d.metallicRoughnessTexture&&x?s.get(d.metallicRoughnessTexture).id:void 0,emissiveBaseColor:d.unlit?h.uY:[d.emissiveFactor[0],d.emissiveFactor[1],d.emissiveFactor[2]],emissiveStrengthKHR:null==d.emissiveStrengthKHR?1:d.emissiveStrengthKHR,emissiveStrengthFromSymbol:null==a.emissiveStrengthFromSymbol?void 0:a.emissiveStrengthFromSymbol,mrrFactors:g?$t.Bt:[d.metallicFactor,d.roughnessFactor,o.mrrFactors[2]],isSchematic:g,colorTextureTransformMatrix:S(d.colorTextureTransform),normalTextureTransformMatrix:S(d.normalTextureTransform),scale:[w[0],w[1]],occlusionTextureTransformMatrix:S(d.occlusionTextureTransform),emissiveTextureTransformMatrix:S(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(d.metallicRoughnessTextureTransform),...a},l))}let w=n.get(v);if(r.stageResources.materials.push(w),x){let e=e=>{null!=e&&r.stageResources.textures.push(s.get(e))};e(d.colorTexture),e(d.normalTexture),e(d.occlusionTexture),e(d.emissiveTexture),e(d.metallicRoughnessTexture)}return w}(o,e,c,C,D,I,O,t,w),{geometry:d,vertexCount:_}=function(e,t){let r=e.attributes.position.count,i=(0,b.x)(e.indices||r,e.primitiveType),o=f(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,g.t)(o,s,e.transform,3,l);let c=[["position",new z.n(o,i,3,!0)]];if(null!=e.attributes.normal){let t=f(3*r),{typedBuffer:o,typedBufferStride:s}=e.attributes.normal;(0,n.Ge)(Sr,e.transform),(0,g.b)(t,o,Sr,3,s),(0,a.or)(Sr)&&(0,g.n)(t,t),c.push(["normal",new z.n(t,i,3,!0)])}if(null!=e.attributes.tangent){let t=f(4*r),{typedBuffer:o,typedBufferStride:s}=e.attributes.tangent;(0,n.z0)(Sr,e.transform),(0,v.t)(t,o,Sr,4,s),(0,a.or)(Sr)&&(0,g.n)(t,t,4),c.push(["tangent",new z.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){let t=f(2*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.texCoord0;(0,x.a)(t,o,2,a),c.push(["uv0",new z.n(t,i,2,!0)])}let u=e.attributes.color;if(null!=u){let t=new Uint8Array(4*r);4===u.elementCount?u instanceof p.Eq?(0,v.b)(t,u,1,255):(u instanceof p.XP||u instanceof p.Uz)&&(0,v.b)(t,u,1/255,255):(t.fill(255),u instanceof p.xs?(0,g.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof p.eI||e.attributes.color instanceof p.nS)&&(0,g.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new z.n(t,i,4,!0)])}return{geometry:new J(t,c),vertexCount:r}}(e,r??new or({},t)),M=d.boundingInfo;null!=M&&0===s&&(0,m.RF)(F,M.box),null!=r&&(c.stageResources.geometries.push(d),c.numberOfVertices+=_)}),l||P.push(c)}),{engineResources:P,referenceBoundingBox:F}}(s,t,w.specifiedLodIndex);return{lods:M,referenceBoundingBox:I,isEsriSymbolResource:s.meta.isEsriSymbolResource,isWosr:!1}}const Sr=(0,s.vt)()},26857(e,t,r){var i=r(32198),o=r(69622),a=r(91429);let n=class extends o.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.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,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.UPDATING=!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,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,a.MZ)()],n.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"UPDATING",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),n=(0,i.Cg)([(0,a.$K)("esri.views.3d.support.debugFlags")],n);const s=new n;r.d(t,["b",0,s])},46686(e,t,r){r.d(t,{A7:()=>a,Y0:()=>o});var i=r(29941);class o extends i.v{constructor(e){super(),this.spherical=e,this.draped=!1}}function a(e){(function(e){e.varyings.add("linearDepth","float",{invariant:!0})})(e),e.vertex.code.add("void forwardLinearDepth(float _linearDepth) { linearDepth = _linearDepth; }")}},32680(e,t,r){r.d(t,{M:()=>o});var i=r(31821);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
|
|
651
|
+
fragBlur = b / w_total;`),e}const h=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}));r.d(t,["S",0,h])},43609(e,t,r){r.d(t,{a:()=>a,f:()=>n,n:()=>o});var i=r(34275);function o(e,t){a(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r=2,o=r){let a=t.length/2,n=0,s=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<a;++i)e[n]=t[s],e[n+1]=t[s+1],n+=r,s+=o;return}let l=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<a;++i)e[n]=Math.max(t[s]/l,-1),e[n+1]=Math.max(t[s+1]/l,-1),n+=r,s+=o;else for(let i=0;i<a;++i)e[n]=t[s]/l,e[n+1]=t[s+1]/l,n+=r,s+=o}function n(e,t,r,i){let o=e.typedBuffer,a=e.typedBufferStride,n=i?.count??e.count,s=(i?.dstIndex??0)*a;for(let e=0;e<n;++e)o[s]=t,o[s+1]=r,s+=a}Object.freeze(Object.defineProperty({__proto__:null,fill:n,normalizeIntegerBuffer:a,normalizeIntegerBufferView:o},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>d,b:()=>s,c:()=>o,d:()=>n,e:()=>h,f:()=>u,l:()=>c,n:()=>m,t:()=>a}),r(44208);var i=r(72727);function o(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,o=3,a=o){let n=(0,i.k)(e.length,o,3),s=(0,i.k)(t.length,a,3),l=Math.min(n,s),c=r[0],u=r[1],d=r[2],h=r[4],m=r[5],f=r[6],p=r[8],g=r[9],v=r[10],x=r[12],_=r[13],b=r[14],y=0,w=0;for(let r=0;r<l;r++){let r=t[y],i=t[y+1],n=t[y+2];e[w]=c*r+h*i+p*n+x,e[w+1]=u*r+m*i+g*n+_,e[w+2]=d*r+f*i+v*n+b,y+=a,w+=o}return e}function n(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,a=o){let n=(0,i.k)(e.length,o,3),s=(0,i.k)(t.length,a,3),l=Math.min(n,s),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],f=r[5],p=r[6],g=r[7],v=r[8],x=0,_=0;for(let r=0;r<l;r++){let r=t[x],i=t[x+1],n=t[x+2];e[_]=c*r+h*i+p*n,e[_+1]=u*r+m*i+g*n,e[_+2]=d*r+f*i+v*n,x+=a,_+=o}}function l(e,t,r,i=3,o=i){let a=Math.min(e.length/i,t.length/o),n=0,s=0;for(let l=0;l<a;l++)e[s]=r*t[n],e[s+1]=r*t[n+1],e[s+2]=r*t[n+2],n+=o,s+=i;return e}function c(e,t,r,i){u(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r,i,o=3,a=o){let n=Math.min(e.length/o,t.length/a),s=0,l=0,c=1/2.2;for(let u=0;u<n;u++)e[l]=i*(r*t[s])**c,e[l+1]=i*(r*t[s+1])**c,e[l+2]=i*(r*t[s+2])**c,s+=a,l+=o}function d(e,t,r,o=3,a=o){let n=(0,i.k)(e.length,o,3),s=(0,i.k)(t.length,a,3),l=Math.min(n,s),c=0,u=0;for(let i=0;i<l;i++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=a,u+=o;return e}function h(e,t){m(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function m(e,t,r=3,i=r){let o=Math.min(e.length/r,t.length/i),a=0,n=0;for(let s=0;s<o;s++){let o=t[a],s=t[a+1],l=t[a+2],c=o*o+s*s+l*l;if(c>0){let t=1/Math.sqrt(c);e[n]=t*o,e[n+1]=t*s,e[n+2]=t*l}a+=i,n+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:u,linearToSRGBView:c,normalize:m,normalizeView:h,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){let i=Math.min(e.count,t.count),o=e.typedBuffer,a=e.typedBufferStride,n=t.typedBuffer,s=t.typedBufferStride,l=0,c=0;for(let e=0;e<i;e++)o[c]=n[l]>>r,o[c+1]=n[l+1]>>r,o[c+2]=n[l+2]>>r,l+=s,c+=a},transformMat3:s,transformMat3View:n,transformMat4:a,transformMat4View:o,translate:d},Symbol.toStringTag,{value:"Module"}))},50867(e,t,r){r.d(t,{a:()=>o,b:()=>c,l:()=>l,n:()=>n,t:()=>a}),r(44208);var i=r(72727);function o(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,o=4,a=o){let n=(0,i.k)(e.length,o,4),s=(0,i.k)(t.length,a,4),l=Math.min(n,s),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],f=r[5],p=r[6],g=r[7],v=r[8],x=0,_=0;for(let r=0;r<l;r++){let r=t[x],i=t[x+1],n=t[x+2],s=t[x+3];e[_]=c*r+h*i+p*n,e[_+1]=u*r+m*i+g*n,e[_+2]=d*r+f*i+v*n,e[_+3]=s,x+=a,_+=o}}function n(e,t){let r=Math.min(e.count,t.count),i=e.typedBuffer,o=e.typedBufferStride,a=t.typedBuffer,n=t.typedBufferStride;for(let e=0;e<r;e++){let t=e*o,r=e*n,s=a[r],l=a[r+1],c=a[r+2],u=s*s+l*l+c*c;if(u>0){let e=1/Math.sqrt(u);i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function s(e,t,r,i=4){let o=Math.min(e.length/i,t.count),a=t.typedBuffer,n=t.typedBufferStride,s=0,l=0;for(let t=0;t<o;t++)e[l]=r*a[s],e[l+1]=r*a[s+1],e[l+2]=r*a[s+2],e[l+3]=r*a[s+3],s+=n,l+=i}function l(e,t,r,i){c(e.typedBuffer,t,r,i,e.typedBufferStride)}function c(e,t,r,i,o=4){let a=Math.min(e.length/o,t.count),n=t.typedBuffer,s=t.typedBufferStride,l=0,c=0,u=1/2.2;for(let t=0;t<a;t++)e[c]=i*(r*n[l])**u,e[c+1]=i*(r*n[l+1])**u,e[c+2]=i*(r*n[l+2])**u,e[c+3]=i*r*n[l+3],l+=s,c+=o}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:l,normalize:n,scale:s,scaleView:function(e,t,r){s(e.typedBuffer,t,r,e.typedBufferStride)},transformMat3:a,transformMat3View:o,transformMat4:function(e,t,r,o=4,a=o){let n=(0,i.k)(e.length,o,4),s=(0,i.k)(t.length,a,4),l=Math.min(n,s),c=r[0],u=r[1],d=r[2],h=r[3],m=r[4],f=r[5],p=r[6],g=r[7],v=r[8],x=r[9],_=r[10],b=r[11],y=r[12],w=r[13],S=r[14],M=r[15],T=0,C=0;for(let r=0;r<l;r++){let r=t[T],i=t[T+1],n=t[T+2],s=t[T+3];e[C]=c*r+m*i+v*n+y*s,e[C+1]=u*r+f*i+x*n+w*s,e[C+2]=d*r+p*i+_*n+S*s,e[C+3]=h*r+g*i+b*n+M*s,T+=a,C+=o}},transformMat4View:function(e,t,r){let o=e.typedBuffer,a=e.typedBufferStride,n=t.typedBuffer,s=t.typedBufferStride,l=(0,i.k)(o.length,a,4),c=(0,i.k)(n.length,s,4),u=Math.min(l,c),d=r[0],h=r[1],m=r[2],f=r[3],p=r[4],g=r[5],v=r[6],x=r[7],_=r[8],b=r[9],y=r[10],w=r[11],S=r[12],M=r[13],T=r[14],C=r[15];for(let e=0;e<u;e++){let t=e*a,r=e*s,i=n[r],l=n[r+1],c=n[r+2],u=n[r+3];o[t]=d*i+p*l+_*c+S*u,o[t+1]=h*i+g*l+b*c+M*u,o[t+2]=m*i+v*l+y*c+T*u,o[t+3]=f*i+x*l+w*c+C*u}}},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>o});var i=r(34727);class o{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return a(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+n(this.range,e-t,r)}minimalMonotonic(e,t,r){return a(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);let 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 a(e,t,r,i,o=0,a=!1){return(i-=o)<t?i+=n(e,t-i):i>r&&(i-=n(e,i-r)),a&&i===r&&(i=t),i+o}function n(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new o(0,2*Math.PI),l=(new o(-Math.PI,Math.PI),new o(0,360));r.d(t,["ie",0,l,"uC",0,s])},46140(e,t,r){r.d(t,{A:()=>o});var i=r(49186);class o{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)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){let 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 o(this.major,this.minor,this._context)}static parse(e,t=""){let[r,a]=e.split("."),n=/^\s*\d+\s*$/;if(!r?.match||!n.test(r)){let r=t&&t+":";throw new i.A(r+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e})}if(!a?.match||!n.test(a)){let r=t&&t+":";throw new i.A(r+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e})}return new o(parseInt(r,10),parseInt(a,10),t)}}},61473(e,t,r){function i(e){return e||=globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function o(e,t){return e?(t||=globalThis.location.hostname,t?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e):null}r.d(t,{EM:()=>o,b5:()=>i});const a=/^devext\.arcgis\.com$/,n=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,a,n,/^jsapps\.esri\.com$/,s,l]},18370(e,t,r){r.d(t,{z:()=>o});class i{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return this._promise??=this._import().then(async e=>(this.module=e,e)),this._promise}}function o(e){return new i(e)}},88340(e,t,r){function i(){return new Float32Array(2)}function o(e,t){let r=new Float32Array(2);return r[0]=e,r[1]=t,r}function a(){return i()}function n(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{fA:()=>o,vt:()=>i});const c=a(),u=n(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){let t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:o,ones:n,unitX:s,unitY:l,zeros:a},Symbol.toStringTag,{value:"Module"})),r.d(t,["Un",0,u,"uY",0,c])},69397(e,t,r){r.d(t,{Qf:()=>s,Qh:()=>a,lM:()=>o});var i=r(34275);function o(e){if(!e)return 0;let t=c;for(let r in e)e.hasOwnProperty(r)&&(t+=n(e[r],!1));return t}function a(e){if(!e)return 0;if("number"==typeof e[0])return s(e);if(Array.isArray(e))return function(e){let t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=u;for(let i=0;i<t;i++)r+=n(e[i]);return r}(e);let t=c;for(let r in e)e.hasOwnProperty(r)&&(t+=n(e[r]));return t}function n(e,t=!0){switch(typeof e){case"object":return t?a(e):c;case"string":return function(e){return 32+e.length}(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(...e){return e.reduce((e,t)=>e+(t?(0,i.iu)(t)?t.byteLength+d:Array.isArray(t)?l(t,16):0:0),0)}function l(e,t){return u+e.length*t}const c=32,u=16,d=145},65806(e,t,r){r.d(t,{g:()=>n});var i=r(51850),o=r(99917),a=r(9762);function n(e,t,r,i){if((0,o.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,a.projectBuffer)(s,e.spatialReference,0,t,r,0);let n=(0,o.tryProject)(e,r,i);return!!n&&(t[0]=n.x,t[1]=n.y,t[2]=n.z??0,!0)}const s=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>s});var i=r(99917),o=r(16930),a=r(9762),n=r(65806);function s(e,t,r,o){return!(null==t||null==o||e.length<2)&&((0,i.canProjectWithoutEngine)(t,o)?(0,a.projectBuffer)(e,t,0,r,o,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,n.g)(l,r,o)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:o.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>a,lC:()=>s,my:()=>n,tM:()=>d,uW:()=>o});var i=r(34275);function o(e){return a(e,!0)}function a(e,t){if(Array.isArray(e)){if(e.length<1024)return e}else if(e.length<1024)return Array.from(e);let r=!0,o=!0;return e.some((e,t)=>(r&&=0===e,o&&=e===t,!r&&!o)),r?function(e){if(1===e)return c;if(e<1024)return Array(e).fill(0);if(e>m.length){let t=Math.max(2*m.length,e);m=new Uint8Array(t)}return new Uint8Array(m.buffer,0,e)}(e.length):o?d(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(let 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 n(e,t=e){return e<=1024?Array(e):t<=65536?new Uint16Array(e):new Uint32Array(e)}function s(e,t,r){if(0===t.length)return e.slice();if(0===e.length)return t.slice();let i=n(e.length+t.length,r);for(let t=0;t<e.length;++t)i[t]=e[t];for(let r=0;r<t.length;++r)i[e.length+r]=t[r];return i}let l=h(131072);const c=[0],u=(()=>{let e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function d(e){return 1===e?c:e<1024?Array.from(new Uint16Array(u.buffer,0,e)):e<u.length?new Uint16Array(u.buffer,0,e):(e>l.length&&(l=h(Math.max(2*l.length,e))),new Uint32Array(l.buffer,0,e))}function h(e){let t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let m=new Uint8Array(65536)},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;let i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},65720(e,t,r){r.d(t,{C:()=>v,vt:()=>p,Qy:()=>g,ui:()=>x,ST:()=>M,bU:()=>C,pw:()=>S,m7:()=>_,ZU:()=>b,GH:()=>w,Pi:()=>y,LJ:()=>T,c8:()=>P});var i=r(4341),o=r(58083),a=r(35522),n=r(51850),s=r(78955),l=r(91829),c=r(70328),u=r(71351);function d(e){return e?{ray:(0,u.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,u.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>d());var h=r(27921);function m(e,t,r,i){let{t0:o,t1:a}=i,n=(0,h.mN)(e,t),s=(0,h.mN)(e,r);if(n>=0&&s>=0)return!1;if(n<0&&s>=0){let e=-n/(s-n);if(e<o)return!1;e<a&&(a=e)}else if(n>=0&&s<0){let e=n/(n-s);if(e>a)return!1;e>o&&(o=e)}return i.t0=o,i.t1=a,!0}var f=r(32114);function p(e){return e?[(0,h.vt)(e[0]),(0,h.vt)(e[1]),(0,h.vt)(e[2]),(0,h.vt)(e[3]),(0,h.vt)(e[4]),(0,h.vt)(e[5])]:[(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)()]}function g(){return[(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,n.vt)(),(0,n.vt)()]}function v(e,t){for(let r=0;r<O;r++)(0,h.C)(e[r],t[r]);return e}function x(e,t,r,i=R){let n=(0,o.lw)(f.Rc.get(),t,e);(0,o.B8)(n,n);for(let e=0;e<E;++e){let t=(0,s.Z0)(f.Km.get(),F[e],n);(0,a.hZ)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}!function(e,t){(0,h.Cr)(t[4],t[0],t[3],e[0]),(0,h.Cr)(t[1],t[5],t[6],e[1]),(0,h.Cr)(t[4],t[5],t[1],e[2]),(0,h.Cr)(t[3],t[2],t[6],e[3]),(0,h.Cr)(t[0],t[1],t[2],e[4]),(0,h.Cr)(t[5],t[4],t[7],e[5])}(r,i)}function _(e,t){return b(e,t.center,t.radius)}function b(e,t,r){for(let i=0;i<O;i++){let o=e[i];if(o[0]*t[0]+o[1]*t[1]+o[2]*t[2]+o[3]>=r)return!1}return!0}function y(e,t,r){for(let i of I)if((0,h.wE)(e[i],t,r))return!0;return!1}function w(e,t,r){let i=(0,c.gX)(t,B),o=(0,c.VL)(t)/2,n=(0,c.yr)(t)/2,s=(0,c.uJ)(t)/2;return r?function(e,t,r,i,o,n){let s=(0,a.Z0)(z,t,n);for(let t=0;t<O;t++){let a=e[t];if(a[0]*s[0]+a[1]*s[1]+a[2]*s[2]+a[3]-(Math.abs(a[0]*n[0]+a[1]*n[1]+a[2]*n[2])*r+Math.abs(a[0]*n[4]+a[1]*n[5]+a[2]*n[6])*i+Math.abs(a[0]*n[8]+a[1]*n[9]+a[2]*n[10])*o)>0)return!1}return!0}(e,i,o,n,s,r):function(e,t,r,i,o){for(let a=0;a<O;a++){let n=e[a];if(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]-(Math.abs(n[0])*r+Math.abs(n[1])*i+Math.abs(n[2])*o)>0)return!1}return!0}(e,i,o,n,s)}function S(e,t){return D(e,function(e,t=d()){return(0,u.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,A.get()))}function M(e,t,r){return D(e,function(e,t,r=d()){let i=(0,a.Bw)(e.vector);return(0,u.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,A.get()))}function T(e,t,r){return function(e,t,r,i){let o={t0:0,t1:1};for(let a of t)if(!m(e[a],r,i,o))return!1;return o.t0<o.t1}(e,I,t,r)}function C(e,t){for(let r=0;r<O;r++)if((0,h.mN)(e[r],t)>0)return!1;return!0}function D(e,t){for(let r=0;r<O;r++)if(!(0,h.$Q)(e[r],t))return!1;return!0}const I=[0,1,2,3,5],P={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]},O=6,E=8,F=[(0,l.fA)(-1,-1,-1,1),(0,l.fA)(1,-1,-1,1),(0,l.fA)(1,1,-1,1),(0,l.fA)(-1,1,-1,1),(0,l.fA)(-1,-1,1,1),(0,l.fA)(1,-1,1,1),(0,l.fA)(1,1,1,1),(0,l.fA)(-1,1,1,1)],A=new i.I(d),R=g(),B=(0,n.vt)(),z=(0,n.vt)()},52039(e,t,r){r.d(t,{O7:()=>h,el:()=>c});var i=r(69052),o=(r(49186),r(18370)),a=r(17676),n=(r(5443),r(39829)),s=(r(82799),r(16930)),l=(r(80754),r(21325));async function c(e,t,r){Array.isArray(e)||(e=[e]),"object"==typeof t&&t&&"authMode"in t&&(r=t);let i=null;for(let t of e)i??=t?.spatialReference;if(!i)return e;let o=(0,l.Vp)(i);if(!o)return e;if(1===e.length&&"extent"===e[0]?.type){let t=e[0].clone().normalizeAsSingleGeometry(o);return["xmin"in t?t:new n.A(t)]}let[s,c]=o.valid,h=!1;for(let t of e){if(!t)continue;if("point"===t.type){h||=t.x>=c,h||=t.x<=s;continue}let{extent:e}=t;if(null==e){h=!0;break}h||=e.xmin>=c,h||=e.xmin<=s,h||=e.xmax>=c,h||=e.xmax<=s}if(!h)return e;let[{foldInto360Range:m},f]=await(0,a.qr)(Promise.all([u.getImportPromise(),d.getImportPromise()]),r),p=f.fromSpatialReference(i);return e.map(e=>{if(null==e||"mesh"===e.type)return e;let t=f.fromGeometry(e),r=f.toGeometry(m(t,p),i);return"extent"===e.type&&1===r?.rings.length?r.extent:r})}const u=(0,o.z)(()=>r.e(4144).then(()=>r(4144)).then(e=>e.load().then(()=>e))),d=(0,o.z)(()=>Promise.all([r.e(9187),r.e(8885),r.e(9117),r.e(3299),r.e(1550)]).then(()=>r(78125)));function h(e,t,r){let i=(0,l.Vp)(r);if(null==i)return e;let[o,a]=i.valid,n=2*a,s=0,c=0;t>a?s=Math.ceil(Math.abs(t-a)/n):t<o&&(s=-Math.ceil(Math.abs(t-o)/n)),e>a?c=Math.ceil(Math.abs(e-a)/n):e<o&&(c=-Math.ceil(Math.abs(e-o)/n));let u=e+(s-c)*n,d=u-t;return d>a?u-=n:d<o&&(u+=n),u}function m(e){let t=(0,l.Vp)(e);if(null==t)return null;let[r,o]=t.valid;return new i.hr(r,o)}const f=m(s.A.WGS84);m(s.A.WebMercator),r.d(t,["Y_",0,f])},48295(e,t,r){r.d(t,{BU:()=>u,Ui:()=>s,cq:()=>c,k3:()=>d,rb:()=>h});var i=r(4341),o=r(35522),a=r(51850),n=r(11964);function s(e,t,r){let{direction:i,origin:a}=t,{p0:n,p1:s,p2:l}=e,c=s[0]-n[0],u=s[1]-n[1],d=s[2]-n[2],h=l[0]-n[0],m=l[1]-n[1],f=l[2]-n[2],p=i[1]*f-m*i[2],g=i[2]*h-f*i[0],v=i[0]*m-h*i[1],x=c*p+u*g+d*v;if(x>-1e-5&&x<1e-5)return!1;let _=1/x,b=a[0]-n[0],y=a[1]-n[1],w=a[2]-n[2],S=_*(b*p+y*g+w*v);if(S<0||S>1)return!1;let M=y*d-u*w,T=w*c-d*b,C=b*u-c*y,D=_*(i[0]*M+i[1]*T+i[2]*C);if(D<0||S+D>1)return!1;if(r){let e=_*(h*M+m*T+f*C);(0,o.hs)(r,i,e),(0,o.WQ)(r,a,r)}return!0}function l(e,t,r){let[i,o]=e,[a,n]=t,[s,l]=r;return.5*((a-i)*(l-o)-(n-o)*(s-i))}function c(e,t,r,i,o=0){let a=l(i,e,t),n=l(i,t,r),s=l(i,r,e);return!((a<-o||n<-o||s<-o)&&(a>o||n>o||s>o))}function u(e,t,r){return(0,o.Re)(m,t,e),(0,o.Re)(f,r,e),.5*(0,o.Bw)((0,o.$A)(m,m,f))}function d(e,t,r,i,a){(0,o.jb)(m,i,r),(0,o.jb)(p,a,r),(0,o.jb)(f,t,r);let n=(0,o.Om)(m,f),s=(0,o.Om)(p,f);if(n<=0&&s<=0)return void(0,o.C)(e,r);(0,o.jb)(f,t,i);let l=(0,o.Om)(m,f),c=(0,o.Om)(p,f);if(l>=0&&c<=l)return void(0,o.C)(e,i);let u=n*c-l*s;if(u<=0&&n>=0&&l<=0)return void(0,o.Ln)(e,r,m,n/(n-l));(0,o.jb)(f,t,a);let d=(0,o.Om)(m,f),h=(0,o.Om)(p,f);if(h>=0&&d<=h)return void(0,o.C)(e,a);let g=d*s-n*h;if(g<=0&&s>=0&&h<=0)return void(0,o.Ln)(e,r,p,s/(s-h));let v=l*h-d*c;if(v<=0&&c-l>=0&&d-h>=0)return(0,o.jb)(f,a,i),void(0,o.Ln)(e,i,f,(c-l)/(c-l+(d-h)));let x=1/(v+g+u);(0,o.C)(e,r),(0,o.Ln)(e,e,m,g*x),(0,o.Ln)(e,e,p,u*x)}function h(e,t,r,i){(0,o.jb)(m,r,t),(0,o.jb)(f,i,t),(0,o.$A)(e,m,f);let a=(0,o.Bw)(e);return 0!==a&&((0,o.hs)(e,e,1/a),!0)}r(32114),new i.I(n.vt),new i.I(()=>{return e?{p0:(0,a.o8)(e.p0),p1:(0,a.o8)(e.p1),p2:(0,a.o8)(e.p2)}:{p0:(0,a.vt)(),p1:(0,a.vt)(),p2:(0,a.vt)()};var e});const m=(0,a.vt)(),f=(0,a.vt)(),p=(0,a.vt)()},21015(e,t,r){r.d(t,{R:()=>l});var i=r(56507),o=r(60999),a=r(49186),n=r(17676),s=r(84952);class l{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,s.DB)(e)?((0,n.Te)(t),(0,s.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);let s=await(0,o.Ke)((0,i.A)(t,{responseType:e,...r}));if(s.ok)return s.value.data;throw(0,n.QP)(s.error),new a.A("gltf-loader-request-error",`Request for resource failed: ${s.error}`)}}},84498(e,t,r){r.d(t,{x:()=>n});var i=r(34275),o=r(97146),a=r(63907);function n(e,t){switch(t){case a.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,o.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case a.WR.TRIANGLE_STRIP:return function(e){let t="number"==typeof e?e:e.length;if(t<3)return[];let r=t-2,i=(0,o.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let o=0;o<r;o+=1)o%2==0?(i[t++]=e[o],i[t++]=e[o+1],i[t++]=e[o+2]):(i[t++]=e[o+1],i[t++]=e[o],i[t++]=e[o+2])}return i}(e);case a.WR.TRIANGLE_FAN:return function(e){let t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array;let r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}let o=e[0],a=e[1],n=0;for(let t=0;t<r;++t){let r=e[t+2];i[n++]=o,i[n++]=a,i[n++]=r,a=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>n,Xi:()=>o,pn:()=>s,x3:()=>a});var i=r(44208);class o{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function a(e){return"encoded-mesh-texture"===e?.type}async function n(e){let t=await new Blob([e]).text();return JSON.parse(t)}async function s(e,t){if("image/ktx2"===t)return new o(e);let r=new Blob([e],{type:t}),a=URL.createObjectURL(r);switch(t){case"image/jpeg":a+="#.jpg";break;case"image/png":a+="#.png"}let n=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{let r=()=>{o(),e(n)},i=e=>{o(),t(e)},o=()=>{URL.revokeObjectURL(a),n.removeEventListener("load",r),n.removeEventListener("error",i)};n.addEventListener("load",r),n.addEventListener("error",i),n.src=a});try{n.src=a,await n.decode()}catch{}return URL.revokeObjectURL(a),n}},24426(e,t,r){r.d(t,{fetch:()=>wr});var i=r(40876),o=r(61473),a=r(34727),n=r(77690),s=r(29242),l=r(58083),c=r(9093),u=r(48163),d=r(35522),h=r(51850),m=r(70328);function f(e,t=!1){return e<=1024?t?Array(e).fill(0):Array(e):new Float32Array(e)}var p=r(13030),g=r(73354),v=r(50867),x=r(43609),_=r(21015),b=r(84498),y=r(51530),w=r(88340);function S(e){if(null==e)return null;let t=null==e.offset?w.uY:e.offset,r=null==e.rotation?0:e.rotation,i=null==e.scale?w.Un:e.scale,o=(0,s.fA)(1,0,0,0,1,0,t[0],t[1],1),a=(0,s.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,s.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,s.vt)();return(0,n.lw)(c,a,l),(0,n.lw)(c,o,c),c}class M{constructor(){this.geometries=[],this.materials=[],this.textures=[]}}class T{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new M,this.numberOfVertices=0}}var C=r(56507),D=r(60999),I=r(49186),P=r(53966),O=r(69397);class E{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(let t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){let i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){let r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){let r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(let e of this._outer)yield e}*values(){for(let e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(let[e,t]of this._outer)for(let[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}clone(){let e=new E;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var F=r(17676),A=r(46140),R=r(97146),B=r(31217),z=r(46610),N=r(34275);function j(e){if(e.length<1024)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,N.LW)(e)?Float16Array.from(e):(0,N.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return(0,N.vZ)(e)?Float32Array.from(e):Uint32Array.from(e);default:return Float64Array.from(e)}}var L=r(15142),H=r(94008),W=r(620);class V{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this._readPosition=r,this._children=void 0,(0,W.vA)(e.length>=1);let i=e.length;$.clear();let o=(0,m.Ie)();for(let a=0;a<i;++a){let i=t*e[a];for(let e=0;e<t;++e){let t=i+e;$.push(t),(0,m.iT)(o,r(U,t))}}this.box=o;let a=new H.iy,n=(0,m.gX)(o,a.center),s=.5*Math.max((0,m.VL)(o),(0,m.yr)(o),(0,m.uJ)(o)),l=s*s;for(let e=0;e<$.length;++e){let t=r(U,$.at(e)),i=(0,d.Re)(t,t,n),o=(0,d.uE)(i);if(o<=l)continue;let a=Math.sqrt(o),c=.5*(a-s);s+=c,l=s*s;let u=c/a;(0,d.Ln)(n,n,i,u)}a.radius=s,this.sphere=a,$.clear()}get children(){if(this._children)return this._children;let e=this.box;if((0,m.TF)(e)<=1)return;let{_readPosition:t,_numIndexPerPrimitive:r,primitiveIndices:i}=this,o=(0,m.gX)(e,U),a=i.length,n=new Uint8Array(a),s=[0,0,0,0,0,0,0,0];for(let e=0;e<a;++e){let a=r*i[e],l=t(G,a);for(let e=1;e<r;++e)(0,d.jk)(l,l,t(k,a+e));let c=+(l[0]<o[0])|(l[1]<o[1]?2:0)|(l[2]<o[2]?4:0);n[e]=c,++s[c]}let l=0;for(let e=0;e<8;++e)s[e]>0&&++l;if(l<2)return;let c=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let e=0;e<8;++e)s[e]>0&&(c[e]=new Uint32Array(s[e]));s.fill(0);for(let e=0;e<a;++e){let t=n[e];c[t][s[t]++]=i[e]}let u=[];for(let e=0;e<8;++e){let i=c[e];void 0!==i&&u.push(new V(i,r,t))}return this._children=u,this._children}static prune(){$.prune()}}const U=(0,h.vt)(),G=(0,h.vt)(),k=(0,h.vt)(),$=new L.A({deallocator:null});var Z=r(24326);class q{constructor(e){this.id=(0,Z.c)(),this.type=0,this._attributes=new Map;for(let[t,r]of e)this._attributes.set(t,{...r,indices:(0,R.Dg)(r.indices)})}get attributes(){return this._attributes}}class Y{constructor(){this.uid=(0,Z.c)()}}class X extends Y{constructor(e){super(),this.highlightName=e,this.channel=0}}var K=r(94656);class J extends q{constructor(e,t,r=null,i=-1,o,a){super(t),this.material=e,this.mapPositions=r,this.edgeIndicesLength=i,this.baseGeometry=o,this.drawIndices=a,this._readPrimitivePosition=null,this._vertexPositionIndicesCache=void 0,this._transformation=void 0,this.localOrigin=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0,this._boundingInfo=null,(0,W.vA)((e?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match"),this.edgeIndicesLength<0&&(this.edgeIndicesLength=this.indexCount)}get readPrimitivePosition(){return this._readPrimitivePosition??=function(e,t){let{data:r,indices:i,size:o,stride:a}=e;return(0,W.vA)(2===o||3===o||4===o,"Position attribute must have 2, 3 or 4 components"),2===o?null==t?(e,t)=>{let o=i[t]*a;return e[0]=r[o],e[1]=r[o+1],e[2]=-2,e}:(e,o)=>{let n=i[t[o]]*a;return e[0]=r[n],e[1]=r[n+1],e[2]=-2,e}:null==t?function(e,t,r){return(i,o)=>{let a=t[o]*r;return i[0]=e[a],i[1]=e[a+1],i[2]=e[a+2],i}}(r,i,a):(e,o)=>{let n=i[t[o]]*a;return e[0]=r[n],e[1]=r[n+1],e[2]=r[n+2],e}}(this.positionAttribute,this.drawIndices),this._readPrimitivePosition}_invalidateReadPrimitivePosition(){this._readPrimitivePosition=null}instantiate(e={}){let t=new J(e.material||this.material,[],this.mapPositions,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);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}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:j(t.data)},this._attributes.set(e,t),"position"===e&&this._invalidateReadPrimitivePosition()),t}setAttributeData(e,t){let r=this._attributes.get(e);r?(this._attributes.set(e,{...r,exclusive:!0,data:t}),"position"===e&&this._invalidateReadPrimitivePosition()):(0,K.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){return void 0===this._vertexPositionIndicesCache&&(this._vertexPositionIndicesCache=this._computePrimitivePositionIndices()),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){let{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){let r=[];for(let i of e)r.push(t.indices[i]);return r}return t?.indices??null}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){return(this.drawIndices??this.positionAttribute?.indices)?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!this.material.computeAttachmentOrigin(e,this.readPrimitivePosition,this.indexCount)&&(null!=this._transformation&&(0,d.Z0)(e,e,this._transformation),!0)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){let e=this.positionAttribute,t=this.indexCount;if(!e||0===t)return null;let r=this.material.primitiveVertexCount;(0,W.vA)(t%r===0,"Indexing error: "+t+" not divisible by "+r);let i=(0,R.tM)(t/r);return new V(i,r,this.readPrimitivePosition)}get transformation(){return this._transformation??c.zK}set transformation(e){this._transformation=e&&e!==c.zK?(0,c.o8)(e):null}get highlights(){return this._highlights||Q}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}forEachHighlightOption(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){let t=new X(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);let{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)){let{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const Q=new Set;var ee=r(46859),te=r(49255),re=r(97768);class ie{constructor(e){this._material=e.material,this._techniques=e.techniques}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(t))}ensureResources(e){return 2}}var oe=r(65786);class ae extends ie{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,re.Gz)(this._texture),this._textureNormal=(0,re.Gz)(this._textureNormal),this._textureEmissive=(0,re.Gz)(this._textureEmissive),this._textureOcclusion=(0,re.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,re.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new se(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){(null==this._texture||e!==this._texture.id)&&(this._texture=(0,re.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);let r=this._textures.acquire(e);(0,F.$X)(r)?(++this._numLoading,r.then(e=>{this._disposed?((0,re.Gz)(e),t(null)):t(e)}).finally(()=>--this._numLoading)):t(r)}}class ne extends oe.Y{constructor(e=null){super(),this.textureEmissive=e}}class se extends ne{constructor(e,t,r,i,o,a,n){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=o,this.scale=a,this.normalTextureTransformMatrix=n}}var le=r(48295);const ce=(0,h.vt)(),ue=(0,h.vt)(),de=(0,h.vt)(),he=(0,h.vt)();var me=r(19245);class fe{constructor(e,t){this.id=(0,Z.c)(),this.supportsEdges=!1,this.primitiveVertexCount=3,this._renderPriority=0,this._parameters=new t,(0,me.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,me.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 testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get emissions(){return 0}getConfiguration(e){return this.updateConfiguration(e),this._configuration}updateConfiguration(e){this._configuration.output=e.output,this._configuration.hasEmission=e.hasEmission&&(0,te._o)(e.output),this._configuration.hasHighlightMixTexture=10===e.output&&null!=e.highlightMixTexture,this._configuration.useFloatBlend=e.useFloatBlend.value,this._configuration.emissionDimmingPass=e.transparentWithoutDepthEmissionDimmingPass&&(0,te._o)(e.output)}computeAttachmentOrigin(e,t,r){return function(e,t,r){if(r<=0)return!1;(0,d.hZ)(e,0,0,0),(0,d.hZ)(he,0,0,0);let i=0,o=0;for(let a=0;a<r;++a){let r=3*a;t(ce,r),t(ue,r+1),t(de,r+2);let n=(0,le.BU)(ce,ue,de);n?((0,d.WQ)(ce,ce,ue),(0,d.WQ)(ce,ce,de),(0,d.hs)(ce,ce,1/3*n),(0,d.WQ)(e,e,ce),i+=n):((0,d.WQ)(he,he,ce),(0,d.WQ)(he,he,ue),(0,d.WQ)(he,he,de),o+=3)}return!(0===o&&0===i||(0===i?0===o||((0,d.hs)(e,he,1/o),0):((0,d.hs)(e,e,1/i),0)))}(e,t,r/3)}}oe.Y;var pe=r(58682),ge=r(90629),ve=r(65720),xe=r(27921),_e=r(19419),be=r(11964);function ye(e,t){return e.isRectangle?(0,_e.Uc)(e.bounds,t):function(e,t){return Se(e[0],e[1],t)}(t,e.points)}function we(e,t,r,i){let o=Math.min(t[0],r[0],i[0]),a=Math.min(t[1],r[1],i[1]),n=Math.max(t[0],r[0],i[0]),s=Math.max(t[1],r[1],i[1]);if(!function(e,t){if(!(0,_e.HY)(e.bounds,t))return!1;if(e.isRectangle)return!0;for(let r of e.points)if((0,_e.Uc)(t,r))return!0;if(function(e,t){let r=e[0],i=e[1],o=e[2],a=e[3];return Se(r,i,t)||Se(o,i,t)||Se(o,a,t)||Se(r,a,t)}(t,e.points))return!0;for(let r=0;r<e.points.length;r++)if(Me(e.points[r],r===e.points.length-1?e.points[0]:e.points[r+1],t))return!0;return!1}(e,(0,_e.fA)(o,a,n,s,Oe)))return!1;if(ye(e,t)||ye(e,r)||ye(e,i))return!0;for(let o of e.points)if((0,le.cq)(t,r,i,o,Ee))return!0;for(let o=0;o<e.points.length;o++){let a=e.points[o],n=e.points[(o+1)%e.points.length];if(Ce(t,r,a,n)||Ce(r,i,a,n)||Ce(i,t,a,n))return!0}return!1}function Se(e,t,r){let i=!1;for(let o=0,a=r.length-1;o<r.length;a=o++){let n=r[o],s=r[a];n[1]>t!=s[1]>t&&e<(s[0]-n[0])*(t-n[1])/(s[1]-n[1])+n[0]&&(i=!i)}return i}function Me(e,t,r){let i=r[0],o=r[1],a=r[2],n=r[3],s=e[0],l=e[1],c=t[0],u=t[1];return!(s<i&&c<i||s>a&&c>a||l<o&&u<o||l>n&&u>n)&&(!(!(0,_e.Rj)(r,s,l)&&!(0,_e.Rj)(r,c,u))||Te(e,t,i,o,a,o)||Te(e,t,a,o,a,n)||Te(e,t,a,n,i,n)||Te(e,t,i,n,i,o))}function Te(e,t,r,i,o,a){let n=De(e[0],e[1],t[0],t[1],r,i),s=De(e[0],e[1],t[0],t[1],o,a),l=De(r,i,o,a,e[0],e[1]),c=De(r,i,o,a,t[0],t[1]);return n!==s&&l!==c||0===n&&Ie(e,t,r,i)||0===s&&Ie(e,t,o,a)||0===l&&Pe(r,i,o,a,e[0],e[1])||0===c&&Pe(r,i,o,a,t[0],t[1])}function Ce(e,t,r,i){return Te(e,t,r[0],r[1],i[0],i[1])}function De(e,t,r,i,o,a){let n=(i-t)*(o-r)-(r-e)*(a-i);return Math.abs(n)<=Ee?0:Math.sign(n)}function Ie(e,t,r,i){return Pe(e[0],e[1],t[0],t[1],r,i)}function Pe(e,t,r,i,o,a){return o>=Math.min(e,r)-Ee&&o<=Math.max(e,r)+Ee&&a>=Math.min(t,i)-Ee&&a<=Math.max(t,i)+Ee}const Oe=(0,_e.vt)(),Ee=((0,ge.r_)(),(0,ge.r_)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,be.vt)(),1e-9);class Fe{constructor(e){this.type=e,this.distance=1/0,this.renderDistance=1/0,this.primitiveIndex=0,this.hasNormal=!1,this.point=(0,h.vt)(),this.normal=(0,h.vt)()}reset(){this.distance=1/0,this.renderDistance=1/0,this.hasNormal=!1}update(e,t,r,i,o=e){this.distance=e,this.renderDistance=o,this.primitiveIndex=t,(0,d.C)(this.point,r),this.hasNormal=null!=i,null!=i&&(0,d.C)(this.normal,i)}updateIfCloserFromValues(e,t,r,i,o=e){o<this.renderDistance&&this.update(e,t,r,i,o)}updateIfCloser(e){let{distance:t,renderDistance:r,primitiveIndex:i,point:o,normal:a}=e;this.updateIfCloserFromValues(t,i,o,e.hasNormal?a:null,r)}get valid(){return Number.isFinite(this.distance)}}function Ae(e,t,r,i,o){if(!e.visible)return null;let a,n=new Fe(4);a=e.boundingInfo?Be(e.readPrimitivePosition,e.boundingInfo,t,r,i,o):Re(t,r,i,0,e.faceCount,e.readPrimitivePosition,o,null,0);for(let e of a)n.updateIfCloser(e);return n.valid?n:null}function*Re(e,t,r,i,o,a,n,s=null,l=0){if(null==e.camera)return;let{camera:c,screenPolygonPrimitiveProcessor:u}=e;for(let e=i;e<o;++e){let i=(s?.[e]??e)+l,o=null==s?i:e,h=3*i;ze(He[0],a,h+0,n,o,t),ze(He[1],a,h+1,n,o,t),ze(He[2],a,h+2,n,o,t);let m,f=Ge;$e.reset();let p=We;for(let e of u.processTriangle(He))if(p.length=0,(0,xe.H)(c.frustum[4],e,()=>p.pushNew(),!1),!(p.length<3)){for(let e=0;e<p.length;e++)c.projectToScreen(p.at(e),Ve[e]);Ne(r,Ve,p.length)&&(je(c.eye,p,Ue),m??=(0,le.rb)(Ge,He[0],He[1],He[2]),$e.updateIfCloserFromValues((0,d.Io)(c.eye,Ue),i,Ue,m?f:null))}$e.valid&&(yield $e)}}function*Be(e,t,r,i,o,a){let n;if(null==a?n=(0,ve.GH)(o.broadPhaseFrustum,t.box,i):((0,m.C)(Le,t.box),a.applyToAabb(Le),n=(0,ve.GH)(o.broadPhaseFrustum,Le,i)),!n)return;let{primitiveIndices:s}=t,l=s.length;if(l>1e3){let n=t.children;if(void 0!==n){for(let t of n)yield*Be(e,t,r,i,o,a);return}}yield*Re(r,i,o,0,l,e,a,s,0)}function ze(e,t,r,i,o,a){let[n,s,l]=t(e,r);null==i?(0,d.hZ)(e,n,s,l):i.applyToVertex(e,n,s,l,o),a&&(0,d.Z0)(e,e,a)}function Ne(e,t,r){for(let i=1;i<r-1;i++)if(we(e,t[0],t[i],t[i+1]))return!0;return!1}function je(e,t,r){let i=1/0,o=t.at(0);for(let a=1;a<t.length-1;a++){(0,le.k3)(ke,e,o,t.at(a),t.at(a+1));let n=(0,d.hG)(e,ke);n<i&&(i=n,(0,d.C)(r,ke))}}const Le=(0,m.vt)(),He=[(0,h.vt)(),(0,h.vt)(),(0,h.vt)()],We=new L.A({allocator:e=>e??(0,h.vt)()}),Ve=Array.from({length:12},()=>(0,ge.gs)()),Ue=(0,h.vt)(),Ge=(0,h.vt)(),ke=(0,h.vt)(),$e=new Fe(4);var Ze=r(16396);function qe(e,t,r){let{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length;r*=n;for(let e=0;e<s;++e){let t=2*o[e];a[r]=i[t],a[r+1]=i[t+1],r+=n}}function Ye(e,t,r,i=1){let{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,1===i)for(let e=0;e<l;++e){let t=3*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){let t=3*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}}function Xe(e,t,r,i,o=1){let{data:a,indices:n}=e,s=r.typedBuffer,l=r.typedBufferStride,c=n.length;if(i*=l,t===a.length&&4===t){s[i]=a[0],s[i+1]=a[1],s[i+2]=a[2],s[i+3]=a[3];let e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,n=e[i/=4];i+=t;let u=c*o;for(let r=1;r<u;++r)e[i]=n,i+=t}else if(1===o){if(4===t){for(let e=0;e<c;++e){let t=4*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}return}for(let e=0;e<c;++e){let t=3*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}}else if(4===t)for(let e=0;e<c;++e){let t=4*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}else for(let e=0;e<c;++e){let t=3*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}}function Ke(e,t,r,i,o,a){switch(e){case"position":{(0,W.vA)(3===t.size);let i=o.getField(e,p.xs);(0,W.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void Ye(e,r,i,o);let{data:a,indices:n}=e,s=r.typedBuffer,c=r.typedBufferStride,u=n.length,d=t[0],h=t[1],m=t[2],f=t[4],p=t[5],g=t[6],v=t[8],x=t[9],_=t[10],b=t[12],y=t[13],w=t[14];i*=c;let S=0,M=0,T=0,C=(0,l.tZ)(t)?e=>{S=a[e]+b,M=a[e+1]+y,T=a[e+2]+w}:e=>{let t=a[e],r=a[e+1],i=a[e+2];S=d*t+f*r+v*i+b,M=h*t+p*r+x*i+y,T=m*t+g*r+_*i+w};if(1===o)for(let e=0;e<u;++e)C(3*n[e]),s[i]=S,s[i+1]=M,s[i+2]=T,i+=c;else for(let e=0;e<u;++e){C(3*n[e]);for(let e=0;e<o;++e)s[i]=S,s[i+1]=M,s[i+2]=T,i+=c}}(t,r,i,a);break}case"normal":{(0,W.vA)(3===t.size);let r=o.getField(e,p.xs);(0,W.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void Ye(e,r,i,o);let{data:a,indices:n}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,d=n.length,h=s[0],m=s[1],f=s[2],p=s[4],g=s[5],v=s[6],x=s[8],_=s[9],b=s[10],y=!(0,l.ut)(s),w=1e-6,S=.999999;i*=u;let M=0,T=0,C=0,D=(0,l.tZ)(s)?e=>{M=a[e],T=a[e+1],C=a[e+2]}:e=>{let t=a[e],r=a[e+1],i=a[e+2];M=h*t+p*r+x*i,T=m*t+g*r+_*i,C=f*t+v*r+b*i};if(1===o)if(y)for(let e=0;e<d;++e){D(3*n[e]);let t=M*M+T*T+C*C;if(t<S&&t>w){let e=1/Math.sqrt(t);c[i]=M*e,c[i+1]=T*e,c[i+2]=C*e}else c[i]=M,c[i+1]=T,c[i+2]=C;i+=u}else for(let e=0;e<d;++e)D(3*n[e]),c[i]=M,c[i+1]=T,c[i+2]=C,i+=u;else for(let e=0;e<d;++e){if(D(3*n[e]),y){let e=M*M+T*T+C*C;if(e<S&&e>w){let t=1/Math.sqrt(e);M*=t,T*=t,C*=t}}for(let e=0;e<o;++e)c[i]=M,c[i+1]=T,c[i+2]=C,i+=u}}(t,i,r,a);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,W.vA)(2===t.size);let r=o.getField(e,p.mJ);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,a);break}case"uv0":{(0,W.vA)(2===t.size);let r=o.getField(e,p.ZD)??o.getField(e,p.gH);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,a);break}case"uvi":{(0,W.vA)(2===t.size);let r=o.getField(e,p.mJ);(0,W.vA)(!!r,`No buffer view for ${e}`),qe(t,r,a);break}case"color":case"symbolColor":{let r=o.getField(e,p.XP);(0,W.vA)(!!r,`No buffer view for ${e}`),(0,W.vA)(3===t.size||4===t.size),Xe(t,t.size,r,a);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{let r=o.getField(e,p.Y$)??o.getField(e,p.Y$);(0,W.vA)(!!r,`No buffer view for ${e}`),(0,W.vA)(1===t.size),function(e,t,r){let{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length,l=i[0];r*=n;for(let e=0;e<s;++e)a[r]=l,r+=n}(t,r,a);break}case"tangent":{(0,W.vA)(4===t.size);let i=o.getField(e,p.Eq);(0,W.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,o=1){if(!t)return void function(e,t,r,i=1){let{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,1===i)for(let e=0;e<l;++e){let t=4*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){let t=4*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}}(e,r,i,o);let{data:a,indices:n}=e,s=t,c=r.typedBuffer,u=r.typedBufferStride,d=n.length,h=s[0],m=s[1],f=s[2],p=s[4],g=s[5],v=s[6],x=s[8],_=s[9],b=s[10],y=!(0,l.ut)(s),w=1e-6,S=.999999;if(i*=u,1===o)for(let e=0;e<d;++e){let t=4*n[e],r=a[t],o=a[t+1],s=a[t+2],l=a[t+3],d=h*r+p*o+x*s,M=m*r+g*o+_*s,T=f*r+v*o+b*s;if(y){let e=d*d+M*M+T*T;if(e<S&&e>w){let t=1/Math.sqrt(e);d*=t,M*=t,T*=t}}c[i]=d,c[i+1]=M,c[i+2]=T,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){let t=4*n[e],r=a[t],s=a[t+1],l=a[t+2],d=a[t+3],M=h*r+p*s+x*l,T=m*r+g*s+_*l,C=f*r+v*s+b*l;if(y){let e=M*M+T*T+C*C;if(e<S&&e>w){let t=1/Math.sqrt(e);M*=t,T*=t,C*=t}}for(let e=0;e<o;++e)c[i]=M,c[i+1]=T,c[i+2]=C,c[i+3]=d,i+=u}}(t,r,i,a);break}case"olidColor":(0,W.vA)(4===t.size),Xe(t,4,o.getField(e,p.XP),a)}}(0,h.vt)();class Je{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i){null!=i&&function(e,t,r,i,o){let{buffer:a,offset:n}=o;for(let o of t.fields.keys()){let t=e.get(o),s=t?.indices;t&&s&&Ke(o,t,r,i,a,n)}}(r,this.layout,e,t,i)}}const Qe=at(-1),et=at(1),tt=Qe,rt=[];rt[0]=null,rt[1]=et,rt[2]=Qe,rt[3]=at(-2),rt[4]=at(-3);const it=rt.map(e=>function(e,t){return t?{factor:e.factor+t.factor,units:e.units+t.units}:e}(tt,e));function ot({output:e,enableOITOffset:t,polygonOffset:r}){return(0,te._$)(e)&&t?it[r]:rt[r]}function at(e){return{factor:1*e,units:2*e}}rt[1]=et;var nt=r(32198),st=r(51976),lt=r(34711);class ct extends lt.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,nt.Cg)([(0,st.W)()],ct.prototype,"hasHighlightMixTexture",void 0),(0,nt.Cg)([(0,st.W)()],ct.prototype,"emissionDimmingPass",void 0);class ut extends ct{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}function dt(e){return mt.output=+!!e.transparent,mt.polygonOffset=e.polygonOffset,mt.enableOITOffset=e.enableOITOffset,ot(mt)}function ht({units:e,factor:t},r,i,o){let a=pt*e;return i+((o?1-Math.abs((0,d.Om)(r,o)):0)*t*ft+a)}(0,nt.Cg)([(0,st.W)({count:5})],ut.prototype,"polygonOffset",void 0),(0,nt.Cg)([(0,st.W)()],ut.prototype,"transparent",void 0),(0,nt.Cg)([(0,st.W)()],ut.prototype,"enableOITOffset",void 0);const mt=new ut,ft=2e-5,pt=2e-6,gt=(0,h.vt)();var vt=r(91429),xt=r(91829),_t=r(4431),bt=r(1843),yt=r(72824),wt=r(13840),St=r(42958),Mt=r(16943),Tt=r(90644);const Ct=(0,Tt.p3)(1,0,1,771);function Dt(e,t=!1,r=!1){if(r)return Tt.uR;switch(e){case 0:return t?Tt.RC:Tt.T8;case 1:return Ct;default:return null}}function It(e){if(e.draped)return null;switch(e.output){case 0:case 2:default:return e.writeDepth?Tt.Uy:null;case 1:return null}}function Pt(e,t=513){return{func:(0,te._$)(e)?515:t}}(0,xt._Y)();const Ot={mask:255},Et=(0,Tt.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:0}),Ft=(0,Tt.nk)(2,2,{compare:519,fail:7680,zFail:7680,zPass:7681});(0,Tt.nk)(2,2,{compare:514,fail:7680,zFail:7680,zPass:7680}),(0,Tt.nk)(2,2,{compare:517,fail:7680,zFail:7680,zPass:7680}),r(4576),r(66289);var At=r(69622),Rt=r(65529),Bt=r(32728);class zt{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",p.Eq),this.color=e.getField("instanceColor",p.XP),this.olidColor=e.getField("instanceOlidColor",p.XP),this.state=e.getField("state",p.SL),this.lodLevel=e.getField("lodLevel",p.SL)}}let Nt=class extends At.A{constructor(e,t){super(e),this.events=new Rt.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return Lt(jt.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=Gt,this._buffer=this._layout.createBuffer(this._capacity),this._view=new zt(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();let e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){let t=this._view.state;(0,W.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){let t=this._view.state;(0,W.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){let t=this._view,r=Ht,i=Wt;t.localTransform.getMat(e,Vt),t.globalTransform.getMat(e,Ut);let o=(0,l.lw)(Ut,Ut,Vt);(0,d.hZ)(r,o[12],o[13],o[14]),t.modelOrigin.setVec(e,r),(0,n.z0)(i,o),t.model.setMat(e,i);let a=(0,Bt.wp)(Ht,o);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,n.B8)(i,i),(0,n.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){let r=this._view;r.model.getMat(e,Wt),r.modelOrigin.getVec(e,Ht),t[0]=Wt[0],t[1]=Wt[1],t[2]=Wt[2],t[3]=0,t[4]=Wt[3],t[5]=Wt[4],t[6]=Wt[5],t[7]=0,t[8]=Wt[6],t[9]=Wt[7],t[10]=Wt[8],t[11]=0,t[12]=Ht[0],t[13]=Ht[1],t[14]=Ht[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(Ht,this,e),t*=Math.max(Ht[0],Ht[1],Ht[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Ht,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Ht[0],Ht[1],Ht[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){let{_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){let t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){let 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){let r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){let 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(Gt,Math.floor(1.5*this._capacity)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new zt(this._buffer)}_findSlot(){let e=this._view.state,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,nt.Cg)([(0,vt.MZ)({constructOnly:!0})],Nt.prototype,"shaderTransformation",void 0),(0,nt.Cg)([(0,vt.MZ)()],Nt.prototype,"_size",void 0),(0,nt.Cg)([(0,vt.MZ)({readOnly:!0})],Nt.prototype,"size",null),Nt=(0,nt.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],Nt);const jt=(0,bt.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function Lt(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Mt.E)()&&e.vec4u8("instanceOlidColor"),e}const Ht=(0,h.vt)(),Wt=(0,s.vt)(),Vt=(0,c.vt)(),Ut=(0,c.vt)(),Gt=64,kt=(0,bt.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var $t=r(74810),Zt=r(28491),qt=r(49788);class Yt extends yt.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=$t.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.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=h.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,h.CN)(.2,.2,.2),this.diffuse=(0,h.CN)(.8,.8,.8),this.externalColor=(0,xt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,h.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=qt.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}yt.gy;let Xt=class extends St.w{constructor(e,t){let i=(0,_t.U)(Qt(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,_t.U)(function(e){return Lt(kt.clone(),e)}(t)))),super(e,t,i),this.shader=new wt.r(Zt.D,()=>r.e(5141).then(()=>r(5141))),this.ignoreUnused=!0}_makePipeline(e,t){let{output:r,transparent:i,cullFace:o,customDepthTest:a,hasOccludees:n}=e;return(0,Tt.Ey)({blending:i?Dt(r,!1,e.emissionDimmingPass):null,culling:Jt(e)?(0,Tt.Xt)(o):null,depthTest:Pt(r,Kt(a)),depthWrite:It(e),colorWrite:Tt.kn,stencilWrite:n?Ot:null,stencilTest:n?t?Ft:Et:null,polygonOffset:ot(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t,r){return r?this._occludeePipelineState:super.getPipeline(e,t,r)}};function Kt(e){switch(e){case 1:return 515;case 0:case 4:return 513;case 2:return 516;case 3:return 514}}function Jt(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Qt(e){let t=(0,bt.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",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,Mt.E)()&&t.vec4u8("olidColor"),t}Xt=(0,nt.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],Xt);class er extends ut{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.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1,this.renderOccluded=!1}get textureCoordinateType(){return+!!this.hasTextures}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}}(0,nt.Cg)([(0,st.W)({count:4})],er.prototype,"alphaDiscardMode",void 0),(0,nt.Cg)([(0,st.W)({count:3})],er.prototype,"doubleSidedMode",void 0),(0,nt.Cg)([(0,st.W)({count:8})],er.prototype,"pbrMode",void 0),(0,nt.Cg)([(0,st.W)({count:3})],er.prototype,"cullFace",void 0),(0,nt.Cg)([(0,st.W)({count:3})],er.prototype,"normalType",void 0),(0,nt.Cg)([(0,st.W)({count:4})],er.prototype,"customDepthTest",void 0),(0,nt.Cg)([(0,st.W)({count:8})],er.prototype,"emissionSource",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasVertexColors",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasSymbolColors",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasVerticalOffset",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasColorTexture",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasMetallicRoughnessTexture",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasOcclusionTexture",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasNormalTexture",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasScreenSizePerspective",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasVertexTangents",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasOccludees",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"instanced",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"instancedDoublePrecision",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasModelTransformation",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"offsetBackfaces",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasVVSize",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasVVColor",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"receiveShadows",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasShadowHighlights",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"receiveAmbientOcclusion",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"receiveGlobalIllumination",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"textureAlphaPremultiplied",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"instancedFeatureAttribute",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"instancedColor",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"writeDepth",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"snowCover",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasColorTextureTransform",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasEmissionTextureTransform",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasNormalTextureTransform",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasOcclusionTextureTransform",void 0),(0,nt.Cg)([(0,st.W)()],er.prototype,"hasMetallicRoughnessTextureTransform",void 0);var tr=r(57323);let rr=class extends Xt{constructor(){super(...arguments),this.shader=new wt.r(tr.R,()=>r.e(9933).then(()=>r(39933)))}};rr=(0,nt.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],rr);class ir extends st.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,nt.Cg)([(0,st.W)()],ir.prototype,"receiveShadows",void 0);class or extends fe{constructor(e,t){super(e,nr),this.materialType="default",this.supportsEdges=!0,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,e=>(0,te.uw)(e)&&!this.transparent],[4,e=>(0,te.uw)(e)&&this.transparent]]),this._layout=Qt(this.parameters),this._configuration=new er(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){let{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=qt.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,d.t2)(this.parameters.emissiveBaseColor,h.uY)}get emissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);let{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;let{treeRendering:i,doubleSided:o,doubleSidedType:a}=t;r.hasVertexTangents=!i&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=i?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.hasModelTransformation=!i&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=i?2:o&&"normal"===a?1:o&&"winding-order"===a?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,(0,te._o)(e.output)?(r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=function(e,t){return e.receiveShadows&&null!=t.shadowHighlight?.getTexture()}(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&e.globalIlluminationEnabled):r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=r.receiveGlobalIllumination=!1,r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.unlit?7:t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersectRay(e,t,r,i,o,a){let n=this._getMaterialVerticalOffset(t,r);null!=n&&(i=(0,d.Re)(sr,i,n),o=(0,d.Re)(lr,o,n)),a=function(e,t,r,i){let o=dt(t);if(!o)return e;let a=(0,d.oW)(gt,i,r);return(t,r,i,n)=>e(t,ht(o,a,r,i),i,n)}(a,this._configuration,i,o),(0,pe.Uy)(e,r,i,o,(0,Ze.ou)(r.verticalOffset),a)}intersectScreenPolygon(e,t,r,i){return function(e,t,r){return null==e?null:(e.renderDistance=function(e,t,r,i,o){let a=dt(r);return a?ht(a,(0,d.oW)(gt,o,i),e,t):e}(e.renderDistance,e.hasNormal?e.normal:null,t,r,e.point),e)}(Ae(e,r,t,i,this._createScreenPolygonVertexDisplacement(t,r)),this._configuration,r.camera.eye)}createGLMaterial(e){return new ar(e)}createBufferWriter(){return new Je(this._layout)}get transparent(){let{drivenOpacity:e,opacity:t,externalColor:r,layerOpacity:i,texture:o,textureId:a,textureAlphaMode:n,colorMixMode:s}=this.parameters,l=r[3];return e||t<1&&"replace"!==s||l<1&&"ignore"!==s||i<1||(null!=o||null!=a)&&1!==n&&2!==n&&"replace"!==s}_createScreenPolygonVertexDisplacement(e,t){let r=this._getMaterialVerticalOffset(e,t);return null==r?null:{applyToVertex:(e,t,i,o)=>(e[0]=t+r[0],e[1]=i+r[1],e[2]=o+r[2],e),applyToAabb:e=>((0,m.Ne)(e,(0,d.WQ)(fr,(0,m.pg)(e,fr),r)),(0,m.vI)(e,(0,d.WQ)(fr,(0,m.Lu)(e,fr),r)),e)}}_getMaterialVerticalOffset(e,t){if(null==this.parameters.verticalOffset)return null;let r=t.camera;(0,d.hZ)(dr,e[12],e[13],e[14]);let i=null;switch(t.viewingMode){case 1:i=(0,d.S8)(ur,dr);break;case 2:i=(0,d.C)(ur,cr)}let o=(0,d.Re)(hr,dr,r.eye),a=(0,d.Bw)(o),n=(0,d.hs)(o,o,1/a),s=null;this.parameters.screenSizePerspective&&(s=(0,d.Om)(i,n));let l=(0,me.kE)(r,a,this.parameters.verticalOffset,s??0,this.parameters.screenSizePerspective,null);return(0,d.hs)(i,i,l),(0,d.ei)(mr,i,t.transform.inverseRotation)}}class ar extends ae{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});let t=this._material.parameters;this.updateTexture(t.textureId);let r=e.camera.viewInverseTransposeMatrix;return(0,d.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?rr:Xt,e)}}class nr extends Yt{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1,this.unlit=!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 null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const sr=(0,h.vt)(),lr=(0,h.vt)(),cr=(0,h.fA)(0,0,1),ur=(0,h.vt)(),dr=(0,h.vt)(),hr=(0,h.vt)(),mr=(0,h.vt)(),fr=(0,h.vt)(),pr=()=>P.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class gr{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function vr(e){let t=e.params,r=t.topology,i=!0;switch(t.vertexAttributes||(pr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{let e=t.faces;if(e){if(t.vertexAttributes)for(let r in t.vertexAttributes){let t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(pr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(pr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(pr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else pr().warn("Indexed geometries must specify faces"),i=!1;break}default:pr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(pr().warn("Geometry requires material"),i=!1);let o=e.params.vertexAttributes;for(let e in o)o[e].values||(pr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function xr(e){let t=(0,m.Ie)();return e.forEach(e=>{let r=e.boundingInfo;null!=r&&(0,m.RF)(t,r.box)}),t}function _r(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function br(e){let t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const yr=new A.A(1,2,"wosr");async function wr(e,t){let s,w=function(e){let t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null==t[4]?null:Number(t[4])}:{fileType:e.match(/(.*\.(json|json\.gz))$/)?"wosr":"unknown",url:e,specifiedLodIndex:null}}((0,o.EM)(e));if("wosr"===w.fileType){let e=await(t.cache?t.cache.loadWOSR(w.url,t):async function(e,t){let r=await async function(e,t){let r=await(0,D.Ke)((0,C.A)(e,t));if(r.ok)return r.value.data;(0,F.QP)(r.error),function(e){throw new I.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){let r=[];for(let i in e){let o=e[i],a=o.images[0].data;if(!a){pr().warn("Externally referenced texture data is not yet supported");continue}let n=o.encoding+";base64,"+a,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==_r(l)},u=t?.disableTextures?Promise.resolve(null):(0,B.D)(n,t);r.push(u.then(e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l})))}let i=await Promise.all(r),o={};for(let e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t),o=0;for(let e in i)if(i.hasOwnProperty(e)){let t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return new gr(r,i,o+(0,O.Qh)(r))}(w.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){let r=[],i=[],o=[],a=new E,n=e.resource,s=A.A.parse(n.version||"1.0","wosr");yr.validate(s);let l=n.model.name,c=n.model.geometries,u=n.materialDefinitions??{},d=e.textures,m=0,f=new Map;for(let e=0;e<c.length;e++){let n=c[e];if(!vr(n))continue;let s=br(n),l=n.params.vertexAttributes,p=[],g=e=>{if("PerAttributeArray"===n.params.topology)return null;let t=n.params.faces;for(let r in t)if(r===e)return t[r].values;return null},v=l.position,x=v.values.length/v.valuesPerElement;for(let e in l){let t=l[e],r=t.values,i=g(e)??(0,R.tM)(x);p.push([e,new z.n(r,i,t.valuesPerElement,!0)])}let _=s.texture,b=d&&d[_];if(b&&!f.has(_)){let{image:e,parameters:t}=b,r=new ee.h(e,t);i.push(r),f.set(_,r)}let y=f.get(_),w=y?y.id:void 0,S=s.material,M=a.get(S,_);if(null==M){let e=u[S.slice(S.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);let r=b?_r(b.alphaChannelUsage):void 0,i={ambient:(0,h.ci)(e.diffuse),diffuse:(0,h.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:w,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:b?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),M=new or(i,t),a.set(S,_,M)}o.push(M);let T=new J(M,p);m+=p.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(T)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:xr(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}if(t.cache)s=await t.cache.loadGLTF(w.url,t,!!t.usePBR,!!t.useEmissive);else{let{loadGLTF:e}=await r.e(1698).then(()=>r(51698));s=await e(new _.R,w.url,t,t.usePBR,t.useEmissive)}let{engineResources:M,referenceBoundingBox:P}=function(e,t,r){let o=e.model,s=e.meta,_=o.meta?.ESRI_proxyEllipsoid,w=s.isEsriSymbolResource&&null!=_&&"EsriRealisticTreesStyle"===s.ESRI_webstyle;w&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){let i=e.model.lods[r];for(let o of i.parts){let i=o.attributes.normal;if(null==i)return;let a=o.attributes.position,n=a.count,s=(0,h.vt)(),u=(0,h.vt)(),m=(0,h.vt)(),f=new Float32Array(4*n),g=new Float32Array(3*n),v=(0,l.B8)((0,c.vt)(),o.transform),x=0,_=0;for(let l=0;l<n;l++){a.getVec(l,u),i.getVec(l,s),(0,d.Z0)(u,u,o.transform),(0,d.Re)(m,u,t.center),(0,d.Qr)(m,m,t.radius);let n=m[2],c=(0,d.Bw)(m),h=Math.min(.45+.55*c*c,1)**2.2;(0,d.Qr)(m,m,t.radius),null!==v&&(0,d.Z0)(m,m,v),(0,d.S8)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(n>-1?(0,d.Cc)(m,m,s,.2):(0,d.Cc)(m,m,s,Math.min(-4*n-3.8,1))),g[x]=m[0],g[x+1]=m[1],g[x+2]=m[2],x+=3,f[_]=h,f[_+1]=h,f[_+2]=h,f[_+3]=1,_+=4}o.attributes.normal=new p.xs(g.buffer),o.attributes.color=new p.Eq(f.buffer)}}}(e,_));let M=!!t.usePBR,C=s.isEsriSymbolResource?{usePBR:M,isSchematic:!1,treeRendering:w,mrrFactors:$t.SY}:{usePBR:M,isSchematic:!1,treeRendering:!1,mrrFactors:$t.mb},D={...t.materialParameters,treeRendering:w},I=[],P=new Map,O=new Map,E=o.lods.length,F=(0,m.Ie)();return o.lods.forEach((e,s)=>{let l=!0===t.skipHighLods&&(E>1&&0===s||E>3&&1===s)||!1===t.skipHighLods&&null!=r&&s!==r;if(l&&0!==s)return;let c=new T(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{let r=l?new or({},t):function(e,t,r,o,a,n,s,l,c){let d=e.materials.get(t.material);if(null==d)return null;let{normal:m,color:f,texCoord0:p,tangent:g}=t.attributes,v=t.material+(m?"_normal":"")+(f?"_color":"")+(p?"_texCoord0":"")+(g?"_tangent":""),x=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,b=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(d.alphaMode);if(!n.has(v)){if(x){let t=(t,r=!1,i=!1)=>{if(null!=t&&!s.has(t)){let o=e.textures.get(t);if(o){let e=o.data,a=r&&!(0,y.x3)(e)?l.compressionOptions:void 0;s.set(t,new ee.h((0,y.x3)(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&i,encoding:(0,y.x3)(e)?e.encoding:void 0,compressionOptions:a}))}}},r=1!==b&&!c;t(d.colorTexture,r,1!==b),t(d.normalTexture),t(d.occlusionTexture,!0),t(d.emissiveTexture),t(d.metallicRoughnessTexture,!0)}let r=(0,i.xV)(d.color[0]),m=(0,i.xV)(d.color[1]),f=(0,i.xV)(d.color[2]),p=null!=d.colorTexture&&x?s.get(d.colorTexture):null,g=(0,$t.Jr)(d),w=null==d.normalTextureTransform?.scale?u.Un:d.normalTextureTransform?.scale;n.set(v,new or({...o,customDepthTest:1,textureAlphaMode:b,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,m,f],ambient:[r,m,f],opacity:"OPAQUE"===d.alphaMode?1:d.opacity,doubleSided:d.doubleSided,doubleSidedType:"winding-order",cullFace:d.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:d.receiveShadows,receiveAmbientOcclusion:d.receiveAmbientOcclusion,unlit:d.unlit,textureId:p?.id,colorMixMode:d.colorMixMode,normalTextureId:null!=d.normalTexture&&x?s.get(d.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.occlusionTexture&&x?s.get(d.occlusionTexture).id:void 0,emissiveTextureId:null!=d.emissiveTexture&&x&&!d.unlit?s.get(d.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=d.metallicRoughnessTexture&&x?s.get(d.metallicRoughnessTexture).id:void 0,emissiveBaseColor:d.unlit?h.uY:[d.emissiveFactor[0],d.emissiveFactor[1],d.emissiveFactor[2]],emissiveStrengthKHR:null==d.emissiveStrengthKHR?1:d.emissiveStrengthKHR,emissiveStrengthFromSymbol:null==a.emissiveStrengthFromSymbol?void 0:a.emissiveStrengthFromSymbol,mrrFactors:g?$t.Bt:[d.metallicFactor,d.roughnessFactor,o.mrrFactors[2]],isSchematic:g,colorTextureTransformMatrix:S(d.colorTextureTransform),normalTextureTransformMatrix:S(d.normalTextureTransform),scale:[w[0],w[1]],occlusionTextureTransformMatrix:S(d.occlusionTextureTransform),emissiveTextureTransformMatrix:S(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(d.metallicRoughnessTextureTransform),...a},l))}let w=n.get(v);if(r.stageResources.materials.push(w),x){let e=e=>{null!=e&&r.stageResources.textures.push(s.get(e))};e(d.colorTexture),e(d.normalTexture),e(d.occlusionTexture),e(d.emissiveTexture),e(d.metallicRoughnessTexture)}return w}(o,e,c,C,D,P,O,t,w),{geometry:d,vertexCount:_}=function(e,t){let r=e.attributes.position.count,i=(0,b.x)(e.indices||r,e.primitiveType),o=f(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,g.t)(o,s,e.transform,3,l);let c=[["position",new z.n(o,i,3,!0)]];if(null!=e.attributes.normal){let t=f(3*r),{typedBuffer:o,typedBufferStride:s}=e.attributes.normal;(0,n.Ge)(Sr,e.transform),(0,g.b)(t,o,Sr,3,s),(0,a.or)(Sr)&&(0,g.n)(t,t),c.push(["normal",new z.n(t,i,3,!0)])}if(null!=e.attributes.tangent){let t=f(4*r),{typedBuffer:o,typedBufferStride:s}=e.attributes.tangent;(0,n.z0)(Sr,e.transform),(0,v.t)(t,o,Sr,4,s),(0,a.or)(Sr)&&(0,g.n)(t,t,4),c.push(["tangent",new z.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){let t=f(2*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.texCoord0;(0,x.a)(t,o,2,a),c.push(["uv0",new z.n(t,i,2,!0)])}let u=e.attributes.color;if(null!=u){let t=new Uint8Array(4*r);4===u.elementCount?u instanceof p.Eq?(0,v.b)(t,u,1,255):(u instanceof p.XP||u instanceof p.Uz)&&(0,v.b)(t,u,1/255,255):(t.fill(255),u instanceof p.xs?(0,g.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof p.eI||e.attributes.color instanceof p.nS)&&(0,g.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new z.n(t,i,4,!0)])}return{geometry:new J(t,c),vertexCount:r}}(e,r??new or({},t)),M=d.boundingInfo;null!=M&&0===s&&(0,m.RF)(F,M.box),null!=r&&(c.stageResources.geometries.push(d),c.numberOfVertices+=_)}),l||I.push(c)}),{engineResources:I,referenceBoundingBox:F}}(s,t,w.specifiedLodIndex);return{lods:M,referenceBoundingBox:P,isEsriSymbolResource:s.meta.isEsriSymbolResource,isWosr:!1}}const Sr=(0,s.vt)()},26857(e,t,r){var i=r(32198),o=r(69622),a=r(91429);let n=class extends o.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.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,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.UPDATING=!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,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,a.MZ)()],n.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"UPDATING",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,a.MZ)()],n.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),n=(0,i.Cg)([(0,a.$K)("esri.views.3d.support.debugFlags")],n);const s=new n;r.d(t,["b",0,s])},46686(e,t,r){r.d(t,{A7:()=>a,Y0:()=>o});var i=r(29941);class o extends i.v{constructor(e){super(),this.spherical=e,this.draped=!1}}function a(e){(function(e){e.varyings.add("linearDepth","float",{invariant:!0})})(e),e.vertex.code.add("void forwardLinearDepth(float _linearDepth) { linearDepth = _linearDepth; }")}},32680(e,t,r){r.d(t,{M:()=>o});var i=r(31821);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
|
|
652
652
|
vec3 camToVert = posWorld - camPosWorld;
|
|
653
653
|
bool isBackface = dot(camToVert, normalWorld) > 0.0;
|
|
654
654
|
if (isBackface) {
|
|
@@ -1030,7 +1030,7 @@ vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),v&&r.code.a
|
|
|
1030
1030
|
normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
|
|
1031
1031
|
0.0, 0.0, 0.0 );
|
|
1032
1032
|
rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(l.H`return tangentSpace * rawNormal;
|
|
1033
|
-
}`))}(e,t)}},72233(e,t,r){r.d(t,{n:()=>E});var i=r(31821),o=r(12791),a=r(32198),n=r(34727),s=r(97768),l=r(36708),c=r(78659),u=r(91429),d=r(37585),h=r(89904),m=r(33779),f=r(15581),p=r(13840),g=r(42958),v=r(95774),x=r(90644);let _=class extends g.w{constructor(){super(...arguments),this.shader=new p.r(v.S,()=>r.e(1285).then(()=>r(91285)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};_=(0,a.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],_);var b=r(48163),y=r(65786);class w extends y.Y{constructor(){super(...arguments),this.projScale=1}}class S extends w{constructor(){super(...arguments),this.intensity=1}}class M extends y.Y{}class T extends M{constructor(){super(...arguments),this.blurSize=(0,b.vt)()}}let C=class extends g.w{constructor(){super(...arguments),this.shader=new p.r(f.S,()=>r.e(6122).then(()=>r(86122)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};C=(0,a.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],C),r(63907);var D=r(21231),
|
|
1033
|
+
}`))}(e,t)}},72233(e,t,r){r.d(t,{n:()=>E});var i=r(31821),o=r(12791),a=r(32198),n=r(34727),s=r(97768),l=r(36708),c=r(78659),u=r(91429),d=r(37585),h=r(89904),m=r(33779),f=r(15581),p=r(13840),g=r(42958),v=r(95774),x=r(90644);let _=class extends g.w{constructor(){super(...arguments),this.shader=new p.r(v.S,()=>r.e(1285).then(()=>r(91285)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};_=(0,a.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],_);var b=r(48163),y=r(65786);class w extends y.Y{constructor(){super(...arguments),this.projScale=1}}class S extends w{constructor(){super(...arguments),this.intensity=1}}class M extends y.Y{}class T extends M{constructor(){super(...arguments),this.blurSize=(0,b.vt)()}}let C=class extends g.w{constructor(){super(...arguments),this.shader=new p.r(f.S,()=>r.e(6122).then(()=>r(86122)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};C=(0,a.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],C),r(63907);var D=r(21231),I=r(67171);let P=class extends m.o{constructor(e){super(e),this._enableTime=(0,c.l5)(0),this._passParameters=new S,this._drawParameters=new T}initialize(){let 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 I.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new D.A(this.renderingContext,t,e),this.addHandles((0,l.wB)(()=>this._useSSAO,e=>{this._enableTime=(0,c.l5)(0),e?this._enable():this._disable()},l.pc))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){let t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(33306);if(!r||!i)return;let o=this.techniques.getCompiled(C),a=this.techniques.getCompiled(_);if(!o||!a)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));let s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,u=this.bindParameters,m=u.camera,p=m.relativeElevation,g=(0,n.qE)((5e5-p)/2e5,0,1),v=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,x=v*g;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/m.computeScreenPixelSizeAtDistance(1),this._passParameters.intensity=4*O/(0,f.g)(m)**6*x;let b=m.fullViewport[2],y=m.fullViewport[3],w=this.fboCache.acquire(b,y,"ssao input",2);s.bindFramebuffer(w.fbo),s.setViewport(0,0,b,y),s.bindTechnique(o,u,this._passParameters,this._drawParameters),s.screen.draw();let S=Math.round(b/2),M=Math.round(y/2),T=this.fboCache.acquire(S,M,"ssao blur",0);s.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=w.getTexture(),(0,d.hZ)(this._drawParameters.blurSize,0,2/y),s.bindTechnique(a,u,this._passParameters,this._drawParameters),s.setViewport(0,0,S,M),s.screen.draw(),w.release();let D=this.fboCache.acquire(S,M,h.OG.AMBIENT_ILLUMINATION,0);return s.bindFramebuffer(D.fbo),s.setViewport(0,0,b,y),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=T.getTexture(),(0,d.hZ)(this._drawParameters.blurSize,2/b,0),s.bindTechnique(a,u,this._passParameters,this._drawParameters),s.setViewport(0,0,S,M),s.screen.draw(),s.setViewport4fv(m.fullViewport),T.release(),v<1&&this.requestRender(2),D}};P=(0,a.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],P);const O=.5;function E(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new o.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",.5),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
1034
1034
|
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
1035
1035
|
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
1036
1036
|
}
|
|
@@ -1073,7 +1073,7 @@ vec3 calculateAmbientRadiance()
|
|
|
1073
1073
|
{
|
|
1074
1074
|
vec3 ambientLight = 1.2 * (0.282095 * vec3(shR[0], shG[0], shB[0])) - 0.2;
|
|
1075
1075
|
return ambientLight *= skyTransmittance;
|
|
1076
|
-
}`)}var s=r(72233),l=r(65261),c=r(98619),u=r(22393),d=r(89786),h=r(32976),m=r(12791),f=r(32198),p=r(97768),g=r(36708),v=r(76030),x=r(91429),_=r(37585),b=r(91829),y=r(89904),w=r(33779),S=r(587),M=r(52516),T=r(13840),C=r(42958),D=r(90644);let
|
|
1076
|
+
}`)}var s=r(72233),l=r(65261),c=r(98619),u=r(22393),d=r(89786),h=r(32976),m=r(12791),f=r(32198),p=r(97768),g=r(36708),v=r(76030),x=r(91429),_=r(37585),b=r(91829),y=r(89904),w=r(33779),S=r(587),M=r(52516),T=r(13840),C=r(42958),D=r(90644);let I=class extends C.w{constructor(){super(...arguments),this.shader=new T.r(M.a,()=>r.e(2013).then(()=>r(42013)))}initializePipeline(){return(0,D.Ey)({colorWrite:D.kn})}};I=(0,f.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationBlurTechnique")],I);let P=class extends C.w{constructor(){super(...arguments),this.shader=new T.r(S.a,()=>r.e(9794).then(()=>r(89794)))}initializePipeline(){return(0,D.Ey)({colorWrite:D.kn})}};P=(0,f.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationTechnique")],P);var O=r(51976);class E extends O.K{constructor(){super(...arguments),this.hasColor=!0,this.hasEmission=!1,this.rayMarchMaxReach=.5,this.rayMarchMaxSteps=16,this.useProjectedRayLength=!0,this.clampRayToScreen=!1}}(0,f.Cg)([(0,O.W)()],E.prototype,"hasColor",void 0),(0,f.Cg)([(0,O.W)()],E.prototype,"hasEmission",void 0);var F=r(50704);let A=class extends C.w{constructor(){super(...arguments),this.shader=new T.r(F.a,()=>r.e(7891).then(()=>r(37891)))}initializePipeline(){return(0,D.Ey)({colorWrite:D.kn})}};A=(0,f.Cg)([(0,x.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationUpscaleTechnique")],A),r(63907);let R=class extends w.o{constructor(e){super(e),this._passParameters=new S.G,this._drawParameters=new M.G,this._drawParametersUpscale=new F.G,this._configuration=new E,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._lowQualityResolutionScale=.35,this._maxFrames=256}initialize(){this.addHandles((0,g.wB)(()=>this._mode,e=>{0===e?this._disable():this._enable()},g.pc))}destroy(){this._lastOutput=(0,p.Gz)(this._lastOutput)}_disable(){super._disable(),this._resetAccumulation(),this._passParameters.temporalSampleFrame=0}get hasHighQuality(){return 2===this._mode}resetAccumulation(){!this._isGlobalIlluminationUpdate&&(this._passParameters.accumulatedFrames>100||!this._configuration.hasEmission)&&this._resetAccumulation()}_resetAccumulation(){this._passParameters.accumulatedFrames=0,this._lastOutput=(0,p.Gz)(this._lastOutput)}get isAccumulating(){return this.enabled&&this._passParameters.accumulatedFrames<this._maxFrames}precompile(){this.techniques.getCompiled(A)}render(e){let t=1===this.bindParameters.frameRendererTarget;if(this._passParameters.accumulatedFrames>=this._maxFrames&&!t)return this._lastOutput?.retain(),this._lastOutput;let r=e.find(({name:e})=>"normals"===e),i=r?.getTexture(),o=r?.getTexture(33306);return i&&o&&0!==this._mode?(this._configuration.hasEmission=!!this.bindParameters.reprojection.lastFrameEmission,t?this._renderScreenshot(i,o):this._renderInteractive(i,o)):this._emptyOutput}_renderScreenshot(e,t){let r=this._emptyOutput,i=this._passParameters.accumulatedFrames,o=this._passParameters.temporalSampleFrame;this._passParameters.accumulatedFrames=0,this._passParameters.temporalSampleFrame=0;let a=this.techniques.get(P,this._configuration),n=this.techniques.get(I);for(;this._passParameters.accumulatedFrames<this._maxFrames;){this._passParameters.globalIllumination=r.getTexture(),this._passParameters.globalIlluminationWeights=r.getTexture(36065);let i=this._renderAccumulationFrame(e,t,a,n);++this._passParameters.accumulatedFrames,r.release(),r=i}return this._passParameters.globalIllumination=null,this._passParameters.globalIlluminationWeights=null,this._passParameters.accumulatedFrames=i,this._passParameters.temporalSampleFrame=o,r}_renderInteractive(e,t){if(!this._canRender)return this._requestRender(),this._emptyOutput;let r=1===this._mode?this._lowQualityResolutionScale:1,i=this.techniques.getCompiled(P,this._configuration),o=this.techniques.getCompiled(I),a=r<1,n=a?this.techniques.getCompiled(A):null;if(!i||!o||a&&!n)return this._requestRender(),this._emptyOutput;let s=this._renderAccumulationFrame(e,t,i,o,n,r);return++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),this._storeOutput(s),s}_renderAccumulationFrame(e,t,r,i,o,a=1){let n=this.bindParameters,s=this.renderingContext,{camera:l}=n;this._passParameters.normalTexture=e,this._passParameters.depthTexture=t,this._passParameters.projScale=1/l.computeScreenPixelSizeAtDistance(1),this._passParameters.resolutionScale=a,this._passParameters.glowBoost=this._glowBoost;let{fullWidth:c,fullHeight:u}=l,d=Math.max(1,Math.floor(c*a)),h=Math.max(1,Math.floor(u*a)),m=this.fboCache.acquire(d,h,"global illumination input").acquireColor(36065,2);s.bindFramebuffer(m.fbo),s.setViewport(0,0,d,h),s.bindTechnique(r,n,this._passParameters,this._drawParameters),s.screen.draw();let f=Math.max(1,Math.round(d/1)),p=Math.max(1,Math.round(h/1)),g=this.fboCache.acquire(f,p,"global illumination blur horizontal");s.bindFramebuffer(g.fbo);let v=m.obtainAttachment(36065);this._drawParameters.texture=m.getTexture(),this._drawParameters.weightTexture=v.attachment,(0,_.hZ)(this._drawParameters.blurSize,0,1/h),s.bindTechnique(i,n,this._passParameters,this._drawParameters),s.setViewport(0,0,f,p),s.screen.draw(),m.release();let x=this.fboCache.acquire(f,p,o?"global illumination blur vertical":y.OG.AMBIENT_ILLUMINATION);s.bindFramebuffer(x.fbo),s.setViewport(0,0,f,p),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.texture=g.getTexture(),this._drawParameters.weightTexture=v.attachment,(0,_.hZ)(this._drawParameters.blurSize,1/f,0),s.bindTechnique(i,n,this._passParameters,this._drawParameters),s.setViewport(0,0,f,p),s.screen.draw(),g.release(),x.attachColor(v,36065),v.release();let b=x;return o&&(b=this.fboCache.acquire(c,u,y.OG.AMBIENT_ILLUMINATION).acquireColor(36065,2),s.bindFramebuffer(b.fbo),s.setViewport(0,0,c,u),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParametersUpscale.colorTexture=x.getTexture(),this._drawParametersUpscale.weightTexture=x.getTexture(36065),s.bindTechnique(o,n,this._passParameters,this._drawParametersUpscale),s.screen.draw(),x.release()),s.setViewport4fv(l.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,b}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(e){this._lastOutput!==e&&(this._lastOutput=(0,p.Gz)(this._lastOutput),this._lastOutput=e,this._lastOutput.retain())}get _emptyOutput(){let e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,i=this.fboCache.acquire(t,r,y.OG.AMBIENT_ILLUMINATION).acquireColor(36065,2);return e.bindFramebuffer(i.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,b.v7),e.clearBuffer(1,b.uY),i}get _canRender(){let{reprojection:e,hasEmission:t,globalIllumination:r}=this.bindParameters;return!(!e.lastFrameColor||t&&!e.lastFrameEmission||!e.lastFrameDepth||!r)}get _glowBoost(){let e=this.view.environment.lighting.glow;return null==e?0:2+3*e.intensity}get _mode(){return this._useGlobalIllumination?this.view.stage.renderer.isFeatureEnabled(10)?2:1:0}get test(){let e=this;return{get maxFrames(){return e._maxFrames},set maxFrames(t){e._maxFrames=t},get lowQualityResolutionScale(){return e._lowQualityResolutionScale},set lowQualityResolutionScale(t){e._lowQualityResolutionScale=t},passParameters:this._passParameters,configuration:this._configuration,get mode(){return e._mode},async restartAccumulation(){"disabled"!==e.produces&&(e._disable(),await(0,v.gh)(),e._enable())}}}};function B(e,t){t.receiveGlobalIllumination?(e.uniforms.add(new h.o("hasGlobalIlluminationTexture",e=>null!=e.globalIllumination),new m.x("globalIlluminationTexture",e=>e.globalIllumination?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1),e.code.add(a.H`vec3 readGlobalIlluminationOcclusionInverse() {
|
|
1077
1077
|
if (!hasGlobalIlluminationTexture) {
|
|
1078
1078
|
return vec3(1.0);
|
|
1079
1079
|
}
|
|
@@ -1116,11 +1116,11 @@ return vec3(mapChannel(color.x, p), mapChannel(color.y, p), mapChannel(color.z,
|
|
|
1116
1116
|
`),e.uniforms.add(c.VK).code.add(a.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
|
|
1117
1117
|
float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
|
|
1118
1118
|
return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
|
|
1119
|
-
}`);let p=m?"globalIlluminationOcclusion":"ssao",g=m?"factorDirect":"0.0",v=m?"factorAmbient":"1.0";switch(e.constants.add("mainLightIrradianceScale","float",m?.75:1),e.constants.add("ambientIrradianceScale","float",m?1.5:1),m&&(e.uniforms.add(new z.U("factorDirect",e=>e.globalIlluminationDirectFactor),new z.U("factorAmbient",e=>e.globalIlluminationAmbientFactor)),e.constants.add("globalIlluminationEmissionCompressionWeight","float",.75),e.code.add(a.H`vec3 evaluateGlobalIlluminationOcclusion() {
|
|
1120
|
-
return min(
|
|
1119
|
+
}`);let p=m?"globalIlluminationOcclusion":"ssao",g=m?"factorDirect":"0.0",v=m?"factorAmbient":"1.0";switch(e.constants.add("mainLightIrradianceScale","float",m?.75:1),e.constants.add("ambientIrradianceScale","float",m?1.5:1),m&&(e.uniforms.add(new z.U("factorDirect",e=>e.globalIlluminationDirectFactor),new z.U("factorAmbient",e=>e.globalIlluminationAmbientFactor)),e.constants.add("globalIlluminationOcclusionBoost","float",1.2),e.constants.add("globalIlluminationEmissionBoost","float",2.25),e.constants.add("globalIlluminationEmissionCompressionWeight","float",.75),e.code.add(a.H`vec3 evaluateGlobalIlluminationOcclusion() {
|
|
1120
|
+
return min(globalIlluminationOcclusionBoost * readGlobalIlluminationOcclusion(), 1.0);
|
|
1121
1121
|
}
|
|
1122
1122
|
vec3 evaluateGlobalIlluminationEmission(vec3 albedoLinear) {
|
|
1123
|
-
vec3 emission =
|
|
1123
|
+
vec3 emission = globalIlluminationEmissionBoost * (0.75 * albedoLinear + 0.25) * readGlobalIlluminationEmission().rgb;
|
|
1124
1124
|
vec3 compressedEmission = emission / (emission + 1.0);
|
|
1125
1125
|
return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWeight);
|
|
1126
1126
|
}`)),r){case 0:case 4:case 3:e.include(c.Vt),e.code.add(a.H`
|
|
@@ -1698,7 +1698,7 @@ return max(c.x, max(c.y, c.z));
|
|
|
1698
1698
|
vec3 hiD = hiA + hiB;
|
|
1699
1699
|
vec3 loD = loA + loB;
|
|
1700
1700
|
return dpDummy * hiD + loD;
|
|
1701
|
-
}`)}},20693(e,t,r){r.d(t,{yu:()=>m,NB:()=>f});var i=r(58083),o=r(9093),a=r(35522),n=r(51850),s=r(45324),l=r(23205),c=r(40710),u=(r(33094),r(58029)),d=r(74333);class h extends d.n{constructor(e,t,r){super(e,"mat4",2,(i,o,a)=>i.setUniformMatrix4fv(e,t(o,a),r))}}function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",n.uY):e.uniforms.add(new c.W("cameraPosition",({origin:e},{camera:t})=>(0,a.hZ)(g,t.viewInverseTransposeMatrix[3]-e[0],t.viewInverseTransposeMatrix[7]-e[1],t.viewInverseTransposeMatrix[11]-e[2])))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(s.rS,new h("view",(e,t)=>(0,i.Tl)(p,t.camera.viewMatrix,e.origin)),new c.W("localOrigin",e=>e.origin));let r=({camera:e})=>(0,a.hZ)(g,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(s.rS,new u.F("view",e=>(0,i.Tl)(p,e.camera.viewMatrix,r(e))),new l.d("localOrigin",e=>r(e)))}const p=(0,o.vt)(),g=(0,n.vt)()},45324(e,t,r){var i=r(37585),o=r(48163),a=r(77108),n=r(14314),s=r(33094),l=r(58029);const c=new l.F("view",({camera:e})=>e.viewMatrix),u=(new l.F("inverseViewMatrix",({camera:e})=>e.inverseViewMatrix),new l.F("proj",({camera:e})=>e.projectionMatrix)),d=(new l.F("inverseProjectionMatrix",({camera:e})=>e.inverseProjectionMatrix),new l.F("viewNormal",({camera:e})=>e.viewInverseTransposeMatrix)),h=new a.E("nearFar",({camera:e})=>e.nearFar),m=(new n.I("viewport",({camera:e})=>e.fullViewport),new s.U("pixelRatio",({camera:e})=>e.pixelRatio),new s.U("screenPixelSizePerDistance",({camera:e})=>e.screenPixelSizePerDistance),new s.U("renderPixelSizePerDistance",({camera:e})=>e.renderPixelSizePerDistance),new s.U("metersPerRenderUnit",e=>e.metersPerRenderUnit),new a.E("inverseScreenSize",({camera:e})=>(0,i.hZ)(m,1/e.fullWidth,1/e.fullHeight)),(0,o.vt)());r.d(t,["HO",0,d,"Xl",0,c,"Y$",0,h,"rS",0,u])},32976(e,t,r){r.d(t,{o:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"bool",0,(r,i)=>r.setUniform1b(e,t(i)))}}},77108(e,t,r){r.d(t,{E:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,o)=>i.setUniform2fv(e,t(o),r))}}},68259(e,t,r){r.d(t,{t:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,o,a,n)=>i.setUniform2fv(e,t(o,a,n),r))}}},47286(e,t,r){r.d(t,{G:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,o,a)=>i.setUniform2fv(e,t(o,a),r))}}},23205(e,t,r){r.d(t,{d:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",0,(i,o)=>i.setUniform3fv(e,t(o),r))}}},40710(e,t,r){r.d(t,{W:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",2,(i,o,a,n)=>i.setUniform3fv(e,t(o,a,n),r))}}},33079(e,t,r){r.d(t,{t:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",1,(i,o,a)=>i.setUniform3fv(e,t(o,a),r))}}},14314(e,t,r){r.d(t,{I:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,o)=>i.setUniform4fv(e,t(o),r))}}},71988(e,t,r){r.d(t,{E:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,o,a)=>i.setUniform4fv(e,t(o,a),r))}}},33094(e,t,r){r.d(t,{U:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",0,(i,o)=>i.setUniform1f(e,t(o),r))}}},28421(e,t,r){r.d(t,{J:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",2,(i,o,a)=>i.setUniform1f(e,t(o,a),r))}}},20304(e,t,r){r.d(t,{m:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",1,(i,o,a)=>i.setUniform1f(e,t(o,a),r))}}},35818(e,t,r){r.d(t,{W:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"int",0,(r,i)=>r.setUniform1i(e,t(i)))}}},35644(e,t,r){r.d(t,{k:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"mat3",1,(i,o,a)=>i.setUniformMatrix3fv(e,t(o,a),r))}}},58029(e,t,r){r.d(t,{F:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"mat4",0,(i,o)=>i.setUniformMatrix4fv(e,t(o),r))}}},12791(e,t,r){r.d(t,{x:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},15976(e,t,r){r.d(t,{o:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"sampler2D",2,(i,o,a)=>i.bindTexture(e,t(o,a),r?.(o,a)))}}},63761(e,t,r){r.d(t,{N:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,o)=>r.bindTexture(e,t(i,o)))}}},31821(e,t,r){r.d(t,{If:()=>o});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 o(e,t,r=""){return e?t:r}i.int=e=>e.toFixed(),i.uint=e=>`${Math.max(0,e).toFixed()}u`,i.hexuint=e=>`0x${Math.round(Math.max(0,e)).toString(16)}u`,i.float=e=>e.toPrecision(8),r.d(t,["H",0,i])},13840(e,t,r){r.d(t,{r:()=>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}}},42958(e,t,r){r.d(t,{w:()=>p});var i=r(32198),o=r(69622),a=r(53966),n=r(91429),s=r(63907),l=r(85079),c=r(74038);new c._("position",3,s.pe.FLOAT,0,12);const u=[new c._("position",2,s.pe.FLOAT,0,8)];(0,l.Xk)(u),new c._("position",2,s.pe.FLOAT,0,12),new c._("uv0",2,s.pe.HALF_FLOAT,8,12),r(44208);var d=r(26857),h=r(94656);class m{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,h.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||a.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.get(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}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)}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){if(d.b.ENABLE_OPTIMIZATIONS)return;let r=e.locations;if(t){let 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: ${Array.from(r.keys())} vs ${Array.from(this.locations.keys())}`),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,r){if(!t?.glName){let r=`Texture sampler ${e} in ${this._context.debugBoundTechnique} has no given Texture in ${Error().stack}`;(0,h.en)()&&console.error(r),t=this._context.emptyTexture}let i=this._ensureTextureUnit(e,t);this._context.useProgram(this);let o=i.unit;this.setUniform1i(e,o),this._context.bindTexture(t,o,!1,r)}_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 f=r(90644);let p=class extends o.A{constructor(e,t,r){super({}),this._context=e,this._configuration=t,this.primitiveType=s.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=t.key,this.locations=(0,l.Xk)(r??u),this._pipeline=this.initializePipeline(t),this.reload=async r=>{if(r&&await this.shader.reload(),!this.key.equals(t.key))return void a.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);let i=this.shader.get().build(t);i.debugName=this.declaredClass,this._program=new m(e.rctx,i,this.locations),this._pipeline=this.initializePipeline(t)}}initialize(){let e=this.shader.get().build(this._configuration);e.debugName=this.declaredClass,this._program=new m(this._context.rctx,e,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t,r){return this._pipeline}initializePipeline(e){return(0,f.Ey)({blending:f.RC,colorWrite:f.kn})}};p=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],p)},51976(e,t,r){r.d(t,{K:()=>s,W:()=>l});var i=r(49186),o=r(4576);class a{constructor(e){this._bits=[...e]}equals(e){return(0,o.aI)(this._bits,e.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var n=r(65786);class s extends n.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new a(this._parameterBits),this._key}decode(e=this.key){let t=this._parameterBits;this._parameterBits=[...e.bits];let r=this._parameterNames.map(e=>` ${e}: ${this[e]}`).join("\n");return this._parameterBits=t,r}}function l(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);let o=e.count||2,a=Math.ceil(Math.log2(o)),n=t._parameterBits,s=0;for(;n[s]+a>16;)s++,s>=n.length&&n.push(0);let l=n[s],c=(1<<a)-1<<l;n[s]+=a,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[s]&c)>>l},set(t){let o=this._parameterBits[s];if((o&c)>>l!==t){if(this._key=null,this._parameterBits[s]=o&~c|+t<<l&c,"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[s]&c)>>l)},set(e){let t=this._parameterBits[s];if(!!((t&c)>>l)!==e&&(this._key=null,this._parameterBits[s]=t&~c|+e<<l,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configurationx",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},33779(e,t,r){r.d(t,{o:()=>A});var i=r(32198),o=r(91429),a=r(89904),n=r(69622),s=r(49186),l=r(36708),c=r(10107),u=r(64108),d=r(44208),h=r(53966),m=(r(17676),r(94656)),f=r(63907);r(93637),r(4576),"layout.centroid.smooth.case.mat2x2.mat2x3.mat2x4.mat3x2.mat3x3.mat3x4.mat4x2.mat4x3.mat4x4.uint.uvec2.uvec3.uvec4.samplerCubeShadow.sampler2DArray.sampler2DArrayShadow.isampler2D.isampler3D.isamplerCube.isampler2DArray.usampler2D.usampler3D.usamplerCube.usampler2DArray.coherent.restrict.readonly.writeonly.resource.atomic_uint.noperspective.patch.sample.subroutine.common.partition.active.filter.image1D.image2D.image3D.imageCube.iimage1D.iimage2D.iimage3D.iimageCube.uimage1D.uimage2D.uimage3D.uimageCube.image1DArray.image2DArray.iimage1DArray.iimage2DArray.uimage1DArray.uimage2DArray.image1DShadow.image2DShadow.image1DArrayShadow.image2DArrayShadow.imageBuffer.iimageBuffer.uimageBuffer.sampler1DArray.sampler1DArrayShadow.isampler1D.isampler1DArray.usampler1D.usampler1DArray.isampler2DRect.usampler2DRect.samplerBuffer.isamplerBuffer.usamplerBuffer.sampler2DMS.isampler2DMS.usampler2DMS.sampler2DMSArray.isampler2DMSArray.usampler2DMSArray.trunc.round.roundEven.isnan.isinf.floatBitsToInt.floatBitsToUint.intBitsToFloat.uintBitsToFloat.packSnorm2x16.unpackSnorm2x16.packUnorm2x16.unpackUnorm2x16.packHalf2x16.unpackHalf2x16.outerProduct.transpose.determinant.inverse.texture.textureSize.textureProj.textureLod.textureOffset.texelFetch.texelFetchOffset.textureProjOffset.textureLodOffset.textureProjLod.textureProjLodOffset.textureGrad.textureGradOffset.textureProjGrad.textureProjGradOffset".split("."),"precision.highp.mediump.lowp.attribute.const.uniform.varying.break.continue.do.for.while.if.else.in.out.inout.float.int.void.bool.true.false.discard.return.mat2.mat3.mat4.vec2.vec3.vec4.ivec2.ivec3.ivec4.uvec2.uvec3.uvec4.bvec2.bvec3.bvec4.sampler1D.sampler2D.sampler3D.usampler1D.usampler2D.usampler3D.samplerCube.sampler1DShadow.sampler2DShadow.struct.asm.class.union.enum.typedef.template.this.packed.goto.switch.default.inline.noinline.volatile.public.static.extern.external.interface.long.short.double.half.fixed.unsigned.input.output.hvec2.hvec3.hvec4.dvec2.dvec3.dvec4.fvec2.fvec3.fvec4.sampler2DRect.sampler3DRect.sampler2DRectShadow.sizeof.cast.namespace.using".split("."),"<<= >>= ++ -- << >> <= >= == != && || += -= *= /= %= &= ^^ ^= |= ( ) [ ] . ! ~ * / % + - < > & ^ | ? : = , ; { }".split(" "),"abs.acos.all.any.asin.atan.ceil.clamp.cos.cross.dFdx.dFdy.degrees.distance.dot.equal.exp.exp2.faceforward.floor.fract.gl_BackColor.gl_BackLightModelProduct.gl_BackLightProduct.gl_BackMaterial.gl_BackSecondaryColor.gl_ClipPlane.gl_ClipVertex.gl_Color.gl_DepthRange.gl_DepthRangeParameters.gl_EyePlaneQ.gl_EyePlaneR.gl_EyePlaneS.gl_EyePlaneT.gl_Fog.gl_FogCoord.gl_FogFragCoord.gl_FogParameters.gl_FragColor.gl_FragCoord.gl_FragData.gl_FragDepth.gl_FragDepthEXT.gl_FrontColor.gl_FrontFacing.gl_FrontLightModelProduct.gl_FrontLightProduct.gl_FrontMaterial.gl_FrontSecondaryColor.gl_LightModel.gl_LightModelParameters.gl_LightModelProducts.gl_LightProducts.gl_LightSource.gl_LightSourceParameters.gl_MaterialParameters.gl_MaxClipPlanes.gl_MaxCombinedTextureImageUnits.gl_MaxDrawBuffers.gl_MaxFragmentUniformComponents.gl_MaxLights.gl_MaxTextureCoords.gl_MaxTextureImageUnits.gl_MaxTextureUnits.gl_MaxVaryingFloats.gl_MaxVertexAttribs.gl_MaxVertexTextureImageUnits.gl_MaxVertexUniformComponents.gl_ModelViewMatrix.gl_ModelViewMatrixInverse.gl_ModelViewMatrixInverseTranspose.gl_ModelViewMatrixTranspose.gl_ModelViewProjectionMatrix.gl_ModelViewProjectionMatrixInverse.gl_ModelViewProjectionMatrixInverseTranspose.gl_ModelViewProjectionMatrixTranspose.gl_MultiTexCoord0.gl_MultiTexCoord1.gl_MultiTexCoord2.gl_MultiTexCoord3.gl_MultiTexCoord4.gl_MultiTexCoord5.gl_MultiTexCoord6.gl_MultiTexCoord7.gl_Normal.gl_NormalMatrix.gl_NormalScale.gl_ObjectPlaneQ.gl_ObjectPlaneR.gl_ObjectPlaneS.gl_ObjectPlaneT.gl_Point.gl_PointCoord.gl_PointParameters.gl_PointSize.gl_Position.gl_ProjectionMatrix.gl_ProjectionMatrixInverse.gl_ProjectionMatrixInverseTranspose.gl_ProjectionMatrixTranspose.gl_SecondaryColor.gl_TexCoord.gl_TextureEnvColor.gl_TextureMatrix.gl_TextureMatrixInverse.gl_TextureMatrixInverseTranspose.gl_TextureMatrixTranspose.gl_Vertex.greaterThan.greaterThanEqual.inversesqrt.length.lessThan.lessThanEqual.log.log2.matrixCompMult.max.min.mix.mod.normalize.not.notEqual.pow.radians.reflect.refract.sign.sin.smoothstep.sqrt.step.tan.texture2D.texture2DLod.texture2DProj.texture2DProjLod.textureCube.textureCubeLod.texture2DLodEXT.texture2DProjLodEXT.textureCubeLodEXT.texture2DGradEXT.texture2DProjGradEXT.textureCubeGradEXT.textureSize.texelFetch".split("."),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,d.A)("esri-tests-disable-gpu-memory-measurements"),(0,m.en)();(0,m.en)();r(90644);var p=r(21231),g=r(97768),v=r(48852),x=r(42293);const _=!!(0,d.A)("esri-tests-disable-gpu-memory-measurements");class b{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(f.vt.Renderbuffer,this);let r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);let{width:i,height:o,internalFormat:a,multisampled:n}=t;n?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,a,i,o):r.renderbufferStorage(r.RENDERBUFFER,a,i,o),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){let e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return _?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,x.MW)(e.internalFormat);var e}resize(e,t){let r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;let i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&=(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(f.vt.Renderbuffer,this),null)}}class y{constructor(e,t,r){if(this._context=e,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,e.instanceCounter.increment(f.vt.FramebufferObject,this),null!=t){let r=function(e,t){return w(t)||S(t)?t:M(t)?new p.A(e,t):function(e){return 3===T(e)||null!=e&&"samples"in e}(t)?new b(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(36064,r),w(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(36064)}if(null!=r)if(function(e){return w(e)||M(e)}(r))this._depthStencilTexture=w(r)?r:new p.A(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{let t=S(r)?r:new b(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}get glName(){return this._glName}get colorTexture(){let e=this._colorAttachments.get(36064);return w(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return(this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.width??0}get height(){return(this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.height??0}get usedMemory(){return this._colorAttachments.values().reduce((e,t)=>e+t.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(e){this._level!==e&&(this._level=e,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){let t=this._colorAttachments.get(e);return t&&w(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=36064){if(!e)return;this._validateColorAttachmentPoint(t);let{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=36064){let t=this._colorAttachments.get(e);if(!t)return;let r=w(t);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(r)this._framebufferTexture2D(null,e);else{let t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._glName){let t=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{e.forEach(e=>{w(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=36064,r=0){let i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,r):this._framebufferTexture2D(i.glName,t,e,36160))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;let{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041!==r&&6402!==r?console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"):34041===r&&i!==f.ld.UNSIGNED_INT_24_8?console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):6402===r&&i!==f.ld.UNSIGNED_INT&&i!==f.ld.UNSIGNED_SHORT?console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,P(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e)}detachDepthStencilTexture(){let e=this._depthStencilTexture;return e&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,P(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;let t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);let{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){let e=this._depthStencilBuffer;if(e&&this._glName){let{_context:t}=this,r=t.boundFramebuffer;t.bindFramebuffer(this);let{gl:i}=t,o=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,o,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){let{_context:t}=this;t.temporaryBindFramebuffer(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,o,a,n){(e<0||t<0||o<0||a<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");let s=n.descriptor;3553!==n.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||a+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");let l=this._context,c=l.bindTexture(n,p.A.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(p.A.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(3553,0,o,a,e,t,r,i),l.bindTexture(c,p.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,a,n){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),n||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,a,n)}async readPixelsAsync(e,t,r,i,o,a,n,s){let{gl:l}=this._context,c=v.g.createPixelPack(this._context,35041,n.byteLength);this._context.bindBuffer(c);let u=this._context.boundFramebuffer;this._context.bindFramebuffer(this),l.readPixels(e,t,r,i,o,a,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(u);try{await c.getSubDataAsync(n,void 0,void 0,void 0,s)}finally{c.dispose()}}resize(e,t){if(this.width===e&&this.height===t)return;let r={width:e,height:t};if(C(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._glName&&(C(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,m.en)())){let{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){let{gl:t}=this._context;this._glName?t.bindFramebuffer(e,this._glName):(this._glName&&t.deleteFramebuffer(this._glName),this._glName=t.createFramebuffer(),t.bindFramebuffer(e,this._glName),this._initializeAttachments(e))}_initializeAttachments(e=36160){let{gl:t}=this._context;if(this._colorAttachments.forEach((t,r)=>{if(w(t)){let i=D(t);35866===i?this._framebufferTextureLayer(t.glName,r,e):this._framebufferTexture2D(t.glName,r,i,e)}else if(S(t)){let i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){let r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){let t=P(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,D(this._depthStencilTexture),e)}(0,m.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(e,t=36064,r=3553,i=36160){this._context.gl.framebufferTexture2D(i,t,r,e,this._level)}_framebufferTextureLayer(e,t=36064,r=36160,i=0){this._context.gl.framebufferTextureLayer(r,t,e,this._level,i)}_disposeDepthStencilAttachments(){let e=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);let t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,g.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&=(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,P(this._depthStencilTexture.descriptor.pixelFormat))),(0,g.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),C(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){C(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width!==e.width||this.height!==e.height)&&console.error("Attachment size must match framebuffer size!")}_getGLAttachmentPoint(e){switch(e.internalFormat){case f.SB.DEPTH_COMPONENT16:case f.SB.DEPTH_COMPONENT24:case f.SB.DEPTH_COMPONENT32F:return 36096;case f.iE.DEPTH24_STENCIL8:case f.iE.DEPTH32F_STENCIL8:return 33306;case 36168:return 36128;default:return 36064}}_validateColorAttachmentPoint(e){if(-1===y._MAX_COLOR_ATTACHMENTS){let{gl:e}=this._context;y._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}let t=e-36064;t+1>y._MAX_COLOR_ATTACHMENTS&&h.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function w(e){return 1===T(e)}function S(e){return 2===T(e)}function M(e){return 0===T(e)}function T(e){return null!=e&&"type"in e?e.type:null}function C(e,t){let r=Math.max(e.width,e.height);if(r>t){h.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);let i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function D(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function P(e){return 6402===e?36096:33306}r(67171),r(21818);var I=r(85079);const O=[new(r(74038)._)("position",2,f.pe.UNSIGNED_SHORT,0,4)];(0,I.Xk)(O),r(66289);const E=new Image;E.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",E.width=5,E.height=5,E.decode();let F=class extends n.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=a.gP.COMPOSITE,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 s.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(){let e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(function(e){return e?e.colorAttachments.length>0?e.colorAttachments:[0]:[1029]}(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0: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}}get requireGeometryDepth(){return!1}queryDepthRange(e){return null}get input(){return this._frameBuffer}};(0,i.Cg)([(0,c.MZ)({constructOnly:!0})],F.prototype,"view",void 0),(0,i.Cg)([(0,c.MZ)({constructOnly:!0})],F.prototype,"consumes",void 0),(0,i.Cg)([(0,c.MZ)()],F.prototype,"produces",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],F.prototype,"techniques",null),F=(0,i.Cg)([(0,u.$)("esri.views.3d.webgl.RenderNode")],F);let A=class extends F{constructor(){super(...arguments),this.consumes={required:["normals"]},this.produces="disabled"}get enabled(){return!this.destroying&&!this.destroyed&&this.produces===a.OG.AMBIENT_ILLUMINATION}get _belowMaxElevation(){return(this.view.state.camera.relativeElevation??1/0)<5e5}get _useGlobalIllumination(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(11)}get _useSSAO(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(3)}_enable(){this.produces=a.OG.AMBIENT_ILLUMINATION,this.requestRender(1)}_disable(){this.produces="disabled",this.requestRender(1)}};(0,i.Cg)([(0,o.MZ)()],A.prototype,"consumes",void 0),(0,i.Cg)([(0,o.MZ)()],A.prototype,"produces",void 0),A=(0,i.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.effects.AmbientIllumination")],A)},16943(e,t,r){r.d(t,{E:()=>o});var i=r(44208);function o(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},94046(e,t,r){r.d(t,{R:()=>o});var i=r(31821);function o(e){e.code.add(i.H`
|
|
1701
|
+
}`)}},20693(e,t,r){r.d(t,{yu:()=>m,NB:()=>f});var i=r(58083),o=r(9093),a=r(35522),n=r(51850),s=r(45324),l=r(23205),c=r(40710),u=(r(33094),r(58029)),d=r(74333);class h extends d.n{constructor(e,t,r){super(e,"mat4",2,(i,o,a)=>i.setUniformMatrix4fv(e,t(o,a),r))}}function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",n.uY):e.uniforms.add(new c.W("cameraPosition",({origin:e},{camera:t})=>(0,a.hZ)(g,t.viewInverseTransposeMatrix[3]-e[0],t.viewInverseTransposeMatrix[7]-e[1],t.viewInverseTransposeMatrix[11]-e[2])))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(s.rS,new h("view",(e,t)=>(0,i.Tl)(p,t.camera.viewMatrix,e.origin)),new c.W("localOrigin",e=>e.origin));let r=({camera:e})=>(0,a.hZ)(g,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(s.rS,new u.F("view",e=>(0,i.Tl)(p,e.camera.viewMatrix,r(e))),new l.d("localOrigin",e=>r(e)))}const p=(0,o.vt)(),g=(0,n.vt)()},45324(e,t,r){var i=r(37585),o=r(48163),a=r(77108),n=r(14314),s=r(33094),l=r(58029);const c=new l.F("view",({camera:e})=>e.viewMatrix),u=(new l.F("inverseViewMatrix",({camera:e})=>e.inverseViewMatrix),new l.F("proj",({camera:e})=>e.projectionMatrix)),d=(new l.F("inverseProjectionMatrix",({camera:e})=>e.inverseProjectionMatrix),new l.F("viewNormal",({camera:e})=>e.viewInverseTransposeMatrix)),h=new a.E("nearFar",({camera:e})=>e.nearFar),m=(new n.I("viewport",({camera:e})=>e.fullViewport),new s.U("pixelRatio",({camera:e})=>e.pixelRatio),new s.U("screenPixelSizePerDistance",({camera:e})=>e.screenPixelSizePerDistance),new s.U("renderPixelSizePerDistance",({camera:e})=>e.renderPixelSizePerDistance),new s.U("metersPerRenderUnit",e=>e.metersPerRenderUnit),new a.E("inverseScreenSize",({camera:e})=>(0,i.hZ)(m,1/e.fullWidth,1/e.fullHeight)),(0,o.vt)());r.d(t,["HO",0,d,"Xl",0,c,"Y$",0,h,"rS",0,u])},32976(e,t,r){r.d(t,{o:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"bool",0,(r,i)=>r.setUniform1b(e,t(i)))}}},77108(e,t,r){r.d(t,{E:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,o)=>i.setUniform2fv(e,t(o),r))}}},68259(e,t,r){r.d(t,{t:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,o,a,n)=>i.setUniform2fv(e,t(o,a,n),r))}}},47286(e,t,r){r.d(t,{G:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,o,a)=>i.setUniform2fv(e,t(o,a),r))}}},23205(e,t,r){r.d(t,{d:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",0,(i,o)=>i.setUniform3fv(e,t(o),r))}}},40710(e,t,r){r.d(t,{W:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",2,(i,o,a,n)=>i.setUniform3fv(e,t(o,a,n),r))}}},33079(e,t,r){r.d(t,{t:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",1,(i,o,a)=>i.setUniform3fv(e,t(o,a),r))}}},14314(e,t,r){r.d(t,{I:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,o)=>i.setUniform4fv(e,t(o),r))}}},71988(e,t,r){r.d(t,{E:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,o,a)=>i.setUniform4fv(e,t(o,a),r))}}},33094(e,t,r){r.d(t,{U:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",0,(i,o)=>i.setUniform1f(e,t(o),r))}}},28421(e,t,r){r.d(t,{J:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",2,(i,o,a)=>i.setUniform1f(e,t(o,a),r))}}},20304(e,t,r){r.d(t,{m:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",1,(i,o,a)=>i.setUniform1f(e,t(o,a),r))}}},35818(e,t,r){r.d(t,{W:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"int",0,(r,i)=>r.setUniform1i(e,t(i)))}}},35644(e,t,r){r.d(t,{k:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"mat3",1,(i,o,a)=>i.setUniformMatrix3fv(e,t(o,a),r))}}},58029(e,t,r){r.d(t,{F:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"mat4",0,(i,o)=>i.setUniformMatrix4fv(e,t(o),r))}}},12791(e,t,r){r.d(t,{x:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},15976(e,t,r){r.d(t,{o:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"sampler2D",2,(i,o,a)=>i.bindTexture(e,t(o,a),r?.(o,a)))}}},63761(e,t,r){r.d(t,{N:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,o)=>r.bindTexture(e,t(i,o)))}}},31821(e,t,r){r.d(t,{If:()=>o});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 o(e,t,r=""){return e?t:r}i.int=e=>e.toFixed(),i.uint=e=>`${Math.max(0,e).toFixed()}u`,i.hexuint=e=>`0x${Math.round(Math.max(0,e)).toString(16)}u`,i.float=e=>e.toPrecision(8),r.d(t,["H",0,i])},13840(e,t,r){r.d(t,{r:()=>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}}},42958(e,t,r){r.d(t,{w:()=>p});var i=r(32198),o=r(69622),a=r(53966),n=r(91429),s=r(63907),l=r(85079),c=r(74038);new c._("position",3,s.pe.FLOAT,0,12);const u=[new c._("position",2,s.pe.FLOAT,0,8)];(0,l.Xk)(u),new c._("position",2,s.pe.FLOAT,0,12),new c._("uv0",2,s.pe.HALF_FLOAT,8,12),r(44208);var d=r(26857),h=r(94656);class m{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,h.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||a.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.get(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}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)}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){if(d.b.ENABLE_OPTIMIZATIONS)return;let r=e.locations;if(t){let 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: ${Array.from(r.keys())} vs ${Array.from(this.locations.keys())}`),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,r){if(!t?.glName){let r=`Texture sampler ${e} in ${this._context.debugBoundTechnique} has no given Texture in ${Error().stack}`;(0,h.en)()&&console.error(r),t=this._context.emptyTexture}let i=this._ensureTextureUnit(e,t);this._context.useProgram(this);let o=i.unit;this.setUniform1i(e,o),this._context.bindTexture(t,o,!1,r)}_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 f=r(90644);let p=class extends o.A{constructor(e,t,r){super({}),this._context=e,this._configuration=t,this.primitiveType=s.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=t.key,this.locations=(0,l.Xk)(r??u),this._pipeline=this.initializePipeline(t),this.reload=async r=>{if(r&&await this.shader.reload(),!this.key.equals(t.key))return void a.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);let i=this.shader.get().build(t);i.debugName=this.declaredClass,this._program=new m(e.rctx,i,this.locations),this._pipeline=this.initializePipeline(t)}}initialize(){let e=this.shader.get().build(this._configuration);e.debugName=this.declaredClass,this._program=new m(this._context.rctx,e,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t,r){return this._pipeline}initializePipeline(e){return(0,f.Ey)({blending:f.RC,colorWrite:f.kn})}};p=(0,i.Cg)([(0,n.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],p)},51976(e,t,r){r.d(t,{K:()=>s,W:()=>l});var i=r(49186),o=r(4576);class a{constructor(e){this._bits=[...e]}equals(e){return(0,o.aI)(this._bits,e.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var n=r(65786);class s extends n.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new a(this._parameterBits),this._key}decode(e=this.key){let t=this._parameterBits;this._parameterBits=[...e.bits];let r=this._parameterNames.map(e=>` ${e}: ${this[e]}`).join("\n");return this._parameterBits=t,r}}function l(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);let o=e.count||2,a=Math.ceil(Math.log2(o)),n=t._parameterBits,s=0;for(;n[s]+a>16;)s++,s>=n.length&&n.push(0);let l=n[s],c=(1<<a)-1<<l;n[s]+=a,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[s]&c)>>l},set(t){let o=this._parameterBits[s];if((o&c)>>l!==t){if(this._key=null,this._parameterBits[s]=o&~c|+t<<l&c,"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[s]&c)>>l)},set(e){let t=this._parameterBits[s];if(!!((t&c)>>l)!==e&&(this._key=null,this._parameterBits[s]=t&~c|+e<<l,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configurationx",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},33779(e,t,r){r.d(t,{o:()=>A});var i=r(32198),o=r(91429),a=r(89904),n=r(69622),s=r(49186),l=r(36708),c=r(10107),u=r(64108),d=r(44208),h=r(53966),m=(r(17676),r(94656)),f=r(63907);r(93637),r(4576),"layout.centroid.smooth.case.mat2x2.mat2x3.mat2x4.mat3x2.mat3x3.mat3x4.mat4x2.mat4x3.mat4x4.uint.uvec2.uvec3.uvec4.samplerCubeShadow.sampler2DArray.sampler2DArrayShadow.isampler2D.isampler3D.isamplerCube.isampler2DArray.usampler2D.usampler3D.usamplerCube.usampler2DArray.coherent.restrict.readonly.writeonly.resource.atomic_uint.noperspective.patch.sample.subroutine.common.partition.active.filter.image1D.image2D.image3D.imageCube.iimage1D.iimage2D.iimage3D.iimageCube.uimage1D.uimage2D.uimage3D.uimageCube.image1DArray.image2DArray.iimage1DArray.iimage2DArray.uimage1DArray.uimage2DArray.image1DShadow.image2DShadow.image1DArrayShadow.image2DArrayShadow.imageBuffer.iimageBuffer.uimageBuffer.sampler1DArray.sampler1DArrayShadow.isampler1D.isampler1DArray.usampler1D.usampler1DArray.isampler2DRect.usampler2DRect.samplerBuffer.isamplerBuffer.usamplerBuffer.sampler2DMS.isampler2DMS.usampler2DMS.sampler2DMSArray.isampler2DMSArray.usampler2DMSArray.trunc.round.roundEven.isnan.isinf.floatBitsToInt.floatBitsToUint.intBitsToFloat.uintBitsToFloat.packSnorm2x16.unpackSnorm2x16.packUnorm2x16.unpackUnorm2x16.packHalf2x16.unpackHalf2x16.outerProduct.transpose.determinant.inverse.texture.textureSize.textureProj.textureLod.textureOffset.texelFetch.texelFetchOffset.textureProjOffset.textureLodOffset.textureProjLod.textureProjLodOffset.textureGrad.textureGradOffset.textureProjGrad.textureProjGradOffset".split("."),"precision.highp.mediump.lowp.attribute.const.uniform.varying.break.continue.do.for.while.if.else.in.out.inout.float.int.void.bool.true.false.discard.return.mat2.mat3.mat4.vec2.vec3.vec4.ivec2.ivec3.ivec4.uvec2.uvec3.uvec4.bvec2.bvec3.bvec4.sampler1D.sampler2D.sampler3D.usampler1D.usampler2D.usampler3D.samplerCube.sampler1DShadow.sampler2DShadow.struct.asm.class.union.enum.typedef.template.this.packed.goto.switch.default.inline.noinline.volatile.public.static.extern.external.interface.long.short.double.half.fixed.unsigned.input.output.hvec2.hvec3.hvec4.dvec2.dvec3.dvec4.fvec2.fvec3.fvec4.sampler2DRect.sampler3DRect.sampler2DRectShadow.sizeof.cast.namespace.using".split("."),"<<= >>= ++ -- << >> <= >= == != && || += -= *= /= %= &= ^^ ^= |= ( ) [ ] . ! ~ * / % + - < > & ^ | ? : = , ; { }".split(" "),"abs.acos.all.any.asin.atan.ceil.clamp.cos.cross.dFdx.dFdy.degrees.distance.dot.equal.exp.exp2.faceforward.floor.fract.gl_BackColor.gl_BackLightModelProduct.gl_BackLightProduct.gl_BackMaterial.gl_BackSecondaryColor.gl_ClipPlane.gl_ClipVertex.gl_Color.gl_DepthRange.gl_DepthRangeParameters.gl_EyePlaneQ.gl_EyePlaneR.gl_EyePlaneS.gl_EyePlaneT.gl_Fog.gl_FogCoord.gl_FogFragCoord.gl_FogParameters.gl_FragColor.gl_FragCoord.gl_FragData.gl_FragDepth.gl_FragDepthEXT.gl_FrontColor.gl_FrontFacing.gl_FrontLightModelProduct.gl_FrontLightProduct.gl_FrontMaterial.gl_FrontSecondaryColor.gl_LightModel.gl_LightModelParameters.gl_LightModelProducts.gl_LightProducts.gl_LightSource.gl_LightSourceParameters.gl_MaterialParameters.gl_MaxClipPlanes.gl_MaxCombinedTextureImageUnits.gl_MaxDrawBuffers.gl_MaxFragmentUniformComponents.gl_MaxLights.gl_MaxTextureCoords.gl_MaxTextureImageUnits.gl_MaxTextureUnits.gl_MaxVaryingFloats.gl_MaxVertexAttribs.gl_MaxVertexTextureImageUnits.gl_MaxVertexUniformComponents.gl_ModelViewMatrix.gl_ModelViewMatrixInverse.gl_ModelViewMatrixInverseTranspose.gl_ModelViewMatrixTranspose.gl_ModelViewProjectionMatrix.gl_ModelViewProjectionMatrixInverse.gl_ModelViewProjectionMatrixInverseTranspose.gl_ModelViewProjectionMatrixTranspose.gl_MultiTexCoord0.gl_MultiTexCoord1.gl_MultiTexCoord2.gl_MultiTexCoord3.gl_MultiTexCoord4.gl_MultiTexCoord5.gl_MultiTexCoord6.gl_MultiTexCoord7.gl_Normal.gl_NormalMatrix.gl_NormalScale.gl_ObjectPlaneQ.gl_ObjectPlaneR.gl_ObjectPlaneS.gl_ObjectPlaneT.gl_Point.gl_PointCoord.gl_PointParameters.gl_PointSize.gl_Position.gl_ProjectionMatrix.gl_ProjectionMatrixInverse.gl_ProjectionMatrixInverseTranspose.gl_ProjectionMatrixTranspose.gl_SecondaryColor.gl_TexCoord.gl_TextureEnvColor.gl_TextureMatrix.gl_TextureMatrixInverse.gl_TextureMatrixInverseTranspose.gl_TextureMatrixTranspose.gl_Vertex.greaterThan.greaterThanEqual.inversesqrt.length.lessThan.lessThanEqual.log.log2.matrixCompMult.max.min.mix.mod.normalize.not.notEqual.pow.radians.reflect.refract.sign.sin.smoothstep.sqrt.step.tan.texture2D.texture2DLod.texture2DProj.texture2DProjLod.textureCube.textureCubeLod.texture2DLodEXT.texture2DProjLodEXT.textureCubeLodEXT.texture2DGradEXT.texture2DProjGradEXT.textureCubeGradEXT.textureSize.texelFetch".split("."),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,d.A)("esri-tests-disable-gpu-memory-measurements"),(0,m.en)();(0,m.en)();r(90644);var p=r(21231),g=r(97768),v=r(48852),x=r(42293);const _=!!(0,d.A)("esri-tests-disable-gpu-memory-measurements");class b{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(f.vt.Renderbuffer,this);let r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);let{width:i,height:o,internalFormat:a,multisampled:n}=t;n?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,a,i,o):r.renderbufferStorage(r.RENDERBUFFER,a,i,o),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){let e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return _?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,x.MW)(e.internalFormat);var e}resize(e,t){let r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;let i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&=(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(f.vt.Renderbuffer,this),null)}}class y{constructor(e,t,r){if(this._context=e,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,e.instanceCounter.increment(f.vt.FramebufferObject,this),null!=t){let r=function(e,t){return w(t)||S(t)?t:M(t)?new p.A(e,t):function(e){return 3===T(e)||null!=e&&"samples"in e}(t)?new b(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(36064,r),w(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(36064)}if(null!=r)if(function(e){return w(e)||M(e)}(r))this._depthStencilTexture=w(r)?r:new p.A(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{let t=S(r)?r:new b(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}get glName(){return this._glName}get colorTexture(){let e=this._colorAttachments.get(36064);return w(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return(this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.width??0}get height(){return(this._colorAttachments.get(36064)??this._depthStencilTexture??this._depthStencilBuffer)?.descriptor?.height??0}get usedMemory(){return this._colorAttachments.values().reduce((e,t)=>e+t.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(e){this._level!==e&&(this._level=e,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){let t=this._colorAttachments.get(e);return t&&w(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=36064){if(!e)return;this._validateColorAttachmentPoint(t);let{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=36064){let t=this._colorAttachments.get(e);if(!t)return;let r=w(t);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(r)this._framebufferTexture2D(null,e);else{let t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._glName){let t=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{e.forEach(e=>{w(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=36064,r=0){let i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,r):this._framebufferTexture2D(i.glName,t,e,36160))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;let{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041!==r&&6402!==r?console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"):34041===r&&i!==f.ld.UNSIGNED_INT_24_8?console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):6402===r&&i!==f.ld.UNSIGNED_INT&&i!==f.ld.UNSIGNED_SHORT?console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,I(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e)}detachDepthStencilTexture(){let e=this._depthStencilTexture;return e&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,I(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;let t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);let{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){let e=this._depthStencilBuffer;if(e&&this._glName){let{_context:t}=this,r=t.boundFramebuffer;t.bindFramebuffer(this);let{gl:i}=t,o=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,o,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){let{_context:t}=this;t.temporaryBindFramebuffer(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,o,a,n){(e<0||t<0||o<0||a<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");let s=n.descriptor;3553!==n.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||a+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");let l=this._context,c=l.bindTexture(n,p.A.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(p.A.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(3553,0,o,a,e,t,r,i),l.bindTexture(c,p.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,a,n){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),n||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,a,n)}async readPixelsAsync(e,t,r,i,o,a,n,s){let{gl:l}=this._context,c=v.g.createPixelPack(this._context,35041,n.byteLength);this._context.bindBuffer(c);let u=this._context.boundFramebuffer;this._context.bindFramebuffer(this),l.readPixels(e,t,r,i,o,a,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(u);try{await c.getSubDataAsync(n,void 0,void 0,void 0,s)}finally{c.dispose()}}resize(e,t){if(this.width===e&&this.height===t)return;let r={width:e,height:t};if(C(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._glName&&(C(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,m.en)())){let{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){let{gl:t}=this._context;this._glName?t.bindFramebuffer(e,this._glName):(this._glName&&t.deleteFramebuffer(this._glName),this._glName=t.createFramebuffer(),t.bindFramebuffer(e,this._glName),this._initializeAttachments(e))}_initializeAttachments(e=36160){let{gl:t}=this._context;if(this._colorAttachments.forEach((t,r)=>{if(w(t)){let i=D(t);35866===i?this._framebufferTextureLayer(t.glName,r,e):this._framebufferTexture2D(t.glName,r,i,e)}else if(S(t)){let i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){let r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){let t=I(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,D(this._depthStencilTexture),e)}(0,m.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(e,t=36064,r=3553,i=36160){this._context.gl.framebufferTexture2D(i,t,r,e,this._level)}_framebufferTextureLayer(e,t=36064,r=36160,i=0){this._context.gl.framebufferTextureLayer(r,t,e,this._level,i)}_disposeDepthStencilAttachments(){let e=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);let t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,g.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&=(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,I(this._depthStencilTexture.descriptor.pixelFormat))),(0,g.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),C(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){C(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width!==e.width||this.height!==e.height)&&console.error("Attachment size must match framebuffer size!")}_getGLAttachmentPoint(e){switch(e.internalFormat){case f.SB.DEPTH_COMPONENT16:case f.SB.DEPTH_COMPONENT24:case f.SB.DEPTH_COMPONENT32F:return 36096;case f.iE.DEPTH24_STENCIL8:case f.iE.DEPTH32F_STENCIL8:return 33306;case 36168:return 36128;default:return 36064}}_validateColorAttachmentPoint(e){if(-1===y._MAX_COLOR_ATTACHMENTS){let{gl:e}=this._context;y._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}let t=e-36064;t+1>y._MAX_COLOR_ATTACHMENTS&&h.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function w(e){return 1===T(e)}function S(e){return 2===T(e)}function M(e){return 0===T(e)}function T(e){return null!=e&&"type"in e?e.type:null}function C(e,t){let r=Math.max(e.width,e.height);if(r>t){h.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);let i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function D(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function I(e){return 6402===e?36096:33306}r(67171),r(21818);var P=r(85079);const O=[new(r(74038)._)("position",2,f.pe.UNSIGNED_SHORT,0,4)];(0,P.Xk)(O),r(66289);const E=new Image;E.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",E.width=5,E.height=5,E.decode();let F=class extends n.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=a.gP.COMPOSITE,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 s.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(){let e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){e.initializeAndBind(),this.gl.drawBuffers(function(e){return e?e.colorAttachments.length>0?e.colorAttachments:[0]:[1029]}(e))}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0: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}}get requireGeometryDepth(){return!1}queryDepthRange(e){return null}get input(){return this._frameBuffer}};(0,i.Cg)([(0,c.MZ)({constructOnly:!0})],F.prototype,"view",void 0),(0,i.Cg)([(0,c.MZ)({constructOnly:!0})],F.prototype,"consumes",void 0),(0,i.Cg)([(0,c.MZ)()],F.prototype,"produces",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],F.prototype,"techniques",null),F=(0,i.Cg)([(0,u.$)("esri.views.3d.webgl.RenderNode")],F);let A=class extends F{constructor(){super(...arguments),this.consumes={required:["normals"]},this.produces="disabled"}get enabled(){return!this.destroying&&!this.destroyed&&this.produces===a.OG.AMBIENT_ILLUMINATION}get _belowMaxElevation(){return(this.view.state.camera.relativeElevation??1/0)<5e5}get _useGlobalIllumination(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(11)}get _useSSAO(){return this._belowMaxElevation&&this.view.stage.renderer.isFeatureEnabled(3)}_enable(){this.produces=a.OG.AMBIENT_ILLUMINATION,this.requestRender(1)}_disable(){this.produces="disabled",this.requestRender(1)}};(0,i.Cg)([(0,o.MZ)()],A.prototype,"consumes",void 0),(0,i.Cg)([(0,o.MZ)()],A.prototype,"produces",void 0),A=(0,i.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.effects.AmbientIllumination")],A)},16943(e,t,r){r.d(t,{E:()=>o});var i=r(44208);function o(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},94046(e,t,r){r.d(t,{R:()=>o});var i=r(31821);function o(e){e.code.add(i.H`
|
|
1702
1702
|
vec3 quantizeGlobalIlluminationColor(vec3 color) {
|
|
1703
1703
|
vec3 clampedColor = clamp(color, vec3(0.0), vec3(1.0));
|
|
1704
1704
|
return floor(clampedColor * ${i.H.float(255)} + 0.5) * ${i.H.float(1/255)};
|
|
@@ -1713,7 +1713,7 @@ smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal)));
|
|
|
1713
1713
|
return snow * snowCover;
|
|
1714
1714
|
}`),e.include(i.d),e.code.add(a.H`void applySnowToMRR(float snow) {
|
|
1715
1715
|
mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
|
|
1716
|
-
}`))}},49718(e,t,r){r(51850),r(6867).w_},6867(e,t,r){r.d(t,{w_:()=>d});var i=r(58083),o=r(9093),a=r(35522),n=r(51850),s=r(78955),l=r(91829),c=r(71351);class u{constructor(){this.intersector=4}get distance(){return this._distance}get renderDistance(){return this._renderDistance}_init(){this._distance=this._renderDistance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4}_setBase(e,t,r,i=null,o=null,a=null){this.intersector=e,this._distance=r,this._renderDistance=i,this.target=t,this.drapedLayerOrder=o,this.renderPriority=a}}class d extends u{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,a.hs)(m,this.ray.direction,this.distance),(0,a.Bw)(m))}withinDistance(e){return!!h(this)&&null!=this.distanceInRenderSpace&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!h(this)&&((0,a.hs)(m,this.ray.direction,this.distance),(0,a.WQ)(e,this.ray.origin,m),!0)}getTransformedNormal(e){return(0,a.C)(f,this.normal),f[3]=0,(0,s.Z0)(f,f,this.transformation),(0,a.C)(e,f),(0,a.S8)(e,e)}constructor(e){super(),this.normal=(0,n.vt)(),this.transformation=(0,o.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){super._init(),e&&(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,u,d){this._setBase(e,t,r,s,u,d),(0,a.C)(this.normal,l??n.Cb),(0,i.C)(this.transformation,c??o.zK)}copy(e){this._setBase(e.intersector,e.target,e.distance,e.renderDistance,e.drapedLayerOrder,e.renderPriority),(0,c.C)(e.ray,this._ray),(0,a.C)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function h(e){return null!=e?.distance&&null!=e?.renderDistance}const m=(0,n.vt)(),f=(0,l.vt)()},16396(e,t,r){r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(35522),o=r(51850),a=r(94008),n=r(57005);const s=new class{constructor(e=0){this.offset=e,this._tmpSphere=new a.iy}applyToVertex(e,t,r,o){let a=this.objectTransform.transform,n=(0,i.hZ)(c,t,r,o),s=(0,i.Z0)(n,n,a),l=this.offset/(0,i.Bw)(s);(0,i.Ln)(s,s,s,l);let u=this.objectTransform.inverse;return(0,i.Z0)(e,s,u),e}applyToMinMax(e,t){let r=this.offset/(0,i.Bw)(e);(0,i.Ln)(e,e,e,r);let o=this.offset/(0,i.Bw)(t);(0,i.Ln)(t,t,t,o)}applyToAabb(e){let 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;let 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){let t=e.center,r=(0,i.Bw)(t),o=this.offset/r;return(0,i.Ln)(this._tmpSphere.center,t,t,o),this._tmpSphere.radius=e.radius+e.radius*this.offset/r,this._tmpSphere}};function l(e){return null==e?null:(s.offset=e,s)}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpMbs=new a.iy,this._tmpObb=new n.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.Bw)(e)}applyToVertex(e,t,r,o){let a=(0,i.hZ)(c,t,r,o),n=(0,i.hZ)(u,t,r,o+this.componentLocalOriginLength),s=this._totalOffset/(0,i.Bw)(n);return(0,i.Ln)(e,a,n,s),e}applyToAabb(e){let t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,a=e[3],n=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),u=Math.abs(o),d=Math.abs(a),h=Math.abs(n),m=Math.abs(s),f=.5*(1+Math.sign(r*a))*Math.min(l,d),p=.5*(1+Math.sign(i*n))*Math.min(c,h),g=.5*(1+Math.sign(o*s))*Math.min(u,m),v=Math.sqrt(f*f+p*p+g*g),x=Math.sign(l+r),_=Math.sign(c+i),b=Math.sign(u+o),y=Math.sign(d+a),w=Math.sign(h+n),S=Math.sign(m+s),M=this._totalOffset;if(v<M)return e[0]-=(1-x)*M,e[1]-=(1-_)*M,e[2]-=(1-b)*M,e[3]+=y*M,e[4]+=w*M,e[5]+=S*M,e;let T=Math.max(l,d),C=Math.max(c,h),D=Math.max(u,m),
|
|
1716
|
+
}`))}},49718(e,t,r){r(51850),r(6867).w_},6867(e,t,r){r.d(t,{w_:()=>d});var i=r(58083),o=r(9093),a=r(35522),n=r(51850),s=r(78955),l=r(91829),c=r(71351);class u{constructor(){this.intersector=4}get distance(){return this._distance}get renderDistance(){return this._renderDistance}_init(){this._distance=this._renderDistance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4}_setBase(e,t,r,i=null,o=null,a=null){this.intersector=e,this._distance=r,this._renderDistance=i,this.target=t,this.drapedLayerOrder=o,this.renderPriority=a}}class d extends u{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,a.hs)(m,this.ray.direction,this.distance),(0,a.Bw)(m))}withinDistance(e){return!!h(this)&&null!=this.distanceInRenderSpace&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!h(this)&&((0,a.hs)(m,this.ray.direction,this.distance),(0,a.WQ)(e,this.ray.origin,m),!0)}getTransformedNormal(e){return(0,a.C)(f,this.normal),f[3]=0,(0,s.Z0)(f,f,this.transformation),(0,a.C)(e,f),(0,a.S8)(e,e)}constructor(e){super(),this.normal=(0,n.vt)(),this.transformation=(0,o.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){super._init(),e&&(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,u,d){this._setBase(e,t,r,s,u,d),(0,a.C)(this.normal,l??n.Cb),(0,i.C)(this.transformation,c??o.zK)}copy(e){this._setBase(e.intersector,e.target,e.distance,e.renderDistance,e.drapedLayerOrder,e.renderPriority),(0,c.C)(e.ray,this._ray),(0,a.C)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function h(e){return null!=e?.distance&&null!=e?.renderDistance}const m=(0,n.vt)(),f=(0,l.vt)()},16396(e,t,r){r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(35522),o=r(51850),a=r(94008),n=r(57005);const s=new class{constructor(e=0){this.offset=e,this._tmpSphere=new a.iy}applyToVertex(e,t,r,o){let a=this.objectTransform.transform,n=(0,i.hZ)(c,t,r,o),s=(0,i.Z0)(n,n,a),l=this.offset/(0,i.Bw)(s);(0,i.Ln)(s,s,s,l);let u=this.objectTransform.inverse;return(0,i.Z0)(e,s,u),e}applyToMinMax(e,t){let r=this.offset/(0,i.Bw)(e);(0,i.Ln)(e,e,e,r);let o=this.offset/(0,i.Bw)(t);(0,i.Ln)(t,t,t,o)}applyToAabb(e){let 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;let 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){let t=e.center,r=(0,i.Bw)(t),o=this.offset/r;return(0,i.Ln)(this._tmpSphere.center,t,t,o),this._tmpSphere.radius=e.radius+e.radius*this.offset/r,this._tmpSphere}};function l(e){return null==e?null:(s.offset=e,s)}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpMbs=new a.iy,this._tmpObb=new n.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.Bw)(e)}applyToVertex(e,t,r,o){let a=(0,i.hZ)(c,t,r,o),n=(0,i.hZ)(u,t,r,o+this.componentLocalOriginLength),s=this._totalOffset/(0,i.Bw)(n);return(0,i.Ln)(e,a,n,s),e}applyToAabb(e){let t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,a=e[3],n=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),u=Math.abs(o),d=Math.abs(a),h=Math.abs(n),m=Math.abs(s),f=.5*(1+Math.sign(r*a))*Math.min(l,d),p=.5*(1+Math.sign(i*n))*Math.min(c,h),g=.5*(1+Math.sign(o*s))*Math.min(u,m),v=Math.sqrt(f*f+p*p+g*g),x=Math.sign(l+r),_=Math.sign(c+i),b=Math.sign(u+o),y=Math.sign(d+a),w=Math.sign(h+n),S=Math.sign(m+s),M=this._totalOffset;if(v<M)return e[0]-=(1-x)*M,e[1]-=(1-_)*M,e[2]-=(1-b)*M,e[3]+=y*M,e[4]+=w*M,e[5]+=S*M,e;let T=Math.max(l,d),C=Math.max(c,h),D=Math.max(u,m),I=M/Math.sqrt(T*T+C*C+D*D),P=M/v,O=P-I,E=-O;return e[0]+=r*(x*E+P),e[1]+=i*(_*E+P),e[2]+=o*(b*E+P),e[3]+=a*(y*O+I),e[4]+=n*(w*O+I),e[5]+=s*(S*O+I),e}applyToMbs(e){let t=e.center,r=(0,i.Bw)(t),o=this._totalOffset/r;return(0,i.Ln)(this._tmpMbs.center,t,t,o),this._tmpMbs.radius=e.radius+e.radius*this._totalOffset/r,this._tmpMbs}applyToObb(e){return(0,n.gm)(e,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this._tmpVertex=(0,o.vt)()}applyToVertex(e,t,r,o){let a=(0,i.hZ)(c,t,r,o),n=(0,i.WQ)(u,a,this.localOrigin),s=this.offset/(0,i.Bw)(n);return(0,i.Ln)(e,a,n,s),e}applyToAabb(e){let t=d,r=h,i=m;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];let o=this.applyToVertex(this._tmpVertex,t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];let a=t=>{let r=this.applyToVertex(this._tmpVertex,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 o=0;o<3;++o)i[o]=e&1<<o?r[o]:t[o];a(i)}let n=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(n|=1<<e);if(0!==n&&7!==n)for(let e=0;e<8;++e)if(0===(n&e)){for(let o=0;o<3;++o)i[o]=n&1<<o?0:e&1<<o?t[o]:r[o];a(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const c=(0,o.vt)(),u=(0,o.vt)(),d=(0,o.vt)(),h=(0,o.vt)(),m=(0,o.vt)()},46606(e,t,r){r.d(t,{S:()=>s,p:()=>l}),r(34727),r(77690),r(29242),r(58083);var i=r(9093),o=(r(35522),r(51850)),a=(r(78955),r(91829),r(31756),r(26857),r(16943),r(65786));class n 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}}(0,i.vt)(),(0,o.vt)(),(0,i.vt)();class s extends n{constructor(){super(...arguments),this.renderOccluded=1,this.emissiveStrength=0,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const l=8},19245(e,t,r){r.d(t,{Um:()=>l,MB:()=>s,kE:()=>a});var i=r(4576),o=r(34727);r(44208);function a(e,t,r,i,a,n){let s=r.screenLength*e.pixelRatio;null!=a&&(c.update(i,t,a,n),s=c.apply(s));let l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.qE)(l*t,r.minWorldLength,r.maxWorldLength)}const n=(0,i.VO)();function s(e,t){let r=!1;for(let i in t){let o=t[i];void 0!==o&&(Array.isArray(o)?(!Array.isArray(e[i])||!n(o,e[i]))&&(e[i]=o.slice(),r=!0):e[i]!==o&&(r=!0,e[i]=o))}return r}const l={multiply:1,ignore:2,replace:3,tint:4},c=new class{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(e,t,r,i){r?(this._scale=Math.min(r.divisor/(t-r.offset),1),this._angleFactor=function(e){return Math.abs(e)**3}(e),this._minScale=null==i?0:Math.min(r.minPixelSize/i,1)):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(e){let{_scale:t,_angleFactor:r,_minScale:i}=this;return e*(0,o.qE)((0,o.Cc)(t,1,r),i,1)}applyVec2(e,t){e[0]=this.apply(t[0]),e[1]=this.apply(t[1])}}},47630(e,t,r){r.d(t,{D:()=>h});var i=r(49255),o=r(47187),a=r(42593),n=r(63365);function s(e){e.code.add("\n vec3 emissionFilter(in vec3 srcColor, float srcAlpha) {\n vec3 color = min(srcColor + vec3(1.0 - srcAlpha), 1.0);\n float m = max(color.r, max(color.g, color.b));\n return m > 0.0 ? color / m : vec3(1.0);\n }\n ")}var l=r(31821),c=r(26934),u=r(58243),d=r(72458);function h(e,t){e.include(a.Q,t),e.include(o.zp,t);let{fragment:r,outputs:h}=e;r.include(n.a);let{output:m,hasEmission:f,oitPremultipliedAlpha:p,snowCover:g,emissionDimmingPass:v,renderOccluded:x}=t,_=11===m,b=(0,i._$)(m),y=(0,i.Rb)(m),w=(0,i._o)(m)&&!b,S=0!==m||x,M=0;(w||b)&&h.add("fragColor","vec4",M++),b&&h.add("fragAlpha","float",M++),f&&h.add("fragEmission","vec4",M++),r.include(n.a),r.include(c.Q),r.include(d.O,t),r.include(u.t,t),v&&r.include(s),r.code.add(l.H`
|
|
1717
1717
|
void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${(0,l.If)(g,", float snow")}) {
|
|
1718
1718
|
${(0,l.If)(_,"finalColor.a = 1.0;")}
|
|
1719
1719
|
${(0,l.If)(S,"if (finalColor.a < alphaCutoff) discard;")}
|
|
@@ -1739,4 +1739,4 @@ float newPeak = 1.0 - d * d / (peak + d - startCompression);
|
|
|
1739
1739
|
color *= newPeak / peak;
|
|
1740
1740
|
float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0 );
|
|
1741
1741
|
return mix(color, vec3(newPeak), g);
|
|
1742
|
-
}`)}},26934(e,t,r){r.d(t,{Q:()=>o});var i=r(49788);function o(e){e.constants.add("alphaCutoff","float",i.Q),e.constants.add("opacityCutoff","float",i.v)}},58243(e,t,r){function i(e,t){t.useFloatBlend?e.code.add("float ditherNoise(vec4 color) { return 0.0; }"):e.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}r.d(t,{t:()=>i})},72458(e,t,r){r.d(t,{C:()=>a,O:()=>n});var i=r(32198),o=r(51976);class a extends o.K{constructor(){super(...arguments),this.useFloatBlend=!0}}function n(e,t){t.useFloatBlend?(e.constants.add("floatBlendOutputScale","float",1),e.constants.add("floatBlendInputScale","float",1)):(e.constants.add("floatBlendOutputScale","float",1/16),e.constants.add("floatBlendInputScale","float",16)),e.constants.add("maxEmissiveStrength","float",16)}(0,i.Cg)([(0,o.W)()],a.prototype,"useFloatBlend",void 0)},89904(e,t,r){r.d(t,{OG:()=>$e,gP:()=>Ge});var i=r(32198),o=r(69540),a=r(91429);let n=class extends o.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],n.prototype,"row",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],n.prototype,"column",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],n.prototype,"rows",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],n.prototype,"columns",void 0),n=(0,i.Cg)([(0,a.$K)("esri.CameraLayout")],n);const s=n;var l=r(69052),c=r(25482),u=r(34727),d=r(78888),h=r(86738),m=r(43937),f=r(36005);let p=class extends((0,o.OU)(c.o)){constructor(...e){super(...e),this.position=new h.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new s}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){let o={position:e};return null!=t&&(o.heading=t),null!=r&&(o.tilt=r),null!=i&&(o.fov=i),o}return e}writePosition(e,t,r,i){let o=e.clone();o.x=(0,d.GB)(e.x||0),o.y=(0,d.GB)(e.y||0),o.z=e.hasZ?(0,d.GB)(e.z||0):e.z,t[r]=o.write({},i)}readPosition(e,t){let r=new h.A;return r.read(e,t),r.x=(0,d.GB)(r.x||0),r.y=(0,d.GB)(r.y||0),r.z=r.hasZ?(0,d.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,i.Cg)([(0,a.MZ)({type:h.A,json:{write:{isRequired:!0}}})],p.prototype,"position",void 0),(0,i.Cg)([(0,m.K)("position")],p.prototype,"writePosition",null),(0,i.Cg)([(0,f.w)("position")],p.prototype,"readPosition",null),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,a.wg)(e=>l.ie.normalize((0,d.GB)(e)))],p.prototype,"heading",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,a.wg)(e=>(0,u.qE)((0,d.GB)(e),-180,180))],p.prototype,"tilt",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,a.wg)(e=>(0,u.qE)((0,d.GB)(e,55),1,170))],p.prototype,"fov",void 0),(0,i.Cg)([(0,a.MZ)({type:s,nonNullable:!0,json:{read:!1,write:!1}})],p.prototype,"layout",void 0),p=(0,i.Cg)([(0,a.$K)("esri.Camera")],p);var g=r(9093),v=r(35522),x=r(51850),_=r(16930),b=(r(48353),r(9762),r(65806)),y=r(27993),w=r(73941),S=(r(19419),r(58083)),M=r(65720),T=r(71351),C=r(69622),D=r(53966),P=r(90629),I=r(37585),O=r(48163),E=r(78955),F=r(91829),A=r(44280);function R(e,t,r){e.worldUpAtPosition(t,B),(0,v.Re)(z,r,t);let i=(0,v.Bw)(z);return 0===i?0:(0,u.XM)((0,v.Om)(z,B)/i)}const B=(0,x.vt)(),z=(0,x.vt)();var N;let j=N=class extends C.A{constructor(e){super(e),this._ray=(0,T.vt)(),this._viewport=(0,F.fA)(0,0,1,1),this._padding=(0,F.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,O.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,g.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,g.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,g.vt)(),this._frustumDirty=!0,this._frustum=(0,M.vt)(),this._fullViewport=(0,F.vt)(),this._fullViewportDirty=!0,this._pixelRatio=1,this.pixelScale=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,x.vt)(),this._up=(0,x.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,"eye")}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,v.Re)(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,S.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get inverseViewMatrix(){return(0,S.Qw)((0,g.vt)(),this.viewMatrix)||this._get("inverseViewMatrix")||(0,g.vt)()}get viewForward(){return this._ensureViewClean(),(0,v.hZ)((0,x.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,v.hZ)((0,x.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,v.hZ)((0,x.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;let e=(0,E.hs)((0,F.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,E.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;let e=(0,E.hs)((0,F.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,E.aI)(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._fullViewportDirty=!0,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._fullViewportDirty=!0,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._fullViewportDirty=!0,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._fullViewportDirty=!0,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._fullViewportDirty&&=(this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this._viewport[2]+this._padding[1]+this._padding[3],this._fullViewport[3]=this._viewport[3]+this._padding[0]+this._padding[2],!1),this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,E.t2)(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,E.C)(this._padding,e),this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&=((0,S.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,S.B8)((0,g.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,g.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,v.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,S.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,S.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){let{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get renderPixelSizePerDistance(){return Math.tan(this.fovX/2)/(this.width/2)}get screenPixelSizePerDistance(){return this.renderPixelSizePerDistance*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){let e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,o=r/this.rows,a=i/this.columns,n=-i/2+this.column*a,s=n+a,l=-r/2+this.row*o,c=l+o,u=(0,S.$h)((0,g.vt)(),n*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),d=this._get("projectionMatrix");return d&&(0,S.t2)(d,u)?d:u}copyFrom(e){(0,v.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,E.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,E.C)(this._padding,e.padding),this.notifyChange("_padding"),this._fullViewportDirty=!0,(0,I.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;let t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,S.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||=((0,M.C)(this._frustum,e.frustum),!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,S.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this.pixelRatio=e.pixelRatio,this.pixelScale=e.pixelScale,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new N).copyFrom(this)}equals(e){return(0,v.t2)(this.eye,e.eye)&&(0,v.t2)(this.center,e.center)&&(0,v.t2)(this.up,e.up)&&(0,E.t2)(this._viewport,e.viewport)&&(0,E.t2)(this._padding,e.padding)&&(0,I.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}equalsView(e){return(0,v.t2)(this.eye,e.eye)&&(0,v.t2)(this.center,e.center)&&(0,v.t2)(this.up,e.up)&&this._fov===e.fov}almostEquals(e){let t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,E.hG)(e.screenPadding,this.screenPadding)>=t||(0,E.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,v.jb)(W,e.eye,e.center),(0,v.jb)(V,this.eye,this.center);let r=(0,v.Om)(W,V),i=(0,v.uE)(W),o=(0,v.uE)(V),a=5e-4;return r*r>=.9999999999*i*o&&(0,v.lo)(e.eye,this.eye)<Math.max(i,o)*a*a}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDistance(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDistance(e){return e*this.renderPixelSizePerDistance}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDistance(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,A.gr)(this.viewForward,(0,v.Re)(W,e,this.eye)))}computeScreenPixelSizeAtDistance(e){return e*this.screenPixelSizePerDistance}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,P.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){let 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!==L&&(0,v.C)(L,e),L[3]=1,(0,E.Z0)(L,L,this.projectionMatrix);let r=Math.abs(L[3]);(0,v.hs)(L,L,1/r);let i=this.fullViewport;t[0]=(0,u.Cc)(0,i[0]+i[2],.5+.5*L[0]),t[1]=(0,u.Cc)(0,i[1]+i[3],.5+.5*L[1]),t[2]=.5*(L[2]+1),t[3]=r}unapplyProjection(e,t){let r=this.fullViewport;L[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],L[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],L[2]=(2*e[2]-1)*e[3],L[3]=e[3],null!=this.inverseProjectionMatrix&&((0,E.Z0)(L,L,this.inverseProjectionMatrix),t[0]=L[0],t[1]=L[1],t[2]=L[2])}projectToScreen(e,t){return null==this.projectToRenderScreen(e,U)?null:(this.renderToScreen(U,t),t)}projectToRenderScreen(e,t){if(L[0]=e[0],L[1]=e[1],L[2]=e[2],L[3]=1,(0,E.Z0)(L,L,this.viewProjectionMatrix),0===L[3])return null;let r=L;(0,v.hs)(r,r,1/Math.abs(L[3]));let i=this.fullViewport,o=(0,u.Cc)(0,i[0]+i[2],.5+.5*r[0]),a=(0,u.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=o,t.y=a):(t[0]=o,t[1]=a,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,U),t)}unprojectFromRenderScreen(e,t){if((0,S.lw)(H,this.projectionMatrix,this.viewMatrix),!(0,S.B8)(H,H))return null;let r=this.fullViewport;return L[0]=2*(e[0]-r[0])/r[2]-1,L[1]=2*(e[1]-r[1])/r[3]-1,L[2]=2*e[2]-1,L[3]=1,(0,E.Z0)(L,L,H),0===L[3]?null:(t[0]=L[0]/L[3],t[1]=L[1]/L[3],t[2]=L[2]/L[3],t)}constrainWindowSize(e,t,r,i){let o=e*this.pixelRatio,a=t*this.pixelRatio,n=Math.max(o-r/2,0),s=Math.max(this.fullHeight-a-i/2,0),l=-Math.min(o-r/2,0),c=-Math.min(this.fullHeight-a-i/2,0),u=r-l- -Math.min(this.fullWidth-o-r/2,0),d=i-c- -Math.min(a-i/2,0);return[Math.round(n),Math.round(s),Math.round(u),Math.round(d)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){let r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){let r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){let{center:r,eye:i,distance:o,fovY:a}=this,n=Math.abs(Math.PI/2-R(t,r,i));return e.frustumCoverage(n,o,a)}_computeUpGlobal(){(0,v.Re)(W,this.center,this.eye);let e=(0,v.Bw)(this.center);e<1?(0,v.t2)(this._up,x.Cb)&&((0,v.C)(this._up,x.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,v.Om)(W,this.center))>.9999*(0,v.Bw)(W)*e||((0,v.$A)(V,W,this.center),(0,v.$A)(V,V,W),(0,v.S8)(V,V),(0,v.t2)(this._up,V)||((0,v.C)(this._up,V),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,v.oW)(W,this.eye,this.center),Math.abs(W[2])<=.9999&&((0,v.hs)(W,W,W[2]),(0,v.hZ)(W,-W[0],-W[1],1-W[2]),(0,v.S8)(W,W),(0,v.t2)(this._up,W)||((0,v.C)(this._up,W),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,v.t2)(e,t)||((0,v.C)(t,e),this._markViewDirty(),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,M.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),!1)}_ensureViewClean(){this._viewDirty&&((0,S.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,i.Cg)([(0,a.MZ)()],j.prototype,"_viewport",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_padding",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_fov",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_nearFar",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_viewDirty",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_viewMatrix",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"pixelRatio",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_pixelRatio",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"pixelScale",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"row",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"column",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_rows",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"rows",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_columns",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"columns",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"eye",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"center",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_center",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"up",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_up",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"viewMatrix",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"inverseViewMatrix",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"viewForward",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"viewUp",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"viewRight",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"nearFar",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"near",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"far",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"viewport",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"screenViewport",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"screenPadding",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"x",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"y",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"width",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"height",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"fullWidth",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"fullHeight",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"_aspect",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"padding",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"projectionMatrix",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"inverseProjectionMatrix",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"fov",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"fovX",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"fovY",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"viewInverseTransposeMatrix",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"_projectionMatrixInternal",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"relativeElevation",void 0),j=N=(0,i.Cg)([(0,a.$K)("esri.views.3d.webgl.RenderCamera")],j);const L=(0,F.vt)(),H=(0,g.vt)(),W=(0,x.vt)(),V=(0,x.vt)(),U=(0,P.r_)();r(49718),r(6867),r(16396),(0,g.vt)(),(0,x.vt)(),(0,x.vt)(),(0,x.vt)();var G=r(5443),k=r(39829),$=r(95108);function Z(e,t,r,i){let o=function(e,t){let r=0===t||2===t?0:1,i=e[t],o=0===t||1===t?1:-1,a=+(0===r);return(e,t,n)=>{if(t[r]<i&&n[r]<i)return 1===o?0:1;if(t[r]>i&&n[r]>i)return+(1===o);let s=(n[a]-t[a])/(n[r]-t[r]),l=t[a]+s*(i-t[r]);return e[r]=i,e[a]=l,(t[r]<i?1:-1)*o>0?2:3}}(r,i);if(e.length=0,t.length){1===o(Y,t[0],t[0])&&q(e,t[0]);for(let r=0;r<t.length;r++){let i=t[r===t.length-1?0:r+1];switch(o(Y,t[r],i)){case 1:q(e,i);break;case 3:q(e,(0,O.o8)(Y));break;case 2:q(e,(0,O.o8)(Y)),q(e,i)}}}}function q(e,t){(0===e.length||!(0,I.aI)(e.at(-1),t))&&e.push(t)}const Y=(0,O.vt)();var X=r(11964),K=r(27921);const J=(0,x.vt)(),Q=(0,x.vt)();function ee(){return{direction:(0,x.vt)(),up:(0,x.vt)()}}function te(e,t,r,i,o){let a=(0,v.S8)(J,e),n=(0,v.Om)(a,i),s=n>0;n=Math.abs(n),n>.99&&(n=Math.abs((0,v.Om)(t,i)),n<.99?((0,v.C)(a,t),s&&(0,v.hs)(a,a,-1)):a=null);let l=0;if(a){(0,v.hs)(Q,i,(0,v.Om)(i,a)),(0,v.Re)(a,a,Q);let e=(0,v.Om)(a,o)/((0,v.Bw)(a)*(0,v.Bw)(o));(0,v.$A)(Q,a,o),l=((0,v.Om)(Q,i)>0?1:-1)*(0,u.KJ)((0,u.XM)(e))}let c=(0,u.KJ)((0,u.XM)(-(0,v.Om)(i,e)/(0,v.Bw)(e)));return r?(r.heading=l,r.tilt=c,r):{heading:l,tilt:c}}function re(e,t,r,i){(0,v.Re)(ie,r,t),!(0,K.T7)(i,(0,X.LV)(t,ie),e)&&e!==r&&(0,v.C)(e,r)}const ie=(0,x.vt)(),oe=(0,x.fA)(0,1,0),ae=(0,x.fA)(0,0,1),ne=(0,g.vt)(),se=(0,x.vt)(),le=(0,x.vt)();function ce(e,t,r,i=ee()){let{direction:o,up:a}=i;return(0,S.N9)(ne,-(0,u.kU)(t)),(0,S.eL)(ne,ne,(0,u.kU)(r)),(0,v.Z0)(o,ae,ne),(0,v.hs)(o,o,-1),(0,v.Z0)(a,oe,ne),i}function ue(e,t,r,i,o){let a=t.lines[11].direction,n=(o-r.getAltitude(i))/a[2];(0,v.Ln)(e,i,a,n)}const de=(0,x.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return te(t,r,i,ae,oe)},eyeForCenterWithHeadingTilt:function(e,t,r,i){let o=ce(0,r,i),a=(0,x.vt)();return(0,v.hs)(a,o.direction,-t),(0,v.WQ)(a,a,e),{up:o.up,eye:a,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,u.kU)(e)},headingTiltToDirectionUp:ce,lookAtTiltToEyeTilt:function(e){return(0,u.KJ)(e)},toArea:function(e,t){let r=e.frustum,{renderCoordsHelper:i}=e,o=i.getAltitude(t),a=e.spatialReference,n=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){let t=r.lines[e];i.intersectInfiniteManifold((0,T.LV)(t.origin,t.direction),o,de)||ue(de,r,i,t.endpoint,o),re(de,n,de,l),s.push((0,O.fA)(de[0],de[1]))}return function(e,t,r){let i=e.map(e=>((0,v.hZ)(de,e[0],e[1],0),t.fromRenderCoords(de,de,r),[de[0],de[1]]));return i.length<=2?new k.A({spatialReference:r}):(i.push(i[0].slice()),(0,$.$3)(i)||i.reverse(),new k.A({rings:[i],spatialReference:r}))}(function(e,t){let r=[],i=[];return Z(r,e,t,0),Z(i,r,t,1),Z(r,i,t,2),Z(i,r,t,3),i}(s,i.extent),i,a)},toExtent:function(e,t,r,i,o){let a=e.renderSpatialReference,n=e.spatialReference??t.spatialReference;return(0,b.g)(t,se,a),(0,b.g)(t,le,a),se[0]-=r/2,le[0]+=r/2,se[1]-=i/2,le[1]+=i/2,(0,y.F)(se,a,se,n),(0,y.F)(le,a,le,n),o?(o.xmin=se[0],o.ymin=se[1],o.xmax=le[0],o.ymax=le[1],o.spatialReference=n):o=new G.A(se[0],se[1],le[0],le[1],n),o}},Symbol.toStringTag,{value:"Module"}));var he=r(34304),me=r(52039),fe=r(94008),pe=r(28735);class ge{get planes(){return this.frustum}get points(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,M.vt)(),this._points=(0,M.Qy)(),this.lines=Array(12),this._origin=(0,x.vt)(),this._direction=(0,x.vt)(),this._boundingSphere=new fe.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,x.vt)(),endpoint:null}}update(e){(0,M.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,v.C)(this._origin,e.eye),(0,v.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}get altitude(){return this._altitude}intersectsSphere(e){return(0,M.m7)(this.frustum,e)}isConvexHullOutsideViewPyramid(e,t){return(0,M.Pi)(this.frustum,e,t)}intersectsRay(e){return(0,M.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,M.ST)(this.frustum,e,t)}lineSegmentIntersectsViewPyramid(e,t){return(0,M.LJ)(this.frustum,e,t)}intersectsPoint(e){return(0,M.bU)(this.frustum,e)}_updateLines(){let e=this._points;for(let t=0;t<4;t++){let r=t+4;ve(this.lines[t],e[t],e[r]),ve(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ve(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){let{origin:e}=this,t=_e;(0,v.S8)(t,this.direction);let r=xe;(0,v.jb)(r,this.points[4],e);let i=.5*(0,v.Om)(r,r)/(0,v.Om)(t,r),o=this._boundingSphere;o.center=(0,v.Ln)(be,e,t,i),o.radius=i}static{this.planePointIndices=M.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ve(e,t,r){e.origin=t,e.endpoint=r,(0,v.oW)(e.direction,t,r)}const xe=(0,x.vt)(),_e=(0,x.vt)(),be=(0,x.vt)();r(86211);const ye=(0,x.fA)(5802e-9,13558e-9,331e-7),we=(0,x.fA)(195e-8,5643e-9,255e-9);(0,x.fA)(ye[0]+we[0],ye[1]+we[1],ye[2]+we[2]);class Se{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Se(0,0)}static{this.Infinite=new Se}}(0,x.vt)(),(0,x.vt)(),new fe.iy,(0,T.vt)(),new G.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Me=r(32728);const Te=(0,x.fA)(0,0,1),Ce=(0,v.S8)((0,x.vt)(),(0,x.fA)(1,1,1)),De=(0,g.vt)(),Pe=(0,x.vt)(),Ie=(0,x.vt)();function Oe(e,t,r,i=ee()){(0,v.$A)(Pe,e,Te),0===(0,v.Om)(Pe,Pe)&&(0,v.$A)(Pe,e,Ce),(0,S.$0)(De,-(0,u.kU)(t),e),(0,S.e$)(De,De,-(0,u.kU)(r),Pe);let{up:o,direction:a}=i;return(0,v.$A)(o,Pe,e),(0,v.S8)(o,o),(0,v.Z0)(o,o,De),(0,v.S8)(a,e),(0,v.ze)(a,a),(0,v.Z0)(a,a,De),i}function Ee(e){let t=e[1];e[1]=-e[2],e[2]=t}function Fe(e,t){return e.up=Oe(t,e.heading,e.tilt).up,e}function Ae(e,t){let{renderCoordsHelper:r,state:i}=e;if(1!==i.viewingMode)return 1;let o=r.getAltitude(t),a=r.referenceEllipsoid.radius,n=1+(0,v.Io)(i.camera.eye,t)/(a+o),s=Math.sqrt(n*n-1),{minCurvature:l,maxCurvature:c,minSamples:d,maxSamples:h}=Be,m=(0,u.qE)((s-l)/(c-l),0,1);return Math.round((0,u.Cc)(d,h,m))}function Re(e,t){let r=[],i=[],o=(0,he.FD)();for(let a=0;a<e.length;a++){let n=e[a],s=a===e.length-1?e[0]:e[a+1],l=(0,X.Cr)(n,s,Ve),c=(0,K.vE)(t,l.origin,l.vector,0,He);switch(c){case 2:r.push(n);break;case 3:i.push(n);break;case 0:case 1:{let[e,a,s]=0===c?[1,r,i]:[-1,i,r],l=(0,K.Qj)(t),u=(0,v.Ln)((0,x.vt)(),He,l,e*o),d=(0,v.Ln)((0,x.vt)(),He,l,e*-o);a.push(n),a.push(u),s.push(d)}}}let a=[];return r.length&&a.push(r),i.length&&a.push(i),a}const Be={minCurvature:(0,u.kU)(5),maxCurvature:(0,u.kU)(50),minSamples:1,maxSamples:6},ze=(0,x.fA)(1,0,0),Ne=(0,x.fA)(0,1,0),je=(0,x.vt)(),Le=(0,x.vt)(),He=(0,x.vt)(),We=new fe.iy,Ve=(0,X.vt)(),Ue=(0,F.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){let o=Pe,a=Ie;return(0,v.S8)(o,e),(0,v.$A)(Ie,o,Te),0===(0,v.Om)(Ie,Ie)&&(0,v.$A)(Ie,o,Ce),(0,v.$A)(a,Ie,o),te(t,r,i,o,a)},eyeForCenterWithHeadingTilt:function(e,t,r,i){let o={eye:(0,x.vt)(),up:null,tilt:i,heading:r},a=Pe;a[0]=e[0],a[1]=e[2],a[2]=-e[1];let n,s=t,l=(0,u.kU)(r),c=(0,u.kU)(i),d=Math.sin(l),h=Math.cos(l),m=Math.sin(c),f=Math.cos(c),p=(0,v.Bw)(a);if(Math.abs(c)<1e-8)n=s+p;else{let e=p/m,t=(0,u.YN)(s/e),r=Math.PI-c-t;n=e*Math.sin(r)}let g=f*s,_=s*s*(m*m),b=h*h*_,y=n-g,w=y*y,S=b*(b+w-a[1]*a[1]);if(S<0)return(0,v.hs)(o.eye,a,n/p),o.tilt=0,Fe(o,e);let M,T=Math.sqrt(S),C=a[1]*y,D=b+w;if(M=h>0?-T+C:T+C,Math.abs(D)<1e-8)return p<1e-8?(o.eye[0]=0,o.eye[1]=0,o.eye[2]=s):(0,v.hs)(o.eye,a,n/p),o.tilt=0,Ee(o.eye),Fe(o,e);o.eye[1]=M/D;let P=d*d*_,I=m*s,O=h*I*o.eye[1],E=o.eye[1]*o.eye[1],F=1-E,A=Math.sqrt(F),R=b*E+P-2*O*A*y+F*w;return Math.abs(R)<1e-8?((0,v.hs)(o.eye,a,n/p),o.tilt=0,Ee(o.eye),Fe(o,e)):(o.eye[0]=(F*(n*a[0]-g*a[0])-I*A*(a[0]*o.eye[1]*h+a[2]*d))/R,o.eye[2]=(F*(n*a[2]-g*a[2])-I*A*(a[2]*o.eye[1]*h-a[0]*d))/R,(0,v.hs)(o.eye,o.eye,n),Ee(o.eye),Fe(o,e))},eyeTiltToLookAtTilt:function(e,t,r){let i=(0,u.kU)(e),o=(0,v.Bw)(t);return(0,u.YN)(r/(o/Math.sin(i)))+i},getCurvatureSamples:Ae,headingTiltToDirectionUp:Oe,lookAtTiltToEyeTilt:function(e,t,r){let i=(0,v.Bw)(t),o=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),a=(0,u.YN)(r/(o/Math.sin(e)));return(0,u.KJ)(e-a)},toArea:function(e,t){let{renderCoordsHelper:r}=e,i=e.state.camera.clone(),o=new ge(r);i.near=2,o.update(i);let a=r.getAltitude(t),n=e.spatialReference,s=i.eye,l=function(e){let{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),c=Ae(e,t),d=i.aboveGround,h=o.planes[5],m=[],f=(0,K.O_)(x.uY,ze,(0,K.vt)()),p=(0,K.O_)(x.uY,Ne,(0,K.vt)());(0,E.hZ)(Ue,0,0,0,0);for(let e=0;e<4;e++){let t=1===e&&!d||3===e&&d?1-l:0,i=1===e&&d||3===e&&!d?l:1,n=o.lines[e],g=o.lines[3===e?0:e+1];for(let o=0;o<c;o++){let l=o/c,d=1===e?1-(1-l)**2:3===e?l**2:l,_=0===o?0:(0,u.Cc)(t,i,d),b=(0,v.Cc)(Le,n.origin,g.origin,_),y=(0,Me.nu)(n.direction,g.direction,_,je);r.intersectManifoldClosestSilhouette((0,T.LV)(b,y),a,He),re(He,s,He,h),m.push((0,x.o8)(He)),0!==m.length&&(0,v.lo)(m.at(-1),He);let w=+!!(0,K.BX)(f,He)|((0,K.BX)(p,He)?2:0);Ue[w]=1}}m.length>2&&(0,v.lo)(m[0],m.at(-1));let g=function(e,t,r){let i=2*(0,he.FD)();return e.map(e=>{let o=[],a=!1;for(let n of e)t.fromRenderCoords(n,He,r),Math.abs(n[0])<i&&Math.abs(n[1])<i?(o.push([null,He[1]]),o.push([null,He[1]]),a=!0):o.push([He[0],He[1]]);if(a)for(let e=0;e<o.length;e++){let t=o[e];if(null!=t[0])continue;let r=o[e+1];t[0]=o.at(0===e?-1:e-1)[0],e++,r[0]=o.at(e===o.length-1?0:e+1)[0]}return o.push(o[0]),(0,$.$3)(o)||o.reverse(),o})}((0,E.m3)(Ue)>1?function(e,t){let r=[];for(let i of e)r.push(...Re(i,t));return r}(Re(m,f),p):[m],r,n);return new k.A({rings:g,spatialReference:n})},toExtent:function(e,t,r,i,o){let a,n,s,c,d=t.latitude,h=(0,w.tO)(e.spatialReference).radius,m=t.longitude,f=function(e,t,r){let i=t/r,o=(0,u.kU)(e),a=Math.sin(i/2),n=Math.cos(o),s=2*(0,u.YN)(Math.sqrt(a*a/(n*n)));return(0,u.KJ)(s)}(d,r,h)/2;a=m-f,n=m+f;let p=(0,u.kU)(d),g=(1+Math.sin(p))/(1-Math.sin(p)),v=(g+1)*Math.tan(i/h/2),x=v*v;function b(e){let t=Math.PI/2;return(e=l.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(s=1.5*Math.PI-2*Math.atan(.5*(v+Math.sqrt(4*g+x))),c=s+i/h,s=b(s),c=b(c),c<s){let e=c;c=s,s=e}if(s=Math.max((0,u.KJ)(s),-90),c=Math.min((0,u.KJ)(c),90),n=me.Y_.monotonic(a,n),n-a>180){let e=(n-a-180)/2;a+=e,n-=e}let y=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:_.A.WGS84;return o?(o.xmin=a,o.ymin=s,o.xmax=n,o.ymax=c,o.spatialReference=y):o=new G.A(a,s,n,c,y),e.spatialReference&&e.spatialReference.isWebMercator&&(0,pe.Gh)(o,!1,o),o}},Symbol.toStringTag,{value:"Module"}));const Ge={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},ke=[Ge.FINAL,Ge.COMPOSITE,Ge.OPAQUE,Ge.TRANSPARENT],$e={ANTIALIASING:"antialiasing",CUTFILL:"cutfill",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA:"focusarea",FOCUSAREA_MASK:"focusarea-mask",GAUSSIAN_SPLAT:"gaussian",GAUSSIAN_SPLAT_DEPTH:"gaussian-depth",GROUND_DEPTH:"ground-depth",HIGHLIGHT:"highlight",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_ACCUMULATION:"shadow-accumulation",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values($e)).concat(ke),(0,x.vt)()},48852(e,t,r){r.d(t,{g:()=>m});var i=r(4576),o=r(44208),a=r(53966),n=r(17676),s=r(78659),l=r(34275),c=r(94656),u=r(63907);const d=()=>a.A.getLogger("esri.views.webgl.BufferObject"),h=!!(0,o.A)("esri-tests-disable-gpu-memory-measurements");class m{static createIndex(e,t,r){return new m(e,34963,t,r)}static createUniform(e,t,r){return new m(e,35345,t,r)}static createPixelPack(e,t=35041,r){let i=new m(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new m(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){let i=new m(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(u.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,c.Y2)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case u.pe.UNSIGNED_INT:return this._sizeBytes/4;case u.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case u.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return h?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&=(this._context.gl.deleteBuffer(this._glName),null),this._context.instanceCounter.decrement(u.vt.BufferObject,this),this._context=null):this._glName&&d().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case u.pe.UNSIGNED_SHORT:e*=2;break;case u.pe.UNSIGNED_INT:e*=4;case u.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;34963===this.bufferType&&((0,l.mg)(e)?this._indexType=u.pe.UNSIGNED_BYTE:(0,l.jq)(e)?this._indexType=u.pe.UNSIGNED_SHORT:(0,l.XJ)(e)&&(this._indexType=u.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;let r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);let i=this._context.gl;null==t?i.bufferData(this.bufferType,e,this.usage):i.bufferData(this.bufferType,t,this.usage),(0,c.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;let o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);let{gl:a}=this._context;a.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,c.Y2)(a),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,o){if(r<0||o<0)return;let a=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(a*((r??0)+(o??0))>e.byteLength)return;t+a*(o??0)>this.usedMemory&&d().warn("Potential problem getting subdata: requested data exceeds buffer size!");let n=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),n.getBufferSubData(35982,t,e,r,o),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),n.getBufferSubData(36662,t,e,r,o),this._context.unbindBuffer(36662))}async getSubDataAsync(e,t=0,r,i,o){if(await this._context.clientWaitAsync((0,s.l5)(10),o),!this._context||!this._glName)throw(0,n.NK)();this.getSubData(e,t,r,i)}}},65786(e,t,r){const i=class{};new i,r.d(t,["Y",0,i])},14113(e,t,r){r.d(t,{N5:()=>s});var i=r(49186),o=(r(44208),r(53966));const a=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class n{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 s extends n{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new f,this.outputs=new p}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){let r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),s=o.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?x:v,u=o.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${u.join("\n")}\n${a.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${d.join("\n")}\n${n.join("\n")}\n${s.join("\n")}`}generateBind(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[0];r&&t.set(e.name,r)});let r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[1];r&&t.set(e.name,r)});let r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let a=0;a<i;++a)r[a](e,o,t)}}generateBindDraw(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[2];r&&t.set(e.name,r)});let r=Array.from(t.values()),i=r.length;return(t,o,a)=>{for(let n=0;n<i;++n)r[n](e,a,t,o)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(let t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null==e)a().error(`Trying to add null Uniform from ${Error().stack}.`);else{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)}}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null==t?`uniform ${r} ${e};`:`uniform ${r} ${e}[${t}];`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(){this._entries=new Map}add(e,t){if(this._entries.has(e))throw new i.A("shaderbuilder:duplicate-input",`Duplicate input for ${e}`);this._entries.set(e,t)}get(e){let t=this._entries.get(e);if(null==t)throw new i.A("shaderbuilder:input-resolver-error",`No resolver for input ${e} found.`);return t()}}class u{constructor(e){this._stage=e,this._bodies=[]}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0){let e=[];for(let t of this._bodies)"string"==typeof t?e.push(t):e.push(...t());return[`void main() {\n ${e.join("\n")||""} \n}`]}if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=[]}add(e){return this._entries.push(e),this._stage}generateSource(){let e=[];for(let t of this._entries)"string"==typeof t?e.push(t):e.push(...t());return e}}class h extends n{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new u(this),this.code=new d(this),this.constants=new g(this),this.inputs=new c}get builder(){return this}}class m{constructor(){this._entries=[]}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 f{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?a().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){let t=[];return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){let i=this._entries.get(r);i?.name===e&&i?.type===t?a().warn(`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}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:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});let t=[];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"uint":i=g._numberToUintStr(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._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])}, ${g._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])}, ${g._numberToUintStr(r[2])}, ${g._numberToUintStr(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 _numberToUintStr(e){return`${e.toFixed(0)}u`}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",x="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,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}}},66289(e,t,r){r.d(t,{R:()=>o});var i=r(48852);class o extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},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 o(e,t,r,i,o=32774,a=32774,n=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:o,opAlpha:a,color:{r:n[0],g:n[1],b:n[2],a:n[3]}}}r.d(t,{Ey:()=>b,nk:()=>d,p3:()=>o}),r(4718);const a=i(0,771),n=(i(1,0),i(1,1),i(1,771)),s=(i(773,1),o(770,1,771,771)),l=o(0,0,768,0),c={face:1029,mode:2305},u={face:1028,mode:2305};function d(e,t,r){return{ref:e,readMask:t,stencilFront:r,stencilBack:r}}function h(e){return S.intern(e)}function m(e){return T.intern(e)}function f(e){return D.intern(e)}function p(e){return I.intern(e)}function g(e){return E.intern(e)}function v(e){return A.intern(e)}function x(e){return B.intern(e)}function _(e){return N.intern(e)}function b(e){return L.intern(e)}class y{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;let t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function w(e){return"["+e.join(",")+"]"}const S=new y(M,e=>({__tag:"Blending",...e}));function M(e){return e?w([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 T=new y(C,e=>({__tag:"Culling",...e}));function C(e){return e?w([e.face,e.mode]):null}const D=new y(P,e=>({__tag:"PolygonOffset",...e}));function P(e){return e?w([e.factor,e.units]):null}const I=new y(O,e=>({__tag:"DepthTest",...e}));function O(e){return e?w([e.func]):null}const E=new y(F,e=>({__tag:"StencilTest",...e}));function F(e){return e?w([e.ref,e.readMask,e.stencilFront.compare,e.stencilFront.fail,e.stencilFront.zFail,e.stencilFront.zPass,e.stencilBack.compare,e.stencilBack.fail,e.stencilBack.zFail,e.stencilBack.zPass]):null}const A=new y(R,e=>({__tag:"DepthWrite",...e}));function R(e){return e?w([e.zNear,e.zFar]):null}const B=new y(z,e=>({__tag:"ColorWrite",...e}));function z(e){return e?w([e.r,e.g,e.b,e.a]):null}const N=new y(j,e=>({__tag:"StencilWrite",...e}));function j(e){return e?w([e.mask]):null}const L=new y(function(e){return e?w([M(e.blending),C(e.culling),P(e.polygonOffset),O(e.depthTest),F(e.stencilTest),R(e.depthWrite),z(e.colorWrite),j(e.stencilWrite)]):null},e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:f(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:_(e.stencilWrite)}));r.d(t,["RC",0,n,"T8",0,s,"Uy",0,{zNear:0,zFar:1},"Xt",0,e=>2===e?c:1===e?u:null,"iD",0,a,"kn",0,{r:!0,g:!0,b:!0,a:!0},"uR",0,l])}}]);
|
|
1742
|
+
}`)}},26934(e,t,r){r.d(t,{Q:()=>o});var i=r(49788);function o(e){e.constants.add("alphaCutoff","float",i.Q),e.constants.add("opacityCutoff","float",i.v)}},58243(e,t,r){function i(e,t){t.useFloatBlend?e.code.add("float ditherNoise(vec4 color) { return 0.0; }"):e.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}r.d(t,{t:()=>i})},72458(e,t,r){r.d(t,{C:()=>a,O:()=>n});var i=r(32198),o=r(51976);class a extends o.K{constructor(){super(...arguments),this.useFloatBlend=!0}}function n(e,t){t.useFloatBlend?(e.constants.add("floatBlendOutputScale","float",1),e.constants.add("floatBlendInputScale","float",1)):(e.constants.add("floatBlendOutputScale","float",1/16),e.constants.add("floatBlendInputScale","float",16)),e.constants.add("maxEmissiveStrength","float",16)}(0,i.Cg)([(0,o.W)()],a.prototype,"useFloatBlend",void 0)},89904(e,t,r){r.d(t,{OG:()=>$e,gP:()=>Ge});var i=r(32198),o=r(69540),a=r(91429);let n=class extends o.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],n.prototype,"row",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],n.prototype,"column",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],n.prototype,"rows",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],n.prototype,"columns",void 0),n=(0,i.Cg)([(0,a.$K)("esri.CameraLayout")],n);const s=n;var l=r(69052),c=r(25482),u=r(34727),d=r(78888),h=r(86738),m=r(43937),f=r(36005);let p=class extends((0,o.OU)(c.o)){constructor(...e){super(...e),this.position=new h.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new s}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){let o={position:e};return null!=t&&(o.heading=t),null!=r&&(o.tilt=r),null!=i&&(o.fov=i),o}return e}writePosition(e,t,r,i){let o=e.clone();o.x=(0,d.GB)(e.x||0),o.y=(0,d.GB)(e.y||0),o.z=e.hasZ?(0,d.GB)(e.z||0):e.z,t[r]=o.write({},i)}readPosition(e,t){let r=new h.A;return r.read(e,t),r.x=(0,d.GB)(r.x||0),r.y=(0,d.GB)(r.y||0),r.z=r.hasZ?(0,d.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,i.Cg)([(0,a.MZ)({type:h.A,json:{write:{isRequired:!0}}})],p.prototype,"position",void 0),(0,i.Cg)([(0,m.K)("position")],p.prototype,"writePosition",null),(0,i.Cg)([(0,f.w)("position")],p.prototype,"readPosition",null),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,a.wg)(e=>l.ie.normalize((0,d.GB)(e)))],p.prototype,"heading",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,a.wg)(e=>(0,u.qE)((0,d.GB)(e),-180,180))],p.prototype,"tilt",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,a.wg)(e=>(0,u.qE)((0,d.GB)(e,55),1,170))],p.prototype,"fov",void 0),(0,i.Cg)([(0,a.MZ)({type:s,nonNullable:!0,json:{read:!1,write:!1}})],p.prototype,"layout",void 0),p=(0,i.Cg)([(0,a.$K)("esri.Camera")],p);var g=r(9093),v=r(35522),x=r(51850),_=r(16930),b=(r(48353),r(9762),r(65806)),y=r(27993),w=r(73941),S=(r(19419),r(58083)),M=r(65720),T=r(71351),C=r(69622),D=r(53966),I=r(90629),P=r(37585),O=r(48163),E=r(78955),F=r(91829),A=r(44280);function R(e,t,r){e.worldUpAtPosition(t,B),(0,v.Re)(z,r,t);let i=(0,v.Bw)(z);return 0===i?0:(0,u.XM)((0,v.Om)(z,B)/i)}const B=(0,x.vt)(),z=(0,x.vt)();var N;let j=N=class extends C.A{constructor(e){super(e),this._ray=(0,T.vt)(),this._viewport=(0,F.fA)(0,0,1,1),this._padding=(0,F.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,O.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,g.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,g.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,g.vt)(),this._frustumDirty=!0,this._frustum=(0,M.vt)(),this._fullViewport=(0,F.vt)(),this._fullViewportDirty=!0,this._pixelRatio=1,this.pixelScale=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,x.vt)(),this._up=(0,x.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,"eye")}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,v.Re)(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,S.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get inverseViewMatrix(){return(0,S.Qw)((0,g.vt)(),this.viewMatrix)||this._get("inverseViewMatrix")||(0,g.vt)()}get viewForward(){return this._ensureViewClean(),(0,v.hZ)((0,x.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,v.hZ)((0,x.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,v.hZ)((0,x.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;let e=(0,E.hs)((0,F.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,E.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;let e=(0,E.hs)((0,F.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,E.aI)(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._fullViewportDirty=!0,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._fullViewportDirty=!0,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._fullViewportDirty=!0,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._fullViewportDirty=!0,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._fullViewportDirty&&=(this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this._viewport[2]+this._padding[1]+this._padding[3],this._fullViewport[3]=this._viewport[3]+this._padding[0]+this._padding[2],!1),this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,E.t2)(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,E.C)(this._padding,e),this._fullViewportDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&=((0,S.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,S.B8)((0,g.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,g.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,v.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,S.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,S.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){let{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get renderPixelSizePerDistance(){return Math.tan(this.fovX/2)/(this.width/2)}get screenPixelSizePerDistance(){return this.renderPixelSizePerDistance*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){let e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,o=r/this.rows,a=i/this.columns,n=-i/2+this.column*a,s=n+a,l=-r/2+this.row*o,c=l+o,u=(0,S.$h)((0,g.vt)(),n*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),d=this._get("projectionMatrix");return d&&(0,S.t2)(d,u)?d:u}copyFrom(e){(0,v.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,E.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,E.C)(this._padding,e.padding),this.notifyChange("_padding"),this._fullViewportDirty=!0,(0,P.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;let t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,S.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||=((0,M.C)(this._frustum,e.frustum),!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,S.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this.pixelRatio=e.pixelRatio,this.pixelScale=e.pixelScale,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new N).copyFrom(this)}equals(e){return(0,v.t2)(this.eye,e.eye)&&(0,v.t2)(this.center,e.center)&&(0,v.t2)(this.up,e.up)&&(0,E.t2)(this._viewport,e.viewport)&&(0,E.t2)(this._padding,e.padding)&&(0,P.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}equalsView(e){return(0,v.t2)(this.eye,e.eye)&&(0,v.t2)(this.center,e.center)&&(0,v.t2)(this.up,e.up)&&this._fov===e.fov}almostEquals(e){let t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,E.hG)(e.screenPadding,this.screenPadding)>=t||(0,E.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,v.jb)(W,e.eye,e.center),(0,v.jb)(V,this.eye,this.center);let r=(0,v.Om)(W,V),i=(0,v.uE)(W),o=(0,v.uE)(V),a=5e-4;return r*r>=.9999999999*i*o&&(0,v.lo)(e.eye,this.eye)<Math.max(i,o)*a*a}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDistance(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDistance(e){return e*this.renderPixelSizePerDistance}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDistance(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,A.gr)(this.viewForward,(0,v.Re)(W,e,this.eye)))}computeScreenPixelSizeAtDistance(e){return e*this.screenPixelSizePerDistance}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,I.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){let 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!==L&&(0,v.C)(L,e),L[3]=1,(0,E.Z0)(L,L,this.projectionMatrix);let r=Math.abs(L[3]);(0,v.hs)(L,L,1/r);let i=this.fullViewport;t[0]=(0,u.Cc)(0,i[0]+i[2],.5+.5*L[0]),t[1]=(0,u.Cc)(0,i[1]+i[3],.5+.5*L[1]),t[2]=.5*(L[2]+1),t[3]=r}unapplyProjection(e,t){let r=this.fullViewport;L[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],L[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],L[2]=(2*e[2]-1)*e[3],L[3]=e[3],null!=this.inverseProjectionMatrix&&((0,E.Z0)(L,L,this.inverseProjectionMatrix),t[0]=L[0],t[1]=L[1],t[2]=L[2])}projectToScreen(e,t){return null==this.projectToRenderScreen(e,U)?null:(this.renderToScreen(U,t),t)}projectToRenderScreen(e,t){if(L[0]=e[0],L[1]=e[1],L[2]=e[2],L[3]=1,(0,E.Z0)(L,L,this.viewProjectionMatrix),0===L[3])return null;let r=L;(0,v.hs)(r,r,1/Math.abs(L[3]));let i=this.fullViewport,o=(0,u.Cc)(0,i[0]+i[2],.5+.5*r[0]),a=(0,u.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=o,t.y=a):(t[0]=o,t[1]=a,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,U),t)}unprojectFromRenderScreen(e,t){if((0,S.lw)(H,this.projectionMatrix,this.viewMatrix),!(0,S.B8)(H,H))return null;let r=this.fullViewport;return L[0]=2*(e[0]-r[0])/r[2]-1,L[1]=2*(e[1]-r[1])/r[3]-1,L[2]=2*e[2]-1,L[3]=1,(0,E.Z0)(L,L,H),0===L[3]?null:(t[0]=L[0]/L[3],t[1]=L[1]/L[3],t[2]=L[2]/L[3],t)}constrainWindowSize(e,t,r,i){let o=e*this.pixelRatio,a=t*this.pixelRatio,n=Math.max(o-r/2,0),s=Math.max(this.fullHeight-a-i/2,0),l=-Math.min(o-r/2,0),c=-Math.min(this.fullHeight-a-i/2,0),u=r-l- -Math.min(this.fullWidth-o-r/2,0),d=i-c- -Math.min(a-i/2,0);return[Math.round(n),Math.round(s),Math.round(u),Math.round(d)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){let r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){let r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){let{center:r,eye:i,distance:o,fovY:a}=this,n=Math.abs(Math.PI/2-R(t,r,i));return e.frustumCoverage(n,o,a)}_computeUpGlobal(){(0,v.Re)(W,this.center,this.eye);let e=(0,v.Bw)(this.center);e<1?(0,v.t2)(this._up,x.Cb)&&((0,v.C)(this._up,x.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,v.Om)(W,this.center))>.9999*(0,v.Bw)(W)*e||((0,v.$A)(V,W,this.center),(0,v.$A)(V,V,W),(0,v.S8)(V,V),(0,v.t2)(this._up,V)||((0,v.C)(this._up,V),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,v.oW)(W,this.eye,this.center),Math.abs(W[2])<=.9999&&((0,v.hs)(W,W,W[2]),(0,v.hZ)(W,-W[0],-W[1],1-W[2]),(0,v.S8)(W,W),(0,v.t2)(this._up,W)||((0,v.C)(this._up,W),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,v.t2)(e,t)||((0,v.C)(t,e),this._markViewDirty(),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,M.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),!1)}_ensureViewClean(){this._viewDirty&&((0,S.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,i.Cg)([(0,a.MZ)()],j.prototype,"_viewport",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_padding",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_fov",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_nearFar",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_viewDirty",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_viewMatrix",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"pixelRatio",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_pixelRatio",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"pixelScale",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"row",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"column",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_rows",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"rows",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_columns",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"columns",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"eye",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"center",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_center",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"up",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"_up",void 0),(0,i.Cg)([(0,a.MZ)()],j.prototype,"viewMatrix",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"inverseViewMatrix",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"viewForward",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"viewUp",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"viewRight",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"nearFar",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"near",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"far",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"viewport",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"screenViewport",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"screenPadding",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"x",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"y",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"width",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"height",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"fullWidth",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"fullHeight",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"_aspect",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"padding",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"projectionMatrix",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"inverseProjectionMatrix",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"fov",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"fovX",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"fovY",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"viewInverseTransposeMatrix",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],j.prototype,"_projectionMatrixInternal",null),(0,i.Cg)([(0,a.MZ)()],j.prototype,"relativeElevation",void 0),j=N=(0,i.Cg)([(0,a.$K)("esri.views.3d.webgl.RenderCamera")],j);const L=(0,F.vt)(),H=(0,g.vt)(),W=(0,x.vt)(),V=(0,x.vt)(),U=(0,I.r_)();r(49718),r(6867),r(16396),(0,g.vt)(),(0,x.vt)(),(0,x.vt)(),(0,x.vt)();var G=r(5443),k=r(39829),$=r(95108);function Z(e,t,r,i){let o=function(e,t){let r=0===t||2===t?0:1,i=e[t],o=0===t||1===t?1:-1,a=+(0===r);return(e,t,n)=>{if(t[r]<i&&n[r]<i)return 1===o?0:1;if(t[r]>i&&n[r]>i)return+(1===o);let s=(n[a]-t[a])/(n[r]-t[r]),l=t[a]+s*(i-t[r]);return e[r]=i,e[a]=l,(t[r]<i?1:-1)*o>0?2:3}}(r,i);if(e.length=0,t.length){1===o(Y,t[0],t[0])&&q(e,t[0]);for(let r=0;r<t.length;r++){let i=t[r===t.length-1?0:r+1];switch(o(Y,t[r],i)){case 1:q(e,i);break;case 3:q(e,(0,O.o8)(Y));break;case 2:q(e,(0,O.o8)(Y)),q(e,i)}}}}function q(e,t){(0===e.length||!(0,P.aI)(e.at(-1),t))&&e.push(t)}const Y=(0,O.vt)();var X=r(11964),K=r(27921);const J=(0,x.vt)(),Q=(0,x.vt)();function ee(){return{direction:(0,x.vt)(),up:(0,x.vt)()}}function te(e,t,r,i,o){let a=(0,v.S8)(J,e),n=(0,v.Om)(a,i),s=n>0;n=Math.abs(n),n>.99&&(n=Math.abs((0,v.Om)(t,i)),n<.99?((0,v.C)(a,t),s&&(0,v.hs)(a,a,-1)):a=null);let l=0;if(a){(0,v.hs)(Q,i,(0,v.Om)(i,a)),(0,v.Re)(a,a,Q);let e=(0,v.Om)(a,o)/((0,v.Bw)(a)*(0,v.Bw)(o));(0,v.$A)(Q,a,o),l=((0,v.Om)(Q,i)>0?1:-1)*(0,u.KJ)((0,u.XM)(e))}let c=(0,u.KJ)((0,u.XM)(-(0,v.Om)(i,e)/(0,v.Bw)(e)));return r?(r.heading=l,r.tilt=c,r):{heading:l,tilt:c}}function re(e,t,r,i){(0,v.Re)(ie,r,t),!(0,K.T7)(i,(0,X.LV)(t,ie),e)&&e!==r&&(0,v.C)(e,r)}const ie=(0,x.vt)(),oe=(0,x.fA)(0,1,0),ae=(0,x.fA)(0,0,1),ne=(0,g.vt)(),se=(0,x.vt)(),le=(0,x.vt)();function ce(e,t,r,i=ee()){let{direction:o,up:a}=i;return(0,S.N9)(ne,-(0,u.kU)(t)),(0,S.eL)(ne,ne,(0,u.kU)(r)),(0,v.Z0)(o,ae,ne),(0,v.hs)(o,o,-1),(0,v.Z0)(a,oe,ne),i}function ue(e,t,r,i,o){let a=t.lines[11].direction,n=(o-r.getAltitude(i))/a[2];(0,v.Ln)(e,i,a,n)}const de=(0,x.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return te(t,r,i,ae,oe)},eyeForCenterWithHeadingTilt:function(e,t,r,i){let o=ce(0,r,i),a=(0,x.vt)();return(0,v.hs)(a,o.direction,-t),(0,v.WQ)(a,a,e),{up:o.up,eye:a,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,u.kU)(e)},headingTiltToDirectionUp:ce,lookAtTiltToEyeTilt:function(e){return(0,u.KJ)(e)},toArea:function(e,t){let r=e.frustum,{renderCoordsHelper:i}=e,o=i.getAltitude(t),a=e.spatialReference,n=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){let t=r.lines[e];i.intersectInfiniteManifold((0,T.LV)(t.origin,t.direction),o,de)||ue(de,r,i,t.endpoint,o),re(de,n,de,l),s.push((0,O.fA)(de[0],de[1]))}return function(e,t,r){let i=e.map(e=>((0,v.hZ)(de,e[0],e[1],0),t.fromRenderCoords(de,de,r),[de[0],de[1]]));return i.length<=2?new k.A({spatialReference:r}):(i.push(i[0].slice()),(0,$.$3)(i)||i.reverse(),new k.A({rings:[i],spatialReference:r}))}(function(e,t){let r=[],i=[];return Z(r,e,t,0),Z(i,r,t,1),Z(r,i,t,2),Z(i,r,t,3),i}(s,i.extent),i,a)},toExtent:function(e,t,r,i,o){let a=e.renderSpatialReference,n=e.spatialReference??t.spatialReference;return(0,b.g)(t,se,a),(0,b.g)(t,le,a),se[0]-=r/2,le[0]+=r/2,se[1]-=i/2,le[1]+=i/2,(0,y.F)(se,a,se,n),(0,y.F)(le,a,le,n),o?(o.xmin=se[0],o.ymin=se[1],o.xmax=le[0],o.ymax=le[1],o.spatialReference=n):o=new G.A(se[0],se[1],le[0],le[1],n),o}},Symbol.toStringTag,{value:"Module"}));var he=r(34304),me=r(52039),fe=r(94008),pe=r(28735);class ge{get planes(){return this.frustum}get points(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,M.vt)(),this._points=(0,M.Qy)(),this.lines=Array(12),this._origin=(0,x.vt)(),this._direction=(0,x.vt)(),this._boundingSphere=new fe.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,x.vt)(),endpoint:null}}update(e){(0,M.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,v.C)(this._origin,e.eye),(0,v.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}get altitude(){return this._altitude}intersectsSphere(e){return(0,M.m7)(this.frustum,e)}isConvexHullOutsideViewPyramid(e,t){return(0,M.Pi)(this.frustum,e,t)}intersectsRay(e){return(0,M.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,M.ST)(this.frustum,e,t)}lineSegmentIntersectsViewPyramid(e,t){return(0,M.LJ)(this.frustum,e,t)}intersectsPoint(e){return(0,M.bU)(this.frustum,e)}_updateLines(){let e=this._points;for(let t=0;t<4;t++){let r=t+4;ve(this.lines[t],e[t],e[r]),ve(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ve(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){let{origin:e}=this,t=_e;(0,v.S8)(t,this.direction);let r=xe;(0,v.jb)(r,this.points[4],e);let i=.5*(0,v.Om)(r,r)/(0,v.Om)(t,r),o=this._boundingSphere;o.center=(0,v.Ln)(be,e,t,i),o.radius=i}static{this.planePointIndices=M.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ve(e,t,r){e.origin=t,e.endpoint=r,(0,v.oW)(e.direction,t,r)}const xe=(0,x.vt)(),_e=(0,x.vt)(),be=(0,x.vt)();r(86211);const ye=(0,x.fA)(5802e-9,13558e-9,331e-7),we=(0,x.fA)(195e-8,5643e-9,255e-9);(0,x.fA)(ye[0]+we[0],ye[1]+we[1],ye[2]+we[2]);class Se{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Se(0,0)}static{this.Infinite=new Se}}(0,x.vt)(),(0,x.vt)(),new fe.iy,(0,T.vt)(),new G.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Me=r(32728);const Te=(0,x.fA)(0,0,1),Ce=(0,v.S8)((0,x.vt)(),(0,x.fA)(1,1,1)),De=(0,g.vt)(),Ie=(0,x.vt)(),Pe=(0,x.vt)();function Oe(e,t,r,i=ee()){(0,v.$A)(Ie,e,Te),0===(0,v.Om)(Ie,Ie)&&(0,v.$A)(Ie,e,Ce),(0,S.$0)(De,-(0,u.kU)(t),e),(0,S.e$)(De,De,-(0,u.kU)(r),Ie);let{up:o,direction:a}=i;return(0,v.$A)(o,Ie,e),(0,v.S8)(o,o),(0,v.Z0)(o,o,De),(0,v.S8)(a,e),(0,v.ze)(a,a),(0,v.Z0)(a,a,De),i}function Ee(e){let t=e[1];e[1]=-e[2],e[2]=t}function Fe(e,t){return e.up=Oe(t,e.heading,e.tilt).up,e}function Ae(e,t){let{renderCoordsHelper:r,state:i}=e;if(1!==i.viewingMode)return 1;let o=r.getAltitude(t),a=r.referenceEllipsoid.radius,n=1+(0,v.Io)(i.camera.eye,t)/(a+o),s=Math.sqrt(n*n-1),{minCurvature:l,maxCurvature:c,minSamples:d,maxSamples:h}=Be,m=(0,u.qE)((s-l)/(c-l),0,1);return Math.round((0,u.Cc)(d,h,m))}function Re(e,t){let r=[],i=[],o=(0,he.FD)();for(let a=0;a<e.length;a++){let n=e[a],s=a===e.length-1?e[0]:e[a+1],l=(0,X.Cr)(n,s,Ve),c=(0,K.vE)(t,l.origin,l.vector,0,He);switch(c){case 2:r.push(n);break;case 3:i.push(n);break;case 0:case 1:{let[e,a,s]=0===c?[1,r,i]:[-1,i,r],l=(0,K.Qj)(t),u=(0,v.Ln)((0,x.vt)(),He,l,e*o),d=(0,v.Ln)((0,x.vt)(),He,l,e*-o);a.push(n),a.push(u),s.push(d)}}}let a=[];return r.length&&a.push(r),i.length&&a.push(i),a}const Be={minCurvature:(0,u.kU)(5),maxCurvature:(0,u.kU)(50),minSamples:1,maxSamples:6},ze=(0,x.fA)(1,0,0),Ne=(0,x.fA)(0,1,0),je=(0,x.vt)(),Le=(0,x.vt)(),He=(0,x.vt)(),We=new fe.iy,Ve=(0,X.vt)(),Ue=(0,F.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){let o=Ie,a=Pe;return(0,v.S8)(o,e),(0,v.$A)(Pe,o,Te),0===(0,v.Om)(Pe,Pe)&&(0,v.$A)(Pe,o,Ce),(0,v.$A)(a,Pe,o),te(t,r,i,o,a)},eyeForCenterWithHeadingTilt:function(e,t,r,i){let o={eye:(0,x.vt)(),up:null,tilt:i,heading:r},a=Ie;a[0]=e[0],a[1]=e[2],a[2]=-e[1];let n,s=t,l=(0,u.kU)(r),c=(0,u.kU)(i),d=Math.sin(l),h=Math.cos(l),m=Math.sin(c),f=Math.cos(c),p=(0,v.Bw)(a);if(Math.abs(c)<1e-8)n=s+p;else{let e=p/m,t=(0,u.YN)(s/e),r=Math.PI-c-t;n=e*Math.sin(r)}let g=f*s,_=s*s*(m*m),b=h*h*_,y=n-g,w=y*y,S=b*(b+w-a[1]*a[1]);if(S<0)return(0,v.hs)(o.eye,a,n/p),o.tilt=0,Fe(o,e);let M,T=Math.sqrt(S),C=a[1]*y,D=b+w;if(M=h>0?-T+C:T+C,Math.abs(D)<1e-8)return p<1e-8?(o.eye[0]=0,o.eye[1]=0,o.eye[2]=s):(0,v.hs)(o.eye,a,n/p),o.tilt=0,Ee(o.eye),Fe(o,e);o.eye[1]=M/D;let I=d*d*_,P=m*s,O=h*P*o.eye[1],E=o.eye[1]*o.eye[1],F=1-E,A=Math.sqrt(F),R=b*E+I-2*O*A*y+F*w;return Math.abs(R)<1e-8?((0,v.hs)(o.eye,a,n/p),o.tilt=0,Ee(o.eye),Fe(o,e)):(o.eye[0]=(F*(n*a[0]-g*a[0])-P*A*(a[0]*o.eye[1]*h+a[2]*d))/R,o.eye[2]=(F*(n*a[2]-g*a[2])-P*A*(a[2]*o.eye[1]*h-a[0]*d))/R,(0,v.hs)(o.eye,o.eye,n),Ee(o.eye),Fe(o,e))},eyeTiltToLookAtTilt:function(e,t,r){let i=(0,u.kU)(e),o=(0,v.Bw)(t);return(0,u.YN)(r/(o/Math.sin(i)))+i},getCurvatureSamples:Ae,headingTiltToDirectionUp:Oe,lookAtTiltToEyeTilt:function(e,t,r){let i=(0,v.Bw)(t),o=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),a=(0,u.YN)(r/(o/Math.sin(e)));return(0,u.KJ)(e-a)},toArea:function(e,t){let{renderCoordsHelper:r}=e,i=e.state.camera.clone(),o=new ge(r);i.near=2,o.update(i);let a=r.getAltitude(t),n=e.spatialReference,s=i.eye,l=function(e){let{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),c=Ae(e,t),d=i.aboveGround,h=o.planes[5],m=[],f=(0,K.O_)(x.uY,ze,(0,K.vt)()),p=(0,K.O_)(x.uY,Ne,(0,K.vt)());(0,E.hZ)(Ue,0,0,0,0);for(let e=0;e<4;e++){let t=1===e&&!d||3===e&&d?1-l:0,i=1===e&&d||3===e&&!d?l:1,n=o.lines[e],g=o.lines[3===e?0:e+1];for(let o=0;o<c;o++){let l=o/c,d=1===e?1-(1-l)**2:3===e?l**2:l,_=0===o?0:(0,u.Cc)(t,i,d),b=(0,v.Cc)(Le,n.origin,g.origin,_),y=(0,Me.nu)(n.direction,g.direction,_,je);r.intersectManifoldClosestSilhouette((0,T.LV)(b,y),a,He),re(He,s,He,h),m.push((0,x.o8)(He)),0!==m.length&&(0,v.lo)(m.at(-1),He);let w=+!!(0,K.BX)(f,He)|((0,K.BX)(p,He)?2:0);Ue[w]=1}}m.length>2&&(0,v.lo)(m[0],m.at(-1));let g=function(e,t,r){let i=2*(0,he.FD)();return e.map(e=>{let o=[],a=!1;for(let n of e)t.fromRenderCoords(n,He,r),Math.abs(n[0])<i&&Math.abs(n[1])<i?(o.push([null,He[1]]),o.push([null,He[1]]),a=!0):o.push([He[0],He[1]]);if(a)for(let e=0;e<o.length;e++){let t=o[e];if(null!=t[0])continue;let r=o[e+1];t[0]=o.at(0===e?-1:e-1)[0],e++,r[0]=o.at(e===o.length-1?0:e+1)[0]}return o.push(o[0]),(0,$.$3)(o)||o.reverse(),o})}((0,E.m3)(Ue)>1?function(e,t){let r=[];for(let i of e)r.push(...Re(i,t));return r}(Re(m,f),p):[m],r,n);return new k.A({rings:g,spatialReference:n})},toExtent:function(e,t,r,i,o){let a,n,s,c,d=t.latitude,h=(0,w.tO)(e.spatialReference).radius,m=t.longitude,f=function(e,t,r){let i=t/r,o=(0,u.kU)(e),a=Math.sin(i/2),n=Math.cos(o),s=2*(0,u.YN)(Math.sqrt(a*a/(n*n)));return(0,u.KJ)(s)}(d,r,h)/2;a=m-f,n=m+f;let p=(0,u.kU)(d),g=(1+Math.sin(p))/(1-Math.sin(p)),v=(g+1)*Math.tan(i/h/2),x=v*v;function b(e){let t=Math.PI/2;return(e=l.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(s=1.5*Math.PI-2*Math.atan(.5*(v+Math.sqrt(4*g+x))),c=s+i/h,s=b(s),c=b(c),c<s){let e=c;c=s,s=e}if(s=Math.max((0,u.KJ)(s),-90),c=Math.min((0,u.KJ)(c),90),n=me.Y_.monotonic(a,n),n-a>180){let e=(n-a-180)/2;a+=e,n-=e}let y=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:_.A.WGS84;return o?(o.xmin=a,o.ymin=s,o.xmax=n,o.ymax=c,o.spatialReference=y):o=new G.A(a,s,n,c,y),e.spatialReference&&e.spatialReference.isWebMercator&&(0,pe.Gh)(o,!1,o),o}},Symbol.toStringTag,{value:"Module"}));const Ge={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},ke=[Ge.FINAL,Ge.COMPOSITE,Ge.OPAQUE,Ge.TRANSPARENT],$e={ANTIALIASING:"antialiasing",CUTFILL:"cutfill",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA:"focusarea",FOCUSAREA_MASK:"focusarea-mask",GAUSSIAN_SPLAT:"gaussian",GAUSSIAN_SPLAT_DEPTH:"gaussian-depth",GROUND_DEPTH:"ground-depth",HIGHLIGHT:"highlight",LASERLINES:"laserlines",TRANSPARENT_NO_DEPTH:"transparent-no-depth",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",TRANSPARENT_ENVIRONMENT:"transparent-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_ACCUMULATION:"shadow-accumulation",SHADOWMAP:"shadowmap",SHADOW_HIGHLIGHT:"shadow-highlight",VOXEL:"voxel",VIEWSHED:"viewshed",OBJECT_AND_LAYER_ID_COLOR:"olid"};Array.from(Object.values($e)).concat(ke),(0,x.vt)()},48852(e,t,r){r.d(t,{g:()=>m});var i=r(4576),o=r(44208),a=r(53966),n=r(17676),s=r(78659),l=r(34275),c=r(94656),u=r(63907);const d=()=>a.A.getLogger("esri.views.webgl.BufferObject"),h=!!(0,o.A)("esri-tests-disable-gpu-memory-measurements");class m{static createIndex(e,t,r){return new m(e,34963,t,r)}static createUniform(e,t,r){return new m(e,35345,t,r)}static createPixelPack(e,t=35041,r){let i=new m(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new m(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){let i=new m(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(u.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,c.Y2)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case u.pe.UNSIGNED_INT:return this._sizeBytes/4;case u.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case u.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return h?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&=(this._context.gl.deleteBuffer(this._glName),null),this._context.instanceCounter.decrement(u.vt.BufferObject,this),this._context=null):this._glName&&d().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case u.pe.UNSIGNED_SHORT:e*=2;break;case u.pe.UNSIGNED_INT:e*=4;case u.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;34963===this.bufferType&&((0,l.mg)(e)?this._indexType=u.pe.UNSIGNED_BYTE:(0,l.jq)(e)?this._indexType=u.pe.UNSIGNED_SHORT:(0,l.XJ)(e)&&(this._indexType=u.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;let r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);let i=this._context.gl;null==t?i.bufferData(this.bufferType,e,this.usage):i.bufferData(this.bufferType,t,this.usage),(0,c.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;let o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);let{gl:a}=this._context;a.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,c.Y2)(a),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,o){if(r<0||o<0)return;let a=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(a*((r??0)+(o??0))>e.byteLength)return;t+a*(o??0)>this.usedMemory&&d().warn("Potential problem getting subdata: requested data exceeds buffer size!");let n=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),n.getBufferSubData(35982,t,e,r,o),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),n.getBufferSubData(36662,t,e,r,o),this._context.unbindBuffer(36662))}async getSubDataAsync(e,t=0,r,i,o){if(await this._context.clientWaitAsync((0,s.l5)(10),o),!this._context||!this._glName)throw(0,n.NK)();this.getSubData(e,t,r,i)}}},65786(e,t,r){const i=class{};new i,r.d(t,["Y",0,i])},14113(e,t,r){r.d(t,{N5:()=>s});var i=r(49186),o=(r(44208),r(53966));const a=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class n{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 s extends n{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new f,this.outputs=new p}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){let r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),s=o.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?x:v,u=o.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${u.join("\n")}\n${a.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${d.join("\n")}\n${n.join("\n")}\n${s.join("\n")}`}generateBind(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[0];r&&t.set(e.name,r)});let r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[1];r&&t.set(e.name,r)});let r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let a=0;a<i;++a)r[a](e,o,t)}}generateBindDraw(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{let r=e.bind[2];r&&t.set(e.name,r)});let r=Array.from(t.values()),i=r.length;return(t,o,a)=>{for(let n=0;n<i;++n)r[n](e,a,t,o)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(let t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null==e)a().error(`Trying to add null Uniform from ${Error().stack}.`);else{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)}}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null==t?`uniform ${r} ${e};`:`uniform ${r} ${e}[${t}];`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(){this._entries=new Map}add(e,t){if(this._entries.has(e))throw new i.A("shaderbuilder:duplicate-input",`Duplicate input for ${e}`);this._entries.set(e,t)}get(e){let t=this._entries.get(e);if(null==t)throw new i.A("shaderbuilder:input-resolver-error",`No resolver for input ${e} found.`);return t()}}class u{constructor(e){this._stage=e,this._bodies=[]}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0){let e=[];for(let t of this._bodies)"string"==typeof t?e.push(t):e.push(...t());return[`void main() {\n ${e.join("\n")||""} \n}`]}if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=[]}add(e){return this._entries.push(e),this._stage}generateSource(){let e=[];for(let t of this._entries)"string"==typeof t?e.push(t):e.push(...t());return e}}class h extends n{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new u(this),this.code=new d(this),this.constants=new g(this),this.inputs=new c}get builder(){return this}}class m{constructor(){this._entries=[]}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 f{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?a().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){let t=[];return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){let i=this._entries.get(r);i?.name===e&&i?.type===t?a().warn(`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}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:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});let t=[];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"uint":i=g._numberToUintStr(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._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])}, ${g._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToUintStr(r[0])}, ${g._numberToUintStr(r[1])}, ${g._numberToUintStr(r[2])}, ${g._numberToUintStr(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 _numberToUintStr(e){return`${e.toFixed(0)}u`}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",x="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,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}}},66289(e,t,r){r.d(t,{R:()=>o});var i=r(48852);class o extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},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 o(e,t,r,i,o=32774,a=32774,n=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:o,opAlpha:a,color:{r:n[0],g:n[1],b:n[2],a:n[3]}}}r.d(t,{Ey:()=>b,nk:()=>d,p3:()=>o}),r(4718);const a=i(0,771),n=(i(1,0),i(1,1),i(1,771)),s=(i(773,1),o(770,1,771,771)),l=o(0,0,768,0),c={face:1029,mode:2305},u={face:1028,mode:2305};function d(e,t,r){return{ref:e,readMask:t,stencilFront:r,stencilBack:r}}function h(e){return S.intern(e)}function m(e){return T.intern(e)}function f(e){return D.intern(e)}function p(e){return P.intern(e)}function g(e){return E.intern(e)}function v(e){return A.intern(e)}function x(e){return B.intern(e)}function _(e){return N.intern(e)}function b(e){return L.intern(e)}class y{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;let t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function w(e){return"["+e.join(",")+"]"}const S=new y(M,e=>({__tag:"Blending",...e}));function M(e){return e?w([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 T=new y(C,e=>({__tag:"Culling",...e}));function C(e){return e?w([e.face,e.mode]):null}const D=new y(I,e=>({__tag:"PolygonOffset",...e}));function I(e){return e?w([e.factor,e.units]):null}const P=new y(O,e=>({__tag:"DepthTest",...e}));function O(e){return e?w([e.func]):null}const E=new y(F,e=>({__tag:"StencilTest",...e}));function F(e){return e?w([e.ref,e.readMask,e.stencilFront.compare,e.stencilFront.fail,e.stencilFront.zFail,e.stencilFront.zPass,e.stencilBack.compare,e.stencilBack.fail,e.stencilBack.zFail,e.stencilBack.zPass]):null}const A=new y(R,e=>({__tag:"DepthWrite",...e}));function R(e){return e?w([e.zNear,e.zFar]):null}const B=new y(z,e=>({__tag:"ColorWrite",...e}));function z(e){return e?w([e.r,e.g,e.b,e.a]):null}const N=new y(j,e=>({__tag:"StencilWrite",...e}));function j(e){return e?w([e.mask]):null}const L=new y(function(e){return e?w([M(e.blending),C(e.culling),I(e.polygonOffset),O(e.depthTest),F(e.stencilTest),R(e.depthWrite),z(e.colorWrite),j(e.stencilWrite)]):null},e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:f(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:_(e.stencilWrite)}));r.d(t,["RC",0,n,"T8",0,s,"Uy",0,{zNear:0,zFar:1},"Xt",0,e=>2===e?c:1===e?u:null,"iD",0,a,"kn",0,{r:!0,g:!0,b:!0,a:!0},"uR",0,l])}}]);
|