@arcgis/core 4.28.0-rc.2 → 4.28.0-rc.4

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 (163) hide show
  1. package/arcade/ArcadeDate.js +1 -1
  2. package/arcade/functions/featuresetbase.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{0e354096ad8817971eed.js → 02d235849ba93541d7ad.js} +1 -1
  5. package/assets/esri/core/workers/chunks/0422c5160491fbcf01dc.js +1 -0
  6. package/assets/esri/core/workers/chunks/1da721608993783dc9cf.js +1 -0
  7. package/assets/esri/core/workers/chunks/224e79f6c172da444e0a.js +1 -0
  8. package/assets/esri/core/workers/chunks/{ca3d5803cdf035d7389d.js → 30776102fbab294bfe7b.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{61dec8399919b278b636.js → 3ac9001b19a90faf5573.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{fa6103e3d4e857b0035b.js → 3dcb2a82e1e4b520c9c9.js} +11 -8
  11. package/assets/esri/core/workers/chunks/41081c921037e543a22f.js +1 -0
  12. package/assets/esri/core/workers/chunks/4564a7885d045a850887.js +1 -0
  13. package/assets/esri/core/workers/chunks/4adf3a8c6b49c381a633.js +1 -0
  14. package/assets/esri/core/workers/chunks/{2721aa6b6941b28b9758.js → 63c8bf00120a4e67f5b0.js} +1 -1
  15. package/assets/esri/core/workers/chunks/6bc1f6f8a2408fa4bb6a.js +1 -0
  16. package/assets/esri/core/workers/chunks/74951370a341f02d3714.js +1 -0
  17. package/assets/esri/core/workers/chunks/78e49a70193e5adea17c.js +1 -0
  18. package/assets/esri/core/workers/chunks/7b8377b3a9f78f9d3613.js +1 -0
  19. package/assets/esri/core/workers/chunks/{fd28400141a6751327ae.js → 7cf7f2b991a7cbdad2ce.js} +1 -1
  20. package/assets/esri/core/workers/chunks/830d99e6c58a52a58973.js +1 -0
  21. package/assets/esri/core/workers/chunks/{1a723bb4a341f645e5fe.js → 83b8141f0c80e3448012.js} +1 -1
  22. package/assets/esri/core/workers/chunks/8f7997e8e6ee9e56239f.js +1 -0
  23. package/assets/esri/core/workers/chunks/934c32c49bb9e21482fd.js +1 -0
  24. package/assets/esri/core/workers/chunks/{a4341ec0fe89b865d849.js → a160576f21ada91995ac.js} +1 -1
  25. package/assets/esri/core/workers/chunks/a1e16c33f1843dbdce26.js +1 -0
  26. package/assets/esri/core/workers/chunks/{d07235ce2765a25b9be4.js → a50ec5b647a160199cb2.js} +1 -1
  27. package/assets/esri/core/workers/chunks/b6bd31674076e543d8b2.js +1 -0
  28. package/assets/esri/core/workers/chunks/{77923afde29ae1ff10ca.js → b6e86e179f99b5cf8dff.js} +1 -1
  29. package/assets/esri/core/workers/chunks/c3ddf5dbc34f118002df.js +1 -0
  30. package/assets/esri/core/workers/chunks/{562eafa5090827ebb7ec.js → c87e9280681c20d042b5.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{7b3d5f044c96e2c2af11.js → d191267d91a53db42956.js} +1 -1
  32. package/assets/esri/core/workers/chunks/ffa330a19a09679212fb.js +1 -0
  33. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +9 -13
  34. package/assets/esri/themes/base/widgets/_Features.scss +5 -0
  35. package/assets/esri/themes/base/widgets/_Legend.scss +1 -1
  36. package/assets/esri/themes/base/widgets/_Popup.scss +0 -1
  37. package/assets/esri/themes/base/widgets/_TimeZoneLabel.scss +3 -3
  38. package/assets/esri/themes/dark/main.css +1 -1
  39. package/assets/esri/themes/light/main.css +1 -1
  40. package/assets/esri/themes/light/view.css +1 -1
  41. package/geometry/support/meshUtils/georeference.js +1 -1
  42. package/interfaces.d.ts +1506 -314
  43. package/intl/date.js +1 -1
  44. package/kernel.js +1 -1
  45. package/layers/FeatureLayer.js +1 -1
  46. package/layers/GroupLayer.js +1 -1
  47. package/layers/OrientedImageryLayer.js +1 -1
  48. package/layers/SceneLayer.js +1 -1
  49. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  50. package/layers/graphics/data/QueryEngineResult.js +1 -1
  51. package/layers/graphics/data/queryValidationUtils.js +1 -1
  52. package/layers/mixins/ArcGISMapService.js +1 -1
  53. package/layers/save/groupLayerUtils.js +1 -1
  54. package/layers/save/utils.js +1 -1
  55. package/layers/support/ImageElement.js +1 -1
  56. package/layers/support/LayerContingentValuesCache.js +1 -1
  57. package/layers/support/Sublayer.js +1 -1
  58. package/layers/support/Subtype.d.ts +4 -0
  59. package/layers/support/Subtype.js +1 -1
  60. package/layers/support/imageryRendererUtils.js +1 -1
  61. package/networks/Network.js +1 -1
  62. package/package.json +1 -1
  63. package/portal/support/jsonContext.js +1 -1
  64. package/portal/support/layersLoader.js +1 -1
  65. package/rest/featureService/FeatureService.d.ts +4 -0
  66. package/rest/featureService/FeatureService.js +1 -1
  67. package/rest/featureService/utils.d.ts +4 -0
  68. package/rest/query/operations/query.js +1 -1
  69. package/smartMapping/support/utils.js +1 -1
  70. package/statistics/utils.js +1 -1
  71. package/support/basemapUtils.js +1 -1
  72. package/support/revision.js +1 -1
  73. package/versionManagement/VersionManagementService.d.ts +4 -0
  74. package/versionManagement/VersionManagementService.js +1 -1
  75. package/views/2d/engine/Container.js +1 -1
  76. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  77. package/views/2d/engine/webgl/Overlay.js +1 -1
  78. package/views/2d/input/handlers/KeyPan.js +1 -1
  79. package/views/2d/interactive/editingTools/manipulations/DragManipulation.js +1 -1
  80. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  81. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  82. package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
  83. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  84. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  85. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  86. package/views/3d/layers/I3SMeshView3D.js +1 -1
  87. package/views/3d/layers/MediaLayerView3D.js +1 -1
  88. package/views/3d/layers/SceneLayerWorker.js +1 -1
  89. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  90. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  91. package/views/3d/layers/graphics/elevationAlignPointsInFeatures.js +1 -1
  92. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  93. package/views/3d/support/MemoryController.js +1 -1
  94. package/views/3d/support/PBFDecoder.js +1 -1
  95. package/views/3d/support/ResourceController.js +1 -1
  96. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  97. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  98. package/views/3d/webgl-engine/core/FBOPool.js +5 -0
  99. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +9 -6
  100. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +2 -2
  101. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  102. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  103. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  104. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  105. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  106. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  107. package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
  108. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  109. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  110. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  111. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +1 -1
  112. package/views/draw/DrawOperation.js +1 -1
  113. package/views/draw/support/Reshape.js +1 -1
  114. package/views/interactive/sketch/constraints.js +1 -1
  115. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  116. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  117. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  118. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  119. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  120. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  121. package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
  122. package/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js +1 -1
  123. package/webdoc/support/writeUtils.js +1 -1
  124. package/widgets/BasemapGallery.js +1 -1
  125. package/widgets/DirectionalPad.js +1 -1
  126. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  127. package/widgets/Editor/EditorViewModel.js +1 -1
  128. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  129. package/widgets/Editor/UpdateWorkflow.js +1 -1
  130. package/widgets/Editor/VisibleElements.js +1 -1
  131. package/widgets/Editor/workflowUtils.js +1 -1
  132. package/widgets/Editor.js +1 -1
  133. package/widgets/FeatureForm/FieldInput.js +1 -1
  134. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  135. package/widgets/FeatureForm.js +1 -1
  136. package/widgets/Features.js +1 -1
  137. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.d.ts +4 -0
  138. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  139. package/widgets/OrientedImageryViewer.js +1 -1
  140. package/widgets/TimeSlider.js +1 -1
  141. package/widgets/TimeZoneLabel.js +1 -1
  142. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  143. package/widgets/UtilityNetworkTrace.js +1 -1
  144. package/widgets/support/dateUtils.js +1 -1
  145. package/assets/esri/core/workers/chunks/00da3c16741a9bc47f3a.js +0 -1
  146. package/assets/esri/core/workers/chunks/0e4646d14fa0775bf463.js +0 -1
  147. package/assets/esri/core/workers/chunks/4e0bf30da4281070e453.js +0 -1
  148. package/assets/esri/core/workers/chunks/51b8913dff24e693bd25.js +0 -1
  149. package/assets/esri/core/workers/chunks/5e907ec0ee1565b5fbbc.js +0 -1
  150. package/assets/esri/core/workers/chunks/7388fd97e7b1a2142744.js +0 -1
  151. package/assets/esri/core/workers/chunks/7648f3341b7dff2825c3.js +0 -1
  152. package/assets/esri/core/workers/chunks/92d8f75e616afa5c761e.js +0 -1
  153. package/assets/esri/core/workers/chunks/9c77d69a13ec22cdd760.js +0 -1
  154. package/assets/esri/core/workers/chunks/a821fa1870b83fed5d31.js +0 -1
  155. package/assets/esri/core/workers/chunks/a877a4826cd6a46ec99b.js +0 -1
  156. package/assets/esri/core/workers/chunks/b251d8a856dc8b9406e0.js +0 -1
  157. package/assets/esri/core/workers/chunks/c416df0668f6c596095f.js +0 -1
  158. package/assets/esri/core/workers/chunks/d8c696da42f8f8919b83.js +0 -1
  159. package/assets/esri/core/workers/chunks/f0d342303fc20e266d27.js +0 -1
  160. package/assets/esri/core/workers/chunks/fac3e57784d7f37053af.js +0 -1
  161. package/assets/esri/core/workers/chunks/fc95b1a36ed68b851400.js +0 -1
  162. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +0 -4
  163. package/widgets/DirectionalPad.d.ts +0 -4
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[670],{32078:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>U});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),u=r(37099),d=r(76056),h=r(135),m=r(11317),f=r(15719),p=r(92555),g=r(89136),v=r(15817),_=r(77813),T=r(89753),x=r(5802),E=r(42001),b=r(19419),A=r(26322),S=r(85504),R=r(22539),w=r(57806),M=r(92302),y=r(96310),C=r(85787),O=r(90692),I=r(93669),P=r(172),N=r(71250),L=r(21437),D=r(74709),F=r(33680),H=r(98069),B=r(93144),G=r(35065);function U(e){const t=new F.kG,{vertex:r,fragment:U,varyings:z}=t;if((0,I.Sv)(r,e),t.include(u.f),z.add("vpos","vec3"),t.include(M.k,e),t.include(l.fQ,e),t.include(p.L,e),e.hasColorTextureTransform&&t.include(w.av),e.output===n.H.Color||e.output===n.H.Alpha){e.hasNormalTextureTransform&&t.include(w.NI),e.hasEmissionTextureTransform&&t.include(w.R5),e.hasOcclusionTextureTransform&&t.include(w.jF),e.hasMetallicRoughnessTextureTransform&&t.include(w.DT),(0,I.hY)(r,e),t.include(c.O,e),t.include(s.w,e);const n=e.normalType===c.r.Attribute||e.normalType===c.r.Compressed;n&&e.offsetBackfaces&&t.include(o.w),t.include(v.Q,e),t.include(f.Bb,e),e.instancedColor&&t.attributes.add(G.T.INSTANCECOLOR,"vec4"),z.add("vPositionLocal","vec3"),t.include(h.D,e),t.include(i.qj,e),t.include(d.R,e),t.include(m.c,e),r.uniforms.add(new N.N("externalColor",(e=>e.externalColor))),z.add("vcolorExt","vec4"),e.multipassEnabled&&z.add("depth","float"),r.code.add(D.H`
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[670],{32078:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>U});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),u=r(37099),d=r(76056),h=r(135),m=r(11317),f=r(15719),p=r(92555),g=r(89136),v=r(15817),_=r(21627),T=r(89753),x=r(5802),E=r(42001),b=r(19419),A=r(26322),S=r(85504),R=r(22539),w=r(57806),M=r(92302),y=r(96310),C=r(85787),O=r(90692),I=r(93669),P=r(172),N=r(71250),L=r(21437),D=r(74709),F=r(33680),H=r(98069),B=r(93144),G=r(35065);function U(e){const t=new F.kG,{vertex:r,fragment:U,varyings:z}=t;if((0,I.Sv)(r,e),t.include(u.f),z.add("vpos","vec3"),t.include(M.k,e),t.include(l.fQ,e),t.include(p.L,e),e.hasColorTextureTransform&&t.include(w.av),e.output===n.H.Color||e.output===n.H.Alpha){e.hasNormalTextureTransform&&t.include(w.NI),e.hasEmissionTextureTransform&&t.include(w.R5),e.hasOcclusionTextureTransform&&t.include(w.jF),e.hasMetallicRoughnessTextureTransform&&t.include(w.DT),(0,I.hY)(r,e),t.include(c.O,e),t.include(s.w,e);const n=e.normalType===c.r.Attribute||e.normalType===c.r.Compressed;n&&e.offsetBackfaces&&t.include(o.w),t.include(v.Q,e),t.include(f.Bb,e),e.instancedColor&&t.attributes.add(G.T.INSTANCECOLOR,"vec4"),z.add("vPositionLocal","vec3"),t.include(h.D,e),t.include(i.qj,e),t.include(d.R,e),t.include(m.c,e),r.uniforms.add(new N.N("externalColor",(e=>e.externalColor))),z.add("vcolorExt","vec4"),e.multipassEnabled&&z.add("depth","float"),r.code.add(D.H`
2
2
  void main(void) {
3
3
  forwardNormalizedVertexColor();
4
4
  vcolorExt = externalColor;
@@ -91,7 +91,7 @@
91
91
  fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
92
92
  ${e.transparencyPassType===B.A.Color?D.H`fragColor = premultiplyAlpha(fragColor);`:""}
93
93
  }
94
- `)}return t.include(g.s,e),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>H,b:()=>F});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),u=r(37099),d=r(76056),h=r(135),m=r(11317),f=r(92555),p=r(89136),g=r(77813),v=r(89753),_=r(5802),T=r(42001),x=r(26322),E=r(85504),b=r(22539),A=r(92302),S=r(96310),R=r(85787),w=r(90692),M=r(93669),y=r(172),C=r(71250),O=r(21437),I=r(74709),P=r(33680),N=r(98069),L=r(93144),D=r(35065);function F(e){const t=new P.kG,{vertex:r,fragment:F,varyings:H}=t;return(0,M.Sv)(r,e),t.include(u.f),H.add("vpos","vec3"),t.include(A.k,e),t.include(l.fQ,e),t.include(f.L,e),e.output!==n.H.Color&&e.output!==n.H.Alpha||((0,M.hY)(t.vertex,e),t.include(c.O,e),t.include(s.w,e),e.offsetBackfaces&&t.include(o.w),e.instancedColor&&t.attributes.add(D.T.INSTANCECOLOR,"vec4"),H.add("vNormalWorld","vec3"),H.add("localvpos","vec3"),e.multipassEnabled&&H.add("depth","float"),t.include(h.D,e),t.include(i.qj,e),t.include(d.R,e),t.include(m.c,e),r.uniforms.add(new C.N("externalColor",(e=>e.externalColor))),H.add("vcolorExt","vec4"),r.code.add(I.H`
94
+ `)}return t.include(g.s,e),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},41846:(e,t,r)=>{r.d(t,{R:()=>H,b:()=>F});var i=r(1391),o=r(62707),n=r(55039),a=r(51546),s=r(77171),l=r(47624),c=r(60624),u=r(37099),d=r(76056),h=r(135),m=r(11317),f=r(92555),p=r(89136),g=r(21627),v=r(89753),_=r(5802),T=r(42001),x=r(26322),E=r(85504),b=r(22539),A=r(92302),S=r(96310),R=r(85787),w=r(90692),M=r(93669),y=r(172),C=r(71250),O=r(21437),I=r(74709),P=r(33680),N=r(98069),L=r(93144),D=r(35065);function F(e){const t=new P.kG,{vertex:r,fragment:F,varyings:H}=t;return(0,M.Sv)(r,e),t.include(u.f),H.add("vpos","vec3"),t.include(A.k,e),t.include(l.fQ,e),t.include(f.L,e),e.output!==n.H.Color&&e.output!==n.H.Alpha||((0,M.hY)(t.vertex,e),t.include(c.O,e),t.include(s.w,e),e.offsetBackfaces&&t.include(o.w),e.instancedColor&&t.attributes.add(D.T.INSTANCECOLOR,"vec4"),H.add("vNormalWorld","vec3"),H.add("localvpos","vec3"),e.multipassEnabled&&H.add("depth","float"),t.include(h.D,e),t.include(i.qj,e),t.include(d.R,e),t.include(m.c,e),r.uniforms.add(new C.N("externalColor",(e=>e.externalColor))),H.add("vcolorExt","vec4"),r.code.add(I.H`
95
95
  void main(void) {
96
96
  forwardNormalizedVertexColor();
97
97
  vcolorExt = externalColor;
@@ -282,7 +282,7 @@ return fallOffFunction(vv, vn, 0.1);
282
282
 
283
283
  fragBlur = b / w_total;
284
284
  }
285
- `),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},21787:(e,t,r)=>{r.d(t,{a:()=>l,d:()=>s,f:()=>o,i:()=>h,m:()=>c,n:()=>u,s:()=>n,t:()=>a});var i=r(46851);function o(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function n(e,t,r,i,o,n,a,s,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=o,e[4]=n,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e}function a(e,t){if(e===t){const r=t[1],i=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=o}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function s(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*a-s*c,h=-u*n+s*l,m=c*n-a*l;let f=r*d+i*h+o*m;return f?(f=1/f,e[0]=d*f,e[1]=(-u*i+o*c)*f,e[2]=(s*i-o*a)*f,e[3]=h*f,e[4]=(u*r-o*l)*f,e[5]=(-s*r+o*n)*f,e[6]=m*f,e[7]=(-c*r+i*l)*f,e[8]=(a*r-i*n)*f,e):null}function l(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=a*u-s*c,e[1]=o*c-i*u,e[2]=i*s-o*a,e[3]=s*l-n*u,e[4]=r*u-o*l,e[5]=o*n-r*s,e[6]=n*c-a*l,e[7]=i*l-r*c,e[8]=r*a-i*n,e}function c(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],m=r[1],f=r[2],p=r[3],g=r[4],v=r[5],_=r[6],T=r[7],x=r[8];return e[0]=h*i+m*a+f*c,e[1]=h*o+m*s+f*u,e[2]=h*n+m*l+f*d,e[3]=p*i+g*a+v*c,e[4]=p*o+g*s+v*u,e[5]=p*n+g*l+v*d,e[6]=_*i+T*a+x*c,e[7]=_*o+T*s+x*u,e[8]=_*n+T*l+x*d,e}function u(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],m=t[11],f=t[12],p=t[13],g=t[14],v=t[15],_=r*s-i*a,T=r*l-o*a,x=r*c-n*a,E=i*l-o*s,b=i*c-n*s,A=o*c-n*l,S=u*p-d*f,R=u*g-h*f,w=u*v-m*f,M=d*g-h*p,y=d*v-m*p,C=h*v-m*g;let O=_*C-T*y+x*M+E*w-b*R+A*S;return O?(O=1/O,e[0]=(s*C-l*y+c*M)*O,e[1]=(l*w-a*C-c*R)*O,e[2]=(a*y-s*w+c*S)*O,e[3]=(o*y-i*C-n*M)*O,e[4]=(r*C-o*w+n*R)*O,e[5]=(i*w-r*y-n*S)*O,e[6]=(p*A-g*b+v*E)*O,e[7]=(g*x-f*A-v*T)*O,e[8]=(f*b-p*x+v*_)*O,e):null}function d(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function h(e){const t=(0,i.g)(),r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8];return Math.abs(1-(r*r+a*a+c*c))<=t&&Math.abs(1-(o*o+s*s+u*u))<=t&&Math.abs(1-(n*n+l*l+d*d))<=t}const m=c,f=d;Object.freeze(Object.defineProperty({__proto__:null,add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},adjoint:l,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},determinant:function(e){const t=e[0],r=e[1],i=e[2],o=e[3],n=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*(c*n-a*l)+r*(-c*o+a*s)+i*(l*o-n*s)},equals:function(e,t){const r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=t[0],m=t[1],f=t[2],p=t[3],g=t[4],v=t[5],_=t[6],T=t[7],x=t[8],E=(0,i.g)();return Math.abs(r-h)<=E*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(o-m)<=E*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(n-f)<=E*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(a-p)<=E*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-g)<=E*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-v)<=E*Math.max(1,Math.abs(l),Math.abs(v))&&Math.abs(c-_)<=E*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-T)<=E*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(d-x)<=E*Math.max(1,Math.abs(d),Math.abs(x))},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromMat4:o,fromQuat:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r+r,s=i+i,l=o+o,c=r*a,u=i*a,d=i*s,h=o*a,m=o*s,f=o*l,p=n*a,g=n*s,v=n*l;return e[0]=1-d-f,e[3]=u-v,e[6]=h+g,e[1]=u+v,e[4]=1-c-f,e[7]=m-p,e[2]=h-g,e[5]=m+p,e[8]=1-c-d,e},fromRotation:function(e,t){const r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},invert:s,isOrthoNormal:h,mul:m,multiply:c,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},multiplyScalarAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},normalFromMat4:u,normalFromMat4Legacy:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[4],a=t[5],s=t[6],l=t[8],c=t[9],u=t[10],d=u*a-s*c,h=-u*n+s*l,m=c*n-a*l,f=r*d+i*h+o*m;if(!f)return null;const p=1/f;return e[0]=d*p,e[1]=(-u*i+o*c)*p,e[2]=(s*i-o*a)*p,e[3]=h*p,e[4]=(u*r-o*l)*p,e[5]=(-s*r+o*n)*p,e[6]=m*p,e[7]=(-c*r+i*l)*p,e[8]=(a*r-i*n)*p,e},projection:function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},rotate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=Math.sin(r),m=Math.cos(r);return e[0]=m*i+h*a,e[1]=m*o+h*s,e[2]=m*n+h*l,e[3]=m*a-h*i,e[4]=m*s-h*o,e[5]=m*l-h*n,e[6]=c,e[7]=u,e[8]=d,e},scale:function(e,t,r){const i=r[0],o=r[1],n=r[2];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=n*t[6],e[7]=n*t[7],e[8]=n*t[8],e},scaleByVec2:function(e,t,r){const i=r[0],o=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e},set:n,str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},sub:f,subtract:d,translate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],m=r[1];return e[0]=i,e[1]=o,e[2]=n,e[3]=a,e[4]=s,e[5]=l,e[6]=h*i+m*a+c,e[7]=h*o+m*s+u,e[8]=h*n+m*l+d,e},transpose:a},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},51305:(e,t,r)=>{r.d(t,{a:()=>m,c:()=>g,g:()=>u,j:()=>y,k:()=>p,m:()=>d,s:()=>c});var i=r(46521),o=r(94961),n=r(65617),a=r(46851),s=r(17896),l=r(98766);function c(e,t,r){r*=.5;const i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function u(e,t){const r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>(0,a.g)()?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function d(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+a*s+o*c-n*l,e[1]=o*u+a*l+n*s-i*c,e[2]=n*u+a*c+i*l-o*s,e[3]=a*u-i*s-o*l-n*c,e}function h(e,t,r,i){const o=t[0],n=t[1],s=t[2],l=t[3];let c,u,d,h,m,f=r[0],p=r[1],g=r[2],v=r[3];return u=o*f+n*p+s*g+l*v,u<0&&(u=-u,f=-f,p=-p,g=-g,v=-v),1-u>(0,a.g)()?(c=Math.acos(u),d=Math.sin(c),h=Math.sin((1-i)*c)/d,m=Math.sin(i*c)/d):(h=1-i,m=i),e[0]=h*o+m*f,e[1]=h*n+m*p,e[2]=h*s+m*g,e[3]=h*l+m*v,e}function m(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function f(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const o=(r+1)%3,n=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*o+o]-t[3*n+n]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*o+n]-t[3*n+o])*i,e[o]=(t[3*o+r]+t[3*r+o])*i,e[n]=(t[3*n+r]+t[3*r+n])*i}return e}function p(e,t,r,i){const o=.5*Math.PI/180;t*=o,r*=o,i*=o;const n=Math.sin(t),a=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(i),u=Math.cos(i);return e[0]=n*l*u-a*s*c,e[1]=a*s*u+n*l*c,e[2]=a*l*c-n*s*u,e[3]=a*l*u+n*s*c,e}const g=l.c,v=l.s,_=l.a,T=d,x=l.b,E=l.d,b=l.l,A=l.f,S=A,R=l.g,w=R,M=l.n,y=l.h,C=l.e,O=(0,n.c)(),I=(0,n.f)(1,0,0),P=(0,n.f)(0,1,0),N=(0,o.a)(),L=(0,o.a)(),D=(0,i.a)();Object.freeze(Object.defineProperty({__proto__:null,add:_,calculateW:function(e,t){const r=t[0],i=t[1],o=t[2];return e[0]=r,e[1]=i,e[2]=o,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-o*o)),e},conjugate:m,copy:g,dot:E,equals:C,exactEquals:y,fromEuler:p,fromMat3:f,getAxisAngle:u,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},invert:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r*r+i*i+o*o+n*n,s=a?1/a:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-o*s,e[3]=n*s,e},len:S,length:A,lerp:b,mul:T,multiply:d,normalize:M,random:function(e){const t=a.R,r=t(),i=t(),o=t(),n=Math.sqrt(1-r),s=Math.sqrt(r);return e[0]=n*Math.sin(2*Math.PI*i),e[1]=n*Math.cos(2*Math.PI*i),e[2]=s*Math.sin(2*Math.PI*o),e[3]=s*Math.cos(2*Math.PI*o),e},rotateX:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=o*l+n*s,e[2]=n*l-o*s,e[3]=a*l-i*s,e},rotateY:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-n*s,e[1]=o*l+a*s,e[2]=n*l+i*s,e[3]=a*l-o*s,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*s,e[1]=o*l-i*s,e[2]=n*l+a*s,e[3]=a*l-n*s,e},rotationTo:function(e,t,r){const i=(0,s.j)(t,r);return i<-.999999?((0,s.b)(O,I,t),(0,s.k)(O)<1e-6&&(0,s.b)(O,P,t),(0,s.n)(O,O),c(e,O,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,s.b)(O,t,r),e[0]=O[0],e[1]=O[1],e[2]=O[2],e[3]=1+i,M(e,e))},scale:x,set:v,setAxes:function(e,t,r,i){const o=D;return o[0]=r[0],o[3]=r[1],o[6]=r[2],o[1]=i[0],o[4]=i[1],o[7]=i[2],o[2]=-t[0],o[5]=-t[1],o[8]=-t[2],M(e,f(e,o))},setAxisAngle:c,slerp:h,sqlerp:function(e,t,r,i,o,n){return h(N,t,o,n),h(L,r,i,n),h(e,N,L,2*n*(1-n)),e},sqrLen:w,squaredLength:R,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>u,Z:()=>c,c:()=>i,f:()=>o});const c=n(),u=a(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>u,e:()=>l,n:()=>d,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[4],d=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],v=r[13],_=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+u*i+m*a+g,e[x+1]=l*r+d*i+f*a+v,e[x+2]=c*r+h*i+p*a+_,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[3],d=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,v=0;for(let r=0;r<a;r++){const r=t[g],i=t[g+1],a=t[g+2];e[v]=s*r+u*i+m*a,e[v+1]=l*r+d*i+f*a,e[v+2]=c*r+h*i+p*a,g+=n,v+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function u(e,t){d(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function d(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:d,normalizeView:u,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(20102);let o=class{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 i.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),a=/^\s*\d+\s*$/;if(!r?.match||!a.test(r))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n?.match||!a.test(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new o(s,l,t)}}},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(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,{XO:()=>i,pJ:()=>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]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>u,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.g)(e.origin),vector:(0,a.g)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.f)(r.vector,t,e),r}function u(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,u=(0,n.f)(s.WM.get(),t,c),d=(0,n.j)(l,u)/(0,n.m)(l);return(0,n.i)(a,l,(0,i.uZ)(d,0,1)),(0,n.g)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},670:(e,t,r)=>{r.d(t,{fetch:()=>kt});var i=r(32243),o=r(21787),n=r(46521),a=r(52138),s=r(13598),l=r(17896),c=r(65617),u=r(60437),d=r(1533);function h(e,t=!1){return e<=d.c8?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),v=r(56067),_=r(75488),T=r(40270),x=r(91695),E=r(91911),b=r(15317),A=r(14682),S=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,n=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,a,s),(0,o.m)(l,n,l),l}class w{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 w,this.numberOfVertices=0}}var y=r(3172),C=r(66643),O=r(43090),I=r(20102),P=r(92604);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 i=this._outer.get(e);i?i.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)))}}var L=r(95330),D=r(23670),F=r(24882);async function H(e,t){const{data:r}=await(0,y.Z)(e,{responseType:"image",...t});return r}var B=r(51417),G=r(47026),U=r(22631),z=r(80442),V=r(32448),W=r(70586),j=r(17452),q=r(85958),k=r(99880);let X;var $,Y;(Y=$||($={}))[Y.ETC1_RGB=0]="ETC1_RGB",Y[Y.ETC2_RGBA=1]="ETC2_RGBA",Y[Y.BC1_RGB=2]="BC1_RGB",Y[Y.BC3_RGBA=3]="BC3_RGBA",Y[Y.BC4_R=4]="BC4_R",Y[Y.BC5_RG=5]="BC5_RG",Y[Y.BC7_M6_RGB=6]="BC7_M6_RGB",Y[Y.BC7_M5_RGBA=7]="BC7_M5_RGBA",Y[Y.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Y[Y.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Y[Y.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Y[Y.ATC_RGB=11]="ATC_RGB",Y[Y.ATC_RGBA=12]="ATC_RGBA",Y[Y.FXT1_RGB=17]="FXT1_RGB",Y[Y.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Y[Y.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Y[Y.ETC2_EAC_R11=20]="ETC2_EAC_R11",Y[Y.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Y[Y.RGBA32=13]="RGBA32",Y[Y.RGB565=14]="RGB565",Y[Y.BGR565=15]="BGR565",Y[Y.RGBA4444=16]="RGBA4444";var J=r(35371),Z=r(57088),K=r(45762);let Q=null,ee=null;async function te(){return null==ee&&(ee=function(){if(null==X){const e=e=>(0,k.V)(`esri/libs/basisu/${e}`);X=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return X}(),Q=await ee),ee}function re(e,t,r,i,o){const n=(0,K.RG)(t?J.q_.COMPRESSED_RGBA8_ETC2_EAC:J.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ne(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[$.ETC2_RGBA,J.q_.COMPRESSED_RGBA8_ETC2_EAC]:[$.ETC1_RGB,J.q_.COMPRESSED_RGB8_ETC2]:c?i?[$.BC3_RGBA,J.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[$.BC1_RGB,J.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[$.RGBA32,J.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,u))),s(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.LINEAR,t.width=o,t.height=n,new Z.x(e,t,{type:"compressed",levels:m})}var ae=r(17662),se=r(4726);const le=P.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function ce(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ue=ce("DXT1"),de=ce("DXT3"),he=ce("DXT5");function me(e){if(e instanceof ImageData)return me(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.Z("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e));let t=e.width*e.height;if(t>=4096){let r=e.width,i=e.height;do{r=Math.ceil(r/2),i=Math.ceil(i/2),t=r*i}while(t>1048576);const o=document.createElement("canvas");return o.width=r,o.height=i,o.getContext("2d").drawImage(e,0,0,r,i),o}return e}var fe,pe,ge=r(11726),ve=r(47859);class _e extends ae.c{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=se.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new V.Z,this._parameters={...xe,...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,j.jc)(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,j.HK)(e.src)||(0,j.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new ve.X;return t.wrapMode=this._parameters.wrap??J.e8.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.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?.gpuMemoryUsage||function(e,t){if(null==e)return 0;if((0,d.eP)(e)||(0,d.lq)(e))return t.encoding===G.Ti.KTX2_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.KTX2File(new Uint8Array(e)),i=oe(r)?re(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===G.Ti.BASIS_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.BasisFile(new Uint8Array(e)),i=ie(r)?re(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Te(e):t;return(t.mipmap?4/3:1)*r*i*(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 Z.x(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,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.DDS_ENCODING?this._loadFromDDSData(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.BASIS_ENCODING?this._loadFromBasis(e,t):(0,d.lq)(t)?this._loadFromPixelData(e,t):(0,d.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<fe.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return le.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return le.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case ue:o=8,n=J.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case de:o=16,n=J.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case he:o=16,n=J.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return le.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(le.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let d,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)*o,d=new Uint8Array(e,m,h),f.push(d),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:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new Z.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const o=ne(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.BasisFile(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=ne(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,ge.hu)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?J.VI.LUMINANCE:3===this._parameters.components?J.VI.RGB:J.VI.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new Z.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await H(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,q.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=fe.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,W.hw)(l)},a=()=>{t.readyState>=fe.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,t)))},s=e=>{n(),o(e||new I.Z("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_loadFromImage(e,t){let r=t;this._parameters.downsampleUncompressed&&(r instanceof ImageData||r instanceof HTMLImageElement||r instanceof HTMLCanvasElement)&&(r=me(r));const i=Te(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?J.VI.RGB:J.VI.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new Z.x(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,W.M2)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function Te(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(pe=fe||(fe={}))[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 xe={wrap:{s:J.e8.REPEAT,t:J.e8.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Ee=r(35065),be=r(64822),Ae=r(65576),Se=r(55039),Re=r(60624),we=r(19419),Me=r(85504),ye=r(60537),Ce=r(82791),Oe=r(93144),Ie=r(27097);const Pe=(0,Ie.wK)(J.zi.SRC_ALPHA,J.zi.ONE,J.zi.ONE_MINUS_SRC_ALPHA,J.zi.ONE_MINUS_SRC_ALPHA),Ne=(0,Ie.if)(J.zi.ONE,J.zi.ONE),Le=(0,Ie.if)(J.zi.ZERO,J.zi.ONE_MINUS_SRC_ALPHA);function De(e){return e===Oe.A.FrontFace?null:e===Oe.A.Alpha?Le:Ne}const Fe={factor:-1,units:-2};function He(e,t=J.wb.LESS){return e===Oe.A.NONE||e===Oe.A.FrontFace?t:J.wb.LEQUAL}var Be=r(97995),Ge=r(8310),Ue=r(87951);const ze=new class{constructor(e=0){this.offset=e,this.sphere=(0,Ge.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,l.s)(Ve,e,t,r),n=(0,l.e)(o,o,i),a=this.offset/(0,l.l)(n);(0,l.q)(n,n,n,a);const s=this.objectTransform.inverse;return(0,l.e)(this.tmpVertex,n,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,l.l)(e);(0,l.q)(e,e,e,r);const i=this.offset/(0,l.l)(t);(0,l.q)(t,t,t,i)}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,l.l)(e),r=this.offset/t;return(0,l.q)(this.sphere,e,e,r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,Ge.c)(),this._obb=(0,Ue.Ue)(),this._totalOffset=0,this._offset=0,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,l.l)(e)}applyToVertex(e,t,r){const i=(0,l.s)(Ve,e,t,r),o=(0,l.s)(We,e,t,r+this.componentLocalOriginLength),n=this._totalOffset/(0,l.l)(o);return(0,l.q)(this._tmpVertex,i,o,n),this._tmpVertex}applyToAabb(e){const t=(0,l.s)(Ve,e[0],e[1],e[2]+this.componentLocalOriginLength),r=(0,l.s)(We,e[3],e[4],e[5]+this.componentLocalOriginLength),i=(0,l.z)(je,t),o=(0,l.z)(qe,r),n=(0,l.w)(ke,t),a=(0,l.w)(Xe,r),s=(0,l.x)($e,n,a);s[0]=i[0]*o[0]<0?0:s[0],s[1]=i[1]*o[1]<0?0:s[1],s[2]=i[2]*o[2]<0?0:s[2];const c=(0,l.l)(s);if(c<this._totalOffset)return e[0]-=t[0]<0?this._totalOffset:0,e[1]-=t[1]<0?this._totalOffset:0,e[2]-=t[2]<0?this._totalOffset:0,e[3]+=r[0]>0?this._totalOffset:0,e[4]+=r[1]>0?this._totalOffset:0,e[5]+=r[2]>0?this._totalOffset:0,e;const u=(0,l.D)($e,n,a),d=(0,l.l)(u),h=this._totalOffset/d,m=this._totalOffset/c;return e[0]+=t[0]*(t[0]>0?h:m),e[1]+=t[1]*(t[1]>0?h:m),e[2]+=t[2]*(t[2]>0?h:m),e[3]+=r[0]*(r[0]<0?h:m),e[4]+=r[1]*(r[1]<0?h:m),e[5]+=r[2]*(r[2]<0?h:m),e}applyToMbs(e){const t=(0,l.l)(e),r=this._totalOffset/t;return(0,l.q)(this._mbs,e,e,r),this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){return(0,Ue.gI)(e,this._totalOffset,this._totalOffset,be.JY.Global,this._obb),this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=(0,l.s)(Ve,e,t,r),o=(0,l.g)(We,i,this.localOrigin),n=this.offset/(0,l.l)(o);return(0,l.q)(this.tmpVertex,i,o,n),this.tmpVertex}applyToAabb(e){const t=je,r=qe,i=ke;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[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 o=0;o<3;++o)i[o]=0==(e&1<<o)?t[o]:r[o];n(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0==(a&e)){for(let o=0;o<3;++o)i[o]=0!=(a&1<<o)?0:0!=(e&1<<o)?t[o]:r[o];n(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ve=(0,c.c)(),We=(0,c.c)(),je=(0,c.c)(),qe=(0,c.c)(),ke=(0,c.c)(),Xe=(0,c.c)(),$e=(0,c.c)();function Ye(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length;r*=a;for(let e=0;e<s;++e){const t=2*o[e];n[r]=i[t],n[r+1]=i[t+1],r+=a}}function Je(e,t,r,i){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,null==i||1===i)for(let e=0;e<l;++e){const t=3*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}}function Ze(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}}function Ke(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function Qe(e,t,r,i,o,n){switch(e){case Ee.T.POSITION:{(0,ge.hu)(3===t.size);const i=o.getField(e,m.ct);(0,ge.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o=1){if(!t)return void Je(e,r,i,o);const{data:n,indices:s}=e,l=r.typedBuffer,c=r.typedBufferStride,u=s.length,d=t[0],h=t[1],m=t[2],f=t[4],p=t[5],g=t[6],v=t[8],_=t[9],T=t[10],x=t[12],E=t[13],b=t[14];i*=c;let A=0,S=0,R=0;const w=(0,a.y)(t)?e=>{A=n[e]+x,S=n[e+1]+E,R=n[e+2]+b}:e=>{const t=n[e],r=n[e+1],i=n[e+2];A=d*t+f*r+v*i+x,S=h*t+p*r+_*i+E,R=m*t+g*r+T*i+b};if(1===o)for(let e=0;e<u;++e)w(3*s[e]),l[i]=A,l[i+1]=S,l[i+2]=R,i+=c;else for(let e=0;e<u;++e){w(3*s[e]);for(let e=0;e<o;++e)l[i]=A,l[i+1]=S,l[i+2]=R,i+=c}}(t,r,i,n);break}case Ee.T.NORMAL:{(0,ge.hu)(3===t.size);const r=o.getField(e,m.ct);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void Je(e,r,i,o);const{data:n,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=l[0],m=l[1],f=l[2],p=l[4],g=l[5],v=l[6],_=l[8],T=l[9],x=l[10],E=!(0,a.z)(l),b=1e-6,A=1-b;i*=u;let S=0,R=0,w=0;const M=(0,a.y)(l)?e=>{S=n[e],R=n[e+1],w=n[e+2]}:e=>{const t=n[e],r=n[e+1],i=n[e+2];S=h*t+p*r+_*i,R=m*t+g*r+T*i,w=f*t+v*r+x*i};if(1===o)if(E)for(let e=0;e<d;++e){M(3*s[e]);const t=S*S+R*R+w*w;if(t<A&&t>b){const e=1/Math.sqrt(t);c[i]=S*e,c[i+1]=R*e,c[i+2]=w*e}else c[i]=S,c[i+1]=R,c[i+2]=w;i+=u}else for(let e=0;e<d;++e)M(3*s[e]),c[i]=S,c[i+1]=R,c[i+2]=w,i+=u;else for(let e=0;e<d;++e){if(M(3*s[e]),E){const e=S*S+R*R+w*w;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=R,c[i+2]=w,i+=u}}(t,i,r,n);break}case Ee.T.NORMALCOMPRESSED:{(0,ge.hu)(2===t.size);const r=o.getField(e,m.or);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&Ye(t,r,n);break}case Ee.T.UV0:{(0,ge.hu)(2===t.size);const r=o.getField(e,m.Eu);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&Ye(t,r,n);break}case Ee.T.COLOR:case Ee.T.SYMBOLCOLOR:{const r=o.getField(e,m.mc);(0,ge.hu)(!!r,`No buffer view for ${e}`),(0,ge.hu)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,i,o=1){const{data:n,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t!==n.length||4!==t)if(1!==o)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=l}}else{s[i]=n[0],s[i+1]=n[1],s[i+2]=n[2],s[i+3]=n[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const u=c*o;for(let r=1;r<u;++r)e[i]=a,i+=t}}(t,t.size,r,n);break}case Ee.T.COLORFEATUREATTRIBUTE:{const r=o.getField(e,m.ly);(0,ge.hu)(!!r,`No buffer view for ${e}`),(0,ge.hu)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length,l=i[0];r*=a;for(let e=0;e<s;++e)n[r]=l,r+=a}(t,r,n);break}case Ee.T.TANGENT:{(0,ge.hu)(4===t.size);const r=o.getField(e,m.ek);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void Ze(e,r,i,o);const{data:n,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=l[0],m=l[1],f=l[2],p=l[4],g=l[5],v=l[6],_=l[8],T=l[9],x=l[10],E=!(0,a.z)(l),b=1e-6,A=1-b;if(i*=u,1===o)for(let e=0;e<d;++e){const t=4*s[e],r=n[t],o=n[t+1],a=n[t+2],l=n[t+3];let d=h*r+p*o+_*a,S=m*r+g*o+T*a,R=f*r+v*o+x*a;if(E){const e=d*d+S*S+R*R;if(e<A&&e>b){const t=1/Math.sqrt(e);d*=t,S*=t,R*=t}}c[i]=d,c[i+1]=S,c[i+2]=R,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){const t=4*s[e],r=n[t],a=n[t+1],l=n[t+2],d=n[t+3];let S=h*r+p*a+_*l,R=m*r+g*a+T*l,w=f*r+v*a+x*l;if(E){const e=S*S+R*R+w*w;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=R,c[i+2]=w,c[i+3]=d,i+=u}}(t,i,r,n);break}case Ee.T.PROFILERIGHT:case Ee.T.PROFILEUP:case Ee.T.PROFILEVERTEXANDNORMAL:case Ee.T.FEATUREVALUE:{(0,ge.hu)(4===t.size);const r=o.getField(e,m.ek);(0,ge.hu)(!!r,`No buffer view for ${e}`),r&&Ze(t,r,n)}}}class et{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(Ee.T.POSITION).indices.length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.attributes.get(a),s=t?.indices;if(t&&s)Qe(a,t,r,i,o,n);else if(a===Ee.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(Ee.T.POSITION)?.indices;if(t){const r=t.length,i=o.getField(a,m.mc);Ke(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var tt=r(57790),rt=r(88669),it=r(135),ot=r(15719),nt=r(96310),at=r(78869),st=r(14589),lt=r(83475),ct=r(59377);J.wb.LESS,J.wb.ALWAYS;const ut={mask:255},dt={function:{func:J.wb.ALWAYS,ref:G.hU.OutlineVisualElementMask,mask:G.hU.OutlineVisualElementMask},operation:{fail:J.xS.KEEP,zFail:J.xS.KEEP,zPass:J.xS.ZERO}},ht={function:{func:J.wb.ALWAYS,ref:G.hU.OutlineVisualElementMask,mask:G.hU.OutlineVisualElementMask},operation:{fail:J.xS.KEEP,zFail:J.xS.KEEP,zPass:J.xS.REPLACE}};J.wb.EQUAL,G.hU.OutlineVisualElementMask,G.hU.OutlineVisualElementMask,J.xS.KEEP,J.xS.KEEP,J.xS.KEEP,J.wb.NOTEQUAL,G.hU.OutlineVisualElementMask,G.hU.OutlineVisualElementMask,J.xS.KEEP,J.xS.KEEP,J.xS.KEEP;const mt=[1,1,.5],ft=[0,.6,.2],pt=[0,1,.2];var gt=r(32078);class vt extends ot.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.e)(mt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=G.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Re.r.Attribute,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,rt.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),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=G.Gv.Less,this.textureAlphaMode=G.JJ.Blend,this.textureAlphaCutoff=nt.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ce.yD.Occlude,this.isDecoration=!1}}class _t extends st.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===be.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?it.N.Default:it.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,_t.shader)}_initializeProgram(e,t){return new ct.$(e.rctx,t.get().build(this.configuration),lt.i)}_convertDepthTestFunction(e){return e===G.Gv.Lequal?J.wb.LEQUAL:J.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===Oe.A.NONE,o=e===Oe.A.FrontFace;return(0,Ie.sm)({blending:r.output!==Se.H.Color&&r.output!==Se.H.Alpha||!r.transparent?null:i?Pe:De(e),culling:Tt(r)?(0,Ie.zp)(r.cullFace):null,depthTest:{func:He(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ie.LZ:null,colorWrite:Ie.BK,stencilWrite:r.hasOccludees?ut:null,stencilTest:r.hasOccludees?t?ht:dt:null,polygonOffset:i||o?null:(n=r.enableOffset,n?Fe: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 Tt(e){return e.cullFace!==G.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}_t.shader=new at.J(gt.D,(()=>r.e(9291).then(r.bind(r,79291))));var xt=r(43697),Et=r(51354),bt=r(47624),At=r(67498);class St extends bt.PO{}(0,xt._)([(0,Et.o)({constValue:!0})],St.prototype,"hasSliceHighlight",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],St.prototype,"hasSliceInVertexProgram",void 0),(0,xt._)([(0,Et.o)({constValue:At.P.Pass})],St.prototype,"pbrTextureBindType",void 0);class Rt extends St{constructor(){super(...arguments),this.output=Se.H.Color,this.alphaDiscardMode=G.JJ.Opaque,this.doubleSidedMode=we.q.None,this.pbrMode=Me.f7.Disabled,this.cullFace=G.Vr.None,this.transparencyPassType=Oe.A.NONE,this.normalType=Re.r.Attribute,this.textureCoordinateType=it.N.None,this.customDepthTest=G.Gv.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,xt._)([(0,Et.o)({count:Se.H.COUNT})],Rt.prototype,"output",void 0),(0,xt._)([(0,Et.o)({count:G.JJ.COUNT})],Rt.prototype,"alphaDiscardMode",void 0),(0,xt._)([(0,Et.o)({count:we.q.COUNT})],Rt.prototype,"doubleSidedMode",void 0),(0,xt._)([(0,Et.o)({count:Me.f7.COUNT})],Rt.prototype,"pbrMode",void 0),(0,xt._)([(0,Et.o)({count:G.Vr.COUNT})],Rt.prototype,"cullFace",void 0),(0,xt._)([(0,Et.o)({count:Oe.A.COUNT})],Rt.prototype,"transparencyPassType",void 0),(0,xt._)([(0,Et.o)({count:Re.r.COUNT})],Rt.prototype,"normalType",void 0),(0,xt._)([(0,Et.o)({count:it.N.COUNT})],Rt.prototype,"textureCoordinateType",void 0),(0,xt._)([(0,Et.o)({count:G.Gv.COUNT})],Rt.prototype,"customDepthTest",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"spherical",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasVertexColors",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasSymbolColors",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasVerticalOffset",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasSlicePlane",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasSliceHighlight",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasColorTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasMetallicRoughnessTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasEmissionTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasOcclusionTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasNormalTexture",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasScreenSizePerspective",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasVertexTangents",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasOccludees",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"multipassEnabled",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasModelTransformation",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"offsetBackfaces",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"vvSize",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"vvColor",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"receiveShadows",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"receiveAmbientOcclusion",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"textureAlphaPremultiplied",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"instanced",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"instancedColor",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"instancedDoublePrecision",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"writeDepth",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"transparent",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"enableOffset",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"cullAboveGround",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"snowCover",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasColorTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasEmissionTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasNormalTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasOcclusionTextureTransform",void 0),(0,xt._)([(0,Et.o)()],Rt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],Rt.prototype,"occlusionPass",void 0),(0,xt._)([(0,Et.o)({constValue:!0})],Rt.prototype,"hasVvInstancing",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],Rt.prototype,"useCustomDTRExponentForWater",void 0),(0,xt._)([(0,Et.o)({constValue:!1})],Rt.prototype,"supportsTextureAtlas",void 0),(0,xt._)([(0,Et.o)({constValue:!0})],Rt.prototype,"useFillLights",void 0);var wt=r(41846);class Mt extends _t{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Re.r.Attribute,t.doubleSidedMode=we.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Mt.shader)}}Mt.shader=new at.J(wt.R,(()=>r.e(8096).then(r.bind(r,38096))));class yt extends Ce.F5{constructor(e){super(e,Ot),this.supportsEdges=!0,this._configuration=new Rt,this._vertexBufferLayout=function(e){const t=(0,Ae.U$)().vec3f(Ee.T.POSITION);return e.normalType===Re.r.Compressed?t.vec2i16(Ee.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(Ee.T.NORMAL),e.hasVertexTangents&&t.vec4f(Ee.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(Ee.T.UV0),e.hasVertexColors&&t.vec4u8(Ee.T.COLOR),e.hasSymbolColors&&t.vec4u8(Ee.T.SYMBOLCOLOR),(0,z.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(Ee.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Se.H.Shadow&&e!==Se.H.ShadowExcludeHighlight&&e!==Se.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}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?G.Vr.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Se.H.Color&&e!==Se.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=we.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?we.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?we.q.WindingOrder:we.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.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?Me.f7.Schematic:Me.f7.Normal:Me.f7.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,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(Ft,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case be.JY.Global:n=(0,l.n)(Lt,Ft);break;case be.JY.Local:n=(0,l.c)(Lt,Nt)}let a=0;const s=(0,l.f)(Ht,Ft,e.eye),c=(0,l.l)(s),u=(0,l.i)(s,s,1/c);let d=null;this.parameters.screenSizePerspective&&(d=(0,l.j)(n,u)),a+=(0,tt.Hx)(e,c,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective),(0,l.i)(n,n,a),(0,l.t)(Dt,n,r.transform.inverseRotation),i=(0,l.f)(It,i,Dt),o=(0,l.f)(Pt,o,Dt)}var a;(0,tt.Bw)(e,r,i,o,null!=(a=r.verticalOffset)?(ze.offset=a,ze):null,n)}produces(e,t){return!(t!==Se.H.Color&&t!==Se.H.Alpha&&t!==Se.H.Depth&&t!==Se.H.Normal&&t!==Se.H.Shadow&&t!==Se.H.ShadowHighlight&&t!==Se.H.ShadowExcludeHighlight&&t!==Se.H.Highlight&&t!==Se.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Be.r.TRANSPARENT_MATERIAL:Be.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Be.r.OPAQUE_MATERIAL)&&e!==Be.r.DRAPED_MATERIAL)}createGLMaterial(e){return new Ct(e)}createBufferWriter(){return new et(this._vertexBufferLayout)}}class Ct extends ye.F{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!==Se.H.Color&&this._output!==Se.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?Mt:_t,e)}}const Ot=new class extends vt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},It=(0,c.c)(),Pt=(0,c.c)(),Nt=(0,c.f)(0,0,1),Lt=(0,c.c)(),Dt=(0,c.c)(),Ft=(0,c.c)(),Ht=(0,c.c)(),Bt=P.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Gt(e){throw new I.Z("",`Request for object resource failed: ${e}`)}function Ut(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Bt.warn("Geometry must specify vertex attributes"),i=!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&&(Bt.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Bt.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Bt.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Bt.warn("Indexed geometries must specify faces"),i=!1;break}default:Bt.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Bt.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Bt.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function zt(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.pp)(t,r.bbMin),(0,u.pp)(t,r.bbMax))})),t}function Vt(e){switch(e){case"mask":return G.JJ.Mask;case"maskAndTransparency":return G.JJ.MaskBlend;case"none":return G.JJ.Opaque;default:return G.JJ.Blend}}function Wt(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const jt=new D.G(1,2,"wosr");var qt=r(57758);async function kt(e,t){const r=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,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.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 i=await(0,C.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Gt(i.error.details.url)}(e,r,t);const i=await(0,C.q6)((0,y.Z)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Gt(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],n=o.images[0].data;if(!n){Bt.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:J.e8.REPEAT,t:J.e8.REPEAT},preMultiplyAlpha:Vt(l)!==G.JJ.Opaque},u=null!=t&&t.disableTextures?Promise.resolve(null):H(a,t);r.push(u.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,O.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new N,a=e.resource,s=D.G.parse(a.version||"1.0","wosr");jt.validate(s);const l=a.model.name,u=a.model.geometries,d=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<u.length;e++){const a=u[e];if(!Ut(a))continue;const s=Wt(a),l=a.params.vertexAttributes,p=[],g=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},v=l[Ee.T.POSITION],_=v.values.length/v.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=g(e)??(0,F.KF)(_);p.push([e,new B.a(r,i,t.valuesPerElement,!0)])}const T=s.texture,x=h&&h[T];if(x&&!f.has(T)){const{image:e,parameters:t}=x,r=new _e(e,t);i.push(r),f.set(T,r)}const E=f.get(T),b=E?E.id:void 0,A=s.material;let S=n.get(A,T);if(null==S){const e=d[A.substring(A.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=x&&x.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=x?Vt(x.alphaChannelUsage):void 0,a={ambient:(0,c.e)(e.diffuse),diffuse:(0,c.e)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:b,initTextureTransparent:!0,doubleSided:!0,cullFace:G.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:x?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(a,t.materialParameters),S=new yt(a),n.set(A,T,S)}o.push(S);const R=new U.Z(S,p);m+=p.find((e=>e[0]===Ee.T.POSITION))?.[1]?.indices.length??0,r.push(R)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:zt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),d=n.model.meta?.ESRI_proxyEllipsoid,A=n.meta.isEsriSymbolResource&&null!=d&&n.meta.uri.includes("/RealisticTrees/");A&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,u=n.count,d=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*u),g=new Float64Array(3*u),v=(0,a.i)((0,s.a)(),o.transform);let _=0,T=0;for(let a=0;a<u;a++){n.getVec(a,h),i.getVec(a,d),(0,l.e)(h,h,o.transform),(0,l.f)(f,h,t.center),(0,l.B)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),u=Math.min(.45+.55*c*c,1);(0,l.B)(f,f,t.radius),null!==v&&(0,l.e)(f,f,v),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.p)(f,f,d,s>-1?.2:Math.min(-4*s-3.8,1)),g[_]=f[0],g[_+1]=f[1],g[_+2]=f[2],_+=3,p[T]=255*u,p[T+1]=255*u,p[T+2]=255*u,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(n,d));const S=!!t.usePBR,w=n.meta.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:A,mrrFactors:[...pt]}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:[...mt]},I={...t.materialParameters,treeRendering:A},{engineResources:P,referenceBoundingBox:z}=function(e,t,r,i){const n=e.model,a=new Array,s=new Map,d=new Map,T=n.lods.length,x=(0,u.cS)();return n.lods.forEach(((e,A)=>{const S=!0===i.skipHighLods&&(T>1&&0===A||T>3&&1===A)||!1===i.skipHighLods&&null!=i.singleLodIndex&&A!==i.singleLodIndex;if(S&&0!==A)return;const w=new M(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=S?new yt({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),d=null!=t.attributes.texCoord0,h=null!=t.attributes.normal;if(null==u)return null;const m=function(e){switch(e){case"BLEND":return G.JJ.Blend;case"MASK":return G.JJ.Mask;case"OPAQUE":case null:case void 0:return G.JJ.Opaque}}(u.alphaMode);if(!n.has(s)){if(d){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new _e((0,b.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,b.$A)(e)&&r,encoding:(0,b.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,m!==G.JJ.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/qt.j),f=u.color[1]**(1/qt.j),p=u.color[2]**(1/qt.j),g=u.emissiveFactor[0]**(1/qt.j),v=u.emissiveFactor[1]**(1/qt.j),_=u.emissiveFactor[2]**(1/qt.j),T=null!=u.textureColor&&d?a.get(u.textureColor):null,x=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==o&&(null==n||(0,l.h)(n,c.Z))&&null==a&&(null==i||1===i)&&(null==r||1===r||0===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion});n.set(s,new yt({...i,transparent:m===G.JJ.Blend,customDepthTest:G.Gv.Lequal,textureAlphaMode:m,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,p],ambient:[r,f,p],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?G.Vr.None:G.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?Re.r.Attribute:Re.r.ScreenDerivative,castShadows:!0,textureId:null!=T?T.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&d?a.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&d?a.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&d?a.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&d?a.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,v,_],mrrFactors:x?[...ft]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:x,colorTextureTransformMatrix:R(u.colorTextureTransform),normalTextureTransformMatrix:R(u.normalTextureTransform),occlusionTextureTransformMatrix:R(u.occlusionTextureTransform),emissiveTextureTransformMatrix:R(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(u.metallicRoughnessTextureTransform),...o}))}const f=n.get(s);if(r.stageResources.materials.push(f),d){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(n,e,w,t,r,s,d),{geometry:a,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.p)(e.indices||r,e.primitiveType),n=h(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,f.t)(n,a,e.transform,3,s);const l=[[Ee.T.POSITION,new B.a(n,i,3,!0)]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.n)(Xt,e.transform),(0,f.a)(t,n,Xt,3,a),l.push([Ee.T.NORMAL,new B.a(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.n)(Xt,e.transform),(0,p.t)(t,n,Xt,4,a),l.push([Ee.T.TANGENT,new B.a(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([Ee.T.UV0,new B.a(t,i,2,!0)])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([Ee.T.COLOR,new B.a(t,i,4,!0)])}return{geometry:new U.Z(t,l),vertexCount:r}}(e,null!=i?i:new yt({})),M=a.boundingInfo;null!=M&&0===A&&((0,u.pp)(x,M.bbMin),(0,u.pp)(x,M.bbMax)),null!=i&&(w.stageResources.geometries.push(a),w.numberOfVertices+=T)})),S||a.push(w)})),{engineResources:a,referenceBoundingBox:x}}(n,w,I,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:P,referenceBoundingBox:z,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const Xt=(0,n.a)()},6206:(e,t,r)=>{var i,o;r.d(t,{a9:()=>i}),r(22021),(o=i||(i={}))[o.Multiply=1]="Multiply",o[o.Ignore=2]="Ignore",o[o.Replace=3]="Replace",o[o.Tint=4]="Tint"},87951:(e,t,r)=>{r.d(t,{Ue:()=>u,gI:()=>d}),r(21787);var i=r(46521),o=r(51305),n=r(94961),a=r(17896),s=r(65617),l=(r(98766),r(88669)),c=(r(60437),r(62073),r(64822));function u(e=[0,0,0],t=[-1,-1,-1],r=(0,n.a)()){return{center:(0,s.g)(e),halfSize:(0,s.g)(t),quaternion:(0,n.b)(r)}}function d(e,t,r,i,n){if((0,o.c)(n.quaternion,e.quaternion),i===c.JY.Global){(0,o.a)(p,e.quaternion),(0,a.v)(h,e.center,p),(0,a.w)(m,h),(0,a.x)(f,m,e.halfSize),(0,a.u)(f,m,f);const i=(0,a.l)(f);(0,a.g)(f,m,e.halfSize);const s=(0,a.l)(f);if(i<r)(0,a.c)(n.center,e.center),(0,a.s)(h,r,r,r),(0,a.g)(n.halfSize,e.halfSize,h);else{const o=s>0?1+t/s:1,l=i>0?1+r/i:1,c=(l+o)/2,u=(l-o)/2;(0,a.i)(n.halfSize,m,u),(0,a.q)(n.halfSize,n.halfSize,e.halfSize,c),(0,a.i)(n.center,m,c),(0,a.q)(n.center,n.center,e.halfSize,u),(0,a.z)(h,h),(0,a.A)(n.center,n.center,h),(0,a.v)(n.center,n.center,n.quaternion)}}else{const i=(0,a.s)(h,0,0,1);(0,a.q)(n.center,e.center,i,(r+t)/2),(0,o.a)(p,e.quaternion),(0,a.v)(i,i,p),(0,a.w)(i,i),(0,a.q)(n.halfSize,e.halfSize,i,(r-t)/2)}return n}(0,n.a)(),(0,s.c)(),(0,s.c)(),(0,l.c)(),(0,i.a)(),(()=>{const e=new Int8Array(162);let t=0;const r=r=>{for(let i=0;i<r.length;i++)e[t+i]=r[i];t+=6};r([6,2,3,1,5,4]),r([0,2,3,1,5,4]),r([0,2,3,7,5,4]),r([0,1,3,2,6,4]),r([0,1,3,2,0,0]),r([0,1,5,7,3,2]),r([0,1,3,7,6,4]),r([0,1,3,7,6,2]),r([0,1,5,7,6,2]),r([0,1,5,4,6,2]),r([0,1,5,4,0,0]),r([0,1,3,7,5,4]),r([0,2,6,4,0,0]),r([0,0,0,0,0,0]),r([1,3,7,5,0,0]),r([2,3,7,6,4,0]),r([2,3,7,6,0,0]),r([2,3,1,5,7,6]),r([0,1,5,7,6,2]),r([0,1,5,7,6,4]),r([0,1,3,7,6,4]),r([4,5,7,6,2,0]),r([4,5,7,6,0,0]),r([4,5,1,3,7,6]),r([0,2,3,7,5,4]),r([6,2,3,7,5,4]),r([6,2,3,1,5,4])})();const h=(0,s.c)(),m=(0,s.c)(),f=(0,s.c)(),p=(0,n.a)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>u});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
285
+ `),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},21787:(e,t,r)=>{r.d(t,{a:()=>l,d:()=>s,f:()=>o,i:()=>h,m:()=>c,n:()=>u,s:()=>n,t:()=>a});var i=r(46851);function o(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function n(e,t,r,i,o,n,a,s,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=o,e[4]=n,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e}function a(e,t){if(e===t){const r=t[1],i=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=o}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function s(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=u*a-s*c,h=-u*n+s*l,m=c*n-a*l;let f=r*d+i*h+o*m;return f?(f=1/f,e[0]=d*f,e[1]=(-u*i+o*c)*f,e[2]=(s*i-o*a)*f,e[3]=h*f,e[4]=(u*r-o*l)*f,e[5]=(-s*r+o*n)*f,e[6]=m*f,e[7]=(-c*r+i*l)*f,e[8]=(a*r-i*n)*f,e):null}function l(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=a*u-s*c,e[1]=o*c-i*u,e[2]=i*s-o*a,e[3]=s*l-n*u,e[4]=r*u-o*l,e[5]=o*n-r*s,e[6]=n*c-a*l,e[7]=i*l-r*c,e[8]=r*a-i*n,e}function c(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],m=r[1],f=r[2],p=r[3],g=r[4],v=r[5],_=r[6],T=r[7],x=r[8];return e[0]=h*i+m*a+f*c,e[1]=h*o+m*s+f*u,e[2]=h*n+m*l+f*d,e[3]=p*i+g*a+v*c,e[4]=p*o+g*s+v*u,e[5]=p*n+g*l+v*d,e[6]=_*i+T*a+x*c,e[7]=_*o+T*s+x*u,e[8]=_*n+T*l+x*d,e}function u(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],m=t[11],f=t[12],p=t[13],g=t[14],v=t[15],_=r*s-i*a,T=r*l-o*a,x=r*c-n*a,E=i*l-o*s,b=i*c-n*s,A=o*c-n*l,S=u*p-d*f,R=u*g-h*f,w=u*v-m*f,M=d*g-h*p,y=d*v-m*p,C=h*v-m*g;let O=_*C-T*y+x*M+E*w-b*R+A*S;return O?(O=1/O,e[0]=(s*C-l*y+c*M)*O,e[1]=(l*w-a*C-c*R)*O,e[2]=(a*y-s*w+c*S)*O,e[3]=(o*y-i*C-n*M)*O,e[4]=(r*C-o*w+n*R)*O,e[5]=(i*w-r*y-n*S)*O,e[6]=(p*A-g*b+v*E)*O,e[7]=(g*x-f*A-v*T)*O,e[8]=(f*b-p*x+v*_)*O,e):null}function d(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function h(e){const t=(0,i.g)(),r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8];return Math.abs(1-(r*r+a*a+c*c))<=t&&Math.abs(1-(o*o+s*s+u*u))<=t&&Math.abs(1-(n*n+l*l+d*d))<=t}const m=c,f=d;Object.freeze(Object.defineProperty({__proto__:null,add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},adjoint:l,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},determinant:function(e){const t=e[0],r=e[1],i=e[2],o=e[3],n=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*(c*n-a*l)+r*(-c*o+a*s)+i*(l*o-n*s)},equals:function(e,t){const r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],d=e[8],h=t[0],m=t[1],f=t[2],p=t[3],g=t[4],v=t[5],_=t[6],T=t[7],x=t[8],E=(0,i.g)();return Math.abs(r-h)<=E*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(o-m)<=E*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(n-f)<=E*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(a-p)<=E*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-g)<=E*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-v)<=E*Math.max(1,Math.abs(l),Math.abs(v))&&Math.abs(c-_)<=E*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-T)<=E*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(d-x)<=E*Math.max(1,Math.abs(d),Math.abs(x))},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromMat4:o,fromQuat:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r+r,s=i+i,l=o+o,c=r*a,u=i*a,d=i*s,h=o*a,m=o*s,f=o*l,p=n*a,g=n*s,v=n*l;return e[0]=1-d-f,e[3]=u-v,e[6]=h+g,e[1]=u+v,e[4]=1-c-f,e[7]=m-p,e[2]=h-g,e[5]=m+p,e[8]=1-c-d,e},fromRotation:function(e,t){const r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},invert:s,isOrthoNormal:h,mul:m,multiply:c,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},multiplyScalarAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},normalFromMat4:u,normalFromMat4Legacy:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[4],a=t[5],s=t[6],l=t[8],c=t[9],u=t[10],d=u*a-s*c,h=-u*n+s*l,m=c*n-a*l,f=r*d+i*h+o*m;if(!f)return null;const p=1/f;return e[0]=d*p,e[1]=(-u*i+o*c)*p,e[2]=(s*i-o*a)*p,e[3]=h*p,e[4]=(u*r-o*l)*p,e[5]=(-s*r+o*n)*p,e[6]=m*p,e[7]=(-c*r+i*l)*p,e[8]=(a*r-i*n)*p,e},projection:function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},rotate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=Math.sin(r),m=Math.cos(r);return e[0]=m*i+h*a,e[1]=m*o+h*s,e[2]=m*n+h*l,e[3]=m*a-h*i,e[4]=m*s-h*o,e[5]=m*l-h*n,e[6]=c,e[7]=u,e[8]=d,e},scale:function(e,t,r){const i=r[0],o=r[1],n=r[2];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=n*t[6],e[7]=n*t[7],e[8]=n*t[8],e},scaleByVec2:function(e,t,r){const i=r[0],o=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e},set:n,str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},sub:f,subtract:d,translate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=r[0],m=r[1];return e[0]=i,e[1]=o,e[2]=n,e[3]=a,e[4]=s,e[5]=l,e[6]=h*i+m*a+c,e[7]=h*o+m*s+u,e[8]=h*n+m*l+d,e},transpose:a},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},51305:(e,t,r)=>{r.d(t,{a:()=>m,c:()=>g,g:()=>u,j:()=>y,k:()=>p,m:()=>d,s:()=>c});var i=r(46521),o=r(94961),n=r(65617),a=r(46851),s=r(17896),l=r(98766);function c(e,t,r){r*=.5;const i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function u(e,t){const r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>(0,a.g)()?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function d(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=r[0],l=r[1],c=r[2],u=r[3];return e[0]=i*u+a*s+o*c-n*l,e[1]=o*u+a*l+n*s-i*c,e[2]=n*u+a*c+i*l-o*s,e[3]=a*u-i*s-o*l-n*c,e}function h(e,t,r,i){const o=t[0],n=t[1],s=t[2],l=t[3];let c,u,d,h,m,f=r[0],p=r[1],g=r[2],v=r[3];return u=o*f+n*p+s*g+l*v,u<0&&(u=-u,f=-f,p=-p,g=-g,v=-v),1-u>(0,a.g)()?(c=Math.acos(u),d=Math.sin(c),h=Math.sin((1-i)*c)/d,m=Math.sin(i*c)/d):(h=1-i,m=i),e[0]=h*o+m*f,e[1]=h*n+m*p,e[2]=h*s+m*g,e[3]=h*l+m*v,e}function m(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function f(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const o=(r+1)%3,n=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*o+o]-t[3*n+n]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*o+n]-t[3*n+o])*i,e[o]=(t[3*o+r]+t[3*r+o])*i,e[n]=(t[3*n+r]+t[3*r+n])*i}return e}function p(e,t,r,i){const o=.5*Math.PI/180;t*=o,r*=o,i*=o;const n=Math.sin(t),a=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(i),u=Math.cos(i);return e[0]=n*l*u-a*s*c,e[1]=a*s*u+n*l*c,e[2]=a*l*c-n*s*u,e[3]=a*l*u+n*s*c,e}const g=l.c,v=l.s,_=l.a,T=d,x=l.b,E=l.d,b=l.l,A=l.f,S=A,R=l.g,w=R,M=l.n,y=l.h,C=l.e,O=(0,n.c)(),I=(0,n.f)(1,0,0),P=(0,n.f)(0,1,0),N=(0,o.a)(),L=(0,o.a)(),D=(0,i.a)();Object.freeze(Object.defineProperty({__proto__:null,add:_,calculateW:function(e,t){const r=t[0],i=t[1],o=t[2];return e[0]=r,e[1]=i,e[2]=o,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-o*o)),e},conjugate:m,copy:g,dot:E,equals:C,exactEquals:y,fromEuler:p,fromMat3:f,getAxisAngle:u,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},invert:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r*r+i*i+o*o+n*n,s=a?1/a:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-o*s,e[3]=n*s,e},len:S,length:A,lerp:b,mul:T,multiply:d,normalize:M,random:function(e){const t=a.R,r=t(),i=t(),o=t(),n=Math.sqrt(1-r),s=Math.sqrt(r);return e[0]=n*Math.sin(2*Math.PI*i),e[1]=n*Math.cos(2*Math.PI*i),e[2]=s*Math.sin(2*Math.PI*o),e[3]=s*Math.cos(2*Math.PI*o),e},rotateX:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=o*l+n*s,e[2]=n*l-o*s,e[3]=a*l-i*s,e},rotateY:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-n*s,e[1]=o*l+a*s,e[2]=n*l+i*s,e[3]=a*l-o*s,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*s,e[1]=o*l-i*s,e[2]=n*l+a*s,e[3]=a*l-n*s,e},rotationTo:function(e,t,r){const i=(0,s.j)(t,r);return i<-.999999?((0,s.b)(O,I,t),(0,s.k)(O)<1e-6&&(0,s.b)(O,P,t),(0,s.n)(O,O),c(e,O,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,s.b)(O,t,r),e[0]=O[0],e[1]=O[1],e[2]=O[2],e[3]=1+i,M(e,e))},scale:x,set:v,setAxes:function(e,t,r,i){const o=D;return o[0]=r[0],o[3]=r[1],o[6]=r[2],o[1]=i[0],o[4]=i[1],o[7]=i[2],o[2]=-t[0],o[5]=-t[1],o[8]=-t[2],M(e,f(e,o))},setAxisAngle:c,slerp:h,sqlerp:function(e,t,r,i,o,n){return h(N,t,o,n),h(L,r,i,n),h(e,N,L,2*n*(1-n)),e},sqrLen:w,squaredLength:R,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>u,Z:()=>c,c:()=>i,f:()=>o});const c=n(),u=a(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>u,e:()=>l,n:()=>d,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[4],d=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],v=r[13],_=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+u*i+m*a+g,e[x+1]=l*r+d*i+f*a+v,e[x+2]=c*r+h*i+p*a+_,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[3],d=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,v=0;for(let r=0;r<a;r++){const r=t[g],i=t[g+1],a=t[g+2];e[v]=s*r+u*i+m*a,e[v+1]=l*r+d*i+f*a,e[v+2]=c*r+h*i+p*a,g+=n,v+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function u(e,t){d(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function d(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:d,normalizeView:u,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(20102);let o=class{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 i.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),a=/^\s*\d+\s*$/;if(!r?.match||!a.test(r))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n?.match||!a.test(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new o(s,l,t)}}},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(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,{XO:()=>i,pJ:()=>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]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>u,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.g)(e.origin),vector:(0,a.g)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.f)(r.vector,t,e),r}function u(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,u=(0,n.f)(s.WM.get(),t,c),d=(0,n.j)(l,u)/(0,n.m)(l);return(0,n.i)(a,l,(0,i.uZ)(d,0,1)),(0,n.g)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},670:(e,t,r)=>{r.d(t,{fetch:()=>Xt});var i=r(32243),o=r(21787),n=r(46521),a=r(52138),s=r(13598),l=r(17896),c=r(65617),u=r(60437),d=r(1533);function h(e,t=!1){return e<=d.c8?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),v=r(56067),_=r(75488),T=r(40270),x=r(91695),E=r(91911),b=r(15317),A=r(14682),S=r(1265);function R(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,n=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,a,s),(0,o.m)(l,n,l),l}class w{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 w,this.numberOfVertices=0}}var y=r(3172),C=r(66643),O=r(43090),I=r(20102),P=r(92604);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 i=this._outer.get(e);i?i.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)))}}var L=r(95330),D=r(23670),F=r(24882);async function H(e,t){const{data:r}=await(0,y.Z)(e,{responseType:"image",...t});return r}var B=r(51417),G=r(47026),U=r(22631),z=r(80442),V=r(32448),W=r(70586),j=r(17452),q=r(85958),k=r(99880);let X;var $,Y;(Y=$||($={}))[Y.ETC1_RGB=0]="ETC1_RGB",Y[Y.ETC2_RGBA=1]="ETC2_RGBA",Y[Y.BC1_RGB=2]="BC1_RGB",Y[Y.BC3_RGBA=3]="BC3_RGBA",Y[Y.BC4_R=4]="BC4_R",Y[Y.BC5_RG=5]="BC5_RG",Y[Y.BC7_M6_RGB=6]="BC7_M6_RGB",Y[Y.BC7_M5_RGBA=7]="BC7_M5_RGBA",Y[Y.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Y[Y.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Y[Y.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Y[Y.ATC_RGB=11]="ATC_RGB",Y[Y.ATC_RGBA=12]="ATC_RGBA",Y[Y.FXT1_RGB=17]="FXT1_RGB",Y[Y.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Y[Y.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Y[Y.ETC2_EAC_R11=20]="ETC2_EAC_R11",Y[Y.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Y[Y.RGBA32=13]="RGBA32",Y[Y.RGB565=14]="RGB565",Y[Y.BGR565=15]="BGR565",Y[Y.RGBA4444=16]="RGBA4444";var J=r(35371),Z=r(57088),K=r(45762);let Q=null,ee=null;async function te(){return null==ee&&(ee=function(){if(null==X){const e=e=>(0,k.V)(`esri/libs/basisu/${e}`);X=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return X}(),Q=await ee),ee}function re(e,t,r,i,o){const n=(0,K.RG)(t?J.q_.COMPRESSED_RGBA8_ETC2_EAC:J.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ne(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[$.ETC2_RGBA,J.q_.COMPRESSED_RGBA8_ETC2_EAC]:[$.ETC1_RGB,J.q_.COMPRESSED_RGB8_ETC2]:c?i?[$.BC3_RGBA,J.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[$.BC1_RGB,J.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[$.RGBA32,J.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,u))),s(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.LINEAR,t.width=o,t.height=n,new Z.x(e,t,{type:"compressed",levels:m})}var ae=r(17662),se=r(4726);const le=P.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function ce(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ue=ce("DXT1"),de=ce("DXT3"),he=ce("DXT5");function me(e,t,r){if(e instanceof ImageData)return me(fe(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function fe(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.Z("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var pe,ge,ve=r(11726),_e=r(47859);class Te extends ae.c{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=se.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new V.Z,this._parameters={...Ee,...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,j.jc)(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,j.HK)(e.src)||(0,j.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new _e.X;return t.wrapMode=this._parameters.wrap??J.e8.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.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?.gpuMemoryUsage||function(e,t){if(null==e)return 0;if((0,d.eP)(e)||(0,d.lq)(e))return t.encoding===G.Ti.KTX2_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.KTX2File(new Uint8Array(e)),i=oe(r)?re(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===G.Ti.BASIS_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.BasisFile(new Uint8Array(e)),i=ie(r)?re(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?xe(e):t;return(t.mipmap?4/3:1)*r*i*(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 Z.x(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,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.DDS_ENCODING?this._loadFromDDSData(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this._parameters.encoding===G.Ti.BASIS_ENCODING?this._loadFromBasis(e,t):(0,d.lq)(t)?this._loadFromPixelData(e,t):(0,d.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<pe.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return le.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return le.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case ue:o=8,n=J.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case de:o=16,n=J.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case he:o=16,n=J.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return le.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(le.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let d,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)*o,d=new Uint8Array(e,m,h),f.push(d),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:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?J.cw.LINEAR_MIPMAP_LINEAR:J.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new Z.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const o=ne(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.BasisFile(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=ne(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,ve.hu)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?J.VI.LUMINANCE:3===this._parameters.components?J.VI.RGB:J.VI.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new Z.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await H(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,q.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=pe.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,W.hw)(l)},a=()=>{t.readyState>=pe.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,t)))},s=e=>{n(),o(e||new I.Z("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_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?fe(e):e;let i=e.width,o=e.height;do{i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o}while(r>1048576||null!=t&&(i>t||o>t));return me(e,i,o)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return me(e,Math.round(e.width*i),Math.round(e.height*i))}(r,t)}const i=xe(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?J.VI.RGB:J.VI.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new Z.x(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,W.M2)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function xe(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(ge=pe||(pe={}))[ge.HAVE_NOTHING=0]="HAVE_NOTHING",ge[ge.HAVE_METADATA=1]="HAVE_METADATA",ge[ge.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",ge[ge.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",ge[ge.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Ee={wrap:{s:J.e8.REPEAT,t:J.e8.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var be=r(35065),Ae=r(64822),Se=r(65576),Re=r(55039),we=r(60624),Me=r(19419),ye=r(85504),Ce=r(60537),Oe=r(82791),Ie=r(93144),Pe=r(27097);const Ne=(0,Pe.wK)(J.zi.SRC_ALPHA,J.zi.ONE,J.zi.ONE_MINUS_SRC_ALPHA,J.zi.ONE_MINUS_SRC_ALPHA),Le=(0,Pe.if)(J.zi.ONE,J.zi.ONE),De=(0,Pe.if)(J.zi.ZERO,J.zi.ONE_MINUS_SRC_ALPHA);function Fe(e){return e===Ie.A.FrontFace?null:e===Ie.A.Alpha?De:Le}const He={factor:-1,units:-2};function Be(e,t=J.wb.LESS){return e===Ie.A.NONE||e===Ie.A.FrontFace?t:J.wb.LEQUAL}var Ge=r(97995),Ue=r(8310),ze=r(87951);const Ve=new class{constructor(e=0){this.offset=e,this.sphere=(0,Ue.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,l.s)(We,e,t,r),n=(0,l.e)(o,o,i),a=this.offset/(0,l.l)(n);(0,l.q)(n,n,n,a);const s=this.objectTransform.inverse;return(0,l.e)(this.tmpVertex,n,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,l.l)(e);(0,l.q)(e,e,e,r);const i=this.offset/(0,l.l)(t);(0,l.q)(t,t,t,i)}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,l.l)(e),r=this.offset/t;return(0,l.q)(this.sphere,e,e,r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,Ue.c)(),this._obb=(0,ze.Ue)(),this._totalOffset=0,this._offset=0,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,l.l)(e)}applyToVertex(e,t,r){const i=(0,l.s)(We,e,t,r),o=(0,l.s)(je,e,t,r+this.componentLocalOriginLength),n=this._totalOffset/(0,l.l)(o);return(0,l.q)(this._tmpVertex,i,o,n),this._tmpVertex}applyToAabb(e){const t=(0,l.s)(We,e[0],e[1],e[2]+this.componentLocalOriginLength),r=(0,l.s)(je,e[3],e[4],e[5]+this.componentLocalOriginLength),i=(0,l.z)(qe,t),o=(0,l.z)(ke,r),n=(0,l.w)(Xe,t),a=(0,l.w)($e,r),s=(0,l.x)(Ye,n,a);s[0]=i[0]*o[0]<0?0:s[0],s[1]=i[1]*o[1]<0?0:s[1],s[2]=i[2]*o[2]<0?0:s[2];const c=(0,l.l)(s);if(c<this._totalOffset)return e[0]-=t[0]<0?this._totalOffset:0,e[1]-=t[1]<0?this._totalOffset:0,e[2]-=t[2]<0?this._totalOffset:0,e[3]+=r[0]>0?this._totalOffset:0,e[4]+=r[1]>0?this._totalOffset:0,e[5]+=r[2]>0?this._totalOffset:0,e;const u=(0,l.D)(Ye,n,a),d=(0,l.l)(u),h=this._totalOffset/d,m=this._totalOffset/c;return e[0]+=t[0]*(t[0]>0?h:m),e[1]+=t[1]*(t[1]>0?h:m),e[2]+=t[2]*(t[2]>0?h:m),e[3]+=r[0]*(r[0]<0?h:m),e[4]+=r[1]*(r[1]<0?h:m),e[5]+=r[2]*(r[2]<0?h:m),e}applyToMbs(e){const t=(0,l.l)(e),r=this._totalOffset/t;return(0,l.q)(this._mbs,e,e,r),this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){return(0,ze.gI)(e,this._totalOffset,this._totalOffset,Ae.JY.Global,this._obb),this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=(0,l.s)(We,e,t,r),o=(0,l.g)(je,i,this.localOrigin),n=this.offset/(0,l.l)(o);return(0,l.q)(this.tmpVertex,i,o,n),this.tmpVertex}applyToAabb(e){const t=qe,r=ke,i=Xe;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[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 o=0;o<3;++o)i[o]=0==(e&1<<o)?t[o]:r[o];n(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0==(a&e)){for(let o=0;o<3;++o)i[o]=0!=(a&1<<o)?0:0!=(e&1<<o)?t[o]:r[o];n(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const We=(0,c.c)(),je=(0,c.c)(),qe=(0,c.c)(),ke=(0,c.c)(),Xe=(0,c.c)(),$e=(0,c.c)(),Ye=(0,c.c)();function Je(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length;r*=a;for(let e=0;e<s;++e){const t=2*o[e];n[r]=i[t],n[r+1]=i[t+1],r+=a}}function Ze(e,t,r,i){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,null==i||1===i)for(let e=0;e<l;++e){const t=3*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}}function Ke(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}}function Qe(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function et(e,t,r,i,o,n){switch(e){case be.T.POSITION:{(0,ve.hu)(3===t.size);const i=o.getField(e,m.ct);(0,ve.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o=1){if(!t)return void Ze(e,r,i,o);const{data:n,indices:s}=e,l=r.typedBuffer,c=r.typedBufferStride,u=s.length,d=t[0],h=t[1],m=t[2],f=t[4],p=t[5],g=t[6],v=t[8],_=t[9],T=t[10],x=t[12],E=t[13],b=t[14];i*=c;let A=0,S=0,R=0;const w=(0,a.y)(t)?e=>{A=n[e]+x,S=n[e+1]+E,R=n[e+2]+b}:e=>{const t=n[e],r=n[e+1],i=n[e+2];A=d*t+f*r+v*i+x,S=h*t+p*r+_*i+E,R=m*t+g*r+T*i+b};if(1===o)for(let e=0;e<u;++e)w(3*s[e]),l[i]=A,l[i+1]=S,l[i+2]=R,i+=c;else for(let e=0;e<u;++e){w(3*s[e]);for(let e=0;e<o;++e)l[i]=A,l[i+1]=S,l[i+2]=R,i+=c}}(t,r,i,n);break}case be.T.NORMAL:{(0,ve.hu)(3===t.size);const r=o.getField(e,m.ct);(0,ve.hu)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void Ze(e,r,i,o);const{data:n,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=l[0],m=l[1],f=l[2],p=l[4],g=l[5],v=l[6],_=l[8],T=l[9],x=l[10],E=!(0,a.z)(l),b=1e-6,A=1-b;i*=u;let S=0,R=0,w=0;const M=(0,a.y)(l)?e=>{S=n[e],R=n[e+1],w=n[e+2]}:e=>{const t=n[e],r=n[e+1],i=n[e+2];S=h*t+p*r+_*i,R=m*t+g*r+T*i,w=f*t+v*r+x*i};if(1===o)if(E)for(let e=0;e<d;++e){M(3*s[e]);const t=S*S+R*R+w*w;if(t<A&&t>b){const e=1/Math.sqrt(t);c[i]=S*e,c[i+1]=R*e,c[i+2]=w*e}else c[i]=S,c[i+1]=R,c[i+2]=w;i+=u}else for(let e=0;e<d;++e)M(3*s[e]),c[i]=S,c[i+1]=R,c[i+2]=w,i+=u;else for(let e=0;e<d;++e){if(M(3*s[e]),E){const e=S*S+R*R+w*w;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=R,c[i+2]=w,i+=u}}(t,i,r,n);break}case be.T.NORMALCOMPRESSED:{(0,ve.hu)(2===t.size);const r=o.getField(e,m.or);(0,ve.hu)(!!r,`No buffer view for ${e}`),r&&Je(t,r,n);break}case be.T.UV0:{(0,ve.hu)(2===t.size);const r=o.getField(e,m.Eu);(0,ve.hu)(!!r,`No buffer view for ${e}`),r&&Je(t,r,n);break}case be.T.COLOR:case be.T.SYMBOLCOLOR:{const r=o.getField(e,m.mc);(0,ve.hu)(!!r,`No buffer view for ${e}`),(0,ve.hu)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,i,o=1){const{data:n,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t!==n.length||4!==t)if(1!==o)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=l}}else{s[i]=n[0],s[i+1]=n[1],s[i+2]=n[2],s[i+3]=n[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const u=c*o;for(let r=1;r<u;++r)e[i]=a,i+=t}}(t,t.size,r,n);break}case be.T.COLORFEATUREATTRIBUTE:{const r=o.getField(e,m.ly);(0,ve.hu)(!!r,`No buffer view for ${e}`),(0,ve.hu)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length,l=i[0];r*=a;for(let e=0;e<s;++e)n[r]=l,r+=a}(t,r,n);break}case be.T.TANGENT:{(0,ve.hu)(4===t.size);const r=o.getField(e,m.ek);(0,ve.hu)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void Ke(e,r,i,o);const{data:n,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=l[0],m=l[1],f=l[2],p=l[4],g=l[5],v=l[6],_=l[8],T=l[9],x=l[10],E=!(0,a.z)(l),b=1e-6,A=1-b;if(i*=u,1===o)for(let e=0;e<d;++e){const t=4*s[e],r=n[t],o=n[t+1],a=n[t+2],l=n[t+3];let d=h*r+p*o+_*a,S=m*r+g*o+T*a,R=f*r+v*o+x*a;if(E){const e=d*d+S*S+R*R;if(e<A&&e>b){const t=1/Math.sqrt(e);d*=t,S*=t,R*=t}}c[i]=d,c[i+1]=S,c[i+2]=R,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){const t=4*s[e],r=n[t],a=n[t+1],l=n[t+2],d=n[t+3];let S=h*r+p*a+_*l,R=m*r+g*a+T*l,w=f*r+v*a+x*l;if(E){const e=S*S+R*R+w*w;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,R*=t,w*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=R,c[i+2]=w,c[i+3]=d,i+=u}}(t,i,r,n);break}case be.T.PROFILERIGHT:case be.T.PROFILEUP:case be.T.PROFILEVERTEXANDNORMAL:case be.T.FEATUREVALUE:{(0,ve.hu)(4===t.size);const r=o.getField(e,m.ek);(0,ve.hu)(!!r,`No buffer view for ${e}`),r&&Ke(t,r,n)}}}class tt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(be.T.POSITION).indices.length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.attributes.get(a),s=t?.indices;if(t&&s)et(a,t,r,i,o,n);else if(a===be.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(be.T.POSITION)?.indices;if(t){const r=t.length,i=o.getField(a,m.mc);Qe(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var rt=r(57790),it=r(88669),ot=r(135),nt=r(15719),at=r(96310),st=r(78869),lt=r(14589),ct=r(83475),ut=r(59377);J.wb.LESS,J.wb.ALWAYS;const dt={mask:255},ht={function:{func:J.wb.ALWAYS,ref:G.hU.OutlineVisualElementMask,mask:G.hU.OutlineVisualElementMask},operation:{fail:J.xS.KEEP,zFail:J.xS.KEEP,zPass:J.xS.ZERO}},mt={function:{func:J.wb.ALWAYS,ref:G.hU.OutlineVisualElementMask,mask:G.hU.OutlineVisualElementMask},operation:{fail:J.xS.KEEP,zFail:J.xS.KEEP,zPass:J.xS.REPLACE}};J.wb.EQUAL,G.hU.OutlineVisualElementMask,G.hU.OutlineVisualElementMask,J.xS.KEEP,J.xS.KEEP,J.xS.KEEP,J.wb.NOTEQUAL,G.hU.OutlineVisualElementMask,G.hU.OutlineVisualElementMask,J.xS.KEEP,J.xS.KEEP,J.xS.KEEP;const ft=[1,1,.5],pt=[0,.6,.2],gt=[0,1,.2];var vt=r(32078);class _t extends nt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.e)(ft),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=G.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=we.r.Attribute,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,it.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),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=G.Gv.Less,this.textureAlphaMode=G.JJ.Blend,this.textureAlphaCutoff=at.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Oe.yD.Occlude,this.isDecoration=!1}}class Tt extends lt.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===Ae.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?ot.N.Default:ot.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Tt.shader)}_initializeProgram(e,t){return new ut.$(e.rctx,t.get().build(this.configuration),ct.i)}_convertDepthTestFunction(e){return e===G.Gv.Lequal?J.wb.LEQUAL:J.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===Ie.A.NONE,o=e===Ie.A.FrontFace;return(0,Pe.sm)({blending:r.output!==Re.H.Color&&r.output!==Re.H.Alpha||!r.transparent?null:i?Ne:Fe(e),culling:xt(r)?(0,Pe.zp)(r.cullFace):null,depthTest:{func:Be(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Pe.LZ:null,colorWrite:Pe.BK,stencilWrite:r.hasOccludees?dt:null,stencilTest:r.hasOccludees?t?mt:ht:null,polygonOffset:i||o?null:(n=r.enableOffset,n?He: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 xt(e){return e.cullFace!==G.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Tt.shader=new st.J(vt.D,(()=>r.e(9291).then(r.bind(r,79291))));var Et=r(43697),bt=r(51354),At=r(47624),St=r(67498);class Rt extends At.PO{}(0,Et._)([(0,bt.o)({constValue:!0})],Rt.prototype,"hasSliceHighlight",void 0),(0,Et._)([(0,bt.o)({constValue:!1})],Rt.prototype,"hasSliceInVertexProgram",void 0),(0,Et._)([(0,bt.o)({constValue:St.P.Pass})],Rt.prototype,"pbrTextureBindType",void 0);class wt extends Rt{constructor(){super(...arguments),this.output=Re.H.Color,this.alphaDiscardMode=G.JJ.Opaque,this.doubleSidedMode=Me.q.None,this.pbrMode=ye.f7.Disabled,this.cullFace=G.Vr.None,this.transparencyPassType=Ie.A.NONE,this.normalType=we.r.Attribute,this.textureCoordinateType=ot.N.None,this.customDepthTest=G.Gv.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,Et._)([(0,bt.o)({count:Re.H.COUNT})],wt.prototype,"output",void 0),(0,Et._)([(0,bt.o)({count:G.JJ.COUNT})],wt.prototype,"alphaDiscardMode",void 0),(0,Et._)([(0,bt.o)({count:Me.q.COUNT})],wt.prototype,"doubleSidedMode",void 0),(0,Et._)([(0,bt.o)({count:ye.f7.COUNT})],wt.prototype,"pbrMode",void 0),(0,Et._)([(0,bt.o)({count:G.Vr.COUNT})],wt.prototype,"cullFace",void 0),(0,Et._)([(0,bt.o)({count:Ie.A.COUNT})],wt.prototype,"transparencyPassType",void 0),(0,Et._)([(0,bt.o)({count:we.r.COUNT})],wt.prototype,"normalType",void 0),(0,Et._)([(0,bt.o)({count:ot.N.COUNT})],wt.prototype,"textureCoordinateType",void 0),(0,Et._)([(0,bt.o)({count:G.Gv.COUNT})],wt.prototype,"customDepthTest",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"spherical",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasVertexColors",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasSymbolColors",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasVerticalOffset",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasSlicePlane",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasSliceHighlight",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasColorTexture",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasMetallicRoughnessTexture",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasEmissionTexture",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasOcclusionTexture",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasNormalTexture",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasScreenSizePerspective",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasVertexTangents",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasOccludees",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"multipassEnabled",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasModelTransformation",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"offsetBackfaces",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"vvSize",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"vvColor",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"receiveShadows",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"receiveAmbientOcclusion",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"textureAlphaPremultiplied",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"instanced",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"instancedColor",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"instancedDoublePrecision",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"writeDepth",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"transparent",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"enableOffset",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"cullAboveGround",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"snowCover",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasColorTextureTransform",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasEmissionTextureTransform",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasNormalTextureTransform",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasOcclusionTextureTransform",void 0),(0,Et._)([(0,bt.o)()],wt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Et._)([(0,bt.o)({constValue:!1})],wt.prototype,"occlusionPass",void 0),(0,Et._)([(0,bt.o)({constValue:!0})],wt.prototype,"hasVvInstancing",void 0),(0,Et._)([(0,bt.o)({constValue:!1})],wt.prototype,"useCustomDTRExponentForWater",void 0),(0,Et._)([(0,bt.o)({constValue:!1})],wt.prototype,"supportsTextureAtlas",void 0),(0,Et._)([(0,bt.o)({constValue:!0})],wt.prototype,"useFillLights",void 0);var Mt=r(41846);class yt extends Tt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=we.r.Attribute,t.doubleSidedMode=Me.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,yt.shader)}}yt.shader=new st.J(Mt.R,(()=>r.e(8096).then(r.bind(r,38096))));class Ct extends Oe.F5{constructor(e){super(e,It),this.supportsEdges=!0,this._configuration=new wt,this._vertexBufferLayout=function(e){const t=(0,Se.U$)().vec3f(be.T.POSITION);return e.normalType===we.r.Compressed?t.vec2i16(be.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(be.T.NORMAL),e.hasVertexTangents&&t.vec4f(be.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(be.T.UV0),e.hasVertexColors&&t.vec4u8(be.T.COLOR),e.hasSymbolColors&&t.vec4u8(be.T.SYMBOLCOLOR),(0,z.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(be.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Re.H.Shadow&&e!==Re.H.ShadowExcludeHighlight&&e!==Re.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}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?G.Vr.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Re.H.Color&&e!==Re.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Me.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Me.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Me.q.WindingOrder:Me.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.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?ye.f7.Schematic:ye.f7.Normal:ye.f7.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,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(Ht,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case Ae.JY.Global:n=(0,l.n)(Dt,Ht);break;case Ae.JY.Local:n=(0,l.c)(Dt,Lt)}let a=0;const s=(0,l.f)(Bt,Ht,e.eye),c=(0,l.l)(s),u=(0,l.i)(s,s,1/c);let d=null;this.parameters.screenSizePerspective&&(d=(0,l.j)(n,u)),a+=(0,rt.Hx)(e,c,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective),(0,l.i)(n,n,a),(0,l.t)(Ft,n,r.transform.inverseRotation),i=(0,l.f)(Pt,i,Ft),o=(0,l.f)(Nt,o,Ft)}var a;(0,rt.Bw)(e,r,i,o,null!=(a=r.verticalOffset)?(Ve.offset=a,Ve):null,n)}produces(e,t){return!(t!==Re.H.Color&&t!==Re.H.Alpha&&t!==Re.H.Depth&&t!==Re.H.Normal&&t!==Re.H.Shadow&&t!==Re.H.ShadowHighlight&&t!==Re.H.ShadowExcludeHighlight&&t!==Re.H.Highlight&&t!==Re.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Ge.r.TRANSPARENT_MATERIAL:Ge.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Ge.r.OPAQUE_MATERIAL)&&e!==Ge.r.DRAPED_MATERIAL)}createGLMaterial(e){return new Ot(e)}createBufferWriter(){return new tt(this._vertexBufferLayout)}}class Ot extends Ce.F{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!==Re.H.Color&&this._output!==Re.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?yt:Tt,e)}}const It=new class extends _t{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Pt=(0,c.c)(),Nt=(0,c.c)(),Lt=(0,c.f)(0,0,1),Dt=(0,c.c)(),Ft=(0,c.c)(),Ht=(0,c.c)(),Bt=(0,c.c)(),Gt=P.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Ut(e){throw new I.Z("",`Request for object resource failed: ${e}`)}function zt(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Gt.warn("Geometry must specify vertex attributes"),i=!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&&(Gt.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Gt.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Gt.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Gt.warn("Indexed geometries must specify faces"),i=!1;break}default:Gt.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Gt.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Gt.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Vt(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.pp)(t,r.bbMin),(0,u.pp)(t,r.bbMax))})),t}function Wt(e){switch(e){case"mask":return G.JJ.Mask;case"maskAndTransparency":return G.JJ.MaskBlend;case"none":return G.JJ.Opaque;default:return G.JJ.Blend}}function jt(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const qt=new D.G(1,2,"wosr");var kt=r(57758);async function Xt(e,t){const r=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,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.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 i=await(0,C.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Ut(i.error.details.url)}(e,r,t);const i=await(0,C.q6)((0,y.Z)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Ut(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],n=o.images[0].data;if(!n){Gt.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:J.e8.REPEAT,t:J.e8.REPEAT},preMultiplyAlpha:Wt(l)!==G.JJ.Opaque},u=null!=t&&t.disableTextures?Promise.resolve(null):H(a,t);r.push(u.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,O.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new N,a=e.resource,s=D.G.parse(a.version||"1.0","wosr");qt.validate(s);const l=a.model.name,u=a.model.geometries,d=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<u.length;e++){const a=u[e];if(!zt(a))continue;const s=jt(a),l=a.params.vertexAttributes,p=[],g=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},v=l[be.T.POSITION],_=v.values.length/v.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=g(e)??(0,F.KF)(_);p.push([e,new B.a(r,i,t.valuesPerElement,!0)])}const T=s.texture,x=h&&h[T];if(x&&!f.has(T)){const{image:e,parameters:t}=x,r=new Te(e,t);i.push(r),f.set(T,r)}const E=f.get(T),b=E?E.id:void 0,A=s.material;let S=n.get(A,T);if(null==S){const e=d[A.substring(A.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=x&&x.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=x?Wt(x.alphaChannelUsage):void 0,a={ambient:(0,c.e)(e.diffuse),diffuse:(0,c.e)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:b,initTextureTransparent:!0,doubleSided:!0,cullFace:G.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:x?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(a,t.materialParameters),S=new Ct(a),n.set(A,T,S)}o.push(S);const R=new U.Z(S,p);m+=p.find((e=>e[0]===be.T.POSITION))?.[1]?.indices.length??0,r.push(R)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Vt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),d=n.model.meta?.ESRI_proxyEllipsoid,A=n.meta.isEsriSymbolResource&&null!=d&&n.meta.uri.includes("/RealisticTrees/");A&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,u=n.count,d=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*u),g=new Float64Array(3*u),v=(0,a.i)((0,s.a)(),o.transform);let _=0,T=0;for(let a=0;a<u;a++){n.getVec(a,h),i.getVec(a,d),(0,l.e)(h,h,o.transform),(0,l.f)(f,h,t.center),(0,l.B)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),u=Math.min(.45+.55*c*c,1);(0,l.B)(f,f,t.radius),null!==v&&(0,l.e)(f,f,v),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.p)(f,f,d,s>-1?.2:Math.min(-4*s-3.8,1)),g[_]=f[0],g[_+1]=f[1],g[_+2]=f[2],_+=3,p[T]=255*u,p[T+1]=255*u,p[T+2]=255*u,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(n,d));const S=!!t.usePBR,w=n.meta.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:A,mrrFactors:[...gt]}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:[...ft]},I={...t.materialParameters,treeRendering:A},{engineResources:P,referenceBoundingBox:z}=function(e,t,r,i){const n=e.model,a=new Array,s=new Map,d=new Map,T=n.lods.length,x=(0,u.cS)();return n.lods.forEach(((e,A)=>{const S=!0===i.skipHighLods&&(T>1&&0===A||T>3&&1===A)||!1===i.skipHighLods&&null!=i.singleLodIndex&&A!==i.singleLodIndex;if(S&&0!==A)return;const w=new M(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=S?new Ct({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),d=null!=t.attributes.texCoord0,h=null!=t.attributes.normal;if(null==u)return null;const m=function(e){switch(e){case"BLEND":return G.JJ.Blend;case"MASK":return G.JJ.Mask;case"OPAQUE":case null:case void 0:return G.JJ.Opaque}}(u.alphaMode);if(!n.has(s)){if(d){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new Te((0,b.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,b.$A)(e)&&r,encoding:(0,b.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,m!==G.JJ.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/kt.j),f=u.color[1]**(1/kt.j),p=u.color[2]**(1/kt.j),g=u.emissiveFactor[0]**(1/kt.j),v=u.emissiveFactor[1]**(1/kt.j),_=u.emissiveFactor[2]**(1/kt.j),T=null!=u.textureColor&&d?a.get(u.textureColor):null,x=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==o&&(null==n||(0,l.h)(n,c.Z))&&null==a&&(null==i||1===i)&&(null==r||1===r||0===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion});n.set(s,new Ct({...i,transparent:m===G.JJ.Blend,customDepthTest:G.Gv.Lequal,textureAlphaMode:m,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,p],ambient:[r,f,p],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?G.Vr.None:G.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?we.r.Attribute:we.r.ScreenDerivative,castShadows:!0,textureId:null!=T?T.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&d?a.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&d?a.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&d?a.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&d?a.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,v,_],mrrFactors:x?[...pt]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:x,colorTextureTransformMatrix:R(u.colorTextureTransform),normalTextureTransformMatrix:R(u.normalTextureTransform),occlusionTextureTransformMatrix:R(u.occlusionTextureTransform),emissiveTextureTransformMatrix:R(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:R(u.metallicRoughnessTextureTransform),...o}))}const f=n.get(s);if(r.stageResources.materials.push(f),d){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(n,e,w,t,r,s,d),{geometry:a,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.p)(e.indices||r,e.primitiveType),n=h(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,f.t)(n,a,e.transform,3,s);const l=[[be.T.POSITION,new B.a(n,i,3,!0)]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.n)($t,e.transform),(0,f.a)(t,n,$t,3,a),l.push([be.T.NORMAL,new B.a(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.n)($t,e.transform),(0,p.t)(t,n,$t,4,a),l.push([be.T.TANGENT,new B.a(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([be.T.UV0,new B.a(t,i,2,!0)])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([be.T.COLOR,new B.a(t,i,4,!0)])}return{geometry:new U.Z(t,l),vertexCount:r}}(e,null!=i?i:new Ct({})),M=a.boundingInfo;null!=M&&0===A&&((0,u.pp)(x,M.bbMin),(0,u.pp)(x,M.bbMax)),null!=i&&(w.stageResources.geometries.push(a),w.numberOfVertices+=T)})),S||a.push(w)})),{engineResources:a,referenceBoundingBox:x}}(n,w,I,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:P,referenceBoundingBox:z,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const $t=(0,n.a)()},6206:(e,t,r)=>{var i,o;r.d(t,{a9:()=>i}),r(22021),(o=i||(i={}))[o.Multiply=1]="Multiply",o[o.Ignore=2]="Ignore",o[o.Replace=3]="Replace",o[o.Tint=4]="Tint"},87951:(e,t,r)=>{r.d(t,{Ue:()=>u,gI:()=>d}),r(21787);var i=r(46521),o=r(51305),n=r(94961),a=r(17896),s=r(65617),l=(r(98766),r(88669)),c=(r(60437),r(62073),r(64822));function u(e=[0,0,0],t=[-1,-1,-1],r=(0,n.a)()){return{center:(0,s.g)(e),halfSize:(0,s.g)(t),quaternion:(0,n.b)(r)}}function d(e,t,r,i,n){if((0,o.c)(n.quaternion,e.quaternion),i===c.JY.Global){(0,o.a)(p,e.quaternion),(0,a.v)(h,e.center,p),(0,a.w)(m,h),(0,a.x)(f,m,e.halfSize),(0,a.u)(f,m,f);const i=(0,a.l)(f);(0,a.g)(f,m,e.halfSize);const s=(0,a.l)(f);if(i<r)(0,a.c)(n.center,e.center),(0,a.s)(h,r,r,r),(0,a.g)(n.halfSize,e.halfSize,h);else{const o=s>0?1+t/s:1,l=i>0?1+r/i:1,c=(l+o)/2,u=(l-o)/2;(0,a.i)(n.halfSize,m,u),(0,a.q)(n.halfSize,n.halfSize,e.halfSize,c),(0,a.i)(n.center,m,c),(0,a.q)(n.center,n.center,e.halfSize,u),(0,a.z)(h,h),(0,a.A)(n.center,n.center,h),(0,a.v)(n.center,n.center,n.quaternion)}}else{const i=(0,a.s)(h,0,0,1);(0,a.q)(n.center,e.center,i,(r+t)/2),(0,o.a)(p,e.quaternion),(0,a.v)(i,i,p),(0,a.w)(i,i),(0,a.q)(n.halfSize,e.halfSize,i,(r-t)/2)}return n}(0,n.a)(),(0,s.c)(),(0,s.c)(),(0,l.c)(),(0,i.a)(),(()=>{const e=new Int8Array(162);let t=0;const r=r=>{for(let i=0;i<r.length;i++)e[t+i]=r[i];t+=6};r([6,2,3,1,5,4]),r([0,2,3,1,5,4]),r([0,2,3,7,5,4]),r([0,1,3,2,6,4]),r([0,1,3,2,0,0]),r([0,1,5,7,3,2]),r([0,1,3,7,6,4]),r([0,1,3,7,6,2]),r([0,1,5,7,6,2]),r([0,1,5,4,6,2]),r([0,1,5,4,0,0]),r([0,1,3,7,5,4]),r([0,2,6,4,0,0]),r([0,0,0,0,0,0]),r([1,3,7,5,0,0]),r([2,3,7,6,4,0]),r([2,3,7,6,0,0]),r([2,3,1,5,7,6]),r([0,1,5,7,6,2]),r([0,1,5,7,6,4]),r([0,1,3,7,6,4]),r([4,5,7,6,2,0]),r([4,5,7,6,0,0]),r([4,5,1,3,7,6]),r([0,2,3,7,5,4]),r([6,2,3,7,5,4]),r([6,2,3,1,5,4])})();const h=(0,s.c)(),m=(0,s.c)(),f=(0,s.c)(),p=(0,n.a)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>u});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
286
286
  return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
287
287
  }`)}function u(e,t){const{vertex:r}=e;switch(t.output){case i.H.Color:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.H.Depth:case i.H.Shadow:case i.H.ShadowHighlight:case i.H.ShadowExcludeHighlight:return e.include(o.up,t),s(e),l(e),c(e),void r.code.add(a.H`void forwardLinearDepth() {
288
288
  linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
@@ -371,7 +371,10 @@ return proj * (view * vec4(pos, 1.0));
371
371
 
372
372
  vec3 subtractOrigin(vec3 _pos) {
373
373
  ${i?m.H`
374
- vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -instanceModelOriginHi, -instanceModelOriginLo);
374
+ // Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped
375
+ // working for macOS 14+ and iOS 17+.
376
+ // Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
377
+ vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo);
375
378
  return _pos - originDelta;`:"return vpos;"}
376
379
  }
377
380
  `),n.code.add(m.H`
@@ -620,7 +623,7 @@ return mat3(T, B, normal);
620
623
  }`),t.textureCoordinateType!==i.N.None&&(e.include(o.i,t),r.uniforms.add(t.pbrTextureBindType===c.P.Pass?new l.A("normalTexture",(e=>e.textureNormal)):new s.R("normalTexture",(e=>e.textureNormal))),r.code.add(a.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
621
624
  vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;
622
625
  return tangentSpace * rawNormal;
623
- }`))}},77813:(e,t,r)=>{r.d(t,{K:()=>he});var i=r(74709),o=r(98069),n=r(43697),a=r(70586),s=r(17445),l=r(76882),c=r(5600),u=(r(75215),r(67676)),d=(r(80442),r(52011)),h=r(4307);r(69801);var m=r(35371),f=r(92604),p=r(1533),g=r(49300),v=r(7575);const _=f.Z.getLogger("esri.views.webgl.BufferObject");class T{static createIndex(e,t,r){return new T(e,m.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new T(e,m.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==v.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new T(e,m.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=m.l1.STREAM_READ,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new T(e,m.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=m.l1.STREAM_DRAW,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new T(e,m.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(m._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,g.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER?this._indexType===m.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===m.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(m._g.BufferObject,this),this._context=null):this._glName&&_.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_.error("Buffer size needs to be positive!"),this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case m.g.UNSIGNED_SHORT:e*=2;break;case m.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&((0,p.Uc)(e)&&(t/=2,this._indexType=m.g.UNSIGNED_SHORT),(0,p.ZY)(e)&&(t/=4,this._indexType=m.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,g.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteLength)&&_.error("offset is out of range!"),r>=i&&_.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteLength&&_.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===v.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,g.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==v.zO.WEBGL2)return void _.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,u.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void _.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteLength&&_.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,m.w0.COPY_READ_BUFFER),n.getBufferSubData(m.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(m.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===v.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_.error("Get buffer subdata is supported in WebGL2 only!")}}var x=r(4375),E=r(45762);class b{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}}class A{constructor(e,t){this._context=e,this._descriptor=t,this.type=x.B.RenderBuffer,this._context.instanceCounter.increment(m._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;if(a){if(this._context.type!==v.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get gpuMemoryUsage(){return(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,E.RG)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m._g.Renderbuffer,this),this._context=null)}}var S=r(57088);const R=f.Z.getLogger("esri.views.webgl.FramebufferObject");class w{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m._g.FramebufferObject,this);const i=M(t)?t:new S.x(this._context,t);if(this._colorAttachments.set(m.VY.COLOR_ATTACHMENT0,i),this._validateTextureDescriptor(i.descriptor),this._validateColorAttachmentPoint(m.VY.COLOR_ATTACHMENT0),null!=r)if(function(e){return M(e)||null!=e&&"pixelFormat"in e}(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=M(r)?r:new S.x(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=function(e){return null!=e&&"type"in e&&e.type===x.B.RenderBuffer}(r)?r:new A(this._context,r);this._depthStencilBuffer=e,this._validateRenderBufferDescriptor(e.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach(((e,t)=>this.detachColorTexture(t)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(m._g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+r.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&M(t)?t:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,t=m.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=m.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),t}setColorTextureTarget(e,t=m.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case x.B.Texture:return this._attachDepthStencilTexture(e);case x.B.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==m.VI.DEPTH_STENCIL&&t.pixelFormat!==m.VI.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==m.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m.Lu)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m.Lu)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(m.qi.FRAMEBUFFER,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(m.qi.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;a.descriptor.target!==m.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||n+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,S.x.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(S.x.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(m.No.TEXTURE_2D,0,o,n,e,t,r,i),l.bindTexture(c,S.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==v.zO.WEBGL2)return(0,g.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=T.createPixelPack(this._context,m.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(m.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};y(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((e=>e.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(y(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=m.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach(((t,r)=>this._framebufferTexture2D(t.glName,r,C(t),e))),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,C(this._depthStencilTexture),e);(0,g.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.VY.COLOR_ATTACHMENT0,r=m.No.TEXTURE_2D,i=m.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(m.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.M2)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=(0,a.M2)(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==m.No.TEXTURE_2D&&e.target!==m.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),y(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){y(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.Tg.DEPTH_COMPONENT16:case m.Tg.DEPTH_COMPONENT24:case m.Tg.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case m.Tg.DEPTH24_STENCIL8:case m.Tg.DEPTH32F_STENCIL8:case m.Tg.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case m.Tg.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===w._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;w._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else w._MAX_COLOR_ATTACHMENTS=1}const t=e-m.VY.COLOR_ATTACHMENT0;t+1>w._MAX_COLOR_ATTACHMENTS&&f.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${w._MAX_COLOR_ATTACHMENTS} color attachments`)}}function M(e){return null!=e&&"type"in e&&e.type===x.B.Texture}function y(e,t){const r=Math.max(e.width,e.height);if(r>t){R.warn(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function C(e){return e.descriptor.target===m.No.TEXTURE_CUBE_MAP?m.No.TEXTURE_CUBE_MAP_POSITIVE_X:m.No.TEXTURE_2D}w._MAX_COLOR_ATTACHMENTS=-1;var O,I,P=r(47859);(I=O||(O={}))[I.RED=0]="RED",I[I.RG=1]="RG",I[I.RGBA4=2]="RGBA4",I[I.RGBA=3]="RGBA",I[I.RGBA_MIPMAP=4]="RGBA_MIPMAP",I[I.R16F=5]="R16F",I[I.RGBA16F=6]="RGBA16F";const N=new P.X;N.pixelFormat=m.VI.RED,N.internalFormat=m.lP.R8,N.wrapMode=m.e8.CLAMP_TO_EDGE;const L=new P.X;L.pixelFormat=m.VI.RG,L.internalFormat=m.lP.RG8,L.wrapMode=m.e8.CLAMP_TO_EDGE;const D=new P.X;D.internalFormat=m.lP.RGBA4,D.dataType=m.Br.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.e8.CLAMP_TO_EDGE;(new P.X).wrapMode=m.e8.CLAMP_TO_EDGE;const F=new P.X;F.wrapMode=m.e8.CLAMP_TO_EDGE,F.samplingMode=m.cw.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const H=new P.X;H.pixelFormat=m.VI.RED,H.dataType=m.Br.HALF_FLOAT,H.internalFormat=m.lP.R16F,H.samplingMode=m.cw.NEAREST;const B=new P.X;var G;B.dataType=m.Br.HALF_FLOAT,B.internalFormat=m.lP.RGBA16F,B.samplingMode=m.cw.NEAREST,O.RED,O.RG,O.RGBA4,O.RGBA,O.RGBA_MIPMAP,O.R16F,O.RGBA16F,function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH_STENCIL_BUFFER=1]="DEPTH_STENCIL_BUFFER",e[e.DEPTH24_BUFFER=2]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=3]="DEPTH16_BUFFER"}(G||(G={}));const U=new P.X;U.pixelFormat=m.VI.DEPTH_STENCIL,U.dataType=m.Br.UNSIGNED_INT_24_8,U.samplingMode=m.cw.NEAREST,U.wrapMode=m.e8.CLAMP_TO_EDGE,G.DEPTH_STENCIL_TEXTURE,G.DEPTH_STENCIL_BUFFER,new b(m.Tg.DEPTH24_STENCIL8,4),G.DEPTH24_BUFFER,new b(m.Tg.DEPTH_COMPONENT24,4),G.DEPTH16_BUFFER,new b(m.Tg.DEPTH_COMPONENT16,4);var z=r(92036),V=r(55039);const W={required:[]},j=(V.H.Depth,V.H.CompositeColor,V.H.Highlight,{required:[V.H.Depth,V.H.Normal]});class q extends z.Z{consumes(){return W}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}}class k extends q{}var X=r(78869),$=r(14589),Y=r(83475),J=r(59377),Z=r(59915),K=r(27097);class Q extends $.A{initializeProgram(e){return new J.$(e.rctx,Q.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}Q.shader=new X.J(Z.S,(()=>r.e(8092).then(r.bind(r,88092))));var ee=r(97323);class te extends i.K{constructor(){super(...arguments),this.projScale=1}}class re extends te{constructor(){super(...arguments),this.intensity=1}}class ie extends i.K{}class oe extends ie{constructor(){super(...arguments),this.blurSize=(0,ee.a)()}}var ne,ae=r(25377);class se extends $.A{initializeProgram(e){return new J.$(e.rctx,se.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}se.shader=new X.J(ae.S,(()=>r.e(9243).then(r.bind(r,49243)))),r(95720),function(e){e[e.Antialiasing=0]="Antialiasing",e[e.HighQualityTransparency=1]="HighQualityTransparency",e[e.HighResolutionVoxel=2]="HighResolutionVoxel",e[e.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",e[e.SSAO=4]="SSAO",e[e.WaterReflection=5]="WaterReflection",e[e.HighResolutionShadows=6]="HighResolutionShadows",e[e.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(ne||(ne={}));var le=r(97995);const ce=2;let ue=class extends k{constructor(e){super(e),this._context=null,this._passParameters=new re,this._drawParameters=new oe,this.produces=new Map([[le.r.SSAO,()=>this._produces()]])}_produces(){return null!=this._enableTime&&null!=this._context}consumes(){return this._produces()?j:W}initializeRenderContext(e){this._context=e,this.addHandles([(0,s.YP)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(ne.SSAO)),(e=>e?this._enable():this._disable()),s.tX)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,a.M2)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;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 P.X;t.wrapMode=m.e8.CLAMP_TO_EDGE,t.pixelFormat=m.VI.RGB,t.wrapMode=m.e8.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new S.x(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(se)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(Q)),this._enableTime=(0,l.HA)(0),this._context?.requestRender()}renderNode(e,t,r){const i=e.bindParameters,o=i.linearDepth?.colorTexture,n=r?.normal?.colorTexture;if(null==this._enableTime||null==this._context||null==o||!n)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,s=i.camera,l=this.view.qualitySettings.fadeDuration,c=l>0?Math.min(l,e.time-this._enableTime)/l:1;this._passParameters.normalTexture=n,this._passParameters.depthTexture=o,this._passParameters.projScale=1/s.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*de/(0,ae.g)(s)**6*c;const u=s.fullViewport[2],d=s.fullViewport[3],f=u/ce,p=d/ce,g=this._context.fbos,v=g.acquire(O.RED,u,d);a.bindFramebuffer(v.fbo),a.setViewport(0,0,u,d),a.bindTechnique(this._ssaoTechnique,this._passParameters,i).bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw();const _=a.bindTechnique(this._blurTechnique,this._passParameters,i);a.setViewport(0,0,f,p);const T=g.acquire(O.RED,f,p);a.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=v.colorTexture,(0,h.s)(this._drawParameters.blurSize,0,ce/d),_.bindDraw(this._drawParameters,i,this._passParameters),a.setViewport(0,0,f,p),a.screen.draw(),v.release();const x=g.acquire(O.RED,f,p);return a.bindFramebuffer(x.fbo),a.setViewport(0,0,u,d),a.setClearColor(1,1,1,0),a.clear(m.lk.COLOR_BUFFER_BIT),a.setViewport(0,0,f,p),this._drawParameters.colorTexture=T.colorTexture,(0,h.s)(this._drawParameters.blurSize,ce/u,0),_.bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw(),a.setViewport4fv(s.fullViewport),T.release(),c<1&&this._context.requestRender(),x}};(0,n._)([(0,c.Cb)({constructOnly:!0})],ue.prototype,"view",void 0),(0,n._)([(0,c.Cb)()],ue.prototype,"_context",void 0),ue=(0,n._)([(0,d.j)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ue);const de=.5;function he(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new o.A("ssaoTex",((e,t)=>t.ssao?.colorTexture))),r.constants.add("blurSizePixelsInverse","float",1/ce),r.code.add(i.H`float evaluateAmbientOcclusionInverse() {
626
+ }`))}},21627:(e,t,r)=>{r.d(t,{K:()=>he});var i=r(74709),o=r(98069),n=r(43697),a=r(70586),s=r(17445),l=r(76882),c=r(5600),u=(r(75215),r(67676)),d=(r(80442),r(52011)),h=r(4307);r(69801),r(44553);var m=r(35371),f=r(92604),p=r(1533),g=r(49300),v=r(7575);const _=f.Z.getLogger("esri.views.webgl.BufferObject");class T{static createIndex(e,t,r){return new T(e,m.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new T(e,m.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==v.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new T(e,m.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=m.l1.STREAM_READ,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new T(e,m.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=m.l1.STREAM_DRAW,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new T(e,m.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(m._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,g.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER?this._indexType===m.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===m.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(m._g.BufferObject,this),this._context=null):this._glName&&_.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_.error("Buffer size needs to be positive!"),this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case m.g.UNSIGNED_SHORT:e*=2;break;case m.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&((0,p.Uc)(e)&&(t/=2,this._indexType=m.g.UNSIGNED_SHORT),(0,p.ZY)(e)&&(t/=4,this._indexType=m.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,g.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteLength)&&_.error("offset is out of range!"),r>=i&&_.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteLength&&_.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===v.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,g.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==v.zO.WEBGL2)return void _.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,u.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void _.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteLength&&_.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,m.w0.COPY_READ_BUFFER),n.getBufferSubData(m.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(m.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===v.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_.error("Get buffer subdata is supported in WebGL2 only!")}}var x=r(4375),E=r(45762);class b{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}}class A{constructor(e,t){this._context=e,this._descriptor=t,this.type=x.B.RenderBuffer,this._context.instanceCounter.increment(m._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;if(a){if(this._context.type!==v.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get gpuMemoryUsage(){return(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,E.RG)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m._g.Renderbuffer,this),this._context=null)}}var S=r(57088);const R=f.Z.getLogger("esri.views.webgl.FramebufferObject");class w{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m._g.FramebufferObject,this);const i=M(t)?t:new S.x(this._context,t);if(this._colorAttachments.set(m.VY.COLOR_ATTACHMENT0,i),this._validateTextureDescriptor(i.descriptor),this._validateColorAttachmentPoint(m.VY.COLOR_ATTACHMENT0),null!=r)if(function(e){return M(e)||null!=e&&"pixelFormat"in e}(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=M(r)?r:new S.x(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=function(e){return null!=e&&"type"in e&&e.type===x.B.RenderBuffer}(r)?r:new A(this._context,r);this._depthStencilBuffer=e,this._validateRenderBufferDescriptor(e.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach(((e,t)=>this.detachColorTexture(t)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(m._g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+r.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&M(t)?t:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,t=m.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=m.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),t}setColorTextureTarget(e,t=m.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case x.B.Texture:return this._attachDepthStencilTexture(e);case x.B.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==m.VI.DEPTH_STENCIL&&t.pixelFormat!==m.VI.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==m.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m.Lu)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m.Lu)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(m.qi.FRAMEBUFFER,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(m.qi.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;a.descriptor.target!==m.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||n+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,S.x.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(S.x.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(m.No.TEXTURE_2D,0,o,n,e,t,r,i),l.bindTexture(c,S.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==v.zO.WEBGL2)return(0,g.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=T.createPixelPack(this._context,m.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(m.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};y(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((e=>e.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(y(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=m.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach(((t,r)=>this._framebufferTexture2D(t.glName,r,C(t),e))),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,C(this._depthStencilTexture),e);(0,g.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.VY.COLOR_ATTACHMENT0,r=m.No.TEXTURE_2D,i=m.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(m.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.M2)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=(0,a.M2)(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==m.No.TEXTURE_2D&&e.target!==m.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),y(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){y(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.Tg.DEPTH_COMPONENT16:case m.Tg.DEPTH_COMPONENT24:case m.Tg.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case m.Tg.DEPTH24_STENCIL8:case m.Tg.DEPTH32F_STENCIL8:case m.Tg.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case m.Tg.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===w._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;w._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else w._MAX_COLOR_ATTACHMENTS=1}const t=e-m.VY.COLOR_ATTACHMENT0;t+1>w._MAX_COLOR_ATTACHMENTS&&f.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${w._MAX_COLOR_ATTACHMENTS} color attachments`)}}function M(e){return null!=e&&"type"in e&&e.type===x.B.Texture}function y(e,t){const r=Math.max(e.width,e.height);if(r>t){R.warn(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function C(e){return e.descriptor.target===m.No.TEXTURE_CUBE_MAP?m.No.TEXTURE_CUBE_MAP_POSITIVE_X:m.No.TEXTURE_2D}w._MAX_COLOR_ATTACHMENTS=-1;var O,I,P=r(47859);(I=O||(O={}))[I.RED=0]="RED",I[I.RG=1]="RG",I[I.RGBA4=2]="RGBA4",I[I.RGBA=3]="RGBA",I[I.RGBA_MIPMAP=4]="RGBA_MIPMAP",I[I.R16F=5]="R16F",I[I.RGBA16F=6]="RGBA16F";const N=new P.X;N.pixelFormat=m.VI.RED,N.internalFormat=m.lP.R8,N.wrapMode=m.e8.CLAMP_TO_EDGE;const L=new P.X;L.pixelFormat=m.VI.RG,L.internalFormat=m.lP.RG8,L.wrapMode=m.e8.CLAMP_TO_EDGE;const D=new P.X;D.internalFormat=m.lP.RGBA4,D.dataType=m.Br.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.e8.CLAMP_TO_EDGE;(new P.X).wrapMode=m.e8.CLAMP_TO_EDGE;const F=new P.X;F.wrapMode=m.e8.CLAMP_TO_EDGE,F.samplingMode=m.cw.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const H=new P.X;H.pixelFormat=m.VI.RED,H.dataType=m.Br.HALF_FLOAT,H.internalFormat=m.lP.R16F,H.samplingMode=m.cw.NEAREST;const B=new P.X;var G;B.dataType=m.Br.HALF_FLOAT,B.internalFormat=m.lP.RGBA16F,B.samplingMode=m.cw.NEAREST,O.RED,O.RG,O.RGBA4,O.RGBA,O.RGBA_MIPMAP,O.R16F,O.RGBA16F,function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH_STENCIL_BUFFER=1]="DEPTH_STENCIL_BUFFER",e[e.DEPTH24_BUFFER=2]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=3]="DEPTH16_BUFFER"}(G||(G={}));const U=new P.X;U.pixelFormat=m.VI.DEPTH_STENCIL,U.dataType=m.Br.UNSIGNED_INT_24_8,U.samplingMode=m.cw.NEAREST,U.wrapMode=m.e8.CLAMP_TO_EDGE,G.DEPTH_STENCIL_TEXTURE,G.DEPTH_STENCIL_BUFFER,new b(m.Tg.DEPTH24_STENCIL8,4),G.DEPTH24_BUFFER,new b(m.Tg.DEPTH_COMPONENT24,4),G.DEPTH16_BUFFER,new b(m.Tg.DEPTH_COMPONENT16,4);var z=r(92036),V=r(55039);const W={required:[]},j=(V.H.Depth,V.H.CompositeColor,V.H.Highlight,{required:[V.H.Depth,V.H.Normal]});class q extends z.Z{consumes(){return W}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}}class k extends q{}var X=r(78869),$=r(14589),Y=r(83475),J=r(59377),Z=r(59915),K=r(27097);class Q extends $.A{initializeProgram(e){return new J.$(e.rctx,Q.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}Q.shader=new X.J(Z.S,(()=>r.e(8092).then(r.bind(r,88092))));var ee=r(97323);class te extends i.K{constructor(){super(...arguments),this.projScale=1}}class re extends te{constructor(){super(...arguments),this.intensity=1}}class ie extends i.K{}class oe extends ie{constructor(){super(...arguments),this.blurSize=(0,ee.a)()}}var ne,ae=r(25377);class se extends $.A{initializeProgram(e){return new J.$(e.rctx,se.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}se.shader=new X.J(ae.S,(()=>r.e(9243).then(r.bind(r,49243)))),r(95720),function(e){e[e.Antialiasing=0]="Antialiasing",e[e.HighQualityTransparency=1]="HighQualityTransparency",e[e.HighResolutionVoxel=2]="HighResolutionVoxel",e[e.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",e[e.SSAO=4]="SSAO",e[e.WaterReflection=5]="WaterReflection",e[e.HighResolutionShadows=6]="HighResolutionShadows",e[e.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(ne||(ne={}));var le=r(97995);const ce=2;let ue=class extends k{constructor(e){super(e),this._context=null,this._passParameters=new re,this._drawParameters=new oe,this.produces=new Map([[le.r.SSAO,()=>this._produces()]])}_produces(){return null!=this._enableTime&&null!=this._context}consumes(){return this._produces()?j:W}initializeRenderContext(e){this._context=e,this.addHandles([(0,s.YP)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(ne.SSAO)),(e=>e?this._enable():this._disable()),s.tX)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,a.M2)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;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 P.X;t.wrapMode=m.e8.CLAMP_TO_EDGE,t.pixelFormat=m.VI.RGB,t.wrapMode=m.e8.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new S.x(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(se)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(Q)),this._enableTime=(0,l.HA)(0),this._context?.requestRender()}renderNode(e,t,r){const i=e.bindParameters,o=i.linearDepth?.colorTexture,n=r?.normal?.colorTexture;if(null==this._enableTime||null==this._context||null==o||!n)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,s=i.camera,l=this.view.qualitySettings.fadeDuration,c=l>0?Math.min(l,e.time-this._enableTime)/l:1;this._passParameters.normalTexture=n,this._passParameters.depthTexture=o,this._passParameters.projScale=1/s.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*de/(0,ae.g)(s)**6*c;const u=s.fullViewport[2],d=s.fullViewport[3],f=Math.round(u/ce),p=Math.round(d/ce),g=this._context.fbos,v=g.acquire(O.RED,u,d);a.bindFramebuffer(v.fbo),a.setViewport(0,0,u,d),a.bindTechnique(this._ssaoTechnique,this._passParameters,i).bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw();const _=a.bindTechnique(this._blurTechnique,this._passParameters,i);a.setViewport(0,0,f,p);const T=g.acquire(O.RED,f,p);a.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=v.colorTexture,(0,h.s)(this._drawParameters.blurSize,0,ce/d),_.bindDraw(this._drawParameters,i,this._passParameters),a.setViewport(0,0,f,p),a.screen.draw(),v.release();const x=g.acquire(O.RED,f,p);return a.bindFramebuffer(x.fbo),a.setViewport(0,0,u,d),a.setClearColor(1,1,1,0),a.clear(m.lk.COLOR_BUFFER_BIT),a.setViewport(0,0,f,p),this._drawParameters.colorTexture=T.colorTexture,(0,h.s)(this._drawParameters.blurSize,ce/u,0),_.bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw(),a.setViewport4fv(s.fullViewport),T.release(),c<1&&this._context.requestRender(),x}};(0,n._)([(0,c.Cb)({constructOnly:!0})],ue.prototype,"view",void 0),(0,n._)([(0,c.Cb)()],ue.prototype,"_context",void 0),ue=(0,n._)([(0,d.j)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ue);const de=.5;function he(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new o.A("ssaoTex",((e,t)=>t.ssao?.colorTexture))),r.constants.add("blurSizePixelsInverse","float",1/ce),r.code.add(i.H`float evaluateAmbientOcclusionInverse() {
624
627
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
625
628
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
626
629
  }
@@ -673,7 +676,7 @@ vec3 calculateAmbientRadiance(float ambientOcclusion)
673
676
  {
674
677
  vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
675
678
  return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
676
- }`))}const m=(0,n.c)(),f=(0,s.c)();var p=r(77813),g=r(5802),v=r(26322),_=r(27754),T=r(79884),x=r(67498);class E extends T.x{constructor(e,t){super(e,"bool",x.P.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var b=r(21437);r(22021),(0,n.c)();const A=.4;function S(e){e.constants.add("ambientBoostFactor","float",A)}function R(e){e.uniforms.add(new b.p("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function w(e,t){const r=e.fragment;switch(e.include(p.K,t),t.pbrMode!==l.f7.Disabled&&e.include(v.T,t),e.include(h,t),e.include(_.e),r.code.add(d.H`
679
+ }`))}const m=(0,n.c)(),f=(0,s.c)();var p=r(21627),g=r(5802),v=r(26322),_=r(27754),T=r(79884),x=r(67498);class E extends T.x{constructor(e,t){super(e,"bool",x.P.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var b=r(21437);r(22021),(0,n.c)();const A=.4;function S(e){e.constants.add("ambientBoostFactor","float",A)}function R(e){e.uniforms.add(new b.p("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function w(e,t){const r=e.fragment;switch(e.include(p.K,t),t.pbrMode!==l.f7.Disabled&&e.include(v.T,t),e.include(h,t),e.include(_.e),r.code.add(d.H`
677
680
  const float GAMMA_SRGB = 2.1;
678
681
  const float INV_GAMMA_SRGB = 0.4761904;
679
682
  ${t.pbrMode===l.f7.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
@@ -715,7 +718,7 @@ inputs.metalness = mrr[0];
715
718
  inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(d.H`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
716
719
  inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
717
720
  inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new E("hasFillLights",((e,t)=>t.enableFillLights))):r.constants.add("hasFillLights","bool",!1),r.code.add(d.H`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);
718
- ambientDir = ambientDir != vec3(0.0)? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
721
+ ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
719
722
  inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
720
723
  vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity;
721
724
  vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
@@ -733,7 +736,7 @@ inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianc
733
736
  inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(d.H`
734
737
  vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
735
738
  vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
736
- vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB));
739
+ vec3 emissionComponent = _emission == vec3(0.0) ? _emission : pow(_emission, vec3(GAMMA_SRGB));
737
740
  vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
738
741
  ${t.pbrMode!==l.f7.Schematic||t.hasColorTexture?d.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`:d.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
739
742
  return outColor;
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4697],{65845:(e,t,r)=>{r.d(t,{D:()=>i});var a=r(81153);function i(e){e?.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,a.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},81153:(e,t,r)=>{function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>a})},64697:(e,t,r)=>{r.d(t,{save:()=>d,saveAs:()=>y});var a=r(64383),i=r(14661);const o="Image Service",n="imagery-layer-save",l="imagery-layer-save-as",s="imagery-tile-layer-save",p="imagery-tile-layer-save-as";function u(e){if("imagery"===e.type)return{isValid:!0};const{raster:t}=e,r="Function"===t?.datasetFormat?t.primaryRasters?.rasters[0]:t;return{isValid:"RasterTileServer"===r?.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType),errorMessage:"imagery tile layer should be created from a tiled image service."}}function c(e){const t=e.layerJSON;return Promise.resolve(t&&Object.keys(t).length?t:null)}async function m(e,t){const{parsedUrl:r,title:a,fullExtent:o}=e;t.url=r.path,t.title||=a,t.extent=await(0,i.$o)(o),"imagery-tile"===e.type&&(0,i.qj)(t,i.Kz.TILED_IMAGERY)}async function d(e,t){const r="imagery"===e.type?n:s;return(0,a.a1)({layer:e,itemType:o,validateLayer:u,createItemData:c,errorNamePrefix:r},t)}async function y(e,t,r){const i="imagery"===e.type?l:p;return(0,a.po)({layer:e,itemType:o,validateLayer:u,createItemData:c,errorNamePrefix:i,newItem:t,setItemProperties:m},r)}},64383:(e,t,r)=>{r.d(t,{a1:()=>g,po:()=>v});var a=r(20102),i=r(65845),o=r(48522),n=r(15235),l=r(33516),s=r(14661),p=r(14769);async function u(e){const{layer:t,errorNamePrefix:r,validateLayer:i}=e;await t.load(),function(e,t,r){const i=r(e);if(!i.isValid)throw new a.Z(`${t}:invalid-parameters`,i.errorMessage,{layer:e})}(t,r,i)}function c(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function m(e){const{item:t,itemType:r,errorNamePrefix:i,layer:o,validateItem:n}=e;if((0,p.w)(t),t.type!==r)throw new a.Z(`${i}:portal-item-wrong-type`,`Portal item type should be "${r}"`,{item:t,layer:o});if(n){const e=n(t);if(!e.isValid)throw new a.Z(`${i}:invalid-parameters`,e.errorMessage,{layer:o})}}function d(e){const{layer:t,errorNamePrefix:r}=e,{portalItem:i}=t;if(!i)throw new a.Z(`${r}:portal-item-not-set`,c(t,"requires the portalItem property to be set"));if(!i.loaded)throw new a.Z(`${r}:portal-item-not-loaded`,c(t,"cannot be saved to a portal item that does not exist or is inaccessible"));m({...e,item:i})}function y(e){const{newItem:t,itemType:r}=e;let a=n.default.from(t);return a.id&&(a=a.clone(),a.id=null),a.type??=r,a.portal??=o.Z.getDefault(),m({...e,item:a}),a}async function f(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const i=e.write({},t);return await Promise.all(t.resources?.pendingOperations??[]),function(e,t){let r=(e.messages??[]).filter((({type:e})=>"error"===e)).map((({name:e,message:t,details:r})=>new a.Z(e,t,r)));if(e.blockedRelativeUrls&&(r=r.concat(e.blockedRelativeUrls.map((e=>new a.Z("url:unsupported",`Relative url '${e}' is not supported`))))),t?.ignoreUnsupported&&(r=r.filter((({name:e})=>"layer:unsupported"!==e&&"symbol:unsupported"!==e&&"symbol-layer:unsupported"!==e&&"property:unsupported"!==e&&"url:unsupported"!==e))),r.length>0)throw new a.Z("layer-write:unsupported","Failed to save layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}(t,r),i}function w(e){(0,s.qj)(e,s.Kz.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}async function g(e,t){const{layer:r,createItemData:a,createJSONContext:o,saveResources:n}=e;await u(e),d(e);const s=r.portalItem,p=o?o(s):(0,l.Yv)(s),c=await f(r,p,t),m=await a({layer:r,layerJSON:c},s);return w(s),await s.update({data:m}),(0,i.D)(p),await(n?.(s,p)),s}async function v(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:n,saveResources:s}=e;await u(e);const p=y(e),c=o?o(p):(0,l.Yv)(p),m=await f(r,c,t),d=await a({layer:r,layerJSON:m},p);return await n(r,p),w(p),await async function(e,t,r){const a=e.portal;await a.signIn(),await(a.user?.addItem({item:e,data:t,folder:r?.folder}))}(p,d,t),r.portalItem=p,(0,i.D)(c),await(s?.(p,c)),p}},33516:(e,t,r)=>{r.d(t,{M4:()=>s,Yv:()=>n,ht:()=>o,wk:()=>l});var a=r(17452),i=r(48522);function o(e){return{origin:"portal-item",url:(0,a.mN)(e.itemUrl),portal:e.portal||i.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function n(e){const t=(0,a.mN)(e.itemUrl);return{origin:"portal-item",messages:[],writtenProperties:[],url:t,portal:e.portal||i.Z.getDefault(),portalItem:e,verifyItemRelativeUrls:t?{rootPath:t.path,writtenUrls:[]}:null,blockedRelativeUrls:[]}}function l(e){return{origin:"web-map",url:(0,a.mN)(e.itemUrl),portal:e.portal||i.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function s(e,t){const r=(0,a.mN)(e.itemUrl);return{origin:"web-map",messages:[],writtenProperties:[],url:r,portal:e.portal||i.Z.getDefault(),portalItem:e,initiator:t,verifyItemRelativeUrls:r?{rootPath:r.path,writtenUrls:[]}:null,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}}},14769:(e,t,r)=>{r.d(t,{w:()=>n});var a=r(68773),i=r(20102),o=r(71058);function n(e){if(a.default.apiKey&&(0,o.r)(e.portal.url))throw new i.Z("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${e.portal.url} when using an api key`)}}}]);