@arcgis/core 5.1.0-next.100 → 5.1.0-next.102

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 (158) hide show
  1. package/arcgisGlobal.d.ts +1449 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0d81409721d29d8bc276.js +1 -0
  4. package/assets/esri/core/workers/chunks/{9478a0478fb49a88685e.js → 119b84f5349f90d1dd28.js} +1 -1
  5. package/assets/esri/core/workers/chunks/15167eeb6d7dbe7e392d.js +1 -0
  6. package/assets/esri/core/workers/chunks/{6881ae969b48bd04f064.js → 1ba37706e5d5eaabcb8e.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{889a0405e3cdfa59b8e7.js → 1faa8a42d5a437fc40a3.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{40137b23d8ad4af7ff9c.js → 3996149146dd1eca7cc5.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{38b1d2ffcc318ac0119d.js → 48fcc10768d93e95a04e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{e7637d6a8ce0af46843c.js → 55ccb8ed7325efb62091.js} +2 -2
  11. package/assets/esri/core/workers/chunks/{2b2e5628d08d0e3108d2.js → 5663df3cd1dfd4b43c73.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{0253292939b981134663.js → 5bc299f7f89a07a6e6a6.js} +1 -1
  13. package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +1 -0
  14. package/assets/esri/core/workers/chunks/{d345030a89914348d3c5.js → 6f96ce41c47cae82e687.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{b6b6f190687813267d77.js → 7db09c5bf024242becfa.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{df232b8aa77f7e3285e3.js → 86bff154d46f8a562887.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{07ddf1b1f7602063ceb0.js → 8f9117d589de7caaa02d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{2ad7c221ad317706387a.js → 9e7c84a3a2abec4d49df.js} +2 -2
  19. package/assets/esri/core/workers/chunks/{490e4a648cb2ab3e7956.js → a318cf6bb900e0ee268c.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{3ba29e7cf9fba3aa5f41.js → b1b8a7c00ec4d998ab84.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{fff4b9e43464ebb3fb4e.js → bb5512ecb5300d45d46b.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{d8c4fb66c733ab2f66d3.js → bb81da98546c4d923e0d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{765ee0f2bfcec6d5bcc6.js → bc6a809a965355eb425f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{53ff47c06ccfc0be885c.js → d30790c69724258dab2b.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{7a20941913d0115cfe26.js → de25311b6d13bf1c6089.js} +2 -2
  26. package/assets/esri/core/workers/chunks/{9940b318f38ea9d7a533.js → e86c073f0b6d395c7a38.js} +1 -1
  27. package/assets/esri/core/workers/chunks/f5bd0a4f82df5e942b70.js +1 -0
  28. package/assets/esri/core/workers/chunks/{b8d10d8db44c7c6acebe.js → fa38dc5010f8630a80fe.js} +1 -1
  29. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +125 -0
  30. package/assets/esri/themes/base/widgets/_Directions.scss +5 -1
  31. package/assets/esri/themes/dark/main.css +1 -1
  32. package/assets/esri/themes/light/main.css +1 -1
  33. package/assets/esri/themes/light/view.css +1 -1
  34. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  35. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  36. package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer.json +1 -1
  37. package/chunks/GaussianSplatShadow.glsl.js +39 -0
  38. package/chunks/GlobalIllumination.glsl.js +1 -1
  39. package/config.js +1 -1
  40. package/form/elements/inputs/MultipleChoiceInput.d.ts +5 -5
  41. package/form/elements/inputs/MultipleChoiceInput.js +1 -1
  42. package/interfaces.d.ts +17 -0
  43. package/kernel.js +1 -1
  44. package/layers/FeatureLayer.d.ts +29 -39
  45. package/layers/KnowledgeGraphLayer.d.ts +1 -1
  46. package/layers/KnowledgeGraphLayer.js +1 -1
  47. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  48. package/layers/OrientedImageryLayer.d.ts +233 -0
  49. package/layers/OrientedImageryLayer.js +1 -1
  50. package/layers/ParquetLayer.d.ts +73 -24
  51. package/layers/ParquetLayer.js +1 -1
  52. package/layers/SceneLayer.d.ts +2 -2
  53. package/layers/VideoLayer.d.ts +35 -9
  54. package/layers/VideoLayer.js +1 -1
  55. package/layers/catalog/CatalogFootprintLayer.d.ts +147 -0
  56. package/layers/graphics/sources/ParquetSource.js +1 -1
  57. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  58. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +3 -1
  59. package/layers/support/FeatureReductionBinning.d.ts +87 -9
  60. package/layers/support/FeatureReductionCluster.d.ts +87 -9
  61. package/layers/support/FieldConfiguration.d.ts +1 -1
  62. package/layers/support/ParquetFilesData.d.ts +46 -0
  63. package/layers/support/ParquetFilesData.js +2 -0
  64. package/layers/support/ParquetPortalItemData.d.ts +25 -0
  65. package/layers/support/ParquetPortalItemData.js +2 -0
  66. package/layers/support/SubtypeSublayer.d.ts +147 -0
  67. package/layers/support/TelemetryData.d.ts +5 -0
  68. package/layers/support/TelemetryData.js +1 -1
  69. package/layers/support/TelemetryDisplay.d.ts +10 -2
  70. package/layers/support/TelemetryDisplay.js +1 -1
  71. package/layers/support/parquetUtils.js +1 -1
  72. package/layers/support/types.d.ts +9 -0
  73. package/layers/video/VideoController.js +1 -1
  74. package/layers/video/types.d.ts +8 -1
  75. package/layers/video/videoUtils.js +1 -1
  76. package/networks/UtilityNetworkTraceAnalysis.d.ts +1 -1
  77. package/networks/UtilityNetworkTraceAnalysis.js +1 -1
  78. package/package.json +3 -3
  79. package/portal/jsonTypes.d.ts +7 -0
  80. package/renderers/support/ClassBreakInfo.d.ts +3 -3
  81. package/renderers/support/ClassBreakInfo.js +1 -1
  82. package/renderers/support/UniqueValueInfo.d.ts +3 -3
  83. package/renderers/support/UniqueValueInfo.js +1 -1
  84. package/rest/print.js +1 -1
  85. package/rest/support/PrintParameters.d.ts +8 -1
  86. package/rest/support/PrintParameters.js +1 -1
  87. package/support/revision.js +1 -1
  88. package/third-party-notices.txt +4 -0
  89. package/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter.js +1 -1
  90. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
  91. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
  92. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  93. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  94. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  95. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
  96. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
  97. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
  98. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
  99. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
  100. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
  101. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  102. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/surface.js +1 -1
  103. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  104. package/views/2d/layers/VideoLayerView2D.js +1 -1
  105. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  106. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  107. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  108. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  109. package/views/3d/webgl/RenderNode.js +1 -1
  110. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +5 -2
  111. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  112. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  113. package/views/3d/webgl-engine/lib/GaussianSplatShadowRenderNode.js +2 -0
  114. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  115. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  116. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  117. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  118. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +2 -0
  119. package/views/3d/webgl-engine/shaders/GaussianSplatShadowTechnique.js +2 -0
  120. package/views/3d/webgl.js +1 -1
  121. package/views/Viewport2DBaseMixin.js +1 -1
  122. package/widgets/Attachments/support/attachmentUtils.js +1 -1
  123. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +8 -1
  124. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  125. package/widgets/BatchAttributeForm/attachmentUtils.js +2 -0
  126. package/widgets/BatchAttributeForm/css.js +1 -1
  127. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  128. package/widgets/BatchAttributeForm/templates/RelationshipElementTemplate.js +1 -1
  129. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  130. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  131. package/widgets/BatchAttributeForm/types.d.ts +7 -0
  132. package/widgets/BatchAttributeForm.js +1 -1
  133. package/widgets/FeatureForm/RelationshipInput.d.ts +1 -1
  134. package/widgets/FeatureTable.js +1 -1
  135. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  136. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
  137. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  138. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  139. package/widgets/OrientedImageryViewer/constants.js +1 -1
  140. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  141. package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
  142. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
  143. package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
  144. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  145. package/widgets/OrientedImageryViewer/types.js +1 -1
  146. package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
  147. package/widgets/OrientedImageryViewer.js +1 -1
  148. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  149. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +9 -0
  150. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  151. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  152. package/widgets/support/forms/formUtils.js +1 -1
  153. package/assets/esri/core/workers/chunks/26f28406056ddc0e159c.js +0 -1
  154. package/assets/esri/core/workers/chunks/43cc82373be791b7cb4c.js +0 -1
  155. package/assets/esri/core/workers/chunks/b06cc59068d32baaaa87.js +0 -1
  156. package/assets/esri/core/workers/chunks/c9461568e1002ebac534.js +0 -1
  157. /package/assets/esri/core/workers/chunks/{e7637d6a8ce0af46843c.js.LICENSE.txt → 55ccb8ed7325efb62091.js.LICENSE.txt} +0 -0
  158. /package/assets/esri/core/workers/chunks/{7a20941913d0115cfe26.js.LICENSE.txt → de25311b6d13bf1c6089.js.LICENSE.txt} +0 -0
@@ -259,4 +259,4 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
259
259
  calculateOcclusionAndOutputHighlight();
260
260
  ${(0,c.If)(y,"outputObjectAndLayerIdColor();")}
261
261
  }
262
- `)}},26934(t,e,i){i.d(e,{Q:()=>n});var r=i(49788);function n(t){t.constants.add("alphaCutoff","float",r.Q)}},2016(t,e,i){i.d(e,{OG:()=>Dt,gP:()=>Rt});var r=i(5482),n=i(69540),s=i(91429);let o=class extends n.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,s.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),p=i(43937),f=i(36005);let g=class extends((0,n.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const n={position:t};return null!=e&&(n.heading=e),null!=i&&(n.tilt=i),null!=r&&(n.fov=r),n}return t}writePosition(t,e,i,r){const n=t.clone();n.x=(0,u.GB)(t.x||0),n.y=(0,u.GB)(t.y||0),n.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=n.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,s.MZ)({type:d.A,json:{write:{isRequired:!0}}})],g.prototype,"position",void 0),(0,r.Cg)([(0,p.K)("position")],g.prototype,"writePosition",null),(0,r.Cg)([(0,f.w)("position")],g.prototype,"readPosition",null),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>c.ie.normalize((0,u.GB)(t)))],g.prototype,"heading",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],g.prototype,"tilt",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],g.prototype,"fov",void 0),(0,r.Cg)([(0,s.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],g.prototype,"layout",void 0),g=(0,r.Cg)([(0,s.$K)("esri.Camera")],g);var m=i(9093),_=i(35522),v=i(51850),x=i(16930),y=(i(48353),i(9762),i(65806)),b=i(27993),w=i(73941),T=(i(19419),i(71351));i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var A=i(58083),M=i(48163),S=i(5443),C=i(39829),E=i(95108),R=i(37585);function I(t,e,i,r){const n=function(t,e){const i=0===e||2===e?0:1,r=t[e],n=0===e||1===e?1:-1,s=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===n?0:1;if(e[i]>r&&o[i]>r)return 1===n?1:0;const a=(o[s]-e[s])/(o[i]-e[i]),c=e[s]+a*(r-e[i]);return t[i]=r,t[s]=c,(e[i]<r?1:-1)*n>0?2:3}}(i,r);if(t.length=0,e.length){1===n(O,e[0],e[0])&&D(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(n(O,e[i],r)){case 1:D(t,r);break;case 3:D(t,(0,M.o8)(O));break;case 2:D(t,(0,M.o8)(O)),D(t,r)}}}}function D(t,e){0!==t.length&&(0,R.aI)(t.at(-1),e)||t.push(e)}const O=(0,M.vt)();var F=i(11964),P=i(27921);const N=(0,v.vt)(),B=(0,v.vt)();function L(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function U(t,e,i,r,n){let s=(0,_.S8)(N,t),o=(0,_.Om)(s,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(s,e),a&&(0,_.hs)(s,s,-1)):s=null);let c=0;if(s){(0,_.hs)(B,r,(0,_.Om)(r,s)),(0,_.Re)(s,s,B);const t=(0,_.Om)(s,n)/((0,_.Bw)(s)*(0,_.Bw)(n));(0,_.$A)(B,s,n),c=((0,_.Om)(B,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function H(t,e,i,r){(0,_.Re)(z,i,e),(0,P.T7)(r,(0,F.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),V=(0,v.fA)(0,1,0),G=(0,v.fA)(0,0,1),k=(0,m.vt)(),W=(0,v.vt)(),$=(0,v.vt)();function Z(t,e,i,r=L()){const{direction:n,up:s}=r;return(0,A.N9)(k,-(0,l.kU)(e)),(0,A.eL)(k,k,(0,l.kU)(i)),(0,_.Z0)(n,G,k),(0,_.hs)(n,n,-1),(0,_.Z0)(s,V,k),r}function j(t,e,i,r,n){const s=e.lines[11].direction,o=(n-i.getAltitude(r))/s[2];(0,_.Ln)(t,r,s,o)}const q=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return U(e,i,r,G,V)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n=Z(0,i,r),s=(0,v.vt)();return(0,_.hs)(s,n.direction,-e),(0,_.WQ)(s,s,t),{up:n.up,eye:s,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:Z,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,n=r.getAltitude(e),s=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,T.LV)(e.origin,e.direction),n,q)||j(q,i,r,e.endpoint,n),H(q,o,q,c),a.push((0,M.fA)(q[0],q[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(q,t[0],t[1],0),e.fromRenderCoords(q,q,i),[q[0],q[1]]));return r.length<=2?new C.A({spatialReference:i}):(r.push(r[0].slice()),(0,E.$3)(r)||r.reverse(),new C.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return I(i,t,e,0),I(r,i,e,1),I(i,r,e,2),I(r,i,e,3),r}(a,r.extent),r,s)},toExtent:function(t,e,i,r,n){const s=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,y.g)(e,W,s),(0,y.g)(e,$,s),W[0]-=i/2,$[0]+=i/2,W[1]-=r/2,$[1]+=r/2,(0,b.F)(W,s,W,o),(0,b.F)($,s,$,o),n?(n.xmin=W[0],n.ymin=W[1],n.xmax=$[0],n.ymax=$[1],n.spatialReference=o):n=new S.A(W[0],W[1],$[0],$[1],o),n}},Symbol.toStringTag,{value:"Module"}));var X=i(78955),Q=i(91829),Y=i(34304),K=i(17136),J=i(94008),tt=i(28735),et=i(82919);class it{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,et.vt)(),this._points=(0,et.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new J.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,et.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,et.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,et.m7)(this.frustum,t)}intersectsRay(t){return(0,et.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,et.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,et.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=st;(0,_.S8)(e,this.direction);const i=nt;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),n=this._boundingSphere,s=(0,_.Ln)(ot,t,e,r);n.center=s,n.radius=r}static{this.planePointIndices=et.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const nt=(0,v.vt)(),st=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new J.iy,(0,T.vt)(),new S.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),pt=(0,m.vt)(),ft=(0,v.vt)(),gt=(0,v.vt)();function mt(t,e,i,r=L()){(0,_.$A)(ft,t,ut),0===(0,_.Om)(ft,ft)&&(0,_.$A)(ft,t,dt),(0,A.$0)(pt,-(0,l.kU)(e),t),(0,A.e$)(pt,pt,-(0,l.kU)(i),ft);const{up:n,direction:s}=r;return(0,_.$A)(n,ft,t),(0,_.S8)(n,n),(0,_.Z0)(n,n,pt),(0,_.S8)(s,t),(0,_.ze)(s,s),(0,_.Z0)(s,s,pt),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=mt(e,t.heading,t.tilt);return t.up=i.up,t}function xt(t,e){const i=[],r=[],n=(0,Y.FD)();for(let s=0;s<t.length;s++){const o=t[s],a=s===t.length-1?t[0]:t[s+1],c=(0,F.Cr)(o,a,Ct),h=(0,P.vE)(e,c.origin,c.vector,0,Mt);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,s,a]=0===h?[1,i,r]:[-1,r,i],c=(0,P.Qj)(e),l=(0,_.Ln)((0,v.vt)(),Mt,c,t*n),u=(0,_.Ln)((0,v.vt)(),Mt,c,t*-n);s.push(o),s.push(l),a.push(u)}}}const s=[];return i.length&&s.push(i),r.length&&s.push(r),s}const yt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},bt=(0,v.fA)(1,0,0),wt=(0,v.fA)(0,1,0),Tt=(0,v.vt)(),At=(0,v.vt)(),Mt=(0,v.vt)(),St=new J.iy,Ct=(0,F.vt)(),Et=(0,Q.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const n=ft,s=gt;return(0,_.S8)(n,t),(0,_.$A)(gt,n,ut),0===(0,_.Om)(gt,gt)&&(0,_.$A)(gt,n,dt),(0,_.$A)(s,gt,n),U(e,i,r,n,s)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n={eye:(0,v.vt)(),up:null,tilt:r,heading:i},s=ft;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),p=Math.cos(c),f=(0,_.Bw)(s);let g;if(Math.abs(c)<1e-8)g=o+f;else{const t=f/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;g=t*Math.sin(i)}const m=p*o,x=o*o*(d*d),y=u*u*x,b=g-m,w=b*b,T=y*(y+w-s[1]*s[1]);if(T<0)return(0,_.hs)(n.eye,s,g/f),n.tilt=0,vt(n,t);const A=Math.sqrt(T),M=s[1]*b,S=y+w;let C;if(C=u>0?-A+M:A+M,Math.abs(S)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):(0,_.hs)(n.eye,s,g/f),n.tilt=0,_t(n.eye),vt(n,t);n.eye[1]=C/S;const E=h*h*x,R=d*o,I=u*R*n.eye[1],D=n.eye[1]*n.eye[1],O=1-D,F=Math.sqrt(O),P=y*D+E-2*I*F*b+O*w;return Math.abs(P)<1e-8?((0,_.hs)(n.eye,s,g/f),n.tilt=0,_t(n.eye),vt(n,t)):(n.eye[0]=(O*(g*s[0]-m*s[0])-R*F*(s[0]*n.eye[1]*u+s[2]*h))/P,n.eye[2]=(O*(g*s[2]-m*s[2])-R*F*(s[2]*n.eye[1]*u-s[0]*h))/P,(0,_.hs)(n.eye,n.eye,g),_t(n.eye),vt(n,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),n=(0,_.Bw)(e);return(0,l.YN)(i/(n/Math.sin(r)))+r},headingTiltToDirectionUp:mt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),n=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),s=(0,l.YN)(i/(n/Math.sin(t)));return(0,l.KJ)(t-s)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),n=new it(i);r.near=2,n.update(r);const s=i.getAltitude(e),o=t.spatialReference,a=i.referenceEllipsoid.radius,c=r.eye,h=1+(0,_.Io)(c,e)/(a+s),u=Math.sqrt(h*h-1),{minCurvature:d,maxCurvature:p,minSamples:f,maxSamples:g}=yt,m=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return St.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(St,e)}(t),x=(0,l.qE)((u-d)/(p-d),0,1),y=Math.round((0,l.Cc)(f,g,x)),b=r.aboveGround,w=n.planes[5],A=[],M=(0,P.O_)(v.uY,bt,(0,P.vt)()),S=(0,P.O_)(v.uY,wt,(0,P.vt)());(0,X.hZ)(Et,0,0,0,0);const R=t=>{};for(let t=0;t<4;t++){const e=1===t&&!b||3===t&&b?1-m:0,r=1===t&&b||3===t&&!b?m:1,o=n.lines[t],a=n.lines[3===t?0:t+1];for(let n=0;n<y;n++){const h=n/y,u=0===n?0:(0,l.Cc)(e,r,1===t?1-(1-h)**2:3===t?h**2:h),d=(0,_.Cc)(At,o.origin,a.origin,u),p=(0,lt.nu)(o.direction,a.direction,u,Tt);i.intersectManifoldClosestSilhouette((0,T.LV)(d,p),s,Mt),H(Mt,c,Mt,w),A.push((0,v.o8)(Mt)),0!==A.length&&R((0,_.lo)(A.at(-1),Mt));const f=((0,P.Tj)(M,Mt)?1:0)|((0,P.Tj)(S,Mt)?2:0);Et[f]=1}}A.length>2&&(0,_.lo)(A[0],A.at(-1));const I=function(t,e,i){const r=2*(0,Y.FD)();return t.map(t=>{const n=[];let s=!1;for(const o of t)e.fromRenderCoords(o,Mt,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(n.push([null,Mt[1]]),n.push([null,Mt[1]]),s=!0):n.push([Mt[0],Mt[1]]);if(s)for(let t=0;t<n.length;t++){const e=n[t];if(null!=e[0])continue;const i=n[t+1],r=n.at(0===t?-1:t-1);e[0]=r[0],t++;const s=n.at(t===n.length-1?0:t+1);i[0]=s[0]}return n.push(n[0]),(0,E.$3)(n)||n.reverse(),n})}((0,X.m3)(Et)>1?function(t,e){const i=[];for(const r of t)i.push(...xt(r,e));return i}(xt(A,M),S):[A],i,o);return new C.A({rings:I,spatialReference:o})},toExtent:function(t,e,i,r,n){let s,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,p=e.longitude,f=function(t,e,i){const r=e/i,n=(0,l.kU)(t),s=Math.sin(r/2),o=Math.cos(n),a=2*(0,l.YN)(Math.sqrt(s*s/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;s=p-f,o=p+f;const g=(0,l.kU)(u),m=(1+Math.sin(g))/(1-Math.sin(g)),_=(m+1)*Math.tan(r/d/2),v=_*_;function y(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*m+v))),h=a+r/d,a=y(a),h=y(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=K.Y_.monotonic(s,o),o-s>180){const t=(o-s-180)/2;s+=t,o-=t}const b=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:x.A.WGS84;return n?(n.xmin=s,n.ymin=a,n.xmax=o,n.ymax=h,n.spatialReference=b):n=new S.A(s,a,o,h,b),t.spatialReference&&t.spatialReference.isWebMercator&&(0,tt.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Rt={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},It=[Rt.FINAL,Rt.COMPOSITE,Rt.OPAQUE,Rt.TRANSPARENT],Dt={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_HIGHLIGHT:"shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VOXEL:"voxel",VIEWSHED:"viewshed"};Array.from(Object.values(Dt)).concat(It),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>M});var r=i(5482),n=i(69622),s=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),p=i(35522),f=i(51850),g=i(78955),m=i(91829),_=i(82919),v=i(71351),x=i(44280);function y(t,e,i){t.worldUpAtPosition(e,b),(0,p.Re)(w,i,e);const r=(0,p.Bw)(w);return 0===r?0:(0,o.XM)((0,p.Om)(w,b)/r)}const b=(0,f.vt)(),w=(0,f.vt)();var T;let A=T=class extends n.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,m.fA)(0,0,1,1),this._padding=(0,m.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,m.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,f.vt)(),this._up=(0,f.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,p.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,g.hs)((0,m.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,g.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,g.hs)((0,m.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,g.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){(0,g.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,g.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,p.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,n=i/this.rows,s=r/this.columns,o=-r/2+this.column*s,a=o+s,c=-i/2+this.row*n,u=c+n,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),p=this._get("projectionMatrix");return p&&(0,h.aI)(p,d)?p:d}copyFrom(t){(0,p.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,g.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,g.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,g.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&(0,g.t2)(this._viewport,t.viewport)&&(0,g.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,g.hG)(t.screenPadding,this.screenPadding)>=e||(0,g.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,p.jb)(E,t.eye,t.center),(0,p.jb)(R,this.eye,this.center);const i=(0,p.Om)(E,R),r=(0,p.uE)(E),n=(0,p.uE)(R),s=5e-4;return i*i>=(1-1e-10)*r*n&&(0,p.lo)(t.eye,this.eye)<Math.max(r,n)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,x.gr)(this.viewForward,(0,p.Re)(E,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==S&&(0,p.C)(S,t),S[3]=1,(0,g.Z0)(S,S,this.projectionMatrix);const i=Math.abs(S[3]);(0,p.hs)(S,S,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*S[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*S[1]),e[2]=.5*(S[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;S[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],S[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],S[2]=(2*t[2]-1)*t[3],S[3]=t[3],null!=this.inverseProjectionMatrix&&((0,g.Z0)(S,S,this.inverseProjectionMatrix),e[0]=S[0],e[1]=S[1],e[2]=S[2])}projectToScreen(t,e){return this.projectToRenderScreen(t,I),this.renderToScreen(I,e),e}projectToRenderScreen(t,e){if(S[0]=t[0],S[1]=t[1],S[2]=t[2],S[3]=1,(0,g.Z0)(S,S,this.viewProjectionMatrix),0===S[3])return null;const i=S;(0,p.hs)(i,i,1/Math.abs(S[3]));const r=this.fullViewport,n=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),s=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=n,e.y=s):(e[0]=n,e[1]=s,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,I),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(C,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(C,C))return null;const i=this.fullViewport;return S[0]=2*(t[0]-i[0])/i[2]-1,S[1]=2*(t[1]-i[1])/i[3]-1,S[2]=2*t[2]-1,S[3]=1,(0,g.Z0)(S,S,C),0===S[3]?null:(e[0]=S[0]/S[3],e[1]=S[1]/S[3],e[2]=S[2]/S[3],e)}constrainWindowSize(t,e,i,r){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-i/2,0),a=Math.max(this.fullHeight-s-r/2,0),c=-Math.min(n-i/2,0),h=-Math.min(this.fullHeight-s-r/2,0),l=i-c- -Math.min(this.fullWidth-n-i/2,0),u=r-h- -Math.min(s-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:n,fovY:s}=this,o=Math.abs(Math.PI/2-y(e,i,r));return t.frustumCoverage(o,n,s)}_computeUpGlobal(){(0,p.Re)(E,this.center,this.eye);const t=(0,p.Bw)(this.center);t<1?(0,p.t2)(this._up,f.Cb)&&((0,p.C)(this._up,f.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,p.Om)(E,this.center))>.9999*(0,p.Bw)(E)*t||((0,p.$A)(R,E,this.center),(0,p.$A)(R,R,E),(0,p.S8)(R,R),(0,p.t2)(this._up,R)||((0,p.C)(this._up,R),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,p.oW)(E,this.eye,this.center),Math.abs(E[2])<=.9999&&((0,p.hs)(E,E,E[2]),(0,p.hZ)(E,-E[0],-E[1],1-E[2]),(0,p.S8)(E,E),(0,p.t2)(this._up,E)||((0,p.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,p.t2)(t,e)||((0,p.C)(e,t),this._markViewDirty(),i.length&&this.notifyChange(i)):s.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"relativeElevation",void 0),A=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],A);const M=A,S=(0,m.vt)(),C=(0,l.vt)(),E=(0,f.vt)(),R=(0,f.vt)(),I=(0,a.r_)()},48375(t,e,i){i.d(e,{A:()=>F});var r=i(5482),n=i(69622),s=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(2016),l=i(44208),u=i(53966),d=(i(17676),i(94656)),p=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var f=i(21231),g=i(97768),m=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class x{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:s,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,s,r,n):i.renderbufferStorage(i.RENDERBUFFER,s,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class y{constructor(t,e,i){if(this._context=t,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,t.instanceCounter.increment(p.vt.FramebufferObject,this),null!=e){const i=function(t,e){return b(e)||w(e)?e:T(e)?new f.A(t,e):function(t){return 3===A(t)||null!=t&&"samples"in t}(e)?new x(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(p.r6,i),b(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(p.r6)}if(null!=i)if(function(t){return b(t)||T(t)}(i))this._depthStencilTexture=b(i)?i:new f.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new x(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(p.r6);return b(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,i])=>t+i.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(t){this._level!==t&&(this._level=t,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&b(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=p.r6){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=p.r6){const e=this._colorAttachments.get(t);if(!e)return;const i=b(e);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._glName){const e=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{t.forEach(t=>{b(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=p.r6,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,i):this._framebufferTexture2D(r.glName,e,t,36160))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===p.ld.UNSIGNED_INT_24_8?6402!==i||r===p.ld.UNSIGNED_INT||r===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,C(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,C(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._glName){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,n,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebuffer(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,n,s,o){(t<0||e<0||n<0||s<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||n+i>a.width||s+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,f.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,s,t,e,i,r),c.bindTexture(h,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,n,s,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,n,s,o)}async readPixelsAsync(t,e,i,r,n,s,o){const{gl:a}=this._context,c=m.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(c);const h=this._context.boundFramebuffer;this._context.bindFramebuffer(this),a.readPixels(t,e,i,r,n,s,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(h),await c.getSubDataAsync(o),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(M(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._glName&&(M(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;this._glName?e.bindFramebuffer(t,this._glName):(this._glName&&e.deleteFramebuffer(this._glName),this._glName=e.createFramebuffer(),e.bindFramebuffer(t,this._glName),this._initializeAttachments(t))}_initializeAttachments(t=36160){const{gl:e}=this._context;if(this._colorAttachments.forEach((e,i)=>{if(b(e)){const r=S(e);35866===r?this._framebufferTextureLayer(e.glName,i,t):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=C(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,S(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(t,e=p.r6,i=3553,r=36160){this._context.gl.framebufferTexture2D(r,e,i,t,this._level)}_framebufferTextureLayer(t,e=p.r6,i=36160,r=0){this._context.gl.framebufferTextureLayer(i,e,t,this._level,r)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,g.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,C(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,g.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),M(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){M(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return p.xL;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return p.nI;case 36168:return p.uH;default:return p.r6}}_validateColorAttachmentPoint(t){if(-1===y._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;y._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-p.r6;e+1>y._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(t){return 1===A(t)}function w(t){return 2===A(t)}function T(t){return 0===A(t)}function A(t){return null!=t&&"type"in t?t.type:null}function M(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function S(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function C(t){return 6402===t?p.xL:p.nI}i(67171),i(79785);var E=i(85079),R=i(74038);const I=[new R._("position",2,p.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,p.pe.BYTE,0,2),new R._("a_pos",2,p.pe.BYTE,0,4),new R._("a_tex",2,p.pe.BYTE,2,4),(0,E.Xk)(I),i(66289);const D=new Image;D.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",D.width=5,D.height=5,D.decode();let O=class extends n.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[p.$0]:[p.C5])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],O.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],O.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],O.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],O.prototype,"techniques",null),O=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],O);const F=O},37957(t,e,i){i.d(e,{P:()=>r});const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}}},48852(t,e,i){i.d(e,{g:()=>u});var r=i(4576),n=i(44208),s=i(53966),o=i(34275),a=i(94656),c=i(63907);const h=()=>s.A.getLogger("esri.views.webgl.BufferObject"),l=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class u{static createIndex(t,e,i){return new u(t,34963,e,i)}static createUniform(t,e,i){return new u(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new u(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new u(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new u(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(c.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,a.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case c.pe.UNSIGNED_INT:return this._sizeBytes/4;case c.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case c.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return l?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(c.vt.BufferObject,this),this._context=null):this._glName&&h().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case c.pe.UNSIGNED_SHORT:t*=2;break;case c.pe.UNSIGNED_INT:t*=4;case c.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,o.mg)(t)?this._indexType=c.pe.UNSIGNED_BYTE:(0,o.jq)(t)?this._indexType=c.pe.UNSIGNED_SHORT:(0,o.XJ)(t)&&(this._indexType=c.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,a.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:s}=this._context;s.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,a.Y2)(s),this._isVAOAware&&this._context.bindVAO(n)}getSubData(t,e=0,i,n){if(i<0||n<0)return;const s=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(s*((i??0)+(n??0))>t.byteLength)return;e+s*(n??0)>this.usedMemory&&h().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,n),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r){await this._context.clientWaitAsync(),this.getSubData(t,e,i,r)}}},14113(t,e,i){i.d(e,{N5:()=>a});var r=i(49186),n=(i(44208),i(53966));const s=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new p,this.varyings=new f,this.outputs=new g}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),n="vertex"===t?this.vertex:this.fragment,s=n.uniforms.generateSource(),o=n.code.generateSource(),a=n.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=n.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let n=0;n<r;++n)i[n](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n)=>{for(let s=0;s<r;++s)i[s](t,e,n)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n,s)=>{for(let o=0;o<r;++o)i[o](t,s,e,n)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){return this._entries}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new m(this),this.inputs=new h}get builder(){return this}}class p{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class f{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?s().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class g{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):s().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:g.DEFAULT_NAME,type:g.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class m{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=m._numberToFloatStr(i);break;case"int":r=m._numberToIntStr(i);break;case"uint":r=m._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${m._numberToFloatStr(i[0])}, ${m._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${m._numberToFloatStr(i[0])}, ${m._numberToFloatStr(i[1])}, ${m._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${m._numberToFloatStr(i[0])}, ${m._numberToFloatStr(i[1])}, ${m._numberToFloatStr(i[2])}, ${m._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${m._numberToIntStr(i[0])}, ${m._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${m._numberToIntStr(i[0])}, ${m._numberToIntStr(i[1])}, ${m._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${m._numberToIntStr(i[0])}, ${m._numberToIntStr(i[1])}, ${m._numberToIntStr(i[2])}, ${m._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${m._numberToUintStr(i[0])}, ${m._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${m._numberToUintStr(i[0])}, ${m._numberToUintStr(i[1])}, ${m._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${m._numberToUintStr(i[0])}, ${m._numberToUintStr(i[1])}, ${m._numberToUintStr(i[2])}, ${m._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>m._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.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 precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},21231(t,e,i){i.d(e,{A:()=>m});var r=i(49186),n=i(44208),s=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171),d=i(12541);class p extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;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=36244}}static validate(t,e){return new p(t,e)}}const f=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),g=()=>s.A.getLogger("esri/views/webgl/Texture");class m{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=p.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return f?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!(0,d.Qp)(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!(0,d.Qp)(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,n,s,o,a=0){o||g().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||g().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=(0,d.mq)(c);const{context:h,pixelFormat:l,dataType:u,target:p,isImmutable:f}=c;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const _=h.bindTexture(this,m.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+n>c.width||i+s>c.height)&&g().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=h;a&&(n&&s||g().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),v.pixelStorei(v.UNPACK_SKIP_ROWS,a)),(0,d.Kv)(o)?v.texSubImage2D(p,t,e,i,n,s,l,u,o):(0,d.Qp)(o)?v.compressedTexSubImage2D(p,t,e,i,n,s,c.internalFormat,o.levels[t]):v.texSubImage2D(p,t,e,i,n,s,l,u,o),a&&v.pixelStorei(v.UNPACK_SKIP_ROWS,0),h.bindTexture(_,m.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,n,s,o,a,c){c||g().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||g().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=(0,d.mq)(h);const{context:l,pixelFormat:u,dataType:p,isImmutable:f,target:_}=h;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,d.re)(_)||g().warn("Attempting to set 3D texture data on a non-3D texture");const v=l.bindTexture(this,m.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(m.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||n<0||e+s>h.width||i+o>h.height||n+a>h.depth)&&g().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=l;if((0,d.Qp)(c))c=c.levels[t],x.compressedTexSubImage3D(_,t,e,i,n,s,o,a,h.internalFormat,c);else{const r=c;x.texSubImage3D(_,t,e,i,n,s,o,a,u,p,r)}l.bindTexture(v,m.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 r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,d.QE)(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,m.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(m.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,m.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,(0,d.QE)(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,(0,d.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),(0,d.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,h.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),(0,d.QE)(i);const s=i.context.bindTexture(this,m.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(m.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(n);const o=e??i.target,a=(0,d.re)(o);if((0,d.Kv)(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:s,depth:c}=i;if(null==e||null==s)throw new r.A("texture:missing-size","Width and height must be specified!");if(a&&null==c)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=(0,d.mq)(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,s,c),(0,d.Qp)(t)){if(!(0,d.tl)(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,s,c,t),(0,h.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(n),i.context.bindTexture(s,m.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=(0,d.mq)(r);const n=(0,d.re)(e),{width:s,height:o,depth:a}=(0,d.Eo)(t);r.width&&r.height,r.width||(r.width=s),r.height||(r.height=o),n&&r.depth,n&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,s,o,a),this._texImage(e,0,r.internalFormat,s,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:n,height:s,depth:o}=r,a=t.levels,c=(0,d.FV)(i,n,s,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,n,s)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,n,s,o)},h)}_texStorage(t,e,i,n,s,o){const{gl:a}=this._descriptor.context;if(!(0,d.tr)(e)&&!(0,d.tl)(e))throw new r.A("texture:missing-format","Immutable textures must have a sized or compressed internal format");if(!this._descriptor.isImmutable)return;const c=i?(0,d.FV)(t,n,s,o):1;if((0,d.re)(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,n,s,o)}else a.texStorage2D(t,c,e,n,s);this._wasImmutablyAllocated=!0}_texImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t),{isImmutable:l,pixelFormat:u,dataType:p}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,n,s,o,u,p,i)}else c.texSubImage2D(t,e,0,0,n,s,u,p,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,n,s,o,0,u,p,l)}else c.texImage2D(t,e,i,n,s,0,u,p,l)}}_compressedTexImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,n,s,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,n,s,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,n,s,o,0,a)}else c.compressedTexImage2D(t,e,i,n,s,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:n,preMultiplyAlpha:s,hasMipmap:o}=this._descriptor,a=this._descriptor.compress?.compressionTracker,h=this._descriptor.compress?.compressionCallback,{compressedTextureETC:l,compressedTextureS3TC:u}=r.capabilities;if(!m.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!l&&!u)return;this.abortCompression();const d=new AbortController;let p;this._compressionAbortController=d,a?.increment();let f=!1,_=!1;try{t instanceof ImageBitmap?p=t:t instanceof Uint8Array?(p=t.buffer,f=this.descriptor.flipped):(p=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(d),_=!0);const r={data:p,width:e,height:i,needsFlip:f,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,hasMipmap:o,hasETC:!!l,hasS3TC:!!u},a=await m.compressionWorkerHandle.invoke(r,d.signal,1);if((0,c.Te)(d),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),h?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||g().error("Texture compression failed!")}finally{a?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),_&&p instanceof ImageBitmap&&p.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==n||c&&null==s)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,n,s),o&&(1!==i||1!==n||c&&1!==s)&&!(r>=e);++r)i=Math.max(1,i>>1),n=Math.max(1,n>>1),c&&(s=Math.max(1,s>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>s,e:()=>o});var r=i(63907),n=i(42293);class s{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,n.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),n=i(63907);const s=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function o(t,e,i,n=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&s.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>u});var r=i(21818),n=i(53966),s=i(97768),o=i(69397),a=i(63907),c=i(42293),h=i(85079);const l=()=>n.A.getLogger("esri.views.webgl.VertexArrayObject");let u=class t{constructor(t,e,i,n,s){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==n?new Map:"number"==typeof n?new Map([["geometry",n]]):n,this.locations=s??(0,r.z)((0,h.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*o.i5)}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,s.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&l().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(a.vt.VertexArrayObject,this)),this._context=null):this._glName&&l().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(a.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||l().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,c.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>n});var r=i(48852);class n extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),n=i(44208),s=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.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 t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],e[r]=s[0];return e}function n(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],s[1]=t[r]-s[0],e[r]=s[1];return e}i.d(e,{Zo:()=>r,jA:()=>n});const s=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function n(t,e,i,r,n=32774,s=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>T,RC:()=>o,T8:()=>a,Uy:()=>p,Xt:()=>u,iD:()=>s,kn:()=>f,nk:()=>d,p3:()=>n,uR:()=>c}),i(4718);const s=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=n(770,1,771,771),c=n(0,0,768,1),h={face:1029,mode:2305},l={face:1028,mode:2305},u=t=>2===t?h:1===t?l:null;function d(t,e,i){return{ref:t,readMask:e,stencilFront:i,stencilBack:i}}const p={zNear:0,zFar:1},f={r:!0,g:!0,b:!0,a:!0};function g(t){return S.intern(t)}function m(t){return E.intern(t)}function _(t){return I.intern(t)}function v(t){return O.intern(t)}function x(t){return P.intern(t)}function y(t){return B.intern(t)}function b(t){return U.intern(t)}function w(t){return z.intern(t)}function T(t){return G.intern(t)}class A{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function M(t){return"["+t.join(",")+"]"}const S=new A(C,t=>({__tag:"Blending",...t}));function C(t){return t?M([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const E=new A(R,t=>({__tag:"Culling",...t}));function R(t){return t?M([t.face,t.mode]):null}const I=new A(D,t=>({__tag:"PolygonOffset",...t}));function D(t){return t?M([t.factor,t.units]):null}const O=new A(F,t=>({__tag:"DepthTest",...t}));function F(t){return t?M([t.func]):null}const P=new A(N,t=>({__tag:"StencilTest",...t}));function N(t){return t?M([t.ref,t.readMask,t.stencilFront.compare,t.stencilFront.fail,t.stencilFront.zFail,t.stencilFront.zPass,t.stencilBack.compare,t.stencilBack.fail,t.stencilBack.zFail,t.stencilBack.zPass]):null}const B=new A(L,t=>({__tag:"DepthWrite",...t}));function L(t){return t?M([t.zNear,t.zFar]):null}const U=new A(H,t=>({__tag:"ColorWrite",...t}));function H(t){return t?M([t.r,t.g,t.b,t.a]):null}const z=new A(V,t=>({__tag:"StencilWrite",...t}));function V(t){return t?M([t.mask]):null}const G=new A(function(t){return t?M([C(t.blending),R(t.culling),D(t.polygonOffset),F(t.depthTest),N(t.stencilTest),L(t.depthWrite),H(t.colorWrite),V(t.stencilWrite)]):null},t=>({blending:g(t.blending),culling:m(t.culling),polygonOffset:_(t.polygonOffset),depthTest:v(t.depthTest),stencilTest:x(t.stencilTest),depthWrite:y(t.depthWrite),colorWrite:b(t.colorWrite),stencilWrite:w(t.stencilWrite)}))},12541(t,e,i){i.d(e,{CR:()=>l,Eo:()=>v,FV:()=>m,Kv:()=>f,QE:()=>c,QJ:()=>u,Qp:()=>p,mq:()=>_,re:()=>g,tl:()=>d,tr:()=>h});var r=i(49186),n=i(53966),s=i(93637),o=i(63907);const a=()=>n.A.getLogger("esri/views/webgl/textureUtils");function c(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=t;if(n&&(l(n)||u(n))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:n}=t;n&&a().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&a().error("Depth textures cannot sample mipmaps"):(9728!==r&&a().error("Depth textures without filtering must use NEAREST filtering"),i&&a().error("Depth textures without filtering cannot use compare function"))}}function h(t){return function(t){return o.XN.includes(t)}(t)||l(t)||u(t)}function l(t){return(0,s.a4)(o.SB,t)}function u(t){return(0,s.a4)(o.iE,t)}function d(t){return null!=t&&(0,s.a4)(o.CQ,t)}function p(t){return null!=t&&"type"in t&&"compressed"===t.type}function f(t){return null!=t&&!p(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function g(t){return 32879===t||35866===t}function m(t,e,i,r=1){let n=Math.max(e,i);return 32879===t&&(n=Math.max(n,r)),Math.floor(Math.log2(n))+1}function _(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case o.ld.FLOAT:switch(t.pixelFormat){case 6408:return o.H0.RGBA32F;case 6407:return o.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case o.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return o.H0.RGBA8;case 6407:return o.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?o.iE.DEPTH24_STENCIL8:6402===e?o.SB.DEPTH_COMPONENT24:e,t.internalFormat}function v(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}},49788(t,e,i){i.d(e,{Q:()=>r});const r=1/255.5}}]);
262
+ `)}},26934(t,e,i){i.d(e,{Q:()=>n});var r=i(49788);function n(t){t.constants.add("alphaCutoff","float",r.Q)}},2016(t,e,i){i.d(e,{OG:()=>Dt,gP:()=>Rt});var r=i(5482),n=i(69540),s=i(91429);let o=class extends n.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,s.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),p=i(43937),f=i(36005);let g=class extends((0,n.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const n={position:t};return null!=e&&(n.heading=e),null!=i&&(n.tilt=i),null!=r&&(n.fov=r),n}return t}writePosition(t,e,i,r){const n=t.clone();n.x=(0,u.GB)(t.x||0),n.y=(0,u.GB)(t.y||0),n.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=n.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,s.MZ)({type:d.A,json:{write:{isRequired:!0}}})],g.prototype,"position",void 0),(0,r.Cg)([(0,p.K)("position")],g.prototype,"writePosition",null),(0,r.Cg)([(0,f.w)("position")],g.prototype,"readPosition",null),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>c.ie.normalize((0,u.GB)(t)))],g.prototype,"heading",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],g.prototype,"tilt",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,s.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],g.prototype,"fov",void 0),(0,r.Cg)([(0,s.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],g.prototype,"layout",void 0),g=(0,r.Cg)([(0,s.$K)("esri.Camera")],g);var m=i(9093),_=i(35522),v=i(51850),x=i(16930),y=(i(48353),i(9762),i(65806)),b=i(27993),w=i(73941),T=(i(19419),i(71351));i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var A=i(58083),M=i(48163),S=i(5443),C=i(39829),E=i(95108),R=i(37585);function I(t,e,i,r){const n=function(t,e){const i=0===e||2===e?0:1,r=t[e],n=0===e||1===e?1:-1,s=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===n?0:1;if(e[i]>r&&o[i]>r)return 1===n?1:0;const a=(o[s]-e[s])/(o[i]-e[i]),c=e[s]+a*(r-e[i]);return t[i]=r,t[s]=c,(e[i]<r?1:-1)*n>0?2:3}}(i,r);if(t.length=0,e.length){1===n(O,e[0],e[0])&&D(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(n(O,e[i],r)){case 1:D(t,r);break;case 3:D(t,(0,M.o8)(O));break;case 2:D(t,(0,M.o8)(O)),D(t,r)}}}}function D(t,e){0!==t.length&&(0,R.aI)(t.at(-1),e)||t.push(e)}const O=(0,M.vt)();var F=i(11964),P=i(27921);const N=(0,v.vt)(),B=(0,v.vt)();function L(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function U(t,e,i,r,n){let s=(0,_.S8)(N,t),o=(0,_.Om)(s,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(s,e),a&&(0,_.hs)(s,s,-1)):s=null);let c=0;if(s){(0,_.hs)(B,r,(0,_.Om)(r,s)),(0,_.Re)(s,s,B);const t=(0,_.Om)(s,n)/((0,_.Bw)(s)*(0,_.Bw)(n));(0,_.$A)(B,s,n),c=((0,_.Om)(B,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function H(t,e,i,r){(0,_.Re)(z,i,e),(0,P.T7)(r,(0,F.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),V=(0,v.fA)(0,1,0),G=(0,v.fA)(0,0,1),k=(0,m.vt)(),W=(0,v.vt)(),$=(0,v.vt)();function Z(t,e,i,r=L()){const{direction:n,up:s}=r;return(0,A.N9)(k,-(0,l.kU)(e)),(0,A.eL)(k,k,(0,l.kU)(i)),(0,_.Z0)(n,G,k),(0,_.hs)(n,n,-1),(0,_.Z0)(s,V,k),r}function j(t,e,i,r,n){const s=e.lines[11].direction,o=(n-i.getAltitude(r))/s[2];(0,_.Ln)(t,r,s,o)}const q=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return U(e,i,r,G,V)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n=Z(0,i,r),s=(0,v.vt)();return(0,_.hs)(s,n.direction,-e),(0,_.WQ)(s,s,t),{up:n.up,eye:s,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:Z,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,n=r.getAltitude(e),s=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,T.LV)(e.origin,e.direction),n,q)||j(q,i,r,e.endpoint,n),H(q,o,q,c),a.push((0,M.fA)(q[0],q[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(q,t[0],t[1],0),e.fromRenderCoords(q,q,i),[q[0],q[1]]));return r.length<=2?new C.A({spatialReference:i}):(r.push(r[0].slice()),(0,E.$3)(r)||r.reverse(),new C.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return I(i,t,e,0),I(r,i,e,1),I(i,r,e,2),I(r,i,e,3),r}(a,r.extent),r,s)},toExtent:function(t,e,i,r,n){const s=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,y.g)(e,W,s),(0,y.g)(e,$,s),W[0]-=i/2,$[0]+=i/2,W[1]-=r/2,$[1]+=r/2,(0,b.F)(W,s,W,o),(0,b.F)($,s,$,o),n?(n.xmin=W[0],n.ymin=W[1],n.xmax=$[0],n.ymax=$[1],n.spatialReference=o):n=new S.A(W[0],W[1],$[0],$[1],o),n}},Symbol.toStringTag,{value:"Module"}));var X=i(78955),Q=i(91829),Y=i(34304),K=i(17136),J=i(94008),tt=i(28735),et=i(82919);class it{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,et.vt)(),this._points=(0,et.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new J.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,et.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,et.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,et.m7)(this.frustum,t)}intersectsRay(t){return(0,et.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,et.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,et.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=st;(0,_.S8)(e,this.direction);const i=nt;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),n=this._boundingSphere,s=(0,_.Ln)(ot,t,e,r);n.center=s,n.radius=r}static{this.planePointIndices=et.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const nt=(0,v.vt)(),st=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new J.iy,(0,T.vt)(),new S.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),pt=(0,m.vt)(),ft=(0,v.vt)(),gt=(0,v.vt)();function mt(t,e,i,r=L()){(0,_.$A)(ft,t,ut),0===(0,_.Om)(ft,ft)&&(0,_.$A)(ft,t,dt),(0,A.$0)(pt,-(0,l.kU)(e),t),(0,A.e$)(pt,pt,-(0,l.kU)(i),ft);const{up:n,direction:s}=r;return(0,_.$A)(n,ft,t),(0,_.S8)(n,n),(0,_.Z0)(n,n,pt),(0,_.S8)(s,t),(0,_.ze)(s,s),(0,_.Z0)(s,s,pt),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=mt(e,t.heading,t.tilt);return t.up=i.up,t}function xt(t,e){const i=[],r=[],n=(0,Y.FD)();for(let s=0;s<t.length;s++){const o=t[s],a=s===t.length-1?t[0]:t[s+1],c=(0,F.Cr)(o,a,Ct),h=(0,P.vE)(e,c.origin,c.vector,0,Mt);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,s,a]=0===h?[1,i,r]:[-1,r,i],c=(0,P.Qj)(e),l=(0,_.Ln)((0,v.vt)(),Mt,c,t*n),u=(0,_.Ln)((0,v.vt)(),Mt,c,t*-n);s.push(o),s.push(l),a.push(u)}}}const s=[];return i.length&&s.push(i),r.length&&s.push(r),s}const yt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},bt=(0,v.fA)(1,0,0),wt=(0,v.fA)(0,1,0),Tt=(0,v.vt)(),At=(0,v.vt)(),Mt=(0,v.vt)(),St=new J.iy,Ct=(0,F.vt)(),Et=(0,Q.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const n=ft,s=gt;return(0,_.S8)(n,t),(0,_.$A)(gt,n,ut),0===(0,_.Om)(gt,gt)&&(0,_.$A)(gt,n,dt),(0,_.$A)(s,gt,n),U(e,i,r,n,s)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const n={eye:(0,v.vt)(),up:null,tilt:r,heading:i},s=ft;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),p=Math.cos(c),f=(0,_.Bw)(s);let g;if(Math.abs(c)<1e-8)g=o+f;else{const t=f/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;g=t*Math.sin(i)}const m=p*o,x=o*o*(d*d),y=u*u*x,b=g-m,w=b*b,T=y*(y+w-s[1]*s[1]);if(T<0)return(0,_.hs)(n.eye,s,g/f),n.tilt=0,vt(n,t);const A=Math.sqrt(T),M=s[1]*b,S=y+w;let C;if(C=u>0?-A+M:A+M,Math.abs(S)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):(0,_.hs)(n.eye,s,g/f),n.tilt=0,_t(n.eye),vt(n,t);n.eye[1]=C/S;const E=h*h*x,R=d*o,I=u*R*n.eye[1],D=n.eye[1]*n.eye[1],O=1-D,F=Math.sqrt(O),P=y*D+E-2*I*F*b+O*w;return Math.abs(P)<1e-8?((0,_.hs)(n.eye,s,g/f),n.tilt=0,_t(n.eye),vt(n,t)):(n.eye[0]=(O*(g*s[0]-m*s[0])-R*F*(s[0]*n.eye[1]*u+s[2]*h))/P,n.eye[2]=(O*(g*s[2]-m*s[2])-R*F*(s[2]*n.eye[1]*u-s[0]*h))/P,(0,_.hs)(n.eye,n.eye,g),_t(n.eye),vt(n,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),n=(0,_.Bw)(e);return(0,l.YN)(i/(n/Math.sin(r)))+r},headingTiltToDirectionUp:mt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),n=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),s=(0,l.YN)(i/(n/Math.sin(t)));return(0,l.KJ)(t-s)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),n=new it(i);r.near=2,n.update(r);const s=i.getAltitude(e),o=t.spatialReference,a=i.referenceEllipsoid.radius,c=r.eye,h=1+(0,_.Io)(c,e)/(a+s),u=Math.sqrt(h*h-1),{minCurvature:d,maxCurvature:p,minSamples:f,maxSamples:g}=yt,m=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return St.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(St,e)}(t),x=(0,l.qE)((u-d)/(p-d),0,1),y=Math.round((0,l.Cc)(f,g,x)),b=r.aboveGround,w=n.planes[5],A=[],M=(0,P.O_)(v.uY,bt,(0,P.vt)()),S=(0,P.O_)(v.uY,wt,(0,P.vt)());(0,X.hZ)(Et,0,0,0,0);const R=t=>{};for(let t=0;t<4;t++){const e=1===t&&!b||3===t&&b?1-m:0,r=1===t&&b||3===t&&!b?m:1,o=n.lines[t],a=n.lines[3===t?0:t+1];for(let n=0;n<y;n++){const h=n/y,u=0===n?0:(0,l.Cc)(e,r,1===t?1-(1-h)**2:3===t?h**2:h),d=(0,_.Cc)(At,o.origin,a.origin,u),p=(0,lt.nu)(o.direction,a.direction,u,Tt);i.intersectManifoldClosestSilhouette((0,T.LV)(d,p),s,Mt),H(Mt,c,Mt,w),A.push((0,v.o8)(Mt)),0!==A.length&&R((0,_.lo)(A.at(-1),Mt));const f=((0,P.Tj)(M,Mt)?1:0)|((0,P.Tj)(S,Mt)?2:0);Et[f]=1}}A.length>2&&(0,_.lo)(A[0],A.at(-1));const I=function(t,e,i){const r=2*(0,Y.FD)();return t.map(t=>{const n=[];let s=!1;for(const o of t)e.fromRenderCoords(o,Mt,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(n.push([null,Mt[1]]),n.push([null,Mt[1]]),s=!0):n.push([Mt[0],Mt[1]]);if(s)for(let t=0;t<n.length;t++){const e=n[t];if(null!=e[0])continue;const i=n[t+1],r=n.at(0===t?-1:t-1);e[0]=r[0],t++;const s=n.at(t===n.length-1?0:t+1);i[0]=s[0]}return n.push(n[0]),(0,E.$3)(n)||n.reverse(),n})}((0,X.m3)(Et)>1?function(t,e){const i=[];for(const r of t)i.push(...xt(r,e));return i}(xt(A,M),S):[A],i,o);return new C.A({rings:I,spatialReference:o})},toExtent:function(t,e,i,r,n){let s,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,p=e.longitude,f=function(t,e,i){const r=e/i,n=(0,l.kU)(t),s=Math.sin(r/2),o=Math.cos(n),a=2*(0,l.YN)(Math.sqrt(s*s/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;s=p-f,o=p+f;const g=(0,l.kU)(u),m=(1+Math.sin(g))/(1-Math.sin(g)),_=(m+1)*Math.tan(r/d/2),v=_*_;function y(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*m+v))),h=a+r/d,a=y(a),h=y(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=K.Y_.monotonic(s,o),o-s>180){const t=(o-s-180)/2;s+=t,o-=t}const b=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:x.A.WGS84;return n?(n.xmin=s,n.ymin=a,n.xmax=o,n.ymax=h,n.spatialReference=b):n=new S.A(s,a,o,h,b),t.spatialReference&&t.spatialReference.isWebMercator&&(0,tt.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Rt={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},It=[Rt.FINAL,Rt.COMPOSITE,Rt.OPAQUE,Rt.TRANSPARENT],Dt={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_CASTERS:"shadow-casters",SHADOW_HIGHLIGHT:"shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VOXEL:"voxel",VIEWSHED:"viewshed"};Array.from(Object.values(Dt)).concat(It),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>M});var r=i(5482),n=i(69622),s=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),p=i(35522),f=i(51850),g=i(78955),m=i(91829),_=i(82919),v=i(71351),x=i(44280);function y(t,e,i){t.worldUpAtPosition(e,b),(0,p.Re)(w,i,e);const r=(0,p.Bw)(w);return 0===r?0:(0,o.XM)((0,p.Om)(w,b)/r)}const b=(0,f.vt)(),w=(0,f.vt)();var T;let A=T=class extends n.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,m.fA)(0,0,1,1),this._padding=(0,m.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,m.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,f.vt)(),this._up=(0,f.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,p.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,g.hs)((0,m.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,g.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,g.hs)((0,m.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,g.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){(0,g.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,g.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,p.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,n=i/this.rows,s=r/this.columns,o=-r/2+this.column*s,a=o+s,c=-i/2+this.row*n,u=c+n,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),p=this._get("projectionMatrix");return p&&(0,h.aI)(p,d)?p:d}copyFrom(t){(0,p.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,g.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,g.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,g.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&(0,g.t2)(this._viewport,t.viewport)&&(0,g.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,g.hG)(t.screenPadding,this.screenPadding)>=e||(0,g.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,p.jb)(E,t.eye,t.center),(0,p.jb)(R,this.eye,this.center);const i=(0,p.Om)(E,R),r=(0,p.uE)(E),n=(0,p.uE)(R),s=5e-4;return i*i>=(1-1e-10)*r*n&&(0,p.lo)(t.eye,this.eye)<Math.max(r,n)*s*s}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,x.gr)(this.viewForward,(0,p.Re)(E,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==S&&(0,p.C)(S,t),S[3]=1,(0,g.Z0)(S,S,this.projectionMatrix);const i=Math.abs(S[3]);(0,p.hs)(S,S,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*S[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*S[1]),e[2]=.5*(S[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;S[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],S[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],S[2]=(2*t[2]-1)*t[3],S[3]=t[3],null!=this.inverseProjectionMatrix&&((0,g.Z0)(S,S,this.inverseProjectionMatrix),e[0]=S[0],e[1]=S[1],e[2]=S[2])}projectToScreen(t,e){return this.projectToRenderScreen(t,I),this.renderToScreen(I,e),e}projectToRenderScreen(t,e){if(S[0]=t[0],S[1]=t[1],S[2]=t[2],S[3]=1,(0,g.Z0)(S,S,this.viewProjectionMatrix),0===S[3])return null;const i=S;(0,p.hs)(i,i,1/Math.abs(S[3]));const r=this.fullViewport,n=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),s=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=n,e.y=s):(e[0]=n,e[1]=s,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,I),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(C,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(C,C))return null;const i=this.fullViewport;return S[0]=2*(t[0]-i[0])/i[2]-1,S[1]=2*(t[1]-i[1])/i[3]-1,S[2]=2*t[2]-1,S[3]=1,(0,g.Z0)(S,S,C),0===S[3]?null:(e[0]=S[0]/S[3],e[1]=S[1]/S[3],e[2]=S[2]/S[3],e)}constrainWindowSize(t,e,i,r){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-i/2,0),a=Math.max(this.fullHeight-s-r/2,0),c=-Math.min(n-i/2,0),h=-Math.min(this.fullHeight-s-r/2,0),l=i-c- -Math.min(this.fullWidth-n-i/2,0),u=r-h- -Math.min(s-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:n,fovY:s}=this,o=Math.abs(Math.PI/2-y(e,i,r));return t.frustumCoverage(o,n,s)}_computeUpGlobal(){(0,p.Re)(E,this.center,this.eye);const t=(0,p.Bw)(this.center);t<1?(0,p.t2)(this._up,f.Cb)&&((0,p.C)(this._up,f.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,p.Om)(E,this.center))>.9999*(0,p.Bw)(E)*t||((0,p.$A)(R,E,this.center),(0,p.$A)(R,R,E),(0,p.S8)(R,R),(0,p.t2)(this._up,R)||((0,p.C)(this._up,R),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,p.oW)(E,this.eye,this.center),Math.abs(E[2])<=.9999&&((0,p.hs)(E,E,E[2]),(0,p.hZ)(E,-E[0],-E[1],1-E[2]),(0,p.S8)(E,E),(0,p.t2)(this._up,E)||((0,p.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,p.t2)(t,e)||((0,p.C)(e,t),this._markViewDirty(),i.length&&this.notifyChange(i)):s.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"relativeElevation",void 0),A=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],A);const M=A,S=(0,m.vt)(),C=(0,l.vt)(),E=(0,f.vt)(),R=(0,f.vt)(),I=(0,a.r_)()},48375(t,e,i){i.d(e,{A:()=>F});var r=i(5482),n=i(69622),s=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(2016),l=i(44208),u=i(53966),d=(i(17676),i(94656)),p=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var f=i(21231),g=i(97768),m=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class x{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:s,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,s,r,n):i.renderbufferStorage(i.RENDERBUFFER,s,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class y{constructor(t,e,i){if(this._context=t,this._level=0,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,t.instanceCounter.increment(p.vt.FramebufferObject,this),null!=e){const i=function(t,e){return b(e)||w(e)?e:T(e)?new f.A(t,e):function(t){return 3===A(t)||null!=t&&"samples"in t}(e)?new x(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(p.r6,i),b(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(p.r6)}if(null!=i)if(function(t){return b(t)||T(t)}(i))this._depthStencilTexture=b(i)?i:new f.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new x(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(p.r6);return b(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,i])=>t+i.usedMemory,this.depthStencil?.usedMemory??0)}get level(){return this._level}set level(t){this._level!==t&&(this._level=t,this._glName&&this._context.temporaryBindFramebuffer(this,()=>this._initializeAttachments()))}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&b(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=p.r6){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=p.r6){const e=this._colorAttachments.get(t);if(!e)return;const i=b(e);return this._glName&&this._context.temporaryBindFramebuffer(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._glName){const e=this._context.gl;this._context.temporaryBindFramebuffer(this,()=>{t.forEach(t=>{b(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=p.r6,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,i):this._framebufferTexture2D(r.glName,e,t,36160))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===p.ld.UNSIGNED_INT_24_8?6402!==i||r===p.ld.UNSIGNED_INT||r===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,C(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._glName&&this._context.temporaryBindFramebuffer(this,()=>{this._framebufferTexture2D(null,C(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._glName){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._glName){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,n,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebuffer(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,n,s,o){(t<0||e<0||n<0||s<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||n+i>a.width||s+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,f.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,s,t,e,i,r),c.bindTexture(h,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,n,s,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,n,s,o)}async readPixelsAsync(t,e,i,r,n,s,o){const{gl:a}=this._context,c=m.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(c);const h=this._context.boundFramebuffer;this._context.bindFramebuffer(this),a.readPixels(t,e,i,r,n,s,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(h),await c.getSubDataAsync(o),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(M(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._glName&&(M(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;this._glName?e.bindFramebuffer(t,this._glName):(this._glName&&e.deleteFramebuffer(this._glName),this._glName=e.createFramebuffer(),e.bindFramebuffer(t,this._glName),this._initializeAttachments(t))}_initializeAttachments(t=36160){const{gl:e}=this._context;if(this._colorAttachments.forEach((e,i)=>{if(b(e)){const r=S(e);35866===r?this._framebufferTextureLayer(e.glName,i,t):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=C(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,S(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}_framebufferTexture2D(t,e=p.r6,i=3553,r=36160){this._context.gl.framebufferTexture2D(r,e,i,t,this._level)}_framebufferTextureLayer(t,e=p.r6,i=36160,r=0){this._context.gl.framebufferTextureLayer(i,e,t,this._level,r)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._glName){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,g.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._glName&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,C(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,g.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),M(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){M(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return p.xL;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return p.nI;case 36168:return p.uH;default:return p.r6}}_validateColorAttachmentPoint(t){if(-1===y._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;y._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-p.r6;e+1>y._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${y._MAX_COLOR_ATTACHMENTS} color attachments`)}}function b(t){return 1===A(t)}function w(t){return 2===A(t)}function T(t){return 0===A(t)}function A(t){return null!=t&&"type"in t?t.type:null}function M(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function S(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function C(t){return 6402===t?p.xL:p.nI}i(67171),i(79785);var E=i(85079),R=i(74038);const I=[new R._("position",2,p.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,p.pe.BYTE,0,2),new R._("a_pos",2,p.pe.BYTE,0,4),new R._("a_tex",2,p.pe.BYTE,2,4),(0,E.Xk)(I),i(66289);const D=new Image;D.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",D.width=5,D.height=5,D.decode();let O=class extends n.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new s.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[p.$0]:[p.C5])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}queryDepthRange(t){return null}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],O.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],O.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],O.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],O.prototype,"techniques",null),O=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],O);const F=O},37957(t,e,i){i.d(e,{P:()=>r});const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}}},48852(t,e,i){i.d(e,{g:()=>u});var r=i(4576),n=i(44208),s=i(53966),o=i(34275),a=i(94656),c=i(63907);const h=()=>s.A.getLogger("esri.views.webgl.BufferObject"),l=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class u{static createIndex(t,e,i){return new u(t,34963,e,i)}static createUniform(t,e,i){return new u(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new u(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new u(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new u(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(c.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,a.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case c.pe.UNSIGNED_INT:return this._sizeBytes/4;case c.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case c.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return l?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(c.vt.BufferObject,this),this._context=null):this._glName&&h().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case c.pe.UNSIGNED_SHORT:t*=2;break;case c.pe.UNSIGNED_INT:t*=4;case c.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,o.mg)(t)?this._indexType=c.pe.UNSIGNED_BYTE:(0,o.jq)(t)?this._indexType=c.pe.UNSIGNED_SHORT:(0,o.XJ)(t)&&(this._indexType=c.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,a.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:s}=this._context;s.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,a.Y2)(s),this._isVAOAware&&this._context.bindVAO(n)}getSubData(t,e=0,i,n){if(i<0||n<0)return;const s=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(s*((i??0)+(n??0))>t.byteLength)return;e+s*(n??0)>this.usedMemory&&h().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,n),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r){await this._context.clientWaitAsync(),this.getSubData(t,e,i,r)}}},14113(t,e,i){i.d(e,{N5:()=>a});var r=i(49186),n=(i(44208),i(53966));const s=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new p,this.varyings=new f,this.outputs=new g}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),n="vertex"===t?this.vertex:this.fragment,s=n.uniforms.generateSource(),o=n.code.generateSource(),a=n.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=n.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${s.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let n=0;n<r;++n)i[n](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n)=>{for(let s=0;s<r;++s)i[s](t,e,n)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,n,s)=>{for(let o=0;o<r;++o)i[o](t,s,e,n)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){return this._entries}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new m(this),this.inputs=new h}get builder(){return this}}class p{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class f{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?s().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class g{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):s().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:g.DEFAULT_NAME,type:g.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class m{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=m._numberToFloatStr(i);break;case"int":r=m._numberToIntStr(i);break;case"uint":r=m._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${m._numberToFloatStr(i[0])}, ${m._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${m._numberToFloatStr(i[0])}, ${m._numberToFloatStr(i[1])}, ${m._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${m._numberToFloatStr(i[0])}, ${m._numberToFloatStr(i[1])}, ${m._numberToFloatStr(i[2])}, ${m._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${m._numberToIntStr(i[0])}, ${m._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${m._numberToIntStr(i[0])}, ${m._numberToIntStr(i[1])}, ${m._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${m._numberToIntStr(i[0])}, ${m._numberToIntStr(i[1])}, ${m._numberToIntStr(i[2])}, ${m._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${m._numberToUintStr(i[0])}, ${m._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${m._numberToUintStr(i[0])}, ${m._numberToUintStr(i[1])}, ${m._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${m._numberToUintStr(i[0])}, ${m._numberToUintStr(i[1])}, ${m._numberToUintStr(i[2])}, ${m._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>m._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.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 precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},21231(t,e,i){i.d(e,{A:()=>m});var r=i(49186),n=i(44208),s=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171),d=i(12541);class p extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;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=36244}}static validate(t,e){return new p(t,e)}}const f=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),g=()=>s.A.getLogger("esri/views/webgl/Texture");class m{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=p.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return f?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!(0,d.Qp)(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!(0,d.Qp)(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,n,s,o,a=0){o||g().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||g().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=(0,d.mq)(c);const{context:h,pixelFormat:l,dataType:u,target:p,isImmutable:f}=c;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const _=h.bindTexture(this,m.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+n>c.width||i+s>c.height)&&g().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=h;a&&(n&&s||g().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),v.pixelStorei(v.UNPACK_SKIP_ROWS,a)),(0,d.Kv)(o)?v.texSubImage2D(p,t,e,i,n,s,l,u,o):(0,d.Qp)(o)?v.compressedTexSubImage2D(p,t,e,i,n,s,c.internalFormat,o.levels[t]):v.texSubImage2D(p,t,e,i,n,s,l,u,o),a&&v.pixelStorei(v.UNPACK_SKIP_ROWS,0),h.bindTexture(_,m.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,n,s,o,a,c){c||g().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||g().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=(0,d.mq)(h);const{context:l,pixelFormat:u,dataType:p,isImmutable:f,target:_}=h;if(f&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");(0,d.re)(_)||g().warn("Attempting to set 3D texture data on a non-3D texture");const v=l.bindTexture(this,m.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(m.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||n<0||e+s>h.width||i+o>h.height||n+a>h.depth)&&g().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=l;if((0,d.Qp)(c))c=c.levels[t],x.compressedTexSubImage3D(_,t,e,i,n,s,o,a,h.internalFormat,c);else{const r=c;x.texSubImage3D(_,t,e,i,n,s,o,a,u,p,r)}l.bindTexture(v,m.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 r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,(0,d.QE)(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,m.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(m.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,m.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,(0,d.QE)(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,(0,d.QE)(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),(0,d.QE)(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,n=i.context?.gl;if(!n)return;(0,h.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),(0,d.QE)(i);const s=i.context.bindTexture(this,m.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(m.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(n);const o=e??i.target,a=(0,d.re)(o);if((0,d.Kv)(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:s,depth:c}=i;if(null==e||null==s)throw new r.A("texture:missing-size","Width and height must be specified!");if(a&&null==c)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=(0,d.mq)(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,s,c),(0,d.Qp)(t)){if(!(0,d.tl)(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,s,c,t),(0,h.Y2)(n),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(n),i.context.bindTexture(s,m.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=(0,d.mq)(r);const n=(0,d.re)(e),{width:s,height:o,depth:a}=(0,d.Eo)(t);r.width&&r.height,r.width||(r.width=s),r.height||(r.height=o),n&&r.depth,n&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,s,o,a),this._texImage(e,0,r.internalFormat,s,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:n,height:s,depth:o}=r,a=t.levels,c=(0,d.FV)(i,n,s,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,n,s)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,n,s,o)},h)}_texStorage(t,e,i,n,s,o){const{gl:a}=this._descriptor.context;if(!(0,d.tr)(e)&&!(0,d.tl)(e))throw new r.A("texture:missing-format","Immutable textures must have a sized or compressed internal format");if(!this._descriptor.isImmutable)return;const c=i?(0,d.FV)(t,n,s,o):1;if((0,d.re)(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,n,s,o)}else a.texStorage2D(t,c,e,n,s);this._wasImmutablyAllocated=!0}_texImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t),{isImmutable:l,pixelFormat:u,dataType:p}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,n,s,o,u,p,i)}else c.texSubImage2D(t,e,0,0,n,s,u,p,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,n,s,o,0,u,p,l)}else c.texImage2D(t,e,i,n,s,0,u,p,l)}}_compressedTexImage(t,e,i,n,s,o,a){const c=this._descriptor.context.gl,h=(0,d.re)(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,n,s,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,n,s,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,n,s,o,0,a)}else c.compressedTexImage2D(t,e,i,n,s,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:n,preMultiplyAlpha:s,hasMipmap:o}=this._descriptor,a=this._descriptor.compress?.compressionTracker,h=this._descriptor.compress?.compressionCallback,{compressedTextureETC:l,compressedTextureS3TC:u}=r.capabilities;if(!m.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!l&&!u)return;this.abortCompression();const d=new AbortController;let p;this._compressionAbortController=d,a?.increment();let f=!1,_=!1;try{t instanceof ImageBitmap?p=t:t instanceof Uint8Array?(p=t.buffer,f=this.descriptor.flipped):(p=await createImageBitmap(t,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(d),_=!0);const r={data:p,width:e,height:i,needsFlip:f,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:s,hasMipmap:o,hasETC:!!l,hasS3TC:!!u},a=await m.compressionWorkerHandle.invoke(r,d.signal,1);if((0,c.Te)(d),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),h?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||g().error("Texture compression failed!")}finally{a?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),_&&p instanceof ImageBitmap&&p.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:n,depth:s,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==n||c&&null==s)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,n,s),o&&(1!==i||1!==n||c&&1!==s)&&!(r>=e);++r)i=Math.max(1,i>>1),n=Math.max(1,n>>1),c&&(s=Math.max(1,s>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>s,e:()=>o});var r=i(63907),n=i(42293);class s{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,n.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),n=i(63907);const s=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function o(t,e,i,n=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&s.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>u});var r=i(21818),n=i(53966),s=i(97768),o=i(69397),a=i(63907),c=i(42293),h=i(85079);const l=()=>n.A.getLogger("esri.views.webgl.VertexArrayObject");let u=class t{constructor(t,e,i,n,s){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==n?new Map:"number"==typeof n?new Map([["geometry",n]]):n,this.locations=s??(0,r.z)((0,h.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*o.i5)}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,s.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&l().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(a.vt.VertexArrayObject,this)),this._context=null):this._glName&&l().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(a.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||l().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,c.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>n});var r=i(48852);class n extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),n=i(44208),s=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.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 t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;s.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],e[r]=s[0];return e}function n(t,e){const i=t.length;for(let r=0;r<i;++r)s[0]=t[r],s[1]=t[r]-s[0],e[r]=s[1];return e}i.d(e,{Zo:()=>r,jA:()=>n});const s=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function n(t,e,i,r,n=32774,s=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>T,RC:()=>o,T8:()=>a,Uy:()=>p,Xt:()=>u,iD:()=>s,kn:()=>f,nk:()=>d,p3:()=>n,uR:()=>c}),i(4718);const s=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=n(770,1,771,771),c=n(0,0,768,1),h={face:1029,mode:2305},l={face:1028,mode:2305},u=t=>2===t?h:1===t?l:null;function d(t,e,i){return{ref:t,readMask:e,stencilFront:i,stencilBack:i}}const p={zNear:0,zFar:1},f={r:!0,g:!0,b:!0,a:!0};function g(t){return S.intern(t)}function m(t){return E.intern(t)}function _(t){return I.intern(t)}function v(t){return O.intern(t)}function x(t){return P.intern(t)}function y(t){return B.intern(t)}function b(t){return U.intern(t)}function w(t){return z.intern(t)}function T(t){return G.intern(t)}class A{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function M(t){return"["+t.join(",")+"]"}const S=new A(C,t=>({__tag:"Blending",...t}));function C(t){return t?M([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const E=new A(R,t=>({__tag:"Culling",...t}));function R(t){return t?M([t.face,t.mode]):null}const I=new A(D,t=>({__tag:"PolygonOffset",...t}));function D(t){return t?M([t.factor,t.units]):null}const O=new A(F,t=>({__tag:"DepthTest",...t}));function F(t){return t?M([t.func]):null}const P=new A(N,t=>({__tag:"StencilTest",...t}));function N(t){return t?M([t.ref,t.readMask,t.stencilFront.compare,t.stencilFront.fail,t.stencilFront.zFail,t.stencilFront.zPass,t.stencilBack.compare,t.stencilBack.fail,t.stencilBack.zFail,t.stencilBack.zPass]):null}const B=new A(L,t=>({__tag:"DepthWrite",...t}));function L(t){return t?M([t.zNear,t.zFar]):null}const U=new A(H,t=>({__tag:"ColorWrite",...t}));function H(t){return t?M([t.r,t.g,t.b,t.a]):null}const z=new A(V,t=>({__tag:"StencilWrite",...t}));function V(t){return t?M([t.mask]):null}const G=new A(function(t){return t?M([C(t.blending),R(t.culling),D(t.polygonOffset),F(t.depthTest),N(t.stencilTest),L(t.depthWrite),H(t.colorWrite),V(t.stencilWrite)]):null},t=>({blending:g(t.blending),culling:m(t.culling),polygonOffset:_(t.polygonOffset),depthTest:v(t.depthTest),stencilTest:x(t.stencilTest),depthWrite:y(t.depthWrite),colorWrite:b(t.colorWrite),stencilWrite:w(t.stencilWrite)}))},12541(t,e,i){i.d(e,{CR:()=>l,Eo:()=>v,FV:()=>m,Kv:()=>f,QE:()=>c,QJ:()=>u,Qp:()=>p,mq:()=>_,re:()=>g,tl:()=>d,tr:()=>h});var r=i(49186),n=i(53966),s=i(93637),o=i(63907);const a=()=>n.A.getLogger("esri/views/webgl/textureUtils");function c(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&a().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=t;if(n&&(l(n)||u(n))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:n}=t;n&&a().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&a().error("Depth textures cannot sample mipmaps"):(9728!==r&&a().error("Depth textures without filtering must use NEAREST filtering"),i&&a().error("Depth textures without filtering cannot use compare function"))}}function h(t){return function(t){return o.XN.includes(t)}(t)||l(t)||u(t)}function l(t){return(0,s.a4)(o.SB,t)}function u(t){return(0,s.a4)(o.iE,t)}function d(t){return null!=t&&(0,s.a4)(o.CQ,t)}function p(t){return null!=t&&"type"in t&&"compressed"===t.type}function f(t){return null!=t&&!p(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function g(t){return 32879===t||35866===t}function m(t,e,i,r=1){let n=Math.max(e,i);return 32879===t&&(n=Math.max(n,r)),Math.floor(Math.log2(n))+1}function _(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case o.ld.FLOAT:switch(t.pixelFormat){case 6408:return o.H0.RGBA32F;case 6407:return o.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case o.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return o.H0.RGBA8;case 6407:return o.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?o.iE.DEPTH24_STENCIL8:6402===e?o.SB.DEPTH_COMPONENT24:e,t.internalFormat}function v(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}},49788(t,e,i){i.d(e,{Q:()=>r});const r=1/255.5}}]);