@arcgis/core 4.31.0-next.20240705 → 4.31.0-next.20240708

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.
Files changed (82) hide show
  1. package/arcade/functions/geomasync.js +1 -1
  2. package/arcade/functions/geomsync.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{734844c5bef28f609a8c.js → 17c37078ab65f8d4046b.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{3edc527a24cb9a4868e5.js → 20d0390504e4cc9f93f4.js} +1 -1
  6. package/assets/esri/core/workers/chunks/291bdab5737152bc1825.js +1 -0
  7. package/assets/esri/core/workers/chunks/{ef8ba10380053ea4c4dd.js → 34ea46659c8cebec3ffa.js} +1 -1
  8. package/assets/esri/core/workers/chunks/3de4fe7458b7844e2aae.js +1 -0
  9. package/assets/esri/core/workers/chunks/413609b0aa85f2052154.js +1 -0
  10. package/assets/esri/core/workers/chunks/5089a12084a8a8fb93d8.js +1 -0
  11. package/assets/esri/core/workers/chunks/527932bf4c31cec46922.js +1 -0
  12. package/assets/esri/core/workers/chunks/65d34a9d408c678de2ca.js +1 -0
  13. package/assets/esri/core/workers/chunks/{5d0761c14d6ee53dd653.js → 7447883bb4a981e6d759.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{86f3ef84cc27de6d8540.js → 87f33a60768801ca1ce8.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{a734359619e3eb955399.js → b4d850e82a8ae902d684.js} +1 -1
  16. package/assets/esri/core/workers/chunks/d85c51abde781660b1f5.js +1 -0
  17. package/assets/esri/core/workers/chunks/{5afc1562bb5c20127ef1.js → e840e54455eb500b501d.js} +18 -18
  18. package/assets/esri/themes/base/widgets/_Tooltip.scss +4 -0
  19. package/assets/esri/themes/dark/main.css +1 -1
  20. package/assets/esri/themes/light/main.css +1 -1
  21. package/assets/esri/themes/light/view.css +1 -1
  22. package/chunks/ChapmanAtmosphere.glsl.js +1 -1
  23. package/chunks/ComponentShader.glsl.js +3 -3
  24. package/chunks/DefaultMaterial.glsl.js +1 -1
  25. package/chunks/EdgeShader.glsl.js +5 -6
  26. package/chunks/Heatmap.glsl.js +4 -4
  27. package/chunks/HighlightApply.glsl.js +172 -135
  28. package/chunks/LineCallout.glsl.js +4 -4
  29. package/chunks/MeasurementArrow.glsl.js +5 -5
  30. package/chunks/RealisticTree.glsl.js +2 -2
  31. package/chunks/Terrain.glsl.js +39 -39
  32. package/geometry/Polyline.js +1 -1
  33. package/geometry/SpatialReference.js +1 -1
  34. package/geometry/geometryEngine.js +1 -1
  35. package/geometry/support/geodesicUtils.js +1 -1
  36. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  37. package/layers/LinkChartLayer.js +1 -1
  38. package/layers/support/ElevationQuery.js +1 -1
  39. package/layers/video/videoUtils.js +1 -1
  40. package/package.json +1 -1
  41. package/rest/knowledgeGraph/wasmInterface/wasmToGeometryFactories.js +1 -1
  42. package/support/revision.js +1 -1
  43. package/views/2d/interactive/SnappingVisualizer2D.js +1 -1
  44. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  45. package/views/3d/environment/Fog.js +1 -1
  46. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  47. package/views/3d/terrain/TerrainRenderer.js +1 -1
  48. package/views/3d/terrain/TerrainSurface.js +1 -1
  49. package/views/3d/terrain/TransparencyMode.js +1 -1
  50. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  51. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +1 -1
  52. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
  53. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +11 -11
  54. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
  55. package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js +9 -0
  56. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  57. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  58. package/views/3d/webgl-engine/lib/MainFramebuffer.js +5 -0
  59. package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
  60. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  61. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  62. package/views/3d/webgl-engine/shaders/Heatmap.glsl.js +1 -1
  63. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  64. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  65. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  66. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  67. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShader.glsl.js +1 -1
  68. package/views/draw/support/Box.js +1 -1
  69. package/views/draw/support/Reshape.js +1 -1
  70. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  71. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  72. package/assets/esri/core/workers/chunks/164debfd5eac01ce3121.js +0 -1
  73. package/assets/esri/core/workers/chunks/1972e6be738a3b9289e8.js +0 -1
  74. package/assets/esri/core/workers/chunks/2e62e34c85d8505c98f4.js +0 -1
  75. package/assets/esri/core/workers/chunks/4ef2ce12499fae8b85c4.js +0 -1
  76. package/assets/esri/core/workers/chunks/5bf51ad34e2d729f9048.js +0 -1
  77. package/assets/esri/core/workers/chunks/9a9abefa8099aa1ebc3d.js +0 -1
  78. package/assets/esri/core/workers/chunks/da3af488df83bd8e153b.js +0 -1
  79. package/views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js +0 -7
  80. package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl.js +0 -7
  81. package/views/3d/webgl-engine/lib/MainColor.js +0 -5
  82. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardByCoverage.glsl.js +0 -5
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5268],{28491:(e,t,r)=>{r.d(t,{D:()=>G,b:()=>V});var o=r(46686),i=r(32680),n=r(49255),a=r(76591),s=r(76597),l=r(82991),c=r(96336),d=r(10764),u=r(39014),h=r(53466),m=r(92700),f=r(72824),p=r(54154),v=r(9169),g=r(77695),_=r(3452),x=r(8881),T=r(98619),b=r(51343),y=r(62602),A=r(22393),E=r(59469),M=r(25618),S=r(51406),w=r(986),C=r(35093),O=r(52919),R=r(27950),I=r(20693),N=r(33079),P=r(71988),L=r(20304),H=r(2597),D=r(85977),B=r(63761),F=r(46540),z=r(60517);function V(e){const t=new D.N5,{vertex:r,fragment:V,varyings:G}=t;if((0,I.NB)(r,e),t.include(d.I),G.add("vpos","vec3"),t.include(w.A,e),t.include(l.BK,e),t.include(p.G,e),t.include(S.q2,e),e.output===n.V.Color){t.include(S.Sx,e),t.include(S.MU,e),t.include(S.O1,e),t.include(S.QM,e),(0,I.yu)(r,e),t.include(c.Y,e),t.include(s.d,e);const n=e.normalType===c.W.Attribute||e.normalType===c.W.Compressed;n&&e.offsetBackfaces&&t.include(i.M),t.include(g.W,e),t.include(f.Mh,e),e.instancedColor&&t.attributes.add(F.r.INSTANCECOLOR,"vec4"),G.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(o.oD,e),t.include(u.K,e),t.include(m.c,e),r.uniforms.add(new P.E("externalColor",(e=>e.externalColor))),G.add("vcolorExt","vec4"),e.multipassEnabled&&G.add("depth","float"),r.code.add(H.H`
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5268],{28491:(e,t,r)=>{r.d(t,{D:()=>G,b:()=>V});var o=r(46686),i=r(32680),n=r(49255),a=r(76591),s=r(76597),l=r(82991),c=r(96336),d=r(10764),u=r(39014),h=r(53466),m=r(92700),f=r(72824),p=r(54154),v=r(9169),g=r(77695),_=r(3452),x=r(8881),T=r(98619),b=r(51343),y=r(62602),A=r(22393),E=r(59469),S=r(25618),M=r(51406),w=r(986),C=r(35093),O=r(11955),R=r(27950),I=r(20693),N=r(33079),P=r(71988),L=r(20304),H=r(2597),D=r(85977),B=r(63761),F=r(46540),z=r(60517);function V(e){const t=new D.N5,{vertex:r,fragment:V,varyings:G}=t;if((0,I.NB)(r,e),t.include(d.I),G.add("vpos","vec3"),t.include(w.A,e),t.include(l.BK,e),t.include(p.G,e),t.include(M.q2,e),e.output===n.V.Color){t.include(M.Sx,e),t.include(M.MU,e),t.include(M.O1,e),t.include(M.QM,e),(0,I.yu)(r,e),t.include(c.Y,e),t.include(s.d,e);const n=e.normalType===c.W.Attribute||e.normalType===c.W.Compressed;n&&e.offsetBackfaces&&t.include(i.M),t.include(g.W,e),t.include(f.Mh,e),e.instancedColor&&t.attributes.add(F.r.INSTANCECOLOR,"vec4"),G.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(o.oD,e),t.include(u.K,e),t.include(m.c,e),r.uniforms.add(new P.E("externalColor",(e=>e.externalColor))),G.add("vcolorExt","vec4"),e.multipassEnabled&&G.add("depth","float"),r.code.add(H.H`
2
2
  void main(void) {
3
3
  forwardNormalizedVertexColor();
4
4
  vcolorExt = externalColor;
@@ -29,7 +29,7 @@
29
29
  forwardOcclusionUV();
30
30
  forwardMetallicRoughnessUV();
31
31
  }
32
- `),t.include(x.kA,e),t.include(_.n,e),t.include(O.S,e),t.include(e.instancedDoublePrecision?M.G:M.Bz,e),t.include(b.Q,e),t.include(a.HQ,e),t.include(z.z,e),(0,I.yu)(V,e),V.uniforms.add(r.uniforms.get("localOrigin"),new N.t("ambient",(e=>e.ambient)),new N.t("diffuse",(e=>e.diffuse)),new L.m("opacity",(e=>e.opacity)),new L.m("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&V.uniforms.add(new B.N("tex",(e=>e.texture))),t.include(E._Z,e),t.include(A.c,e),V.include(R.N),t.include(y.r,e),(0,x.a8)(V),(0,x.eU)(V),(0,T.O4)(V),V.code.add(H.H`
32
+ `),t.include(x.kA,e),t.include(_.n,e),t.include(O.S,e),t.include(e.instancedDoublePrecision?S.G:S.Bz,e),t.include(b.Q,e),t.include(a.HQ,e),t.include(z.z,e),(0,I.yu)(V,e),V.uniforms.add(r.uniforms.get("localOrigin"),new N.t("ambient",(e=>e.ambient)),new N.t("diffuse",(e=>e.diffuse)),new L.m("opacity",(e=>e.opacity)),new L.m("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&V.uniforms.add(new B.N("tex",(e=>e.texture))),t.include(E._Z,e),t.include(A.c,e),V.include(R.N),t.include(y.r,e),(0,x.a8)(V),(0,x.eU)(V),(0,T.O4)(V),V.code.add(H.H`
33
33
  void main() {
34
34
  discardBySlice(vpos);
35
35
  ${e.multipassEnabled?"terrainDepthTest(depth);":""}
@@ -79,7 +79,7 @@
79
79
  vec4 finalColor = vec4(shadedColor, opacity_);
80
80
  outputColorHighlightOID(finalColor, vpos);
81
81
  }
82
- `)}return t.include(v.E,e),t}const G=Object.freeze(Object.defineProperty({__proto__:null,build:V},Symbol.toStringTag,{value:"Module"}))},57323:(e,t,r)=>{r.d(t,{R:()=>B,b:()=>D});var o=r(46686),i=r(32680),n=r(49255),a=r(76591),s=r(76597),l=r(82991),c=r(96336),d=r(10764),u=r(39014),h=r(53466),m=r(92700),f=r(54154),p=r(9169),v=r(3452),g=r(8881),_=r(98619),x=r(51343),T=r(22393),b=r(59469),y=r(25618),A=r(986),E=r(35093),M=r(52919),S=r(27950),w=r(20693),C=r(33079),O=r(71988),R=r(20304),I=r(2597),N=r(85977),P=r(63761),L=r(46540),H=r(60517);function D(e){const t=new N.N5,{vertex:r,fragment:D,varyings:B}=t;return(0,w.NB)(r,e),t.include(d.I),B.add("vpos","vec3"),t.include(A.A,e),t.include(l.BK,e),t.include(f.G,e),e.output===n.V.Color&&((0,w.yu)(t.vertex,e),t.include(c.Y,e),t.include(s.d,e),e.offsetBackfaces&&t.include(i.M),e.instancedColor&&t.attributes.add(L.r.INSTANCECOLOR,"vec4"),B.add("vNormalWorld","vec3"),B.add("localvpos","vec3"),e.multipassEnabled&&B.add("depth","float"),t.include(h.U,e),t.include(o.oD,e),t.include(u.K,e),t.include(m.c,e),r.uniforms.add(new O.E("externalColor",(e=>e.externalColor))),B.add("vcolorExt","vec4"),r.code.add(I.H`
82
+ `)}return t.include(v.E,e),t}const G=Object.freeze(Object.defineProperty({__proto__:null,build:V},Symbol.toStringTag,{value:"Module"}))},57323:(e,t,r)=>{r.d(t,{R:()=>B,b:()=>D});var o=r(46686),i=r(32680),n=r(49255),a=r(76591),s=r(76597),l=r(82991),c=r(96336),d=r(10764),u=r(39014),h=r(53466),m=r(92700),f=r(54154),p=r(9169),v=r(3452),g=r(8881),_=r(98619),x=r(51343),T=r(22393),b=r(59469),y=r(25618),A=r(986),E=r(35093),S=r(11955),M=r(27950),w=r(20693),C=r(33079),O=r(71988),R=r(20304),I=r(2597),N=r(85977),P=r(63761),L=r(46540),H=r(60517);function D(e){const t=new N.N5,{vertex:r,fragment:D,varyings:B}=t;return(0,w.NB)(r,e),t.include(d.I),B.add("vpos","vec3"),t.include(A.A,e),t.include(l.BK,e),t.include(f.G,e),e.output===n.V.Color&&((0,w.yu)(t.vertex,e),t.include(c.Y,e),t.include(s.d,e),e.offsetBackfaces&&t.include(i.M),e.instancedColor&&t.attributes.add(L.r.INSTANCECOLOR,"vec4"),B.add("vNormalWorld","vec3"),B.add("localvpos","vec3"),e.multipassEnabled&&B.add("depth","float"),t.include(h.U,e),t.include(o.oD,e),t.include(u.K,e),t.include(m.c,e),r.uniforms.add(new O.E("externalColor",(e=>e.externalColor))),B.add("vcolorExt","vec4"),r.code.add(I.H`
83
83
  void main(void) {
84
84
  forwardNormalizedVertexColor();
85
85
  vcolorExt = externalColor;
@@ -103,7 +103,7 @@
103
103
  forwardLinearDepth();
104
104
  forwardTextureCoordinates();
105
105
  }
106
- `)),e.output===n.V.Color&&(t.include(g.kA,e),t.include(v.n,e),t.include(M.S,e),t.include(e.instancedDoublePrecision?y.G:y.Bz,e),t.include(x.Q,e),t.include(a.HQ,e),t.include(H.z,e),(0,w.yu)(t.fragment,e),(0,_.Gc)(D),(0,g.a8)(D),(0,g.eU)(D),D.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new C.t("ambient",(e=>e.ambient)),new C.t("diffuse",(e=>e.diffuse)),new R.m("opacity",(e=>e.opacity)),new R.m("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&D.uniforms.add(new P.N("tex",(e=>e.texture))),t.include(b._Z,e),t.include(T.c,e),D.include(S.N),(0,_.O4)(D),D.code.add(I.H`
106
+ `)),e.output===n.V.Color&&(t.include(g.kA,e),t.include(v.n,e),t.include(S.S,e),t.include(e.instancedDoublePrecision?y.G:y.Bz,e),t.include(x.Q,e),t.include(a.HQ,e),t.include(H.z,e),(0,w.yu)(t.fragment,e),(0,_.Gc)(D),(0,g.a8)(D),(0,g.eU)(D),D.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new C.t("ambient",(e=>e.ambient)),new C.t("diffuse",(e=>e.diffuse)),new R.m("opacity",(e=>e.opacity)),new R.m("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&D.uniforms.add(new P.N("tex",(e=>e.texture))),t.include(b._Z,e),t.include(T.c,e),D.include(M.N),(0,_.O4)(D),D.code.add(I.H`
107
107
  void main() {
108
108
  discardBySlice(vpos);
109
109
  ${e.multipassEnabled?I.H`terrainDepthTest(depth);`:""}
@@ -256,7 +256,7 @@ return fallOffFunction(vv, vn, 0.1);
256
256
 
257
257
  fragBlur = b / w_total;
258
258
  }
259
- `),e}const f=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},76412:(e,t,r)=>{r.d(t,{c:()=>p,d:()=>_,f:()=>b,g:()=>T,h:()=>x,k:()=>S,o:()=>P}),r(44208),r(53966);var o=r(34727),i=r(58083),n=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(34304),d=r(88582),u=r(71351),h=r(44280),m=r(32114);const f=p();function p(){return(0,l.vt)()}const v=s.e,g=s.e;function _(e,t){return(0,s.c)(t,e)}function x(e){return e[3]}function T(e){return e}function b(e,t,r,o){return(0,l.fA)(e,t,r,o)}function y(e,t,r){if(null==t)return!1;if(!E(e,t,A))return!1;let{t0:o,t1:i}=A;if((o<0||i<o&&i>0)&&(o=i),o<0)return!1;if(r){const{origin:e,direction:i}=t;r[0]=e[0]+i[0]*o,r[1]=e[1]+i[1]*o,r[2]=e[2]+i[2]*o}return!0}const A={t0:0,t1:0};function E(e,t,r){const{origin:o,direction:i}=t,n=M;n[0]=o[0]-e[0],n[1]=o[1]-e[1],n[2]=o[2]-e[2];const a=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===a)return!1;const s=2*(i[0]*n[0]+i[1]*n[1]+i[2]*n[2]),l=s*s-4*a*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-e[3]*e[3]);if(l<0)return!1;const c=Math.sqrt(l);return r.t0=(-s-c)/(2*a),r.t1=(-s+c)/(2*a),!0}const M=(0,a.vt)();function S(e,t){return y(e,t,null)}function w(e,t,r){const o=m.rq.get(),a=m.Rc.get();(0,n.b)(o,t.origin,t.direction);const s=x(e);(0,n.b)(r,o,t.origin),(0,n.j)(r,r,1/(0,n.l)(r)*s);const l=O(e,t.origin),c=(0,h.g7)(t.origin,r);return(0,i.$0)(a,c+l,o),(0,n.h)(r,r,a),r}function C(e,t,r){const o=(0,n.f)(m.rq.get(),t,e),i=(0,n.j)(m.rq.get(),o,e[3]/(0,n.l)(o));return(0,n.g)(r,i,e)}function O(e,t){const r=(0,n.f)(m.rq.get(),t,e),i=(0,n.l)(r),a=x(e),s=a+Math.abs(a-i);return(0,o.XM)(a/s)}const R=(0,a.vt)();function I(e,t,r,i){const a=(0,n.f)(R,t,e);switch(r){case d._.X:{const e=(0,o.jU)(a,R)[2];return(0,n.s)(i,-Math.sin(e),Math.cos(e),0)}case d._.Y:{const e=(0,o.jU)(a,R),t=e[1],r=e[2],s=Math.sin(t);return(0,n.s)(i,-s*Math.cos(r),-s*Math.sin(r),Math.cos(t))}case d._.Z:return(0,n.n)(i,a);default:return}}function N(e,t){const r=(0,n.f)(L,t,e);return(0,n.l)(r)-e[3]}function P(e,t){const r=(0,n.a)(e,t),o=x(e);return r<=o*o}const L=(0,a.vt)(),H=p();Object.freeze(Object.defineProperty({__proto__:null,NullSphere:f,altitudeAt:N,angleToSilhouette:O,axisAt:I,cameraFrustumCoverage:function(e,t,r,o){const i=x(e),n=i*i,a=t+.5*Math.PI,s=r*r+n-2*Math.cos(a)*r*i,l=Math.sqrt(s),c=s-n;if(c<=0)return.5;const d=Math.sqrt(c),u=Math.acos(d/l)-Math.asin(i/(l/Math.sin(a)));return Math.min(1,(u+.5*o)/o)},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},closestPoint:function(e,t,r){return y(e,t,r)?r:((0,u.oC)(t,e,r),C(e,r,r))},closestPointOnSilhouette:w,containsPoint:P,copy:_,create:p,distanceToSilhouette:function(e,t){const r=(0,n.f)(m.rq.get(),t,e),o=(0,n.q)(r),i=e[3]*e[3];return Math.sqrt(Math.abs(o-i))},elevate:function(e,t,r){return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),r[3]=e[3]+t,r},equals:g,exactEquals:v,fromCenterAndRadius:function(e,t){return(0,l.fA)(e[0],e[1],e[2],t)},fromRadius:function(e,t){return e[0]=e[1]=e[2]=0,e[3]=t,e},fromValues:b,getCenter:T,getExtent:function(e,t){return t},getRadius:x,intersectLine:function(e,t,r){const o=(0,u.Cr)(t,r);if(!E(e,o,A))return[];const{origin:i,direction:s}=o,{t0:l,t1:d}=A,h=t=>{const r=(0,a.vt)();return(0,n.r)(r,i,s,t),C(e,r,r)};return Math.abs(l-d)<(0,c.FD)()?[h(l)]:[h(l),h(d)]},intersectRay:y,intersectRayClosestSilhouette:function(e,t,r){if(y(e,t,r))return r;const o=w(e,t,m.rq.get());return(0,n.g)(r,t.origin,(0,n.j)(m.rq.get(),t.direction,(0,n.p)(t.origin,o)/(0,n.l)(t.direction))),r},intersectsRay:S,projectPoint:C,setAltitudeAt:function(e,t,r,o){const i=N(e,t),a=I(e,t,d._.Z,L),s=(0,n.j)(L,a,r-i);return(0,n.g)(o,t,s)},setExtent:function(e,t,r){return e!==r&&_(e,r),r},tmpSphere:H,union:function(e,t,r=(0,l.vt)()){const o=(0,n.p)(e,t),i=e[3],a=t[3];return o+a<i?((0,s.c)(r,e),r):o+i<a?((0,s.c)(r,t),r):((0,n.o)(r,e,t,(o+a-i)/(2*o)),r[3]=(o+i+a)/2,r)},wrap:function(e){return e}},Symbol.toStringTag,{value:"Module"}))},43609:(e,t,r)=>{r.d(t,{a:()=>n,f:()=>a,n:()=>i});var o=r(34275);function i(e,t){n(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r=2,i=r){const n=t.length/2;let a=0,s=0;if((0,o.cy)(t)||(0,o.dk)(t)){for(let o=0;o<n;++o)e[a]=t[s],e[a+1]=t[s+1],a+=r,s+=i;return}const l=(0,o.a3)(t);if((0,o.JI)(t))for(let o=0;o<n;++o)e[a]=Math.max(t[s]/l,-1),e[a+1]=Math.max(t[s+1]/l,-1),a+=r,s+=i;else for(let o=0;o<n;++o)e[a]=t[s]/l,e[a+1]=t[s+1]/l,a+=r,s+=i}function a(e,t,r,o){const i=e.typedBuffer,n=e.typedBufferStride,a=o?.count??e.count;let s=(o?.dstIndex??0)*n;for(let e=0;e<a;++e)i[s]=t,i[s+1]=r,s+=n}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:n,normalizeIntegerBufferView:i},Symbol.toStringTag,{value:"Module"}))},73354:(e,t,r)=>{function o(e,t,r){i(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function i(e,t,r,o=3,i=o){if(e.length/o!==Math.ceil(t.length/i))return e;const n=e.length/o,a=r[0],s=r[1],l=r[2],c=r[4],d=r[5],u=r[6],h=r[8],m=r[9],f=r[10],p=r[12],v=r[13],g=r[14];let _=0,x=0;for(let r=0;r<n;r++){const r=t[_],n=t[_+1],T=t[_+2];e[x]=a*r+c*n+h*T+p,e[x+1]=s*r+d*n+m*T+v,e[x+2]=l*r+u*n+f*T+g,_+=i,x+=o}return e}function n(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,o=3,i=o){if(e.length/o!==Math.ceil(t.length/i))return;const n=e.length/o,a=r[0],s=r[1],l=r[2],c=r[3],d=r[4],u=r[5],h=r[6],m=r[7],f=r[8];let p=0,v=0;for(let r=0;r<n;r++){const r=t[p],n=t[p+1],g=t[p+2];e[v]=a*r+c*n+h*g,e[v+1]=s*r+d*n+m*g,e[v+2]=l*r+u*n+f*g,p+=i,v+=o}}function s(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function l(e,t,r,o=3,i=o){const n=Math.min(e.length/o,t.length/i);let a=0,s=0;for(let l=0;l<n;l++)e[s]=r*t[a],e[s+1]=r*t[a+1],e[s+2]=r*t[a+2],a+=i,s+=o;return e}function c(e,t,r,o=3,i=o){const n=e.length/o;if(n!==Math.ceil(t.length/i))return e;let a=0,s=0;for(let l=0;l<n;l++)e[s]=t[a]+r[0],e[s+1]=t[a+1]+r[1],e[s+2]=t[a+2]+r[2],a+=i,s+=o;return e}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,o=r){const i=Math.min(e.length/r,t.length/o);let n=0,a=0;for(let s=0;s<i;s++){const i=t[n],s=t[n+1],l=t[n+2],c=i*i+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*i,e[a+1]=t*s,e[a+2]=t*l}n+=o,a+=r}}r.d(t,{a:()=>i,b:()=>c,c:()=>n,d:()=>o,e:()=>d,f:()=>l,n:()=>u,s:()=>s,t:()=>a}),r(44208),r(53966),Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:l,scaleView:s,shiftRight:function(e,t,r){const o=Math.min(e.count,t.count),i=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<o;e++)i[c]=a[l]>>r,i[c+1]=a[l+1]>>r,i[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:a,transformMat3View:n,transformMat4:i,transformMat4View:o,translate:c},Symbol.toStringTag,{value:"Module"}))},51737:(e,t,r)=>{function o(e,t){i(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function i(e,t,r=3,o=r){const i=t.length/o;let n=0,a=0;for(let s=0;s<i;++s)e[n]=t[a],e[n+1]=t[a+1],e[n+2]=t[a+2],n+=r,a+=o}function n(e,t,r,o,i){const n=e.typedBuffer,a=e.typedBufferStride,s=i?.count??e.count;let l=(i?.dstIndex??0)*a;for(let e=0;e<s;++e)n[l]=t,n[l+1]=r,n[l+2]=o,l+=a}r.d(t,{a:()=>o,c:()=>i,f:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,copyView:o,fill:n},Symbol.toStringTag,{value:"Module"}))},65686:(e,t,r)=>{r.d(t,{a:()=>i,b:()=>l,n:()=>a,s:()=>s,t:()=>n}),r(44208);var o=r(53966);function i(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=4,i=o){if(e.length/o!=t.length/i)return;const n=e.length/o,a=r[0],s=r[1],l=r[2],c=r[3],d=r[4],u=r[5],h=r[6],m=r[7],f=r[8];let p=0,v=0;for(let r=0;r<n;r++){const r=t[p],n=t[p+1],g=t[p+2],_=t[p+3];e[v]=a*r+c*n+h*g,e[v+1]=s*r+d*n+m*g,e[v+2]=l*r+u*n+f*g,e[v+3]=_,p+=i,v+=o}}function a(e,t){const r=Math.min(e.count,t.count),o=e.typedBuffer,i=e.typedBufferStride,n=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*i,r=e*a,s=n[r],l=n[r+1],c=n[r+2],d=s*s+l*l+c*c;if(d>0){const e=1/Math.sqrt(d);o[t]=e*s,o[t+1]=e*l,o[t+2]=e*c}}}function s(e,t,r){l(e.typedBuffer,t,r,e.typedBufferStride)}function l(e,t,r,o=4){const i=Math.min(e.length/o,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<i;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],e[l+3]=r*n[s+3],s+=a,l+=o}Object.freeze(Object.defineProperty({__proto__:null,normalize:a,scale:l,scaleView:s,transformMat3:n,transformMat3View:i,transformMat4:function(e,t,r,i=4,n=i){if(e.length/i!=t.length/n)return void o.A.getLogger("esri.views.3d.support.buffer.math").error("source and destination buffers need to have the same number of elements");const a=e.length/i,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],m=r[6],f=r[7],p=r[8],v=r[9],g=r[10],_=r[11],x=r[12],T=r[13],b=r[14],y=r[15];let A=0,E=0;for(let r=0;r<a;r++){const r=t[A],o=t[A+1],a=t[A+2],M=t[A+3];e[E]=s*r+u*o+p*a+x*M,e[E+1]=l*r+h*o+v*a+T*M,e[E+2]=c*r+m*o+g*a+b*M,e[E+3]=d*r+f*o+_*a+y*M,A+=n,E+=i}},transformMat4View:function(e,t,r){if(e.count!==t.count)return;const o=e.count,i=r[0],n=r[1],a=r[2],s=r[3],l=r[4],c=r[5],d=r[6],u=r[7],h=r[8],m=r[9],f=r[10],p=r[11],v=r[12],g=r[13],_=r[14],x=r[15],T=e.typedBuffer,b=e.typedBufferStride,y=t.typedBuffer,A=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*b,r=e*A,o=y[r],E=y[r+1],M=y[r+2],S=y[r+3];T[t]=i*o+l*E+h*M+v*S,T[t+1]=n*o+c*E+m*M+g*S,T[t+2]=a*o+d*E+f*M+_*S,T[t+3]=s*o+u*E+p*M+x*S}}},Symbol.toStringTag,{value:"Module"}))},78358:(e,t,r)=>{function o(e,t){i(e.typedBuffer,t,e.typedBufferStride)}function i(e,t,r=4){const o=t.typedBuffer,i=t.typedBufferStride,n=t.count;let a=0,s=0;for(let t=0;t<n;++t)e[a]=o[s],e[a+1]=o[s+1],e[a+2]=o[s+2],e[a+3]=o[s+3],a+=r,s+=i}function n(e,t,r,o,i,n){const a=e.typedBuffer,s=e.typedBufferStride,l=n?.count??e.count;let c=(n?.dstIndex??0)*s;for(let e=0;e<l;++e)a[c]=t,a[c+1]=r,a[c+2]=o,a[c+3]=i,c+=s}r.d(t,{a:()=>i,c:()=>o,f:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,copyView:o,fill:n},Symbol.toStringTag,{value:"Module"}))},4341:(e,t,r)=>{r.d(t,{I:()=>i});var o=r(26390);class i{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,o.d)((()=>this._reset())),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*n);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,n));e++)this._items.push(this._allocator())}}const n=1024},46140:(e,t,r)=>{r.d(t,{R:()=>i});var o=r(49186);let i=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new o.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[i,n]=t.split("."),a=/^\s*\d+\s*$/;if(!i?.match||!a.test(i))throw new o.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!n?.match||!a.test(n))throw new o.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(i,10),l=parseInt(n,10);return new e(s,l,r)}}},61473:(e,t,r)=>{function o(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function i(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{EM:()=>i,b5:()=>o});const n=/^devext\.arcgis\.com$/,a=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,n,a,/^jsapps\.esri\.com$/,s,l]},11964:(e,t,r)=>{r.d(t,{Cr:()=>c,H6:()=>h,_I:()=>u,kb:()=>d,vt:()=>l});var o=r(34727),i=r(4341),n=r(38954),a=r(51850),s=r(32114);function l(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.f)(r.vector,t,e),r}function d(e,t){const r=(0,n.f)(s.rq.get(),t,e.origin),i=(0,n.m)(e.vector,r),a=(0,n.m)(e.vector,e.vector),l=(0,o.qE)(i/a,0,1),c=(0,n.f)(s.rq.get(),(0,n.j)(s.rq.get(),e.vector,l),r);return(0,n.m)(c,c)}function u(e,t,r){return h(e,t,0,1,r)}function h(e,t,r,i,a){const{vector:l,origin:c}=e,d=(0,n.f)(s.rq.get(),t,c),u=(0,n.m)(l,d)/(0,n.q)(l);return(0,n.j)(a,l,(0,o.qE)(u,r,i)),(0,n.g)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)(),new i.I((()=>l()))},71351:(e,t,r)=>{r.d(t,{Cr:()=>d,LV:()=>c,kb:()=>u,oC:()=>h,vt:()=>s}),r(4576);var o=r(4341),i=r(38954),n=r(51850),a=r(32114);function s(e){return e?l((0,n.o8)(e.origin),(0,n.o8)(e.direction)):l((0,n.vt)(),(0,n.vt)())}function l(e,t){return{origin:e,direction:t}}function c(e,t){const r=m.get();return r.origin=e,r.direction=t,r}function d(e,t,r=s()){return(0,i.c)(r.origin,e),(0,i.f)(r.direction,t,e),r}function u(e,t){const r=(0,i.b)(a.rq.get(),(0,i.n)(a.rq.get(),e.direction),(0,i.f)(a.rq.get(),t,e.origin));return(0,i.m)(r,r)}function h(e,t,r){const o=(0,i.m)(e.direction,(0,i.f)(r,t,e.origin));return(0,i.g)(r,e.origin,(0,i.j)(r,e.direction,o)),r}const m=new o.I((()=>s()));(0,n.vt)()},21015:(e,t,r)=>{r.d(t,{R:()=>l});var o=r(78888),i=r(60999),n=r(49186),a=r(74887),s=r(84952);class l{constructor(e){this._streamDataRequester=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,s.DB)(e)?((0,a.Te)(t),(0,s.lJ)(e)):this._load("binary",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){if(null==this._streamDataRequester)return(await(0,o.A)(t,{responseType:c[e]})).data;const s=await(0,i.Ke)(this._streamDataRequester.request(t,e,r));if(!0===s.ok)return s.value;throw(0,a.QP)(s.error),new n.A("",`Request for resource failed: ${s.error}`)}}const c={image:"image",binary:"array-buffer",json:"json","image+type":void 0}},84498:(e,t,r)=>{r.d(t,{x:()=>a});var o=r(34275),i=r(97146),n=r(63907);function a(e,t){switch(t){case n.WR.TRIANGLES:return"number"==typeof(r=e)?(0,i.tM)(r):(0,o.mg)(r)?new Uint16Array(r):r;case n.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,o=(0,i.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(o[e++]=t,o[e++]=t+1,o[e++]=t+2):(o[e++]=t+1,o[e++]=t,o[e++]=t+2)}else{let t=0;for(let i=0;i<r;i+=1)i%2==0?(o[t++]=e[i],o[t++]=e[i+1],o[t++]=e[i+2]):(o[t++]=e[i+1],o[t++]=e[i],o[t++]=e[i+2])}return o}(e);case n.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,o=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)o[e++]=0,o[e++]=t+1,o[e++]=t+2;return o}const i=e[0];let n=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];o[a++]=i,o[a++]=n,o[a++]=r,n=r}return o}(e)}var r}},51530:(e,t,r)=>{r.d(t,{KB:()=>s,Xi:()=>n,pn:()=>l,x3:()=>a});var o=r(44208),i=r(89192);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding=i.JS.KTX2_ENCODING}}function a(e){return"encoded-mesh-texture"===e?.type}async function s(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function l(e,t){if(t===i.JS.KTX2_ENCODING)return new n(e);const r=new Blob([e],{type:t}),a=URL.createObjectURL(r),s=new Image;if((0,o.A)("esri-iPhone"))return new Promise(((e,t)=>{const r=()=>{i(),e(s)},o=e=>{i(),t(e)},i=()=>{URL.revokeObjectURL(a),s.removeEventListener("load",r),s.removeEventListener("error",o)};s.addEventListener("load",r),s.addEventListener("error",o),s.src=a}));try{s.src=a,await s.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(a),s}},55268:(e,t,r)=>{r.d(t,{fetch:()=>Mr});var o=r(61473),i=r(34727),n=r(77690),a=r(29242),s=r(58083),l=r(9093),c=r(48163),d=r(38954),u=r(51850),h=r(70328),m=r(11868),f=r(13030),p=r(73354),v=r(65686),g=r(43609),_=r(51737),x=r(78358),T=r(21015),b=r(84498),y=r(51530),A=r(88340);function E(e){if(null==e)return null;const t=null!=e.offset?e.offset:A.uY,r=null!=e.rotation?e.rotation:0,o=null!=e.scale?e.scale:A.Un,i=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(o[0],0,0,0,o[1],0,0,0,1),c=(0,a.vt)();return(0,n.lw)(c,s,l),(0,n.lw)(c,i,c),c}class M{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class S{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new M,this.numberOfVertices=0}}var w=r(78888),C=r(60999),O=r(86805),R=r(49186),I=r(53966);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const o=this._outer.get(e);o?o.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}forAll(e){for(const t of this._outer.values())for(const r of t.values())e(r)}}var P=r(74887),L=r(46140),H=r(97146);async function D(e,t){const{data:r}=await(0,w.A)(e,{responseType:"image",...t});return r}var B=r(46610),F=r(89192),z=r(34275);function V(e){if(e.length<z.y9)return Array.from(e);if((0,z.cy)(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,z.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var G=r(3694),U=r(620);class W{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,U.vA)(e.length>=1),(0,U.vA)(3===r.size||4===r.size);const{data:o,size:i,indices:n}=r;(0,U.vA)(n.length%this._numIndexPerPrimitive==0),(0,U.vA)(n.length>=e.length*this._numIndexPerPrimitive);const a=e.length;let s=i*n[this._numIndexPerPrimitive*e[0]];j.clear(),j.push(s);const l=(0,u.fA)(o[s],o[s+1],o[s+2]),c=(0,u.o8)(l);for(let t=0;t<a;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=i*n[r+e],j.push(s);let t=o[s];l[0]=Math.min(t,l[0]),c[0]=Math.max(t,c[0]),t=o[s+1],l[1]=Math.min(t,l[1]),c[1]=Math.max(t,c[1]),t=o[s+2],l[2]=Math.min(t,l[2]),c[2]=Math.max(t,c[2])}}this.bbMin=l,this.bbMax=c;const h=(0,d.o)((0,u.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(c[0]-l[0],c[1]-l[1]),c[2]-l[2]);let m=this.radius*this.radius;for(let e=0;e<j.length;++e){s=j.at(e);const t=o[s]-h[0],r=o[s+1]-h[1],i=o[s+2]-h[2],n=t*t+r*r+i*i;if(n<=m)continue;const a=Math.sqrt(n),l=.5*(a-this.radius);this.radius=this.radius+l,m=this.radius*this.radius;const c=l/a;h[0]+=t*c,h[1]+=r*c,h[2]+=i*c}this.center=h,j.clear()}getChildren(){if(this._children||(0,d.a)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,d.o)((0,u.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),o=new Array(8);for(let e=0;e<8;++e)o[e]=0;const{data:i,size:n,indices:a}=this.position;for(let s=0;s<t;++s){let t=0;const l=this._numIndexPerPrimitive*this.primitiveIndices[s];let c=n*a[l],d=i[c],u=i[c+1],h=i[c+2];for(let e=1;e<this._numIndexPerPrimitive;++e){c=n*a[l+e];const t=i[c],r=i[c+1],o=i[c+2];t<d&&(d=t),r<u&&(u=r),o<h&&(h=o)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[s]=t,++o[t]}let s=0;for(let e=0;e<8;++e)o[e]>0&&++s;if(s<2)return;const l=new Array(8);for(let e=0;e<8;++e)l[e]=o[e]>0?new Uint32Array(o[e]):void 0;for(let e=0;e<8;++e)o[e]=0;for(let e=0;e<t;++e){const t=r[e];l[t][o[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==l[e]&&this._children.push(new W(l[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){j.prune()}}const j=new G.A({deallocator:null});var q=r(69720),k=r(96672),$=r(4341),Y=r(11964);function X(e,t,r){return(0,d.f)(Z,t,e),(0,d.f)(J,r,e),.5*(0,d.l)((0,d.b)(Z,Z,J))}r(32114),new $.I(Y.vt),new $.I((()=>{return e?{p0:(0,u.o8)(e.p0),p1:(0,u.o8)(e.p1),p2:(0,u.o8)(e.p2)}:{p0:(0,u.vt)(),p1:(0,u.vt)(),p2:(0,u.vt)()};var e}));const Z=(0,u.vt)(),J=(0,u.vt)(),K=(0,u.vt)(),Q=(0,u.vt)(),ee=(0,u.vt)(),te=(0,u.vt)();var re=r(24326);class oe{constructor(e){this.channel=e,this.id=(0,re.c)()}}var ie=r(46540);r(28449),(0,u.vt)(),new Float32Array(6);class ne extends q.J{constructor(e,t,r=null,o=k.X.Mesh,i=null,n=-1){super(),this.material=e,this.mapPositions=r,this.type=o,this.objectAndLayerIdColor=i,this.edgeIndicesLength=n,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,H.Dg)(r.indices)}),e===ie.r.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new ne(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)})),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:V(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r&&this._attributes.set(e,{...r,exclusive:!0,data:t})}get indexCount(){const e=this._attributes.values().next().value.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===k.X.Mesh?this._computeAttachmentOriginTriangles(e):this.type===k.X.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,d.h)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:o,indices:i}=e;(0,d.s)(t,0,0,0),(0,d.s)(te,0,0,0);let n=0,a=0;for(let e=0;e<i.length-2;e+=3){const s=i[e]*r,l=i[e+1]*r,c=i[e+2]*r;(0,d.s)(K,o[s],o[s+1],o[s+2]),(0,d.s)(Q,o[l],o[l+1],o[l+2]),(0,d.s)(ee,o[c],o[c+1],o[c+2]);const u=X(K,Q,ee);u?((0,d.g)(K,K,Q),(0,d.g)(K,K,ee),(0,d.j)(K,K,1/3*u),(0,d.g)(t,t,K),n+=u):((0,d.g)(te,te,K),(0,d.g)(te,te,Q),(0,d.g)(te,te,ee),a+=3)}return!(0===a&&0===n||(0!==n?((0,d.j)(t,t,1/n),0):0===a||((0,d.j)(t,te,1/a),0)))}(this.attributes.get(ie.r.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(ie.r.POSITION);return function(e,t,r){if(!e)return!1;(0,d.s)(r,0,0,0),(0,d.s)(te,0,0,0);let o=0,i=0;const{size:n,data:a,indices:s}=e,l=s.length-1,c=l+(t?2:0);for(let e=0;e<c;e+=2){const t=e<l?e+1:0,c=s[e<l?e:l]*n,u=s[t]*n;K[0]=a[c],K[1]=a[c+1],K[2]=a[c+2],Q[0]=a[u],Q[1]=a[u+1],Q[2]=a[u+2],(0,d.j)(K,(0,d.g)(K,K,Q),.5);const h=(0,d.F)(K,Q);h>0?((0,d.g)(r,r,(0,d.j)(K,K,h)),o+=h):0===o&&((0,d.g)(te,te,K),i++)}return 0!==o?((0,d.j)(r,r,1/o),!0):0!==i&&((0,d.j)(r,te,1/i),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:o,indices:i}=e;(0,d.s)(t,0,0,0);let n=-1,a=0;for(let e=0;e<i.length;e++){const s=i[e]*r;n!==s&&(t[0]+=o[s],t[1]+=o[s+1],t[2]+=o[s+2],a++),n=s}return a>1&&(0,d.j)(t,t,1/a),a>0}(this.attributes.get(ie.r.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(ie.r.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===k.X.Mesh?3:1;(0,U.vA)(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,H.tM)(e.indices.length/t);return new W(r,t,e)}get transformation(){return this._transformation??l.zK}set transformation(e){this._transformation=e&&e!==l.zK?(0,l.o8)(e):null}addHighlight(){const e=new oe(F.Mg.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}var ae=r(44208),se=r(65529),le=r(97768),ce=r(84952),de=r(56058),ue=r(2741);let he;var me,fe;(fe=me||(me={}))[fe.ETC1_RGB=0]="ETC1_RGB",fe[fe.ETC2_RGBA=1]="ETC2_RGBA",fe[fe.BC1_RGB=2]="BC1_RGB",fe[fe.BC3_RGBA=3]="BC3_RGBA",fe[fe.BC4_R=4]="BC4_R",fe[fe.BC5_RG=5]="BC5_RG",fe[fe.BC7_M6_RGB=6]="BC7_M6_RGB",fe[fe.BC7_M5_RGBA=7]="BC7_M5_RGBA",fe[fe.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",fe[fe.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",fe[fe.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",fe[fe.ATC_RGB=11]="ATC_RGB",fe[fe.ATC_RGBA=12]="ATC_RGBA",fe[fe.FXT1_RGB=17]="FXT1_RGB",fe[fe.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",fe[fe.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",fe[fe.ETC2_EAC_R11=20]="ETC2_EAC_R11",fe[fe.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",fe[fe.RGBA32=13]="RGBA32",fe[fe.RGB565=14]="RGB565",fe[fe.BGR565=15]="BGR565",fe[fe.RGBA4444=16]="RGBA4444";var pe=r(63907),ve=r(21231),ge=r(42293);let _e=null,xe=null;async function Te(){return null==xe&&(he??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,ue.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),xe=he,_e=await xe),xe}function be(e,t,r,o,i){const n=(0,ge.IB)(t?pe.CQ.COMPRESSED_RGBA8_ETC2_EAC:pe.CQ.COMPRESSED_RGB8_ETC2),a=i&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*o*n*a)}function ye(e){return e.getNumImages()>=1&&!e.isUASTC()}function Ae(e){return e.getFaces()>=1&&e.isETC1S()}function Ee(e,t,r,o,i,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?o?[me.ETC2_RGBA,pe.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[me.ETC1_RGB,pe.CQ.COMPRESSED_RGB8_ETC2]:c?o?[me.BC3_RGBA,pe.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[me.BC1_RGB,pe.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[me.RGBA32,pe.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.width=i,t.height=n,new ve.g(e,t,{type:"compressed",levels:m})}const Me=()=>I.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Se(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const we=Se("DXT1"),Ce=Se("DXT3"),Oe=Se("DXT5");function Re(e,t,r){if(e instanceof ImageData)return Re(Ie(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}function Ie(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new R.A("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var Ne,Pe,Le=r(67171);class He extends q.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=k.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new se.A,this._parameters={...Be,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,ce.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,ce.DB)(e.src)||(0,ce.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new Le.R;return t.wrapMode=this._parameters.wrap??pe.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,z.mw)(e)||(0,z.mg)(e))return t.encoding===F.JS.KTX2_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.KTX2File(new Uint8Array(e)),o=Ae(r)?be(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),o}(e,!!t.mipmap):t.encoding===F.JS.BASIS_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.BasisFile(new Uint8Array(e)),o=ye(r)?be(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),o}(e,!!t.mipmap):e.byteLength;const{width:r,height:o}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?De(e):t;return(t.mipmap?4/3:1)*r*o*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new ve.g(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,z.mg)(t)?this._loadFromPixelData(e,t):(0,z.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<Ne.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const o=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return Me().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Me().error("Unsupported format, must contain a FourCC code"),null;const o=r[21];let i,n;switch(o){case we:i=8,n=pe.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ce:i=16,n=pe.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Oe:i=16,n=pe.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Me().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(o)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(Me().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*i,u=new Uint8Array(e,m,h),f.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:c,height:d}}(r,t.hasMipmap??!1);if(null==o)throw new Error("DDS texture data is null");const{textureData:i,internalFormat:n,width:a,height:s}=o;return t.samplingMode=i.levels.length>1?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new ve.g(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await Te());const o=new _e.KTX2File(new Uint8Array(r));if(!Ae(o))return null;o.startTranscoding();const i=Ee(e,t,o.getLevels(),o.getHasAlpha(),o.getWidth(),o.getHeight(),((e,t)=>o.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>o.transcodeImage(r,e,0,0,t,0,-1,-1)));return o.close(),o.delete(),i}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await Te());const o=new _e.BasisFile(new Uint8Array(r));if(!ye(o))return null;o.startTranscoding();const i=Ee(e,t,o.getNumLevels(0),o.getHasAlpha(),o.getImageWidth(0,0),o.getImageHeight(0,0),((e,t)=>o.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>o.transcodeImage(r,0,e,t,0,0)));return o.close(),o.delete(),i}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,U.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?pe.Ab.LUMINANCE:3===this._parameters.components?pe.Ab.RGB:pe.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new ve.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const o=await D(t,{signal:r});return(0,P.Te)(r),this._loadFromImage(e,o)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const o=await(0,de.Sx)(t,t.src,!1,r);return(0,P.Te)(r),this._loadFromImage(e,o)}))}_loadFromVideoElement(e,t){return t.readyState>=Ne.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((o,i)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,le.xt)(l)},a=()=>{t.readyState>=Ne.HAVE_CURRENT_DATA&&(n(),o(this._loadFromImage(e,t)))},s=e=>{n(),i(e||new R.A("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,P.u7)(r,(()=>s((0,P.NK)())))}))))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:t}=e.parameters;r=this._parameters.downsampleUncompressed?function(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?Ie(e):e;let o=e.width,i=e.height;do{o=Math.ceil(o/2),i=Math.ceil(i/2),r=o*i}while(r>1048576||null!=t&&(o>t||i>t));return Re(e,o,i)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const o=t/r;return Re(e,Math.round(e.width*o),Math.round(e.height*o))}(r,t)}const o=De(r);this._parameters.width=o.width,this._parameters.height=o.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this._parameters.components?pe.Ab.RGB:pe.Ab.RGBA,i.width=o.width,i.height=o.height,this._glTexture=new ve.g(e,i,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const o=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(o,o),r}unload(){if(this._glTexture=(0,le.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function De(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(Pe=Ne||(Ne={}))[Pe.HAVE_NOTHING=0]="HAVE_NOTHING",Pe[Pe.HAVE_METADATA=1]="HAVE_METADATA",Pe[Pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Pe[Pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Pe[Pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Be={wrap:{s:pe.pF.REPEAT,t:pe.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Fe=r(24151),ze=r(1843),Ve=r(49255),Ge=r(96336),Ue=r(62602),We=r(59469),je=r(35093),qe=r(25634),ke=r(14903),$e=r(14327),Ye=r(90644);const Xe=(0,Ye.p3)(pe.dn.SRC_ALPHA,pe.dn.ONE,pe.dn.ONE_MINUS_SRC_ALPHA,pe.dn.ONE_MINUS_SRC_ALPHA),Ze=(0,Ye.p3)(pe.dn.ONE,pe.dn.ZERO,pe.dn.ONE,pe.dn.ONE_MINUS_SRC_ALPHA);function Je(e){switch(e){case $e.y.NONE:return Xe;case $e.y.ColorAlpha:return Ze;case $e.y.FrontFace:case $e.y.COUNT:return null}}const Ke={factor:-1,units:-2};function Qe(e,t=pe.MT.LESS){return e===$e.y.NONE||e===$e.y.FrontFace?t:pe.MT.LEQUAL}function et(e){return e===$e.y.ColorAlpha?{buffers:[pe.Nm.COLOR_ATTACHMENT0,pe.Nm.COLOR_ATTACHMENT1]}:null}class tt{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const rt=(0,h.vt)();function ot(e,t,r,o,i,n){if(!e.visible)return;const a=(0,d.z)(vt,o,r),s=(e,t,r)=>{n(e,r,t,!1)},l=new tt(!1,t.options.normalRequired);if(e.boundingInfo){(0,U.vA)(e.type===k.X.Mesh);const o=t.tolerance;nt(e.boundingInfo,r,a,o,i,l,s)}else{const t=e.attributes.get(ie.r.POSITION),o=t.indices;!function(e,t,r,o,i,n,a,s,l,c){const u=t,h=gt,m=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),v=m>=f?m>=p?0:2:f>=p?1:2,g=v,_=u[g]<0?2:1,x=(v+_)%3,T=(v+(3-_))%3,b=u[x]/u[g],y=u[T]/u[g],A=1/u[g],E=st,M=lt,S=ct,{normalRequired:w}=l;for(let t=r;t<o;++t){const r=3*t,o=a*i[r];(0,d.s)(h[0],n[o+0],n[o+1],n[o+2]);const l=a*i[r+1];(0,d.s)(h[1],n[l+0],n[l+1],n[l+2]);const u=a*i[r+2];(0,d.s)(h[2],n[u+0],n[u+1],n[u+2]),s&&((0,d.c)(h[0],s.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,d.c)(h[1],s.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,d.c)(h[2],s.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,d.z)(E,h[0],e),(0,d.z)(M,h[1],e),(0,d.z)(S,h[2],e);const m=E[x]-b*E[g],f=E[T]-y*E[g],p=M[x]-b*M[g],v=M[T]-y*M[g],_=S[x]-b*S[g],C=S[T]-y*S[g],O=_*v-C*p,R=m*C-f*_,I=p*f-v*m;if((O<0||R<0||I<0)&&(O>0||R>0||I>0))continue;const N=O+R+I;if(0===N)continue;const P=O*(A*E[g])+R*(A*M[g])+I*(A*S[g]);if(P*Math.sign(N)<0)continue;const L=P/N;L>=0&&c(L,t,w?ut(h):null)}}(r,a,0,o.length/3,o,t.data,t.stride,i,l,s)}}const it=(0,u.vt)();function nt(e,t,r,o,i,n,a){if(null==e)return;const s=function(e,t){return(0,d.s)(t,1/e[0],1/e[1],1/e[2])}(r,it);if((0,h.Ne)(rt,e.bbMin),(0,h.vI)(rt,e.bbMax),null!=i&&i.applyToAabb(rt),function(e,t,r,o){return function(e,t,r,o,i){const n=(e[0]-o-t[0])*r[0],a=(e[3]+o-t[0])*r[0];let s=Math.min(n,a),l=Math.max(n,a);const c=(e[1]-o-t[1])*r[1],d=(e[4]+o-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-o-t[2])*r[2],h=(e[5]+o-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,o)}(rt,t,s,o)){const{primitiveIndices:s,position:l}=e,c=s?s.length:l.indices.length/3;if(c>ft){const s=e.getChildren();if(void 0!==s){for(const e of s)nt(e,t,r,o,i,n,a);return}}!function(e,t,r,o,i,n,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],p=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<o;++e){const t=s[e],r=3*t,o=a*i[r];let c=n[o],_=n[o+1],x=n[o+2];const T=a*i[r+1];let b=n[T],y=n[T+1],A=n[T+2];const E=a*i[r+2];let M=n[E],S=n[E+1],w=n[E+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[b,y,A]=l.applyToVertex(b,y,A,e),[M,S,w]=l.applyToVertex(M,S,w,e));const C=b-c,O=y-_,R=A-x,I=M-c,N=S-_,P=w-x,L=p*P-N*v,H=v*I-P*f,D=f*N-I*p,B=C*L+O*H+R*D;if(Math.abs(B)<=pt)continue;const F=u-c,z=h-_,V=m-x,G=F*L+z*H+V*D;if(B>0){if(G<0||G>B)continue}else if(G>0||G<B)continue;const U=z*R-O*V,W=V*C-R*F,j=F*O-C*z,q=f*U+p*W+v*j;if(B>0){if(q<0||G+q>B)continue}else if(q>0||G+q<B)continue;const k=(I*U+N*W+P*j)/B;k>=0&&d(k,t,g?dt(C,O,R,I,N,P,at):null)}}(t,r,0,c,l.indices,l.data,l.stride,s,i,n,a)}}const at=(0,u.vt)();const st=(0,u.vt)(),lt=(0,u.vt)(),ct=(0,u.vt)();function dt(e,t,r,o,i,n,a){return(0,d.s)(ht,e,t,r),(0,d.s)(mt,o,i,n),(0,d.b)(a,ht,mt),(0,d.n)(a,a),a}function ut(e){return(0,d.z)(ht,e[1],e[0]),(0,d.z)(mt,e[2],e[0]),(0,d.b)(at,ht,mt),(0,d.n)(at,at),at}const ht=(0,u.vt)(),mt=(0,u.vt)(),ft=1e3,pt=1e-7,vt=(0,u.vt)(),gt=[(0,u.vt)(),(0,u.vt)(),(0,u.vt)()];var _t,xt;(xt=_t||(_t={}))[xt.INTEGRATED_MESH=0]="INTEGRATED_MESH",xt[xt.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",xt[xt.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",xt[xt.OPAQUE_NO_SSAO_DEPTH=3]="OPAQUE_NO_SSAO_DEPTH",xt[xt.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",xt[xt.TRANSPARENT_NO_SSAO_DEPTH=5]="TRANSPARENT_NO_SSAO_DEPTH",xt[xt.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",xt[xt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=7]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",xt[xt.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",xt[xt.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",xt[xt.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",xt[xt.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",xt[xt.OPAQUE_ENVIRONMENT=12]="OPAQUE_ENVIRONMENT",xt[xt.TRANSPARENT_ENVIRONMENT=13]="TRANSPARENT_ENVIRONMENT",xt[xt.HUD_MATERIAL=14]="HUD_MATERIAL",xt[xt.LABEL_MATERIAL=15]="LABEL_MATERIAL",xt[xt.LINE_CALLOUTS=16]="LINE_CALLOUTS",xt[xt.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",xt[xt.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",xt[xt.DRAPED_WATER=19]="DRAPED_WATER",xt[xt.VIEWSHED=20]="VIEWSHED",xt[xt.VOXEL=21]="VOXEL",xt[xt.MAX_SLOTS=22]="MAX_SLOTS";var Tt=r(76412),bt=r(57005);const yt=new class{constructor(e=0){this.offset=e,this.sphere=(0,Tt.c)(),this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const o=this.objectTransform.transform,i=(0,d.s)(At,e,t,r),n=(0,d.h)(i,i,o),a=this.offset/(0,d.l)(n);(0,d.r)(n,n,n,a);const s=this.objectTransform.inverse;return(0,d.h)(this.tmpVertex,n,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,d.l)(e);(0,d.r)(e,e,e,r);const o=this.offset/(0,d.l)(t);(0,d.r)(t,t,t,o)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,d.l)((0,Tt.g)(e)),r=this.offset/t;return(0,d.r)((0,Tt.g)(this.sphere),(0,Tt.g)(e),(0,Tt.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,u.vt)(),this._tmpMbs=(0,Tt.c)(),this._tmpObb=new bt.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,d.l)(e)}applyToVertex(e,t,r){const o=(0,d.s)(At,e,t,r),i=(0,d.s)(Et,e,t,r+this.componentLocalOriginLength),n=this._totalOffset/(0,d.l)(i);return(0,d.r)(this._tmpVertex,o,i,n),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],o=e[1],i=e[2]+t,n=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(o),d=Math.abs(i),u=Math.abs(n),h=Math.abs(a),m=Math.abs(s),f=.5*(1+Math.sign(r*n))*Math.min(l,u),p=.5*(1+Math.sign(o*a))*Math.min(c,h),v=.5*(1+Math.sign(i*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),T=Math.sqrt(f*f+p*p+v*v),b=Math.sign(l+r),y=Math.sign(c+o),A=Math.sign(d+i),E=Math.sign(u+n),M=Math.sign(h+a),S=Math.sign(m+s),w=this._totalOffset;if(T<w)return e[0]-=(1-b)*w,e[1]-=(1-y)*w,e[2]-=(1-A)*w,e[3]+=E*w,e[4]+=M*w,e[5]+=S*w,e;const C=w/Math.sqrt(g*g+_*_+x*x),O=w/T,R=O-C,I=-R;return e[0]+=r*(b*I+O),e[1]+=o*(y*I+O),e[2]+=i*(A*I+O),e[3]+=n*(E*R+C),e[4]+=a*(M*R+C),e[5]+=s*(S*R+C),e}applyToMbs(e){const t=(0,d.l)((0,Tt.g)(e)),r=this._totalOffset/t;return(0,d.r)((0,Tt.g)(this._tmpMbs),(0,Tt.g)(e),(0,Tt.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,bt.gm)(e,this._totalOffset,this._totalOffset,Fe.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const o=(0,d.s)(At,e,t,r),i=(0,d.g)(Et,o,this.localOrigin),n=this.offset/(0,d.l)(i);return(0,d.r)(this.tmpVertex,o,i,n),this.tmpVertex}applyToAabb(e){const t=Mt,r=St,o=wt;for(let i=0;i<3;++i)t[i]=e[0+i]+this.localOrigin[i],r[i]=e[3+i]+this.localOrigin[i],o[i]=t[i];const i=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=i[t],e[t+3]=i[t];const n=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let i=0;i<3;++i)o[i]=e&1<<i?r[i]:t[i];n(o)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(!(a&e)){for(let i=0;i<3;++i)o[i]=a&1<<i?0:e&1<<i?t[i]:r[i];n(o)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const At=(0,u.vt)(),Et=(0,u.vt)(),Mt=(0,u.vt)(),St=(0,u.vt)(),wt=(0,u.vt)();function Ct(e,t,r){const{data:o,indices:i}=e,n=t.typedBuffer,a=t.typedBufferStride,s=i.length;r*=a;for(let e=0;e<s;++e){const t=2*i[e];n[r]=o[t],n[r+1]=o[t+1],r+=a}}function Ot(e,t,r,o){const{data:i,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,null==o||1===o)for(let e=0;e<l;++e){const t=3*n[e];a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*n[e];for(let e=0;e<o;++e)a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],r+=s}}function Rt(e,t,r,o=1){const{data:i,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===o)for(let e=0;e<l;++e){const t=4*n[e];a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],a[r+3]=i[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*n[e];for(let e=0;e<o;++e)a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],a[r+3]=i[t+3],r+=s}}function It(e,t,r,o,i=1){const n=t.typedBuffer,a=t.typedBufferStride;if(o*=a,1===i)for(let t=0;t<r;++t)n[o]=e[0],n[o+1]=e[1],n[o+2]=e[2],n[o+3]=e[3],o+=a;else for(let t=0;t<r;++t)for(let t=0;t<i;++t)n[o]=e[0],n[o+1]=e[1],n[o+2]=e[2],n[o+3]=e[3],o+=a}function Nt(e,t,r,o,i,n){switch(e){case ie.r.POSITION:{(0,U.vA)(3===t.size);const o=i.getField(e,f.xs);(0,U.vA)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,o,i=1){if(!t)return void Ot(e,r,o,i);const{data:n,indices:a}=e,l=r.typedBuffer,c=r.typedBufferStride,d=a.length,u=t[0],h=t[1],m=t[2],f=t[4],p=t[5],v=t[6],g=t[8],_=t[9],x=t[10],T=t[12],b=t[13],y=t[14];o*=c;let A=0,E=0,M=0;const S=(0,s.tZ)(t)?e=>{A=n[e]+T,E=n[e+1]+b,M=n[e+2]+y}:e=>{const t=n[e],r=n[e+1],o=n[e+2];A=u*t+f*r+g*o+T,E=h*t+p*r+_*o+b,M=m*t+v*r+x*o+y};if(1===i)for(let e=0;e<d;++e)S(3*a[e]),l[o]=A,l[o+1]=E,l[o+2]=M,o+=c;else for(let e=0;e<d;++e){S(3*a[e]);for(let e=0;e<i;++e)l[o]=A,l[o+1]=E,l[o+2]=M,o+=c}}(t,r,o,n);break}case ie.r.NORMAL:{(0,U.vA)(3===t.size);const r=i.getField(e,f.xs);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,o,i=1){if(!t)return void Ot(e,r,o,i);const{data:n,indices:a}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=a.length,h=l[0],m=l[1],f=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),y=1e-6,A=1-y;o*=d;let E=0,M=0,S=0;const w=(0,s.tZ)(l)?e=>{E=n[e],M=n[e+1],S=n[e+2]}:e=>{const t=n[e],r=n[e+1],o=n[e+2];E=h*t+p*r+_*o,M=m*t+v*r+x*o,S=f*t+g*r+T*o};if(1===i)if(b)for(let e=0;e<u;++e){w(3*a[e]);const t=E*E+M*M+S*S;if(t<A&&t>y){const e=1/Math.sqrt(t);c[o]=E*e,c[o+1]=M*e,c[o+2]=S*e}else c[o]=E,c[o+1]=M,c[o+2]=S;o+=d}else for(let e=0;e<u;++e)w(3*a[e]),c[o]=E,c[o+1]=M,c[o+2]=S,o+=d;else for(let e=0;e<u;++e){if(w(3*a[e]),b){const e=E*E+M*M+S*S;if(e<A&&e>y){const t=1/Math.sqrt(e);E*=t,M*=t,S*=t}}for(let e=0;e<i;++e)c[o]=E,c[o+1]=M,c[o+2]=S,o+=d}}(t,o,r,n);break}case ie.r.NORMALCOMPRESSED:{(0,U.vA)(2===t.size);const r=i.getField(e,f.mJ);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Ct(t,r,n);break}case ie.r.UV0:{(0,U.vA)(2===t.size);const r=i.getField(e,f.gH);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Ct(t,r,n);break}case ie.r.COLOR:case ie.r.SYMBOLCOLOR:{const r=i.getField(e,f.XP);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,o,i=1){const{data:n,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(o*=l,t!==n.length||4!==t)if(1!==i)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<i;++e)s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=255,o+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<i;++e)s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=n[t+3],o+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=n[t+3],o+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=255,o+=l}}else{s[o]=n[0],s[o+1]=n[1],s[o+2]=n[2],s[o+3]=n[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[o/=4];o+=t;const d=c*i;for(let r=1;r<d;++r)e[o]=a,o+=t}}(t,t.size,r,n);break}case ie.r.COLORFEATUREATTRIBUTE:{const r=i.getField(e,f.Y$);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:o,indices:i}=e,n=t.typedBuffer,a=t.typedBufferStride,s=i.length,l=o[0];r*=a;for(let e=0;e<s;++e)n[r]=l,r+=a}(t,r,n);break}case ie.r.TANGENT:{(0,U.vA)(4===t.size);const o=i.getField(e,f.Eq);(0,U.vA)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,o,i=1){if(!t)return void Rt(e,r,o,i);const{data:n,indices:a}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=a.length,h=l[0],m=l[1],f=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),y=1e-6,A=1-y;if(o*=d,1===i)for(let e=0;e<u;++e){const t=4*a[e],r=n[t],i=n[t+1],s=n[t+2],l=n[t+3];let u=h*r+p*i+_*s,E=m*r+v*i+x*s,M=f*r+g*i+T*s;if(b){const e=u*u+E*E+M*M;if(e<A&&e>y){const t=1/Math.sqrt(e);u*=t,E*=t,M*=t}}c[o]=u,c[o+1]=E,c[o+2]=M,c[o+3]=l,o+=d}else for(let e=0;e<u;++e){const t=4*a[e],r=n[t],s=n[t+1],l=n[t+2],u=n[t+3];let E=h*r+p*s+_*l,M=m*r+v*s+x*l,S=f*r+g*s+T*l;if(b){const e=E*E+M*M+S*S;if(e<A&&e>y){const t=1/Math.sqrt(e);E*=t,M*=t,S*=t}}for(let e=0;e<i;++e)c[o]=E,c[o+1]=M,c[o+2]=S,c[o+3]=u,o+=d}}(t,r,o,n);break}case ie.r.PROFILERIGHT:case ie.r.PROFILEUP:case ie.r.PROFILEVERTEXANDNORMAL:case ie.r.FEATUREVALUE:{(0,U.vA)(4===t.size);const r=i.getField(e,f.Eq);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Rt(t,r,n)}}}class Pt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(ie.r.POSITION).indices.length}write(e,t,r,o,i){!function(e,t,r,o,i,n){for(const a of t.fields.keys()){const t=e.attributes.get(a),s=t?.indices;if(t&&s)Nt(a,t,r,o,i,n);else if(a===ie.r.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(ie.r.POSITION)?.indices;if(t){const r=t.length,o=i.getField(a,f.XP);It(e.objectAndLayerIdColor,o,r,n)}}}}(r,this.vertexBufferLayout,e,t,o,i)}}var Lt=r(13752),Ht=r(91829),Dt=r(53466),Bt=r(72824),Ft=r(97220),zt=r(84867),Vt=r(39341),Gt=r(34886);pe.MT.LESS,pe.MT.ALWAYS;const Ut={mask:255},Wt={function:{func:pe.MT.ALWAYS,ref:F.dd.OutlineVisualElementMask,mask:F.dd.OutlineVisualElementMask},operation:{fail:pe.eA.KEEP,zFail:pe.eA.KEEP,zPass:pe.eA.ZERO}},jt={function:{func:pe.MT.ALWAYS,ref:F.dd.OutlineVisualElementMask,mask:F.dd.OutlineVisualElementMask},operation:{fail:pe.eA.KEEP,zFail:pe.eA.KEEP,zPass:pe.eA.REPLACE}};pe.MT.EQUAL,F.dd.OutlineVisualElementMask,F.dd.OutlineVisualElementMask,pe.eA.KEEP,pe.eA.KEEP,pe.eA.KEEP,pe.MT.NOTEQUAL,F.dd.OutlineVisualElementMask,F.dd.OutlineVisualElementMask,pe.eA.KEEP,pe.eA.KEEP,pe.eA.KEEP;const qt=[1,1,.5],kt=[0,.6,.2],$t=[0,1,.2];var Yt=r(28491);class Xt extends Bt.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,u.ci)(qt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=F.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,u.fA)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Ge.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,u.fA)(.2,.2,.2),this.diffuse=(0,u.fA)(.8,.8,.8),this.externalColor=(0,Ht.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,u.vt)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=F.it.Less,this.textureAlphaMode=F.sf.Blend,this.textureAlphaCutoff=je.Q,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=ke.m$.Occlude,this.isDecoration=!1}}Bt.gy;class Zt extends zt.w{initializeConfiguration(e,t){t.spherical=e.viewingMode===Fe.RT.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?Dt.q.Default:Dt.q.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Zt.shader)}_initializeProgram(e,t){return new Gt.B(e.rctx,t.get().build(this.configuration),Vt.D)}_makePipeline(e,t){const r=this.configuration,o=e===$e.y.NONE,i=e===$e.y.FrontFace;return(0,Ye.Ey)({blending:r.output===Ve.V.Color&&r.transparent?Je(e):null,culling:Kt(r)?(0,Ye.Xt)(r.cullFace):null,depthTest:{func:Qe(e,Jt(r.customDepthTest))},depthWrite:(o||i)&&r.writeDepth?Ye.kn:null,drawBuffers:r.output===Ve.V.Depth?{buffers:[pe.Hr.NONE]}:et(e),colorWrite:Ye.wE,stencilWrite:r.hasOccludees?Ut:null,stencilTest:r.hasOccludees?t?jt:Wt:null,polygonOffset:o||i?null:(n=r.enableOffset,n?Ke:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Jt(e){return e===F.it.Lequal?pe.MT.LEQUAL:pe.MT.LESS}function Kt(e){return e.cullFace!==F.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Zt.shader=new Ft.$(Yt.D,(()=>r.e(5141).then(r.bind(r,5141))));var Qt=r(90237),er=r(99769),tr=r(82991),rr=r(46263);class or extends tr.nW{}(0,Qt._)([(0,er.W)({constValue:!0})],or.prototype,"hasSliceHighlight",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],or.prototype,"hasSliceInVertexProgram",void 0),(0,Qt._)([(0,er.W)({constValue:rr.c.Pass})],or.prototype,"pbrTextureBindType",void 0);class ir extends or{constructor(){super(...arguments),this.output=Ve.V.Color,this.alphaDiscardMode=F.sf.Opaque,this.doubleSidedMode=Ue.W.None,this.pbrMode=We.A9.Disabled,this.cullFace=F.s2.None,this.transparencyPassType=$e.y.NONE,this.normalType=Ge.W.Attribute,this.textureCoordinateType=Dt.q.None,this.customDepthTest=F.it.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,Qt._)([(0,er.W)({count:Ve.V.COUNT})],ir.prototype,"output",void 0),(0,Qt._)([(0,er.W)({count:F.sf.COUNT})],ir.prototype,"alphaDiscardMode",void 0),(0,Qt._)([(0,er.W)({count:Ue.W.COUNT})],ir.prototype,"doubleSidedMode",void 0),(0,Qt._)([(0,er.W)({count:We.A9.COUNT})],ir.prototype,"pbrMode",void 0),(0,Qt._)([(0,er.W)({count:F.s2.COUNT})],ir.prototype,"cullFace",void 0),(0,Qt._)([(0,er.W)({count:$e.y.COUNT})],ir.prototype,"transparencyPassType",void 0),(0,Qt._)([(0,er.W)({count:Ge.W.COUNT})],ir.prototype,"normalType",void 0),(0,Qt._)([(0,er.W)({count:Dt.q.COUNT})],ir.prototype,"textureCoordinateType",void 0),(0,Qt._)([(0,er.W)({count:F.it.COUNT})],ir.prototype,"customDepthTest",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"spherical",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasVertexColors",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasSymbolColors",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasVerticalOffset",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasSlicePlane",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasSliceHighlight",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasColorTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasMetallicRoughnessTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasEmissionTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasOcclusionTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasNormalTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasScreenSizePerspective",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasVertexTangents",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasOccludees",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"multipassEnabled",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasModelTransformation",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"offsetBackfaces",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"vvSize",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"vvColor",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"receiveShadows",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"receiveAmbientOcclusion",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"textureAlphaPremultiplied",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"instanced",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"instancedColor",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"instancedDoublePrecision",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"writeDepth",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"transparent",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"enableOffset",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"cullAboveGround",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"snowCover",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasColorTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasEmissionTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasNormalTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasOcclusionTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Qt._)([(0,er.W)({constValue:!0})],ir.prototype,"discardTransparentFragments",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],ir.prototype,"occlusionPass",void 0),(0,Qt._)([(0,er.W)({constValue:!0})],ir.prototype,"hasVvInstancing",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],ir.prototype,"useCustomDTRExponentForWater",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],ir.prototype,"supportsTextureAtlas",void 0),(0,Qt._)([(0,er.W)({constValue:!0})],ir.prototype,"useFillLights",void 0);var nr=r(57323);class ar extends Zt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Ge.W.Attribute,t.doubleSidedMode=Ue.W.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,ar.shader)}}ar.shader=new Ft.$(nr.R,(()=>r.e(9933).then(r.bind(r,39933))));class sr extends ke.im{constructor(e){super(e,cr),this._configuration=new ir,this.supportsEdges=!0,this.produces=new Map([[_t.OPAQUE_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&!this.parameters.transparent],[_t.TRANSPARENT_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[_t.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,ze.BP)().vec3f(ie.r.POSITION);return e.normalType===Ge.W.Compressed?t.vec2i16(ie.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(ie.r.NORMAL),e.hasVertexTangents&&t.vec4f(ie.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(ie.r.UV0),e.hasVertexColors&&t.vec4u8(ie.r.COLOR),e.hasSymbolColors&&t.vec4u8(ie.r.SYMBOLCOLOR),(0,ae.A)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(ie.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Ve.V.Shadow&&e!==Ve.V.ShadowExcludeHighlight&&e!==Ve.V.ShadowHighlight||this.parameters.castShadows}get visible(){const e=this.parameters;if(e.layerOpacity<je.Q)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:o,vvColor:i}=e,n=t||i||o,a="replace"===e.colorMixMode,s=e.opacity>=je.Q;if(r&&n)return a||s;const l=e.externalColor&&e.externalColor[3]>=je.Q;return r?a?l:s:n?a||s:a?l:s}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?F.s2.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e===Ve.V.Color&&(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ue.W.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ue.W.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ue.W.WindingOrder:Ue.W.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?We.A9.Schematic:We.A9.Normal:We.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,o,i,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,d.s)(pr,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case Fe.RT.Global:n=(0,d.n)(mr,pr);break;case Fe.RT.Local:n=(0,d.c)(mr,hr)}let a=0;const s=(0,d.f)(vr,pr,e.eye),l=(0,d.l)(s),c=(0,d.j)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,d.m)(n,c)),a+=(0,Lt.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,d.j)(n,n,a),(0,d.t)(fr,n,r.transform.inverseRotation),o=(0,d.f)(dr,o,fr),i=(0,d.f)(ur,i,fr)}var a;ot(e,r,o,i,null!=(a=r.verticalOffset)?(yt.offset=a,yt):null,n)}createGLMaterial(e){return new lr(e)}createBufferWriter(){return new Pt(this._vertexBufferLayout)}}class lr extends qe.m{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===Ve.V.Color&&(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,d.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?ar:Zt,e)}}class cr extends Xt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}}const dr=(0,u.vt)(),ur=(0,u.vt)(),hr=(0,u.fA)(0,0,1),mr=(0,u.vt)(),fr=(0,u.vt)(),pr=(0,u.vt)(),vr=(0,u.vt)(),gr=()=>I.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function _r(e){throw new R.A("",`Request for object resource failed: ${e}`)}function xr(e){const t=e.params,r=t.topology;let o=!0;switch(t.vertexAttributes||(gr().warn("Geometry must specify vertex attributes"),o=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(gr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),o=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(gr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),o=!1)):(gr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),o=!1)}}else gr().warn("Indexed geometries must specify faces"),o=!1;break}default:gr().warn(`Unsupported topology '${r}'`),o=!1}e.params.material||(gr().warn("Geometry requires material"),o=!1);const i=e.params.vertexAttributes;for(const e in i)i[e].values||(gr().warn("Geometries with externally defined attributes are not yet supported"),o=!1);return o}function Tr(e){const t=(0,h.Ie)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,h.iT)(t,r.bbMin),(0,h.iT)(t,r.bbMax))})),t}function br(e){switch(e){case"mask":return F.sf.Mask;case"maskAndTransparency":return F.sf.MaskBlend;case"none":return F.sf.Opaque;default:return F.sf.Blend}}function yr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Ar=new L.R(1,2,"wosr");var Er=r(61765);async function Mr(e,t){const a=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,o.EM)(e));if("wosr"===a.fileType){const e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const o=await(0,C.Ke)(t.request(e,"json",r));if(!0===o.ok)return o.value;(0,P.QP)(o.error),_r(o.error.details.url)}(e,r,t);const o=await(0,C.Ke)((0,w.A)(e,t));if(!0===o.ok)return o.value.data;(0,P.QP)(o.error),_r(o.error)}(e,t),o=await async function(e,t){const r=new Array;for(const o in e){const i=e[o],n=i.images[0].data;if(!n){gr().warn("Externally referenced texture data is not yet supported");continue}const a=i.encoding+";base64,"+n,s="/textureDefinitions/"+o,l="rgba"===i.channels?i.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:pe.pF.REPEAT,t:pe.pF.REPEAT},preMultiplyAlpha:br(l)!==F.sf.Opaque},d=t?.disableTextures?Promise.resolve(null):D(a,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const o=await Promise.all(r),i={};for(const e of o)i[e.refId]=e;return i}(r.textureDefinitions??{},t);let i=0;for(const e in o)if(o.hasOwnProperty(e)){const t=o[e];i+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:o,size:i+(0,O.iL)(r)}}(a.url,t)),{engineResources:r,referenceBoundingBox:o}=function(e,t){const r=new Array,o=new Array,i=new Array,n=new N,a=e.resource,s=L.R.parse(a.version||"1.0","wosr");Ar.validate(s);const l=a.model.name,c=a.model.geometries,d=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<c.length;e++){const a=c[e];if(!xr(a))continue;const s=yr(a),l=a.params.vertexAttributes,p=[],v=e=>{if("PerAttributeArray"===a.params.topology)return null;const t=a.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l[ie.r.POSITION],_=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,o=v(e)??(0,H.tM)(_);p.push([e,new B.n(r,o,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!f.has(x)){const{image:e,parameters:t}=T,r=new He(e,t);o.push(r),f.set(x,r)}const b=f.get(x),y=b?b.id:void 0,A=s.material;let E=n.get(A,x);if(null==E){const e=d[A.substring(A.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,o=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,i=T?br(T.alphaChannelUsage):void 0,a={ambient:(0,u.ci)(e.diffuse),diffuse:(0,u.ci)(e.diffuse),opacity:1-(e.transparency||0),transparent:o,textureAlphaMode:i,textureAlphaCutoff:.33,textureId:y,initTextureTransparent:!0,doubleSided:!0,cullFace:F.s2.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(a,t.materialParameters),E=new sr(a),n.set(A,x,E)}i.push(E);const M=new ne(E,p);m+=p.find((e=>e[0]===ie.r.POSITION))?.[1]?.indices.length??0,r.push(M)}return{engineResources:[{name:l,stageResources:{textures:o,materials:i,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Tr(r)}}(e,t);return{lods:r,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}let A;if(t.cache)A=await t.cache.loadGLTF(a.url,t,!!t.usePBR);else{const{loadGLTF:e}=await r.e(4399).then(r.bind(r,4399));A=await e(new T.R(t.streamDataRequester),a.url,t,t.usePBR)}const M=A.model.meta?.ESRI_proxyEllipsoid,R=A.meta.isEsriSymbolResource&&null!=M&&"EsriRealisticTreesStyle"===A.meta.ESRI_webstyle;R&&!A.customMeta.esriTreeRendering&&(A.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const i of o.parts){const o=i.attributes.normal;if(null==o)return;const n=i.attributes.position,a=n.count,c=(0,u.vt)(),h=(0,u.vt)(),m=(0,u.vt)(),p=new Uint8Array(4*a),v=new Float64Array(3*a),g=(0,s.B8)((0,l.vt)(),i.transform);let _=0,x=0;for(let s=0;s<a;s++){n.getVec(s,h),o.getVec(s,c),(0,d.h)(h,h,i.transform),(0,d.f)(m,h,t.center),(0,d.D)(m,m,t.radius);const a=m[2],l=(0,d.l)(m),u=Math.min(.45+.55*l*l,1);(0,d.D)(m,m,t.radius),null!==g&&(0,d.h)(m,m,g),(0,d.n)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.o)(m,m,c,a>-1?.2:Math.min(-4*a-3.8,1)),v[_]=m[0],v[_+1]=m[1],v[_+2]=m[2],_+=3,p[x]=255*u,p[x+1]=255*u,p[x+2]=255*u,p[x+3]=255,x+=4}i.attributes.normal=new f.xs(v),i.attributes.color=new f.XP(p)}}}(A,M));const I=!!t.usePBR,z=A.meta.isEsriSymbolResource?{usePBR:I,isSchematic:!1,treeRendering:R,mrrFactors:[...$t]}:{usePBR:I,isSchematic:!1,treeRendering:!1,mrrFactors:[...qt]},V={...t.materialParameters,treeRendering:R},{engineResources:G,referenceBoundingBox:U}=function(e,t,r,o){const a=e.model,s=new Array,l=new Map,T=new Map,A=a.lods.length,M=(0,h.Ie)();return a.lods.forEach(((e,w)=>{const C=!0===o.skipHighLods&&(A>1&&0===w||A>3&&1===w)||!1===o.skipHighLods&&null!=o.singleLodIndex&&w!==o.singleLodIndex;if(C&&0!==w)return;const O=new S(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const o=C?new sr({}):function(e,t,r,o,i,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),l=e.materials.get(t.material),h=null!=t.attributes.texCoord0,m=null!=t.attributes.normal;if(null==l)return null;const f=function(e){switch(e){case"BLEND":return F.sf.Blend;case"MASK":return F.sf.Mask;case"OPAQUE":case null:case void 0:return F.sf.Opaque}}(l.alphaMode);if(!n.has(s)){if(h){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const o=e.textures.get(t);if(null!=o){const e=o.data;a.set(t,new He((0,y.x3)(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&r,encoding:(0,y.x3)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,f!==F.sf.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/Er.T),p=l.color[1]**(1/Er.T),v=l.color[2]**(1/Er.T),g=l.emissiveFactor[0]**(1/Er.T),_=l.emissiveFactor[1]**(1/Er.T),x=l.emissiveFactor[2]**(1/Er.T),T=null!=l.textureColor&&h?a.get(l.textureColor):null,b=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:i,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==i&&(null==n||(0,d.e)(n,u.uY))&&null==a&&(null==o||1===o)&&(null==r||1===r)}({normalTexture:l.textureNormal,metallicRoughnessTexture:l.textureMetallicRoughness,metallicFactor:l.metallicFactor,roughnessFactor:l.roughnessFactor,emissiveTexture:l.textureEmissive,emissiveFactor:l.emissiveFactor,occlusionTexture:l.textureOcclusion}),A=null!=l.normalTextureTransform?.scale?l.normalTextureTransform?.scale:c.Un;n.set(s,new sr({...o,transparent:f===F.sf.Blend,customDepthTest:F.it.Lequal,textureAlphaMode:f,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,p,v],ambient:[r,p,v],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?F.s2.None:F.s2.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?Ge.W.Attribute:Ge.W.ScreenDerivative,castShadows:!0,receiveShadows:l.receiveShadows,receiveAmbientOcclusion:l.receiveAmbientOcclustion,textureId:null!=T?T.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&h?a.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&h?a.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&h?a.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&h?a.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[g,_,x],mrrFactors:b?[...kt]:[l.metallicFactor,l.roughnessFactor,o.mrrFactors[2]],isSchematic:b,colorTextureTransformMatrix:E(l.colorTextureTransform),normalTextureTransformMatrix:E(l.normalTextureTransform),scale:[A[0],A[1]],occlusionTextureTransformMatrix:E(l.occlusionTextureTransform),emissiveTextureTransformMatrix:E(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:E(l.metallicRoughnessTextureTransform),...i}))}const p=n.get(s);if(r.stageResources.materials.push(p),h){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(l.textureColor),e(l.textureNormal),e(l.textureOcclusion),e(l.textureEmissive),e(l.textureMetallicRoughness)}return p}(a,e,O,t,r,l,T),{geometry:s,vertexCount:A}=function(e,t){const r=e.attributes.position.count,o=(0,b.x)(e.indices||r,e.primitiveType),a=(0,m.oe)(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,p.a)(a,s,e.transform,3,l);const c=[[ie.r.POSITION,new B.n(a,o,3,!0)]];if(null!=e.attributes.normal){const t=(0,m.oe)(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.normal;(0,n.Ge)(Sr,e.transform),(0,p.t)(t,a,Sr,3,s),(0,i.or)(Sr)&&(0,p.n)(t,t),c.push([ie.r.NORMAL,new B.n(t,o,3,!0)])}if(null!=e.attributes.tangent){const t=(0,m.oe)(4*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.tangent;(0,n.z0)(Sr,e.transform),(0,v.t)(t,a,Sr,4,s),(0,i.or)(Sr)&&(0,p.n)(t,t,4),c.push([ie.r.TANGENT,new B.n(t,o,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,m.oe)(2*r),{typedBuffer:i,typedBufferStride:n}=e.attributes.texCoord0;(0,g.a)(t,i,2,n),c.push([ie.r.UV0,new B.n(t,o,2,!0)])}const d=e.attributes.color;if(null!=d){const t=new Uint8Array(4*r);4===d.elementCount?d instanceof f.Eq?(0,v.b)(t,d,255):d instanceof f.XP?(0,x.a)(t,d):d instanceof f.Uz&&(0,v.b)(t,d,1/256):(t.fill(255),d instanceof f.xs?(0,p.f)(t,d.typedBuffer,255,4,d.typedBufferStride):e.attributes.color instanceof f.eI?(0,_.c)(t,d.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof f.nS&&(0,p.f)(t,d.typedBuffer,1/256,4,d.typedBufferStride)),c.push([ie.r.COLOR,new B.n(t,o,4,!0)])}return{geometry:new ne(t,c),vertexCount:r}}(e,null!=o?o:new sr({})),S=s.boundingInfo;null!=S&&0===w&&((0,h.iT)(M,S.bbMin),(0,h.iT)(M,S.bbMax)),null!=o&&(O.stageResources.geometries.push(s),O.numberOfVertices+=A)})),C||s.push(O)})),{engineResources:s,referenceBoundingBox:M}}(A,z,V,t.skipHighLods&&null==a.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:a.specifiedLodIndex});return{lods:G,referenceBoundingBox:U,isEsriSymbolResource:A.meta.isEsriSymbolResource,isWosr:!1}}const Sr=(0,a.vt)()},66104:(e,t,r)=>{var o,i;r.d(t,{k5:()=>o}),r(34727),(i=o||(o={}))[i.Multiply=1]="Multiply",i[i.Ignore=2]="Ignore",i[i.Replace=3]="Replace",i[i.Tint=4]="Tint"},42583:(e,t,r)=>{r.d(t,{A:()=>n});var o=r(66104),i=r(2597);function n(e){e.vertex.code.add(i.H`
259
+ `),e}const f=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},76412:(e,t,r)=>{r.d(t,{c:()=>p,d:()=>_,f:()=>b,g:()=>T,h:()=>x,k:()=>M,o:()=>P}),r(44208),r(53966);var o=r(34727),i=r(58083),n=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(34304),d=r(88582),u=r(71351),h=r(44280),m=r(32114);const f=p();function p(){return(0,l.vt)()}const v=s.e,g=s.e;function _(e,t){return(0,s.c)(t,e)}function x(e){return e[3]}function T(e){return e}function b(e,t,r,o){return(0,l.fA)(e,t,r,o)}function y(e,t,r){if(null==t)return!1;if(!E(e,t,A))return!1;let{t0:o,t1:i}=A;if((o<0||i<o&&i>0)&&(o=i),o<0)return!1;if(r){const{origin:e,direction:i}=t;r[0]=e[0]+i[0]*o,r[1]=e[1]+i[1]*o,r[2]=e[2]+i[2]*o}return!0}const A={t0:0,t1:0};function E(e,t,r){const{origin:o,direction:i}=t,n=S;n[0]=o[0]-e[0],n[1]=o[1]-e[1],n[2]=o[2]-e[2];const a=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===a)return!1;const s=2*(i[0]*n[0]+i[1]*n[1]+i[2]*n[2]),l=s*s-4*a*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-e[3]*e[3]);if(l<0)return!1;const c=Math.sqrt(l);return r.t0=(-s-c)/(2*a),r.t1=(-s+c)/(2*a),!0}const S=(0,a.vt)();function M(e,t){return y(e,t,null)}function w(e,t,r){const o=m.rq.get(),a=m.Rc.get();(0,n.b)(o,t.origin,t.direction);const s=x(e);(0,n.b)(r,o,t.origin),(0,n.j)(r,r,1/(0,n.l)(r)*s);const l=O(e,t.origin),c=(0,h.g7)(t.origin,r);return(0,i.$0)(a,c+l,o),(0,n.h)(r,r,a),r}function C(e,t,r){const o=(0,n.f)(m.rq.get(),t,e),i=(0,n.j)(m.rq.get(),o,e[3]/(0,n.l)(o));return(0,n.g)(r,i,e)}function O(e,t){const r=(0,n.f)(m.rq.get(),t,e),i=(0,n.l)(r),a=x(e),s=a+Math.abs(a-i);return(0,o.XM)(a/s)}const R=(0,a.vt)();function I(e,t,r,i){const a=(0,n.f)(R,t,e);switch(r){case d._.X:{const e=(0,o.jU)(a,R)[2];return(0,n.s)(i,-Math.sin(e),Math.cos(e),0)}case d._.Y:{const e=(0,o.jU)(a,R),t=e[1],r=e[2],s=Math.sin(t);return(0,n.s)(i,-s*Math.cos(r),-s*Math.sin(r),Math.cos(t))}case d._.Z:return(0,n.n)(i,a);default:return}}function N(e,t){const r=(0,n.f)(L,t,e);return(0,n.l)(r)-e[3]}function P(e,t){const r=(0,n.a)(e,t),o=x(e);return r<=o*o}const L=(0,a.vt)(),H=p();Object.freeze(Object.defineProperty({__proto__:null,NullSphere:f,altitudeAt:N,angleToSilhouette:O,axisAt:I,cameraFrustumCoverage:function(e,t,r,o){const i=x(e),n=i*i,a=t+.5*Math.PI,s=r*r+n-2*Math.cos(a)*r*i,l=Math.sqrt(s),c=s-n;if(c<=0)return.5;const d=Math.sqrt(c),u=Math.acos(d/l)-Math.asin(i/(l/Math.sin(a)));return Math.min(1,(u+.5*o)/o)},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},closestPoint:function(e,t,r){return y(e,t,r)?r:((0,u.oC)(t,e,r),C(e,r,r))},closestPointOnSilhouette:w,containsPoint:P,copy:_,create:p,distanceToSilhouette:function(e,t){const r=(0,n.f)(m.rq.get(),t,e),o=(0,n.q)(r),i=e[3]*e[3];return Math.sqrt(Math.abs(o-i))},elevate:function(e,t,r){return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),r[3]=e[3]+t,r},equals:g,exactEquals:v,fromCenterAndRadius:function(e,t){return(0,l.fA)(e[0],e[1],e[2],t)},fromRadius:function(e,t){return e[0]=e[1]=e[2]=0,e[3]=t,e},fromValues:b,getCenter:T,getExtent:function(e,t){return t},getRadius:x,intersectLine:function(e,t,r){const o=(0,u.Cr)(t,r);if(!E(e,o,A))return[];const{origin:i,direction:s}=o,{t0:l,t1:d}=A,h=t=>{const r=(0,a.vt)();return(0,n.r)(r,i,s,t),C(e,r,r)};return Math.abs(l-d)<(0,c.FD)()?[h(l)]:[h(l),h(d)]},intersectRay:y,intersectRayClosestSilhouette:function(e,t,r){if(y(e,t,r))return r;const o=w(e,t,m.rq.get());return(0,n.g)(r,t.origin,(0,n.j)(m.rq.get(),t.direction,(0,n.p)(t.origin,o)/(0,n.l)(t.direction))),r},intersectsRay:M,projectPoint:C,setAltitudeAt:function(e,t,r,o){const i=N(e,t),a=I(e,t,d._.Z,L),s=(0,n.j)(L,a,r-i);return(0,n.g)(o,t,s)},setExtent:function(e,t,r){return e!==r&&_(e,r),r},tmpSphere:H,union:function(e,t,r=(0,l.vt)()){const o=(0,n.p)(e,t),i=e[3],a=t[3];return o+a<i?((0,s.c)(r,e),r):o+i<a?((0,s.c)(r,t),r):((0,n.o)(r,e,t,(o+a-i)/(2*o)),r[3]=(o+i+a)/2,r)},wrap:function(e){return e}},Symbol.toStringTag,{value:"Module"}))},43609:(e,t,r)=>{r.d(t,{a:()=>n,f:()=>a,n:()=>i});var o=r(34275);function i(e,t){n(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r=2,i=r){const n=t.length/2;let a=0,s=0;if((0,o.cy)(t)||(0,o.dk)(t)){for(let o=0;o<n;++o)e[a]=t[s],e[a+1]=t[s+1],a+=r,s+=i;return}const l=(0,o.a3)(t);if((0,o.JI)(t))for(let o=0;o<n;++o)e[a]=Math.max(t[s]/l,-1),e[a+1]=Math.max(t[s+1]/l,-1),a+=r,s+=i;else for(let o=0;o<n;++o)e[a]=t[s]/l,e[a+1]=t[s+1]/l,a+=r,s+=i}function a(e,t,r,o){const i=e.typedBuffer,n=e.typedBufferStride,a=o?.count??e.count;let s=(o?.dstIndex??0)*n;for(let e=0;e<a;++e)i[s]=t,i[s+1]=r,s+=n}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:n,normalizeIntegerBufferView:i},Symbol.toStringTag,{value:"Module"}))},73354:(e,t,r)=>{function o(e,t,r){i(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function i(e,t,r,o=3,i=o){if(e.length/o!==Math.ceil(t.length/i))return e;const n=e.length/o,a=r[0],s=r[1],l=r[2],c=r[4],d=r[5],u=r[6],h=r[8],m=r[9],f=r[10],p=r[12],v=r[13],g=r[14];let _=0,x=0;for(let r=0;r<n;r++){const r=t[_],n=t[_+1],T=t[_+2];e[x]=a*r+c*n+h*T+p,e[x+1]=s*r+d*n+m*T+v,e[x+2]=l*r+u*n+f*T+g,_+=i,x+=o}return e}function n(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,o=3,i=o){if(e.length/o!==Math.ceil(t.length/i))return;const n=e.length/o,a=r[0],s=r[1],l=r[2],c=r[3],d=r[4],u=r[5],h=r[6],m=r[7],f=r[8];let p=0,v=0;for(let r=0;r<n;r++){const r=t[p],n=t[p+1],g=t[p+2];e[v]=a*r+c*n+h*g,e[v+1]=s*r+d*n+m*g,e[v+2]=l*r+u*n+f*g,p+=i,v+=o}}function s(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function l(e,t,r,o=3,i=o){const n=Math.min(e.length/o,t.length/i);let a=0,s=0;for(let l=0;l<n;l++)e[s]=r*t[a],e[s+1]=r*t[a+1],e[s+2]=r*t[a+2],a+=i,s+=o;return e}function c(e,t,r,o=3,i=o){const n=e.length/o;if(n!==Math.ceil(t.length/i))return e;let a=0,s=0;for(let l=0;l<n;l++)e[s]=t[a]+r[0],e[s+1]=t[a+1]+r[1],e[s+2]=t[a+2]+r[2],a+=i,s+=o;return e}function d(e,t){u(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function u(e,t,r=3,o=r){const i=Math.min(e.length/r,t.length/o);let n=0,a=0;for(let s=0;s<i;s++){const i=t[n],s=t[n+1],l=t[n+2],c=i*i+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*i,e[a+1]=t*s,e[a+2]=t*l}n+=o,a+=r}}r.d(t,{a:()=>i,b:()=>c,c:()=>n,d:()=>o,e:()=>d,f:()=>l,n:()=>u,s:()=>s,t:()=>a}),r(44208),r(53966),Object.freeze(Object.defineProperty({__proto__:null,normalize:u,normalizeView:d,scale:l,scaleView:s,shiftRight:function(e,t,r){const o=Math.min(e.count,t.count),i=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<o;e++)i[c]=a[l]>>r,i[c+1]=a[l+1]>>r,i[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:a,transformMat3View:n,transformMat4:i,transformMat4View:o,translate:c},Symbol.toStringTag,{value:"Module"}))},51737:(e,t,r)=>{function o(e,t){i(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function i(e,t,r=3,o=r){const i=t.length/o;let n=0,a=0;for(let s=0;s<i;++s)e[n]=t[a],e[n+1]=t[a+1],e[n+2]=t[a+2],n+=r,a+=o}function n(e,t,r,o,i){const n=e.typedBuffer,a=e.typedBufferStride,s=i?.count??e.count;let l=(i?.dstIndex??0)*a;for(let e=0;e<s;++e)n[l]=t,n[l+1]=r,n[l+2]=o,l+=a}r.d(t,{a:()=>o,c:()=>i,f:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,copyView:o,fill:n},Symbol.toStringTag,{value:"Module"}))},65686:(e,t,r)=>{r.d(t,{a:()=>i,b:()=>l,n:()=>a,s:()=>s,t:()=>n}),r(44208);var o=r(53966);function i(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=4,i=o){if(e.length/o!=t.length/i)return;const n=e.length/o,a=r[0],s=r[1],l=r[2],c=r[3],d=r[4],u=r[5],h=r[6],m=r[7],f=r[8];let p=0,v=0;for(let r=0;r<n;r++){const r=t[p],n=t[p+1],g=t[p+2],_=t[p+3];e[v]=a*r+c*n+h*g,e[v+1]=s*r+d*n+m*g,e[v+2]=l*r+u*n+f*g,e[v+3]=_,p+=i,v+=o}}function a(e,t){const r=Math.min(e.count,t.count),o=e.typedBuffer,i=e.typedBufferStride,n=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*i,r=e*a,s=n[r],l=n[r+1],c=n[r+2],d=s*s+l*l+c*c;if(d>0){const e=1/Math.sqrt(d);o[t]=e*s,o[t+1]=e*l,o[t+2]=e*c}}}function s(e,t,r){l(e.typedBuffer,t,r,e.typedBufferStride)}function l(e,t,r,o=4){const i=Math.min(e.length/o,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<i;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],e[l+3]=r*n[s+3],s+=a,l+=o}Object.freeze(Object.defineProperty({__proto__:null,normalize:a,scale:l,scaleView:s,transformMat3:n,transformMat3View:i,transformMat4:function(e,t,r,i=4,n=i){if(e.length/i!=t.length/n)return void o.A.getLogger("esri.views.3d.support.buffer.math").error("source and destination buffers need to have the same number of elements");const a=e.length/i,s=r[0],l=r[1],c=r[2],d=r[3],u=r[4],h=r[5],m=r[6],f=r[7],p=r[8],v=r[9],g=r[10],_=r[11],x=r[12],T=r[13],b=r[14],y=r[15];let A=0,E=0;for(let r=0;r<a;r++){const r=t[A],o=t[A+1],a=t[A+2],S=t[A+3];e[E]=s*r+u*o+p*a+x*S,e[E+1]=l*r+h*o+v*a+T*S,e[E+2]=c*r+m*o+g*a+b*S,e[E+3]=d*r+f*o+_*a+y*S,A+=n,E+=i}},transformMat4View:function(e,t,r){if(e.count!==t.count)return;const o=e.count,i=r[0],n=r[1],a=r[2],s=r[3],l=r[4],c=r[5],d=r[6],u=r[7],h=r[8],m=r[9],f=r[10],p=r[11],v=r[12],g=r[13],_=r[14],x=r[15],T=e.typedBuffer,b=e.typedBufferStride,y=t.typedBuffer,A=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*b,r=e*A,o=y[r],E=y[r+1],S=y[r+2],M=y[r+3];T[t]=i*o+l*E+h*S+v*M,T[t+1]=n*o+c*E+m*S+g*M,T[t+2]=a*o+d*E+f*S+_*M,T[t+3]=s*o+u*E+p*S+x*M}}},Symbol.toStringTag,{value:"Module"}))},78358:(e,t,r)=>{function o(e,t){i(e.typedBuffer,t,e.typedBufferStride)}function i(e,t,r=4){const o=t.typedBuffer,i=t.typedBufferStride,n=t.count;let a=0,s=0;for(let t=0;t<n;++t)e[a]=o[s],e[a+1]=o[s+1],e[a+2]=o[s+2],e[a+3]=o[s+3],a+=r,s+=i}function n(e,t,r,o,i,n){const a=e.typedBuffer,s=e.typedBufferStride,l=n?.count??e.count;let c=(n?.dstIndex??0)*s;for(let e=0;e<l;++e)a[c]=t,a[c+1]=r,a[c+2]=o,a[c+3]=i,c+=s}r.d(t,{a:()=>i,c:()=>o,f:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,copy:i,copyView:o,fill:n},Symbol.toStringTag,{value:"Module"}))},4341:(e,t,r)=>{r.d(t,{I:()=>i});var o=r(26390);class i{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,o.d)((()=>this._reset())),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*n);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,n));e++)this._items.push(this._allocator())}}const n=1024},46140:(e,t,r)=>{r.d(t,{R:()=>i});var o=r(49186);let i=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new o.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[i,n]=t.split("."),a=/^\s*\d+\s*$/;if(!i?.match||!a.test(i))throw new o.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!n?.match||!a.test(n))throw new o.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(i,10),l=parseInt(n,10);return new e(s,l,r)}}},61473:(e,t,r)=>{function o(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function i(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{EM:()=>i,b5:()=>o});const n=/^devext\.arcgis\.com$/,a=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,n,a,/^jsapps\.esri\.com$/,s,l]},11964:(e,t,r)=>{r.d(t,{Cr:()=>c,H6:()=>h,_I:()=>u,kb:()=>d,vt:()=>l});var o=r(34727),i=r(4341),n=r(38954),a=r(51850),s=r(32114);function l(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.f)(r.vector,t,e),r}function d(e,t){const r=(0,n.f)(s.rq.get(),t,e.origin),i=(0,n.m)(e.vector,r),a=(0,n.m)(e.vector,e.vector),l=(0,o.qE)(i/a,0,1),c=(0,n.f)(s.rq.get(),(0,n.j)(s.rq.get(),e.vector,l),r);return(0,n.m)(c,c)}function u(e,t,r){return h(e,t,0,1,r)}function h(e,t,r,i,a){const{vector:l,origin:c}=e,d=(0,n.f)(s.rq.get(),t,c),u=(0,n.m)(l,d)/(0,n.q)(l);return(0,n.j)(a,l,(0,o.qE)(u,r,i)),(0,n.g)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)(),new i.I((()=>l()))},71351:(e,t,r)=>{r.d(t,{Cr:()=>d,LV:()=>c,kb:()=>u,oC:()=>h,vt:()=>s}),r(4576);var o=r(4341),i=r(38954),n=r(51850),a=r(32114);function s(e){return e?l((0,n.o8)(e.origin),(0,n.o8)(e.direction)):l((0,n.vt)(),(0,n.vt)())}function l(e,t){return{origin:e,direction:t}}function c(e,t){const r=m.get();return r.origin=e,r.direction=t,r}function d(e,t,r=s()){return(0,i.c)(r.origin,e),(0,i.f)(r.direction,t,e),r}function u(e,t){const r=(0,i.b)(a.rq.get(),(0,i.n)(a.rq.get(),e.direction),(0,i.f)(a.rq.get(),t,e.origin));return(0,i.m)(r,r)}function h(e,t,r){const o=(0,i.m)(e.direction,(0,i.f)(r,t,e.origin));return(0,i.g)(r,e.origin,(0,i.j)(r,e.direction,o)),r}const m=new o.I((()=>s()));(0,n.vt)()},21015:(e,t,r)=>{r.d(t,{R:()=>l});var o=r(78888),i=r(60999),n=r(49186),a=r(74887),s=r(84952);class l{constructor(e){this._streamDataRequester=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,s.DB)(e)?((0,a.Te)(t),(0,s.lJ)(e)):this._load("binary",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){if(null==this._streamDataRequester)return(await(0,o.A)(t,{responseType:c[e]})).data;const s=await(0,i.Ke)(this._streamDataRequester.request(t,e,r));if(!0===s.ok)return s.value;throw(0,a.QP)(s.error),new n.A("",`Request for resource failed: ${s.error}`)}}const c={image:"image",binary:"array-buffer",json:"json","image+type":void 0}},84498:(e,t,r)=>{r.d(t,{x:()=>a});var o=r(34275),i=r(97146),n=r(63907);function a(e,t){switch(t){case n.WR.TRIANGLES:return"number"==typeof(r=e)?(0,i.tM)(r):(0,o.mg)(r)?new Uint16Array(r):r;case n.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,o=(0,i.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(o[e++]=t,o[e++]=t+1,o[e++]=t+2):(o[e++]=t+1,o[e++]=t,o[e++]=t+2)}else{let t=0;for(let i=0;i<r;i+=1)i%2==0?(o[t++]=e[i],o[t++]=e[i+1],o[t++]=e[i+2]):(o[t++]=e[i+1],o[t++]=e[i],o[t++]=e[i+2])}return o}(e);case n.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,o=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)o[e++]=0,o[e++]=t+1,o[e++]=t+2;return o}const i=e[0];let n=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];o[a++]=i,o[a++]=n,o[a++]=r,n=r}return o}(e)}var r}},51530:(e,t,r)=>{r.d(t,{KB:()=>s,Xi:()=>n,pn:()=>l,x3:()=>a});var o=r(44208),i=r(89192);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding=i.JS.KTX2_ENCODING}}function a(e){return"encoded-mesh-texture"===e?.type}async function s(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function l(e,t){if(t===i.JS.KTX2_ENCODING)return new n(e);const r=new Blob([e],{type:t}),a=URL.createObjectURL(r),s=new Image;if((0,o.A)("esri-iPhone"))return new Promise(((e,t)=>{const r=()=>{i(),e(s)},o=e=>{i(),t(e)},i=()=>{URL.revokeObjectURL(a),s.removeEventListener("load",r),s.removeEventListener("error",o)};s.addEventListener("load",r),s.addEventListener("error",o),s.src=a}));try{s.src=a,await s.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(a),s}},55268:(e,t,r)=>{r.d(t,{fetch:()=>Sr});var o=r(61473),i=r(34727),n=r(77690),a=r(29242),s=r(58083),l=r(9093),c=r(48163),d=r(38954),u=r(51850),h=r(70328),m=r(11868),f=r(13030),p=r(73354),v=r(65686),g=r(43609),_=r(51737),x=r(78358),T=r(21015),b=r(84498),y=r(51530),A=r(88340);function E(e){if(null==e)return null;const t=null!=e.offset?e.offset:A.uY,r=null!=e.rotation?e.rotation:0,o=null!=e.scale?e.scale:A.Un,i=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(o[0],0,0,0,o[1],0,0,0,1),c=(0,a.vt)();return(0,n.lw)(c,s,l),(0,n.lw)(c,i,c),c}class S{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class M{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new S,this.numberOfVertices=0}}var w=r(78888),C=r(60999),O=r(86805),R=r(49186),I=r(53966);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const o=this._outer.get(e);o?o.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}forAll(e){for(const t of this._outer.values())for(const r of t.values())e(r)}}var P=r(74887),L=r(46140),H=r(97146);async function D(e,t){const{data:r}=await(0,w.A)(e,{responseType:"image",...t});return r}var B=r(46610),F=r(89192),z=r(34275);function V(e){if(e.length<z.y9)return Array.from(e);if((0,z.cy)(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,z.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var G=r(3694),U=r(620);class W{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,U.vA)(e.length>=1),(0,U.vA)(3===r.size||4===r.size);const{data:o,size:i,indices:n}=r;(0,U.vA)(n.length%this._numIndexPerPrimitive==0),(0,U.vA)(n.length>=e.length*this._numIndexPerPrimitive);const a=e.length;let s=i*n[this._numIndexPerPrimitive*e[0]];j.clear(),j.push(s);const l=(0,u.fA)(o[s],o[s+1],o[s+2]),c=(0,u.o8)(l);for(let t=0;t<a;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=i*n[r+e],j.push(s);let t=o[s];l[0]=Math.min(t,l[0]),c[0]=Math.max(t,c[0]),t=o[s+1],l[1]=Math.min(t,l[1]),c[1]=Math.max(t,c[1]),t=o[s+2],l[2]=Math.min(t,l[2]),c[2]=Math.max(t,c[2])}}this.bbMin=l,this.bbMax=c;const h=(0,d.o)((0,u.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(c[0]-l[0],c[1]-l[1]),c[2]-l[2]);let m=this.radius*this.radius;for(let e=0;e<j.length;++e){s=j.at(e);const t=o[s]-h[0],r=o[s+1]-h[1],i=o[s+2]-h[2],n=t*t+r*r+i*i;if(n<=m)continue;const a=Math.sqrt(n),l=.5*(a-this.radius);this.radius=this.radius+l,m=this.radius*this.radius;const c=l/a;h[0]+=t*c,h[1]+=r*c,h[2]+=i*c}this.center=h,j.clear()}getChildren(){if(this._children||(0,d.a)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,d.o)((0,u.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),o=new Array(8);for(let e=0;e<8;++e)o[e]=0;const{data:i,size:n,indices:a}=this.position;for(let s=0;s<t;++s){let t=0;const l=this._numIndexPerPrimitive*this.primitiveIndices[s];let c=n*a[l],d=i[c],u=i[c+1],h=i[c+2];for(let e=1;e<this._numIndexPerPrimitive;++e){c=n*a[l+e];const t=i[c],r=i[c+1],o=i[c+2];t<d&&(d=t),r<u&&(u=r),o<h&&(h=o)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[s]=t,++o[t]}let s=0;for(let e=0;e<8;++e)o[e]>0&&++s;if(s<2)return;const l=new Array(8);for(let e=0;e<8;++e)l[e]=o[e]>0?new Uint32Array(o[e]):void 0;for(let e=0;e<8;++e)o[e]=0;for(let e=0;e<t;++e){const t=r[e];l[t][o[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==l[e]&&this._children.push(new W(l[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){j.prune()}}const j=new G.A({deallocator:null});var q=r(69720),k=r(96672),$=r(4341),Y=r(11964);function X(e,t,r){return(0,d.f)(Z,t,e),(0,d.f)(J,r,e),.5*(0,d.l)((0,d.b)(Z,Z,J))}r(32114),new $.I(Y.vt),new $.I((()=>{return e?{p0:(0,u.o8)(e.p0),p1:(0,u.o8)(e.p1),p2:(0,u.o8)(e.p2)}:{p0:(0,u.vt)(),p1:(0,u.vt)(),p2:(0,u.vt)()};var e}));const Z=(0,u.vt)(),J=(0,u.vt)(),K=(0,u.vt)(),Q=(0,u.vt)(),ee=(0,u.vt)(),te=(0,u.vt)();var re=r(24326);class oe{constructor(e){this.channel=e,this.id=(0,re.c)()}}var ie=r(46540);r(28449),(0,u.vt)(),new Float32Array(6);class ne extends q.J{constructor(e,t,r=null,o=k.X.Mesh,i=null,n=-1){super(),this.material=e,this.mapPositions=r,this.type=o,this.objectAndLayerIdColor=i,this.edgeIndicesLength=n,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,H.Dg)(r.indices)}),e===ie.r.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new ne(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)})),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:V(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r&&this._attributes.set(e,{...r,exclusive:!0,data:t})}get indexCount(){const e=this._attributes.values().next().value.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===k.X.Mesh?this._computeAttachmentOriginTriangles(e):this.type===k.X.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,d.h)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:o,indices:i}=e;(0,d.s)(t,0,0,0),(0,d.s)(te,0,0,0);let n=0,a=0;for(let e=0;e<i.length-2;e+=3){const s=i[e]*r,l=i[e+1]*r,c=i[e+2]*r;(0,d.s)(K,o[s],o[s+1],o[s+2]),(0,d.s)(Q,o[l],o[l+1],o[l+2]),(0,d.s)(ee,o[c],o[c+1],o[c+2]);const u=X(K,Q,ee);u?((0,d.g)(K,K,Q),(0,d.g)(K,K,ee),(0,d.j)(K,K,1/3*u),(0,d.g)(t,t,K),n+=u):((0,d.g)(te,te,K),(0,d.g)(te,te,Q),(0,d.g)(te,te,ee),a+=3)}return!(0===a&&0===n||(0!==n?((0,d.j)(t,t,1/n),0):0===a||((0,d.j)(t,te,1/a),0)))}(this.attributes.get(ie.r.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(ie.r.POSITION);return function(e,t,r){if(!e)return!1;(0,d.s)(r,0,0,0),(0,d.s)(te,0,0,0);let o=0,i=0;const{size:n,data:a,indices:s}=e,l=s.length-1,c=l+(t?2:0);for(let e=0;e<c;e+=2){const t=e<l?e+1:0,c=s[e<l?e:l]*n,u=s[t]*n;K[0]=a[c],K[1]=a[c+1],K[2]=a[c+2],Q[0]=a[u],Q[1]=a[u+1],Q[2]=a[u+2],(0,d.j)(K,(0,d.g)(K,K,Q),.5);const h=(0,d.F)(K,Q);h>0?((0,d.g)(r,r,(0,d.j)(K,K,h)),o+=h):0===o&&((0,d.g)(te,te,K),i++)}return 0!==o?((0,d.j)(r,r,1/o),!0):0!==i&&((0,d.j)(r,te,1/i),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:o,indices:i}=e;(0,d.s)(t,0,0,0);let n=-1,a=0;for(let e=0;e<i.length;e++){const s=i[e]*r;n!==s&&(t[0]+=o[s],t[1]+=o[s+1],t[2]+=o[s+2],a++),n=s}return a>1&&(0,d.j)(t,t,1/a),a>0}(this.attributes.get(ie.r.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(ie.r.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===k.X.Mesh?3:1;(0,U.vA)(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,H.tM)(e.indices.length/t);return new W(r,t,e)}get transformation(){return this._transformation??l.zK}set transformation(e){this._transformation=e&&e!==l.zK?(0,l.o8)(e):null}addHighlight(){const e=new oe(F.Mg.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}var ae=r(44208),se=r(65529),le=r(97768),ce=r(84952),de=r(56058),ue=r(2741);let he;var me,fe;(fe=me||(me={}))[fe.ETC1_RGB=0]="ETC1_RGB",fe[fe.ETC2_RGBA=1]="ETC2_RGBA",fe[fe.BC1_RGB=2]="BC1_RGB",fe[fe.BC3_RGBA=3]="BC3_RGBA",fe[fe.BC4_R=4]="BC4_R",fe[fe.BC5_RG=5]="BC5_RG",fe[fe.BC7_M6_RGB=6]="BC7_M6_RGB",fe[fe.BC7_M5_RGBA=7]="BC7_M5_RGBA",fe[fe.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",fe[fe.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",fe[fe.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",fe[fe.ATC_RGB=11]="ATC_RGB",fe[fe.ATC_RGBA=12]="ATC_RGBA",fe[fe.FXT1_RGB=17]="FXT1_RGB",fe[fe.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",fe[fe.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",fe[fe.ETC2_EAC_R11=20]="ETC2_EAC_R11",fe[fe.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",fe[fe.RGBA32=13]="RGBA32",fe[fe.RGB565=14]="RGB565",fe[fe.BGR565=15]="BGR565",fe[fe.RGBA4444=16]="RGBA4444";var pe=r(63907),ve=r(21231),ge=r(42293);let _e=null,xe=null;async function Te(){return null==xe&&(he??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,ue.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),xe=he,_e=await xe),xe}function be(e,t,r,o,i){const n=(0,ge.IB)(t?pe.CQ.COMPRESSED_RGBA8_ETC2_EAC:pe.CQ.COMPRESSED_RGB8_ETC2),a=i&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*o*n*a)}function ye(e){return e.getNumImages()>=1&&!e.isUASTC()}function Ae(e){return e.getFaces()>=1&&e.isETC1S()}function Ee(e,t,r,o,i,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?o?[me.ETC2_RGBA,pe.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[me.ETC1_RGB,pe.CQ.COMPRESSED_RGB8_ETC2]:c?o?[me.BC3_RGBA,pe.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[me.BC1_RGB,pe.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[me.RGBA32,pe.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.width=i,t.height=n,new ve.g(e,t,{type:"compressed",levels:m})}const Se=()=>I.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Me(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const we=Me("DXT1"),Ce=Me("DXT3"),Oe=Me("DXT5");function Re(e,t,r){if(e instanceof ImageData)return Re(Ie(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}function Ie(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new R.A("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var Ne,Pe,Le=r(67171);class He extends q.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=k.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new se.A,this._parameters={...Be,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,ce.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,ce.DB)(e.src)||(0,ce.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new Le.R;return t.wrapMode=this._parameters.wrap??pe.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,z.mw)(e)||(0,z.mg)(e))return t.encoding===F.JS.KTX2_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.KTX2File(new Uint8Array(e)),o=Ae(r)?be(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),o}(e,!!t.mipmap):t.encoding===F.JS.BASIS_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.BasisFile(new Uint8Array(e)),o=ye(r)?be(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),o}(e,!!t.mipmap):e.byteLength;const{width:r,height:o}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?De(e):t;return(t.mipmap?4/3:1)*r*o*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new ve.g(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,z.mw)(t)||(0,z.mg)(t))&&this._parameters.encoding===F.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,z.mg)(t)?this._loadFromPixelData(e,t):(0,z.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<Ne.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const o=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return Se().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Se().error("Unsupported format, must contain a FourCC code"),null;const o=r[21];let i,n;switch(o){case we:i=8,n=pe.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ce:i=16,n=pe.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Oe:i=16,n=pe.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Se().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(o)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(Se().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*i,u=new Uint8Array(e,m,h),f.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:c,height:d}}(r,t.hasMipmap??!1);if(null==o)throw new Error("DDS texture data is null");const{textureData:i,internalFormat:n,width:a,height:s}=o;return t.samplingMode=i.levels.length>1?pe.Cj.LINEAR_MIPMAP_LINEAR:pe.Cj.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new ve.g(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await Te());const o=new _e.KTX2File(new Uint8Array(r));if(!Ae(o))return null;o.startTranscoding();const i=Ee(e,t,o.getLevels(),o.getHasAlpha(),o.getWidth(),o.getHeight(),((e,t)=>o.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>o.transcodeImage(r,e,0,0,t,0,-1,-1)));return o.close(),o.delete(),i}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await Te());const o=new _e.BasisFile(new Uint8Array(r));if(!ye(o))return null;o.startTranscoding();const i=Ee(e,t,o.getNumLevels(0),o.getHasAlpha(),o.getImageWidth(0,0),o.getImageHeight(0,0),((e,t)=>o.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>o.transcodeImage(r,0,e,t,0,0)));return o.close(),o.delete(),i}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,U.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?pe.Ab.LUMINANCE:3===this._parameters.components?pe.Ab.RGB:pe.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new ve.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const o=await D(t,{signal:r});return(0,P.Te)(r),this._loadFromImage(e,o)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const o=await(0,de.Sx)(t,t.src,!1,r);return(0,P.Te)(r),this._loadFromImage(e,o)}))}_loadFromVideoElement(e,t){return t.readyState>=Ne.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((o,i)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,le.xt)(l)},a=()=>{t.readyState>=Ne.HAVE_CURRENT_DATA&&(n(),o(this._loadFromImage(e,t)))},s=e=>{n(),i(e||new R.A("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,P.u7)(r,(()=>s((0,P.NK)())))}))))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:t}=e.parameters;r=this._parameters.downsampleUncompressed?function(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?Ie(e):e;let o=e.width,i=e.height;do{o=Math.ceil(o/2),i=Math.ceil(i/2),r=o*i}while(r>1048576||null!=t&&(o>t||i>t));return Re(e,o,i)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const o=t/r;return Re(e,Math.round(e.width*o),Math.round(e.height*o))}(r,t)}const o=De(r);this._parameters.width=o.width,this._parameters.height=o.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this._parameters.components?pe.Ab.RGB:pe.Ab.RGBA,i.width=o.width,i.height=o.height,this._glTexture=new ve.g(e,i,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const o=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(o,o),r}unload(){if(this._glTexture=(0,le.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function De(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(Pe=Ne||(Ne={}))[Pe.HAVE_NOTHING=0]="HAVE_NOTHING",Pe[Pe.HAVE_METADATA=1]="HAVE_METADATA",Pe[Pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Pe[Pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Pe[Pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Be={wrap:{s:pe.pF.REPEAT,t:pe.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Fe=r(24151),ze=r(1843),Ve=r(49255),Ge=r(96336),Ue=r(62602),We=r(59469),je=r(35093),qe=r(25634),ke=r(14903),$e=r(14327),Ye=r(90644);const Xe=(0,Ye.p3)(pe.dn.SRC_ALPHA,pe.dn.ONE,pe.dn.ONE_MINUS_SRC_ALPHA,pe.dn.ONE_MINUS_SRC_ALPHA),Ze=(0,Ye.p3)(pe.dn.ONE,pe.dn.ZERO,pe.dn.ONE,pe.dn.ONE_MINUS_SRC_ALPHA);function Je(e){switch(e){case $e.y.NONE:return Xe;case $e.y.ColorAlpha:return Ze;case $e.y.FrontFace:case $e.y.COUNT:return null}}const Ke={factor:-1,units:-2};function Qe(e,t=pe.MT.LESS){return e===$e.y.NONE||e===$e.y.FrontFace?t:pe.MT.LEQUAL}function et(e){return e===$e.y.ColorAlpha?{buffers:[pe.Nm.COLOR_ATTACHMENT0,pe.Nm.COLOR_ATTACHMENT1]}:null}class tt{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const rt=(0,h.vt)();function ot(e,t,r,o,i,n){if(!e.visible)return;const a=(0,d.z)(vt,o,r),s=(e,t,r)=>{n(e,r,t,!1)},l=new tt(!1,t.options.normalRequired);if(e.boundingInfo){(0,U.vA)(e.type===k.X.Mesh);const o=t.tolerance;nt(e.boundingInfo,r,a,o,i,l,s)}else{const t=e.attributes.get(ie.r.POSITION),o=t.indices;!function(e,t,r,o,i,n,a,s,l,c){const u=t,h=gt,m=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),v=m>=f?m>=p?0:2:f>=p?1:2,g=v,_=u[g]<0?2:1,x=(v+_)%3,T=(v+(3-_))%3,b=u[x]/u[g],y=u[T]/u[g],A=1/u[g],E=st,S=lt,M=ct,{normalRequired:w}=l;for(let t=r;t<o;++t){const r=3*t,o=a*i[r];(0,d.s)(h[0],n[o+0],n[o+1],n[o+2]);const l=a*i[r+1];(0,d.s)(h[1],n[l+0],n[l+1],n[l+2]);const u=a*i[r+2];(0,d.s)(h[2],n[u+0],n[u+1],n[u+2]),s&&((0,d.c)(h[0],s.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,d.c)(h[1],s.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,d.c)(h[2],s.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,d.z)(E,h[0],e),(0,d.z)(S,h[1],e),(0,d.z)(M,h[2],e);const m=E[x]-b*E[g],f=E[T]-y*E[g],p=S[x]-b*S[g],v=S[T]-y*S[g],_=M[x]-b*M[g],C=M[T]-y*M[g],O=_*v-C*p,R=m*C-f*_,I=p*f-v*m;if((O<0||R<0||I<0)&&(O>0||R>0||I>0))continue;const N=O+R+I;if(0===N)continue;const P=O*(A*E[g])+R*(A*S[g])+I*(A*M[g]);if(P*Math.sign(N)<0)continue;const L=P/N;L>=0&&c(L,t,w?ut(h):null)}}(r,a,0,o.length/3,o,t.data,t.stride,i,l,s)}}const it=(0,u.vt)();function nt(e,t,r,o,i,n,a){if(null==e)return;const s=function(e,t){return(0,d.s)(t,1/e[0],1/e[1],1/e[2])}(r,it);if((0,h.Ne)(rt,e.bbMin),(0,h.vI)(rt,e.bbMax),null!=i&&i.applyToAabb(rt),function(e,t,r,o){return function(e,t,r,o,i){const n=(e[0]-o-t[0])*r[0],a=(e[3]+o-t[0])*r[0];let s=Math.min(n,a),l=Math.max(n,a);const c=(e[1]-o-t[1])*r[1],d=(e[4]+o-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-o-t[2])*r[2],h=(e[5]+o-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,o)}(rt,t,s,o)){const{primitiveIndices:s,position:l}=e,c=s?s.length:l.indices.length/3;if(c>ft){const s=e.getChildren();if(void 0!==s){for(const e of s)nt(e,t,r,o,i,n,a);return}}!function(e,t,r,o,i,n,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],p=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<o;++e){const t=s[e],r=3*t,o=a*i[r];let c=n[o],_=n[o+1],x=n[o+2];const T=a*i[r+1];let b=n[T],y=n[T+1],A=n[T+2];const E=a*i[r+2];let S=n[E],M=n[E+1],w=n[E+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[b,y,A]=l.applyToVertex(b,y,A,e),[S,M,w]=l.applyToVertex(S,M,w,e));const C=b-c,O=y-_,R=A-x,I=S-c,N=M-_,P=w-x,L=p*P-N*v,H=v*I-P*f,D=f*N-I*p,B=C*L+O*H+R*D;if(Math.abs(B)<=pt)continue;const F=u-c,z=h-_,V=m-x,G=F*L+z*H+V*D;if(B>0){if(G<0||G>B)continue}else if(G>0||G<B)continue;const U=z*R-O*V,W=V*C-R*F,j=F*O-C*z,q=f*U+p*W+v*j;if(B>0){if(q<0||G+q>B)continue}else if(q>0||G+q<B)continue;const k=(I*U+N*W+P*j)/B;k>=0&&d(k,t,g?dt(C,O,R,I,N,P,at):null)}}(t,r,0,c,l.indices,l.data,l.stride,s,i,n,a)}}const at=(0,u.vt)();const st=(0,u.vt)(),lt=(0,u.vt)(),ct=(0,u.vt)();function dt(e,t,r,o,i,n,a){return(0,d.s)(ht,e,t,r),(0,d.s)(mt,o,i,n),(0,d.b)(a,ht,mt),(0,d.n)(a,a),a}function ut(e){return(0,d.z)(ht,e[1],e[0]),(0,d.z)(mt,e[2],e[0]),(0,d.b)(at,ht,mt),(0,d.n)(at,at),at}const ht=(0,u.vt)(),mt=(0,u.vt)(),ft=1e3,pt=1e-7,vt=(0,u.vt)(),gt=[(0,u.vt)(),(0,u.vt)(),(0,u.vt)()];var _t,xt;(xt=_t||(_t={}))[xt.INTEGRATED_MESH=0]="INTEGRATED_MESH",xt[xt.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",xt[xt.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",xt[xt.OPAQUE_NO_SSAO_DEPTH=3]="OPAQUE_NO_SSAO_DEPTH",xt[xt.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",xt[xt.TRANSPARENT_NO_SSAO_DEPTH=5]="TRANSPARENT_NO_SSAO_DEPTH",xt[xt.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",xt[xt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=7]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",xt[xt.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",xt[xt.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",xt[xt.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",xt[xt.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",xt[xt.OPAQUE_ENVIRONMENT=12]="OPAQUE_ENVIRONMENT",xt[xt.TRANSPARENT_ENVIRONMENT=13]="TRANSPARENT_ENVIRONMENT",xt[xt.HUD_MATERIAL=14]="HUD_MATERIAL",xt[xt.LABEL_MATERIAL=15]="LABEL_MATERIAL",xt[xt.LINE_CALLOUTS=16]="LINE_CALLOUTS",xt[xt.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",xt[xt.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",xt[xt.DRAPED_WATER=19]="DRAPED_WATER",xt[xt.VIEWSHED=20]="VIEWSHED",xt[xt.VOXEL=21]="VOXEL",xt[xt.MAX_SLOTS=22]="MAX_SLOTS";var Tt=r(76412),bt=r(57005);const yt=new class{constructor(e=0){this.offset=e,this.sphere=(0,Tt.c)(),this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const o=this.objectTransform.transform,i=(0,d.s)(At,e,t,r),n=(0,d.h)(i,i,o),a=this.offset/(0,d.l)(n);(0,d.r)(n,n,n,a);const s=this.objectTransform.inverse;return(0,d.h)(this.tmpVertex,n,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,d.l)(e);(0,d.r)(e,e,e,r);const o=this.offset/(0,d.l)(t);(0,d.r)(t,t,t,o)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,d.l)((0,Tt.g)(e)),r=this.offset/t;return(0,d.r)((0,Tt.g)(this.sphere),(0,Tt.g)(e),(0,Tt.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,u.vt)(),this._tmpMbs=(0,Tt.c)(),this._tmpObb=new bt.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,d.l)(e)}applyToVertex(e,t,r){const o=(0,d.s)(At,e,t,r),i=(0,d.s)(Et,e,t,r+this.componentLocalOriginLength),n=this._totalOffset/(0,d.l)(i);return(0,d.r)(this._tmpVertex,o,i,n),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],o=e[1],i=e[2]+t,n=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(o),d=Math.abs(i),u=Math.abs(n),h=Math.abs(a),m=Math.abs(s),f=.5*(1+Math.sign(r*n))*Math.min(l,u),p=.5*(1+Math.sign(o*a))*Math.min(c,h),v=.5*(1+Math.sign(i*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),T=Math.sqrt(f*f+p*p+v*v),b=Math.sign(l+r),y=Math.sign(c+o),A=Math.sign(d+i),E=Math.sign(u+n),S=Math.sign(h+a),M=Math.sign(m+s),w=this._totalOffset;if(T<w)return e[0]-=(1-b)*w,e[1]-=(1-y)*w,e[2]-=(1-A)*w,e[3]+=E*w,e[4]+=S*w,e[5]+=M*w,e;const C=w/Math.sqrt(g*g+_*_+x*x),O=w/T,R=O-C,I=-R;return e[0]+=r*(b*I+O),e[1]+=o*(y*I+O),e[2]+=i*(A*I+O),e[3]+=n*(E*R+C),e[4]+=a*(S*R+C),e[5]+=s*(M*R+C),e}applyToMbs(e){const t=(0,d.l)((0,Tt.g)(e)),r=this._totalOffset/t;return(0,d.r)((0,Tt.g)(this._tmpMbs),(0,Tt.g)(e),(0,Tt.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,bt.gm)(e,this._totalOffset,this._totalOffset,Fe.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const o=(0,d.s)(At,e,t,r),i=(0,d.g)(Et,o,this.localOrigin),n=this.offset/(0,d.l)(i);return(0,d.r)(this.tmpVertex,o,i,n),this.tmpVertex}applyToAabb(e){const t=St,r=Mt,o=wt;for(let i=0;i<3;++i)t[i]=e[0+i]+this.localOrigin[i],r[i]=e[3+i]+this.localOrigin[i],o[i]=t[i];const i=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=i[t],e[t+3]=i[t];const n=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let i=0;i<3;++i)o[i]=e&1<<i?r[i]:t[i];n(o)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(!(a&e)){for(let i=0;i<3;++i)o[i]=a&1<<i?0:e&1<<i?t[i]:r[i];n(o)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const At=(0,u.vt)(),Et=(0,u.vt)(),St=(0,u.vt)(),Mt=(0,u.vt)(),wt=(0,u.vt)();function Ct(e,t,r){const{data:o,indices:i}=e,n=t.typedBuffer,a=t.typedBufferStride,s=i.length;r*=a;for(let e=0;e<s;++e){const t=2*i[e];n[r]=o[t],n[r+1]=o[t+1],r+=a}}function Ot(e,t,r,o){const{data:i,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,null==o||1===o)for(let e=0;e<l;++e){const t=3*n[e];a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*n[e];for(let e=0;e<o;++e)a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],r+=s}}function Rt(e,t,r,o=1){const{data:i,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===o)for(let e=0;e<l;++e){const t=4*n[e];a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],a[r+3]=i[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*n[e];for(let e=0;e<o;++e)a[r]=i[t],a[r+1]=i[t+1],a[r+2]=i[t+2],a[r+3]=i[t+3],r+=s}}function It(e,t,r,o,i=1){const n=t.typedBuffer,a=t.typedBufferStride;if(o*=a,1===i)for(let t=0;t<r;++t)n[o]=e[0],n[o+1]=e[1],n[o+2]=e[2],n[o+3]=e[3],o+=a;else for(let t=0;t<r;++t)for(let t=0;t<i;++t)n[o]=e[0],n[o+1]=e[1],n[o+2]=e[2],n[o+3]=e[3],o+=a}function Nt(e,t,r,o,i,n){switch(e){case ie.r.POSITION:{(0,U.vA)(3===t.size);const o=i.getField(e,f.xs);(0,U.vA)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,o,i=1){if(!t)return void Ot(e,r,o,i);const{data:n,indices:a}=e,l=r.typedBuffer,c=r.typedBufferStride,d=a.length,u=t[0],h=t[1],m=t[2],f=t[4],p=t[5],v=t[6],g=t[8],_=t[9],x=t[10],T=t[12],b=t[13],y=t[14];o*=c;let A=0,E=0,S=0;const M=(0,s.tZ)(t)?e=>{A=n[e]+T,E=n[e+1]+b,S=n[e+2]+y}:e=>{const t=n[e],r=n[e+1],o=n[e+2];A=u*t+f*r+g*o+T,E=h*t+p*r+_*o+b,S=m*t+v*r+x*o+y};if(1===i)for(let e=0;e<d;++e)M(3*a[e]),l[o]=A,l[o+1]=E,l[o+2]=S,o+=c;else for(let e=0;e<d;++e){M(3*a[e]);for(let e=0;e<i;++e)l[o]=A,l[o+1]=E,l[o+2]=S,o+=c}}(t,r,o,n);break}case ie.r.NORMAL:{(0,U.vA)(3===t.size);const r=i.getField(e,f.xs);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,o,i=1){if(!t)return void Ot(e,r,o,i);const{data:n,indices:a}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=a.length,h=l[0],m=l[1],f=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),y=1e-6,A=1-y;o*=d;let E=0,S=0,M=0;const w=(0,s.tZ)(l)?e=>{E=n[e],S=n[e+1],M=n[e+2]}:e=>{const t=n[e],r=n[e+1],o=n[e+2];E=h*t+p*r+_*o,S=m*t+v*r+x*o,M=f*t+g*r+T*o};if(1===i)if(b)for(let e=0;e<u;++e){w(3*a[e]);const t=E*E+S*S+M*M;if(t<A&&t>y){const e=1/Math.sqrt(t);c[o]=E*e,c[o+1]=S*e,c[o+2]=M*e}else c[o]=E,c[o+1]=S,c[o+2]=M;o+=d}else for(let e=0;e<u;++e)w(3*a[e]),c[o]=E,c[o+1]=S,c[o+2]=M,o+=d;else for(let e=0;e<u;++e){if(w(3*a[e]),b){const e=E*E+S*S+M*M;if(e<A&&e>y){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}for(let e=0;e<i;++e)c[o]=E,c[o+1]=S,c[o+2]=M,o+=d}}(t,o,r,n);break}case ie.r.NORMALCOMPRESSED:{(0,U.vA)(2===t.size);const r=i.getField(e,f.mJ);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Ct(t,r,n);break}case ie.r.UV0:{(0,U.vA)(2===t.size);const r=i.getField(e,f.gH);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Ct(t,r,n);break}case ie.r.COLOR:case ie.r.SYMBOLCOLOR:{const r=i.getField(e,f.XP);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,o,i=1){const{data:n,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(o*=l,t!==n.length||4!==t)if(1!==i)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<i;++e)s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=255,o+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<i;++e)s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=n[t+3],o+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=n[t+3],o+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[o]=n[t],s[o+1]=n[t+1],s[o+2]=n[t+2],s[o+3]=255,o+=l}}else{s[o]=n[0],s[o+1]=n[1],s[o+2]=n[2],s[o+3]=n[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[o/=4];o+=t;const d=c*i;for(let r=1;r<d;++r)e[o]=a,o+=t}}(t,t.size,r,n);break}case ie.r.COLORFEATUREATTRIBUTE:{const r=i.getField(e,f.Y$);(0,U.vA)(!!r,`No buffer view for ${e}`),(0,U.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:o,indices:i}=e,n=t.typedBuffer,a=t.typedBufferStride,s=i.length,l=o[0];r*=a;for(let e=0;e<s;++e)n[r]=l,r+=a}(t,r,n);break}case ie.r.TANGENT:{(0,U.vA)(4===t.size);const o=i.getField(e,f.Eq);(0,U.vA)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,o,i=1){if(!t)return void Rt(e,r,o,i);const{data:n,indices:a}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=a.length,h=l[0],m=l[1],f=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),y=1e-6,A=1-y;if(o*=d,1===i)for(let e=0;e<u;++e){const t=4*a[e],r=n[t],i=n[t+1],s=n[t+2],l=n[t+3];let u=h*r+p*i+_*s,E=m*r+v*i+x*s,S=f*r+g*i+T*s;if(b){const e=u*u+E*E+S*S;if(e<A&&e>y){const t=1/Math.sqrt(e);u*=t,E*=t,S*=t}}c[o]=u,c[o+1]=E,c[o+2]=S,c[o+3]=l,o+=d}else for(let e=0;e<u;++e){const t=4*a[e],r=n[t],s=n[t+1],l=n[t+2],u=n[t+3];let E=h*r+p*s+_*l,S=m*r+v*s+x*l,M=f*r+g*s+T*l;if(b){const e=E*E+S*S+M*M;if(e<A&&e>y){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}for(let e=0;e<i;++e)c[o]=E,c[o+1]=S,c[o+2]=M,c[o+3]=u,o+=d}}(t,r,o,n);break}case ie.r.PROFILERIGHT:case ie.r.PROFILEUP:case ie.r.PROFILEVERTEXANDNORMAL:case ie.r.FEATUREVALUE:{(0,U.vA)(4===t.size);const r=i.getField(e,f.Eq);(0,U.vA)(!!r,`No buffer view for ${e}`),r&&Rt(t,r,n)}}}class Pt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(ie.r.POSITION).indices.length}write(e,t,r,o,i){!function(e,t,r,o,i,n){for(const a of t.fields.keys()){const t=e.attributes.get(a),s=t?.indices;if(t&&s)Nt(a,t,r,o,i,n);else if(a===ie.r.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(ie.r.POSITION)?.indices;if(t){const r=t.length,o=i.getField(a,f.XP);It(e.objectAndLayerIdColor,o,r,n)}}}}(r,this.vertexBufferLayout,e,t,o,i)}}var Lt=r(13752),Ht=r(91829),Dt=r(53466),Bt=r(72824),Ft=r(97220),zt=r(84867),Vt=r(39341),Gt=r(34886);pe.MT.LESS,pe.MT.ALWAYS;const Ut={mask:255},Wt={function:{func:pe.MT.ALWAYS,ref:F.dd.OutlineVisualElementMask,mask:F.dd.OutlineVisualElementMask},operation:{fail:pe.eA.KEEP,zFail:pe.eA.KEEP,zPass:pe.eA.ZERO}},jt={function:{func:pe.MT.ALWAYS,ref:F.dd.OutlineVisualElementMask,mask:F.dd.OutlineVisualElementMask},operation:{fail:pe.eA.KEEP,zFail:pe.eA.KEEP,zPass:pe.eA.REPLACE}};pe.MT.EQUAL,F.dd.OutlineVisualElementMask,F.dd.OutlineVisualElementMask,pe.eA.KEEP,pe.eA.KEEP,pe.eA.KEEP,pe.MT.NOTEQUAL,F.dd.OutlineVisualElementMask,F.dd.OutlineVisualElementMask,pe.eA.KEEP,pe.eA.KEEP,pe.eA.KEEP;const qt=[1,1,.5],kt=[0,.6,.2],$t=[0,1,.2];var Yt=r(28491);class Xt extends Bt.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,u.ci)(qt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=F.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,u.fA)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Ge.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,u.fA)(.2,.2,.2),this.diffuse=(0,u.fA)(.8,.8,.8),this.externalColor=(0,Ht.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,u.vt)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=F.it.Less,this.textureAlphaMode=F.sf.Blend,this.textureAlphaCutoff=je.Q,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=ke.m$.Occlude,this.isDecoration=!1}}Bt.gy;class Zt extends zt.w{initializeConfiguration(e,t){t.spherical=e.viewingMode===Fe.RT.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?Dt.q.Default:Dt.q.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Zt.shader)}_initializeProgram(e,t){return new Gt.B(e.rctx,t.get().build(this.configuration),Vt.D)}_makePipeline(e,t){const r=this.configuration,o=e===$e.y.NONE,i=e===$e.y.FrontFace;return(0,Ye.Ey)({blending:r.output===Ve.V.Color&&r.transparent?Je(e):null,culling:Kt(r)?(0,Ye.Xt)(r.cullFace):null,depthTest:{func:Qe(e,Jt(r.customDepthTest))},depthWrite:(o||i)&&r.writeDepth?Ye.kn:null,drawBuffers:r.output===Ve.V.Depth?{buffers:[pe.Hr.NONE]}:et(e),colorWrite:Ye.wE,stencilWrite:r.hasOccludees?Ut:null,stencilTest:r.hasOccludees?t?jt:Wt:null,polygonOffset:o||i?null:(n=r.enableOffset,n?Ke:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Jt(e){return e===F.it.Lequal?pe.MT.LEQUAL:pe.MT.LESS}function Kt(e){return e.cullFace!==F.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Zt.shader=new Ft.$(Yt.D,(()=>r.e(5141).then(r.bind(r,5141))));var Qt=r(90237),er=r(99769),tr=r(82991),rr=r(46263);class or extends tr.nW{}(0,Qt._)([(0,er.W)({constValue:!0})],or.prototype,"hasSliceHighlight",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],or.prototype,"hasSliceInVertexProgram",void 0),(0,Qt._)([(0,er.W)({constValue:rr.c.Pass})],or.prototype,"pbrTextureBindType",void 0);class ir extends or{constructor(){super(...arguments),this.output=Ve.V.Color,this.alphaDiscardMode=F.sf.Opaque,this.doubleSidedMode=Ue.W.None,this.pbrMode=We.A9.Disabled,this.cullFace=F.s2.None,this.transparencyPassType=$e.y.NONE,this.normalType=Ge.W.Attribute,this.textureCoordinateType=Dt.q.None,this.customDepthTest=F.it.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,Qt._)([(0,er.W)({count:Ve.V.COUNT})],ir.prototype,"output",void 0),(0,Qt._)([(0,er.W)({count:F.sf.COUNT})],ir.prototype,"alphaDiscardMode",void 0),(0,Qt._)([(0,er.W)({count:Ue.W.COUNT})],ir.prototype,"doubleSidedMode",void 0),(0,Qt._)([(0,er.W)({count:We.A9.COUNT})],ir.prototype,"pbrMode",void 0),(0,Qt._)([(0,er.W)({count:F.s2.COUNT})],ir.prototype,"cullFace",void 0),(0,Qt._)([(0,er.W)({count:$e.y.COUNT})],ir.prototype,"transparencyPassType",void 0),(0,Qt._)([(0,er.W)({count:Ge.W.COUNT})],ir.prototype,"normalType",void 0),(0,Qt._)([(0,er.W)({count:Dt.q.COUNT})],ir.prototype,"textureCoordinateType",void 0),(0,Qt._)([(0,er.W)({count:F.it.COUNT})],ir.prototype,"customDepthTest",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"spherical",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasVertexColors",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasSymbolColors",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasVerticalOffset",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasSlicePlane",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasSliceHighlight",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasColorTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasMetallicRoughnessTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasEmissionTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasOcclusionTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasNormalTexture",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasScreenSizePerspective",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasVertexTangents",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasOccludees",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"multipassEnabled",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasModelTransformation",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"offsetBackfaces",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"vvSize",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"vvColor",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"receiveShadows",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"receiveAmbientOcclusion",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"textureAlphaPremultiplied",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"instanced",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"instancedColor",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"instancedDoublePrecision",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"writeDepth",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"transparent",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"enableOffset",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"cullAboveGround",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"snowCover",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasColorTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasEmissionTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasNormalTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasOcclusionTextureTransform",void 0),(0,Qt._)([(0,er.W)()],ir.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Qt._)([(0,er.W)({constValue:!0})],ir.prototype,"discardTransparentFragments",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],ir.prototype,"occlusionPass",void 0),(0,Qt._)([(0,er.W)({constValue:!0})],ir.prototype,"hasVvInstancing",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],ir.prototype,"useCustomDTRExponentForWater",void 0),(0,Qt._)([(0,er.W)({constValue:!1})],ir.prototype,"supportsTextureAtlas",void 0),(0,Qt._)([(0,er.W)({constValue:!0})],ir.prototype,"useFillLights",void 0);var nr=r(57323);class ar extends Zt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Ge.W.Attribute,t.doubleSidedMode=Ue.W.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,ar.shader)}}ar.shader=new Ft.$(nr.R,(()=>r.e(9933).then(r.bind(r,39933))));class sr extends ke.im{constructor(e){super(e,cr),this._configuration=new ir,this.supportsEdges=!0,this.produces=new Map([[_t.OPAQUE_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&!this.parameters.transparent],[_t.TRANSPARENT_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[_t.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,Ve.XY)(e)||(0,Ve.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,ze.BP)().vec3f(ie.r.POSITION);return e.normalType===Ge.W.Compressed?t.vec2i16(ie.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(ie.r.NORMAL),e.hasVertexTangents&&t.vec4f(ie.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(ie.r.UV0),e.hasVertexColors&&t.vec4u8(ie.r.COLOR),e.hasSymbolColors&&t.vec4u8(ie.r.SYMBOLCOLOR),(0,ae.A)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(ie.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Ve.V.Shadow&&e!==Ve.V.ShadowExcludeHighlight&&e!==Ve.V.ShadowHighlight||this.parameters.castShadows}get visible(){const e=this.parameters;if(e.layerOpacity<je.Q)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:o,vvColor:i}=e,n=t||i||o,a="replace"===e.colorMixMode,s=e.opacity>=je.Q;if(r&&n)return a||s;const l=e.externalColor&&e.externalColor[3]>=je.Q;return r?a?l:s:n?a||s:a?l:s}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?F.s2.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e===Ve.V.Color&&(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ue.W.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ue.W.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ue.W.WindingOrder:Ue.W.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?We.A9.Schematic:We.A9.Normal:We.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,o,i,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,d.s)(pr,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case Fe.RT.Global:n=(0,d.n)(mr,pr);break;case Fe.RT.Local:n=(0,d.c)(mr,hr)}let a=0;const s=(0,d.f)(vr,pr,e.eye),l=(0,d.l)(s),c=(0,d.j)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,d.m)(n,c)),a+=(0,Lt.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,d.j)(n,n,a),(0,d.t)(fr,n,r.transform.inverseRotation),o=(0,d.f)(dr,o,fr),i=(0,d.f)(ur,i,fr)}var a;ot(e,r,o,i,null!=(a=r.verticalOffset)?(yt.offset=a,yt):null,n)}createGLMaterial(e){return new lr(e)}createBufferWriter(){return new Pt(this._vertexBufferLayout)}}class lr extends qe.m{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===Ve.V.Color&&(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,d.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?ar:Zt,e)}}class cr extends Xt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}}const dr=(0,u.vt)(),ur=(0,u.vt)(),hr=(0,u.fA)(0,0,1),mr=(0,u.vt)(),fr=(0,u.vt)(),pr=(0,u.vt)(),vr=(0,u.vt)(),gr=()=>I.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function _r(e){throw new R.A("",`Request for object resource failed: ${e}`)}function xr(e){const t=e.params,r=t.topology;let o=!0;switch(t.vertexAttributes||(gr().warn("Geometry must specify vertex attributes"),o=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(gr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),o=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(gr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),o=!1)):(gr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),o=!1)}}else gr().warn("Indexed geometries must specify faces"),o=!1;break}default:gr().warn(`Unsupported topology '${r}'`),o=!1}e.params.material||(gr().warn("Geometry requires material"),o=!1);const i=e.params.vertexAttributes;for(const e in i)i[e].values||(gr().warn("Geometries with externally defined attributes are not yet supported"),o=!1);return o}function Tr(e){const t=(0,h.Ie)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,h.iT)(t,r.bbMin),(0,h.iT)(t,r.bbMax))})),t}function br(e){switch(e){case"mask":return F.sf.Mask;case"maskAndTransparency":return F.sf.MaskBlend;case"none":return F.sf.Opaque;default:return F.sf.Blend}}function yr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Ar=new L.R(1,2,"wosr");var Er=r(61765);async function Sr(e,t){const a=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,o.EM)(e));if("wosr"===a.fileType){const e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const o=await(0,C.Ke)(t.request(e,"json",r));if(!0===o.ok)return o.value;(0,P.QP)(o.error),_r(o.error.details.url)}(e,r,t);const o=await(0,C.Ke)((0,w.A)(e,t));if(!0===o.ok)return o.value.data;(0,P.QP)(o.error),_r(o.error)}(e,t),o=await async function(e,t){const r=new Array;for(const o in e){const i=e[o],n=i.images[0].data;if(!n){gr().warn("Externally referenced texture data is not yet supported");continue}const a=i.encoding+";base64,"+n,s="/textureDefinitions/"+o,l="rgba"===i.channels?i.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:pe.pF.REPEAT,t:pe.pF.REPEAT},preMultiplyAlpha:br(l)!==F.sf.Opaque},d=t?.disableTextures?Promise.resolve(null):D(a,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const o=await Promise.all(r),i={};for(const e of o)i[e.refId]=e;return i}(r.textureDefinitions??{},t);let i=0;for(const e in o)if(o.hasOwnProperty(e)){const t=o[e];i+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:o,size:i+(0,O.iL)(r)}}(a.url,t)),{engineResources:r,referenceBoundingBox:o}=function(e,t){const r=new Array,o=new Array,i=new Array,n=new N,a=e.resource,s=L.R.parse(a.version||"1.0","wosr");Ar.validate(s);const l=a.model.name,c=a.model.geometries,d=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<c.length;e++){const a=c[e];if(!xr(a))continue;const s=yr(a),l=a.params.vertexAttributes,p=[],v=e=>{if("PerAttributeArray"===a.params.topology)return null;const t=a.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l[ie.r.POSITION],_=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,o=v(e)??(0,H.tM)(_);p.push([e,new B.n(r,o,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!f.has(x)){const{image:e,parameters:t}=T,r=new He(e,t);o.push(r),f.set(x,r)}const b=f.get(x),y=b?b.id:void 0,A=s.material;let E=n.get(A,x);if(null==E){const e=d[A.substring(A.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,o=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,i=T?br(T.alphaChannelUsage):void 0,a={ambient:(0,u.ci)(e.diffuse),diffuse:(0,u.ci)(e.diffuse),opacity:1-(e.transparency||0),transparent:o,textureAlphaMode:i,textureAlphaCutoff:.33,textureId:y,initTextureTransparent:!0,doubleSided:!0,cullFace:F.s2.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(a,t.materialParameters),E=new sr(a),n.set(A,x,E)}i.push(E);const S=new ne(E,p);m+=p.find((e=>e[0]===ie.r.POSITION))?.[1]?.indices.length??0,r.push(S)}return{engineResources:[{name:l,stageResources:{textures:o,materials:i,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Tr(r)}}(e,t);return{lods:r,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}let A;if(t.cache)A=await t.cache.loadGLTF(a.url,t,!!t.usePBR);else{const{loadGLTF:e}=await r.e(4399).then(r.bind(r,4399));A=await e(new T.R(t.streamDataRequester),a.url,t,t.usePBR)}const S=A.model.meta?.ESRI_proxyEllipsoid,R=A.meta.isEsriSymbolResource&&null!=S&&"EsriRealisticTreesStyle"===A.meta.ESRI_webstyle;R&&!A.customMeta.esriTreeRendering&&(A.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const i of o.parts){const o=i.attributes.normal;if(null==o)return;const n=i.attributes.position,a=n.count,c=(0,u.vt)(),h=(0,u.vt)(),m=(0,u.vt)(),p=new Uint8Array(4*a),v=new Float64Array(3*a),g=(0,s.B8)((0,l.vt)(),i.transform);let _=0,x=0;for(let s=0;s<a;s++){n.getVec(s,h),o.getVec(s,c),(0,d.h)(h,h,i.transform),(0,d.f)(m,h,t.center),(0,d.D)(m,m,t.radius);const a=m[2],l=(0,d.l)(m),u=Math.min(.45+.55*l*l,1);(0,d.D)(m,m,t.radius),null!==g&&(0,d.h)(m,m,g),(0,d.n)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.o)(m,m,c,a>-1?.2:Math.min(-4*a-3.8,1)),v[_]=m[0],v[_+1]=m[1],v[_+2]=m[2],_+=3,p[x]=255*u,p[x+1]=255*u,p[x+2]=255*u,p[x+3]=255,x+=4}i.attributes.normal=new f.xs(v),i.attributes.color=new f.XP(p)}}}(A,S));const I=!!t.usePBR,z=A.meta.isEsriSymbolResource?{usePBR:I,isSchematic:!1,treeRendering:R,mrrFactors:[...$t]}:{usePBR:I,isSchematic:!1,treeRendering:!1,mrrFactors:[...qt]},V={...t.materialParameters,treeRendering:R},{engineResources:G,referenceBoundingBox:U}=function(e,t,r,o){const a=e.model,s=new Array,l=new Map,T=new Map,A=a.lods.length,S=(0,h.Ie)();return a.lods.forEach(((e,w)=>{const C=!0===o.skipHighLods&&(A>1&&0===w||A>3&&1===w)||!1===o.skipHighLods&&null!=o.singleLodIndex&&w!==o.singleLodIndex;if(C&&0!==w)return;const O=new M(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const o=C?new sr({}):function(e,t,r,o,i,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),l=e.materials.get(t.material),h=null!=t.attributes.texCoord0,m=null!=t.attributes.normal;if(null==l)return null;const f=function(e){switch(e){case"BLEND":return F.sf.Blend;case"MASK":return F.sf.Mask;case"OPAQUE":case null:case void 0:return F.sf.Opaque}}(l.alphaMode);if(!n.has(s)){if(h){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const o=e.textures.get(t);if(null!=o){const e=o.data;a.set(t,new He((0,y.x3)(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!(0,y.x3)(e)&&r,encoding:(0,y.x3)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,f!==F.sf.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/Er.T),p=l.color[1]**(1/Er.T),v=l.color[2]**(1/Er.T),g=l.emissiveFactor[0]**(1/Er.T),_=l.emissiveFactor[1]**(1/Er.T),x=l.emissiveFactor[2]**(1/Er.T),T=null!=l.textureColor&&h?a.get(l.textureColor):null,b=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:i,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==i&&(null==n||(0,d.e)(n,u.uY))&&null==a&&(null==o||1===o)&&(null==r||1===r)}({normalTexture:l.textureNormal,metallicRoughnessTexture:l.textureMetallicRoughness,metallicFactor:l.metallicFactor,roughnessFactor:l.roughnessFactor,emissiveTexture:l.textureEmissive,emissiveFactor:l.emissiveFactor,occlusionTexture:l.textureOcclusion}),A=null!=l.normalTextureTransform?.scale?l.normalTextureTransform?.scale:c.Un;n.set(s,new sr({...o,transparent:f===F.sf.Blend,customDepthTest:F.it.Lequal,textureAlphaMode:f,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,p,v],ambient:[r,p,v],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?F.s2.None:F.s2.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?Ge.W.Attribute:Ge.W.ScreenDerivative,castShadows:!0,receiveShadows:l.receiveShadows,receiveAmbientOcclusion:l.receiveAmbientOcclustion,textureId:null!=T?T.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&h?a.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&h?a.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&h?a.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&h?a.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[g,_,x],mrrFactors:b?[...kt]:[l.metallicFactor,l.roughnessFactor,o.mrrFactors[2]],isSchematic:b,colorTextureTransformMatrix:E(l.colorTextureTransform),normalTextureTransformMatrix:E(l.normalTextureTransform),scale:[A[0],A[1]],occlusionTextureTransformMatrix:E(l.occlusionTextureTransform),emissiveTextureTransformMatrix:E(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:E(l.metallicRoughnessTextureTransform),...i}))}const p=n.get(s);if(r.stageResources.materials.push(p),h){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(l.textureColor),e(l.textureNormal),e(l.textureOcclusion),e(l.textureEmissive),e(l.textureMetallicRoughness)}return p}(a,e,O,t,r,l,T),{geometry:s,vertexCount:A}=function(e,t){const r=e.attributes.position.count,o=(0,b.x)(e.indices||r,e.primitiveType),a=(0,m.oe)(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,p.a)(a,s,e.transform,3,l);const c=[[ie.r.POSITION,new B.n(a,o,3,!0)]];if(null!=e.attributes.normal){const t=(0,m.oe)(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.normal;(0,n.Ge)(Mr,e.transform),(0,p.t)(t,a,Mr,3,s),(0,i.or)(Mr)&&(0,p.n)(t,t),c.push([ie.r.NORMAL,new B.n(t,o,3,!0)])}if(null!=e.attributes.tangent){const t=(0,m.oe)(4*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.tangent;(0,n.z0)(Mr,e.transform),(0,v.t)(t,a,Mr,4,s),(0,i.or)(Mr)&&(0,p.n)(t,t,4),c.push([ie.r.TANGENT,new B.n(t,o,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,m.oe)(2*r),{typedBuffer:i,typedBufferStride:n}=e.attributes.texCoord0;(0,g.a)(t,i,2,n),c.push([ie.r.UV0,new B.n(t,o,2,!0)])}const d=e.attributes.color;if(null!=d){const t=new Uint8Array(4*r);4===d.elementCount?d instanceof f.Eq?(0,v.b)(t,d,255):d instanceof f.XP?(0,x.a)(t,d):d instanceof f.Uz&&(0,v.b)(t,d,1/256):(t.fill(255),d instanceof f.xs?(0,p.f)(t,d.typedBuffer,255,4,d.typedBufferStride):e.attributes.color instanceof f.eI?(0,_.c)(t,d.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof f.nS&&(0,p.f)(t,d.typedBuffer,1/256,4,d.typedBufferStride)),c.push([ie.r.COLOR,new B.n(t,o,4,!0)])}return{geometry:new ne(t,c),vertexCount:r}}(e,null!=o?o:new sr({})),M=s.boundingInfo;null!=M&&0===w&&((0,h.iT)(S,M.bbMin),(0,h.iT)(S,M.bbMax)),null!=o&&(O.stageResources.geometries.push(s),O.numberOfVertices+=A)})),C||s.push(O)})),{engineResources:s,referenceBoundingBox:S}}(A,z,V,t.skipHighLods&&null==a.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:a.specifiedLodIndex});return{lods:G,referenceBoundingBox:U,isEsriSymbolResource:A.meta.isEsriSymbolResource,isWosr:!1}}const Mr=(0,a.vt)()},66104:(e,t,r)=>{var o,i;r.d(t,{k5:()=>o}),r(34727),(i=o||(o={}))[i.Multiply=1]="Multiply",i[i.Ignore=2]="Ignore",i[i.Replace=3]="Replace",i[i.Tint=4]="Tint"},42583:(e,t,r)=>{r.d(t,{A:()=>n});var o=r(66104),i=r(2597);function n(e){e.vertex.code.add(i.H`
260
260
  vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
261
261
  float symbolAlpha = 0.0;
262
262
 
@@ -502,7 +502,7 @@ return depth + SLOPE_SCALE * m + BIAS;
502
502
  }
503
503
  void outputDepth(float _linearDepth) {
504
504
  fragColor = floatToRgba4(_calculateFragDepth(_linearDepth));
505
- }`)}}var p=r(76662),v=r(986),g=r(52919),_=r(20693),x=r(63761),T=r(89192);function b(e,t){const{vertex:r,fragment:c}=e,m=t.hasColorTexture&&t.alphaDiscardMode!==T.sf.Opaque;switch(t.output){case i.V.Depth:(0,_.NB)(r,t),e.include(a.d,t),e.include(n.HQ,t),e.include(u.U,t),m&&c.uniforms.add(new x.N("tex",(e=>e.texture))),r.code.add(l.H`void main(void) {
505
+ }`)}}var p=r(76662),v=r(986),g=r(11955),_=r(20693),x=r(63761),T=r(89192);function b(e,t){const{vertex:r,fragment:c}=e,m=t.hasColorTexture&&t.alphaDiscardMode!==T.sf.Opaque;switch(t.output){case i.V.Depth:(0,_.NB)(r,t),e.include(a.d,t),e.include(n.HQ,t),e.include(u.U,t),m&&c.uniforms.add(new x.N("tex",(e=>e.texture))),r.code.add(l.H`void main(void) {
506
506
  vpos = getVertexInLocalOriginSpace();
507
507
  vpos = subtractOrigin(vpos);
508
508
  vpos = addVerticalOffset(vpos, localOrigin);
@@ -626,14 +626,14 @@ vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),t.hasNormal
626
626
  normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
627
627
  0.0, 0.0, 0.0 );
628
628
  rawNormal.xy = (normalTextureRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(c.H`return tangentSpace * rawNormal;
629
- }`))}},3452:(e,t,r)=>{r.d(t,{n:()=>G});var o,i,n,a=r(2597),s=r(63761),l=r(90237),c=r(34727),d=r(97768),u=r(36708),h=r(78659),m=r(10107),f=(r(44208),r(53966),r(87811),r(40608)),p=r(37585);(n=o||(o={}))[n.RED=0]="RED",n[n.RG=1]="RG",n[n.RGBA4=2]="RGBA4",n[n.RGBA=3]="RGBA",n[n.RGBA_MIPMAP=4]="RGBA_MIPMAP",n[n.R16F=5]="R16F",n[n.RGBA16F=6]="RGBA16F",function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH16_BUFFER=1]="DEPTH16_BUFFER"}(i||(i={}));var v=r(69622),g=r(49186),_=r(89192);let x=class extends v.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._context=null,this._dirty=!0}initialize(){this.addHandles([(0,u.wB)((()=>this.view.ready),(e=>{e&&this.view._stage?.renderer.addRenderNode(this)}),u.Vh)])}destroy(){this.view._stage?.renderer?.removeRenderNode(this)}render(){throw new g.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}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view._stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===_.C7.UPDATE&&this.view._stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view._stage.renderer.fboCache}get bindParameters(){return this._context.bindParameters}get renderingContext(){return this.view._stage.renderView.renderingContext}updateAnimation(){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e,t){this._context=t,this._frameBuffer=e.find((({name:e})=>e===this.produces));try{return this.render(e)}finally{this._frameBuffer=null}}};(0,l._)([(0,m.MZ)({constructOnly:!0})],x.prototype,"view",void 0),(0,l._)([(0,m.MZ)({constructOnly:!0})],x.prototype,"consumes",void 0),(0,l._)([(0,m.MZ)()],x.prototype,"produces",void 0),x=(0,l._)([(0,f.$)("esri.views.3d.webgl.RenderNode")],x);const T=x;var b=r(97220),y=r(84867),A=r(39341),E=r(34886),M=r(95774),S=r(90644);class w extends y.w{initializeProgram(e){return new E.B(e.rctx,w.shader.get().build(),A.D)}initializePipeline(){return(0,S.Ey)({colorWrite:S.wE})}}w.shader=new b.$(M.S,(()=>r.e(9384).then(r.bind(r,59384))));var C=r(48163);class O extends a.Y{constructor(){super(...arguments),this.projScale=1}}class R extends O{constructor(){super(...arguments),this.intensity=1}}class I extends a.Y{}class N extends I{constructor(){super(...arguments),this.blurSize=(0,C.vt)()}}var P=r(15581);class L extends y.w{initializeProgram(e){return new E.B(e.rctx,L.shader.get().build(),A.D)}initializePipeline(){return(0,S.Ey)({colorWrite:S.wE})}}L.shader=new b.$(P.S,(()=>r.e(191).then(r.bind(r,90191))));var H=r(63907),D=r(21231),B=r(67171);const F=2;let z=class extends T{constructor(e){super(e),this.consumes={required:["normals"]},this.produces="ssao",this.isEnabled=()=>!1,this._enableTime=(0,h.l5)(0),this._passParameters=new R,this._drawParameters=new N}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new B.R;t.wrapMode=H.pF.CLAMP_TO_EDGE,t.pixelFormat=H.Ab.RGB,t.wrapMode=H.pF.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new D.g(this.renderingContext,t,e),this._ssaoTechnique=this.techniques.acquire(L),this._blurTechnique=this.techniques.acquire(w),this.addHandles((0,u.wB)((()=>this.isEnabled()),(()=>this._enableTime=(0,h.l5)(0))))}destroy(){this._passParameters.noiseTexture=(0,d.WD)(this._passParameters.noiseTexture),this._blurTechnique.release(),this._ssaoTechnique.release()}render(e){const t=this.bindParameters,r=e.find((({name:e})=>"normals"===e)),i=r?.getTexture(),n=r?.getTexture(H.nI),a=this.fboCache,s=t.camera,l=s.fullViewport[2],d=s.fullViewport[3],u=Math.round(l/F),m=Math.round(d/F);if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=(0,h.l5)(performance.now()),this.requestRender(),a.acquire(u,m,"ssao",o.RED);0===this._enableTime&&(this._enableTime=(0,h.l5)(performance.now()));const f=this.renderingContext,v=this.view.qualitySettings.fadeDuration,g=s.relativeElevation,x=(0,c.qE)((5e5-g)/2e5,0,1),T=v>0?Math.min(v,performance.now()-this._enableTime)/v:1,b=T*x;this._passParameters.normalTexture=i,this._passParameters.depthTexture=n,this._passParameters.projScale=1/s.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*V/(0,P.g)(s)**6*b;const y=a.acquire(l,d,"ssao input",o.RG);f.unbindTexture(y.fbo.colorTexture),f.bindFramebuffer(y.fbo),f.setViewport(0,0,l,d),f.bindTechnique(this._ssaoTechnique,t,this._passParameters,this._drawParameters),f.screen.draw();const A=a.acquire(u,m,"ssao blur",o.RED);f.unbindTexture(A.fbo.colorTexture),f.bindFramebuffer(A.fbo),this._drawParameters.colorTexture=y.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,0,F/d),f.bindTechnique(this._blurTechnique,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,m),f.screen.draw(),y.release();const E=a.acquire(u,m,"ssao",o.RED);return f.unbindTexture(E.fbo.colorTexture),f.bindFramebuffer(E.fbo),f.setViewport(0,0,l,d),f.setClearColor(1,1,1,0),f.clear(H.hn.COLOR_BUFFER_BIT),this._drawParameters.colorTexture=A.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,F/l,0),f.bindTechnique(this._blurTechnique,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,m),f.screen.draw(),f.setViewport4fv(s.fullViewport),A.release(),T<1&&this.requestRender(_.C7.UPDATE),E}};(0,l._)([(0,m.MZ)()],z.prototype,"consumes",void 0),(0,l._)([(0,m.MZ)()],z.prototype,"produces",void 0),(0,l._)([(0,m.MZ)({constructOnly:!0})],z.prototype,"techniques",void 0),(0,l._)([(0,m.MZ)({constructOnly:!0})],z.prototype,"isEnabled",void 0),z=(0,l._)([(0,f.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],z);const V=.5;function G(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new s.N("ssaoTex",((e,t)=>t.ssao?.getTexture()))),r.constants.add("blurSizePixelsInverse","float",1/F),r.code.add(a.H`float evaluateAmbientOcclusionInverse() {
629
+ }`))}},3452:(e,t,r)=>{r.d(t,{n:()=>G});var o,i,n,a=r(2597),s=r(63761),l=r(90237),c=r(34727),d=r(97768),u=r(36708),h=r(78659),m=r(10107),f=(r(44208),r(53966),r(87811),r(40608)),p=r(37585);(n=o||(o={}))[n.RED=0]="RED",n[n.RG=1]="RG",n[n.RGBA4=2]="RGBA4",n[n.RGBA=3]="RGBA",n[n.RGBA_MIPMAP=4]="RGBA_MIPMAP",n[n.R16F=5]="R16F",n[n.RGBA16F=6]="RGBA16F",function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH16_BUFFER=1]="DEPTH16_BUFFER"}(i||(i={}));var v=r(69622),g=r(49186),_=r(89192);let x=class extends v.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._context=null,this._dirty=!0}initialize(){this.addHandles([(0,u.wB)((()=>this.view.ready),(e=>{e&&this.view._stage?.renderer.addRenderNode(this)}),u.Vh)])}destroy(){this.view._stage?.renderer?.removeRenderNode(this)}render(){throw new g.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}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view._stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){e===_.C7.UPDATE&&this.view._stage?.renderView.requestRender(e),this._dirty=!0}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view._stage.renderer.fboCache}get bindParameters(){return this._context.bindParameters}get renderingContext(){return this.view._stage.renderView.renderingContext}updateAnimation(){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e,t){this._context=t,this._frameBuffer=e.find((({name:e})=>e===this.produces));try{return this.render(e)}finally{this._frameBuffer=null}}};(0,l._)([(0,m.MZ)({constructOnly:!0})],x.prototype,"view",void 0),(0,l._)([(0,m.MZ)({constructOnly:!0})],x.prototype,"consumes",void 0),(0,l._)([(0,m.MZ)()],x.prototype,"produces",void 0),x=(0,l._)([(0,f.$)("esri.views.3d.webgl.RenderNode")],x);const T=x;var b=r(97220),y=r(84867),A=r(39341),E=r(34886),S=r(95774),M=r(90644);class w extends y.w{initializeProgram(e){return new E.B(e.rctx,w.shader.get().build(),A.D)}initializePipeline(){return(0,M.Ey)({colorWrite:M.wE})}}w.shader=new b.$(S.S,(()=>r.e(9384).then(r.bind(r,59384))));var C=r(48163);class O extends a.Y{constructor(){super(...arguments),this.projScale=1}}class R extends O{constructor(){super(...arguments),this.intensity=1}}class I extends a.Y{}class N extends I{constructor(){super(...arguments),this.blurSize=(0,C.vt)()}}var P=r(15581);class L extends y.w{initializeProgram(e){return new E.B(e.rctx,L.shader.get().build(),A.D)}initializePipeline(){return(0,M.Ey)({colorWrite:M.wE})}}L.shader=new b.$(P.S,(()=>r.e(191).then(r.bind(r,90191))));var H=r(63907),D=r(21231),B=r(67171);const F=2;let z=class extends T{constructor(e){super(e),this.consumes={required:["normals"]},this.produces="ssao",this.isEnabled=()=>!1,this._enableTime=(0,h.l5)(0),this._passParameters=new R,this._drawParameters=new N}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new B.R;t.wrapMode=H.pF.CLAMP_TO_EDGE,t.pixelFormat=H.Ab.RGB,t.wrapMode=H.pF.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new D.g(this.renderingContext,t,e),this._ssaoTechnique=this.techniques.acquire(L),this._blurTechnique=this.techniques.acquire(w),this.addHandles((0,u.wB)((()=>this.isEnabled()),(()=>this._enableTime=(0,h.l5)(0))))}destroy(){this._passParameters.noiseTexture=(0,d.WD)(this._passParameters.noiseTexture),this._blurTechnique.release(),this._ssaoTechnique.release()}render(e){const t=this.bindParameters,r=e.find((({name:e})=>"normals"===e)),i=r?.getTexture(),n=r?.getTexture(H.nI),a=this.fboCache,s=t.camera,l=s.fullViewport[2],d=s.fullViewport[3],u=Math.round(l/F),m=Math.round(d/F);if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=(0,h.l5)(performance.now()),this.requestRender(),a.acquire(u,m,"ssao",o.RED);0===this._enableTime&&(this._enableTime=(0,h.l5)(performance.now()));const f=this.renderingContext,v=this.view.qualitySettings.fadeDuration,g=s.relativeElevation,x=(0,c.qE)((5e5-g)/2e5,0,1),T=v>0?Math.min(v,performance.now()-this._enableTime)/v:1,b=T*x;this._passParameters.normalTexture=i,this._passParameters.depthTexture=n,this._passParameters.projScale=1/s.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*V/(0,P.g)(s)**6*b;const y=a.acquire(l,d,"ssao input",o.RG);f.unbindTexture(y.fbo.colorTexture),f.bindFramebuffer(y.fbo),f.setViewport(0,0,l,d),f.bindTechnique(this._ssaoTechnique,t,this._passParameters,this._drawParameters),f.screen.draw();const A=a.acquire(u,m,"ssao blur",o.RED);f.unbindTexture(A.fbo.colorTexture),f.bindFramebuffer(A.fbo),this._drawParameters.colorTexture=y.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,0,F/d),f.bindTechnique(this._blurTechnique,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,m),f.screen.draw(),y.release();const E=a.acquire(u,m,"ssao",o.RED);return f.unbindTexture(E.fbo.colorTexture),f.bindFramebuffer(E.fbo),f.setViewport(0,0,l,d),f.setClearColor(1,1,1,0),f.clear(H.hn.COLOR_BUFFER_BIT),this._drawParameters.colorTexture=A.getTexture(),(0,p.hZ)(this._drawParameters.blurSize,F/l,0),f.bindTechnique(this._blurTechnique,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,m),f.screen.draw(),f.setViewport4fv(s.fullViewport),A.release(),T<1&&this.requestRender(_.C7.UPDATE),E}};(0,l._)([(0,m.MZ)()],z.prototype,"consumes",void 0),(0,l._)([(0,m.MZ)()],z.prototype,"produces",void 0),(0,l._)([(0,m.MZ)({constructOnly:!0})],z.prototype,"techniques",void 0),(0,l._)([(0,m.MZ)({constructOnly:!0})],z.prototype,"isEnabled",void 0),z=(0,l._)([(0,f.$)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],z);const V=.5;function G(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new s.N("ssaoTex",((e,t)=>t.ssao?.getTexture()))),r.constants.add("blurSizePixelsInverse","float",1/F),r.code.add(a.H`float evaluateAmbientOcclusionInverse() {
630
630
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
631
631
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
632
632
  }
633
633
  float evaluateAmbientOcclusion() {
634
634
  return 1.0 - evaluateAmbientOcclusionInverse();
635
635
  }`)):r.code.add(a.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
636
- float evaluateAmbientOcclusion() { return 0.0; }`)}},8881:(e,t,r)=>{r.d(t,{kA:()=>S,a8:()=>E,eU:()=>M});var o=r(21818),i=r(38954),n=r(51850),a=r(87317),s=r(91829),l=r(59469),c=r(33079),d=r(71988),u=r(2597);function h(e,t){const r=e.fragment,o=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===o?(r.uniforms.add(new c.t("lightingAmbientSH0",((e,t)=>(0,i.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
636
+ float evaluateAmbientOcclusion() { return 0.0; }`)}},8881:(e,t,r)=>{r.d(t,{kA:()=>M,a8:()=>E,eU:()=>S});var o=r(21818),i=r(38954),n=r(51850),a=r(87317),s=r(91829),l=r(59469),c=r(33079),d=r(71988),u=r(2597);function h(e,t){const r=e.fragment,o=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===o?(r.uniforms.add(new c.t("lightingAmbientSH0",((e,t)=>(0,i.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
637
637
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
638
638
  return ambientLight * (1.0 - ambientOcclusion);
639
639
  }`)):1===o?(r.uniforms.add(new d.E("lightingAmbientSH_R",((e,t)=>(0,a.s)(f,t.lighting.sh.r[0],t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3]))),new d.E("lightingAmbientSH_G",((e,t)=>(0,a.s)(f,t.lighting.sh.g[0],t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3]))),new d.E("lightingAmbientSH_B",((e,t)=>(0,a.s)(f,t.lighting.sh.b[0],t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3])))),r.code.add(u.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
@@ -679,11 +679,11 @@ vec3 calculateAmbientRadiance(float ambientOcclusion)
679
679
  {
680
680
  vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
681
681
  return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
682
- }`))}const m=(0,n.vt)(),f=(0,s.vt)();var p=r(3452),v=r(98619),g=r(22393),_=r(89786),x=r(39589),T=r(46263);class b extends x.n{constructor(e,t){super(e,"bool",T.c.Pass,((r,o,i)=>r.setUniform1b(e,t(o,i))))}}var y=r(20304);r(34727),(0,n.vt)();const A=.4;function E(e){e.constants.add("ambientBoostFactor","float",A)}function M(e){e.uniforms.add(new y.m("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function S(e,t){const r=e.fragment;switch(e.include(p.n,t),t.pbrMode!==l.A9.Disabled&&e.include(g.c,t),e.include(h,t),e.include(_.p),r.code.add(u.H`
682
+ }`))}const m=(0,n.vt)(),f=(0,s.vt)();var p=r(3452),v=r(98619),g=r(22393),_=r(89786),x=r(39589),T=r(46263);class b extends x.n{constructor(e,t){super(e,"bool",T.c.Pass,((r,o,i)=>r.setUniform1b(e,t(o,i))))}}var y=r(20304);r(34727),(0,n.vt)();const A=.4;function E(e){e.constants.add("ambientBoostFactor","float",A)}function S(e){e.uniforms.add(new y.m("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function M(e,t){const r=e.fragment;switch(e.include(p.n,t),t.pbrMode!==l.A9.Disabled&&e.include(g.c,t),e.include(h,t),e.include(_.p),r.code.add(u.H`
683
683
  const float GAMMA_SRGB = 2.1;
684
684
  const float INV_GAMMA_SRGB = 0.4761904;
685
685
  ${t.pbrMode===l.A9.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
686
- `),E(r),M(r),(0,v.Gc)(r),r.code.add(u.H`
686
+ `),E(r),S(r),(0,v.Gc)(r),r.code.add(u.H`
687
687
  float additionalDirectedAmbientLight(vec3 vPosWorld) {
688
688
  float vndl = dot(${t.spherical?u.H`normalize(vPosWorld)`:u.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
689
689
  return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
@@ -977,11 +977,7 @@ vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.c
977
977
  vec4 vvColor() {
978
978
  return vvGetColor(instanceFeatureAttribute);
979
979
  }`:"vec4 vvColor() { return vec4(1.0); }"}
980
- `)):r.code.add(l.H`vec4 vvColor() { return vec4(1.0); }`)}},35093:(e,t,r)=>{r.d(t,{Q:()=>o});const o=1/256},52919:(e,t,r)=>{r.d(t,{S:()=>c});var o=r(35093),i=r(2597);function n(e){e.fragment.code.add(i.H`
981
- #define discardOrAdjustAlpha(color) { if (color.a < ${i.H.float(o.Q)}) { discard; } }
982
- `)}var a=r(39589);r(46263),a.n;var s=r(20304),l=r(89192);function c(e,t){!function(e,t,r){const o=e.fragment;switch(t.alphaDiscardMode!==l.sf.Mask&&t.alphaDiscardMode!==l.sf.MaskBlend||o.uniforms.add(r),t.alphaDiscardMode){case l.sf.Blend:return e.include(n);case l.sf.Opaque:o.code.add(i.H`void discardOrAdjustAlpha(inout vec4 color) {
983
- color.a = 1.0;
984
- }`);break;case l.sf.Mask:o.code.add(i.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case l.sf.MaskBlend:e.fragment.code.add(i.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}(e,t,new s.m("textureAlphaCutoff",(e=>e.textureAlphaCutoff)))}},34845:(e,t,r)=>{r.d(t,{Ir:()=>d});var o=r(37585),i=r(48163),n=r(87317),a=r(91829),s=r(47286),l=r(71988),c=r(2597);function d(e){e.fragment.uniforms.add(new l.E("projInfo",((e,t)=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,n.s)(u,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,n.s)(u,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(t.camera)))),e.fragment.uniforms.add(new s.G("zScale",((e,t)=>function(e){return 0===e.projectionMatrix[11]?(0,o.hZ)(h,0,1):(0,o.hZ)(h,1,0)}(t.camera)))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
980
+ `)):r.code.add(l.H`vec4 vvColor() { return vec4(1.0); }`)}},35093:(e,t,r)=>{r.d(t,{Q:()=>o});const o=1/256},34845:(e,t,r)=>{r.d(t,{Ir:()=>d});var o=r(37585),i=r(48163),n=r(87317),a=r(91829),s=r(47286),l=r(71988),c=r(2597);function d(e){e.fragment.uniforms.add(new l.E("projInfo",((e,t)=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,n.s)(u,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,n.s)(u,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(t.camera)))),e.fragment.uniforms.add(new s.G("zScale",((e,t)=>function(e){return 0===e.projectionMatrix[11]?(0,o.hZ)(h,0,1):(0,o.hZ)(h,1,0)}(t.camera)))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
985
981
  return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
986
982
  }`)}const u=(0,a.vt)(),h=(0,i.vt)()},63365:(e,t,r)=>{r.d(t,{a:()=>i});var o=r(2597);function i(e){e.code.add(o.H`vec4 premultiplyAlpha(vec4 v) {
987
983
  return vec4(v.rgb * v.a, v.a);
@@ -1001,7 +997,11 @@ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
1001
997
  }
1002
998
  float rgb2v(vec3 c) {
1003
999
  return max(c.x, max(c.y, c.z));
1004
- }`)}},26425:(e,t,r)=>{r.d(t,{u:()=>i});var o=r(2597);function i({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(o.H`vec3 dpPlusFrc(vec3 a, vec3 b) {
1000
+ }`)}},11955:(e,t,r)=>{r.d(t,{S:()=>l});var o=r(35093),i=r(39589);r(46263),i.n;var n=r(20304),a=r(2597),s=r(89192);function l(e,t){!function(e,t,r){const i=e.fragment;switch(t.alphaDiscardMode){case s.sf.Blend:e.fragment.code.add(a.H`
1001
+ #define discardOrAdjustAlpha(color) { if (color.a < ${a.H.float(o.Q)}) { discard; } }
1002
+ `);break;case s.sf.Opaque:i.code.add(a.H`void discardOrAdjustAlpha(inout vec4 color) {
1003
+ color.a = 1.0;
1004
+ }`);break;case s.sf.Mask:i.uniforms.add(r).code.add(a.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case s.sf.MaskBlend:i.uniforms.add(r).code.add(a.H`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}(e,t,new n.m("textureAlphaCutoff",(e=>e.textureAlphaCutoff)))}},26425:(e,t,r)=>{r.d(t,{u:()=>i});var o=r(2597);function i({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(o.H`vec3 dpPlusFrc(vec3 a, vec3 b) {
1005
1005
  return mix(a, a + b, vec3(notEqual(b, vec3(0))));
1006
1006
  }
1007
1007
  vec3 dpMinusFrc(vec3 a, vec3 b) {
@@ -1077,7 +1077,7 @@ const vec4 RGBA4_2_FLOAT_FACTORS = vec4(
1077
1077
  );
1078
1078
  float rgba4ToFloat(vec4 rgba) {
1079
1079
  return dot(rgba, RGBA4_2_FLOAT_FACTORS);
1080
- }`)}},26835:(e,t,r)=>{r(2597)},20693:(e,t,r)=>{r.d(t,{yu:()=>m,NB:()=>f,S7:()=>g});var o=r(58083),i=r(9093),n=r(38954),a=r(51850),s=r(40710),l=r(33079),c=(r(20304),r(39589)),d=r(46263);class u extends c.n{constructor(e,t){super(e,"mat4",d.c.Draw,((r,o,i)=>r.setUniformMatrix4fv(e,t(o,i))))}}var h=r(40095);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new s.W("cameraPosition",((e,t)=>(0,n.s)(v,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new h.X("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,o.Tl)(p,t.camera.viewMatrix,e.origin))),new s.W("localOrigin",(e=>e.origin)));const r=e=>(0,n.s)(v,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new h.X("proj",((e,t)=>t.camera.projectionMatrix)),new h.X("view",((e,t)=>(0,o.Tl)(p,t.camera.viewMatrix,r(t)))),new l.t("localOrigin",((e,t)=>r(t))))}const p=(0,i.vt)(),v=(0,a.vt)();function g(e){e.uniforms.add(new h.X("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Draw,((r,o,i,n)=>r.setUniform2fv(e,t(o,i,n))))}}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Pass,((r,o,i)=>r.setUniform2fv(e,t(o,i))))}}},40710:(e,t,r)=>{r.d(t,{W:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec3",i.c.Draw,((r,o,i,n)=>r.setUniform3fv(e,t(o,i,n))))}}},33079:(e,t,r)=>{r.d(t,{t:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec3",i.c.Pass,((r,o,i)=>r.setUniform3fv(e,t(o,i))))}}},71988:(e,t,r)=>{r.d(t,{E:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec4",i.c.Pass,((r,o,i)=>r.setUniform4fv(e,t(o,i))))}}},20304:(e,t,r)=>{r.d(t,{m:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"float",i.c.Pass,((r,o,i)=>r.setUniform1f(e,t(o,i))))}}},93588:(e,t,r)=>{r.d(t,{c:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"int",i.c.Pass,((r,o,i)=>r.setUniform1i(e,t(o,i))))}}},98353:(e,t,r)=>{r.d(t,{h:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"mat3",i.c.Draw,((r,o,i)=>r.setUniformMatrix3fv(e,t(o,i))))}}},35644:(e,t,r)=>{r.d(t,{k:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"mat3",i.c.Pass,((r,o,i)=>r.setUniformMatrix3fv(e,t(o,i))))}}},40095:(e,t,r)=>{r.d(t,{X:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"mat4",i.c.Pass,((r,o,i)=>r.setUniformMatrix4fv(e,t(o,i))))}}},85977:(e,t,r)=>{r.d(t,{N5:()=>l});var o=r(49186),i=(r(44208),r(53966)),n=r(46263),a=r(620);class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class l extends s{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.extensions=new f,this.constants=new v,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),o=this.varyings.generateSource(e),i="vertex"===e?this.vertex:this.fragment,n=i.uniforms.generateSource(),a=i.code.generateSource(),s="vertex"===e?_:g,l=this.constants.generateSource().concat(i.constants.generateSource()),c=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${n.join("\n")}\n\n${r.join("\n")}\n\n${o.join("\n")}\n\n${c.join("\n")}\n\n${a.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),o=r.length;return(t,i)=>{for(let n=0;n<o;++n)r[n](e,t,i)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),o=r.length;return(t,i,n)=>{for(let a=0;a<o;++a)r[a](e,t,i,n)}}}class c{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new o.A(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else i.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder").error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends s{constructor(){super(...arguments),this.uniforms=new c(this),this.code=new d(this),this.constants=new v}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class m{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,a.vA)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,o)=>t.push("vertex"===e?`out ${r} ${o};`:`in ${r} ${o};`))),t}}class f{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?f.ALLOWLIST_VERTEX:f.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}f.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],f.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Map}add(e,t,r=0){const o=this._entries.get(r);o?(0,a.vA)(o.name===e&&o.type===t,`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}p.DEFAULT_TYPE="vec4",p.DEFAULT_NAME="fragColor";class v{constructor(){this._entries=new Set}add(e,t,r){let o="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":o=v._numberToFloatStr(r);break;case"int":o=v._numberToIntStr(r);break;case"bool":o=r.toString();break;case"vec2":o=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":o=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":o=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":o=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":o=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":o=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":o=`${t}(${Array.prototype.map.call(r,(e=>v._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${o};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",_="precision highp float;\nprecision highp sampler2D;"},15976:(e,t,r)=>{r.d(t,{o:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Draw,((r,o,i)=>r.bindTexture(e,t(o,i))))}}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Pass,((r,o,i)=>r.bindTexture(e,t(o,i))))}}},39589:(e,t,r)=>{r.d(t,{n:()=>i});var o=r(46263);class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={[o.c.Pass]:null,[o.c.Draw]:null},i)switch(r){case o.c.Pass:this.bind[o.c.Pass]=i;break;case o.c.Draw:this.bind[o.c.Draw]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},2597:(e,t,r)=>{r.d(t,{H:()=>i,Y:()=>o});const o=class{};function i(e,...t){let r="";for(let o=0;o<t.length;o++)r+=e[o]+t[o];return r+=e[e.length-1],r}var n;(n=i||(i={})).int=function(e){return Math.round(e).toString()},n.float=function(e){return e.toPrecision(8)}},97220:(e,t,r)=>{r.d(t,{$:()=>o});class o{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},84867:(e,t,r)=>{r.d(t,{w:()=>n});var o=r(97768),i=r(63907);class n{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}destroy(){this._program=(0,o.WD)(this._program),this._pipeline=this._configuration=null}reload(e){(0,o.WD)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return i.WR.TRIANGLES}getPipeline(e,t,r){return this._pipeline}initializeConfiguration(e,t){}}},99769:(e,t,r)=>{r.d(t,{K:()=>n,W:()=>a});var o=r(49186),i=r(2597);class n extends i.Y{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function a(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,n=e.count||2,a=Math.ceil(Math.log2(n)),s=t._parameterBits??[0];let l=0;for(;s[l]+a>16;)l++,l>=s.length&&s.push(0);t._parameterBits=s;const c=s[l],d=(1<<a)-1<<c;s[l]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(t){if(this[i]!==t)if(this[i]=t,this._keyDirty=!0,this._parameterBits[l]=this._parameterBits[l]&~d|+t<<c&d,"number"==typeof t){if(null==e.count)throw new o.A(`Configuration value for ${r} must provide a count option`)}else if("boolean"!=typeof t)throw new o.A(`Configuration value for ${r} must be boolean or number, got ${typeof t}`)}})}}}},69720:(e,t,r)=>{r.d(t,{J:()=>i});var o=r(24326);class i{constructor(){this.id=(0,o.c)()}}},96672:(e,t,r)=>{var o;r.d(t,{X:()=>o}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(o||(o={}))},39341:(e,t,r)=>{r.d(t,{D:()=>i});var o=r(46540);const i=new Map([[o.r.POSITION,0],[o.r.NORMAL,1],[o.r.NORMALCOMPRESSED,1],[o.r.UV0,2],[o.r.COLOR,3],[o.r.COLORFEATUREATTRIBUTE,3],[o.r.SIZE,4],[o.r.TANGENT,4],[o.r.CENTEROFFSETANDDISTANCE,5],[o.r.SYMBOLCOLOR,5],[o.r.FEATUREATTRIBUTE,6],[o.r.INSTANCEFEATUREATTRIBUTE,6],[o.r.INSTANCECOLOR,7],[o.r.OBJECTANDLAYERIDCOLOR,7],[o.r.INSTANCEOBJECTANDLAYERIDCOLOR,7],[o.r.INSTANCEMODEL,8],[o.r.INSTANCEMODELNORMAL,12],[o.r.INSTANCEMODELORIGINHI,11],[o.r.INSTANCEMODELORIGINLO,15]])},25634:(e,t,r)=>{r.d(t,{m:()=>l});var o=r(97768),i=r(74887),n=r(2597),a=r(89192);class s{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){this._techniques.release(this._technique)}get technique(){return this._technique}get _stippleTextures(){return this._techniques.constructionContext.stippleTextures}get _markerTextures(){return this._techniques.constructionContext.markerTextures}ensureTechnique(e,t){return this._technique=this._techniques.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return a.Am.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),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(){this._texture=(0,o.Gz)(this._texture),this._textureNormal=(0,o.Gz)(this._textureNormal),this._textureEmissive=(0,o.Gz)(this._textureEmissive),this._textureOcclusion=(0,o.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,o.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Am.LOADED:a.Am.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,o.Gz)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,i.$X)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,o.Gz)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends n.Y{constructor(e=null,t=null,r=null,o=null,i=null,n,a){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=o,this.textureMetallicRoughness=i,this.scale=n,this.normalTextureTransformMatrix=a}}},14903:(e,t,r)=>{r.d(t,{im:()=>h,m$:()=>o});var o,i,n=r(51850),a=r(2597),s=r(89192),l=r(69720),c=r(96672),d=r(39341),u=r(13752);class h extends l.J{constructor(e,t){super(),this.type=c.X.Material,this.supportsEdges=!1,this._renderPriority=0,this._vertexAttributeLocations=d.D,this._pp0=(0,n.fA)(0,0,1),this._pp1=(0,n.fA)(0,0,0),this._parameters=new t,(0,u.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,u.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.bindParameters.decorations===s.ID.ON)&&!!(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())}get vertexAttributeLocations(){return this._vertexAttributeLocations}parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}intersectDraped(e,t,r,o,i,n){return this._pp0[0]=this._pp1[0]=o[0],this._pp0[1]=this._pp1[1]=o[1],this.intersect(e,t,r,this._pp0,this._pp1,i)}}(i=o||(o={}))[i.None=0]="None",i[i.Occlude=1]="Occlude",i[i.Transparent=2]="Transparent",i[i.OccludeAndTransparent=4]="OccludeAndTransparent",i[i.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",i[i.Opaque=16]="Opaque",a.Y},34886:(e,t,r)=>{r.d(t,{B:()=>n});var o=r(3694),i=r(94656);class n{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new o.A({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=(0,i.en)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}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){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t?.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),this._fragmentUniforms?.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},14327:(e,t,r)=>{var o;r.d(t,{y:()=>o}),function(e){e[e.ColorAlpha=0]="ColorAlpha",e[e.FrontFace=1]="FrontFace",e[e.NONE=2]="NONE",e[e.COUNT=3]="COUNT"}(o||(o={}))},89192:(e,t,r)=>{var o,i,n,a,s,l,c,d,u;r.d(t,{Am:()=>a,C7:()=>n,ID:()=>d,JS:()=>u,Mg:()=>l,dd:()=>s,it:()=>i,s2:()=>o,sf:()=>c}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(o||(o={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(i||(i={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(l||(l={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(c||(c={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(d||(d={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(u||(u={}))},61765:(e,t,r)=>{r.d(t,{T:()=>o});const o=2.1},13752:(e,t,r)=>{r.d(t,{Um:()=>X,MB:()=>Y,kE:()=>$});var o=r(4576),i=r(34727),n=(r(44208),r(53966)),a=r(4341),s=r(58083),l=r(9093),c=r(38954),d=r(51850),u=r(19419),h=r(88582),m=r(11964),f=r(240),p=r(71351),v=r(44280),g=r(32114);const _=()=>n.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function x(e=B){return{plane:(0,f.vt)(e.plane),origin:(0,d.o8)(e.origin),basis1:(0,d.o8)(e.basis1),basis2:(0,d.o8)(e.basis2)}}function T(e,t=x()){return b(e.origin,e.basis1,e.basis2,t)}function b(e,t,r,o=x()){return(0,c.c)(o.origin,e),(0,c.c)(o.basis1,t),(0,c.c)(o.basis2,r),y(o),function(e,t){Math.abs((0,c.m)(e.basis1,e.basis2)/((0,c.l)(e.basis1)*(0,c.l)(e.basis2)))>1e-6&&_().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,c.m)(e.basis1,N(e)))>1e-6&&_().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,c.m)(N(e),e.origin)-e.plane[3])>1e-6&&_().warn(t,"Plane offset is not consistent with plane origin")}(o,"fromValues()"),o}function y(e){(0,f.mR)(e.basis2,e.basis1,e.origin,e.plane)}function A(e,t,r){e!==r&&T(e,r);const o=(0,c.j)(g.rq.get(),N(e),t);return(0,c.g)(r.origin,r.origin,o),r.plane[3]-=t,r}function E(e,t=x()){const r=(e[2]-e[0])/2,o=(e[3]-e[1])/2;return(0,c.s)(t.origin,e[0]+r,e[1]+o,0),(0,c.s)(t.basis1,r,0,0),(0,c.s)(t.basis2,0,o,0),(0,f.fA)(0,0,1,0,t.plane),t}function M(e,t,r){return!!(0,f.Ui)(e.plane,t,r)&&P(e,r)}function S(e,t,r){const o=F.get();D(e,t,o,F.get());let n=Number.POSITIVE_INFINITY;for(const a of U){const s=H(e,a,z.get()),l=g.rq.get();if((0,f.T7)(o,s,l)){const e=(0,c.E)(g.rq.get(),t.origin,l),o=Math.abs((0,i.XM)((0,c.m)(t.direction,e)));o<n&&(n=o,(0,c.c)(r,l))}}return n===Number.POSITIVE_INFINITY?w(e,t,r):r}function w(e,t,r){if(M(e,t,r))return r;const o=F.get(),i=F.get();D(e,t,o,i);let n=Number.POSITIVE_INFINITY;for(const a of U){const s=H(e,a,z.get()),l=g.rq.get();if((0,f.gv)(o,s,l)){const e=(0,p.kb)(t,l);if(!(0,f.Tj)(i,l))continue;e<n&&(n=e,(0,c.c)(r,l))}}return R(e,t.origin)<n&&C(e,t.origin,r),r}function C(e,t,r){const o=(0,f._I)(e.plane,t,g.rq.get()),i=(0,m.H6)(L(e,e.basis1),o,-1,1,g.rq.get()),n=(0,m.H6)(L(e,e.basis2),o,-1,1,g.rq.get());return(0,c.f)(r,(0,c.g)(g.rq.get(),i,n),e.origin),r}function O(e,t,r){const{origin:o,basis1:i,basis2:n}=e,a=(0,c.f)(g.rq.get(),t,o),s=(0,v.gr)(i,a),l=(0,v.gr)(n,a),d=(0,v.gr)(N(e),a);return(0,c.s)(r,s,l,d)}function R(e,t){const r=O(e,t,g.rq.get()),{basis1:o,basis2:i}=e,n=(0,c.l)(o),a=(0,c.l)(i),s=Math.max(Math.abs(r[0])-n,0),l=Math.max(Math.abs(r[1])-a,0),d=r[2];return s*s+l*l+d*d}function I(e,t){const r=-e.plane[3];return(0,v.gr)(N(e),t)-r}function N(e){return(0,f.Qj)(e.plane)}function P(e,t){const r=(0,c.f)(g.rq.get(),t,e.origin),o=(0,c.q)(e.basis1),i=(0,c.q)(e.basis2),n=(0,c.m)(e.basis1,r),a=(0,c.m)(e.basis2,r);return-n-o<0&&n-o<0&&-a-i<0&&a-i<0}function L(e,t){const r=z.get();return(0,c.c)(r.origin,e.origin),(0,c.c)(r.vector,t),r}function H(e,t,r){const{basis1:o,basis2:i,origin:n}=e,a=(0,c.j)(g.rq.get(),o,t.origin[0]),s=(0,c.j)(g.rq.get(),i,t.origin[1]);(0,c.g)(r.origin,a,s),(0,c.g)(r.origin,r.origin,n);const l=(0,c.j)(g.rq.get(),o,t.direction[0]),d=(0,c.j)(g.rq.get(),i,t.direction[1]);return(0,c.j)(r.vector,(0,c.g)(l,l,d),2),r}function D(e,t,r,o){const i=N(e);(0,f.mR)(i,t.direction,t.origin,r),(0,f.mR)((0,f.Qj)(r),i,t.origin,o)}const B={plane:(0,f.vt)(),origin:(0,d.fA)(0,0,0),basis1:(0,d.fA)(1,0,0),basis2:(0,d.fA)(0,1,0)},F=new a.I(f.vt),z=new a.I(m.vt),V=(0,d.vt)(),G=new a.I((()=>x())),U=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],W=(0,l.vt)(),j=(0,l.vt)();Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:class{constructor(){this.plane=(0,f.vt)(),this.origin=(0,d.vt)(),this.basis1=(0,d.vt)(),this.basis2=(0,d.vt)()}},altitudeAt:I,axisAt:function(e,t,r,o){return function(e,t,r){switch(t){case h._.X:(0,c.c)(r,e.basis1),(0,c.n)(r,r);break;case h._.Y:(0,c.c)(r,e.basis2),(0,c.n)(r,r);break;case h._.Z:(0,c.c)(r,N(e))}return r}(e,r,o)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:w,closestPointOnSilhouette:S,copy:T,copyWithoutVerify:function(e,t){(0,c.c)(t.origin,e.origin),(0,c.c)(t.basis1,e.basis1),(0,c.c)(t.basis2,e.basis2),(0,f.C)(t.plane,e.plane)},create:x,distance:function(e,t){return Math.sqrt(R(e,t))},distance2:R,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const o of U){const i=H(e,o,z.get()),n=(0,m.kb)(i,t);n>r&&(r=n)}return Math.sqrt(r)},elevate:A,equals:function(e,t){return(0,c.e)(e.basis1,t.basis1)&&(0,c.e)(e.basis2,t.basis2)&&(0,c.e)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,f.Tj)(e.plane,t)&&P(e,t)},fromAABoundingRect:E,fromValues:b,getExtent:function(e,t){const r=e.basis1[0],o=e.basis2[1],[i,n]=e.origin;return(0,u.fA)(i-r,n-o,i+o,n+o,t)},intersectRay:M,intersectRayClosestSilhouette:function(e,t,r){if(M(e,t,r))return r;const o=S(e,t,g.rq.get());return(0,c.g)(r,t.origin,(0,c.j)(g.rq.get(),t.direction,(0,c.p)(t.origin,o)/(0,c.l)(t.direction))),r},normal:N,projectPoint:C,projectPointLocal:O,rotate:function(e,t,r,o){return e!==o&&T(e,o),(0,s.$0)(j,t,r),(0,c.h)(o.basis1,e.basis1,j),(0,c.h)(o.basis2,e.basis2,j),y(o),o},setAltitudeAt:function(e,t,r,o){const i=I(e,t),n=(0,c.j)(V,N(e),r-i);return(0,c.g)(o,t,n),o},setExtent:function(e,t,r){return E(t,r),A(r,I(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&T(e,r),(0,s.B8)(W,t),(0,s.mg)(W,W),(0,c.h)(r.basis1,e.basis1,W),(0,c.h)(r.basis2,e.basis2,W),(0,c.h)((0,f.Qj)(r.plane),(0,f.Qj)(e.plane),W),(0,c.h)(r.origin,e.origin,t),(0,f.mP)(r.plane,r.plane,r.origin),r},up:B,updateUnboundedPlane:y,wrap:function(e,t,r){const o=G.get();return o.origin=e,o.basis1=t,o.basis2=r,o.plane=(0,f.LV)(0,0,0,0),y(o),o}},Symbol.toStringTag,{value:"Module"}));var q=r(76412);r(24151),(0,i.kU)(10),(0,i.kU)(12),(0,i.kU)(70),(0,i.kU)(40);const k={scale:0,factor:0,minScaleFactor:0};function $(e,t,r,o,n){let a=(r.screenLength||0)*e.pixelRatio;null!=n&&(a=function(e,t,r,o){return function(e,t){return(0,i.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}(e,function(e,t,r){const o=r.parameters;return k.scale=Math.min(o.divisor/(t-o.offset),1),k.factor=function(e){return Math.abs(e*e*e)}(e),k}(t,r,o))}(a,o,t,n));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,i.qE)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function Y(e,t){let r=!1;for(const i in t){const n=t[i];void 0!==n&&(Array.isArray(n)?Array.isArray(e[i])&&(0,o.aI)(n,e[i])||(e[i]=n.slice(),r=!0):e[i]!==n&&(r=!0,e[i]=n))}return r}(0,q.c)();const X={multiply:1,ignore:2,replace:3,tint:4}},60517:(e,t,r)=>{r.d(t,{z:()=>c});var o=r(49255),i=r(76662),n=r(35093),a=r(63365),s=r(2597),l=r(14327);function c(e,t){e.include(i.Q,t),e.fragment.include(a.a);const r=t.output===o.V.Highlight,c=t.output===o.V.ObjectAndLayerIdColor,d=t.output===o.V.Color&&t.transparencyPassType===l.y.ColorAlpha,u=t.discardTransparentFragments;d&&(e.outputs.add("fragColor","vec4",0),e.outputs.add("fragAlpha","float",1)),e.fragment.code.add(s.H`
1080
+ }`)}},26835:(e,t,r)=>{r(2597)},20693:(e,t,r)=>{r.d(t,{yu:()=>m,NB:()=>f,S7:()=>g});var o=r(58083),i=r(9093),n=r(38954),a=r(51850),s=r(40710),l=r(33079),c=(r(20304),r(39589)),d=r(46263);class u extends c.n{constructor(e,t){super(e,"mat4",d.c.Draw,((r,o,i)=>r.setUniformMatrix4fv(e,t(o,i))))}}var h=r(40095);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new s.W("cameraPosition",((e,t)=>(0,n.s)(v,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new h.X("proj",((e,t)=>t.camera.projectionMatrix)),new u("view",((e,t)=>(0,o.Tl)(p,t.camera.viewMatrix,e.origin))),new s.W("localOrigin",(e=>e.origin)));const r=e=>(0,n.s)(v,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new h.X("proj",((e,t)=>t.camera.projectionMatrix)),new h.X("view",((e,t)=>(0,o.Tl)(p,t.camera.viewMatrix,r(t)))),new l.t("localOrigin",((e,t)=>r(t))))}const p=(0,i.vt)(),v=(0,a.vt)();function g(e){e.uniforms.add(new h.X("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Draw,((r,o,i,n)=>r.setUniform2fv(e,t(o,i,n))))}}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Pass,((r,o,i)=>r.setUniform2fv(e,t(o,i))))}}},40710:(e,t,r)=>{r.d(t,{W:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec3",i.c.Draw,((r,o,i,n)=>r.setUniform3fv(e,t(o,i,n))))}}},33079:(e,t,r)=>{r.d(t,{t:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec3",i.c.Pass,((r,o,i)=>r.setUniform3fv(e,t(o,i))))}}},71988:(e,t,r)=>{r.d(t,{E:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"vec4",i.c.Pass,((r,o,i)=>r.setUniform4fv(e,t(o,i))))}}},20304:(e,t,r)=>{r.d(t,{m:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"float",i.c.Pass,((r,o,i)=>r.setUniform1f(e,t(o,i))))}}},93588:(e,t,r)=>{r.d(t,{c:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"int",i.c.Pass,((r,o,i)=>r.setUniform1i(e,t(o,i))))}}},98353:(e,t,r)=>{r.d(t,{h:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"mat3",i.c.Draw,((r,o,i)=>r.setUniformMatrix3fv(e,t(o,i))))}}},35644:(e,t,r)=>{r.d(t,{k:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"mat3",i.c.Pass,((r,o,i)=>r.setUniformMatrix3fv(e,t(o,i))))}}},40095:(e,t,r)=>{r.d(t,{X:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"mat4",i.c.Pass,((r,o,i)=>r.setUniformMatrix4fv(e,t(o,i))))}}},85977:(e,t,r)=>{r.d(t,{N5:()=>l});var o=r(49186),i=(r(44208),r(53966)),n=r(46263),a=r(620);class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class l extends s{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.extensions=new f,this.constants=new v,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),o=this.varyings.generateSource(e),i="vertex"===e?this.vertex:this.fragment,n=i.uniforms.generateSource(),a=i.code.generateSource(),s="vertex"===e?_:g,l=this.constants.generateSource().concat(i.constants.generateSource()),c=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${n.join("\n")}\n\n${r.join("\n")}\n\n${o.join("\n")}\n\n${c.join("\n")}\n\n${a.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),o=r.length;return(t,i)=>{for(let n=0;n<o;++n)r[n](e,t,i)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),o=r.length;return(t,i,n)=>{for(let a=0;a<o;++a)r[a](e,t,i,n)}}}class c{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new o.A(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else i.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder").error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends s{constructor(){super(...arguments),this.uniforms=new c(this),this.code=new d(this),this.constants=new v}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class m{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,a.vA)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,o)=>t.push("vertex"===e?`out ${r} ${o};`:`in ${r} ${o};`))),t}}class f{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?f.ALLOWLIST_VERTEX:f.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}f.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],f.ALLOWLIST_VERTEX=[];class p{constructor(){this._entries=new Map}add(e,t,r=0){const o=this._entries.get(r);o?(0,a.vA)(o.name===e&&o.type===t,`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}p.DEFAULT_TYPE="vec4",p.DEFAULT_NAME="fragColor";class v{constructor(){this._entries=new Set}add(e,t,r){let o="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":o=v._numberToFloatStr(r);break;case"int":o=v._numberToIntStr(r);break;case"bool":o=r.toString();break;case"vec2":o=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":o=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":o=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":o=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":o=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":o=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":o=`${t}(${Array.prototype.map.call(r,(e=>v._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${o};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif",_="precision highp float;\nprecision highp sampler2D;"},15976:(e,t,r)=>{r.d(t,{o:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Draw,((r,o,i)=>r.bindTexture(e,t(o,i))))}}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var o=r(39589),i=r(46263);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Pass,((r,o,i)=>r.bindTexture(e,t(o,i))))}}},39589:(e,t,r)=>{r.d(t,{n:()=>i});var o=r(46263);class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={[o.c.Pass]:null,[o.c.Draw]:null},i)switch(r){case o.c.Pass:this.bind[o.c.Pass]=i;break;case o.c.Draw:this.bind[o.c.Draw]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},2597:(e,t,r)=>{r.d(t,{H:()=>i,Y:()=>o});const o=class{};function i(e,...t){let r="";for(let o=0;o<t.length;o++)r+=e[o]+t[o];return r+=e[e.length-1],r}var n;(n=i||(i={})).int=function(e){return Math.round(e).toString()},n.float=function(e){return e.toPrecision(8)}},97220:(e,t,r)=>{r.d(t,{$:()=>o});class o{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},84867:(e,t,r)=>{r.d(t,{w:()=>n});var o=r(97768),i=r(63907);class n{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}destroy(){this._program=(0,o.WD)(this._program),this._pipeline=this._configuration=null}reload(e){(0,o.WD)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return i.WR.TRIANGLES}getPipeline(e,t,r){return this._pipeline}initializeConfiguration(e,t){}}},99769:(e,t,r)=>{r.d(t,{K:()=>n,W:()=>a});var o=r(49186),i=r(2597);class n extends i.Y{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function a(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,n=e.count||2,a=Math.ceil(Math.log2(n)),s=t._parameterBits??[0];let l=0;for(;s[l]+a>16;)l++,l>=s.length&&s.push(0);t._parameterBits=s;const c=s[l],d=(1<<a)-1<<c;s[l]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(t){if(this[i]!==t)if(this[i]=t,this._keyDirty=!0,this._parameterBits[l]=this._parameterBits[l]&~d|+t<<c&d,"number"==typeof t){if(null==e.count)throw new o.A(`Configuration value for ${r} must provide a count option`)}else if("boolean"!=typeof t)throw new o.A(`Configuration value for ${r} must be boolean or number, got ${typeof t}`)}})}}}},69720:(e,t,r)=>{r.d(t,{J:()=>i});var o=r(24326);class i{constructor(){this.id=(0,o.c)()}}},96672:(e,t,r)=>{var o;r.d(t,{X:()=>o}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(o||(o={}))},39341:(e,t,r)=>{r.d(t,{D:()=>i});var o=r(46540);const i=new Map([[o.r.POSITION,0],[o.r.NORMAL,1],[o.r.NORMALCOMPRESSED,1],[o.r.UV0,2],[o.r.COLOR,3],[o.r.COLORFEATUREATTRIBUTE,3],[o.r.SIZE,4],[o.r.TANGENT,4],[o.r.CENTEROFFSETANDDISTANCE,5],[o.r.SYMBOLCOLOR,5],[o.r.FEATUREATTRIBUTE,6],[o.r.INSTANCEFEATUREATTRIBUTE,6],[o.r.INSTANCECOLOR,7],[o.r.OBJECTANDLAYERIDCOLOR,7],[o.r.INSTANCEOBJECTANDLAYERIDCOLOR,7],[o.r.INSTANCEMODEL,8],[o.r.INSTANCEMODELNORMAL,12],[o.r.INSTANCEMODELORIGINHI,11],[o.r.INSTANCEMODELORIGINLO,15]])},25634:(e,t,r)=>{r.d(t,{m:()=>l});var o=r(97768),i=r(74887),n=r(2597),a=r(89192);class s{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){this._techniques.release(this._technique)}get technique(){return this._technique}get _stippleTextures(){return this._techniques.constructionContext.stippleTextures}get _markerTextures(){return this._techniques.constructionContext.markerTextures}ensureTechnique(e,t){return this._technique=this._techniques.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return a.Am.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),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(){this._texture=(0,o.Gz)(this._texture),this._textureNormal=(0,o.Gz)(this._textureNormal),this._textureEmissive=(0,o.Gz)(this._textureEmissive),this._textureOcclusion=(0,o.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,o.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?a.Am.LOADED:a.Am.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,o.Gz)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,i.$X)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,o.Gz)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends n.Y{constructor(e=null,t=null,r=null,o=null,i=null,n,a){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=o,this.textureMetallicRoughness=i,this.scale=n,this.normalTextureTransformMatrix=a}}},14903:(e,t,r)=>{r.d(t,{im:()=>h,m$:()=>o});var o,i,n=r(51850),a=r(2597),s=r(89192),l=r(69720),c=r(96672),d=r(39341),u=r(13752);class h extends l.J{constructor(e,t){super(),this.type=c.X.Material,this.supportsEdges=!1,this._renderPriority=0,this._vertexAttributeLocations=d.D,this._pp0=(0,n.fA)(0,0,1),this._pp1=(0,n.fA)(0,0,0),this._parameters=new t,(0,u.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,u.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.bindParameters.decorations===s.ID.ON)&&!!(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())}get vertexAttributeLocations(){return this._vertexAttributeLocations}parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}intersectDraped(e,t,r,o,i,n){return this._pp0[0]=this._pp1[0]=o[0],this._pp0[1]=this._pp1[1]=o[1],this.intersect(e,t,r,this._pp0,this._pp1,i)}}(i=o||(o={}))[i.None=0]="None",i[i.Occlude=1]="Occlude",i[i.Transparent=2]="Transparent",i[i.OccludeAndTransparent=4]="OccludeAndTransparent",i[i.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",i[i.Opaque=16]="Opaque",a.Y},34886:(e,t,r)=>{r.d(t,{B:()=>n});var o=r(3694),i=r(94656);class n{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new o.A({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=(0,i.en)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}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){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t?.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),this._fragmentUniforms?.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},14327:(e,t,r)=>{var o;r.d(t,{y:()=>o}),function(e){e[e.ColorAlpha=0]="ColorAlpha",e[e.FrontFace=1]="FrontFace",e[e.NONE=2]="NONE",e[e.COUNT=3]="COUNT"}(o||(o={}))},89192:(e,t,r)=>{var o,i,n,a,s,l,c,d,u;r.d(t,{Am:()=>a,C7:()=>n,ID:()=>d,JS:()=>u,Mg:()=>l,dd:()=>s,it:()=>i,s2:()=>o,sf:()=>c}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(o||(o={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(i||(i={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(l||(l={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(c||(c={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(d||(d={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(u||(u={}))},61765:(e,t,r)=>{r.d(t,{T:()=>o});const o=2.1},13752:(e,t,r)=>{r.d(t,{Um:()=>X,MB:()=>Y,kE:()=>$});var o=r(4576),i=r(34727),n=(r(44208),r(53966)),a=r(4341),s=r(58083),l=r(9093),c=r(38954),d=r(51850),u=r(19419),h=r(88582),m=r(11964),f=r(240),p=r(71351),v=r(44280),g=r(32114);const _=()=>n.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function x(e=B){return{plane:(0,f.vt)(e.plane),origin:(0,d.o8)(e.origin),basis1:(0,d.o8)(e.basis1),basis2:(0,d.o8)(e.basis2)}}function T(e,t=x()){return b(e.origin,e.basis1,e.basis2,t)}function b(e,t,r,o=x()){return(0,c.c)(o.origin,e),(0,c.c)(o.basis1,t),(0,c.c)(o.basis2,r),y(o),function(e,t){Math.abs((0,c.m)(e.basis1,e.basis2)/((0,c.l)(e.basis1)*(0,c.l)(e.basis2)))>1e-6&&_().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,c.m)(e.basis1,N(e)))>1e-6&&_().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,c.m)(N(e),e.origin)-e.plane[3])>1e-6&&_().warn(t,"Plane offset is not consistent with plane origin")}(o,"fromValues()"),o}function y(e){(0,f.mR)(e.basis2,e.basis1,e.origin,e.plane)}function A(e,t,r){e!==r&&T(e,r);const o=(0,c.j)(g.rq.get(),N(e),t);return(0,c.g)(r.origin,r.origin,o),r.plane[3]-=t,r}function E(e,t=x()){const r=(e[2]-e[0])/2,o=(e[3]-e[1])/2;return(0,c.s)(t.origin,e[0]+r,e[1]+o,0),(0,c.s)(t.basis1,r,0,0),(0,c.s)(t.basis2,0,o,0),(0,f.fA)(0,0,1,0,t.plane),t}function S(e,t,r){return!!(0,f.Ui)(e.plane,t,r)&&P(e,r)}function M(e,t,r){const o=F.get();D(e,t,o,F.get());let n=Number.POSITIVE_INFINITY;for(const a of U){const s=H(e,a,z.get()),l=g.rq.get();if((0,f.T7)(o,s,l)){const e=(0,c.E)(g.rq.get(),t.origin,l),o=Math.abs((0,i.XM)((0,c.m)(t.direction,e)));o<n&&(n=o,(0,c.c)(r,l))}}return n===Number.POSITIVE_INFINITY?w(e,t,r):r}function w(e,t,r){if(S(e,t,r))return r;const o=F.get(),i=F.get();D(e,t,o,i);let n=Number.POSITIVE_INFINITY;for(const a of U){const s=H(e,a,z.get()),l=g.rq.get();if((0,f.gv)(o,s,l)){const e=(0,p.kb)(t,l);if(!(0,f.Tj)(i,l))continue;e<n&&(n=e,(0,c.c)(r,l))}}return R(e,t.origin)<n&&C(e,t.origin,r),r}function C(e,t,r){const o=(0,f._I)(e.plane,t,g.rq.get()),i=(0,m.H6)(L(e,e.basis1),o,-1,1,g.rq.get()),n=(0,m.H6)(L(e,e.basis2),o,-1,1,g.rq.get());return(0,c.f)(r,(0,c.g)(g.rq.get(),i,n),e.origin),r}function O(e,t,r){const{origin:o,basis1:i,basis2:n}=e,a=(0,c.f)(g.rq.get(),t,o),s=(0,v.gr)(i,a),l=(0,v.gr)(n,a),d=(0,v.gr)(N(e),a);return(0,c.s)(r,s,l,d)}function R(e,t){const r=O(e,t,g.rq.get()),{basis1:o,basis2:i}=e,n=(0,c.l)(o),a=(0,c.l)(i),s=Math.max(Math.abs(r[0])-n,0),l=Math.max(Math.abs(r[1])-a,0),d=r[2];return s*s+l*l+d*d}function I(e,t){const r=-e.plane[3];return(0,v.gr)(N(e),t)-r}function N(e){return(0,f.Qj)(e.plane)}function P(e,t){const r=(0,c.f)(g.rq.get(),t,e.origin),o=(0,c.q)(e.basis1),i=(0,c.q)(e.basis2),n=(0,c.m)(e.basis1,r),a=(0,c.m)(e.basis2,r);return-n-o<0&&n-o<0&&-a-i<0&&a-i<0}function L(e,t){const r=z.get();return(0,c.c)(r.origin,e.origin),(0,c.c)(r.vector,t),r}function H(e,t,r){const{basis1:o,basis2:i,origin:n}=e,a=(0,c.j)(g.rq.get(),o,t.origin[0]),s=(0,c.j)(g.rq.get(),i,t.origin[1]);(0,c.g)(r.origin,a,s),(0,c.g)(r.origin,r.origin,n);const l=(0,c.j)(g.rq.get(),o,t.direction[0]),d=(0,c.j)(g.rq.get(),i,t.direction[1]);return(0,c.j)(r.vector,(0,c.g)(l,l,d),2),r}function D(e,t,r,o){const i=N(e);(0,f.mR)(i,t.direction,t.origin,r),(0,f.mR)((0,f.Qj)(r),i,t.origin,o)}const B={plane:(0,f.vt)(),origin:(0,d.fA)(0,0,0),basis1:(0,d.fA)(1,0,0),basis2:(0,d.fA)(0,1,0)},F=new a.I(f.vt),z=new a.I(m.vt),V=(0,d.vt)(),G=new a.I((()=>x())),U=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],W=(0,l.vt)(),j=(0,l.vt)();Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:class{constructor(){this.plane=(0,f.vt)(),this.origin=(0,d.vt)(),this.basis1=(0,d.vt)(),this.basis2=(0,d.vt)()}},altitudeAt:I,axisAt:function(e,t,r,o){return function(e,t,r){switch(t){case h._.X:(0,c.c)(r,e.basis1),(0,c.n)(r,r);break;case h._.Y:(0,c.c)(r,e.basis2),(0,c.n)(r,r);break;case h._.Z:(0,c.c)(r,N(e))}return r}(e,r,o)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:w,closestPointOnSilhouette:M,copy:T,copyWithoutVerify:function(e,t){(0,c.c)(t.origin,e.origin),(0,c.c)(t.basis1,e.basis1),(0,c.c)(t.basis2,e.basis2),(0,f.C)(t.plane,e.plane)},create:x,distance:function(e,t){return Math.sqrt(R(e,t))},distance2:R,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const o of U){const i=H(e,o,z.get()),n=(0,m.kb)(i,t);n>r&&(r=n)}return Math.sqrt(r)},elevate:A,equals:function(e,t){return(0,c.e)(e.basis1,t.basis1)&&(0,c.e)(e.basis2,t.basis2)&&(0,c.e)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,f.Tj)(e.plane,t)&&P(e,t)},fromAABoundingRect:E,fromValues:b,getExtent:function(e,t){const r=e.basis1[0],o=e.basis2[1],[i,n]=e.origin;return(0,u.fA)(i-r,n-o,i+o,n+o,t)},intersectRay:S,intersectRayClosestSilhouette:function(e,t,r){if(S(e,t,r))return r;const o=M(e,t,g.rq.get());return(0,c.g)(r,t.origin,(0,c.j)(g.rq.get(),t.direction,(0,c.p)(t.origin,o)/(0,c.l)(t.direction))),r},normal:N,projectPoint:C,projectPointLocal:O,rotate:function(e,t,r,o){return e!==o&&T(e,o),(0,s.$0)(j,t,r),(0,c.h)(o.basis1,e.basis1,j),(0,c.h)(o.basis2,e.basis2,j),y(o),o},setAltitudeAt:function(e,t,r,o){const i=I(e,t),n=(0,c.j)(V,N(e),r-i);return(0,c.g)(o,t,n),o},setExtent:function(e,t,r){return E(t,r),A(r,I(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&T(e,r),(0,s.B8)(W,t),(0,s.mg)(W,W),(0,c.h)(r.basis1,e.basis1,W),(0,c.h)(r.basis2,e.basis2,W),(0,c.h)((0,f.Qj)(r.plane),(0,f.Qj)(e.plane),W),(0,c.h)(r.origin,e.origin,t),(0,f.mP)(r.plane,r.plane,r.origin),r},up:B,updateUnboundedPlane:y,wrap:function(e,t,r){const o=G.get();return o.origin=e,o.basis1=t,o.basis2=r,o.plane=(0,f.LV)(0,0,0,0),y(o),o}},Symbol.toStringTag,{value:"Module"}));var q=r(76412);r(24151),(0,i.kU)(10),(0,i.kU)(12),(0,i.kU)(70),(0,i.kU)(40);const k={scale:0,factor:0,minScaleFactor:0};function $(e,t,r,o,n){let a=(r.screenLength||0)*e.pixelRatio;null!=n&&(a=function(e,t,r,o){return function(e,t){return(0,i.Cc)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}(e,function(e,t,r){const o=r.parameters;return k.scale=Math.min(o.divisor/(t-o.offset),1),k.factor=function(e){return Math.abs(e*e*e)}(e),k}(t,r,o))}(a,o,t,n));const s=a*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,i.qE)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function Y(e,t){let r=!1;for(const i in t){const n=t[i];void 0!==n&&(Array.isArray(n)?Array.isArray(e[i])&&(0,o.aI)(n,e[i])||(e[i]=n.slice(),r=!0):e[i]!==n&&(r=!0,e[i]=n))}return r}(0,q.c)();const X={multiply:1,ignore:2,replace:3,tint:4}},60517:(e,t,r)=>{r.d(t,{z:()=>c});var o=r(49255),i=r(76662),n=r(35093),a=r(63365),s=r(2597),l=r(14327);function c(e,t){e.include(i.Q,t),e.fragment.include(a.a);const r=t.output===o.V.Highlight,c=t.output===o.V.ObjectAndLayerIdColor,d=t.output===o.V.Color&&t.transparencyPassType===l.y.ColorAlpha,u=t.discardTransparentFragments;d&&(e.outputs.add("fragColor","vec4",0),e.outputs.add("fragAlpha","float",1)),e.fragment.code.add(s.H`
1081
1081
  void outputColorHighlightOID(vec4 finalColor, const in vec3 vWorldPosition) {
1082
1082
  ${c?s.H`finalColor.a = 1.0;`:""}
1083
1083
 
@@ -1095,4 +1095,4 @@ return dot(rgba, RGBA4_2_FLOAT_FACTORS);
1095
1095
  ${r?s.H`outputHighlight();`:""};
1096
1096
  ${c?s.H`outputObjectAndLayerIdColor();`:""}
1097
1097
  }
1098
- `)}},28449:(e,t,r)=>{function o(e,t){const r=e.length;for(let o=0;o<r;++o)n[0]=e[o],t[o]=n[0];return t}function i(e,t){const r=e.length;for(let o=0;o<r;++o)n[0]=e[o],n[1]=e[o]-n[0],t[o]=n[1];return t}r.d(t,{Zo:()=>o,jA:()=>i});const n=new Float32Array(2)},90644:(e,t,r)=>{r.d(t,{Ey:()=>T,Xt:()=>l,kn:()=>c,p3:()=>n,wE:()=>d});var o=r(89192),i=r(63907);function n(e,t,r,o,n=i.Tb.ADD,a=i.Tb.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:o,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const a={face:i.Y7.BACK,mode:i.Ac.CCW},s={face:i.Y7.FRONT,mode:i.Ac.CCW},l=e=>e===o.s2.Back?a:e===o.s2.Front?s:null,c={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function u(e){return A.intern(e)}function h(e){return M.intern(e)}function m(e){return w.intern(e)}function f(e){return O.intern(e)}function p(e){return I.intern(e)}function v(e){return P.intern(e)}function g(e){return H.intern(e)}function _(e){return B.intern(e)}function x(e){return z.intern(e)}function T(e){return G.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function y(e){return"["+e.join(",")+"]"}const A=new b(E,(e=>({__tag:"Blending",...e})));function E(e){return e?y([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 M=new b(S,(e=>({__tag:"Culling",...e})));function S(e){return e?y([e.face,e.mode]):null}const w=new b(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?y([e.factor,e.units]):null}const O=new b(R,(e=>({__tag:"DepthTest",...e})));function R(e){return e?y([e.func]):null}const I=new b(N,(e=>({__tag:"StencilTest",...e})));function N(e){return e?y([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const P=new b(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?y([e.zNear,e.zFar]):null}const H=new b(D,(e=>({__tag:"ColorWrite",...e})));function D(e){return e?y([e.r,e.g,e.b,e.a]):null}const B=new b(F,(e=>({__tag:"StencilWrite",...e})));function F(e){return e?y([e.mask]):null}const z=new b(V,(e=>({__tag:"DrawBuffers",...e})));function V(e){return e?y(e.buffers):null}const G=new b((function(e){return e?y([E(e.blending),S(e.culling),C(e.polygonOffset),R(e.depthTest),N(e.stencilTest),L(e.depthWrite),D(e.colorWrite),F(e.stencilWrite),V(e.drawBuffers)]):null}),(e=>({blending:u(e.blending),culling:h(e.culling),polygonOffset:m(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:p(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:g(e.colorWrite),stencilWrite:_(e.stencilWrite),drawBuffers:x(e.drawBuffers)})))}}]);
1098
+ `)}},28449:(e,t,r)=>{function o(e,t){const r=e.length;for(let o=0;o<r;++o)n[0]=e[o],t[o]=n[0];return t}function i(e,t){const r=e.length;for(let o=0;o<r;++o)n[0]=e[o],n[1]=e[o]-n[0],t[o]=n[1];return t}r.d(t,{Zo:()=>o,jA:()=>i});const n=new Float32Array(2)},90644:(e,t,r)=>{r.d(t,{Ey:()=>T,Xt:()=>l,kn:()=>c,p3:()=>n,wE:()=>d});var o=r(89192),i=r(63907);function n(e,t,r,o,n=i.Tb.ADD,a=i.Tb.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:o,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const a={face:i.Y7.BACK,mode:i.Ac.CCW},s={face:i.Y7.FRONT,mode:i.Ac.CCW},l=e=>e===o.s2.Back?a:e===o.s2.Front?s:null,c={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function u(e){return A.intern(e)}function h(e){return S.intern(e)}function m(e){return w.intern(e)}function f(e){return O.intern(e)}function p(e){return I.intern(e)}function v(e){return P.intern(e)}function g(e){return H.intern(e)}function _(e){return B.intern(e)}function x(e){return z.intern(e)}function T(e){return G.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function y(e){return"["+e.join(",")+"]"}const A=new b(E,(e=>({__tag:"Blending",...e})));function E(e){return e?y([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const S=new b(M,(e=>({__tag:"Culling",...e})));function M(e){return e?y([e.face,e.mode]):null}const w=new b(C,(e=>({__tag:"PolygonOffset",...e})));function C(e){return e?y([e.factor,e.units]):null}const O=new b(R,(e=>({__tag:"DepthTest",...e})));function R(e){return e?y([e.func]):null}const I=new b(N,(e=>({__tag:"StencilTest",...e})));function N(e){return e?y([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const P=new b(L,(e=>({__tag:"DepthWrite",...e})));function L(e){return e?y([e.zNear,e.zFar]):null}const H=new b(D,(e=>({__tag:"ColorWrite",...e})));function D(e){return e?y([e.r,e.g,e.b,e.a]):null}const B=new b(F,(e=>({__tag:"StencilWrite",...e})));function F(e){return e?y([e.mask]):null}const z=new b(V,(e=>({__tag:"DrawBuffers",...e})));function V(e){return e?y(e.buffers):null}const G=new b((function(e){return e?y([E(e.blending),M(e.culling),C(e.polygonOffset),R(e.depthTest),N(e.stencilTest),L(e.depthWrite),D(e.colorWrite),F(e.stencilWrite),V(e.drawBuffers)]):null}),(e=>({blending:u(e.blending),culling:h(e.culling),polygonOffset:m(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:p(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:g(e.colorWrite),stencilWrite:_(e.stencilWrite),drawBuffers:x(e.drawBuffers)})))}}]);