@arcgis/core 4.33.0-next.20250415 → 4.33.0-next.20250416

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 (147) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{3a84ee5d0434362286a6.js → 07f206719763173faa8d.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{029705c229ccf2e6b78d.js → 29283c19e1ccdc6cfbde.js} +8 -8
  4. package/assets/esri/core/workers/chunks/{ed517687b3728fd2eb64.js → 2fd5b48976cefe7cc0ab.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{4e711f4fa1cbedf4dae5.js → 42aab2a336ee22fd9055.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{d88544ac332be633e3fe.js → e64e0c3240f8e577a61c.js} +1 -1
  7. package/assets/esri/core/workers/chunks/e9fba86036b8fe700a41.js +1 -0
  8. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ar.json +1 -1
  9. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_bg.json +1 -1
  10. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_bs.json +1 -1
  11. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ca.json +1 -1
  12. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_cs.json +1 -1
  13. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_da.json +1 -1
  14. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_de.json +1 -1
  15. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_el.json +1 -1
  16. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_es.json +1 -1
  17. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_et.json +1 -1
  18. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_fi.json +1 -1
  19. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_fr.json +1 -1
  20. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_he.json +1 -1
  21. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_hr.json +1 -1
  22. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_hu.json +1 -1
  23. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_id.json +1 -1
  24. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_it.json +1 -1
  25. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ja.json +1 -1
  26. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ko.json +1 -1
  27. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_lt.json +1 -1
  28. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_lv.json +1 -1
  29. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_nl.json +1 -1
  30. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_no.json +1 -1
  31. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pl.json +1 -1
  32. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pt-BR.json +1 -1
  33. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pt-PT.json +1 -1
  34. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ro.json +1 -1
  35. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ru.json +1 -1
  36. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sk.json +1 -1
  37. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sl.json +1 -1
  38. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sr.json +1 -1
  39. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sv.json +1 -1
  40. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_th.json +1 -1
  41. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_tr.json +1 -1
  42. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_uk.json +1 -1
  43. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_vi.json +1 -1
  44. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-CN.json +1 -1
  45. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-HK.json +1 -1
  46. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-TW.json +1 -1
  47. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ar.json +1 -0
  48. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_bg.json +1 -0
  49. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_bs.json +1 -0
  50. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ca.json +1 -0
  51. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_cs.json +1 -0
  52. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_da.json +1 -0
  53. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_de.json +1 -0
  54. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_el.json +1 -0
  55. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_es.json +1 -0
  56. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_et.json +1 -0
  57. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_fi.json +1 -0
  58. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_fr.json +1 -0
  59. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_he.json +1 -0
  60. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_hr.json +1 -0
  61. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_hu.json +1 -0
  62. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_id.json +1 -0
  63. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_it.json +1 -0
  64. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ja.json +1 -0
  65. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ko.json +1 -0
  66. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_lt.json +1 -0
  67. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_lv.json +1 -0
  68. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_nl.json +1 -0
  69. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_no.json +1 -0
  70. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pl.json +1 -0
  71. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pt-BR.json +1 -0
  72. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pt-PT.json +1 -0
  73. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ro.json +1 -0
  74. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ru.json +1 -0
  75. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sk.json +1 -0
  76. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sl.json +1 -0
  77. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sr.json +1 -0
  78. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sv.json +1 -0
  79. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_th.json +1 -0
  80. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_tr.json +1 -0
  81. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_uk.json +1 -0
  82. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_vi.json +1 -0
  83. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-CN.json +1 -0
  84. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-HK.json +1 -0
  85. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-TW.json +1 -0
  86. package/geometry/support/MeshTexture.js +1 -1
  87. package/interfaces.d.ts +44 -0
  88. package/package.json +1 -1
  89. package/support/revision.js +1 -1
  90. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  91. package/views/3d/interactive/Manipulator3D.js +1 -1
  92. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  93. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  94. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  95. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  96. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  97. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  98. package/views/3d/layers/DrapedSubView3D.js +1 -1
  99. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  100. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  101. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  102. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  103. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  104. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  105. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  106. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  107. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  108. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  109. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  110. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  111. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  112. package/views/3d/layers/graphics/Labeler.js +1 -1
  113. package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
  114. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  115. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  116. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  117. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  118. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  119. package/views/3d/support/MemoryController.js +1 -1
  120. package/views/3d/support/engineContent/line.js +1 -1
  121. package/views/3d/terrain/OverlayRenderer.js +1 -1
  122. package/views/3d/webgl-engine/Stage.js +1 -1
  123. package/views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js +1 -1
  124. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  125. package/views/3d/webgl-engine/lib/ContentObjectType.js +1 -1
  126. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  127. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  128. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  129. package/views/3d/webgl-engine/lib/IntersectableGeometry.js +5 -0
  130. package/views/3d/webgl-engine/lib/Material.js +1 -1
  131. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  132. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  133. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  134. package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
  135. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  136. package/views/3d/webgl-engine/lib/RendererBase.js +1 -1
  137. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  138. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  139. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  140. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  141. package/views/support/Scheduler.js +1 -1
  142. package/webscene/Slide.js +1 -1
  143. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  144. package/widgets/Features/FeaturesViewModel.js +1 -1
  145. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  146. package/assets/esri/core/workers/chunks/72d7e45e7eb28f2cc0b0.js +0 -1
  147. package/views/3d/webgl-engine/lib/MaterialCollection.js +0 -5
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3383],{11725:(e,t,r)=>{r.d(t,{im:()=>m,m$:()=>i});var i,o,n=r(51850),a=r(49255),s=r(69720),l=r(96672),c=r(39341),d=r(35256),u=r(43616),h=r(65786);class m extends s.J{constructor(e,t){super(),this.type=l.X.Material,this.supportsEdges=!1,this._renderPriority=0,this.vertexAttributeLocations=c.D,this._pp0=(0,n.fA)(0,0,1),this._pp1=(0,n.fA)(0,0,0),this._parameters=new t,(0,u.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,u.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&!!(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}get hasEmissions(){return!1}getConfiguration(e,t,r=new d.E){return r.output=e,r.hasHighlightMixTexture=e===a.V.Highlight&&null!=t.highlightMixTexture,r}intersectDraped(e,t,r,i,o,n){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque",h.Y},11964:(e,t,r)=>{r.d(t,{Cr:()=>c,H6:()=>h,_I:()=>u,kb:()=>d,vt:()=>l});var i=r(34727),o=r(4341),n=r(38954),a=r(51850),s=r(32114);function l(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.d)(r.vector,t,e),r}function d(e,t){const r=(0,n.d)(s.rq.get(),t,e.origin),o=(0,n.f)(e.vector,r),a=(0,n.f)(e.vector,e.vector),l=(0,i.qE)(o/a,0,1),c=(0,n.d)(s.rq.get(),(0,n.h)(s.rq.get(),e.vector,l),r);return(0,n.f)(c,c)}function u(e,t,r){return h(e,t,0,1,r)}function h(e,t,r,o,a){const{vector:l,origin:c}=e,d=(0,n.d)(s.rq.get(),t,c),u=(0,n.f)(l,d)/(0,n.k)(l);return(0,n.h)(a,l,(0,i.qE)(u,r,o)),(0,n.g)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)(),new o.I((()=>l()))},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Bind,((r,i)=>r.bindTexture(e,t(i))))}}},13464:(e,t,r)=>{var i;r.d(t,{N:()=>i}),function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.OPAQUE_MATERIAL_WITHOUT_NORMALS=3]="OPAQUE_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_MATERIAL_WITHOUT_NORMALS=5]="TRANSPARENT_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_MATERIAL_WITHOUT_DEPTH=7]="TRANSPARENT_MATERIAL_WITHOUT_DEPTH",e[e.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",e[e.HUD_MATERIAL=12]="HUD_MATERIAL",e[e.LABEL_MATERIAL=13]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=14]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=15]="LINE_CALLOUTS_HUD_DEPTH",e[e.OVERLAY=16]="OVERLAY",e[e.DRAPED_MATERIAL=17]="DRAPED_MATERIAL",e[e.DRAPED_WATER=18]="DRAPED_WATER",e[e.VOXEL=19]="VOXEL",e[e.MAX_SLOTS=20]="MAX_SLOTS"}(i||(i={}))},14113:(e,t,r)=>{r.d(t,{N5:()=>l});var i=r(49186),o=(r(44208),r(53966)),n=r(69270);const a=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class l extends s{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new p,this.extensions=new f,this.outputs=new v}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!1){const r=this.extensions.generateSource(e),i=this.attributes.generateSource(e),o=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,a=n.uniforms.generateSource(),s=n.code.generateSource(),l=n.main.generateSource(t),c="vertex"===e?x:_,d=n.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${r.join("\n")}\n${c}\n${d.join("\n")}\n${a.join("\n")}\n${i.join("\n")}\n${o.join("\n")}\n${u.join("\n")}\n${s.join("\n")}\n${l.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Bind];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Bind];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,n,t,o)}}}class c{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else a().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class h extends s{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new d(this),this.code=new u(this),this.constants=new g(this)}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class p{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?a().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`))),t}}class f{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?f.ALLOWLIST_VERTEX:f.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}static{this.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"]}static{this.ALLOWLIST_VERTEX=[]}}class v{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):a().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:v.DEFAULT_NAME,type:v.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}class g{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=g._numberToFloatStr(r);break;case"int":i=g._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])}, ${g._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>g._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n#endif",x="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec4",i.c.Bind,((r,i)=>r.setUniform4fv(e,t(i))))}}},15581:(e,t,r)=>{r.d(t,{S:()=>x,b:()=>v,g:()=>g});var i=r(37585),o=r(48163),n=r(82048),a=r(52540),s=r(34845),l=r(77108),c=r(47286),d=r(33094),u=r(20304),h=r(31821),m=r(63761),p=r(14113);const f=16;function v(){const e=new p.N5,t=e.fragment;return e.include(n.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new d.U("radius",(e=>g(e.camera)))).code.add(h.H`vec3 sphere[16] = vec3[16](
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7944],{11725:(e,t,r)=>{r.d(t,{im:()=>h,m$:()=>i});var i,o,n=r(24326),a=r(51850),s=r(49255),l=r(39341),c=r(35256),d=r(43616),u=r(65786);class h{constructor(e,t){this.id=(0,n.c)(),this.supportsEdges=!1,this._renderPriority=0,this.vertexAttributeLocations=l.D,this._pp0=(0,a.fA)(0,0,1),this._pp1=(0,a.fA)(0,0,0),this._parameters=new t,(0,d.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,d.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&!!(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.visible&&this.parameters.renderOccluded===e}get hasEmissions(){return!1}getConfiguration(e,t,r=new c.E){return r.output=e,r.hasHighlightMixTexture=e===s.V.Highlight&&null!=t.highlightMixTexture,r}intersectDraped(e,t,r,i,o,n){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque",u.Y},11964:(e,t,r)=>{r.d(t,{Cr:()=>c,H6:()=>h,_I:()=>u,kb:()=>d,vt:()=>l});var i=r(34727),o=r(4341),n=r(38954),a=r(51850),s=r(32114);function l(e){return e?{origin:(0,a.o8)(e.origin),vector:(0,a.o8)(e.vector)}:{origin:(0,a.vt)(),vector:(0,a.vt)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.d)(r.vector,t,e),r}function d(e,t){const r=(0,n.d)(s.rq.get(),t,e.origin),o=(0,n.f)(e.vector,r),a=(0,n.f)(e.vector,e.vector),l=(0,i.qE)(o/a,0,1),c=(0,n.d)(s.rq.get(),(0,n.h)(s.rq.get(),e.vector,l),r);return(0,n.f)(c,c)}function u(e,t,r){return h(e,t,0,1,r)}function h(e,t,r,o,a){const{vector:l,origin:c}=e,d=(0,n.d)(s.rq.get(),t,c),u=(0,n.f)(l,d)/(0,n.k)(l);return(0,n.h)(a,l,(0,i.qE)(u,r,o)),(0,n.g)(a,a,e.origin)}(0,a.vt)(),(0,a.vt)(),new o.I((()=>l()))},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Bind,((r,i)=>r.bindTexture(e,t(i))))}}},13464:(e,t,r)=>{var i;r.d(t,{N:()=>i}),function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.OPAQUE_MATERIAL_WITHOUT_NORMALS=3]="OPAQUE_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_MATERIAL_WITHOUT_NORMALS=5]="TRANSPARENT_MATERIAL_WITHOUT_NORMALS",e[e.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_MATERIAL_WITHOUT_DEPTH=7]="TRANSPARENT_MATERIAL_WITHOUT_DEPTH",e[e.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",e[e.HUD_MATERIAL=12]="HUD_MATERIAL",e[e.LABEL_MATERIAL=13]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=14]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=15]="LINE_CALLOUTS_HUD_DEPTH",e[e.OVERLAY=16]="OVERLAY",e[e.DRAPED_MATERIAL=17]="DRAPED_MATERIAL",e[e.DRAPED_WATER=18]="DRAPED_WATER",e[e.VOXEL=19]="VOXEL",e[e.MAX_SLOTS=20]="MAX_SLOTS"}(i||(i={}))},14113:(e,t,r)=>{r.d(t,{N5:()=>l});var i=r(49186),o=(r(44208),r(53966)),n=r(69270);const a=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class l extends s{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new p,this.extensions=new f,this.outputs=new v}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!1){const r=this.extensions.generateSource(e),i=this.attributes.generateSource(e),o=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,a=n.uniforms.generateSource(),s=n.code.generateSource(),l=n.main.generateSource(t),c="vertex"===e?x:_,d=n.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${r.join("\n")}\n${c}\n${d.join("\n")}\n${a.join("\n")}\n${i.join("\n")}\n${o.join("\n")}\n${u.join("\n")}\n${s.join("\n")}\n${l.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Bind];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Bind];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[n.c.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,n,t,o)}}}class c{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else a().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class h extends s{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new d(this),this.code=new u(this),this.constants=new g(this)}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class p{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?a().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`))),t}}class f{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?f.ALLOWLIST_VERTEX:f.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}static{this.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"]}static{this.ALLOWLIST_VERTEX=[]}}class v{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):a().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:v.DEFAULT_NAME,type:v.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}class g{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=g._numberToFloatStr(r);break;case"int":i=g._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])}, ${g._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>g._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n#endif",x="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec4",i.c.Bind,((r,i)=>r.setUniform4fv(e,t(i))))}}},15581:(e,t,r)=>{r.d(t,{S:()=>x,b:()=>v,g:()=>g});var i=r(37585),o=r(48163),n=r(82048),a=r(52540),s=r(34845),l=r(77108),c=r(47286),d=r(33094),u=r(20304),h=r(31821),m=r(63761),p=r(14113);const f=16;function v(){const e=new p.N5,t=e.fragment;return e.include(n.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new d.U("radius",(e=>g(e.camera)))).code.add(h.H`vec3 sphere[16] = vec3[16](
2
2
  vec3(0.186937, 0.0, 0.0),
3
3
  vec3(0.700542, 0.0, 0.0),
4
4
  vec3(-0.864858, -0.481795, -0.111713),
@@ -379,7 +379,7 @@ return outColor;
379
379
  vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:D.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
380
380
  vec4 finalColor = vec4(shadedColor, opacity_);
381
381
  outputColorHighlightOID(finalColor, vpos, albedo);
382
- `),t}const U=Object.freeze(Object.defineProperty({__proto__:null,build:z},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(3694),o=r(38954),n=r(51850),a=r(620);class s{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:c}=r;(0,a.vA)(c.length%this._numIndexPerPrimitive==0),(0,a.vA)(c.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*c[this._numIndexPerPrimitive*e[0]];l.clear(),l.push(u);const h=(0,n.fA)(i[u],i[u+1],i[u+2]),m=(0,n.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*c[r+e],l.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}this.bbMin=h,this.bbMax=m;const p=(0,o.m)((0,n.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]);let f=this.radius*this.radius;for(let e=0;e<l.length;++e){u=l.at(e);const t=i[u]-p[0],r=i[u+1]-p[1],o=i[u+2]-p[2],n=t*t+r*r+o*o;if(n<=f)continue;const a=Math.sqrt(n),s=.5*(a-this.radius);this.radius=this.radius+s,f=this.radius*this.radius;const c=s/a;p[0]+=t*c,p[1]+=r*c,p[2]+=o*c}this.center=p,l.clear()}getChildren(){if(this._children||(0,o.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,o.m)((0,n.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:l,indices:c}=this.position;for(let o=0;o<t;++o){let t=0;const n=this._numIndexPerPrimitive*this.primitiveIndices[o];let s=l*c[n],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=l*c[n+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[o]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){l.prune()}}const l=new i.A({deallocator:null})},32680:(e,t,r)=>{r.d(t,{M:()=>o});var i=r(31821);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
382
+ `),t}const U=Object.freeze(Object.defineProperty({__proto__:null,build:z},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(3694),o=r(38954),n=r(51850),a=r(620);class s{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:c}=r;(0,a.vA)(c.length%this._numIndexPerPrimitive==0),(0,a.vA)(c.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*c[this._numIndexPerPrimitive*e[0]];l.clear(),l.push(u);const h=(0,n.fA)(i[u],i[u+1],i[u+2]),m=(0,n.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*c[r+e],l.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}this.bbMin=h,this.bbMax=m;const p=(0,o.m)((0,n.vt)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]);let f=this.radius*this.radius;for(let e=0;e<l.length;++e){u=l.at(e);const t=i[u]-p[0],r=i[u+1]-p[1],o=i[u+2]-p[2],n=t*t+r*r+o*o;if(n<=f)continue;const a=Math.sqrt(n),s=.5*(a-this.radius);this.radius=this.radius+s,f=this.radius*this.radius;const c=s/a;p[0]+=t*c,p[1]+=r*c,p[2]+=o*c}this.center=p,l.clear()}getChildren(){if(this._children||(0,o.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,o.m)((0,n.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:l,indices:c}=this.position;for(let o=0;o<t;++o){let t=0;const n=this._numIndexPerPrimitive*this.primitiveIndices[o];let s=l*c[n],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=l*c[n+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[o]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){l.prune()}}const l=new i.A({deallocator:null})},31006:(e,t,r)=>{r.d(t,{g:()=>G}),r(44208);var i=r(49186),o=r(65529),n=r(97768),a=r(74887),s=r(34275),l=r(84952),c=r(99677),d=r(56058),u=r(89192),h=r(2741);let m;var p=r(92993),f=r(63907),v=r(76284),g=r(42293);let _=null,x=null;async function T(){return null==x&&(m??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,h.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=m,_=await x),x}function b(e,t,r,i,o){const n=(0,g.IB)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function A(e){return e.getNumImages()>=1&&!e.isUASTC()}function E(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[p.n.ETC2_RGBA,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[p.n.ETC1_RGB,f.CQ.COMPRESSED_RGB8_ETC2]:c?i?[p.n.BC3_RGBA,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[p.n.BC1_RGB,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[p.n.RGBA32,f.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?f.Cj.LINEAR_MIPMAP_LINEAR:f.Cj.LINEAR,t.width=o,t.height=n,new v.g(e,t,{type:"compressed",levels:m})}var M,w=r(24326);class C{constructor(){this.id=(0,w.c)()}}!function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Texture=2]="Texture",e[e.COUNT=3]="COUNT"}(M||(M={}));var R=r(53966);const I=()=>R.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function O(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const y=O("DXT1"),N=O("DXT3"),P=O("DXT5");function D(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function L(e,{maxPreferredTextureSize:t,maxTextureSize:r}){const i=Math.max(e.width,e.height),o=e.width*e.height,n=t*t;if(i<=r&&o<=n)return e;const a=Math.min(Math.sqrt(n/o),r/i);return H(e,D(Math.round(e.width*a),r),D(Math.round(e.height*a),r))}function H(e,t,r){if(e instanceof ImageData)return H(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}var F=r(620),B=r(67171);class G extends C{constructor(e,t){super(),this._data=e,this.type=M.Texture,this.events=new o.A,this._parameters={...U,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,l.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";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,l.DB)(e.src)||(0,l.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new B.R;return t.wrapMode=this._parameters.wrap??f.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?f.Cj.LINEAR_MIPMAP_LINEAR:f.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture??this._emptyTexture}get loaded(){return null!=this._glTexture}get usedMemory(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return t.encoding===u.JS.KTX2_ENCODING?function(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=E(r)?b(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===u.JS.BASIS_ENCODING?function(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=A(r)?b(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?z(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._glTexture)return this._glTexture;const t=this._data;return null==t?(this._glTexture=new v.g(e,this._createDescriptor(e),null),this._glTexture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&this._parameters.encoding===u.JS.DDS_ENCODING?this._loadFromDDSData(e,t):(0,s.mw)(t)&&this._parameters.encoding===u.JS.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&this._parameters.encoding===u.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&this._parameters.encoding===u.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,s.mg)(t)?this._loadFromPixelData(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_update(e,t){return null==this._glTexture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return I().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return I().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case y:o=8,n=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case N:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case P:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return I().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(I().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e.buffer,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:n,width:c,height:d}}(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?f.Cj.LINEAR_MIPMAP_LINEAR:f.Cj.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new v.g(e,t,o)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==_&&(_=await T());const i=new _.KTX2File(new Uint8Array(r));if(!E(i))return null;i.startTranscoding();const o=S(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==_&&(_=await T());const i=new _.BasisFile(new Uint8Array(r));if(!A(i))return null;i.startTranscoding();const o=S(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,F.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?f.Ab.LUMINANCE:3===this._parameters.components?f.Ab.RGB:f.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new v.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await(0,c.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,d.Sx)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((o,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,n.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),o(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,(()=>d((0,a.NK)())))}))))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=L(r,e.parameters));const i=z(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?f.Ab.RGB:f.Ab.RGBA,o.width=i.width,o.height=i.height,o.compressionHandle=this._parameters.compressionHandle,o.compressionCallback=this._parameters.compressionCallback,this._glTexture=new v.g(e,o,r),this._emptyTexture=null,this.events.emit("loaded"),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._glTexture=(0,n.WD)(this._glTexture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function z(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const U={wrap:{s:f.pF.REPEAT,t:f.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},32680:(e,t,r)=>{r.d(t,{M:()=>o});var i=r(31821);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
383
383
  vec3 camToVert = posWorld - camPosWorld;
384
384
  bool isBackface = dot(camToVert, normalWorld) > 0.0;
385
385
  if (isBackface) {
@@ -575,7 +575,7 @@ outputHighlight(isHighlightOccluded());
575
575
  return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
576
576
  }`)}function d(e,t){const{vertex:r}=e;switch(t.output){case i.V.Color:case i.V.ColorEmission:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.V.Shadow:case i.V.ShadowHighlight:case i.V.ShadowExcludeHighlight:case i.V.ViewshedShadow:return e.include(o.em,t),s(e),l(e),c(e),void r.code.add(a.H`void forwardLinearDepth() {
577
577
  linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
578
- }`)}r.code.add(a.H`void forwardLinearDepth() {}`)}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},48833:(e,t,r)=>{r.d(t,{g:()=>B}),r(44208);var i=r(49186),o=r(65529),n=r(97768),a=r(74887),s=r(34275),l=r(84952),c=r(99677),d=r(56058),u=r(89192),h=r(2741);let m;var p=r(92993),f=r(63907),v=r(76284),g=r(42293);let _=null,x=null;async function T(){return null==x&&(m??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,h.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=m,_=await x),x}function b(e,t,r,i,o){const n=(0,g.IB)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function A(e){return e.getNumImages()>=1&&!e.isUASTC()}function E(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[p.n.ETC2_RGBA,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[p.n.ETC1_RGB,f.CQ.COMPRESSED_RGB8_ETC2]:c?i?[p.n.BC3_RGBA,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[p.n.BC1_RGB,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[p.n.RGBA32,f.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?f.Cj.LINEAR_MIPMAP_LINEAR:f.Cj.LINEAR,t.width=o,t.height=n,new v.g(e,t,{type:"compressed",levels:m})}var M=r(69720),w=r(96672),C=r(53966);const R=()=>C.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function I(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const O=I("DXT1"),y=I("DXT3"),N=I("DXT5");function P(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function D(e,{maxPreferredTextureSize:t,maxTextureSize:r}){const i=Math.max(e.width,e.height),o=e.width*e.height,n=t*t;if(i<=r&&o<=n)return e;const a=Math.min(Math.sqrt(n/o),r/i);return L(e,P(Math.round(e.width*a),r),P(Math.round(e.height*a),r))}function L(e,t,r){if(e instanceof ImageData)return L(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}var H=r(620),F=r(67171);class B extends M.J{constructor(e,t){super(),this._data=e,this.type=w.X.Texture,this.events=new o.A,this._parameters={...z,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,l.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";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,l.DB)(e.src)||(0,l.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new F.R;return t.wrapMode=this._parameters.wrap??f.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?f.Cj.LINEAR_MIPMAP_LINEAR:f.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture??this._emptyTexture}get loaded(){return null!=this._glTexture}get usedMemory(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return t.encoding===u.JS.KTX2_ENCODING?function(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=E(r)?b(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===u.JS.BASIS_ENCODING?function(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=A(r)?b(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?G(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._glTexture)return this._glTexture;const t=this._data;return null==t?(this._glTexture=new v.g(e,this._createDescriptor(e),null),this._glTexture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&this._parameters.encoding===u.JS.DDS_ENCODING?this._loadFromDDSData(e,t):(0,s.mw)(t)&&this._parameters.encoding===u.JS.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&this._parameters.encoding===u.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&this._parameters.encoding===u.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,s.mg)(t)?this._loadFromPixelData(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_update(e,t){return null==this._glTexture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return R().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return R().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case O:o=8,n=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case y:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case N:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return R().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(R().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e.buffer,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:n,width:c,height:d}}(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?f.Cj.LINEAR_MIPMAP_LINEAR:f.Cj.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new v.g(e,t,o)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==_&&(_=await T());const i=new _.KTX2File(new Uint8Array(r));if(!E(i))return null;i.startTranscoding();const o=S(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==_&&(_=await T());const i=new _.BasisFile(new Uint8Array(r));if(!A(i))return null;i.startTranscoding();const o=S(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,H.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?f.Ab.LUMINANCE:3===this._parameters.components?f.Ab.RGB:f.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new v.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await(0,c.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,d.Sx)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((o,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,n.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),o(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,(()=>d((0,a.NK)())))}))))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=D(r,e.parameters));const i=G(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?f.Ab.RGB:f.Ab.RGBA,o.width=i.width,o.height=i.height,o.compressionHandle=this._parameters.compressionHandle,o.compressionCallback=this._parameters.compressionCallback,this._glTexture=new v.g(e,o,r),this._emptyTexture=null,this.events.emit("loaded"),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._glTexture=(0,n.WD)(this._glTexture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function G(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const z={wrap:{s:f.pF.REPEAT,t:f.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51406:(e,t,r)=>{r.d(t,{MU:()=>c,O1:()=>d,QM:()=>u,Sx:()=>l,q2:()=>s});var i=r(29242),o=r(53466),n=r(31821),a=r(35644);function s(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new a.k("colorTextureTransformMatrix",(e=>e.colorTextureTransformMatrix??i.zK))).code.add(n.H`void forwardColorUV(){
578
+ }`)}r.code.add(a.H`void forwardLinearDepth() {}`)}},47286:(e,t,r)=>{r.d(t,{G:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51406:(e,t,r)=>{r.d(t,{MU:()=>c,O1:()=>d,QM:()=>u,Sx:()=>l,q2:()=>s});var i=r(29242),o=r(53466),n=r(31821),a=r(35644);function s(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new a.k("colorTextureTransformMatrix",(e=>e.colorTextureTransformMatrix??i.zK))).code.add(n.H`void forwardColorUV(){
579
579
  colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
580
580
  }`)):e.vertex.code.add(n.H`void forwardColorUV(){}`)}function l(e,t){t.hasNormalTextureTransform&&t.textureCoordinateType!==o.I.None?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new a.k("normalTextureTransformMatrix",(e=>e.normalTextureTransformMatrix??i.zK))).code.add(n.H`void forwardNormalUV(){
581
581
  normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
@@ -585,7 +585,7 @@ emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
585
585
  occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
586
586
  }`)):e.vertex.code.add(n.H`void forwardOcclusionUV(){}`)}function u(e,t){t.hasMetallicRoughnessTextureTransform&&t.textureCoordinateType!==o.I.None?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new a.k("metallicRoughnessTextureTransformMatrix",(e=>e.metallicRoughnessTextureTransformMatrix??i.zK))).code.add(n.H`void forwardMetallicRoughnessUV(){
587
587
  metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
588
- }`)):e.vertex.code.add(n.H`void forwardMetallicRoughnessUV(){}`)}},51768:(e,t,r)=>{r.d(t,{$U:()=>Se});var i=r(38954),o=r(51850),n=r(67222),a=r(24151),s=r(1843),l=r(49255),c=r(96336),d=r(22911),u=r(62602),h=r(59469),m=r(16943),p=r(89192),f=r(25634),v=r(11725),g=r(33524),_=r(70328),x=r(96672),T=r(620),b=r(46540);class A{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const E=(0,_.vt)();function S(e,t,r,o,n,a){if(!e.visible)return;const s=(0,i.a)(B,o,r),l=(e,t,r)=>{a(e,r,t,!1)},c=new A(!1,t.options.normalRequired);if(e.boundingInfo){(0,T.vA)(e.type===x.X.Mesh);const i=t.tolerance;w(e.boundingInfo,r,s,i,n,c,l)}else{const t=e.attributes.get(b.r.POSITION),o=t.indices;!function(e,t,r,o,n,a,s,l,c,d){const u=t,h=G,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),v=m>=p?m>=f?0:2:p>=f?1:2,g=v,_=u[g]<0?2:1,x=(v+_)%3,T=(v+(3-_))%3,b=u[x]/u[g],A=u[T]/u[g],E=1/u[g],S=I,M=O,w=y,{normalRequired:C}=c;for(let t=r;t<o;++t){const r=3*t,o=s*n[r];(0,i.i)(h[0],a[o+0],a[o+1],a[o+2]);const c=s*n[r+1];(0,i.i)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*n[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.c)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(S,h[0],e),(0,i.a)(M,h[1],e),(0,i.a)(w,h[2],e);const m=S[x]-b*S[g],p=S[T]-A*S[g],f=M[x]-b*M[g],v=M[T]-A*M[g],_=w[x]-b*w[g],R=w[T]-A*w[g],I=_*v-R*f,O=m*R-p*_,y=f*p-v*m;if((I<0||O<0||y<0)&&(I>0||O>0||y>0))continue;const N=I+O+y;if(0===N)continue;const D=I*(E*S[g])+O*(E*M[g])+y*(E*w[g]);if(D*Math.sign(N)<0)continue;const L=D/N;L>=0&&d(L,t,C?P(h):null)}}(r,s,0,o.length/3,o,t.data,t.stride,n,c,l)}}const M=(0,o.vt)();function w(e,t,r,o,n,a,s){if(null==e)return;const l=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,M);if((0,_.Ne)(E,e.bbMin),(0,_.vI)(E,e.bbMax),null!=n&&n.applyToAabb(E),function(e,t,r,i){return function(e,t,r,i){const o=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let a=Math.min(o,n),s=Math.max(o,n);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(E,t,l,o)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>H){const i=e.getChildren();if(void 0!==i){for(const e of i)w(e,t,r,o,n,a,s);return}}!function(e,t,r,i,o,n,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],p=t[0],f=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*o[r];let c=n[i],_=n[i+1],x=n[i+2];const T=a*o[r+1];let b=n[T],A=n[T+1],E=n[T+2];const S=a*o[r+2];let M=n[S],w=n[S+1],R=n[S+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[b,A,E]=l.applyToVertex(b,A,E,e),[M,w,R]=l.applyToVertex(M,w,R,e));const I=b-c,O=A-_,y=E-x,P=M-c,D=w-_,L=R-x,H=f*L-D*v,B=v*P-L*p,G=p*D-P*f,z=I*H+O*B+y*G;if(Math.abs(z)<=F)continue;const U=u-c,V=h-_,W=m-x,j=U*H+V*B+W*G;if(z>0){if(j<0||j>z)continue}else if(j>0||j<z)continue;const k=V*y-O*W,Y=W*I-y*U,$=U*O-I*V,q=p*k+f*Y+v*$;if(z>0){if(q<0||j+q>z)continue}else if(q>0||j+q<z)continue;const X=(P*k+D*Y+L*$)/z;X>=0&&d(X,t,g?N(I,O,y,P,D,L,C):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,n,a,s)}}const C=(0,o.vt)();function R(e,t,r,i,o,n,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,p=n*t,f=o[p],v=o[p+1],g=o[p+2],_=n*r,x=n*i,T=o[_]-f,b=o[_+1]-v,A=o[_+2]-g,E=o[x]-f,S=o[x+1]-v,M=o[x+2]-g,w=h*M-S*m,R=m*E-M*u,I=u*S-E*h,O=T*w+b*R+A*I;if(Math.abs(O)<=F)continue;const y=l-f,P=c-v,D=d-g,L=y*w+P*R+D*I;if(O>0){if(L<0||L>O)continue}else if(L>0||L<O)continue;const H=P*A-b*D,B=D*T-A*y,G=y*b-T*P,z=u*H+h*B+m*G;if(O>0){if(z<0||L+z>O)continue}else if(z>0||L+z<O)continue;const U=(E*H+S*B+M*G)/O;U>=0&&s(U,e,a?N(T,b,A,E,S,M,C):null)}}const I=(0,o.vt)(),O=(0,o.vt)(),y=(0,o.vt)();function N(e,t,r,o,n,a,s){return(0,i.i)(D,e,t,r),(0,i.i)(L,o,n,a),(0,i.e)(s,D,L),(0,i.n)(s,s),s}function P(e){return(0,i.a)(D,e[1],e[0]),(0,i.a)(L,e[2],e[0]),(0,i.e)(C,D,L),(0,i.n)(C,C),C}const D=(0,o.vt)(),L=(0,o.vt)(),H=1e3,F=1e-7,B=(0,o.vt)(),G=[(0,o.vt)(),(0,o.vt)(),(0,o.vt)()];var z=r(13464),U=(r(77690),r(29242),r(58083),r(9093),r(97937)),V=r(57005);const W=new class{constructor(e=0){this.offset=e,this.sphere=(0,U.c)(),this.tmpVertex=(0,o.vt)()}applyToVertex(e,t,r){const o=this.objectTransform.transform,n=(0,i.i)(j,e,t,r),a=(0,i.t)(n,n,o),s=this.offset/(0,i.l)(a);(0,i.b)(a,a,a,s);const l=this.objectTransform.inverse;return(0,i.t)(this.tmpVertex,a,l),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.l)(e);(0,i.b)(e,e,e,r);const o=this.offset/(0,i.l)(t);(0,i.b)(t,t,t,o)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,i.l)((0,U.a)(e)),r=this.offset/t;return(0,i.b)((0,U.a)(this.sphere),(0,U.a)(e),(0,U.a)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,o.vt)(),this._tmpMbs=(0,U.c)(),this._tmpObb=new V.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.l)(e)}applyToVertex(e,t,r){const o=(0,i.i)(j,e,t,r),n=(0,i.i)(k,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,i.l)(n);return(0,i.b)(this._tmpVertex,o,n,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,n=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(o),u=Math.abs(n),h=Math.abs(a),m=Math.abs(s),p=.5*(1+Math.sign(r*n))*Math.min(l,u),f=.5*(1+Math.sign(i*a))*Math.min(c,h),v=.5*(1+Math.sign(o*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),T=Math.sqrt(p*p+f*f+v*v),b=Math.sign(l+r),A=Math.sign(c+i),E=Math.sign(d+o),S=Math.sign(u+n),M=Math.sign(h+a),w=Math.sign(m+s),C=this._totalOffset;if(T<C)return e[0]-=(1-b)*C,e[1]-=(1-A)*C,e[2]-=(1-E)*C,e[3]+=S*C,e[4]+=M*C,e[5]+=w*C,e;const R=C/Math.sqrt(g*g+_*_+x*x),I=C/T,O=I-R,y=-O;return e[0]+=r*(b*y+I),e[1]+=i*(A*y+I),e[2]+=o*(E*y+I),e[3]+=n*(S*O+R),e[4]+=a*(M*O+R),e[5]+=s*(w*O+R),e}applyToMbs(e){const t=(0,i.l)((0,U.a)(e)),r=this._totalOffset/t;return(0,i.b)((0,U.a)(this._tmpMbs),(0,U.a)(e),(0,U.a)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,V.gm)(e,this._totalOffset,this._totalOffset,a.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,o.vt)()}applyToVertex(e,t,r){const o=(0,i.i)(j,e,t,r),n=(0,i.g)(k,o,this.localOrigin),a=this.offset/(0,i.l)(n);return(0,i.b)(this.tmpVertex,o,n,a),this.tmpVertex}applyToAabb(e){const t=Y,r=$,i=q;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]=e&1<<o?r[o]:t[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(!(a&e)){for(let o=0;o<3;++o)i[o]=a&1<<o?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 j=(0,o.vt)(),k=(0,o.vt)(),Y=(0,o.vt)(),$=(0,o.vt)(),q=(0,o.vt)();var X=r(13030),Z=r(59907);class J{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(b.r.POSITION).indices.length}write(e,t,r,i,o,n){return(0,Z.SA)(r,i,this.vertexBufferLayout,e,t,o,n)}intersect(e,t,r,o,n,a,s){const l=this.vertexBufferLayout.createView(e).getField(b.r.POSITION,X.xs);if(null==l)return;const c=(0,i.a)(K,a,n),d=l.count/3,u=o.options.normalRequired;R(n,c,0,d,l.typedBuffer,l.typedBufferStride,u,((e,t,r)=>{s(e,r,t,!1)}))}}const K=(0,o.vt)();var Q=r(43616),ee=r(91829),te=r(72824),re=r(97220),ie=r(98958),oe=r(59643),ne=r(63907);ne.MT.LESS,ne.MT.ALWAYS;const ae={mask:255},se={function:{func:ne.MT.ALWAYS,ref:p.dd.OutlineVisualElementMask,mask:p.dd.OutlineVisualElementMask},operation:{fail:ne.eA.KEEP,zFail:ne.eA.KEEP,zPass:ne.eA.ZERO}},le={function:{func:ne.MT.ALWAYS,ref:p.dd.OutlineVisualElementMask,mask:p.dd.OutlineVisualElementMask},operation:{fail:ne.eA.KEEP,zFail:ne.eA.KEEP,zPass:ne.eA.REPLACE}};ne.MT.EQUAL,p.dd.OutlineVisualElementMask,p.dd.OutlineVisualElementMask,ne.eA.KEEP,ne.eA.KEEP,ne.eA.KEEP,ne.MT.NOTEQUAL,p.dd.OutlineVisualElementMask,p.dd.OutlineVisualElementMask,ne.eA.KEEP,ne.eA.KEEP,ne.eA.KEEP;var ce=r(74810),de=r(28491),ue=r(90644),he=r(49788);class me extends te.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=ce.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=p.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveStrength=0,this.emissiveSource=n.YJ.Color,this.emissiveBaseColor=o.uY,this.instancedDoublePrecision=!1,this.normalType=c.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,o.CN)(.2,.2,.2),this.diffuse=(0,o.CN)(.8,.8,.8),this.externalColor=(0,ee.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,o.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=p.it.Less,this.textureAlphaMode=p.sf.Blend,this.textureAlphaCutoff=he.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=v.m$.Occlude,this.isDecoration=!1}}te.gy;class pe extends ie.w{constructor(e,t,i=new re.$(de.D,(()=>r.e(5141).then(r.bind(r,5141))))){super(e,t,i),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:o,cullFace:n,customDepthTest:a,hasOccludees:s,enableOffset:c}=e,d=r===oe.Y.NONE,u=r===oe.Y.FrontFace;return(0,ue.Ey)({blending:(0,l.RN)(i)&&o?(0,g.Yf)(r):null,culling:ve(e)?(0,ue.Xt)(n):null,depthTest:{func:(0,g.K_)(r,fe(a))},depthWrite:(0,g.z5)(e),drawBuffers:i===l.V.Depth?{buffers:[ne.Hr.NONE]}:(0,g.m6)(r,i),colorWrite:ue.kn,stencilWrite:s?ae:null,stencilTest:s?t?le:se:null,polygonOffset:d||u?null:(0,g.aB)(c)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function fe(e){return e===p.it.Lequal?ne.MT.LEQUAL:ne.MT.LESS}function ve(e){return e.cullFace!==p.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}var ge=r(90237),_e=r(53466),xe=r(51976),Te=r(35256);class be extends Te.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=p.sf.Opaque,this.doubleSidedMode=u.W.None,this.pbrMode=h.A9.Disabled,this.cullFace=p.s2.None,this.normalType=c.W.Attribute,this.customDepthTest=p.it.Less,this.emissionSource=d.ZX.None,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instancedDoublePrecision=!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.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||this.emissionSource===d.ZX.Texture||this.hasOcclusionTexture||this.hasNormalTexture?_e.I.Default:_e.I.None}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,ge._)([(0,xe.W)({count:p.sf.COUNT})],be.prototype,"alphaDiscardMode",void 0),(0,ge._)([(0,xe.W)({count:u.W.COUNT})],be.prototype,"doubleSidedMode",void 0),(0,ge._)([(0,xe.W)({count:h.A9.COUNT})],be.prototype,"pbrMode",void 0),(0,ge._)([(0,xe.W)({count:p.s2.COUNT})],be.prototype,"cullFace",void 0),(0,ge._)([(0,xe.W)({count:c.W.COUNT})],be.prototype,"normalType",void 0),(0,ge._)([(0,xe.W)({count:p.it.COUNT})],be.prototype,"customDepthTest",void 0),(0,ge._)([(0,xe.W)({count:d.ZX.COUNT})],be.prototype,"emissionSource",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasVertexColors",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasSymbolColors",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasVerticalOffset",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasColorTexture",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasMetallicRoughnessTexture",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasOcclusionTexture",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasNormalTexture",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasScreenSizePerspective",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasVertexTangents",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasOccludees",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"instancedDoublePrecision",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasModelTransformation",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"offsetBackfaces",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"vvSize",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"vvColor",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"receiveShadows",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"receiveAmbientOcclusion",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"textureAlphaPremultiplied",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"instanced",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"instancedColor",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"writeDepth",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"transparent",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"enableOffset",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"terrainDepthTest",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"cullAboveTerrain",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"snowCover",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasColorTextureTransform",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasEmissionTextureTransform",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasNormalTextureTransform",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasOcclusionTextureTransform",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Ae=r(57323);class Ee extends pe{constructor(e,t){super(e,t,new re.$(Ae.R,(()=>r.e(9933).then(r.bind(r,39933))))),this.type="RealisticTreeTechnique"}}class Se extends v.im{constructor(e,t){super(e,we),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[z.N.OPAQUE_MATERIAL,e=>((0,l.iq)(e)||(0,l.PJ)(e))&&!this.transparent],[z.N.TRANSPARENT_MATERIAL,e=>((0,l.iq)(e)||(0,l.PJ)(e))&&this.transparent&&this.parameters.writeDepth],[z.N.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>((0,l.XY)(e)||(0,l.PJ)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,s.BP)().vec3f(b.r.POSITION);return e.normalType===c.W.Compressed?t.vec2i16(b.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(b.r.NORMAL),e.hasVertexTangents&&t.vec4f(b.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f16(b.r.UV0),e.hasVertexColors&&t.vec4u8(b.r.COLOR),e.hasSymbolColors&&t.vec4u8(b.r.SYMBOLCOLOR),(0,m.E)()&&t.vec4u8(b.r.OLIDCOLOR),t}(this.parameters),this._configuration=new be(t.spherical)}isVisibleForOutput(e){return e!==l.V.Shadow&&e!==l.V.ShadowExcludeHighlight&&e!==l.V.ShadowHighlight||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t?1:i[3])>=he.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.p)(this.parameters.emissiveBaseColor,o.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(this.parameters.emissiveSource===n.YJ.Emissive&&this._hasEmissiveBase||this.parameters.emissiveSource===n.YJ.Color)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:o,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=!o&&!!r.normalTextureId,i.hasColorTexture=!!r.textureId,i.hasVertexTangents=!o&&r.hasVertexTangents,i.instanced=r.isInstanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.vvSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=o?c.W.Attribute:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,null!=r.customDepthTest&&(i.customDepthTest=r.customDepthTest),i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?p.s2.None:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!o&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=o?u.W.WindingOrder:a&&"normal"===s?u.W.View:a&&"winding-order"===s?u.W.WindingOrder:u.W.None,i.instancedColor=r.hasInstancedColor,(0,l.RN)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.vvColor=!!r.vvColor,i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?h.A9.Schematic:h.A9.Normal:h.A9.Disabled,i.hasMetallicRoughnessTexture=!o&&!!r.metallicRoughnessTextureId,i.emissionSource=o?d.ZX.None:null!=r.emissiveTextureId&&r.emissiveSource===n.YJ.Emissive?d.ZX.Texture:r.usePBR?r.emissiveSource===n.YJ.Emissive?d.ZX.EmissiveColor:d.ZX.SymbolColor:d.ZX.None,i.hasOcclusionTexture=!o&&!!r.occlusionTextureId,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.camera.relativeElevation<g.xt,i.snowCover=function(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}(t),i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,o,n,s){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(Ne,t[12],t[13],t[14]);let s=null;switch(r.viewingMode){case a.RT.Global:s=(0,i.n)(Oe,Ne);break;case a.RT.Local:s=(0,i.c)(Oe,Ie)}let l=0;const c=(0,i.d)(Pe,Ne,e.eye),d=(0,i.l)(c),u=(0,i.h)(c,c,1/d);let h=null;this.parameters.screenSizePerspective&&(h=(0,i.f)(s,u)),l+=(0,Q.kE)(e,d,this.parameters.verticalOffset,h??0,this.parameters.screenSizePerspective),(0,i.h)(s,s,l),(0,i.q)(ye,s,r.transform.inverseRotation),o=(0,i.d)(Ce,o,ye),n=(0,i.d)(Re,n,ye)}var l;S(e,r,o,n,null!=(l=r.verticalOffset)?(W.offset=l,W):null,s)}createGLMaterial(e){return new Me(e)}createBufferWriter(){return new J(this._vertexBufferLayout)}get transparent(){const{parameters:{drivenOpacity:e,opacity:t,externalColor:[r,i,o,n],layerOpacity:a,texture:s,textureId:l,textureAlphaMode:c,colorMixMode:d}}=this;return e||t<1&&"replace"!==d||n<1&&"ignore"!==d||a<1||(null!=s||null!=l)&&c!==p.sf.Opaque&&c!==p.sf.Mask&&"replace"!==d}}class Me extends f.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Ee:pe,e)}}class we extends me{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}const Ce=(0,o.vt)(),Re=(0,o.vt)(),Ie=(0,o.fA)(0,0,1),Oe=(0,o.vt)(),ye=(0,o.vt)(),Ne=(0,o.vt)(),Pe=(0,o.vt)()},51976:(e,t,r)=>{r.d(t,{K:()=>s,W:()=>l});var i=r(49186),o=r(4576);class n{constructor(e){this._bits=[...e]}equals(e){return(0,o.aI)(this._bits,e.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var a=r(65786);class s extends a.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map((()=>0))??[],this._parameterNames??=[]}get key(){return this._key??=new n(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map((e=>` ${e}: ${this[e]}`)).join("\n");return this._parameterBits=t,r}}function l(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits;let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);const l=a[s],c=(1<<n)-1<<l;a[s]+=n,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[s]&c)>>l},set(t){if(this[r]!==t){if(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~c|+t<<l&c,"number"!=typeof t)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be a number, got ${typeof t}`);if(null==e.count)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must provide a count option`)}}}):Object.defineProperty(t,r,{get(){return!!((this._parameterBits[s]&c)>>l)},set(e){if(this[r]!==e&&(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},52540:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(37585),o=r(48163),n=r(77108),a=r(31821);function s(e){e.uniforms.add(new n.E("zProjectionMap",(e=>function(e){const t=e.projectionMatrix;return(0,i.hZ)(l,t[14],t[10])}(e.camera)))),e.code.add(a.H`float linearizeDepth(float depth) {
588
+ }`)):e.vertex.code.add(n.H`void forwardMetallicRoughnessUV(){}`)}},51768:(e,t,r)=>{r.d(t,{$U:()=>Se});var i=r(38954),o=r(51850),n=r(67222),a=r(24151),s=r(1843),l=r(49255),c=r(96336),d=r(22911),u=r(62602),h=r(59469),m=r(16943),p=r(89192),f=r(25634),v=r(11725),g=r(33524),_=r(70328),x=r(75039),T=r(620),b=r(46540);class A{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const E=(0,_.vt)();function S(e,t,r,o,n,a){if(!e.visible)return;const s=(0,i.a)(B,o,r),l=(e,t,r)=>{a(e,r,t,!1)},c=new A(!1,t.options.normalRequired);if(e.boundingInfo){(0,T.vA)(e.type===x.d.Mesh);const i=t.tolerance;w(e.boundingInfo,r,s,i,n,c,l)}else{const t=e.attributes.get(b.r.POSITION),o=t.indices;!function(e,t,r,o,n,a,s,l,c,d){const u=t,h=G,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),v=m>=p?m>=f?0:2:p>=f?1:2,g=v,_=u[g]<0?2:1,x=(v+_)%3,T=(v+(3-_))%3,b=u[x]/u[g],A=u[T]/u[g],E=1/u[g],S=I,M=O,w=y,{normalRequired:C}=c;for(let t=r;t<o;++t){const r=3*t,o=s*n[r];(0,i.i)(h[0],a[o+0],a[o+1],a[o+2]);const c=s*n[r+1];(0,i.i)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*n[r+2];(0,i.i)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.c)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.c)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.c)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(S,h[0],e),(0,i.a)(M,h[1],e),(0,i.a)(w,h[2],e);const m=S[x]-b*S[g],p=S[T]-A*S[g],f=M[x]-b*M[g],v=M[T]-A*M[g],_=w[x]-b*w[g],R=w[T]-A*w[g],I=_*v-R*f,O=m*R-p*_,y=f*p-v*m;if((I<0||O<0||y<0)&&(I>0||O>0||y>0))continue;const N=I+O+y;if(0===N)continue;const D=I*(E*S[g])+O*(E*M[g])+y*(E*w[g]);if(D*Math.sign(N)<0)continue;const L=D/N;L>=0&&d(L,t,C?P(h):null)}}(r,s,0,o.length/3,o,t.data,t.stride,n,c,l)}}const M=(0,o.vt)();function w(e,t,r,o,n,a,s){if(null==e)return;const l=function(e,t){return(0,i.i)(t,1/e[0],1/e[1],1/e[2])}(r,M);if((0,_.Ne)(E,e.bbMin),(0,_.vI)(E,e.bbMax),null!=n&&n.applyToAabb(E),function(e,t,r,i){return function(e,t,r,i){const o=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let a=Math.min(o,n),s=Math.max(o,n);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(E,t,l,o)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>H){const i=e.getChildren();if(void 0!==i){for(const e of i)w(e,t,r,o,n,a,s);return}}!function(e,t,r,i,o,n,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],p=t[0],f=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*o[r];let c=n[i],_=n[i+1],x=n[i+2];const T=a*o[r+1];let b=n[T],A=n[T+1],E=n[T+2];const S=a*o[r+2];let M=n[S],w=n[S+1],R=n[S+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[b,A,E]=l.applyToVertex(b,A,E,e),[M,w,R]=l.applyToVertex(M,w,R,e));const I=b-c,O=A-_,y=E-x,P=M-c,D=w-_,L=R-x,H=f*L-D*v,B=v*P-L*p,G=p*D-P*f,z=I*H+O*B+y*G;if(Math.abs(z)<=F)continue;const U=u-c,V=h-_,W=m-x,j=U*H+V*B+W*G;if(z>0){if(j<0||j>z)continue}else if(j>0||j<z)continue;const k=V*y-O*W,Y=W*I-y*U,$=U*O-I*V,q=p*k+f*Y+v*$;if(z>0){if(q<0||j+q>z)continue}else if(q>0||j+q<z)continue;const X=(P*k+D*Y+L*$)/z;X>=0&&d(X,t,g?N(I,O,y,P,D,L,C):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,n,a,s)}}const C=(0,o.vt)();function R(e,t,r,i,o,n,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,p=n*t,f=o[p],v=o[p+1],g=o[p+2],_=n*r,x=n*i,T=o[_]-f,b=o[_+1]-v,A=o[_+2]-g,E=o[x]-f,S=o[x+1]-v,M=o[x+2]-g,w=h*M-S*m,R=m*E-M*u,I=u*S-E*h,O=T*w+b*R+A*I;if(Math.abs(O)<=F)continue;const y=l-f,P=c-v,D=d-g,L=y*w+P*R+D*I;if(O>0){if(L<0||L>O)continue}else if(L>0||L<O)continue;const H=P*A-b*D,B=D*T-A*y,G=y*b-T*P,z=u*H+h*B+m*G;if(O>0){if(z<0||L+z>O)continue}else if(z>0||L+z<O)continue;const U=(E*H+S*B+M*G)/O;U>=0&&s(U,e,a?N(T,b,A,E,S,M,C):null)}}const I=(0,o.vt)(),O=(0,o.vt)(),y=(0,o.vt)();function N(e,t,r,o,n,a,s){return(0,i.i)(D,e,t,r),(0,i.i)(L,o,n,a),(0,i.e)(s,D,L),(0,i.n)(s,s),s}function P(e){return(0,i.a)(D,e[1],e[0]),(0,i.a)(L,e[2],e[0]),(0,i.e)(C,D,L),(0,i.n)(C,C),C}const D=(0,o.vt)(),L=(0,o.vt)(),H=1e3,F=1e-7,B=(0,o.vt)(),G=[(0,o.vt)(),(0,o.vt)(),(0,o.vt)()];var z=r(13464),U=(r(77690),r(29242),r(58083),r(9093),r(97937)),V=r(57005);const W=new class{constructor(e=0){this.offset=e,this.sphere=(0,U.c)(),this.tmpVertex=(0,o.vt)()}applyToVertex(e,t,r){const o=this.objectTransform.transform,n=(0,i.i)(j,e,t,r),a=(0,i.t)(n,n,o),s=this.offset/(0,i.l)(a);(0,i.b)(a,a,a,s);const l=this.objectTransform.inverse;return(0,i.t)(this.tmpVertex,a,l),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.l)(e);(0,i.b)(e,e,e,r);const o=this.offset/(0,i.l)(t);(0,i.b)(t,t,t,o)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,i.l)((0,U.a)(e)),r=this.offset/t;return(0,i.b)((0,U.a)(this.sphere),(0,U.a)(e),(0,U.a)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,o.vt)(),this._tmpMbs=(0,U.c)(),this._tmpObb=new V.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.l)(e)}applyToVertex(e,t,r){const o=(0,i.i)(j,e,t,r),n=(0,i.i)(k,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,i.l)(n);return(0,i.b)(this._tmpVertex,o,n,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,n=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(o),u=Math.abs(n),h=Math.abs(a),m=Math.abs(s),p=.5*(1+Math.sign(r*n))*Math.min(l,u),f=.5*(1+Math.sign(i*a))*Math.min(c,h),v=.5*(1+Math.sign(o*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),T=Math.sqrt(p*p+f*f+v*v),b=Math.sign(l+r),A=Math.sign(c+i),E=Math.sign(d+o),S=Math.sign(u+n),M=Math.sign(h+a),w=Math.sign(m+s),C=this._totalOffset;if(T<C)return e[0]-=(1-b)*C,e[1]-=(1-A)*C,e[2]-=(1-E)*C,e[3]+=S*C,e[4]+=M*C,e[5]+=w*C,e;const R=C/Math.sqrt(g*g+_*_+x*x),I=C/T,O=I-R,y=-O;return e[0]+=r*(b*y+I),e[1]+=i*(A*y+I),e[2]+=o*(E*y+I),e[3]+=n*(S*O+R),e[4]+=a*(M*O+R),e[5]+=s*(w*O+R),e}applyToMbs(e){const t=(0,i.l)((0,U.a)(e)),r=this._totalOffset/t;return(0,i.b)((0,U.a)(this._tmpMbs),(0,U.a)(e),(0,U.a)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,V.gm)(e,this._totalOffset,this._totalOffset,a.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,o.vt)()}applyToVertex(e,t,r){const o=(0,i.i)(j,e,t,r),n=(0,i.g)(k,o,this.localOrigin),a=this.offset/(0,i.l)(n);return(0,i.b)(this.tmpVertex,o,n,a),this.tmpVertex}applyToAabb(e){const t=Y,r=$,i=q;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]=e&1<<o?r[o]:t[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(!(a&e)){for(let o=0;o<3;++o)i[o]=a&1<<o?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 j=(0,o.vt)(),k=(0,o.vt)(),Y=(0,o.vt)(),$=(0,o.vt)(),q=(0,o.vt)();var X=r(13030),Z=r(59907);class J{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(b.r.POSITION).indices.length}write(e,t,r,i,o,n){return(0,Z.SA)(r,i,this.vertexBufferLayout,e,t,o,n)}intersect(e,t,r,o,n,a,s){const l=this.vertexBufferLayout.createView(e).getField(b.r.POSITION,X.xs);if(null==l)return;const c=(0,i.a)(K,a,n),d=l.count/3,u=o.options.normalRequired;R(n,c,0,d,l.typedBuffer,l.typedBufferStride,u,((e,t,r)=>{s(e,r,t,!1)}))}}const K=(0,o.vt)();var Q=r(43616),ee=r(91829),te=r(72824),re=r(97220),ie=r(98958),oe=r(59643),ne=r(63907);ne.MT.LESS,ne.MT.ALWAYS;const ae={mask:255},se={function:{func:ne.MT.ALWAYS,ref:p.dd.OutlineVisualElementMask,mask:p.dd.OutlineVisualElementMask},operation:{fail:ne.eA.KEEP,zFail:ne.eA.KEEP,zPass:ne.eA.ZERO}},le={function:{func:ne.MT.ALWAYS,ref:p.dd.OutlineVisualElementMask,mask:p.dd.OutlineVisualElementMask},operation:{fail:ne.eA.KEEP,zFail:ne.eA.KEEP,zPass:ne.eA.REPLACE}};ne.MT.EQUAL,p.dd.OutlineVisualElementMask,p.dd.OutlineVisualElementMask,ne.eA.KEEP,ne.eA.KEEP,ne.eA.KEEP,ne.MT.NOTEQUAL,p.dd.OutlineVisualElementMask,p.dd.OutlineVisualElementMask,ne.eA.KEEP,ne.eA.KEEP,ne.eA.KEEP;var ce=r(74810),de=r(28491),ue=r(90644),he=r(49788);class me extends te.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=ce.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=p.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveStrength=0,this.emissiveSource=n.YJ.Color,this.emissiveBaseColor=o.uY,this.instancedDoublePrecision=!1,this.normalType=c.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,o.CN)(.2,.2,.2),this.diffuse=(0,o.CN)(.8,.8,.8),this.externalColor=(0,ee.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,o.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=p.it.Less,this.textureAlphaMode=p.sf.Blend,this.textureAlphaCutoff=he.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=v.m$.Occlude,this.isDecoration=!1}}te.gy;class pe extends ie.w{constructor(e,t,i=new re.$(de.D,(()=>r.e(5141).then(r.bind(r,5141))))){super(e,t,i),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:o,cullFace:n,customDepthTest:a,hasOccludees:s,enableOffset:c}=e,d=r===oe.Y.NONE,u=r===oe.Y.FrontFace;return(0,ue.Ey)({blending:(0,l.RN)(i)&&o?(0,g.Yf)(r):null,culling:ve(e)?(0,ue.Xt)(n):null,depthTest:{func:(0,g.K_)(r,fe(a))},depthWrite:(0,g.z5)(e),drawBuffers:i===l.V.Depth?{buffers:[ne.Hr.NONE]}:(0,g.m6)(r,i),colorWrite:ue.kn,stencilWrite:s?ae:null,stencilTest:s?t?le:se:null,polygonOffset:d||u?null:(0,g.aB)(c)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function fe(e){return e===p.it.Lequal?ne.MT.LEQUAL:ne.MT.LESS}function ve(e){return e.cullFace!==p.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}var ge=r(90237),_e=r(53466),xe=r(51976),Te=r(35256);class be extends Te.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=p.sf.Opaque,this.doubleSidedMode=u.W.None,this.pbrMode=h.A9.Disabled,this.cullFace=p.s2.None,this.normalType=c.W.Attribute,this.customDepthTest=p.it.Less,this.emissionSource=d.ZX.None,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instancedDoublePrecision=!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.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.hasVvInstancing=!0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasColorTexture||this.hasMetallicRoughnessTexture||this.emissionSource===d.ZX.Texture||this.hasOcclusionTexture||this.hasNormalTexture?_e.I.Default:_e.I.None}get objectAndLayerIdColorInstanced(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,ge._)([(0,xe.W)({count:p.sf.COUNT})],be.prototype,"alphaDiscardMode",void 0),(0,ge._)([(0,xe.W)({count:u.W.COUNT})],be.prototype,"doubleSidedMode",void 0),(0,ge._)([(0,xe.W)({count:h.A9.COUNT})],be.prototype,"pbrMode",void 0),(0,ge._)([(0,xe.W)({count:p.s2.COUNT})],be.prototype,"cullFace",void 0),(0,ge._)([(0,xe.W)({count:c.W.COUNT})],be.prototype,"normalType",void 0),(0,ge._)([(0,xe.W)({count:p.it.COUNT})],be.prototype,"customDepthTest",void 0),(0,ge._)([(0,xe.W)({count:d.ZX.COUNT})],be.prototype,"emissionSource",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasVertexColors",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasSymbolColors",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasVerticalOffset",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasColorTexture",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasMetallicRoughnessTexture",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasOcclusionTexture",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasNormalTexture",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasScreenSizePerspective",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasVertexTangents",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasOccludees",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"instancedDoublePrecision",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasModelTransformation",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"offsetBackfaces",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"vvSize",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"vvColor",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"receiveShadows",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"receiveAmbientOcclusion",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"textureAlphaPremultiplied",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"instanced",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"instancedColor",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"writeDepth",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"transparent",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"enableOffset",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"terrainDepthTest",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"cullAboveTerrain",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"snowCover",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasColorTextureTransform",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasEmissionTextureTransform",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasNormalTextureTransform",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasOcclusionTextureTransform",void 0),(0,ge._)([(0,xe.W)()],be.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Ae=r(57323);class Ee extends pe{constructor(e,t){super(e,t,new re.$(Ae.R,(()=>r.e(9933).then(r.bind(r,39933))))),this.type="RealisticTreeTechnique"}}class Se extends v.im{constructor(e,t){super(e,we),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[z.N.OPAQUE_MATERIAL,e=>((0,l.iq)(e)||(0,l.PJ)(e))&&!this.transparent],[z.N.TRANSPARENT_MATERIAL,e=>((0,l.iq)(e)||(0,l.PJ)(e))&&this.transparent&&this.parameters.writeDepth],[z.N.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>((0,l.XY)(e)||(0,l.PJ)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=function(e){const t=(0,s.BP)().vec3f(b.r.POSITION);return e.normalType===c.W.Compressed?t.vec2i16(b.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(b.r.NORMAL),e.hasVertexTangents&&t.vec4f(b.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f16(b.r.UV0),e.hasVertexColors&&t.vec4u8(b.r.COLOR),e.hasSymbolColors&&t.vec4u8(b.r.SYMBOLCOLOR),(0,m.E)()&&t.vec4u8(b.r.OLIDCOLOR),t}(this.parameters),this._configuration=new be(t.spherical)}isVisibleForOutput(e){return e!==l.V.Shadow&&e!==l.V.ShadowExcludeHighlight&&e!==l.V.ShadowHighlight||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t?1:i[3])>=he.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.p)(this.parameters.emissiveBaseColor,o.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(this.parameters.emissiveSource===n.YJ.Emissive&&this._hasEmissiveBase||this.parameters.emissiveSource===n.YJ.Color)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:o,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=!o&&!!r.normalTextureId,i.hasColorTexture=!!r.textureId,i.hasVertexTangents=!o&&r.hasVertexTangents,i.instanced=r.isInstanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.vvSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=o?c.W.Attribute:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,null!=r.customDepthTest&&(i.customDepthTest=r.customDepthTest),i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?p.s2.None:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!o&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=o?u.W.WindingOrder:a&&"normal"===s?u.W.View:a&&"winding-order"===s?u.W.WindingOrder:u.W.None,i.instancedColor=r.hasInstancedColor,(0,l.RN)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.vvColor=!!r.vvColor,i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?h.A9.Schematic:h.A9.Normal:h.A9.Disabled,i.hasMetallicRoughnessTexture=!o&&!!r.metallicRoughnessTextureId,i.emissionSource=o?d.ZX.None:null!=r.emissiveTextureId&&r.emissiveSource===n.YJ.Emissive?d.ZX.Texture:r.usePBR?r.emissiveSource===n.YJ.Emissive?d.ZX.EmissiveColor:d.ZX.SymbolColor:d.ZX.None,i.hasOcclusionTexture=!o&&!!r.occlusionTextureId,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.camera.relativeElevation<g.xt,i.snowCover=function(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}(t),i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,o,n,s){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.i)(Ne,t[12],t[13],t[14]);let s=null;switch(r.viewingMode){case a.RT.Global:s=(0,i.n)(Oe,Ne);break;case a.RT.Local:s=(0,i.c)(Oe,Ie)}let l=0;const c=(0,i.d)(Pe,Ne,e.eye),d=(0,i.l)(c),u=(0,i.h)(c,c,1/d);let h=null;this.parameters.screenSizePerspective&&(h=(0,i.f)(s,u)),l+=(0,Q.kE)(e,d,this.parameters.verticalOffset,h??0,this.parameters.screenSizePerspective),(0,i.h)(s,s,l),(0,i.q)(ye,s,r.transform.inverseRotation),o=(0,i.d)(Ce,o,ye),n=(0,i.d)(Re,n,ye)}var l;S(e,r,o,n,null!=(l=r.verticalOffset)?(W.offset=l,W):null,s)}createGLMaterial(e){return new Me(e)}createBufferWriter(){return new J(this._vertexBufferLayout)}get transparent(){const{parameters:{drivenOpacity:e,opacity:t,externalColor:[r,i,o,n],layerOpacity:a,texture:s,textureId:l,textureAlphaMode:c,colorMixMode:d}}=this;return e||t<1&&"replace"!==d||n<1&&"ignore"!==d||a<1||(null!=s||null!=l)&&c!==p.sf.Opaque&&c!==p.sf.Mask&&"replace"!==d}}class Me extends f.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.i)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Ee:pe,e)}}class we extends me{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}}const Ce=(0,o.vt)(),Re=(0,o.vt)(),Ie=(0,o.fA)(0,0,1),Oe=(0,o.vt)(),ye=(0,o.vt)(),Ne=(0,o.vt)(),Pe=(0,o.vt)()},51976:(e,t,r)=>{r.d(t,{K:()=>s,W:()=>l});var i=r(49186),o=r(4576);class n{constructor(e){this._bits=[...e]}equals(e){return(0,o.aI)(this._bits,e.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var a=r(65786);class s extends a.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map((()=>0))??[],this._parameterNames??=[]}get key(){return this._key??=new n(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map((e=>` ${e}: ${this[e]}`)).join("\n");return this._parameterBits=t,r}}function l(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits;let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);const l=a[s],c=(1<<n)-1<<l;a[s]+=n,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[s]&c)>>l},set(t){if(this[r]!==t){if(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~c|+t<<l&c,"number"!=typeof t)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be a number, got ${typeof t}`);if(null==e.count)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must provide a count option`)}}}):Object.defineProperty(t,r,{get(){return!!((this._parameterBits[s]&c)>>l)},set(e){if(this[r]!==e&&(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},52540:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(37585),o=r(48163),n=r(77108),a=r(31821);function s(e){e.uniforms.add(new n.E("zProjectionMap",(e=>function(e){const t=e.projectionMatrix;return(0,i.hZ)(l,t[14],t[10])}(e.camera)))),e.code.add(a.H`float linearizeDepth(float depth) {
589
589
  float depthNdc = depth * 2.0 - 1.0;
590
590
  float c1 = zProjectionMap[0];
591
591
  float c2 = zProjectionMap[1];
@@ -771,7 +771,7 @@ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
771
771
  }
772
772
  float rgb2v(vec3 c) {
773
773
  return max(c.x, max(c.y, c.z));
774
- }`)}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},65786:(e,t,r)=>{r.d(t,{Y:()=>i});const i=class{};new i},67171:(e,t,r)=>{r.d(t,{R:()=>a,e:()=>s});var i=r(63907),o=r(36421),n=r(42293);class a{constructor(e=0,t=e){this.width=e,this.height=t,this.objectType=o.p.Texture,this.target=i.Ap.TEXTURE_2D,this.pixelFormat=i.Ab.RGBA,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=i.Cj.LINEAR,this.wrapMode=i.pF.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function s(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.IB)(e.internalFormat))*(e.target===i.Ap.TEXTURE_CUBE_MAP?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Draw,((r,i,o,n)=>r.setUniform2fv(e,t(i,o,n))))}}},69720:(e,t,r)=>{r.d(t,{J:()=>o});var i=r(24326);class o{constructor(){this.id=(0,i.c)()}}},71955:(e,t,r)=>{r.d(t,{K:()=>d});var i=r(42583),o=r(31821),n=r(69270),a=r(74333);class s extends a.n{constructor(e,t){super(e,"int",n.c.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}var l=r(46540),c=r(43616);function d(e,t){t.hasSymbolColors?(e.include(i.A),e.attributes.add(l.r.SYMBOLCOLOR,"vec4"),e.varyings.add("colorMixMode","mediump float"),e.vertex.code.add(o.H`int symbolColorMixMode;
774
+ }`)}},63761:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"sampler2D",i.c.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},65786:(e,t,r)=>{r.d(t,{Y:()=>i});const i=class{};new i},67171:(e,t,r)=>{r.d(t,{R:()=>a,e:()=>s});var i=r(63907),o=r(36421),n=r(42293);class a{constructor(e=0,t=e){this.width=e,this.height=t,this.objectType=o.p.Texture,this.target=i.Ap.TEXTURE_2D,this.pixelFormat=i.Ab.RGBA,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=i.Cj.LINEAR,this.wrapMode=i.pF.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function s(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.IB)(e.internalFormat))*(e.target===i.Ap.TEXTURE_CUBE_MAP?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>n});var i=r(69270),o=r(74333);class n extends o.n{constructor(e,t){super(e,"vec2",i.c.Draw,((r,i,o,n)=>r.setUniform2fv(e,t(i,o,n))))}}},71955:(e,t,r)=>{r.d(t,{K:()=>d});var i=r(42583),o=r(31821),n=r(69270),a=r(74333);class s extends a.n{constructor(e,t){super(e,"int",n.c.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}var l=r(46540),c=r(43616);function d(e,t){t.hasSymbolColors?(e.include(i.A),e.attributes.add(l.r.SYMBOLCOLOR,"vec4"),e.varyings.add("colorMixMode","mediump float"),e.vertex.code.add(o.H`int symbolColorMixMode;
775
775
  vec4 getSymbolColor() {
776
776
  return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
777
777
  }
@@ -916,7 +916,7 @@ vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceC
916
916
  vec3 outColorLinear = outDiffColor + specularComponent;
917
917
  vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
918
918
  return outColor;
919
- }`);break;default:(0,o.Xb)(t.pbrMode);case c.A9.COUNT:}}(0,a.vt)()},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>n,SY:()=>l,mb:()=>a});var i=r(38954),o=r(51850);function n({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:n,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.p)(s,o.uY))&&null==l&&(null==n||1===n)&&(null==r||1===r)}const a=(0,o.CN)(1,1,.5),s=(0,o.CN)(0,.6,.2),l=(0,o.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>x});var i=r(49186),o=(r(44208),r(53966)),n=r(97768),a=r(74887),s=r(94656),l=r(63907),c=r(36421),d=r(67171);function u(e){(null!=e.width&&e.width<0||null!=e.height&&e.height<0||null!=e.depth&&e.depth<0)&&o.A.getLogger("esri/views/webgl/textureUtils").error("Negative dimension parameters are not allowed!")}function h(e){return null!=e&&"type"in e&&"compressed"===e.type}function m(e){return null!=e&&!h(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function p(e){return e===l.Ap.TEXTURE_3D||e===l.Ap.TEXTURE_2D_ARRAY}function f(e,t,r,i=1){let o=Math.max(t,r);return e===l.Ap.TEXTURE_3D&&(o=Math.max(o,i)),Math.floor(Math.log2(o))+1}function v(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case l.ld.FLOAT:switch(e.pixelFormat){case l.Ab.RGBA:return l.H0.RGBA32F;case l.Ab.RGB:return l.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case l.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case l.Ab.RGBA:return l.H0.RGBA8;case l.Ab.RGB:return l.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=t===l.j7.DEPTH_STENCIL?l.iE.DEPTH24_STENCIL8:t===l.j7.DEPTH_COMPONENT?l.SB.DEPTH_COMPONENT24:t,e.internalFormat}class g extends d.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=l.Ab.RED;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=l.Ab.RED_INTEGER}}static validate(e,t){return new g(e,t)}}const _=()=>o.A.getLogger("esri/views/webgl/Texture");let x=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=c.p.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=g.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}this._descriptor.target===l.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,d.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController}dispose(){this.abortCompression(),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===l.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e,t){this._descriptor.compressionHandle=e,this._descriptor.compressionCallback=t}disableCompression(){this._descriptor.compressionHandle=null,this._descriptor.compressionCallback=null}setData(e){this.abortCompression(),!h(e)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in l.CQ&&(this._descriptor.internalFormat=void 0),this._setData(e),!h(e)&&this._descriptor.compressionHandle&&this._compressOnWorker(e)}updateData(t,r,o,n,a,s,l=0){s||_().error("An attempt to use uninitialized data!"),this._glName||_().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=v(c);const{context:d,pixelFormat:u,dataType:p,target:f,isImmutable:g}=c;if(g&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const x=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||r+n>c.width||o+a>c.height)&&_().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=d;l&&(n&&a||_().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,l)),m(s)?T.texSubImage2D(f,t,r,o,n,a,u,p,s):h(s)?T.compressedTexSubImage2D(f,t,r,o,n,a,c.internalFormat,s.levels[t]):T.texSubImage2D(f,t,r,o,n,a,u,p,s),l&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),d.bindTexture(x,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,o,n,a,s,l,c){c||_().error("An attempt to use uninitialized data!"),this._glName||_().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=v(d);const{context:u,pixelFormat:m,dataType:f,isImmutable:g,target:x}=d;if(g&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");p(x)||_().warn("Attempting to set 3D texture data on a non-3D texture");const T=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||n<0||r+a>d.width||o+s>d.height||n+l>d.depth)&&_().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:b}=u;if(h(c))c=c.levels[t],b.compressedTexSubImage3D(x,t,r,o,n,a,s,l,d.internalFormat,c);else{const e=c;b.texSubImage3D(x,t,r,o,n,a,s,l,m,f,e)}u.bindTexture(T,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,u(t)}t.samplingMode===l.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=l.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===l.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=l.Cj.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,u(e)}e.samplingMode===l.Cj.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=l.Cj.LINEAR):e.samplingMode===l.Cj.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=l.Cj.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,u(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController=(0,n.DC)(this._compressionAbortController))}_setData(t,r){const o=this._descriptor,n=o.context?.gl;if(!n)return;(0,s.Y2)(n),this._glName||(this._glName=n.createTexture(),o.context.instanceCounter.increment(l.vt.Texture,this)),u(o);const a=o.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);o.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,s.Y2)(n);const c=r??o.target,d=p(c);if(m(t))this._setDataFromTexImageSource(t,c);else{const{width:e,height:r,depth:a}=o;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(d&&null==a)throw new i.A("texture:missing-depth","Depth must be specified!");if(o.internalFormat=v(o),o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,o.internalFormat,o.hasMipmap,e,r,a),h(t)){if(null==(f=o.internalFormat)||!(f in l.CQ))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,o.internalFormat,c)}else this._texImage(c,0,o.internalFormat,e,r,a,t),(0,s.Y2)(n),o.hasMipmap&&this.generateMipmap()}var f;this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),(0,s.Y2)(n),o.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=l.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=l.Ap.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=v(i);const o=p(t),{width:n,height:a,depth:l}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=n),i.height||(i.height=a),o&&i.depth,o&&(i.depth=l),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,n,a,l),this._texImage(t,0,i.internalFormat,n,a,l,e),(0,s.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,s.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:o,height:n,depth:a}=i,s=e.levels,c=f(r,o,n,a),d=Math.min(c,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,l.H3.MAX_LEVEL,d),this._forEachMipmapLevel(((e,i,o,n)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,o,n,a)}),d)}_texStorage(e,t,r,o,n,a){const{gl:s}=this._descriptor.context;if(!(c=t,c in l.H0||function(e){return e in l.SB}(t)||function(e){return e in l.iE}(t)))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");var c;if(!this._descriptor.isImmutable)return;const d=r?f(e,o,n,a):1;if(p(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,d,t,o,n,a)}else s.texStorage2D(e,d,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=p(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,o,n,a,u,h,r)}else l.texSubImage2D(e,t,0,0,o,n,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,o,n,a,0,u,h,d)}else l.texImage2D(e,t,r,o,n,0,u,h,d)}}_compressedTexImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=p(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,o,n,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,o,n,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,o,n,a,0,s)}else l.compressedTexImage2D(e,t,r,o,n,0,s)}async _compressOnWorker(t){if(!e.compressionWorkerHandle||!e.compressionWorkerHandle.isCompressible(t))return;const r=!!this._descriptor.context.capabilities.compressedTextureETC,i=!!this._descriptor.context.capabilities.compressedTextureS3TC;if(r||i){const o=new AbortController;this._compressionAbortController=o;const n=this._descriptor.compressionHandle;n.increment();const s=this._descriptor.compressionCallback,l={data:await createImageBitmap(t,{imageOrientation:this.descriptor.flipped?"flipY":"none"}),width:t.width,height:t.height,premultiplyAlpha:this._descriptor.preMultiplyAlpha,hasMipmap:this._descriptor.hasMipmap,hasETC:!!r,hasS3TC:!!i};e.compressionWorkerHandle.invoke(l,this._compressionAbortController.signal).then((e=>{e&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=e.internalFormat,this._setData(e.compressedTexture),s?.()),o===this._compressionAbortController&&(this._compressionAbortController=null),n.decrement()})).catch((e=>{(0,a.zf)(e)||o!==this._compressionAbortController||(this._compressionAbortController=null),n.decrement()}))}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:s}=this._descriptor;const c=s===l.Ap.TEXTURE_3D;if(null==r||null==o||c&&null==n)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||c&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),c&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;r===l.Cj.LINEAR_MIPMAP_NEAREST||r===l.Cj.LINEAR_MIPMAP_LINEAR?(r=l.Cj.LINEAR,e.hasMipmap||(i=l.Cj.LINEAR)):r!==l.Cj.NEAREST_MIPMAP_NEAREST&&r!==l.Cj.NEAREST_MIPMAP_LINEAR||(r=l.Cj.NEAREST,e.hasMipmap||(i=l.Cj.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
919
+ }`);break;default:(0,o.Xb)(t.pbrMode);case c.A9.COUNT:}}(0,a.vt)()},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>n,SY:()=>l,mb:()=>a});var i=r(38954),o=r(51850);function n({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:n,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.p)(s,o.uY))&&null==l&&(null==n||1===n)&&(null==r||1===r)}const a=(0,o.CN)(1,1,.5),s=(0,o.CN)(0,.6,.2),l=(0,o.CN)(0,1,.2)},75039:(e,t,r)=>{var i;r.d(t,{d:()=>i}),function(e){e[e.Mesh=0]="Mesh",e[e.Point=1]="Point",e[e.Line=2]="Line"}(i||(i={}))},76284:(e,t,r)=>{r.d(t,{g:()=>x});var i=r(49186),o=(r(44208),r(53966)),n=r(97768),a=r(74887),s=r(94656),l=r(63907),c=r(36421),d=r(67171);function u(e){(null!=e.width&&e.width<0||null!=e.height&&e.height<0||null!=e.depth&&e.depth<0)&&o.A.getLogger("esri/views/webgl/textureUtils").error("Negative dimension parameters are not allowed!")}function h(e){return null!=e&&"type"in e&&"compressed"===e.type}function m(e){return null!=e&&!h(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function p(e){return e===l.Ap.TEXTURE_3D||e===l.Ap.TEXTURE_2D_ARRAY}function f(e,t,r,i=1){let o=Math.max(t,r);return e===l.Ap.TEXTURE_3D&&(o=Math.max(o,i)),Math.floor(Math.log2(o))+1}function v(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case l.ld.FLOAT:switch(e.pixelFormat){case l.Ab.RGBA:return l.H0.RGBA32F;case l.Ab.RGB:return l.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case l.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case l.Ab.RGBA:return l.H0.RGBA8;case l.Ab.RGB:return l.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=t===l.j7.DEPTH_STENCIL?l.iE.DEPTH24_STENCIL8:t===l.j7.DEPTH_COMPONENT?l.SB.DEPTH_COMPONENT24:t,e.internalFormat}class g extends d.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=l.Ab.RED;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=l.Ab.RED_INTEGER}}static validate(e,t){return new g(e,t)}}const _=()=>o.A.getLogger("esri/views/webgl/Texture");let x=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=c.p.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=g.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}this._descriptor.target===l.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,d.e)(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController}dispose(){this.abortCompression(),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===l.Ap.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e,t){this._descriptor.compressionHandle=e,this._descriptor.compressionCallback=t}disableCompression(){this._descriptor.compressionHandle=null,this._descriptor.compressionCallback=null}setData(e){this.abortCompression(),!h(e)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in l.CQ&&(this._descriptor.internalFormat=void 0),this._setData(e),!h(e)&&this._descriptor.compressionHandle&&this._compressOnWorker(e)}updateData(t,r,o,n,a,s,l=0){s||_().error("An attempt to use uninitialized data!"),this._glName||_().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=v(c);const{context:d,pixelFormat:u,dataType:p,target:f,isImmutable:g}=c;if(g&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const x=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||r+n>c.width||o+a>c.height)&&_().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=d;l&&(n&&a||_().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,l)),m(s)?T.texSubImage2D(f,t,r,o,n,a,u,p,s):h(s)?T.compressedTexSubImage2D(f,t,r,o,n,a,c.internalFormat,s.levels[t]):T.texSubImage2D(f,t,r,o,n,a,u,p,s),l&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),d.bindTexture(x,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,o,n,a,s,l,c){c||_().error("An attempt to use uninitialized data!"),this._glName||_().error("An attempt to update an uninitialized texture!");const d=this._descriptor;d.internalFormat=v(d);const{context:u,pixelFormat:m,dataType:f,isImmutable:g,target:x}=d;if(g&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");p(x)||_().warn("Attempting to set 3D texture data on a non-3D texture");const T=u.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||n<0||r+a>d.width||o+s>d.height||n+l>d.depth)&&_().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:b}=u;if(h(c))c=c.levels[t],b.compressedTexSubImage3D(x,t,r,o,n,a,s,l,d.internalFormat,c);else{const e=c;b.texSubImage3D(x,t,r,o,n,a,s,l,m,f,e)}u.bindTexture(T,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,u(t)}t.samplingMode===l.Cj.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=l.Cj.LINEAR_MIPMAP_NEAREST):t.samplingMode===l.Cj.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=l.Cj.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,u(e)}e.samplingMode===l.Cj.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=l.Cj.LINEAR):e.samplingMode===l.Cj.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=l.Cj.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,u(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController=(0,n.DC)(this._compressionAbortController))}_setData(t,r){const o=this._descriptor,n=o.context?.gl;if(!n)return;(0,s.Y2)(n),this._glName||(this._glName=n.createTexture(),o.context.instanceCounter.increment(l.vt.Texture,this)),u(o);const a=o.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);o.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,s.Y2)(n);const c=r??o.target,d=p(c);if(m(t))this._setDataFromTexImageSource(t,c);else{const{width:e,height:r,depth:a}=o;if(null==e||null==r)throw new i.A("texture:missing-size","Width and height must be specified!");if(d&&null==a)throw new i.A("texture:missing-depth","Depth must be specified!");if(o.internalFormat=v(o),o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,o.internalFormat,o.hasMipmap,e,r,a),h(t)){if(null==(f=o.internalFormat)||!(f in l.CQ))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,o.internalFormat,c)}else this._texImage(c,0,o.internalFormat,e,r,a,t),(0,s.Y2)(n),o.hasMipmap&&this.generateMipmap()}var f;this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),(0,s.Y2)(n),o.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=l.Ap.TEXTURE_CUBE_MAP_POSITIVE_X;t<=l.Ap.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=v(i);const o=p(t),{width:n,height:a,depth:l}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=n),i.height||(i.height=a),o&&i.depth,o&&(i.depth=l),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,n,a,l),this._texImage(t,0,i.internalFormat,n,a,l,e),(0,s.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,s.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:o,height:n,depth:a}=i,s=e.levels,c=f(r,o,n,a),d=Math.min(c,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,l.H3.MAX_LEVEL,d),this._forEachMipmapLevel(((e,i,o,n)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,o,n,a)}),d)}_texStorage(e,t,r,o,n,a){const{gl:s}=this._descriptor.context;if(!(c=t,c in l.H0||function(e){return e in l.SB}(t)||function(e){return e in l.iE}(t)))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");var c;if(!this._descriptor.isImmutable)return;const d=r?f(e,o,n,a):1;if(p(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,d,t,o,n,a)}else s.texStorage2D(e,d,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=p(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,o,n,a,u,h,r)}else l.texSubImage2D(e,t,0,0,o,n,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,o,n,a,0,u,h,d)}else l.texImage2D(e,t,r,o,n,0,u,h,d)}}_compressedTexImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=p(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,o,n,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,o,n,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,o,n,a,0,s)}else l.compressedTexImage2D(e,t,r,o,n,0,s)}async _compressOnWorker(t){if(!e.compressionWorkerHandle||!e.compressionWorkerHandle.isCompressible(t))return;const r=!!this._descriptor.context.capabilities.compressedTextureETC,i=!!this._descriptor.context.capabilities.compressedTextureS3TC;if(r||i){const o=new AbortController;this._compressionAbortController=o;const n=this._descriptor.compressionHandle;n.increment();const s=this._descriptor.compressionCallback,l={data:await createImageBitmap(t,{imageOrientation:this.descriptor.flipped?"flipY":"none"}),width:t.width,height:t.height,premultiplyAlpha:this._descriptor.preMultiplyAlpha,hasMipmap:this._descriptor.hasMipmap,hasETC:!!r,hasS3TC:!!i};e.compressionWorkerHandle.invoke(l,this._compressionAbortController.signal).then((e=>{e&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=e.internalFormat,this._setData(e.compressedTexture),s?.()),o===this._compressionAbortController&&(this._compressionAbortController=null),n.decrement()})).catch((e=>{(0,a.zf)(e)||o!==this._compressionAbortController||(this._compressionAbortController=null),n.decrement()}))}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:s}=this._descriptor;const c=s===l.Ap.TEXTURE_3D;if(null==r||null==o||c&&null==n)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||c&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),c&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;r===l.Cj.LINEAR_MIPMAP_NEAREST||r===l.Cj.LINEAR_MIPMAP_LINEAR?(r=l.Cj.LINEAR,e.hasMipmap||(i=l.Cj.LINEAR)):r!==l.Cj.NEAREST_MIPMAP_NEAREST&&r!==l.Cj.NEAREST_MIPMAP_LINEAR||(r=l.Cj.NEAREST,e.hasMipmap||(i=l.Cj.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
920
920
  vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,new s.W("slicePlaneOrigin",((e,r)=>v(t,e,r))),new s.W("slicePlaneBasis1",((e,r)=>g(t,e,r,r.slicePlane?.basis1))),new s.W("slicePlaneBasis2",((e,r)=>g(t,e,r,r.slicePlane?.basis2))))}function d(e,t){h(e,t,new s.W("slicePlaneOrigin",((e,r)=>v(t,e,r))),new s.W("slicePlaneBasis1",((e,r)=>g(t,e,r,r.slicePlane?.basis1))),new s.W("slicePlaneBasis2",((e,r)=>g(t,e,r,r.slicePlane?.basis2))))}r(65786).Y;const u=l.H`struct SliceFactors {
921
921
  float front;
922
922
  float side0;
@@ -1010,7 +1010,7 @@ return dot(rgba, RGBA4_2_FLOAT_FACTORS);
1010
1010
  }`)}},82048:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821),o=r(46540);function n(e,t=!0){e.attributes.add(o.r.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
1011
1011
  gl_Position = vec4(position, 0.0, 1.0);
1012
1012
  ${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
1013
- `)}},87170:(e,t,r)=>{r.d(t,{V:()=>C});var i=r(9093),o=r(38954),n=r(97146),a=r(57917),s=r(29920),l=r(69720),c=r(96672),d=r(51850),u=r(4341),h=r(11964);function m(e,t,r){return(0,o.d)(p,t,e),(0,o.d)(f,r,e),.5*(0,o.l)((0,o.e)(p,p,f))}r(32114),new u.I(h.vt),new u.I((()=>{return e?{p0:(0,d.o8)(e.p0),p1:(0,d.o8)(e.p1),p2:(0,d.o8)(e.p2)}:{p0:(0,d.vt)(),p1:(0,d.vt)(),p2:(0,d.vt)()};var e}));const p=(0,d.vt)(),f=(0,d.vt)(),v=(0,d.vt)(),g=(0,d.vt)(),_=(0,d.vt)(),x=(0,d.vt)();var T=r(24326),b=r(89192);class A{constructor(){this.uid=(0,T.c)()}}class E extends A{constructor(e){super(),this.highlightName=e,this.channel=b.Mg.Highlight}}var S=r(620),M=r(46540),w=r(94656);class C extends l.J{constructor(e,t,r=null,i=c.X.Mesh,o=null,a=-1){super(),this.material=e,this.mapPositions=r,this.type=i,this.objectAndLayerIdColor=o,this.edgeIndicesLength=a,this.highlights=new Set,this._highlightOptionsCounts=new Map,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,n.Dg)(r.indices)}),e===M.r.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new C(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)})),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,a.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,w.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===c.X.Mesh?this._computeAttachmentOriginTriangles(e):this.type===c.X.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.t)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.i)(t,0,0,0),(0,o.i)(x,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const l=n[e]*r,c=n[e+1]*r,d=n[e+2]*r;(0,o.i)(v,i[l],i[l+1],i[l+2]),(0,o.i)(g,i[c],i[c+1],i[c+2]),(0,o.i)(_,i[d],i[d+1],i[d+2]);const u=m(v,g,_);u?((0,o.g)(v,v,g),(0,o.g)(v,v,_),(0,o.h)(v,v,1/3*u),(0,o.g)(t,t,v),a+=u):((0,o.g)(x,x,v),(0,o.g)(x,x,g),(0,o.g)(x,x,_),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.h)(t,t,1/a),0):0===s||((0,o.h)(t,x,1/s),0)))}(this.attributes.get(M.r.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(M.r.POSITION);return function(e,t,r){if(!e)return!1;(0,o.i)(r,0,0,0),(0,o.i)(x,0,0,0);let i=0,n=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;v[0]=s[d],v[1]=s[d+1],v[2]=s[d+2],g[0]=s[u],g[1]=s[u+1],g[2]=s[u+2],(0,o.h)(v,(0,o.g)(v,v,g),.5);const h=(0,o.F)(v,g);h>0?((0,o.g)(r,r,(0,o.h)(v,v,h)),i+=h):0===i&&((0,o.g)(x,x,v),n++)}return 0!==i?((0,o.h)(r,r,1/i),!0):0!==n&&((0,o.h)(r,x,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.i)(t,0,0,0);let a=-1,s=0;for(let e=0;e<n.length;e++){const o=n[e]*r;a!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),a=o}return s>1&&(0,o.h)(t,t,1/s),s>0}(this.attributes.get(M.r.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(M.r.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===c.X.Mesh?3:1;(0,S.vA)(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,n.tM)(e.indices.length/t);return new s.j(r,t,e)}get transformation(){return this._transformation??i.zK}set transformation(e){this._transformation=e&&e!==i.zK?(0,i.o8)(e):null}get highlightNames(){return this._highlightOptionsCounts}get hasHighlights(){return this._highlightOptionsCounts.size>0}foreachHighlightOptions(e){this._highlightOptionsCounts.forEach(((t,r)=>e(r)))}allocateIdAndHighlight(e){const t=new E(e);return this.addHighlight(t)}addHighlight(e){this.highlights.add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts.get(t)??0)+1;return this._highlightOptionsCounts.set(t,r),e}removeHighlight(e){if(this.highlights.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts.get(t)??0;r<=1?this._highlightOptionsCounts.delete(t):this._highlightOptionsCounts.set(t,r-1)}}}},89192:(e,t,r)=>{var i,o,n,a,s,l,c,d;r.d(t,{Am:()=>a,C7:()=>n,JS:()=>d,Mg:()=>l,dd:()=>s,it:()=>o,s2:()=>i,sf:()=>c}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee"}(l||(l={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(c||(c={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(d||(d={}))},89786:(e,t,r)=>{function i(e){const t=3.141592653589793,r=.3183098861837907;e.vertex.constants.add("PI","float",t),e.fragment.constants.add("PI","float",t),e.fragment.constants.add("LIGHT_NORMALIZATION","float",r),e.fragment.constants.add("INV_PI","float",r),e.fragment.constants.add("HALF_PI","float",1.570796326794897),e.fragment.constants.add("TWO_PI","float",6.28318530717958)}r.d(t,{p:()=>i})},90644:(e,t,r)=>{r.d(t,{Ey:()=>E,RC:()=>s,T8:()=>l,Uy:()=>h,Xt:()=>u,kn:()=>m,p3:()=>a});var i=r(89192),o=r(63907);function n(e,t,r=o.Tb.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function a(e,t,r,i,n=o.Tb.ADD,a=o.Tb.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}n(o.dn.ZERO,o.dn.ONE_MINUS_SRC_ALPHA),n(o.dn.ONE,o.dn.ZERO),n(o.dn.ONE,o.dn.ONE);const s=n(o.dn.ONE,o.dn.ONE_MINUS_SRC_ALPHA),l=a(o.dn.SRC_ALPHA,o.dn.ONE,o.dn.ONE_MINUS_SRC_ALPHA,o.dn.ONE_MINUS_SRC_ALPHA),c={face:o.Y7.BACK,mode:o.Ac.CCW},d={face:o.Y7.FRONT,mode:o.Ac.CCW},u=e=>e===i.s2.Back?c:e===i.s2.Front?d:null,h={zNear:0,zFar:1},m={r:!0,g:!0,b:!0,a:!0};function p(e){return w.intern(e)}function f(e){return R.intern(e)}function v(e){return O.intern(e)}function g(e){return N.intern(e)}function _(e){return D.intern(e)}function x(e){return H.intern(e)}function T(e){return B.intern(e)}function b(e){return z.intern(e)}function A(e){return V.intern(e)}function E(e){return j.intern(e)}class S{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function M(e){return"["+e.join(",")+"]"}const w=new S(C,(e=>({__tag:"Blending",...e})));function C(e){return e?M([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const R=new S(I,(e=>({__tag:"Culling",...e})));function I(e){return e?M([e.face,e.mode]):null}const O=new S(y,(e=>({__tag:"PolygonOffset",...e})));function y(e){return e?M([e.factor,e.units]):null}const N=new S(P,(e=>({__tag:"DepthTest",...e})));function P(e){return e?M([e.func]):null}const D=new S(L,(e=>({__tag:"StencilTest",...e})));function L(e){return e?M([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const H=new S(F,(e=>({__tag:"DepthWrite",...e})));function F(e){return e?M([e.zNear,e.zFar]):null}const B=new S(G,(e=>({__tag:"ColorWrite",...e})));function G(e){return e?M([e.r,e.g,e.b,e.a]):null}const z=new S(U,(e=>({__tag:"StencilWrite",...e})));function U(e){return e?M([e.mask]):null}const V=new S(W,(e=>({__tag:"DrawBuffers",...e})));function W(e){return e?M(e.buffers):null}const j=new S((function(e){return e?M([C(e.blending),I(e.culling),y(e.polygonOffset),P(e.depthTest),L(e.stencilTest),F(e.depthWrite),G(e.colorWrite),U(e.stencilWrite),W(e.drawBuffers)]):null}),(e=>({blending:p(e.blending),culling:f(e.culling),polygonOffset:v(e.polygonOffset),depthTest:g(e.depthTest),stencilTest:_(e.stencilTest),depthWrite:x(e.depthWrite),colorWrite:T(e.colorWrite),stencilWrite:b(e.stencilWrite),drawBuffers:A(e.drawBuffers)})))},92700:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821),o=r(46540);function n(e,t){t.hasVertexColors?(e.attributes.add(o.r.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
1013
+ `)}},87170:(e,t,r)=>{r.d(t,{V:()=>w});var i=r(24326),o=r(9093),n=r(38954),a=r(97146),s=r(57917),l=r(29920),c=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,n.d)(m,t,e),(0,n.d)(p,r,e),.5*(0,n.l)((0,n.e)(m,m,p))}r(32114),new d.I(u.vt),new d.I((()=>{return e?{p0:(0,c.o8)(e.p0),p1:(0,c.o8)(e.p1),p2:(0,c.o8)(e.p2)}:{p0:(0,c.vt)(),p1:(0,c.vt)(),p2:(0,c.vt)()};var e}));const m=(0,c.vt)(),p=(0,c.vt)(),f=(0,c.vt)(),v=(0,c.vt)(),g=(0,c.vt)(),_=(0,c.vt)();var x=r(75039),T=r(89192);class b{constructor(){this.uid=(0,i.c)()}}class A extends b{constructor(e){super(),this.highlightName=e,this.channel=T.Mg.Highlight}}var E=r(620),S=r(46540),M=r(94656);class w{constructor(e,t,r=null,o=x.d.Mesh,n=null,s=-1){this.material=e,this.mapPositions=r,this.type=o,this.objectAndLayerIdColor=n,this.edgeIndicesLength=s,this.highlights=new Set,this._highlightOptionsCounts=new Map,this.id=(0,i.c)(),this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,a.Dg)(r.indices)}),e===S.r.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new w(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)})),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,s.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,M.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===x.d.Mesh?this._computeAttachmentOriginTriangles(e):this.type===x.d.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,n.t)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.i)(t,0,0,0),(0,n.i)(_,0,0,0);let a=0,s=0;for(let e=0;e<o.length-2;e+=3){const l=o[e]*r,c=o[e+1]*r,d=o[e+2]*r;(0,n.i)(f,i[l],i[l+1],i[l+2]),(0,n.i)(v,i[c],i[c+1],i[c+2]),(0,n.i)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,n.g)(f,f,v),(0,n.g)(f,f,g),(0,n.h)(f,f,1/3*u),(0,n.g)(t,t,f),a+=u):((0,n.g)(_,_,f),(0,n.g)(_,_,v),(0,n.g)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,n.h)(t,t,1/a),0):0===s||((0,n.h)(t,_,1/s),0)))}(this.attributes.get(S.r.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(S.r.POSITION);return function(e,t,r){if(!e)return!1;(0,n.i)(r,0,0,0),(0,n.i)(_,0,0,0);let i=0,o=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,n.h)(f,(0,n.g)(f,f,v),.5);const h=(0,n.F)(f,v);h>0?((0,n.g)(r,r,(0,n.h)(f,f,h)),i+=h):0===i&&((0,n.g)(_,_,f),o++)}return 0!==i?((0,n.h)(r,r,1/i),!0):0!==o&&((0,n.h)(r,_,1/o),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:o}=e;(0,n.i)(t,0,0,0);let a=-1,s=0;for(let e=0;e<o.length;e++){const n=o[e]*r;a!==n&&(t[0]+=i[n],t[1]+=i[n+1],t[2]+=i[n+2],s++),a=n}return s>1&&(0,n.h)(t,t,1/s),s>0}(this.attributes.get(S.r.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(S.r.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===x.d.Mesh?3:1;(0,E.vA)(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,a.tM)(e.indices.length/t);return new l.j(r,t,e)}get transformation(){return this._transformation??o.zK}set transformation(e){this._transformation=e&&e!==o.zK?(0,o.o8)(e):null}get highlightNames(){return this._highlightOptionsCounts}get hasHighlights(){return this._highlightOptionsCounts.size>0}foreachHighlightOptions(e){this._highlightOptionsCounts.forEach(((t,r)=>e(r)))}allocateIdAndHighlight(e){const t=new A(e);return this.addHighlight(t)}addHighlight(e){this.highlights.add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts.get(t)??0)+1;return this._highlightOptionsCounts.set(t,r),e}removeHighlight(e){if(this.highlights.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts.get(t)??0;r<=1?this._highlightOptionsCounts.delete(t):this._highlightOptionsCounts.set(t,r-1)}}}},89192:(e,t,r)=>{var i,o,n,a,s,l,c,d;r.d(t,{Am:()=>a,C7:()=>n,JS:()=>d,Mg:()=>l,dd:()=>s,it:()=>o,s2:()=>i,sf:()=>c}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(n||(n={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(a||(a={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee"}(l||(l={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(c||(c={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(d||(d={}))},89786:(e,t,r)=>{function i(e){const t=3.141592653589793,r=.3183098861837907;e.vertex.constants.add("PI","float",t),e.fragment.constants.add("PI","float",t),e.fragment.constants.add("LIGHT_NORMALIZATION","float",r),e.fragment.constants.add("INV_PI","float",r),e.fragment.constants.add("HALF_PI","float",1.570796326794897),e.fragment.constants.add("TWO_PI","float",6.28318530717958)}r.d(t,{p:()=>i})},90644:(e,t,r)=>{r.d(t,{Ey:()=>E,RC:()=>s,T8:()=>l,Uy:()=>h,Xt:()=>u,kn:()=>m,p3:()=>a});var i=r(89192),o=r(63907);function n(e,t,r=o.Tb.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function a(e,t,r,i,n=o.Tb.ADD,a=o.Tb.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:a,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}n(o.dn.ZERO,o.dn.ONE_MINUS_SRC_ALPHA),n(o.dn.ONE,o.dn.ZERO),n(o.dn.ONE,o.dn.ONE);const s=n(o.dn.ONE,o.dn.ONE_MINUS_SRC_ALPHA),l=a(o.dn.SRC_ALPHA,o.dn.ONE,o.dn.ONE_MINUS_SRC_ALPHA,o.dn.ONE_MINUS_SRC_ALPHA),c={face:o.Y7.BACK,mode:o.Ac.CCW},d={face:o.Y7.FRONT,mode:o.Ac.CCW},u=e=>e===i.s2.Back?c:e===i.s2.Front?d:null,h={zNear:0,zFar:1},m={r:!0,g:!0,b:!0,a:!0};function p(e){return w.intern(e)}function f(e){return R.intern(e)}function v(e){return O.intern(e)}function g(e){return N.intern(e)}function _(e){return D.intern(e)}function x(e){return H.intern(e)}function T(e){return B.intern(e)}function b(e){return z.intern(e)}function A(e){return V.intern(e)}function E(e){return j.intern(e)}class S{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function M(e){return"["+e.join(",")+"]"}const w=new S(C,(e=>({__tag:"Blending",...e})));function C(e){return e?M([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const R=new S(I,(e=>({__tag:"Culling",...e})));function I(e){return e?M([e.face,e.mode]):null}const O=new S(y,(e=>({__tag:"PolygonOffset",...e})));function y(e){return e?M([e.factor,e.units]):null}const N=new S(P,(e=>({__tag:"DepthTest",...e})));function P(e){return e?M([e.func]):null}const D=new S(L,(e=>({__tag:"StencilTest",...e})));function L(e){return e?M([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const H=new S(F,(e=>({__tag:"DepthWrite",...e})));function F(e){return e?M([e.zNear,e.zFar]):null}const B=new S(G,(e=>({__tag:"ColorWrite",...e})));function G(e){return e?M([e.r,e.g,e.b,e.a]):null}const z=new S(U,(e=>({__tag:"StencilWrite",...e})));function U(e){return e?M([e.mask]):null}const V=new S(W,(e=>({__tag:"DrawBuffers",...e})));function W(e){return e?M(e.buffers):null}const j=new S((function(e){return e?M([C(e.blending),I(e.culling),y(e.polygonOffset),P(e.depthTest),L(e.stencilTest),F(e.depthWrite),G(e.colorWrite),U(e.stencilWrite),W(e.drawBuffers)]):null}),(e=>({blending:p(e.blending),culling:f(e.culling),polygonOffset:v(e.polygonOffset),depthTest:g(e.depthTest),stencilTest:_(e.stencilTest),depthWrite:x(e.depthWrite),colorWrite:T(e.colorWrite),stencilWrite:b(e.stencilWrite),drawBuffers:A(e.drawBuffers)})))},92700:(e,t,r)=>{r.d(t,{c:()=>n});var i=r(31821),o=r(46540);function n(e,t){t.hasVertexColors?(e.attributes.add(o.r.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
1014
1014
  void forwardNormalizedVertexColor() {}`)}},92993:(e,t,r)=>{var i;r.d(t,{n:()=>i}),function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"}(i||(i={}))},94656:(e,t,r)=>{r.d(t,{Y2:()=>d,en:()=>c});var i=r(49186),o=r(44208),n=r(53966),a=r(63907);const s=()=>n.A.getLogger("esri.views.webgl.checkWebGLError"),l=!!(0,o.A)("enable-feature:webgl-debug");function c(){return l}function d(e){if(c()){const t=e.getError();if(t){const e=function(e){switch(e){case a.bh.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case a.bh.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case a.bh.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case a.bh.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case a.bh.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case a.bh.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(t),r=(new Error).stack;s().error(new i.A("webgl-error","WebGL error occurred",{message:e,stack:r}))}}}},95774:(e,t,r)=>{r.d(t,{S:()=>m,b:()=>h});var i=r(82048),o=r(52540),n=r(68259),a=r(20304),s=r(31821),l=r(15976),c=r(63761),d=r(14113);const u=4;function h(){const e=new d.N5,t=e.fragment;e.include(i.c);const r=(u+1)/2,h=1/(2*r*r);return t.include(o.E),t.uniforms.add(new c.N("depthMap",(e=>e.depthTexture)),new l.o("tex",(e=>e.colorTexture)),new n.t("blurSize",(e=>e.blurSize)),new a.m("projScale",((e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale}))),t.code.add(s.H`
1015
1015
  void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
1016
1016
  float c = texture(tex, uv).r;
@@ -1039,7 +1039,7 @@ void forwardNormalizedVertexColor() {}`)}},92993:(e,t,r)=>{var i;r.d(t,{n:()=>i}
1039
1039
  float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r;
1040
1040
  float linearDepth = linearizeDepth(depth);
1041
1041
  ${t?"return viewPosDepth < linearDepth && depth < 1.0;":`if(viewPosDepth ${a?">":"<="} linearDepth) discard;`}
1042
- }`)}},96672:(e,t,r)=>{var i;r.d(t,{X:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(i||(i={}))},97220:(e,t,r)=>{r.d(t,{$:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>n,O4:()=>a,Vt:()=>s});var i=r(23205),o=r(31821);function n(e){e.uniforms.add(new i.d("mainLightDirection",(e=>e.lighting.mainLight.direction)))}function a(e){e.uniforms.add(new i.d("mainLightIntensity",(e=>e.lighting.mainLight.intensity)))}function s(e){n(e.fragment),a(e.fragment),e.fragment.code.add(o.H`vec3 applyShading(vec3 shadingNormalWorld, float shadow) {
1042
+ }`)}},97220:(e,t,r)=>{r.d(t,{$:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>n,O4:()=>a,Vt:()=>s});var i=r(23205),o=r(31821);function n(e){e.uniforms.add(new i.d("mainLightDirection",(e=>e.lighting.mainLight.direction)))}function a(e){e.uniforms.add(new i.d("mainLightIntensity",(e=>e.lighting.mainLight.intensity)))}function s(e){n(e.fragment),a(e.fragment),e.fragment.code.add(o.H`vec3 applyShading(vec3 shadingNormalWorld, float shadow) {
1043
1043
  float dotVal = clamp(dot(shadingNormalWorld, mainLightDirection), 0.0, 1.0);
1044
1044
  return mainLightIntensity * ((1.0 - shadow) * dotVal);
1045
1045
  }`)}},98958:(e,t,r)=>{r.d(t,{w:()=>d});var i=r(53966),o=r(97768),n=r(39341),a=(r(44208),r(94656));class s{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._glProgram=e.programCache.acquire(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear()}bindTexture(e,t){t?.glName||((0,a.en)()&&console.error(`Texture sampler ${e} has no given Texture in ${(new Error).stack} `),t=this._context.emptyTexture);const r=this._ensureTextureUnit(e,t);this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var l=r(63907),c=r(90644);class d{constructor(e,t,r,a=n.D){this.locations=a,this.primitiveType=l.WR.TRIANGLES,this.key=t.key,this._program=new s(e.rctx,r.get().build(t),a),this._pipeline=this.initializePipeline(t),this.reload=async n=>{n&&await r.reload(),this.key.equals(t.key)||i.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn("Configuration was changed after construction, cannot reload shader.",r),(0,o.WD)(this._program),this._program=new s(e.rctx,r.get().build(t),a),this._pipeline=this.initializePipeline(t)}}destroy(){this._program=(0,o.WD)(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return(0,c.Ey)({blending:c.RC,colorWrite:c.kn})}}},99208:(e,t,r)=>{r.d(t,{r:()=>a});var i=r(53466),o=r(31821);function n(e){e.fragment.code.add(o.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5404],{95404:(e,r,t)=>{t.d(r,{computeObjectLayerResourceSize:()=>u}),t(78888);var i=t(49186),o=t(66344),n=t(51850),s=t(70328),l=t(8887);let c=new o.q(50);async function u(e,r=null){if(!e.isPrimitive){const r=e.resource?.href;if(!r)throw new i.A("symbol:invalid-resource","The symbol does not have a valid resource");const o=c.get(r);if(void 0!==o)return o;const{fetch:l}=await Promise.all([t.e(6213),t.e(3030),t.e(2944),t.e(9899),t.e(3383),t.e(1349)]).then(t.bind(t,64304)),u=await l(r,{disableTextures:!0,spherical:!0}),a=(0,s.Ej)(u.referenceBoundingBox,(0,n.vt)());return c.put(r,a),a}if(!e.resource?.primitive)throw new i.A("symbol:invalid-resource","The symbol does not have a valid resource");const o=(0,s.vt)((0,l.Fq)(e.resource.primitive));if(null!=r)for(let e=0;e<o.length;e++)o[e]*=r;return(0,s.Ej)(o,(0,n.vt)())}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5404],{95404:(e,r,t)=>{t.d(r,{computeObjectLayerResourceSize:()=>u}),t(78888);var i=t(49186),o=t(66344),n=t(51850),s=t(70328),l=t(8887);let c=new o.q(50);async function u(e,r=null){if(!e.isPrimitive){const r=e.resource?.href;if(!r)throw new i.A("symbol:invalid-resource","The symbol does not have a valid resource");const o=c.get(r);if(void 0!==o)return o;const{fetch:l}=await Promise.all([t.e(6213),t.e(3030),t.e(2944),t.e(9899),t.e(7944),t.e(1349)]).then(t.bind(t,64304)),u=await l(r,{disableTextures:!0,spherical:!0}),a=(0,s.Ej)(u.referenceBoundingBox,(0,n.vt)());return c.put(r,a),a}if(!e.resource?.primitive)throw new i.A("symbol:invalid-resource","The symbol does not have a valid resource");const o=(0,s.vt)((0,l.Fq)(e.resource.primitive));if(null!=r)for(let e=0;e<o.length;e++)o[e]*=r;return(0,s.Ej)(o,(0,n.vt)())}}}]);