@arcgis/core 5.0.0-next.72 → 5.0.0-next.74

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 (258) hide show
  1. package/WebDocument2D.d.ts +5 -30
  2. package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/0b666327e8090a6e6f6a.js +1 -0
  5. package/assets/esri/core/workers/chunks/16a7edb381621085a631.js +1 -0
  6. package/assets/esri/core/workers/chunks/{e246b256347a281c13fd.js → 22288b62da20a7a78a4f.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{7e37a3005f2ad2c0a918.js → 23cf4cbc389d2b50e968.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{935a6dccb88557f98189.js → 2a2f33df530b61e3a43f.js} +7 -5
  9. package/assets/esri/core/workers/chunks/4750f55a289bc0cf3d77.js +1 -0
  10. package/assets/esri/core/workers/chunks/a5181292b309b8249bd8.js +1 -0
  11. package/assets/esri/core/workers/chunks/ae733ee050f27f7d8924.js +1 -0
  12. package/assets/esri/core/workers/chunks/{64985e9b6e2edb3ceb37.js → b498db9715a722c52995.js} +45 -58
  13. package/assets/esri/core/workers/chunks/befeca51530bba5e8073.js +1 -0
  14. package/assets/esri/core/workers/chunks/cd788ed111e1e35cf9c8.js +1 -0
  15. package/assets/esri/core/workers/chunks/f35021214e534d5e0446.js +1 -0
  16. package/assets/esri/themes/base/widgets/_FeatureTable.scss +99 -22
  17. package/assets/esri/themes/dark/main.css +1 -1
  18. package/assets/esri/themes/light/main.css +1 -1
  19. package/assets/esri/themes/light/view.css +1 -1
  20. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  21. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  22. package/chunks/ComponentShader.glsl.js +1 -1
  23. package/chunks/GlowBlur.glsl.js +2 -3
  24. package/chunks/HUDMaterial.glsl.js +43 -56
  25. package/config.d.ts +6 -8
  26. package/config.js +1 -1
  27. package/core/Collection.d.ts +27 -1
  28. package/core/types.d.ts +0 -23
  29. package/geometry/support/MeshTexture.d.ts +0 -2
  30. package/geometry/support/MeshVertexAttributes.d.ts +0 -2
  31. package/identity/IdentityManagerBase.d.ts +3 -6
  32. package/interfaces.d.ts +3 -3
  33. package/kernel.js +1 -1
  34. package/layers/BaseDynamicLayer.d.ts +1 -4
  35. package/layers/BaseElevationLayer.d.ts +3 -6
  36. package/layers/BuildingSceneLayer.d.ts +1 -4
  37. package/layers/CSVLayer.d.ts +1 -4
  38. package/layers/CatalogLayer.d.ts +1 -4
  39. package/layers/DimensionLayer.d.ts +1 -4
  40. package/layers/ElevationLayer.d.ts +3 -6
  41. package/layers/FeatureLayer.d.ts +1 -4
  42. package/layers/GaussianSplatLayer.d.ts +0 -1
  43. package/layers/GeoJSONLayer.d.ts +1 -4
  44. package/layers/GeoRSSLayer.d.ts +1 -4
  45. package/layers/GraphicsLayer.d.ts +1 -4
  46. package/layers/GroupLayer.d.ts +1 -4
  47. package/layers/ImageryLayer.d.ts +1 -4
  48. package/layers/ImageryTileLayer.d.ts +1 -4
  49. package/layers/IntegratedMesh3DTilesLayer.d.ts +1 -4
  50. package/layers/IntegratedMeshLayer.d.ts +1 -4
  51. package/layers/KMLLayer.d.ts +1 -4
  52. package/layers/Layer.d.ts +2 -6
  53. package/layers/LineOfSightLayer.d.ts +1 -4
  54. package/layers/MapImageLayer.d.ts +1 -4
  55. package/layers/MapNotesLayer.d.ts +1 -4
  56. package/layers/MediaLayer.d.ts +1 -4
  57. package/layers/OGCFeatureLayer.d.ts +1 -4
  58. package/layers/OrientedImageryLayer.d.ts +1 -4
  59. package/layers/ParquetLayer.d.ts +1 -4
  60. package/layers/PointCloudLayer.d.ts +1 -4
  61. package/layers/RouteLayer.d.ts +2 -5
  62. package/layers/SceneLayer.d.ts +1 -4
  63. package/layers/SubtypeGroupLayer.d.ts +1 -12
  64. package/layers/TileLayer.d.ts +1 -4
  65. package/layers/UnknownLayer.d.ts +1 -4
  66. package/layers/UnsupportedLayer.d.ts +1 -4
  67. package/layers/VectorTileLayer.d.ts +1 -4
  68. package/layers/VideoLayer.d.ts +1 -4
  69. package/layers/ViewshedLayer.d.ts +1 -4
  70. package/layers/VoxelLayer.d.ts +1 -4
  71. package/layers/WCSLayer.d.ts +1 -4
  72. package/layers/WFSLayer.d.ts +1 -4
  73. package/layers/WMSLayer.d.ts +1 -4
  74. package/layers/WMTSLayer.d.ts +1 -4
  75. package/layers/catalog/CatalogDynamicGroupLayer.d.ts +1 -4
  76. package/layers/catalog/CatalogFootprintLayer.d.ts +1 -4
  77. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -6
  78. package/layers/mixins/EditBusLayer.d.ts +0 -1
  79. package/layers/support/FeatureFilter.d.ts +0 -1
  80. package/layers/support/MosaicRule.d.ts +0 -4
  81. package/layers/support/types.d.ts +2 -2
  82. package/layers/types.d.ts +19 -6
  83. package/package.json +1 -1
  84. package/portal/PortalUser.d.ts +1 -1
  85. package/renderers/support/RendererLegendOptions.d.ts +0 -1
  86. package/request/types.d.ts +0 -1
  87. package/rest/support/NormalizationBinParametersMixin.d.ts +18 -20
  88. package/rest/support/PrintTemplate.d.ts +0 -1
  89. package/rest/support/RelationshipQuery.d.ts +1 -10
  90. package/rest/support/types.d.ts +29 -3
  91. package/smartMapping/heuristics/binLevel.d.ts +1 -1
  92. package/smartMapping/heuristics/scaleRange.d.ts +1 -1
  93. package/smartMapping/heuristics/sizeRange.d.ts +1 -1
  94. package/smartMapping/heuristics/types.d.ts +0 -2
  95. package/smartMapping/labels/bins.d.ts +1 -1
  96. package/smartMapping/labels/clusters.d.ts +1 -1
  97. package/smartMapping/popup/clusters.d.ts +1 -1
  98. package/smartMapping/popup/templates.d.ts +1 -1
  99. package/smartMapping/raster/renderers/classBreaks.d.ts +1 -1
  100. package/smartMapping/raster/renderers/colormap.d.ts +1 -1
  101. package/smartMapping/raster/renderers/flow.d.ts +0 -1
  102. package/smartMapping/raster/renderers/rgb.d.ts +1 -1
  103. package/smartMapping/raster/renderers/shadedRelief.d.ts +0 -1
  104. package/smartMapping/raster/renderers/stretch.d.ts +1 -1
  105. package/smartMapping/raster/renderers/uniqueValue.d.ts +0 -1
  106. package/smartMapping/raster/renderers/vectorField.d.ts +0 -1
  107. package/smartMapping/raster/support/utils.d.ts +0 -2
  108. package/smartMapping/renderers/color.d.ts +6 -6
  109. package/smartMapping/renderers/dotDensity.d.ts +0 -1
  110. package/smartMapping/renderers/heatmap.d.ts +1 -1
  111. package/smartMapping/renderers/location.d.ts +0 -1
  112. package/smartMapping/renderers/opacity.d.ts +1 -1
  113. package/smartMapping/renderers/pieChart.d.ts +0 -2
  114. package/smartMapping/renderers/predominance.d.ts +0 -1
  115. package/smartMapping/renderers/relationship.d.ts +0 -1
  116. package/smartMapping/renderers/size.d.ts +4 -6
  117. package/smartMapping/renderers/type.d.ts +9 -5
  118. package/smartMapping/renderers/univariateColorSize.d.ts +2 -2
  119. package/smartMapping/statistics/classBreaks.d.ts +1 -1
  120. package/smartMapping/statistics/heatmapStatistics.d.ts +1 -1
  121. package/smartMapping/statistics/histogram.d.ts +1 -1
  122. package/smartMapping/statistics/predominantCategories.d.ts +1 -1
  123. package/smartMapping/statistics/summaryStatistics.d.ts +1 -1
  124. package/smartMapping/statistics/summaryStatisticsForAge.d.ts +1 -1
  125. package/smartMapping/statistics/support/ageUtils.d.ts +1 -1
  126. package/smartMapping/statistics/types.d.ts +26 -8
  127. package/smartMapping/statistics/uniqueValues.d.ts +1 -1
  128. package/smartMapping/symbology/color.d.ts +4 -4
  129. package/smartMapping/symbology/dotDensity.d.ts +3 -3
  130. package/smartMapping/symbology/flow.d.ts +3 -3
  131. package/smartMapping/symbology/heatmap.d.ts +3 -3
  132. package/smartMapping/symbology/location.d.ts +1 -1
  133. package/smartMapping/symbology/pieChart.d.ts +3 -3
  134. package/smartMapping/symbology/predominance.d.ts +3 -3
  135. package/smartMapping/symbology/relationship.d.ts +3 -3
  136. package/smartMapping/symbology/size.d.ts +1 -1
  137. package/smartMapping/symbology/support/colorRamps.d.ts +1 -1
  138. package/smartMapping/symbology/type.d.ts +3 -3
  139. package/support/revision.js +1 -1
  140. package/symbols/cim/types.d.ts +0 -12
  141. package/symbols/support/symbolUtils.d.ts +1 -1
  142. package/views/2d/MapViewConstraints.d.ts +2 -10
  143. package/views/2d/engine/brushes.js +1 -1
  144. package/views/2d/engine/vectorTiles/GlyphMosaic.js +1 -1
  145. package/views/2d/engine/vectorTiles/MemoryBuffer.js +1 -1
  146. package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
  147. package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
  148. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  149. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  150. package/views/2d/engine/vectorTiles/VertexMemoryBuffer.js +1 -1
  151. package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
  152. package/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js +1 -1
  153. package/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js +1 -1
  154. package/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js +1 -1
  155. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  156. package/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js +1 -1
  157. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  158. package/views/2d/engine/webgl/Painter.js +1 -1
  159. package/views/2d/engine/webgl/RenderingDevice.js +5 -0
  160. package/views/2d/engine/webgl/WGLContainer.js +1 -1
  161. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  162. package/views/2d/engine/webgl/number.js +1 -1
  163. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  164. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderBackground.js +5 -0
  165. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderCircle.js +5 -0
  166. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +5 -0
  167. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +5 -0
  168. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +5 -0
  169. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderOutline.js +5 -0
  170. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +5 -0
  171. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +5 -0
  172. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +5 -0
  173. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +5 -0
  174. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +5 -0
  175. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +5 -0
  176. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js +5 -0
  177. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  178. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  179. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  180. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  181. package/views/3d/layers/i3s/meshUtils.js +1 -1
  182. package/views/3d/state/NearFarHeuristic.js +1 -1
  183. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  184. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +1 -1
  185. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  186. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  187. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -4
  188. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +18 -14
  189. package/views/3d/webgl-engine/effects/glow/GlowBlur.glsl.js +1 -1
  190. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  191. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechniqueConfiguration.js +1 -1
  192. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  193. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  194. package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
  195. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +23 -20
  196. package/views/BreakpointsOwner.d.ts +2 -2
  197. package/views/LinkChartView.d.ts +0 -2
  198. package/views/View2D.d.ts +3 -15
  199. package/views/input/types.d.ts +2 -13
  200. package/views/layers/BuildingComponentSublayerView.d.ts +0 -1
  201. package/views/types.d.ts +2 -9
  202. package/views/webgl/VertexArrayObject.js +1 -1
  203. package/webdoc/ips/SmoothingProperties.d.ts +1 -1
  204. package/webdoc/ips/SmoothingProperties.js +1 -1
  205. package/widgets/BasemapLayerList/BasemapLayerListVisibleElements.d.ts +10 -10
  206. package/widgets/BasemapLayerList/types.d.ts +6 -1
  207. package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +0 -9
  208. package/widgets/Bookmarks/types.d.ts +0 -4
  209. package/widgets/CatalogLayerList/CatalogLayerListVisibleElements.d.ts +2 -2
  210. package/widgets/CatalogLayerList/types.d.ts +5 -1
  211. package/widgets/Editor/VisibleElements.d.ts +0 -11
  212. package/widgets/ElevationProfile/types.d.ts +1 -1
  213. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  214. package/widgets/FeatureTable/FieldColumn.d.ts +0 -1
  215. package/widgets/FeatureTable/VisibleElements.d.ts +2 -16
  216. package/widgets/FeatureTable/support/AttachmentsViewOptions.d.ts +5 -3
  217. package/widgets/FeatureTable/support/AttachmentsViewOptions.js +1 -1
  218. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  219. package/widgets/FeatureTable.js +1 -1
  220. package/widgets/Features/FeaturesViewModel.d.ts +3 -27
  221. package/widgets/Features/FeaturesVisibleElements.d.ts +4 -4
  222. package/widgets/LayerList/LayerListViewModel.d.ts +20 -5
  223. package/widgets/LayerList/LayerListVisibleElements.d.ts +10 -12
  224. package/widgets/LayerList/ListItem.d.ts +33 -0
  225. package/widgets/LayerList/ListItemPanel.d.ts +8 -2
  226. package/widgets/LayerList/types.d.ts +58 -15
  227. package/widgets/Popup/PopupVisibleElements.d.ts +6 -6
  228. package/widgets/Popup/types.d.ts +1 -1
  229. package/widgets/ScaleRangeSlider/ScaleRanges.d.ts +1 -1
  230. package/widgets/Sketch/CreateToolVisibilityMap.d.ts +0 -4
  231. package/widgets/Sketch/VisibleElements.d.ts +0 -2
  232. package/widgets/Sketch/types.d.ts +1 -1
  233. package/widgets/TableList/ListItemPanel.d.ts +8 -0
  234. package/widgets/TableList/TableListViewModel.d.ts +9 -14
  235. package/widgets/TableList/TableListVisibleElements.d.ts +9 -11
  236. package/widgets/TableList/types.d.ts +13 -7
  237. package/widgets/support/SnappingControls/VisibleElements.d.ts +0 -4
  238. package/widgets/types.d.ts +1 -9
  239. package/assets/esri/core/workers/chunks/1d8fc0239c907ff5d1e8.js +0 -1
  240. package/assets/esri/core/workers/chunks/562cddaf63985e53ee6e.js +0 -1
  241. package/assets/esri/core/workers/chunks/b899b4e7979c13b99526.js +0 -1
  242. package/assets/esri/core/workers/chunks/d0ae8752419d5b761190.js +0 -1
  243. package/assets/esri/core/workers/chunks/df2ba5f9d57080fca183.js +0 -1
  244. package/assets/esri/core/workers/chunks/ee175fd4ec706f7878c0.js +0 -1
  245. package/assets/esri/core/workers/chunks/fc00d7278b43df813c54.js +0 -1
  246. package/layers/mixins/ScaleRange.d.ts +0 -16
  247. package/views/2d/engine/vectorTiles/shaders/Programs.js +0 -5
  248. package/views/2d/engine/vectorTiles/shaders/VTLMaterialManager.js +0 -5
  249. package/views/2d/engine/vectorTiles/shaders/sources/resolver.js +0 -5
  250. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +0 -5
  251. package/views/2d/engine/vtlBrushes.js +0 -5
  252. package/views/2d/engine/webgl/brushes/WGLBrushVTLBackground.js +0 -5
  253. package/views/2d/engine/webgl/brushes/WGLBrushVTLCircle.js +0 -5
  254. package/views/2d/engine/webgl/brushes/WGLBrushVTLFill.js +0 -5
  255. package/views/2d/engine/webgl/brushes/WGLBrushVTLLine.js +0 -5
  256. package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +0 -5
  257. package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +0 -5
  258. package/widgets/FeatureTable/support/FeatureStore.d.ts +0 -1
@@ -1,52 +1,39 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4006,7548],{620:(e,t,r)=>{r.d(t,{O_:()=>s,vA:()=>n}),r(48163),r(87317),(0,r(91829).vt)();class i{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}}function n(e,t="Assertion"){if(!e){const e=new Error(t).stack;throw new i(`${t} at ${e}`)}}function s(e,t,r,i){let n,s=(r[0]-e[0])/t[0],o=(i[0]-e[0])/t[0];s>o&&(n=s,s=o,o=n);let a=(r[1]-e[1])/t[1],l=(i[1]-e[1])/t[1];if(a>l&&(n=a,a=l,l=n),s>l||a>o)return!1;a>s&&(s=a),l<o&&(o=l);let c=(r[2]-e[2])/t[2],u=(i[2]-e[2])/t[2];return c>u&&(n=c,c=u,u=n),!(s>u||c>o||(u<o&&(o=u),o<0))}},2272:(e,t,r)=>{r.d(t,{Dl:()=>c,gf:()=>d,jV:()=>l,lF:()=>u});var i=r(92602),n=r(70333),s=r(4718),o=r(84952),a=r(926);function l(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function c(e){return"string"==typeof e?(0,o.An)(e):(0,s.o8)(e)}function u(e,t,r){const i={};for(const n in e){if("declaredClass"===n)continue;const s=e[n];if(null!=s&&"function"!=typeof s)if(Array.isArray(s))i[n]=s.map(e=>u(e));else if("object"==typeof s)if(s.toJSON){const e=s.toJSON(r?.[n]);i[n]=t?e:JSON.stringify(e)}else i[n]=t?s:JSON.stringify(s);else i[n]=s}return i}async function d(e,t,s){const o=function(e,t){return e?t&&(0,a.Qc)(e)?t:(0,a.CG)(e)??n.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!n.id&&i.A.request.useIdentity&&await Promise.all([r.e(7330),r.e(168),r.e(148)]).then(r.bind(r,50148));const l=await n.id.getCredential(e,s);return l?.token}},4146:(e,t,r)=>{r.d(t,{A:()=>b});var i=r(31635),n=r(11254),s=r(49186),o=r(65529),a=r(4902),l=r(92474),c=r(53966),u=r(74887),d=r(84952),h=r(91429),f=r(5443),p=r(16930),m=r(92602),y=r(79677);let g=0,b=class extends((0,o.Zt)((0,a.s)(l.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.A(-180,-90,180,90,p.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=p.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([r.e(812),r.e(7982)]).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await Promise.all([r.e(812),r.e(5613),r.e(5710)]).then(r.bind(r,45613));try{return await i(t)}catch(e){const r=t?.portalItem,i=r?.id||"unset",n=r?.portal?.url||m.A.portalUrl;throw c.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+n+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,u.zf)(e)||c.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,d.An)(this.url)}createLayerView(e,t){return Promise.reject(new s.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,n.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new s.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,h.MZ)({type:String})],b.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],b.prototype,"effectiveVisible",null),(0,i.Cg)([(0,h.MZ)({type:f.A})],b.prototype,"fullExtent",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],b.prototype,"hasAttributionData",null),(0,i.Cg)([(0,h.MZ)({type:String,clonable:!1})],b.prototype,"id",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],b.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:["show","hide","hide-children"]})],b.prototype,"listMode",void 0),(0,i.Cg)([(0,h.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],b.prototype,"opacity",void 0),(0,i.Cg)([(0,h.MZ)({clonable:!1})],b.prototype,"parent",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],b.prototype,"parsedUrl",null),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],b.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean})],b.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean})],b.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,h.MZ)({type:p.A})],b.prototype,"spatialReference",void 0),(0,i.Cg)([(0,h.MZ)({type:String})],b.prototype,"title",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0),(0,i.Cg)([(0,h.MZ)()],b.prototype,"url",void 0),(0,i.Cg)([(0,h.MZ)({type:y.A})],b.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],b.prototype,"visible",void 0),b=(0,i.Cg)([(0,h.$K)("esri.layers.Layer")],b)},4902:(e,t,r)=>{r.d(t,{s:()=>o});var i=r(31635),n=r(64108);let s=0;const o=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+s++})}};return r=(0,i.Cg)([(0,n.$)("esri.core.Identifiable")],r),r};o(class{})},6797:(e,t,r)=>{r.d(t,{Ui:()=>h});var i=r(69622),n=r(7762),s=r(88620);const o=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function a(e){return e instanceof i.A}function l(e){return e instanceof n.A?Object.keys(e.items):a(e)?(0,s.oY)(e).keys():e?Object.keys(e):[]}function c(e,t){return e instanceof n.A?e.items[t]:e[t]}function u(e){return e?e.declaredClass:null}function d(e,t){const r=e.diff;if(r&&"function"==typeof r)return r(e,t);const i=l(e),n=l(t);if(0===i.length&&0===n.length)return;if(!i.length||!n.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const s=n.filter(e=>!i.includes(e)),h=i.filter(e=>!n.includes(e)),f=i.filter(r=>n.includes(r)&&c(e,r)!==c(t,r)).concat(s,h).sort(),p=u(e);if(p&&o.has(p)&&f.length)return{type:"complete",oldValue:e,newValue:t};let m;const y=a(e)&&a(t);for(const i of f){const n=c(e,i),s=c(t,i);let o;if((y||"function"!=typeof n&&"function"!=typeof s)&&n!==s&&(null!=n||null!=s)){if(r&&r[i]&&"function"==typeof r[i])o=r[i]?.(n,s);else if(n instanceof Date&&s instanceof Date){if(n.getTime()===s.getTime())continue;o={type:"complete",oldValue:n,newValue:s}}else o="object"==typeof n&&"object"==typeof s&&u(n)===u(s)?d(n,s):{type:"complete",oldValue:n,newValue:s};null!=o&&(null!=m?m.diff[i]=o:m={type:"partial",diff:{[i]:o}})}}return m}function h(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&u(e)!==u(t)?{type:"complete",oldValue:e,newValue:t}:d(e,t)}},8631:(e,t,r)=>{r.d(t,{r:()=>h,g:()=>d});var i,n=r(53177),s=r(76357),o=r(31635),a=r(91429),l=r(93223);let c=class extends s.A{static{i=this}constructor(e){super(e),this.type="inherited"}clone(){return new i}};(0,o.Cg)([(0,l.e)({inherited:"inherited"})],c.prototype,"type",void 0),c=i=(0,o.Cg)([(0,a.$K)("esri.layers.support.InheritedDomain")],c);var u=r(41628);const d={key:"type",base:s.A,typeMap:{range:u.A,"coded-value":n.A,inherited:c}};function h(e){if(!e?.type)return null;switch(e.type){case"range":return u.A.fromJSON(e);case"codedValue":return n.A.fromJSON(e);case"inherited":return c.fromJSON(e)}return null}},13030:(e,t,r)=>{r.d(t,{Y$:()=>g,XW:()=>y,qB:()=>I,Qt:()=>Y,My:()=>Q,bf:()=>q,jZ:()=>S,j0:()=>A,Sx:()=>T,E$:()=>P,h:()=>j,P:()=>U,SL:()=>O,dy:()=>re,gH:()=>_,ZD:()=>b,si:()=>B,mJ:()=>X,UL:()=>K,D6:()=>k,Yi:()=>V,An:()=>N,LC:()=>R,xs:()=>x,EC:()=>v,Xm:()=>E,Vp:()=>W,zD:()=>ee,m8:()=>$,nS:()=>z,H$:()=>G,eI:()=>D,td:()=>ie,Eq:()=>C,jz:()=>w,Aj:()=>M,E7:()=>J,Y4:()=>te,TX:()=>Z,Uz:()=>L,ml:()=>H,XP:()=>F});var i=r(34727),n=r(87317),s=r(91829),o=r(20498);class a{static{this.ElementCount=9}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.elementCount=9;const s=this.TypedArrayConstructor;void 0===i&&(i=9*s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<9;e++)t[e]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<9;e++)this.typedBuffer[r++]=t[e]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){const i=this.typedBuffer,n=t.typedBuffer;let s=e*this.typedBufferStride,o=r*t.typedBufferStride;for(let e=0;e<9;++e)i[s++]=n[o++]}get buffer(){return this.typedBuffer.buffer}}class l{static{this.ElementCount=16}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.elementCount=16;const s=this.TypedArrayConstructor;void 0===i&&(i=16*s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<16;e++)t[e]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<16;e++)this.typedBuffer[r++]=t[e]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){this.copyFromTypedBuffer(e,t.typedBuffer,r*t.typedBufferStride)}copyFromTypedBuffer(e,t,r){const i=this.typedBuffer;let n=e*this.typedBufferStride;for(let e=0;e<16;++e)i[n++]=t[r++]}get buffer(){return this.typedBuffer.buffer}}class c{static{this.ElementCount=1}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.elementCount=1;const s=this.TypedArrayConstructor;void 0===i&&(i=s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.stride=i,this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}var u=r(37585);class d{static{this.ElementCount=2}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.start=r,this.elementCount=2;const s=this.TypedArrayConstructor;void 0===i&&(i=2*s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,u.hZ)(t,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e]=t[1]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e]=r}copyFrom(e,t,r){const i=this.typedBuffer,n=t.typedBuffer;let s=e*this.typedBufferStride,o=r*t.typedBufferStride;i[s++]=n[o++],i[s]=n[o]}get buffer(){return this.typedBuffer.buffer}}var h=r(38954);class f{static{this.ElementCount=3}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.elementCount=3;const s=this.TypedArrayConstructor;void 0===i&&(i=3*s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,h.h)(t,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e]=t[2]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e]=i}copyFrom(e,t,r){const i=this.typedBuffer,n=t.typedBuffer;let s=e*this.typedBufferStride,o=r*t.typedBufferStride;i[s++]=n[o++],i[s++]=n[o++],i[s]=n[o]}get buffer(){return this.typedBuffer.buffer}}class p{static{this.ElementCount=4}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;const s=this.TypedArrayConstructor;void 0===i&&(i=4*s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,n.c)(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,i,n){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=i,this.typedBuffer[e]=n}copyFrom(e,t,r){const i=this.typedBuffer,n=t.typedBuffer;let s=e*this.typedBufferStride,o=r*t.typedBufferStride;i[s++]=n[o++],i[s++]=n[o++],i[s++]=n[o++],i[s]=n[o]}get buffer(){return this.typedBuffer.buffer}}var m=r(620);class y extends c{constructor(e,t=0,r,i){(0,m.vA)(o.SX),super((0,o.pX)(),e,t,r,i),this.elementType="f16"}static{this.ElementType="f16"}}class g extends c{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}static{this.ElementType="f32"}}class b extends d{constructor(e,t=0,r,i){(0,m.vA)(o.SX),super((0,o.pX)(),e,t,r,i),this.elementType="f16"}slice(e,t){return this.sliceBuffer(b,e,t)}static{this.ElementType="f16"}}class _ extends d{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}slice(e,t){return this.sliceBuffer(_,e,t)}static{this.ElementType="f32"}}class v extends f{constructor(e,t=0,r,i){(0,m.vA)(o.SX),super((0,o.pX)(),e,t,r,i),this.elementType="f16"}slice(e,t){return this.sliceBuffer(v,e,t)}static{this.ElementType="f16"}}class x extends f{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}slice(e,t){return this.sliceBuffer(x,e,t)}static fromTypedArray(e,t){return new x(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f32"}}class w extends p{constructor(e,t=0,r,i){(0,m.vA)(o.SX),super((0,o.pX)(),e,t,r,i),this.elementType="f16"}slice(e,t){return this.sliceBuffer(w,e,t)}static{this.ElementType="f16"}}class C extends p{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}slice(e,t){return this.sliceBuffer(C,e,t)}static{this.ElementType="f32"}}class S extends a{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}slice(e,t){return this.sliceBuffer(S,e,t)}static{this.ElementType="f32"}}class A extends a{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static{this.ElementType="f64"}}class T extends l{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}slice(e,t){return this.sliceBuffer(T,e,t)}static{this.ElementType="f32"}}class P extends l{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(P,e,t)}static{this.ElementType="f64"}}class I extends c{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(I,e,t)}static{this.ElementType="f64"}}class B extends d{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(B,e,t)}static{this.ElementType="f64"}}class E extends f{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(E,e,t)}static fromTypedArray(e,t){return new E(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f64"}}class M extends p{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(M,e,t)}static{this.ElementType="f64"}}class O extends c{constructor(e,t=0,r,i){super(Uint8Array,e,t,r,i),this.elementType="u8"}slice(e,t){return this.sliceBuffer(O,e,t)}static{this.ElementType="u8"}}class R extends d{constructor(e,t=0,r,i){super(Uint8Array,e,t,r,i),this.elementType="u8"}slice(e,t){return this.sliceBuffer(R,e,t)}static{this.ElementType="u8"}}class D extends f{constructor(e,t=0,r,i){super(Uint8Array,e,t,r,i),this.elementType="u8"}slice(e,t){return this.sliceBuffer(D,e,t)}static fromTypedArray(e,t){return new D(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u8"}}class F extends p{constructor(e,t=0,r,i){super(Uint8Array,e,t,r,i),this.elementType="u8"}slice(e,t){return this.sliceBuffer(F,e,t)}static{this.ElementType="u8"}}class j extends c{constructor(e,t=0,r,i){super(Uint16Array,e,t,r,i),this.elementType="u16"}slice(e,t){return this.sliceBuffer(j,e,t)}static{this.ElementType="u16"}}class V extends d{constructor(e,t=0,r,i){super(Uint16Array,e,t,r,i),this.elementType="u16"}slice(e,t){return this.sliceBuffer(V,e,t)}static{this.ElementType="u16"}}class z extends f{constructor(e,t=0,r,i){super(Uint16Array,e,t,r,i),this.elementType="u16"}slice(e,t){return this.sliceBuffer(z,e,t)}static{this.ElementType="u16"}}class L extends p{constructor(e,t=0,r,i){super(Uint16Array,e,t,r,i),this.elementType="u16"}slice(e,t){return this.sliceBuffer(L,e,t)}static{this.ElementType="u16"}}class U extends c{constructor(e,t=0,r,i){super(Uint32Array,e,t,r,i),this.elementType="u32"}slice(e,t){return this.sliceBuffer(U,e,t)}static{this.ElementType="u32"}}class N extends d{constructor(e,t=0,r,i){super(Uint32Array,e,t,r,i),this.elementType="u32"}slice(e,t){return this.sliceBuffer(N,e,t)}static{this.ElementType="u32"}}class G extends f{constructor(e,t=0,r,i){super(Uint32Array,e,t,r,i),this.elementType="u32"}slice(e,t){return this.sliceBuffer(G,e,t)}static{this.ElementType="u32"}}class H extends p{constructor(e,t=0,r,i){super(Uint32Array,e,t,r,i),this.elementType="u32"}slice(e,t){return this.sliceBuffer(H,e,t)}static{this.ElementType="u32"}}class q extends c{constructor(e,t=0,r,i){super(Int8Array,e,t,r,i),this.elementType="i8"}slice(e,t){return this.sliceBuffer(q,e,t)}static{this.ElementType="i8"}}class k extends d{constructor(e,t=0,r,i){super(Int8Array,e,t,r,i),this.elementType="i8"}slice(e,t){return this.sliceBuffer(k,e,t)}static{this.ElementType="i8"}}class $ extends f{constructor(e,t=0,r,i){super(Int8Array,e,t,r,i),this.elementType="i8"}slice(e,t){return this.sliceBuffer($,e,t)}static{this.ElementType="i8"}}class Z extends p{constructor(e,t=0,r,i){super(Int8Array,e,t,r,i),this.elementType="i8"}slice(e,t){return this.sliceBuffer(Z,e,t)}static{this.ElementType="i8"}}class Y extends c{constructor(e,t=0,r,i){super(Int16Array,e,t,r,i),this.elementType="i16"}slice(e,t){return this.sliceBuffer(Y,e,t)}static{this.ElementType="i16"}}class X extends d{constructor(e,t=0,r,i){super(Int16Array,e,t,r,i),this.elementType="i16"}slice(e,t){return this.sliceBuffer(X,e,t)}static{this.ElementType="i16"}}class W extends f{constructor(e,t=0,r,i){super(Int16Array,e,t,r,i),this.elementType="i16"}slice(e,t){return this.sliceBuffer(W,e,t)}static{this.ElementType="i16"}}class J extends p{constructor(e,t=0,r,i){super(Int16Array,e,t,r,i),this.elementType="i16"}slice(e,t){return this.sliceBuffer(J,e,t)}static{this.ElementType="i16"}}class Q extends c{constructor(e,t=0,r,i){super(Int32Array,e,t,r,i),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Q,e,t)}static{this.ElementType="i32"}}class K extends d{constructor(e,t=0,r,i){super(Int32Array,e,t,r,i),this.elementType="i32"}slice(e,t){return this.sliceBuffer(K,e,t)}static{this.ElementType="i32"}}class ee extends f{constructor(e,t=0,r,i){super(Int32Array,e,t,r,i),this.elementType="i32"}slice(e,t){return this.sliceBuffer(ee,e,t)}static{this.ElementType="i32"}}class te extends p{constructor(e,t=0,r,i){super(Int32Array,e,t,r,i),this.elementType="i32"}slice(e,t){return this.sliceBuffer(te,e,t)}static{this.ElementType="i32"}}class re extends O{constructor(e,t=0,r,i){super(e,t,r,i)}get(e){return this.typedBuffer[e*this.typedBufferStride]/255}set(e,t){this.typedBuffer[e*this.typedBufferStride]=Math.round(255*(0,i.qE)(t,0,1))}slice(e,t){return this.sliceBuffer(re,e,t)}}class ie extends F{constructor(e,t=0,r,i){super(e,t,r,i)}getVec(e,t){return(0,n.s)(t,super.getVec(e,t),1/255)}setVec(e,t){(0,n.m)(ne,(0,n.b)(ne,t,s.uY),s.Un),(0,n.s)(ne,ne,255),(0,n.r)(ne,ne),super.setVec(e,ne)}get(e,t){return super.get(e,t)/255}set(e,t,r){super.set(e,t,Math.round(255*(0,i.qE)(r,0,1)))}setValues(e,t,r,i,s){(0,n.c)(ne,t,r,i,s),this.setVec(e,ne)}slice(e,t){return this.sliceBuffer(ie,e,t)}}const ne=(0,s.vt)()},13259:(e,t,r)=>{r.d(t,{H:()=>j,b:()=>E,c:()=>O,f:()=>D});var i=r(37585),n=r(48163),s=r(91829),o=r(79258),a=r(68317),l=r(36782),c=r(47522),u=r(40268),d=r(63578),h=r(50832),f=r(42593),p=r(82094),m=r(42398),y=r(63365),g=r(52587),b=r(20693),_=r(47286),v=r(14314),x=r(81961),w=r(71988),C=r(33094),S=r(20304),A=r(31821),T=r(12791),P=r(63761),I=r(14113),B=r(49788);function E(e){const t=new I.N5;if(t.include(u.Q,e),t.vertex.include(a.rA,e),e.occlusionPass)return t.include(d.I,e),t;const{output:r,oitPass:n,signedDistanceFieldEnabled:E,visibilityPixelEnabled:D,horizonCullingEnabled:j,pixelSnappingEnabled:V,hasEmission:z,hasScreenSizePerspective:L,debugDrawLabelBorder:U,hasVVSize:N,hasVVColor:G,hasRotation:H,occludedFragmentFade:q,sampleSignedDistanceFieldTexelCenter:k}=e;t.include(g.Y6),t.include(m.A,e),t.include(l.g,e),D&&t.include(h.y);const{vertex:$,fragment:Z}=t;Z.include(y.a),t.varyings.add("vcolor","vec4"),t.varyings.add("vtc","vec2"),t.varyings.add("vsize","vec2");const Y=8===r,X=Y&&D;X&&t.varyings.add("voccluded","float"),$.uniforms.add(new v.I("viewport",e=>e.camera.fullViewport),new _.G("screenOffset",(e,t)=>(0,i.hZ)(R,2*e.screenOffset[0]*t.camera.pixelRatio,2*e.screenOffset[1]*t.camera.pixelRatio)),new _.G("anchorPosition",e=>O(e)),new w.E("materialColor",e=>e.color),new S.m("materialRotation",e=>e.rotation),new P.N("tex",e=>e.texture)),(0,b.Nz)($),E&&($.uniforms.add(new w.E("outlineColor",e=>e.outlineColor)),Z.uniforms.add(new w.E("outlineColor",e=>M(e)?e.outlineColor:s.uY),new S.m("outlineSize",e=>M(e)?e.outlineSize:0))),j&&$.uniforms.add(new x.V("pointDistanceSphere",(e,t)=>{const r=t.camera.eye,i=e.origin;return(0,s.fA)(i[0]-r[0],i[1]-r[1],i[2]-r[2],o.$O.radius)})),V&&$.include(c.K),L&&((0,g.pM)($),(0,g.OH)($)),U&&t.varyings.add("debugBorderCoords","vec4"),t.attributes.add("uv0","vec2"),t.attributes.add("uvi","vec4"),t.attributes.add("color","vec4"),t.attributes.add("size","vec2"),t.attributes.add("rotation","float"),(N||G)&&t.attributes.add("featureAttribute","vec4"),$.code.add(j?A.H`bool behindHorizon(vec3 posModel) {
2
- vec3 camToEarthCenter = pointDistanceSphere.xyz - localOrigin;
3
- vec3 camToPos = pointDistanceSphere.xyz + posModel;
4
- float earthRadius = pointDistanceSphere.w;
5
- float a = dot(camToPos, camToPos);
6
- float b = dot(camToPos, camToEarthCenter);
7
- float c = dot(camToEarthCenter, camToEarthCenter) - earthRadius * earthRadius;
8
- return b > 0.0 && b < a && b * b > a * c;
9
- }`:A.H`bool behindHorizon(vec3 posModel) { return false; }`),$.main.add(A.H`
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4006,7548],{620:(e,t,r)=>{r.d(t,{O_:()=>s,vA:()=>n}),r(48163),r(87317),(0,r(91829).vt)();class i{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}}function n(e,t="Assertion"){if(!e){const e=new Error(t).stack;throw new i(`${t} at ${e}`)}}function s(e,t,r,i){let n,s=(r[0]-e[0])/t[0],o=(i[0]-e[0])/t[0];s>o&&(n=s,s=o,o=n);let a=(r[1]-e[1])/t[1],l=(i[1]-e[1])/t[1];if(a>l&&(n=a,a=l,l=n),s>l||a>o)return!1;a>s&&(s=a),l<o&&(o=l);let c=(r[2]-e[2])/t[2],u=(i[2]-e[2])/t[2];return c>u&&(n=c,c=u,u=n),!(s>u||c>o||(u<o&&(o=u),o<0))}},2272:(e,t,r)=>{r.d(t,{Dl:()=>c,gf:()=>d,jV:()=>l,lF:()=>u});var i=r(92602),n=r(70333),s=r(4718),o=r(84952),a=r(926);function l(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function c(e){return"string"==typeof e?(0,o.An)(e):(0,s.o8)(e)}function u(e,t,r){const i={};for(const n in e){if("declaredClass"===n)continue;const s=e[n];if(null!=s&&"function"!=typeof s)if(Array.isArray(s))i[n]=s.map(e=>u(e));else if("object"==typeof s)if(s.toJSON){const e=s.toJSON(r?.[n]);i[n]=t?e:JSON.stringify(e)}else i[n]=t?s:JSON.stringify(s);else i[n]=s}return i}async function d(e,t,s){const o=function(e,t){return e?t&&(0,a.Qc)(e)?t:(0,a.CG)(e)??n.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!n.id&&i.A.request.useIdentity&&await Promise.all([r.e(7330),r.e(168),r.e(148)]).then(r.bind(r,50148));const l=await n.id.getCredential(e,s);return l?.token}},4146:(e,t,r)=>{r.d(t,{A:()=>b});var i=r(31635),n=r(11254),s=r(49186),o=r(65529),a=r(4902),l=r(92474),c=r(53966),u=r(74887),d=r(84952),h=r(91429),f=r(5443),p=r(16930),m=r(92602),y=r(79677);let g=0,b=class extends((0,o.Zt)((0,a.s)(l.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.A(-180,-90,180,90,p.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=p.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([r.e(812),r.e(7982)]).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await Promise.all([r.e(812),r.e(5613),r.e(5710)]).then(r.bind(r,45613));try{return await i(t)}catch(e){const r=t?.portalItem,i=r?.id||"unset",n=r?.portal?.url||m.A.portalUrl;throw c.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+n+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,u.zf)(e)||c.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,d.An)(this.url)}createLayerView(e,t){return Promise.reject(new s.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,n.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new s.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,h.MZ)({type:String})],b.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],b.prototype,"effectiveVisible",null),(0,i.Cg)([(0,h.MZ)({type:f.A})],b.prototype,"fullExtent",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],b.prototype,"hasAttributionData",null),(0,i.Cg)([(0,h.MZ)({type:String,clonable:!1})],b.prototype,"id",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],b.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:["show","hide","hide-children"]})],b.prototype,"listMode",void 0),(0,i.Cg)([(0,h.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],b.prototype,"opacity",void 0),(0,i.Cg)([(0,h.MZ)({clonable:!1})],b.prototype,"parent",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],b.prototype,"parsedUrl",null),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],b.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean})],b.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean})],b.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,h.MZ)({type:p.A})],b.prototype,"spatialReference",void 0),(0,i.Cg)([(0,h.MZ)({type:String})],b.prototype,"title",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0),(0,i.Cg)([(0,h.MZ)()],b.prototype,"url",void 0),(0,i.Cg)([(0,h.MZ)({type:y.A})],b.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,nonNullable:!0})],b.prototype,"visible",void 0),b=(0,i.Cg)([(0,h.$K)("esri.layers.Layer")],b)},4902:(e,t,r)=>{r.d(t,{s:()=>o});var i=r(31635),n=r(64108);let s=0;const o=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+s++})}};return r=(0,i.Cg)([(0,n.$)("esri.core.Identifiable")],r),r};o(class{})},6797:(e,t,r)=>{r.d(t,{Ui:()=>h});var i=r(69622),n=r(7762),s=r(88620);const o=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function a(e){return e instanceof i.A}function l(e){return e instanceof n.A?Object.keys(e.items):a(e)?(0,s.oY)(e).keys():e?Object.keys(e):[]}function c(e,t){return e instanceof n.A?e.items[t]:e[t]}function u(e){return e?e.declaredClass:null}function d(e,t){const r=e.diff;if(r&&"function"==typeof r)return r(e,t);const i=l(e),n=l(t);if(0===i.length&&0===n.length)return;if(!i.length||!n.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const s=n.filter(e=>!i.includes(e)),h=i.filter(e=>!n.includes(e)),f=i.filter(r=>n.includes(r)&&c(e,r)!==c(t,r)).concat(s,h).sort(),p=u(e);if(p&&o.has(p)&&f.length)return{type:"complete",oldValue:e,newValue:t};let m;const y=a(e)&&a(t);for(const i of f){const n=c(e,i),s=c(t,i);let o;if((y||"function"!=typeof n&&"function"!=typeof s)&&n!==s&&(null!=n||null!=s)){if(r&&r[i]&&"function"==typeof r[i])o=r[i]?.(n,s);else if(n instanceof Date&&s instanceof Date){if(n.getTime()===s.getTime())continue;o={type:"complete",oldValue:n,newValue:s}}else o="object"==typeof n&&"object"==typeof s&&u(n)===u(s)?d(n,s):{type:"complete",oldValue:n,newValue:s};null!=o&&(null!=m?m.diff[i]=o:m={type:"partial",diff:{[i]:o}})}}return m}function h(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&u(e)!==u(t)?{type:"complete",oldValue:e,newValue:t}:d(e,t)}},8631:(e,t,r)=>{r.d(t,{r:()=>h,g:()=>d});var i,n=r(53177),s=r(76357),o=r(31635),a=r(91429),l=r(93223);let c=class extends s.A{static{i=this}constructor(e){super(e),this.type="inherited"}clone(){return new i}};(0,o.Cg)([(0,l.e)({inherited:"inherited"})],c.prototype,"type",void 0),c=i=(0,o.Cg)([(0,a.$K)("esri.layers.support.InheritedDomain")],c);var u=r(41628);const d={key:"type",base:s.A,typeMap:{range:u.A,"coded-value":n.A,inherited:c}};function h(e){if(!e?.type)return null;switch(e.type){case"range":return u.A.fromJSON(e);case"codedValue":return n.A.fromJSON(e);case"inherited":return c.fromJSON(e)}return null}},13030:(e,t,r)=>{r.d(t,{Y$:()=>g,XW:()=>y,qB:()=>I,Qt:()=>Y,My:()=>Q,bf:()=>H,jZ:()=>S,j0:()=>A,Sx:()=>T,E$:()=>P,h:()=>j,P:()=>U,SL:()=>O,dy:()=>re,gH:()=>_,ZD:()=>b,si:()=>B,mJ:()=>X,UL:()=>K,D6:()=>k,Yi:()=>V,An:()=>N,LC:()=>R,xs:()=>x,EC:()=>v,Xm:()=>M,Vp:()=>W,zD:()=>ee,m8:()=>Z,nS:()=>z,H$:()=>G,eI:()=>D,td:()=>ie,Eq:()=>C,jz:()=>w,Aj:()=>E,E7:()=>J,Y4:()=>te,TX:()=>$,Uz:()=>L,ml:()=>q,XP:()=>F});var i=r(34727),n=r(87317),s=r(91829),o=r(20498);class a{static{this.ElementCount=9}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.elementCount=9;const s=this.TypedArrayConstructor;void 0===i&&(i=9*s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<9;e++)t[e]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<9;e++)this.typedBuffer[r++]=t[e]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){const i=this.typedBuffer,n=t.typedBuffer;let s=e*this.typedBufferStride,o=r*t.typedBufferStride;for(let e=0;e<9;++e)i[s++]=n[o++]}get buffer(){return this.typedBuffer.buffer}}class l{static{this.ElementCount=16}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.elementCount=16;const s=this.TypedArrayConstructor;void 0===i&&(i=16*s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}getMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<16;e++)t[e]=this.typedBuffer[r++];return t}setMat(e,t){let r=e*this.typedBufferStride;for(let e=0;e<16;e++)this.typedBuffer[r++]=t[e]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}copyFrom(e,t,r){this.copyFromTypedBuffer(e,t.typedBuffer,r*t.typedBufferStride)}copyFromTypedBuffer(e,t,r){const i=this.typedBuffer;let n=e*this.typedBufferStride;for(let e=0;e<16;++e)i[n++]=t[r++]}get buffer(){return this.typedBuffer.buffer}}class c{static{this.ElementCount=1}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.elementCount=1;const s=this.TypedArrayConstructor;void 0===i&&(i=s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.stride=i,this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}var u=r(37585);class d{static{this.ElementCount=2}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.start=r,this.elementCount=2;const s=this.TypedArrayConstructor;void 0===i&&(i=2*s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,u.hZ)(t,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e]=t[1]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e]=r}copyFrom(e,t,r){const i=this.typedBuffer,n=t.typedBuffer;let s=e*this.typedBufferStride,o=r*t.typedBufferStride;i[s++]=n[o++],i[s]=n[o]}get buffer(){return this.typedBuffer.buffer}}var h=r(38954);class f{static{this.ElementCount=3}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.elementCount=3;const s=this.TypedArrayConstructor;void 0===i&&(i=3*s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,h.h)(t,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e]=t[2]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e]=i}copyFrom(e,t,r){const i=this.typedBuffer,n=t.typedBuffer;let s=e*this.typedBufferStride,o=r*t.typedBufferStride;i[s++]=n[o++],i[s++]=n[o++],i[s]=n[o]}get buffer(){return this.typedBuffer.buffer}}class p{static{this.ElementCount=4}constructor(e,t,r=0,i,n){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;const s=this.TypedArrayConstructor;void 0===i&&(i=4*s.BYTES_PER_ELEMENT);const o=0===t.byteLength?0:r;this.typedBuffer=null==n?new s(t,o):new s(t,o,(n-r)/s.BYTES_PER_ELEMENT),this.typedBufferStride=i/s.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const i=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,i,this.stride,i+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,(0,n.c)(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,i,n){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=i,this.typedBuffer[e]=n}copyFrom(e,t,r){const i=this.typedBuffer,n=t.typedBuffer;let s=e*this.typedBufferStride,o=r*t.typedBufferStride;i[s++]=n[o++],i[s++]=n[o++],i[s++]=n[o++],i[s]=n[o]}get buffer(){return this.typedBuffer.buffer}}var m=r(620);class y extends c{constructor(e,t=0,r,i){(0,m.vA)(o.SX),super((0,o.pX)(),e,t,r,i),this.elementType="f16"}static{this.ElementType="f16"}}class g extends c{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}static{this.ElementType="f32"}}class b extends d{constructor(e,t=0,r,i){(0,m.vA)(o.SX),super((0,o.pX)(),e,t,r,i),this.elementType="f16"}slice(e,t){return this.sliceBuffer(b,e,t)}static{this.ElementType="f16"}}class _ extends d{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}slice(e,t){return this.sliceBuffer(_,e,t)}static{this.ElementType="f32"}}class v extends f{constructor(e,t=0,r,i){(0,m.vA)(o.SX),super((0,o.pX)(),e,t,r,i),this.elementType="f16"}slice(e,t){return this.sliceBuffer(v,e,t)}static{this.ElementType="f16"}}class x extends f{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}slice(e,t){return this.sliceBuffer(x,e,t)}static fromTypedArray(e,t){return new x(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f32"}}class w extends p{constructor(e,t=0,r,i){(0,m.vA)(o.SX),super((0,o.pX)(),e,t,r,i),this.elementType="f16"}slice(e,t){return this.sliceBuffer(w,e,t)}static{this.ElementType="f16"}}class C extends p{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}slice(e,t){return this.sliceBuffer(C,e,t)}static{this.ElementType="f32"}}class S extends a{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}slice(e,t){return this.sliceBuffer(S,e,t)}static{this.ElementType="f32"}}class A extends a{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static{this.ElementType="f64"}}class T extends l{constructor(e,t=0,r,i){super(Float32Array,e,t,r,i),this.elementType="f32"}slice(e,t){return this.sliceBuffer(T,e,t)}static{this.ElementType="f32"}}class P extends l{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(P,e,t)}static{this.ElementType="f64"}}class I extends c{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(I,e,t)}static{this.ElementType="f64"}}class B extends d{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(B,e,t)}static{this.ElementType="f64"}}class M extends f{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(M,e,t)}static fromTypedArray(e,t){return new M(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="f64"}}class E extends p{constructor(e,t=0,r,i){super(Float64Array,e,t,r,i),this.elementType="f64"}slice(e,t){return this.sliceBuffer(E,e,t)}static{this.ElementType="f64"}}class O extends c{constructor(e,t=0,r,i){super(Uint8Array,e,t,r,i),this.elementType="u8"}slice(e,t){return this.sliceBuffer(O,e,t)}static{this.ElementType="u8"}}class R extends d{constructor(e,t=0,r,i){super(Uint8Array,e,t,r,i),this.elementType="u8"}slice(e,t){return this.sliceBuffer(R,e,t)}static{this.ElementType="u8"}}class D extends f{constructor(e,t=0,r,i){super(Uint8Array,e,t,r,i),this.elementType="u8"}slice(e,t){return this.sliceBuffer(D,e,t)}static fromTypedArray(e,t){return new D(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}static{this.ElementType="u8"}}class F extends p{constructor(e,t=0,r,i){super(Uint8Array,e,t,r,i),this.elementType="u8"}slice(e,t){return this.sliceBuffer(F,e,t)}static{this.ElementType="u8"}}class j extends c{constructor(e,t=0,r,i){super(Uint16Array,e,t,r,i),this.elementType="u16"}slice(e,t){return this.sliceBuffer(j,e,t)}static{this.ElementType="u16"}}class V extends d{constructor(e,t=0,r,i){super(Uint16Array,e,t,r,i),this.elementType="u16"}slice(e,t){return this.sliceBuffer(V,e,t)}static{this.ElementType="u16"}}class z extends f{constructor(e,t=0,r,i){super(Uint16Array,e,t,r,i),this.elementType="u16"}slice(e,t){return this.sliceBuffer(z,e,t)}static{this.ElementType="u16"}}class L extends p{constructor(e,t=0,r,i){super(Uint16Array,e,t,r,i),this.elementType="u16"}slice(e,t){return this.sliceBuffer(L,e,t)}static{this.ElementType="u16"}}class U extends c{constructor(e,t=0,r,i){super(Uint32Array,e,t,r,i),this.elementType="u32"}slice(e,t){return this.sliceBuffer(U,e,t)}static{this.ElementType="u32"}}class N extends d{constructor(e,t=0,r,i){super(Uint32Array,e,t,r,i),this.elementType="u32"}slice(e,t){return this.sliceBuffer(N,e,t)}static{this.ElementType="u32"}}class G extends f{constructor(e,t=0,r,i){super(Uint32Array,e,t,r,i),this.elementType="u32"}slice(e,t){return this.sliceBuffer(G,e,t)}static{this.ElementType="u32"}}class q extends p{constructor(e,t=0,r,i){super(Uint32Array,e,t,r,i),this.elementType="u32"}slice(e,t){return this.sliceBuffer(q,e,t)}static{this.ElementType="u32"}}class H extends c{constructor(e,t=0,r,i){super(Int8Array,e,t,r,i),this.elementType="i8"}slice(e,t){return this.sliceBuffer(H,e,t)}static{this.ElementType="i8"}}class k extends d{constructor(e,t=0,r,i){super(Int8Array,e,t,r,i),this.elementType="i8"}slice(e,t){return this.sliceBuffer(k,e,t)}static{this.ElementType="i8"}}class Z extends f{constructor(e,t=0,r,i){super(Int8Array,e,t,r,i),this.elementType="i8"}slice(e,t){return this.sliceBuffer(Z,e,t)}static{this.ElementType="i8"}}class $ extends p{constructor(e,t=0,r,i){super(Int8Array,e,t,r,i),this.elementType="i8"}slice(e,t){return this.sliceBuffer($,e,t)}static{this.ElementType="i8"}}class Y extends c{constructor(e,t=0,r,i){super(Int16Array,e,t,r,i),this.elementType="i16"}slice(e,t){return this.sliceBuffer(Y,e,t)}static{this.ElementType="i16"}}class X extends d{constructor(e,t=0,r,i){super(Int16Array,e,t,r,i),this.elementType="i16"}slice(e,t){return this.sliceBuffer(X,e,t)}static{this.ElementType="i16"}}class W extends f{constructor(e,t=0,r,i){super(Int16Array,e,t,r,i),this.elementType="i16"}slice(e,t){return this.sliceBuffer(W,e,t)}static{this.ElementType="i16"}}class J extends p{constructor(e,t=0,r,i){super(Int16Array,e,t,r,i),this.elementType="i16"}slice(e,t){return this.sliceBuffer(J,e,t)}static{this.ElementType="i16"}}class Q extends c{constructor(e,t=0,r,i){super(Int32Array,e,t,r,i),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Q,e,t)}static{this.ElementType="i32"}}class K extends d{constructor(e,t=0,r,i){super(Int32Array,e,t,r,i),this.elementType="i32"}slice(e,t){return this.sliceBuffer(K,e,t)}static{this.ElementType="i32"}}class ee extends f{constructor(e,t=0,r,i){super(Int32Array,e,t,r,i),this.elementType="i32"}slice(e,t){return this.sliceBuffer(ee,e,t)}static{this.ElementType="i32"}}class te extends p{constructor(e,t=0,r,i){super(Int32Array,e,t,r,i),this.elementType="i32"}slice(e,t){return this.sliceBuffer(te,e,t)}static{this.ElementType="i32"}}class re extends O{constructor(e,t=0,r,i){super(e,t,r,i)}get(e){return this.typedBuffer[e*this.typedBufferStride]/255}set(e,t){this.typedBuffer[e*this.typedBufferStride]=Math.round(255*(0,i.qE)(t,0,1))}slice(e,t){return this.sliceBuffer(re,e,t)}}class ie extends F{constructor(e,t=0,r,i){super(e,t,r,i)}getVec(e,t){return(0,n.s)(t,super.getVec(e,t),1/255)}setVec(e,t){(0,n.m)(ne,(0,n.b)(ne,t,s.uY),s.Un),(0,n.s)(ne,ne,255),(0,n.r)(ne,ne),super.setVec(e,ne)}get(e,t){return super.get(e,t)/255}set(e,t,r){super.set(e,t,Math.round(255*(0,i.qE)(r,0,1)))}setValues(e,t,r,i,s){(0,n.c)(ne,t,r,i,s),this.setVec(e,ne)}slice(e,t){return this.sliceBuffer(ie,e,t)}}const ne=(0,s.vt)()},13259:(e,t,r)=>{r.d(t,{H:()=>D,b:()=>I,c:()=>M,f:()=>O});var i=r(37585),n=r(48163),s=r(91829),o=r(68317),a=r(36782),l=r(47522),c=r(40268),u=r(63578),d=r(50832),h=r(42593),f=r(82094),p=r(42398),m=r(63365),y=r(52587),g=r(20693),b=r(47286),_=r(14314),v=r(71988),x=r(33094),w=r(20304),C=r(31821),S=r(12791),A=r(63761),T=r(14113),P=r(49788);function I(e){const t=new T.N5;if(t.include(c.Q,e),t.vertex.include(o.rA,e),e.occlusionPass)return t.include(u.I,e),t;const{output:r,oitPass:n,signedDistanceFieldEnabled:I,visibilityPixelEnabled:O,pixelSnappingEnabled:D,hasEmission:F,hasScreenSizePerspective:j,debugDrawLabelBorder:V,hasVVSize:z,hasVVColor:L,hasRotation:U,occludedFragmentFade:N,sampleSignedDistanceFieldTexelCenter:G}=e;t.include(y.Y6),t.include(p.A,e),t.include(a.g,e),O&&t.include(d.y);const{vertex:q,fragment:H}=t;H.include(m.a),t.varyings.add("vcolor","vec4"),t.varyings.add("vtc","vec2"),t.varyings.add("vsize","vec2");const k=8===r,Z=k&&O;Z&&t.varyings.add("voccluded","float"),q.uniforms.add(new _.I("viewport",e=>e.camera.fullViewport),new b.G("screenOffset",(e,t)=>(0,i.hZ)(E,2*e.screenOffset[0]*t.camera.pixelRatio,2*e.screenOffset[1]*t.camera.pixelRatio)),new b.G("anchorPosition",e=>M(e)),new v.E("materialColor",e=>e.color),new w.m("materialRotation",e=>e.rotation),new A.N("tex",e=>e.texture)),(0,g.Nz)(q),I&&(q.uniforms.add(new v.E("outlineColor",e=>e.outlineColor)),H.uniforms.add(new v.E("outlineColor",e=>B(e)?e.outlineColor:s.uY),new w.m("outlineSize",e=>B(e)?e.outlineSize:0))),D&&q.include(l.K),j&&((0,y.pM)(q),(0,y.OH)(q)),V&&t.varyings.add("debugBorderCoords","vec4"),t.attributes.add("uv0","vec2"),t.attributes.add("uvi","vec4"),t.attributes.add("color","vec4"),t.attributes.add("size","vec2"),t.attributes.add("rotation","float"),(z||L)&&t.attributes.add("featureAttribute","vec4"),q.main.add(C.H`
10
2
  ProjectHUDAux projectAux;
11
3
  vec4 posProj = projectPositionHUD(projectAux);
12
4
  forwardObjectAndLayerIdColor();
13
5
 
14
6
  if (rejectBySlice(projectAux.posModel)) {
15
- gl_Position = ${p.Z};
16
- return;
17
- }
18
-
19
- if (behindHorizon(projectAux.posModel)) {
20
- gl_Position = ${p.Z};
7
+ gl_Position = ${f.Z};
21
8
  return;
22
9
  }
23
10
 
24
11
  vec2 inputSize;
25
- ${(0,A.If)(L,A.H`
12
+ ${(0,C.If)(j,C.H`
26
13
  inputSize = screenSizePerspectiveScaleVec2(size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective);
27
- vec2 screenOffsetScaled = screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);`,A.H`
14
+ vec2 screenOffsetScaled = screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment);`,C.H`
28
15
  inputSize = size;
29
16
  vec2 screenOffsetScaled = screenOffset;`)}
30
- ${(0,A.If)(N,A.H`inputSize *= vvScale(featureAttribute).xx;`)}
17
+ ${(0,C.If)(z,C.H`inputSize *= vvScale(featureAttribute).xx;`)}
31
18
 
32
19
  vec2 combinedSize = inputSize * pixelRatio;
33
20
  vec4 quadOffset = vec4(0.0);
34
21
 
35
- ${(0,A.If)(D,A.H`
22
+ ${(0,C.If)(O,C.H`
36
23
  bool visible = testHUDVisibility(posProj);
37
24
  if (!visible) {
38
25
  vtc = vec2(0.0);
39
- ${(0,A.If)(U,"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);")}
26
+ ${(0,C.If)(V,"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);")}
40
27
  return;
41
28
  }`)}
42
- ${(0,A.If)(X,A.H`voccluded = visible ? 0.0 : 1.0;`)}
43
- `);const W=A.H`
29
+ ${(0,C.If)(Z,C.H`voccluded = visible ? 0.0 : 1.0;`)}
30
+ `);const $=C.H`
44
31
  vec2 uv = mix(uvi.xy, uvi.zw, bvec2(uv0));
45
32
  vec2 texSize = vec2(textureSize(tex, 0));
46
- uv = mix(vec2(1.0), uv / texSize, lessThan(uv, vec2(${F})));
33
+ uv = mix(vec2(1.0), uv / texSize, lessThan(uv, vec2(${R})));
47
34
  quadOffset.xy = (uv0 - anchorPosition) * 2.0 * combinedSize;
48
35
 
49
- ${(0,A.If)(H,A.H`
36
+ ${(0,C.If)(U,C.H`
50
37
  float angle = radians(materialRotation + rotation);
51
38
  float cosAngle = cos(angle);
52
39
  float sinAngle = sin(angle);
@@ -56,36 +43,36 @@ return b > 0.0 && b < a && b * b > a * c;
56
43
  `)}
57
44
 
58
45
  quadOffset.xy = (quadOffset.xy + screenOffsetScaled) / viewport.zw * posProj.w;
59
- `,J=V?E?A.H`posProj = alignToPixelOrigin(posProj, viewport.zw) + quadOffset;`:A.H`posProj += quadOffset;
46
+ `,Y=D?I?C.H`posProj = alignToPixelOrigin(posProj, viewport.zw) + quadOffset;`:C.H`posProj += quadOffset;
60
47
  if (inputSize.x == size.x) {
61
48
  posProj = alignToPixelOrigin(posProj, viewport.zw);
62
- }`:A.H`posProj += quadOffset;`;$.main.add(A.H`
63
- ${W}
64
- ${G?"vcolor = interpolateVVColor(featureAttribute.y) * materialColor;":"vcolor = color / 255.0 * materialColor;"}
49
+ }`:C.H`posProj += quadOffset;`;q.main.add(C.H`
50
+ ${$}
51
+ ${L?"vcolor = interpolateVVColor(featureAttribute.y) * materialColor;":"vcolor = color / 255.0 * materialColor;"}
65
52
 
66
- ${(0,A.If)(9===r,A.H`vcolor.a = 1.0;`)}
53
+ ${(0,C.If)(9===r,C.H`vcolor.a = 1.0;`)}
67
54
 
68
- bool alphaDiscard = vcolor.a < ${A.H.float(B.Q)};
69
- ${(0,A.If)(E,`alphaDiscard = alphaDiscard && outlineColor.a < ${A.H.float(B.Q)};`)}
55
+ bool alphaDiscard = vcolor.a < ${C.H.float(P.Q)};
56
+ ${(0,C.If)(I,`alphaDiscard = alphaDiscard && outlineColor.a < ${C.H.float(P.Q)};`)}
70
57
  if (alphaDiscard) {
71
58
  // "early discard" if both symbol color (= fill) and outline color (if applicable) are transparent
72
59
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
73
60
  return;
74
61
  } else {
75
- ${J}
62
+ ${Y}
76
63
  gl_Position = posProj;
77
64
  }
78
65
 
79
66
  vtc = uv;
80
67
 
81
- ${(0,A.If)(U,A.H`debugBorderCoords = vec4(uv01, 1.5 / combinedSize);`)}
68
+ ${(0,C.If)(V,C.H`debugBorderCoords = vec4(uv01, 1.5 / combinedSize);`)}
82
69
  vsize = inputSize;
83
- `),Z.uniforms.add(new P.N("tex",e=>e.texture)),q&&!Y&&Z.uniforms.add(new T.x("depthMap",e=>e.mainDepth),new C.U("occludedOpacity",e=>e.hudOccludedFragmentOpacity));const Q=U?A.H`(isBorder > 0.0 ? 0.0 : ${A.H.float(B.Q)})`:A.H.float(B.Q),K=A.H`
84
- ${(0,A.If)(U,A.H`float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`)}
70
+ `),H.uniforms.add(new A.N("tex",e=>e.texture)),N&&!k&&H.uniforms.add(new S.x("depthMap",e=>e.mainDepth),new x.U("occludedOpacity",e=>e.hudOccludedFragmentOpacity));const X=V?C.H`(isBorder > 0.0 ? 0.0 : ${C.H.float(P.Q)})`:C.H.float(P.Q),W=C.H`
71
+ ${(0,C.If)(V,C.H`float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`)}
85
72
 
86
73
  vec2 samplePos = vtc;
87
74
 
88
- ${(0,A.If)(k,A.H`
75
+ ${(0,C.If)(G,C.H`
89
76
  float txSize = float(textureSize(tex, 0).x);
90
77
  float texelSize = 1.0 / txSize;
91
78
 
@@ -93,7 +80,7 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
93
80
  vec2 scaleFactor = (vsize - txSize) * texelSize;
94
81
  samplePos += (vec2(1.0, -1.0) * texelSize) * scaleFactor;`)}
95
82
 
96
- ${E?A.H`
83
+ ${I?C.H`
97
84
  vec4 fillPixelColor = vcolor;
98
85
 
99
86
  // Get distance in output units (i.e. pixels)
@@ -114,8 +101,8 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
114
101
  outlinePixelColor.a *= outlineAlphaFactor;
115
102
 
116
103
  if (
117
- outlineAlphaFactor + fillAlphaFactor < ${Q} ||
118
- fillPixelColor.a + outlinePixelColor.a < ${A.H.float(B.Q)}
104
+ outlineAlphaFactor + fillAlphaFactor < ${X} ||
105
+ fillPixelColor.a + outlinePixelColor.a < ${C.H.float(P.Q)}
119
106
  ) {
120
107
  discard;
121
108
  }
@@ -125,42 +112,42 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
125
112
  vec3 compositeColor = vec3(outlinePixelColor) * outlinePixelColor.a +
126
113
  vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a);
127
114
 
128
- ${(0,A.If)(!Y,A.H`fragColor = vec4(compositeColor, compositeAlpha);`)}
115
+ ${(0,C.If)(!k,C.H`fragColor = vec4(compositeColor, compositeAlpha);`)}
129
116
  } else {
130
- if (fillAlphaFactor < ${Q}) {
117
+ if (fillAlphaFactor < ${X}) {
131
118
  discard;
132
119
  }
133
120
 
134
- ${(0,A.If)(!Y,A.H`fragColor = premultiplyAlpha(fillPixelColor);`)}
121
+ ${(0,C.If)(!k,C.H`fragColor = premultiplyAlpha(fillPixelColor);`)}
135
122
  }
136
123
 
137
124
  // visualize SDF:
138
125
  // fragColor = vec4(clamp(-pixelDistance/vsize.x*2.0, 0.0, 1.0), clamp(pixelDistance/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0);
139
- `:A.H`
126
+ `:C.H`
140
127
  vec4 texColor = texture(tex, samplePos, -0.5);
141
- if (texColor.a < ${Q}) {
128
+ if (texColor.a < ${X}) {
142
129
  discard;
143
130
  }
144
- ${(0,A.If)(!Y,A.H`fragColor = texColor * premultiplyAlpha(vcolor);`)}
131
+ ${(0,C.If)(!k,C.H`fragColor = texColor * premultiplyAlpha(vcolor);`)}
145
132
  `}
146
133
 
147
- ${(0,A.If)(q&&!Y,A.H`
134
+ ${(0,C.If)(N&&!k,C.H`
148
135
  float zSample = texelFetch(depthMap, ivec2(gl_FragCoord.xy), 0).x;
149
136
  if (zSample < gl_FragCoord.z) {
150
137
  fragColor *= occludedOpacity;
151
138
  }
152
139
  `)}
153
140
 
154
- ${(0,A.If)(!Y&&U,A.H`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`)}
155
- `;switch(r){case 0:t.outputs.add("fragColor","vec4",0),z&&t.outputs.add("fragEmission","vec4",1),1===n&&t.outputs.add("fragAlpha","float",z?2:1),Z.main.add(A.H`
156
- ${K}
157
- ${(0,A.If)(2===n,A.H`fragColor.rgb /= fragColor.a;`)}
158
- ${(0,A.If)(z,A.H`fragEmission = vec4(0.0);`)}
159
- ${(0,A.If)(1===n,A.H`fragAlpha = fragColor.a;`)}`);break;case 9:Z.main.add(A.H`
160
- ${K}
161
- outputObjectAndLayerIdColor();`);break;case 8:t.include(f.Q,e),Z.main.add(A.H`
162
- ${K}
163
- outputHighlight(${(0,A.If)(X,A.H`voccluded == 1.0`,A.H`false`)});`)}return t}function M(e){return e.outlineColor[3]>0&&e.outlineSize>0}function O(e){return e.textureIsSignedDistanceField?(t=e.anchorPosition,r=e.distanceFieldBoundingBox,n=R,(0,i.hZ)(n,t[0]*(r[2]-r[0])+r[0],t[1]*(r[3]-r[1])+r[1])):(0,i.C)(R,e.anchorPosition),R;var t,r,n}const R=(0,n.vt)(),D=32e3,F=A.H.float(D),j=Object.freeze(Object.defineProperty({__proto__:null,build:E,calculateAnchorPosition:O,fullUV:D},Symbol.toStringTag,{value:"Module"}))},16215:(e,t,r)=>{r.d(t,{S:()=>n,Y:()=>i});const i=Symbol("BasemapInstance");function n(e){return null!=e&&"object"==typeof e&&i in e}},18251:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(31635),n=r(69540),s=r(25482),o=r(91429),a=r(51850),l=r(93223);let c=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.type="local",this.origin=(0,a.vt)()}};(0,i.Cg)([(0,l.e)({local:"local"},{readOnly:!0})],c.prototype,"type",void 0),(0,i.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],c.prototype,"origin",void 0),c=(0,i.Cg)([(0,o.$K)("esri.geometry.support.MeshLocalVertexSpace")],c)},20437:(e,t,r)=>{r.d(t,{A:()=>p});var i,n=r(31635),s=r(66552),o=r(25482),a=r(91429),l=r(56507),c=r(8631),u=r(98453),d=r(36005),h=r(93223);const f=new s.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let p=class extends o.o{static{i=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?.value??null}readValueType(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?f.fromJSON(r.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],p.prototype,"alias",void 0),(0,n.Cg)([(0,a.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],p.prototype,"defaultValue",void 0),(0,n.Cg)([(0,a.MZ)()],p.prototype,"description",void 0),(0,n.Cg)([(0,d.w)("description")],p.prototype,"readDescription",null),(0,n.Cg)([(0,a.MZ)({types:c.g,json:{read:{reader:c.r},write:!0}})],p.prototype,"domain",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],p.prototype,"editable",void 0),(0,n.Cg)([(0,a.MZ)({type:l.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],p.prototype,"length",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],p.prototype,"name",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],p.prototype,"nullable",void 0),(0,n.Cg)([(0,h.e)(u.m)],p.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)()],p.prototype,"valueType",void 0),(0,n.Cg)([(0,d.w)("valueType",["description"])],p.prototype,"readValueType",null),(0,n.Cg)([(0,a.MZ)({type:Boolean,json:{read:!1}})],p.prototype,"visible",void 0),p=i=(0,n.Cg)([(0,a.$K)("esri.layers.support.Field")],p)},20498:(e,t,r)=>{r.d(t,{SX:()=>s,pX:()=>n});let i=globalThis.Float16Array;function n(){return i}let s=!!i},27615:(e,t,r)=>{r.d(t,{CK:()=>l,Hq:()=>a,MW:()=>c,TE:()=>u,yJ:()=>d});var i=r(38954),n=r(86738),s=r(95696),o=r(18251);function a(e){return null!=e.origin}function l(e){return a(e.vertexSpace)}function c(e,t){if(!a(e))return null;const[r,i,s]=e.origin;return new n.A({x:r,y:i,z:s,spatialReference:t})}function u(e,t){const{x:r,y:i,z:n,spatialReference:a}=e,l=[r,i,n??0];return"local"===(t?.vertexSpace??function(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}(a))?new o.A({origin:l}):new s.A({origin:l})}function d(e,t){return e.type===t.type&&(e.origin===t.origin||null!=e.origin&&null!=t.origin&&(0,i.m)(e.origin,t.origin))}},31756:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(86211),n=r(79258);const s={unknown:1,inches:(0,i.oU)(1,"meters","inches"),feet:(0,i.oU)(1,"meters","feet"),"us-feet":(0,i.oU)(1,"meters","us-feet"),yards:(0,i.oU)(1,"meters","yards"),miles:(0,i.oU)(1,"meters","miles"),"nautical-miles":(0,i.oU)(1,"meters","nautical-miles"),millimeters:(0,i.oU)(1,"meters","millimeters"),centimeters:(0,i.oU)(1,"meters","centimeters"),decimeters:(0,i.oU)(1,"meters","decimeters"),meters:(0,i.oU)(1,"meters","meters"),kilometers:(0,i.oU)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.vl)(1,"meters",n.$O.radius)}},32587:(e,t,r)=>{r.d(t,{A:()=>s});var i=r(62788),n=r(95488);class s{constructor(e){this._observable=new n.I,this._notifyPending=!1,this._batchDepth=0,this._map=new Map(e)}get size(){return(0,i.gc)(this._observable),this._map.size}batch(e){try{this._batchDepth++,e()}finally{this._batchDepth--,this._notifyPending&&0===this._batchDepth&&(this._notifyPending=!1,this._notify())}}clear(){this._map.size>0&&(this._map.clear(),this._notify())}delete(e){const t=this._map.delete(e);return t&&this._notify(),t}entries(){return(0,i.gc)(this._observable),this._map.entries()}forEach(e,t){(0,i.gc)(this._observable),this._map.forEach((r,i)=>e.call(t,r,i,this),t)}get(e){return(0,i.gc)(this._observable),this._map.get(e)}has(e){return(0,i.gc)(this._observable),this._map.has(e)}keys(){return(0,i.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._notify(),this}transformValues(e,t=this._map.keys()){this.batch(()=>{for(const r of t){if(!this._map.has(r))continue;const t=this._map.get(r),i=e(t,r);i!==t&&this.set(r,i)}})}values(){return(0,i.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,i.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}_notify(){this._batchDepth>0?this._notifyPending=!0:this._observable.notify()}}},36708:(e,t,r)=>{r.d(t,{C_:()=>h,OH:()=>m,Vh:()=>y,on:()=>d,pc:()=>g,wB:()=>l,z7:()=>c});var i=r(37955),n=r(36563),s=r(97768),o=r(74887),a=r(14012);function l(e,t,r={}){return u(e,t,r,f)}function c(e,t,r={}){return u(e,t,r,p)}function u(e,t,r={},i){let n=null;const o=r.once?(e,r)=>{i(e)&&((0,s.xt)(n),t(e,r))}:(e,r)=>{i(e)&&t(e,r)};if(n=(0,a.Cn)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return n}function d(e,t,r,o={}){let a=null,c=null,u=null;function d(){a&&c&&(c.remove(),o.onListenerRemove?.(a),a=null,c=null)}function h(e){o.once&&o.once&&(0,s.xt)(u),r(e)}const f=l(e,(e,r)=>{d(),(0,i.wb)(e)&&(a=e,c=(0,i.on)(e,t,h),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return u=(0,n.hA)(()=>{f.remove(),d()}),u}function h(e,t){return function(e,t,r){if((0,o.G4)(r))return Promise.reject((0,o.NK)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,s.xt)(a)}return new Promise((i,s)=>{a=(0,n.vE)([(0,o.u7)(r,()=>{l(),s((0,o.NK)())}),u(e,e=>{l(),i(e)},{sync:!1,once:!0},t??f)])})}(e,p,t)}function f(e){return!0}function p(e){return!!e}r(80559);const m={sync:!0},y={initial:!0},g={sync:!0,initial:!0}},39357:(e,t,r)=>{r.d(t,{A:()=>a});var i,n=r(31635),s=r(25482),o=r(91429);let a=i=class extends s.o{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,n.Cg)([(0,o.MZ)({type:String,json:{write:{isRequired:!0}}})],a.prototype,"name",void 0),(0,n.Cg)([(0,o.MZ)({type:[String,Number],json:{write:{isRequired:!0}}})],a.prototype,"code",void 0),a=i=(0,n.Cg)([(0,o.$K)("esri.layers.support.CodedValue")],a)},40268:(e,t,r)=>{r.d(t,{Q:()=>d,R:()=>u});var i=r(35640),n=r(52587),s=r(20693),o=r(14314),a=r(33094),l=r(20304),c=r(31821);const u=.5;function d(e,t){e.include(n.Y6),e.attributes.add("position","vec3"),e.attributes.add("normal","vec3"),e.attributes.add("centerOffsetAndDistance","vec4");const r=e.vertex;(0,s.NB)(r,t),(0,s.yu)(r,t),r.uniforms.add(new o.I("viewport",e=>e.camera.fullViewport),new l.m("polygonOffset",e=>e.shaderPolygonOffset),new a.U("aboveGround",e=>e.camera.aboveGround?1:-1)),t.hasVerticalOffset&&(0,i.VQ)(r),r.code.add(c.H`struct ProjectHUDAux {
141
+ ${(0,C.If)(!k&&V,C.H`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`)}
142
+ `;switch(r){case 0:t.outputs.add("fragColor","vec4",0),F&&t.outputs.add("fragEmission","vec4",1),1===n&&t.outputs.add("fragAlpha","float",F?2:1),H.main.add(C.H`
143
+ ${W}
144
+ ${(0,C.If)(2===n,C.H`fragColor.rgb /= fragColor.a;`)}
145
+ ${(0,C.If)(F,C.H`fragEmission = vec4(0.0);`)}
146
+ ${(0,C.If)(1===n,C.H`fragAlpha = fragColor.a;`)}`);break;case 9:H.main.add(C.H`
147
+ ${W}
148
+ outputObjectAndLayerIdColor();`);break;case 8:t.include(h.Q,e),H.main.add(C.H`
149
+ ${W}
150
+ outputHighlight(${(0,C.If)(Z,C.H`voccluded == 1.0`,C.H`false`)});`)}return t}function B(e){return e.outlineColor[3]>0&&e.outlineSize>0}function M(e){return e.textureIsSignedDistanceField?(t=e.anchorPosition,r=e.distanceFieldBoundingBox,n=E,(0,i.hZ)(n,t[0]*(r[2]-r[0])+r[0],t[1]*(r[3]-r[1])+r[1])):(0,i.C)(E,e.anchorPosition),E;var t,r,n}const E=(0,n.vt)(),O=32e3,R=C.H.float(O),D=Object.freeze(Object.defineProperty({__proto__:null,build:I,calculateAnchorPosition:M,fullUV:O},Symbol.toStringTag,{value:"Module"}))},16215:(e,t,r)=>{r.d(t,{S:()=>n,Y:()=>i});const i=Symbol("BasemapInstance");function n(e){return null!=e&&"object"==typeof e&&i in e}},18251:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(31635),n=r(69540),s=r(25482),o=r(91429),a=r(51850),l=r(93223);let c=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.type="local",this.origin=(0,a.vt)()}};(0,i.Cg)([(0,l.e)({local:"local"},{readOnly:!0})],c.prototype,"type",void 0),(0,i.Cg)([(0,o.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],c.prototype,"origin",void 0),c=(0,i.Cg)([(0,o.$K)("esri.geometry.support.MeshLocalVertexSpace")],c)},20437:(e,t,r)=>{r.d(t,{A:()=>p});var i,n=r(31635),s=r(66552),o=r(25482),a=r(91429),l=r(56507),c=r(8631),u=r(98453),d=r(36005),h=r(93223);const f=new s.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let p=class extends o.o{static{i=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?.value??null}readValueType(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?f.fromJSON(r.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],p.prototype,"alias",void 0),(0,n.Cg)([(0,a.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],p.prototype,"defaultValue",void 0),(0,n.Cg)([(0,a.MZ)()],p.prototype,"description",void 0),(0,n.Cg)([(0,d.w)("description")],p.prototype,"readDescription",null),(0,n.Cg)([(0,a.MZ)({types:c.g,json:{read:{reader:c.r},write:!0}})],p.prototype,"domain",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],p.prototype,"editable",void 0),(0,n.Cg)([(0,a.MZ)({type:l.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],p.prototype,"length",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],p.prototype,"name",void 0),(0,n.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],p.prototype,"nullable",void 0),(0,n.Cg)([(0,h.e)(u.m)],p.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)()],p.prototype,"valueType",void 0),(0,n.Cg)([(0,d.w)("valueType",["description"])],p.prototype,"readValueType",null),(0,n.Cg)([(0,a.MZ)({type:Boolean,json:{read:!1}})],p.prototype,"visible",void 0),p=i=(0,n.Cg)([(0,a.$K)("esri.layers.support.Field")],p)},20498:(e,t,r)=>{r.d(t,{SX:()=>s,pX:()=>n});let i=globalThis.Float16Array;function n(){return i}let s=!!i},27615:(e,t,r)=>{r.d(t,{CK:()=>l,Hq:()=>a,MW:()=>c,TE:()=>u,yJ:()=>d});var i=r(38954),n=r(86738),s=r(95696),o=r(18251);function a(e){return null!=e.origin}function l(e){return a(e.vertexSpace)}function c(e,t){if(!a(e))return null;const[r,i,s]=e.origin;return new n.A({x:r,y:i,z:s,spatialReference:t})}function u(e,t){const{x:r,y:i,z:n,spatialReference:a}=e,l=[r,i,n??0];return"local"===(t?.vertexSpace??function(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}(a))?new o.A({origin:l}):new s.A({origin:l})}function d(e,t){return e.type===t.type&&(e.origin===t.origin||null!=e.origin&&null!=t.origin&&(0,i.m)(e.origin,t.origin))}},31756:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(86211),n=r(79258);const s={unknown:1,inches:(0,i.oU)(1,"meters","inches"),feet:(0,i.oU)(1,"meters","feet"),"us-feet":(0,i.oU)(1,"meters","us-feet"),yards:(0,i.oU)(1,"meters","yards"),miles:(0,i.oU)(1,"meters","miles"),"nautical-miles":(0,i.oU)(1,"meters","nautical-miles"),millimeters:(0,i.oU)(1,"meters","millimeters"),centimeters:(0,i.oU)(1,"meters","centimeters"),decimeters:(0,i.oU)(1,"meters","decimeters"),meters:(0,i.oU)(1,"meters","meters"),kilometers:(0,i.oU)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.vl)(1,"meters",n.$O.radius)}},32587:(e,t,r)=>{r.d(t,{A:()=>s});var i=r(62788),n=r(95488);class s{constructor(e){this._observable=new n.I,this._notifyPending=!1,this._batchDepth=0,this._map=new Map(e)}get size(){return(0,i.gc)(this._observable),this._map.size}batch(e){try{this._batchDepth++,e()}finally{this._batchDepth--,this._notifyPending&&0===this._batchDepth&&(this._notifyPending=!1,this._notify())}}clear(){this._map.size>0&&(this._map.clear(),this._notify())}delete(e){const t=this._map.delete(e);return t&&this._notify(),t}entries(){return(0,i.gc)(this._observable),this._map.entries()}forEach(e,t){(0,i.gc)(this._observable),this._map.forEach((r,i)=>e.call(t,r,i,this),t)}get(e){return(0,i.gc)(this._observable),this._map.get(e)}has(e){return(0,i.gc)(this._observable),this._map.has(e)}keys(){return(0,i.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._notify(),this}transformValues(e,t=this._map.keys()){this.batch(()=>{for(const r of t){if(!this._map.has(r))continue;const t=this._map.get(r),i=e(t,r);i!==t&&this.set(r,i)}})}values(){return(0,i.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,i.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}_notify(){this._batchDepth>0?this._notifyPending=!0:this._observable.notify()}}},36708:(e,t,r)=>{r.d(t,{C_:()=>h,OH:()=>m,Vh:()=>y,on:()=>d,pc:()=>g,wB:()=>l,z7:()=>c});var i=r(37955),n=r(36563),s=r(97768),o=r(74887),a=r(14012);function l(e,t,r={}){return u(e,t,r,f)}function c(e,t,r={}){return u(e,t,r,p)}function u(e,t,r={},i){let n=null;const o=r.once?(e,r)=>{i(e)&&((0,s.xt)(n),t(e,r))}:(e,r)=>{i(e)&&t(e,r)};if(n=(0,a.Cn)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return n}function d(e,t,r,o={}){let a=null,c=null,u=null;function d(){a&&c&&(c.remove(),o.onListenerRemove?.(a),a=null,c=null)}function h(e){o.once&&o.once&&(0,s.xt)(u),r(e)}const f=l(e,(e,r)=>{d(),(0,i.wb)(e)&&(a=e,c=(0,i.on)(e,t,h),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return u=(0,n.hA)(()=>{f.remove(),d()}),u}function h(e,t){return function(e,t,r){if((0,o.G4)(r))return Promise.reject((0,o.NK)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,s.xt)(a)}return new Promise((i,s)=>{a=(0,n.vE)([(0,o.u7)(r,()=>{l(),s((0,o.NK)())}),u(e,e=>{l(),i(e)},{sync:!1,once:!0},t??f)])})}(e,p,t)}function f(e){return!0}function p(e){return!!e}r(80559);const m={sync:!0},y={initial:!0},g={sync:!0,initial:!0}},39357:(e,t,r)=>{r.d(t,{A:()=>a});var i,n=r(31635),s=r(25482),o=r(91429);let a=i=class extends s.o{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,n.Cg)([(0,o.MZ)({type:String,json:{write:{isRequired:!0}}})],a.prototype,"name",void 0),(0,n.Cg)([(0,o.MZ)({type:[String,Number],json:{write:{isRequired:!0}}})],a.prototype,"code",void 0),a=i=(0,n.Cg)([(0,o.$K)("esri.layers.support.CodedValue")],a)},40268:(e,t,r)=>{r.d(t,{Q:()=>d,R:()=>u});var i=r(35640),n=r(52587),s=r(20693),o=r(14314),a=r(33094),l=r(20304),c=r(31821);const u=.5;function d(e,t){e.include(n.Y6),e.attributes.add("position","vec3"),e.attributes.add("normal","vec3"),e.attributes.add("centerOffsetAndDistance","vec4");const r=e.vertex;(0,s.NB)(r,t),(0,s.yu)(r,t),r.uniforms.add(new o.I("viewport",e=>e.camera.fullViewport),new l.m("polygonOffset",e=>e.shaderPolygonOffset),new a.U("aboveGround",e=>e.camera.aboveGround?1:-1)),t.hasVerticalOffset&&(0,i.VQ)(r),r.code.add(c.H`struct ProjectHUDAux {
164
151
  vec3 posModel;
165
152
  vec3 posView;
166
153
  vec3 vnormal;
@@ -271,7 +258,7 @@ float absCosAngle;
271
258
  posProj.z -= groundRelative * polygonOffset * posProj.w;
272
259
  return posProj;
273
260
  }
274
- `)}},41628:(e,t,r)=>{r.d(t,{A:()=>l});var i,n=r(31635),s=r(91429),o=r(76357),a=r(93223);let l=class extends o.A{static{i=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new i({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,n.Cg)([(0,s.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]},isRequired:!0}}})],l.prototype,"maxValue",void 0),(0,n.Cg)([(0,s.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]},isRequired:!0}}})],l.prototype,"minValue",void 0),(0,n.Cg)([(0,a.e)({range:"range"})],l.prototype,"type",void 0),l=i=(0,n.Cg)([(0,s.$K)("esri.layers.support.RangeDomain")],l)},42152:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ti});var i=r(31635),n=r(65529),s=r(74887),o=r(36708),a=r(91429),l=r(5443),c=r(91218),u=r(16930),d=r(56390),h=r(61956),f=r(65494);class p{constructor(e,t,r){this.renderCommandContext=e,this.renderCommandBuffer=t,this.pipelineStateCommands=r}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const t of e)this.appendPipelineStateCommand(t)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}static create(e,t=[]){return new p(e,e.createRenderCommandBuffer(),t)}}var m=r(68197),y=r(80138),g=r(51216),b=r(28975);function _(){return new y.A({material:new b.A({color:new m.A("red")})})}var v=r(9093),x=r(51850),w=r(91829);const C="sphere";var S=r(86211),A=r(58083),T=r(87317),P=r(70328),I=r(19419);r(12359),r(95108),r(27615),r(52106),r(4718),r(65864);var B=r(37585),E=r(48163),M=r(34727),O=r(26857);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const R=[];{const e=16;for(let t=0;t<360;t+=360/e)R.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}Object.freeze({left:0,center:.5,right:1});const D=Object.freeze({"bottom-left":(0,E.fA)(0,0),bottom:(0,E.fA)(.5,0),"bottom-right":(0,E.fA)(1,0),left:(0,E.fA)(0,.5),center:(0,E.fA)(.5,.5),right:(0,E.fA)(1,.5),"top-left":(0,E.fA)(0,1),top:(0,E.fA)(.5,1),"top-right":(0,E.fA)(1,1)});var F=r(9762),j=r(27993);function V(e){const{featureCount:t}=e;if(0===t)return new Uint32Array;const r=new Uint32Array(t);return e.getObjectIdsArray(r),r}function z(e){const{featureCount:t}=e;if(0===t)return new Float64Array;const r=new Float64Array(3*t);return e.getCoordinatesArray(r),r}function L(e,t){const r=t.viewSpatialReference,i=t.renderSpatialReference,{extent:n}=e,s=(0,I.gX)(n),o=(0,x.vt)();return(0,j.F)([s[0],s[1],0],r,o,i),o}var U=r(97146);function N(e){const t=new Map;for(const[r,i]of e)t.set(r,{...i,indices:(0,U.Dg)(i.indices)});return t}r(46859);var G=r(63907);const H=(0,w.CN)(.25,.25,.75,.75);function q(e){return"cross"===e||"x"===e}function k(e,t=128,r=.5*t,i=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return W(e,Y(r,r,t/2))}(t,r);case"square":return function(e,t){return $(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return Z(e,t,!1,r)}(t,r,i);case"x":return function(e,t,r=0){return Z(e,t,!0,r)}(t,r,i);case"kite":return function(e,t){return $(e,t,!0)}(t,r);case"triangle":return function(e,t){return W(e,X(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,i=t/2,n=e/2,s=.8*r,o=Y(n,(e-t)/2-s,Math.sqrt(s*s+i*i)),a=X(n,r,i);return W(e,(e,t)=>Math.max(a(e,t),-o(e,t)))}(t,r)}}function $(e,t,r){return r&&(t/=Math.SQRT2),W(e,(i,n)=>{let s=i-.5*e+.25,o=.5*e-n-.75;if(r){const e=(s+o)/Math.SQRT2;o=(o-s)/Math.SQRT2,s=e}return Math.max(Math.abs(s),Math.abs(o))-.5*t})}function Z(e,t,r,i=0){t-=i,r&&(t*=Math.SQRT2);const n=.5*t;return W(e,(t,s)=>{let o,a=t-.5*e,l=.5*e-s-1;if(r){const e=(a+l)/Math.SQRT2;l=(l-a)/Math.SQRT2,a=e}return a=Math.abs(a),l=Math.abs(l),o=a>l?a>n?Math.sqrt((a-n)*(a-n)+l*l):l:l>n?Math.sqrt(a*a+(l-n)*(l-n)):a,o-=i/2,o})}function Y(e,t,r){return(i,n)=>{const s=i-e,o=n-t;return Math.sqrt(s*s+o*o)-r}}function X(e,t,r){const i=Math.sqrt(t*t+r*r);return(n,s)=>{const o=Math.abs(n-e)-r,a=s-e+t/2+.75,l=(t*o+r*a)/i,c=-a;return Math.max(l,c)}}function W(e,t){const r=new Float32Array(e*e);for(let i=0;i<e;i++)for(let n=0;n<e;n++)r[n+e*i]=t(n,i)/e;return r}var J=r(46610);class Q{constructor(e,t){this._context=null,this._symbolLayer=null,this._draped=!1,this._loaded=!1,this._loadingPromise=null,this._iconTextureID=null,this._materialId=null,this._context=t,this._symbolLayer=e}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}_destroy(){this._iconTextureID=null}async _load(){const e=this._context.renderCommandContext,t=await e.createTexture(()=>function(e,t=128,r=.5*t,i=0){return{data:k(e,t,r,i),parameters:{mipmap:!1,wrap:{s:33071,t:33071},width:t,height:t,noUnpackFlip:!0,dataType:G.ld.FLOAT,pixelFormat:6403,internalFormat:G.H0.R16F,reloadable:!0}}}("circle"));this._iconTextureID=t;const r={anchorPosition:D.center,useVisibilityPixel:!0,hasSlicePlane:!1,color:this._getFillColor(),outlineColor:this._getOutlineColor(),outlineSize:1,distanceFieldBoundingBox:H,textureId:t,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:q("circle")},i=new Uint8Array(8),n=255;i[0]=0,i[1]=0,i[2]=0,i[3]=n,i[4]=n,i[5]=0,i[6]=n,i[7]=n,this._materialId=await e.createMaterial({type:"hud",parameters:r}),await e.createDirectRenderer(this._materialId),await e.setBaseInstance(this._materialId,{data:i.buffer,elementCount:4}),this._loaded=!0}async createAddCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:i}=r;if(null==t)throw new Error("expected material not to be null");const n=await this._createGeometry(e);if(null==n)return r.createPipelineCommand();const s=L(e,r);return r.createPipelineCommand(i.addDirectRendererGeometry(e.id,n,s))}async _createGeometry(e){const{_materialId:t,_context:r}=this,{mainThreadDelegate:i}=r,{featureCount:n}=e;if(0===n||null==t)return null;const s=V(e),o=z(e),a=function(e,t){const r=e.length/3,i=t.viewSpatialReference,n=t.renderSpatialReference,s=new Float64Array(3*r);if(!(0,F.projectBuffer)(e,i,0,s,n,0,r))throw new Error("Failed to project coordinates");return s}(await i.applyElevationAlignmentTo(o),r),l=new Float64Array([0,0,1]),c=new Float64Array([255,255,255,255]),u=new Float64Array([24,24]),d=new Float64Array([0,0,0,1]),h=new Float64Array([0]),f=new Uint32Array(n);for(let e=0;e<n;++e)f[e]=e;const p=new Uint32Array(n);for(let e=0;e<n;++e)p[e]=0;const m=[["position",new J.n(a,f,3,!0)],["normal",new J.n(l,p,3,!0)],["color",new J.n(c,p,4,!0)],["rotation",new J.n(h,p,1,!0)],["size",new J.n(u,p,2,!0)],["centerOffsetAndDistance",new J.n(d,p,4,!0)]],y=new Uint8Array(n);return e.getVisibilityArray(y),{attributes:N(m),olidColor:void 0,transformation:(0,v.vt)(),materialId:t,objectIds:s,visibilities:y}}async createRemoveCommand(e){const{_materialId:t,_context:r}=this,i=r.renderCommandContext;return null==t?r.createPipelineCommand():r.createPipelineCommand(i.removeDirectRendererGeometryBuffer(t,e))}async createUpdateVisibilityCommand(e){const{_materialId:t,_context:r}=this,i=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const n=new Uint8Array(e.featureCount);return e.getVisibilityArray(n),r.createPipelineCommand(i.updateVisibility(t,e.id,n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_materialId:r}=this,i=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(i.updateMaterial({type:"hud",materialId:r,parameters:{color:this._getFillColor(),outlineColor:this._getOutlineColor()}}))}async createUpdateElevationCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:i}=r,{featureCount:n,id:s}=e;if(null==t||0===n)return r.createPipelineCommand();const o=await this._createGeometry(e);if(null==o)return r.createPipelineCommand();const a=L(e,r);return r.createPipelineCommand(i.updateDirectRendererGeometry(s,o,a))}async createDestroyCommand(){const{_iconTextureID:e,_context:t}=this,r=t.renderCommandContext;let i;return i=null!=e?await r.releaseTexture(e):p.create(r),i.appendPipelineStateCommand(()=>this._destroy()),i}_getOutlineColor(){const e=this._getLayerOpacity(),t=this._symbolLayer,r=t?.outline?.color;if(null!=r){const t=r.toUnitRGB(),i=r.a*e;return[t[0],t[1],t[2],i]}return[0,0,0,0]}_getFillColor(){if(function(e){return null!=e&&("cross"===e||"x"===e)}(this._getPrimitive()))return ee;const e=null==this._getPrimitive(),t=this._symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}_getCombinedOpacity(e,t=K){const r=this._draped?1:this._getLayerOpacity();return e?r*e.a:t.hasIntrinsicColor?r:0}_getCombinedOpacityAndColor(e,t=K){const r=this._getCombinedOpacity(e,t);return function(e,t,r=null){const i=(0,w.o8)(w.Un);return null!=e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],e.length>3&&(i[3]=e[3])),null!=t&&(i[3]=t),r&&(0,T.s)(i,i,r),i}(e?.toUnitRGB()??x.Un,r)}_getPrimitive(){return e=this._symbolLayer,e.resource?.href?null:e.resource?.primitive??"circle";var e}}const K={hasIntrinsicColor:!1},ee=w.uY;class te{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._context=null,this._symbol=null,this._symbolLayerRenderers=[],this._context=t,this._symbol=e}_destroy(){}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_context:e,_symbol:t,_symbolLayerRenderers:r}=this,i=[];for(const n of t.symbolLayers){const t=e.symbolRendererFactory.createSymbolRendererFromSymbolLayer(n);null!=t&&(i.push(t.load()),r.push(t))}await Promise.all(i),this._loaded=!0}async createDestroyCommand(){const{_context:e,_symbolLayerRenderers:t}=this,r=[];for(const e of t)r.push(e.createDestroyCommand());const i=e.joinPipelineCommands(await Promise.all(r));return i.appendPipelineStateCommand(()=>this._destroy()),i}async createAddCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createAddCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createRemoveCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createRemoveCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateVisibilityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateVisibilityCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateLayerViewOpacityCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateElevationCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateElevationCommand(e));return t.joinPipelineCommands(await Promise.all(i))}}class re{constructor(e,t){this._symbol=null,this._featureData=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_renderer:e,_context:t}=this;this._symbol=t.symbolRendererFactory.createSymbolRendererFromSymbol(e.symbol),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=await this._provisionSymbol(),i=null==r?t.createPipelineCommand():await r.createAddCommand(e);return i.appendPipelineStateCommand(()=>this._featureData.set(e.id,e)),i}async createRemoveCommand(e){const t=this._context,r=await this._provisionSymbol(),i=null==r?t.createPipelineCommand():await r.createRemoveCommand(e);return i.appendPipelineStateCommand(()=>this._featureData.delete(e)),i}async createUpdateVisibilityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateVisibilityCommand(e)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateLayerViewOpacityCommand(e)}async createUpdateElevationCommand(){const{_featureData:e,_context:t}=this,r=await this._provisionSymbol();if(null==r)return t.createPipelineCommand();const i=[];for(const t of e.values())i.push(r.createUpdateElevationCommand(t));const n=await Promise.all(i);return t.joinPipelineCommands(n)}async createDestroyCommand(){const{_symbol:e,_context:t,_featureData:r}=this;if(!e)return t.createPipelineCommand();const i=[];for(const e of r.keys())i.push(this.createRemoveCommand(e));i.push(e.createDestroyCommand());const n=await Promise.all(i);return t.joinPipelineCommands(n)}async _provisionSymbol(){const e=this._symbol;return e?(e.loaded||await e.load(),e):null}}var ie=r(48353),ne=r(8887),se=r(38954),oe=r(72385),ae=(r(4197),r(11868)),le=r(27921),ce=r(71351),ue=r(73941);function de(e,t){const r=e[t],i=e[t+1],n=e[t+2];return Math.sqrt(r*r+i*i+n*n)}function he(e,t){const r=e[t],i=e[t+1],n=e[t+2],s=1/Math.sqrt(r*r+i*i+n*n);e[t]*=s,e[t+1]*=s,e[t+2]*=s}function fe(e,t,r){e[t]*=r,e[t+1]*=r,e[t+2]*=r}r(37539),r(20498),r(87170),(0,E.vt)(),(0,E.vt)();var pe=r(620);r(78754);const me=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)me[6*e+t]=e;const ye=new Array(36);for(let e=0;e<6;e++)ye[6*e]=0,ye[6*e+1]=1,ye[6*e+2]=2,ye[6*e+3]=2,ye[6*e+4]=3,ye[6*e+5]=0;const ge=(0,oe.fA)(-.5,0,-.5),be=(0,oe.fA)(.5,0,-.5),_e=(0,oe.fA)(0,0,.5),ve=(0,oe.fA)(0,.5,0),xe=(0,oe.vt)(),we=(0,oe.vt)(),Ce=(0,oe.vt)(),Se=(0,oe.vt)(),Ae=(0,oe.vt)();(0,se.e)(xe,ge,ve),(0,se.e)(we,ge,be),(0,se.f)(Ce,xe,we),(0,se.n)(Ce,Ce),(0,se.e)(xe,be,ve),(0,se.e)(we,be,_e),(0,se.f)(Se,xe,we),(0,se.n)(Se,Se),(0,se.e)(xe,_e,ve),(0,se.e)(we,_e,ge),(0,se.f)(Ae,xe,we),(0,se.n)(Ae,Ae),Ce[0],Ce[1],Ce[2],Se[0],Se[1],Se[2],Ae[0],Ae[1],Ae[2],(0,x.vt)();var Te=r(4576);r(6867),r(87582);var Pe=r(57917);function Ie(e,t){const r=(e,r,i=!1)=>({levels:e.map(e=>{const n=N(r(e.tesselation));return i&&function(e){const t=e,r=t.get("position").data,i=t.get("normal").data;if(i){const t=Be(e,"normal").data;for(let e=0;e<i.length;e+=3){const r=i[e+1];t[e+1]=-i[e+2],t[e+2]=r}}if(r){const t=Be(e,"position").data;for(let e=0;e<r.length;e+=3){const i=r[e+1];t[e+1]=-r[e+2],t[e+2]=i}}}(n),{components:[{attributes:n,olidColor:void 0,transformation:null,materialId:t,visibilities:new Uint8Array([1]),objectIds:new Uint32Array([-1])}],minScreenSpaceRadius:e.minScreenSpaceRadius}})});switch(e){case"cone":return r(Ee,e=>function(e,t,r,i,n=!0,s=!0){let o=0;const a=t,l=e;let c=(0,oe.fA)(0,o,0),u=(0,oe.fA)(0,o+l,0),d=(0,oe.fA)(0,-1,0),h=(0,oe.fA)(0,1,0);i&&(o=l,u=(0,oe.fA)(0,0,0),c=(0,oe.fA)(0,o,0),d=(0,oe.fA)(0,1,0),h=(0,oe.fA)(0,-1,0));const f=[u,c],p=[d,h],m=r+2,y=Math.sqrt(l*l+a*a);if(i)for(let e=r-1;e>=0;e--){const t=e*(2*Math.PI/r),i=(0,oe.fA)(Math.cos(t)*a,o,Math.sin(t)*a);f.push(i);const n=(0,oe.fA)(l*Math.cos(t)/y,-a/y,l*Math.sin(t)/y);p.push(n)}else for(let e=0;e<r;e++){const t=e*(2*Math.PI/r),i=(0,oe.fA)(Math.cos(t)*a,o,Math.sin(t)*a);f.push(i);const n=(0,oe.fA)(l*Math.cos(t)/y,a/y,l*Math.sin(t)/y);p.push(n)}const g=new Array,b=new Array;if(n){for(let e=3;e<f.length;e++)g.push(1),g.push(e-1),g.push(e),b.push(0),b.push(0),b.push(0);g.push(f.length-1),g.push(2),g.push(1),b.push(0),b.push(0),b.push(0)}if(s){for(let e=3;e<f.length;e++)g.push(e),g.push(e-1),g.push(0),b.push(e),b.push(e-1),b.push(1);g.push(0),g.push(2),g.push(f.length-1),b.push(1),b.push(2),b.push(p.length-1)}const _=(0,ae.oe)(3*m);for(let e=0;e<m;e++)_[3*e]=f[e][0],_[3*e+1]=f[e][1],_[3*e+2]=f[e][2];const v=(0,ae.oe)(3*m);for(let e=0;e<m;e++)v[3*e]=p[e][0],v[3*e+1]=p[e][1],v[3*e+2]=p[e][2];return[["position",new J.n(_,g,3,!0)],["normal",new J.n(v,b,3,!0)]]}(1,.5,e,!1),!0);case"sphere":return r([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],e=>function(e,t,r){const i=e;let n,s;if(r)n=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],s=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const e=i*(1+Math.sqrt(5))/2;n=[-i,e,0,i,e,0,-i,-e,0,i,-e,0,0,-i,e,0,i,e,0,-i,-e,0,i,-e,e,0,-i,e,0,i,-e,0,-i,-e,0,i],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let t=0;t<n.length;t+=3)fe(n,t,e/de(n,t));let o={};function a(t,r){t>r&&([t,r]=[r,t]);const i=t.toString()+"."+r.toString();if(o[i])return o[i];let s=n.length;return n.length+=3,function(e,t,r,i,n,s=t){(n=n||e)[s]=e[t]+r[i],n[s+1]=e[t+1]+r[i+1],n[s+2]=e[t+2]+r[i+2]}(n,3*t,n,3*r,n,s),fe(n,s,e/de(n,s)),s/=3,o[i]=s,s}for(let e=0;e<t;e++){const e=s.length,t=new Array(4*e);for(let r=0;r<e;r+=3){const e=s[r],i=s[r+1],n=s[r+2],o=a(e,i),l=a(i,n),c=a(n,e),u=4*r;t[u]=e,t[u+1]=o,t[u+2]=c,t[u+3]=i,t[u+4]=l,t[u+5]=o,t[u+6]=n,t[u+7]=c,t[u+8]=l,t[u+9]=o,t[u+10]=l,t[u+11]=c}s=t,o={}}const l=(0,ae.Wz)(n);for(let e=0;e<l.length;e+=3)he(l,e);return[["position",new J.n((0,ae.Wz)(n),s,3,!0)],["normal",new J.n(l,s,3,!0)]]}(.5,e,!0));case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function Be(e,t){let r=e.get(t);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:(0,Pe.S)(r.data)},e.set(t,r)),r}const Ee=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];var Me=r(2495),Oe=r(74810);class Re{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._primitiveMaterialId=null,this._lodRendererId=null,this._context=null,this._symbolLayer=null,this._primitive=null,this._context=t,this._symbolLayer=e}_destroy(){this._lodRendererId=null,this._primitiveMaterialId=null}get loaded(){return this._loaded}get _isPrimitive(){return null!=this._primitive}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const e=this._context.renderCommandContext,t=this._getLayerOpacity();let r={usePBR:!0,isSchematic:!0,mrrFactors:Oe.Bt,ambient:x.Un,diffuse:x.Un,hasSlicePlane:!1,castShadows:!0,layerOpacity:t,offsetTransparentBackfaces:!1,screenSizePerspective:{}};if(r.externalColor=w.Un,r.instanced=!0,this._isPrimitive){const e=new Me.fs;e.layerOpacity=t,r={...r,cullFace:De((0,Me.ty)(e))}}const i=await e.createMaterial({type:"default",parameters:r}),n=this._symbolLayer.resource;this._primitive=n&&function(e){switch(e){case"sphere":case"cube":case"diamond":case"cylinder":case"cone":case"inverted-cone":case"tetrahedron":return!0}return!1}(n?.primitive)?n.primitive:C;const s=Ie(this._primitive,i);this._lodRendererId=await e.createLodRenderer(s),this._primitiveMaterialId=i,this._loaded=!0}async createDestroyCommand(){const{_lodRendererId:e,_primitiveMaterialId:t,_context:r}=this,i=r.renderCommandContext,n=[];return null!=e&&n.push(i.destroyLodRenderer(e)),null!=t&&n.push(i.destroyMaterial(t)),new p(i,i.mergeRenderCommandBuffers(n),[()=>this._destroy()])}async createAddCommand(e){const t=this._context,{renderCommandContext:r,mainThreadDelegate:i}=t;if(null==this._lodRendererId)throw new Error("expected lod renderer id to not be null");const{featureCount:n}=e;if(0===n)return t.createPipelineCommand();const s=this._isPrimitive,o=this._primitive||C,a=(0,P.vt)((0,ne.Fq)(o)),l=(0,x.ci)((0,P.Ej)(a)),c=(0,x.ci)((0,ne.Bb)(l,{isPrimitive:s,width:100,depth:null,height:null})),u=new Float64Array(16*n),d=new Float64Array(16*n),h=z(e),f=await i.applyElevationAlignmentTo(h);for(let e=0;e<n;++e){const t=e,r=f[3*e+0],i=f[3*e+1],n=f[3*e+2],s=this._computeGlobalTransform(r,i,n,this._context.viewSpatialReference,Ve),o=this._computeLocalTransform(c,l,je);this._writeMatrixToTypedBuffer(u,t,o),this._writeMatrixToTypedBuffer(d,t,s)}const p=V(e),m=new Uint8Array(n);e.getVisibilityArray(m);const y={featureIds:new Uint32Array(p),visibility:m,localTransforms:u,globalTransforms:d};return t.createPipelineCommand(r.addLodInstances(this._lodRendererId,e.id,y))}async createRemoveCommand(e){const{_context:t,_lodRendererId:r}=this,i=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(i.removeLodInstances(r,e))}async createUpdateVisibilityCommand(e){const{_lodRendererId:t,_context:r}=this,i=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const n=new Uint8Array(e.featureCount);return e.getVisibilityArray(n),r.createPipelineCommand(i.updateVisibility(t,e.id,n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t}=this,r=t.renderCommandContext,i=this._primitiveMaterialId;if(null==i)return t.createPipelineCommand();const n=this._getLayerOpacity();let s={layerOpacity:n};if(this._isPrimitive){const e=new Me.fs;e.layerOpacity=n,s={...s,cullFace:De((0,Me.ty)(e))}}return t.createPipelineCommand(r.updateMaterial({type:"default",materialId:i,parameters:s}))}async createUpdateElevationCommand(e){const{_context:t,_lodRendererId:r}=this,{renderCommandContext:i,mainThreadDelegate:n}=t,{featureCount:s,id:o}=e;if(null==r||0===s)return t.createPipelineCommand();const a=new Float64Array(16*s),l=z(e),c=await n.applyElevationAlignmentTo(l);for(let e=0;e<s;++e){const t=e,r=c[3*e+0],i=c[3*e+1],n=c[3*e+2],s=this._computeGlobalTransform(r,i,n,this._context.viewSpatialReference,Ve);this._writeMatrixToTypedBuffer(a,t,s)}return t.createPipelineCommand(i.updateLodInstancesData(r,o,a))}_writeMatrixToTypedBuffer(e,t,r){let i=16*t;for(let t=0;t<16;t++)e[i++]=r[t]}_computeGlobalTransform(e,t,r,i,n){return Fe[0]=e,Fe[1]=t,Fe[2]=r,(0,ie.l)(i,Fe,n,this._context.renderSpatialReference),n}_computeLocalTransform(e,t,r){return(0,A.D_)(r),this._applyObjectScale(e,t,r),r}_applyObjectScale(e,t,r){const i=function(e=x.Un,t,r,i=1){const n=new Array(3);if(null==t||null==r)n[0]=1,n[1]=1,n[2]=1;else{let i,s=0;for(let o=2;o>=0;o--){const a=e[o],l=null!=a,c=0===o&&!i&&!l,u=r[o];let d;"symbol-value"===a||c?d=0!==u?t[o]/u:1:l&&"proportional"!==a&&isFinite(a)&&(d=0!==u?a/u:1),null!=d&&(n[o]=d,i=d,s=Math.max(s,Math.abs(d)))}for(let e=2;e>=0;e--)null==n[e]?n[e]=i:0===n[e]&&(n[e]=.001*s)}for(let e=2;e>=0;e--)n[e]/=i;return(0,x.ci)(n)}(e,e,t,this._context.renderCoordsHelper.unitInMeters);1===i[0]&&1===i[1]&&1===i[2]||(0,A.hs)(r,r,i)}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}}function De(e){return e?0:2}const Fe=(0,x.vt)(),je=(0,v.vt)(),Ve=(0,v.vt)();class ze{constructor(e,t){this._symbols=new Array,this._featureDataPartitioning=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){this._symbols[0]=new Q(_(),this._context),this._symbols[1]=new Re(new g.A,this._context),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=this._partition(e),i=await Promise.all(r.map(async({index:e,features:t})=>{const r=await this._provisionSymbol(e);return await(r?.createAddCommand(t))})),n=t.joinPipelineCommands(i);return n.appendPipelineStateCommand(()=>this._featureDataPartitioning.set(e.id,r)),n}async createRemoveCommand(e){const{_featureDataPartitioning:t,_context:r}=this,i=r.renderCommandContext,n=t.get(e);if(null==n)return new p(i,i.createRenderCommandBuffer(),[]);const s=await Promise.all(n.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createRemoveCommand(t.id))})),o=r.joinPipelineCommands(s);return o.appendPipelineStateCommand(()=>t.delete(e)),o}async createUpdateVisibilityCommand(e){const{_featureDataPartitioning:t,_context:r}=this,i=r.renderCommandContext,n=t.get(e.id);if(null==n)return new p(i,i.createRenderCommandBuffer(),[]);const s=await Promise.all(n.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateVisibilityCommand(t))}));return r.joinPipelineCommands(s)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=[];for(let t=0;t<this._symbols.length;++t){const i=this._symbols[t];null!=i&&i.loaded&&r.push(i.createUpdateLayerViewOpacityCommand(e))}const i=await Promise.all(r);return t.joinPipelineCommands(i)}async createUpdateElevationCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.values()){const e=t.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateElevationCommand(t))});r.push(...e)}const i=await Promise.all(r);return t.joinPipelineCommands(i)}async createDestroyCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.keys())r.push(this.createRemoveCommand(t));for(const e of this._symbols)r.push(e.createDestroyCommand());const i=await Promise.all(r);return t.joinPipelineCommands(i)}async _provisionSymbol(e){if(null==e)return null;const t=this._symbols[e];return t?(t.loaded||await t.load(),t):null}_getLoadedSymbol(e){if(null==e)return null;const t=this._symbols[e];return null!=t&&t.loaded?t:null}_partition(e){const t=V(e);if(null==t)throw new Error("unable to fetch objectIds");const{featureCount:r}=e,i=[[],[]];for(let e=0;e<r;++e)i[t[e]%2].push(e);return i.map((t,r)=>new Le(r,e.subset(new Uint32Array(t)))).filter(e=>e.features.featureCount>0)}}class Le{constructor(e,t){this.index=e,this.features=t}}class Ue{constructor(e,t,r,i,n,s,o){this.viewSpatialReference=e,this.renderSpatialReference=t,this.mainThreadDelegate=r,this.renderCoordsHelper=i,this.renderCommandContext=n,this.layerInfo=s,this.layerViewInfo=o,this.symbolRendererFactory=new Ne(this)}createPipelineCommand(e=this.renderCommandContext.createRenderCommandBuffer(),t=[]){return new p(this.renderCommandContext,e,t)}joinPipelineCommands(e){return 0===e.length?this.createPipelineCommand():e.filter(e=>null!=e).reduce((e,t)=>(e.append(t),e))}}class Ne{constructor(e){this.context=e}createSymbolRendererFromJSON(e){const t=(0,f.L)(e??Ge)??void 0;if(!t)throw new Error("Failed to create renderer");const r=t.type;switch(r){case"simple":return new re(t,this.context);case"unique-value":return new ze(t,this.context);default:return console.warn(`Unable to create symbolrenderer for renderer of ${r}`),this.createSymbolRendererFromJSON(Ge)}}createSymbolRendererFromSymbol(e){const t=e?.type;switch(t){case"point-3d":return new te(e,this.context);case"picture-marker":case"simple-marker":return new Q(_(),this.context);default:return console.warn(`Unable to create symbolrenderer for symbol of ${t}`),null}}createSymbolRendererFromSymbolLayer(e){const t=e.type;return"icon"===t?new Q(e,this.context):(console.warn(`Unable to create symbolrenderer for symbolLayer of ${t}`),null)}}const Ge={type:"simple"};var He=r(69622),qe=r(60999),ke=r(44208),$e=r(32587),Ze=r(76030),Ye=r(69397),Xe=r(24326);function We(e=""){return`${e}${(0,Xe.c)()}`}new Float64Array(3);class Je{constructor(e,t){this._parent=e,this._subsetIndices=t,this.id=We(`featureDataSubset-${e.id}-`)}get tileId(){return this._parent.tileId}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+Ye.qK+this._subsetIndices.byteLength}get isFullyEnabled(){for(const e of this._subsetIndices)if(!this._parent.getEnabled(e))return!1;return!0}getObjectId(e){return this._parent.getObjectId(this._subsetIndices[e])}getAttribute(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributeAsTimestamp(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributes(e){return this._parent.getAttributes(this._subsetIndices[e])}getCoordinates(e,t,r){return this._parent.getCoordinates(this._subsetIndices[e],t,r)}getOptimizedGeometry(e){return this._parent.getOptimizedGeometry(this._subsetIndices[e])}getCentroid(e,t){return this._parent.getCentroid(this._subsetIndices[e],t)}getBounds(e){return this._parent.getBounds(this._subsetIndices[e])}getBoundingBox(e){return this._parent.getBoundingBox(this._subsetIndices[e])}getObjectIdsArray(e,t,r){return this._parent.getObjectIdsArray(e,this._translatedIndices(t),r)}getCoordinatesArray(e,t,r){return this._parent.getCoordinatesArray(e,this._translatedIndices(t),r)}objectIds(e){return this._parent.objectIds(this._translatedIndices(e))}subset(e){const{_subsetIndices:t}=this,r=new Uint32Array(e.length);for(let i=0;i<r.length;++i)r[i]=t[e[i]];return new Je(this._parent,r)}disableObjectIds(e){if(0===e.size)return;const{featureCount:t}=this,r=new Array;for(let i=0;i<t;++i)this.getEnabled(i)&&e.has(this.getObjectId(i))&&r.push(i);if(0!==r.length)for(const e of r)this.setEnabled(e,!1)}setEnabled(e,t){this._parent.setEnabled(this._subsetIndices[e],t)}getEnabled(e){return this._parent.getEnabled(this._subsetIndices[e])}enableAll(){const{_subsetIndices:e,_parent:t}=this;for(const r of e)t.setEnabled(r,!0)}getVisibilityArray(e,t,r){return this._parent.getVisibilityArray(e,this._translatedIndices(t),r)}enabledObjectIds(e){return this._parent.enabledObjectIds(this._translatedIndices(e))}*_translatedIndices(e){const{_subsetIndices:t}=this;if(null!=e)for(const r of e)yield t[r];else yield*t}}class Qe{constructor(e){this._tile=e,this.id=We(`featureData-${e.id}-`),this._enabled=new Array(e.featureCount).fill(!0)}get tileId(){return this._tile.id}get featureCount(){return this._tile.featureCount}get usedMemory(){return Ye.qK+(0,Ye.$B)(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every(e=>e)}getObjectId(e){return this._tile.getObjectId(e)}getAttribute(e,t){return this._tile.getAttribute(e,t)}getAttributeAsTimestamp(e,t){return this._tile.getAttribute(e,t)}getAttributes(e){return this._tile.getAttributes(e)}getCoordinates(e,t,r){return this._tile.getCoordinates(e,t,r)}getOptimizedGeometry(e){return this._tile.getOptimizedGeometry(e)}getCentroid(e,t){return this._tile.getCentroid(e,t)}getBounds(e){return this._tile.getBounds(e)}getBoundingBox(e){return this._tile.getBoundingBox(e)}getObjectIdsArray(e,t,r){return this._tile.getObjectIdsArray(e,t,r)}getCoordinatesArray(e,t,r){return this._tile.getCoordinatesArray(e,t,r)}objectIds(e){return this._tile.objectIds(e)}subset(e){return new Je(this,e)}disableObjectIds(e){if(0===e.size)return;const{_enabled:t}=this,r=new Array;for(const i of this._allFeatureIndices())t[i]&&e.has(this.getObjectId(i))&&r.push(i);if(0!==r.length)for(const e of r)t[e]=!1}setEnabled(e,t){this._enabled[e]=t}getEnabled(e){return this._enabled[e]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(e,t=this._allFeatureIndices(),r=0){const{_enabled:i}=this;for(const n of t)e[r++]=Number(i[n]);return r}*enabledObjectIds(e=this._allFeatureIndices()){const{_enabled:t}=this;for(const r of e)t[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}}let Ke=class extends He.A{constructor(e){super(e),this.extent=null,this._tileHandles=new $e.A,this._wanted=new $e.A,this._updateRequested=!1,this._synchronizationTask=null,this._requestedTiles=new Array}destroy(){this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updateRequested||!(this._synchronizationTask?.finished??1)}get _boundingRect(){const{extent:e}=this;return null==e?null:(0,I.VY)(e)}get _missingTiles(){const e=new Array,t=this._wanted,r=this._tileHandles;for(const i of t.values())null==r.get(i.id)?.featureData&&e.push(i);return e}onTileTreeChange({tiles:e}){this._requestedTiles=e,this._scheduleTilesSync()}_scheduleTilesSync(){if(this._updateRequested)return;this._updateRequested=!0;const e=this._synchronizationTask,t=(0,qe.UT)(async()=>{try{await(0,o.C_)(()=>e?.finished??!0),await(0,Ze.NO)(),this._updateRequested=!1,await this._synchronizeTiles()}finally{this._synchronizationTask===t&&(this._synchronizationTask=null)}});this._synchronizationTask=t}async _synchronizeTiles(){const e=this._requestedTiles,t=this._tileHandles,r=new Array;for(const i of e)t.has(i.id)||r.push(i);const i=new Array;for(const r of t.values()){const{id:t}=r;e.every(e=>e.id!==t)&&i.push(r.descriptor)}const n=this._tileHandles,{_boundingRect:s}=this,o=null!=s?r.filter(e=>!e.extent||(0,I.HY)(s,e.extent)):r,a=this._wanted,l=new Array;for(const{id:e}of i)a.delete(e);for(const e of o)a.set(e.id,e);const c=this._missingTiles;for(const e of i){const{id:t}=e;if(c.some(t=>et(t,e)||et(e,t)))continue;const r=n.get(t);null!=r&&l.push(this._removeTile(r))}for(const e of o)l.push(this._addTile(e));const u=await Promise.allSettled(l);for(const e of u)"rejected"===e.status&&console.error(e.reason)}forEachTile(e){for(const t of this._tileHandles.values()){const r=t.featureData;null!=r&&e(r)}}*loadedTiles(){for(const e of this._tileHandles.values()){const t=e.featureData;null!=t&&(yield t)}}async _removeTile(e){e.loadTask.abort(),this._tileHandles.delete(e.id),this._validate();const{featureData:t}=e;if(null!=t){const e={stack:[],error:void 0,hasError:!1};try{(0,i.mS)(e,await this.tileLocks.lock([t.tileId]),!1);const r=await this.createRemoveCommand(t.id);await(r?.execute())}catch(t){e.error=t,e.hasError=!0}finally{(0,i.hk)(e)}}}async _addTile(e){const{_tileHandles:t}=this,r=t.get(e.id);if(null!=r){if(!rt(r)||r.featureData.isFullyEnabled)return;return r.featureData.enableAll(),void await this._onTileLoad(r)}const i=new tt(e,(0,qe.UT)(async t=>{const r=await this.loadTile(e,t);return(0,s.Te)(t),new Qe(r)}));this._tileHandles.set(i.id,i);try{await i.loadTask.promise}catch(e){return void(0,s.jH)(e)}(function(e){if(!rt(e))throw new Error})(i),await this._onTileLoad(i)}async _onTileLoad(e){const t={stack:[],error:void 0,hasError:!1};try{const{_wanted:r,_tileHandles:n,_missingTiles:s}=this,o=e.descriptor,a=new Array,l=new Array,c=new Array,u=new Set;for(const t of n.values()){if(t===e)continue;const{descriptor:i,id:c}=t;if(!r.has(c)&&!s.some(e=>et(e,i)||et(i,e))){n.delete(c),t.loadTask.abort();const{featureData:e}=t;null!=e&&a.push(e);continue}if(rt(t)){if(et(o,i)){const e=t.featureData;for(const t of e.objectIds())u.add(t)}if(et(i,o)){const{featureData:e}=t;l.push(e)}}}u.size>0&&(e.featureData.disableObjectIds(u),this._validateRemoval(e.featureData,u)),this._validate(),c.push(e.featureData);const d=[...c,...a,...l].map(e=>e.tileId);if((0,i.mS)(t,await this.tileLocks.lock(d),!1),0!==l.length){const t=e.featureData,r=new Set(t.objectIds());for(const e of l)e.disableObjectIds(r),this._validateRemoval(e,r)}const h=a.map(e=>this.createRemoveCommand(e.id)),f=c.map(e=>this.createAddCommand(e)),p=l.map(e=>this.createUpdateCommand(e)),m=function(e){return 0===e.length?null:e.reduce((e,t)=>(e.append(t),e))}((await Promise.all([...h,...f,...p])).filter(Te.Ru));await(m?.execute())}catch(e){t.error=e,t.hasError=!0}finally{(0,i.hk)(t)}}_validate(){if(!(0,ke.A)("feature-pipeline-3d-test-validation"))return;const e=new Array;for(const t of this._tileHandles.values()){if(!rt(t))continue;const{featureData:r}=t;e.push({featureData:r,objectIds:new Set(r.enabledObjectIds())})}for(let t=0;t<e.length;++t){const{featureData:r,objectIds:i}=e[t];for(let n=t+1;n<e.length;++n){const{featureData:t,objectIds:s}=e[n];for(const e of s)if(i.has(e))throw new Error(`${r.id} and ${t.id} both contain ${e}.`)}}}_validateRemoval(e,t){if((0,ke.A)("feature-pipeline-3d-test-validation"))for(const r of e.enabledObjectIds())if(t.has(r))throw new Error(`Failed to remove ${r} from ${e.id}!`)}};function et({lij:[e,t,r]},{lij:[i,n,s]}){const o=i-e;return o>=0&&t===n>>o&&r===s>>o}(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"updating",null),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],Ke.prototype,"loadTile",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],Ke.prototype,"createAddCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],Ke.prototype,"createRemoveCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],Ke.prototype,"createUpdateCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],Ke.prototype,"tileLocks",void 0),(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"extent",void 0),(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"_boundingRect",null),(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"_missingTiles",null),(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"_updateRequested",void 0),(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"_synchronizationTask",void 0),Ke=(0,i.Cg)([(0,a.$K)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],Ke);class tt{constructor(e,t){this.descriptor=e,this.loadTask=t}get id(){return this.descriptor.id}get featureData(){return this.loadTask.value}}function rt(e){return null!=e.featureData}var it=r(36563);class nt{constructor(){this._previousActions=new Map}async lock(e){const{_previousActions:t}=this,r=e.map(e=>t.get(e)).filter(Te.Ru),i=Promise.allSettled(r),n=(0,s.Tw)(),o=(0,it.hA)(()=>n.resolve()),a=n.promise.finally(()=>{for(const r of e)t.get(r)===a&&t.delete(r)});for(const r of e)t.set(r,a);return await i,(0,it.Bf)(o)}}var st=r(75503),ot=r(27647);class at{constructor(e,t){this._index=e,this._view=t}get usedMemory(){return Ye.qK+Ye.RS}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new lt(this._index,this._view,e)}}class lt extends at{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,ot.Q)(this._geometryOverride)}}class ct{constructor(e,t){this.featureData=e,this.bounds=t}}class ut{constructor(){this._tileBounds=new Map,this.events=new n.bk,this.featureAdapter=dt.shared}get usedMemory(){return Ye.qK+Ye.qK*this._tileBounds.size}addTile(e){const{featureCount:t}=e;if(0===t)return;const r=new st.wq(9,t=>e.getBounds(t)),i=new Array;for(let e=0;e<t;++e)i[e]=e;r.load(i),this._tileBounds.set(e.id,new ct(e,r)),this.events.emit("changed")}removeTile(e){this._tileBounds.delete(e),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(e){for(const{featureData:t,bounds:r}of this._tileBounds.values())r.all(r=>{t.getEnabled(r)&&e(new at(r,t))})}forEachInBounds(e,t){ht.minX=e[0],ht.minY=e[1],ht.maxX=e[2],ht.maxY=e[3];for(const{featureData:e,bounds:r}of this._tileBounds.values())r.search(ht,r=>{e.getEnabled(r)&&t(new at(r,e))})}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(const{bounds:e}of this._tileBounds.values()){const{minX:s,minY:o,maxX:a,maxY:l}=e.toJSON();t=Math.min(t,s),r=Math.min(r,o),i=Math.min(i,a),n=Math.min(n,l)}return{xmin:t,ymin:r,xmax:i,ymax:n,spatialReference:e}}}class dt{static{this.shared=new dt}getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t,r){return e.cloneWithGeometry(t)}}const ht=new st.EC;var ft=r(80893);class pt{constructor(e,t,r){this.descriptor=e,this._pages=t,this._pageSize=r;const i=Ye.ez+t.reduce((e,{usedMemory:t})=>e+t,0),n=3*Ye.RS;this.usedMemory=Ye.qK+i+n,this.featureCount=t.reduce((e,t)=>e+t.featureCount,0)}get id(){return this.descriptor.id}getObjectId(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getObjectId(r)}getAttribute(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getAttribute(i,t)}getAttributeAsTimestamp(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getAttributeAsTimestamp(i,t)}getAttributes(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getAttributes(r)}getCoordinates(e,t,r){const{pageIndex:i,featurePageIndex:n}=this._translateIndex(e);this._pages[i].getCoordinates(n,t,r)}getOptimizedGeometry(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getOptimizedGeometry(r)}getCentroid(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getCentroid(i,t)}getBounds(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBounds(r)}getBoundingBox(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBoundingBox(r)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){let i=r;for(const{page:r,indices:n}of this._batchPageIndices(t))i=r.getObjectIdsArray(e,n,i);return i}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){let i=r;for(const{page:r,indices:n}of this._batchPageIndices(t))i=r.getCoordinatesArray(e,n,i);return i}*objectIds(e=this._allFeatureIndices()){for(const{page:t,indices:r}of this._batchPageIndices(e))for(const e of t.objectIds(r))yield e}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_translateIndex(e){const{_pageSize:t}=this;return{pageIndex:Math.floor(e/t),featurePageIndex:e%t}}*_batchPageIndices(e){const t=new Array;{let r=0,i=new Array;for(const n of e){const{pageIndex:e,featurePageIndex:s}=this._translateIndex(n);r!==e&&(0!==i.length&&t.push({pageIndex:r,indices:i}),r=e,i=[]),i.push(s)}0!==i.length&&t.push({pageIndex:r,indices:i})}const{_pages:r}=this;for(const{pageIndex:e,indices:i}of t)yield{page:r[e],indices:i}}}var mt=r(49186),yt=r(51624),gt=r(62577),bt=r(92722),_t=r(95466),vt=r(53655);class xt{constructor(e){this._reader=new yt.A(new Uint8Array(e),new DataView(e)),this._index=function(e){for(;e.next();){if(2===e.tag())return wt(e.getMessage());e.skip()}St()}(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:i}}=this,n=r.get(t)?.index;if(null==n)return;const s=i[e*r.fields.length+n],o=this._reader;return o.move(s),At(o)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,i=e*t.fields.length,n=this._reader,s={};for(const e of t.fields){const t=r[i+e.index];n.move(t),s[e.name]=At(n)}return s}getCoordinates(e,t,r=0){const i=this._reader,{transform:n,featureIndices:s}=this._index,{scale:o,translate:a}=n;i.move(s[e]),this._readCoordinates(o,a,t,r)}getOptimizedGeometry(e){const t=(0,x.vt)();return this.getCoordinates(e,t),new bt.A([],t,!0,!1)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,Tt);const[i,n,s]=Tt,o=[i,n];return t&&(o[3]=s),r&&(o[t?4:3]=0),new bt.A([],o,t,r)}getBounds(e){this.getCoordinates(e,Tt);const[t,r]=Tt,i=new st.EC;return i.minX=t,i.minY=r,i.maxX=t,i.maxY=r,i}getBoundingBox(e){this.getCoordinates(e,Tt);const[t,r,i]=Tt;return(0,P.fA)(t,r,i,t,r,i)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const i=this._reader,{objectIdFieldName:n,attributeIndices:s,fieldsIndex:o}=this._index,a=o.get(n).index,l=o.fields.length;for(const n of t){const t=s[n*l+a];i.move(t),e[r++]=At(i)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const i=this._reader,{transform:n,featureIndices:s}=this._index,{scale:o,translate:a}=n;for(const n of t){const t=s[n];i.move(t),r=this._readCoordinates(o,a,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:i,fieldsIndex:n}=this._index,s=n.get(r).index,o=n.fields.length;for(const r of e){const e=i[r*o+s];t.move(e),yield At(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[i,n,s],o,a){const l=this._reader,c=l.getLength(),u=l.pos()+c;for(;l.pos()<u&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),u=l.pos()+c;for(;l.pos()<u&&l.next();)3===l.tag()?(l.getUInt32(),o[a++]=i+e*l.getSInt64(),o[a++]=n+t*l.getSInt64(),o[a++]=s+r*l.getSInt64()):l.skip();break}default:l.skip()}return a}}function wt(e){for(;e.next();){if(1===e.tag())return Ct(e.getMessage());e.skip()}St()}function Ct(e){let t,r,i=!1,n=!1,s=0;const o=new Array,a=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&St();break;case 9:i=e.getBool()??!1;break;case 12:t=(0,gt.Q1)(e.processMessage(vt.ae));break;case 13:{const t=e.processMessage(vt.cn);t.index=s++,o.push(t);break}case 15:{a.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:n=e.getBool()??!1;break;default:e.skip()}const c=new _t.A(o);return null!=t&&n&&null!=r&&c.has(r)||St(),{transform:t,exceededTransferLimit:i,fieldsIndex:c,objectIdFieldName:r,featureIndices:a,attributeIndices:l}}function St(){const e=new mt.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function At(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}const Tt=(0,x.vt)();class Pt{constructor(e,t,r,i,n){this.spatialReference=e,this.url=r,this.objectIdField=i,this.capabilities=n;const{supportsMaxRecordCountFactor:s,maxRecordCount:o}=this.capabilities.query,a=s?4:1,l=(o??8e3)*a;this._pageSize=Math.min(8e3,l);const c=t.clone();c.cacheHint=!0,c.resultType="tile",c.outSpatialReference=e,c.returnGeometry=!0,c.returnZ=!0,c.maxRecordCountFactor=a,c.num=this._pageSize,c.outFields=[i],this._baseQuery=c}async fetch(e,t){const{spatialReference:r,_pageSize:i}=this,n=(0,I.w1)(e.extent,r),o=this._baseQuery.clone();o.geometry=n;const a=new Array;let l=0,c=!1,u=1;for(;!c;){const e=[];for(let r=0;r<u;++r)e.push(this._fetchPage(o,l++,t));const r=await Promise.all(e);(0,s.Te)(t);for(const e of r){const t=0!==e.featureCount;c||=!e.exceededTransferLimit||!t,t&&a.push(e)}u=Math.min(u+1,4)}return new pt(e,a,i)}async _fetchPage(e,t,r){const i=e.clone();i.start=t*this._pageSize;const n=await(0,ft.kS)(this.url,i,{signal:r});return(0,s.Te)(r),new xt(n)}}var It=r(29920),Bt=r(77690),Et=r(29242),Mt=r(13030),Ot=r(78662),Rt=r(49255),Dt=r(40268),Ft=r(25634),jt=r(11725),Vt=r(77194),zt=r(59907),Lt=r(43616),Ut=r(13259),Nt=r(4431),Gt=r(1843),Ht=r(13840),qt=r(42958),kt=r(16943),$t=r(33524),Zt=r(90644);let Yt=class extends qt.w{constructor(e,t){super(e,t,(0,Nt.U)(Wt).concat((0,Nt.U)(Kt()))),this.shader=new Ht.r(Ut.H,()=>r.e(8241).then(r.bind(r,48241))),this.primitiveType=t.occlusionPass?G.WR.POINTS:G.WR.TRIANGLE_STRIP}initializePipeline(e){const{oitPass:t,hasEmission:r,hasPolygonOffset:i,draped:n,output:s,depthTestEnabled:o,occlusionPass:a}=e,l=o&&!n&&!(1===t)&&!a&&!(8===s);return(0,Zt.Ey)({blending:(0,Rt._o)(s)?(0,$t.Yf)(t,!0):null,depthTest:o&&!n?{func:515}:null,depthWrite:l?Zt.Uy:null,drawBuffers:(0,$t.Sv)(t,r),colorWrite:Zt.kn,polygonOffset:i?Xt:null})}};Yt=(0,i.Cg)([(0,a.$K)("esri.views.3d.webgl-engine.shaders.HUDMaterialTechnique")],Yt);const Xt={factor:0,units:-4},Wt=(0,Gt.BP)().vec2u8("uv0",{glNormalized:!0}),Jt=(0,Gt.BP)().vec3f("position").vec3f("normal").vec4i16("uvi").vec4u8("color").vec2f("size").f32("rotation").vec4f("centerOffsetAndDistance").vec4f("featureAttribute"),Qt=Jt.clone().vec4u8("olidColor");function Kt(){return(0,kt.E)()?Qt:Jt}var er=r(51976),tr=r(99550);class rr extends tr.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.visibilityPixelEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!0,this.isFocused=!0,this.olidColorInstanced=!1,this.textureCoordinateType=0,this.emissionSource=0,this.discardInvisibleFragments=!0,this.hasVVInstancing=!1,this.snowCover=!1}}(0,i.Cg)([(0,er.W)()],rr.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"visibilityPixelEnabled",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"signedDistanceFieldEnabled",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasVVSize",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasVVColor",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasVerticalOffset",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasScreenSizePerspective",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasRotation",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"debugDrawLabelBorder",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasPolygonOffset",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"depthTestEnabled",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"pixelSnappingEnabled",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"draped",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"terrainDepthTest",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"cullAboveTerrain",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"occlusionPass",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"occludedFragmentFade",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"horizonCullingEnabled",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"isFocused",void 0);var ir=r(49788);class nr extends jt.i{constructor(e,t){super(e,Pr),this.produces=new Map([[14,e=>(0,Rt.Lc)(e)&&!this.parameters.drawAsLabel],[15,e=>(0,Rt.Lc)(e)&&this.parameters.drawAsLabel],[13,()=>this.parameters.useVisibilityPixel],[19,e=>this.parameters.draped&&(0,Rt.Lc)(e)]]),this._visible=!0,this._configuration=new rr(t)}getConfiguration(e,t){const r=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=r,this._configuration.visibilityPixelEnabled=this.parameters.useVisibilityPixel,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.hasVVSize=!!this.parameters.vvSize,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.occlusionPass=13===t.slot,this._configuration.occludedFragmentFade=!r&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||13===t.slot,(0,Rt._o)(e)&&(this._configuration.debugDrawLabelBorder=!!O.b.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,r,i,n,s){const{options:{selectionMode:o,hud:a,excludeLabels:l},point:c,camera:u}=r,{parameters:d}=this;if(!o||!a||l&&d.isLabel||!e.visible||!c||!u)return;const h=e.attributes.get("featureAttribute"),f=null==h?null:(0,w.ci)(h.data,xr),{scaleX:p,scaleY:m}=Br(f,d,u.pixelRatio),y=e.attributes.get("position"),g=e.attributes.get("size"),b=e.attributes.get("normal"),_=e.attributes.get("rotation"),v=e.attributes.get("centerOffsetAndDistance");(0,pe.vA)(y.size>=3);const C=(0,Ut.c)(d),S="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<y.data.length/y.size;e++){const i=e*y.size;(0,se.h)(cr,y.data[i],y.data[i+1],y.data[i+2]),(0,se.p)(cr,cr,t),(0,se.p)(cr,cr,u.viewMatrix);const n=e*v.size;if((0,se.h)(_r,v.data[n],v.data[n+1],v.data[n+2]),!S&&(cr[0]+=_r[0],cr[1]+=_r[1],0!==_r[2])){const e=_r[2];(0,se.n)(_r,cr),(0,se.e)(cr,cr,(0,se.j)(_r,_r,e))}const o=e*b.size;(0,se.h)(ur,b.data[o],b.data[o+1],b.data[o+2]),(0,se.t)(ur,ur,(0,Bt.z0)(yr,t));const{normal:a,cosAngle:l}=or(ur,u,wr),h=Er(this.parameters,cr,l,u,lr);if((0,se.c)(cr,cr,a,h),u.applyProjection(cr,dr),dr[0]>-1){S&&(_r[0]||_r[1])&&(dr[0]+=_r[0]*u.pixelRatio,0!==_r[1]&&(dr[1]+=lr.alignmentEvaluator.apply(_r[1])*u.pixelRatio),u.unapplyProjection(dr,cr)),dr[0]+=this.parameters.screenOffset[0]*u.pixelRatio,dr[1]+=this.parameters.screenOffset[1]*u.pixelRatio,dr[0]=Math.floor(dr[0]),dr[1]=Math.floor(dr[1]);const t=e*g.size;Ar[0]=g.data[t],Ar[1]=g.data[t+1],lr.evaluator.applyVec2(Ar,Ar);const i=Cr*u.pixelRatio;let n=0;d.textureIsSignedDistanceField&&(n=Math.min(d.outlineSize,.5*Ar[0])*u.pixelRatio/2),Ar[0]*=p,Ar[1]*=m;const o=e*_.size,a=d.rotation+_.data[o];if(ar(c,dr[0],dr[1],Ar,i,n,a,d,C)){const e=r.ray;if((0,se.p)(fr,cr,(0,A.B8)(gr,u.viewMatrix)),dr[0]=c[0],dr[1]=c[1],u.unprojectFromRenderScreen(dr,cr)){const t=(0,x.vt)();(0,se.d)(t,e.direction);const r=1/(0,se.b)(t);(0,se.j)(t,t,r),s((0,se.B)(e.origin,cr)*r,t,-1,fr)}}}}}intersectDraped(e,t,r,i,n){const s=e.attributes.get("position"),o=e.attributes.get("size"),a=e.attributes.get("rotation"),l=this.parameters,c=(0,Ut.c)(l),u=e.attributes.get("featureAttribute"),d=null==u?null:(0,w.ci)(u.data,xr),{scaleX:h,scaleY:f}=Br(d,l,e.screenToWorldRatio),p=Sr*e.screenToWorldRatio;for(let t=0;t<s.data.length/s.size;t++){const u=t*s.size,d=s.data[u],m=s.data[u+1],y=t*o.size;Ar[0]=o.data[y],Ar[1]=o.data[y+1];let g=0;l.textureIsSignedDistanceField&&(g=Math.min(l.outlineSize,.5*Ar[0])*e.screenToWorldRatio/2),Ar[0]*=h,Ar[1]*=f;const b=t*a.size,_=l.rotation+a.data[b];ar(r,d,m,Ar,p,g,_,l,c)&&i(n.distance,n.normal,-1)}}createBufferWriter(){return new Ir}applyShaderOffsets(e,t,r,i,n,s,o){(0,se.t)(hr,r,(0,Bt.z0)(yr,i));const a=or(hr,s,wr),l=function(e,t){const r=t.computeRenderPixelSizeAtDist(e)*Dt.R;return(t.aboveGround?1:-1)*r}((0,se.b)(t),s),c=Er(this.parameters,t,a.cosAngle,s,o);(0,se.c)(t,t,a.normal,c+l),(0,se.c)(e,e,hr,c+l);const u=n[3]+c;this._applyPolygonOffsetView(t,a,u,s,t),this._applyCenterOffsetView(t,n,t)}applyShaderOffsetsNDC(e,t,r,i,n){return this._applyCenterOffsetNDC(e,t,r,i),null!=n&&(0,se.d)(n,i),this._applyPolygonOffsetNDC(i,t,r,i),i}_applyPolygonOffsetView(e,t,r,i,n){const s=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=s);const a=s*o;if(this.parameters.shaderPolygonOffset<=0)return(0,se.d)(n,e);const l=(0,M.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/i.viewport[2];return(0,se.j)(n,e,a>0?c:1/c),n}_applyCenterOffsetView(e,t,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,se.d)(r,e),i&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,se.n)(ur,r),(0,se.a)(r,r,(0,se.j)(ur,ur,t[2])))),r}_applyCenterOffsetNDC(e,t,r,i){const n="screen"!==this.parameters.centerOffsetUnits;return i!==e&&(0,se.d)(i,e),n||(i[0]+=t[0]/r.fullWidth*2,i[1]+=t[1]/r.fullHeight*2),i}_applyPolygonOffsetNDC(e,t,r,i){const n=this.parameters.shaderPolygonOffset;if(e!==i&&(0,se.d)(i,e),n){const e=r.aboveGround?1:-1,s=e*Math.sign(t[3]);i[2]-=(s||e)*n}return i}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,i=e[3]>=ir.Q||t>=ir.Q&&r[3]>=ir.Q;return this._visible&&i}createGLMaterial(e){return new sr(e)}calculateRelativeScreenBounds(e,t,r=(0,I.vt)()){return function(e,t,r,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class sr extends Ft.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(Yt,e)}}function or(e,t,r){return(0,se.p)(r.normal,e,t.viewInverseTransposeMatrix),r.cosAngle=(0,se.g)(r.normal,Tr),r}function ar(e,t,r,i,n,s,o,a,l){let c=t-n-i[0]*l[0],u=c+i[0]+2*n,d=r-n-i[1]*l[1],h=d+i[1]+2*n;const f=a.distanceFieldBoundingBox;return a.textureIsSignedDistanceField&&null!=f&&(c+=i[0]*f[0],d+=i[1]*f[1],u-=i[0]*(1-f[2]),h-=i[1]*(1-f[3]),c-=s,u+=s,d-=s,h+=s),(0,B.hZ)(mr,t,r),(0,B.e$)(pr,e,mr,(0,M.kU)(o)),pr[0]>c&&pr[0]<u&&pr[1]>d&&pr[1]<h}const lr=new Vt.fc,cr=(0,x.vt)(),ur=(0,x.vt)(),dr=(0,w.vt)(),hr=(0,x.vt)(),fr=(0,x.vt)(),pr=(0,E.vt)(),mr=(0,E.vt)(),yr=(0,Et.vt)(),gr=(0,v.vt)(),br=(0,w.vt)(),_r=(0,x.vt)(),vr=(0,x.vt)(),xr=(0,w.vt)(),wr={normal:(0,x.vt)(),cosAngle:0},Cr=1,Sr=2,Ar=(0,E.fA)(0,0),Tr=(0,x.fA)(0,0,1);class Pr extends Ft.NV{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=(0,w.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,E.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,w.CN)(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=(0,w.vt)(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.useVisibilityPixel=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.occludedVisibilityMode="hidden",this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Ir{constructor(){this.layout=Kt(),this.baseInstanceLayout=Wt}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,r,i,n,s){const{position:o,normal:a,color:l,size:c,rotation:u,centerOffsetAndDistance:d,featureAttribute:h,uvi:f}=n;(0,zt.Hk)(r.get("position"),e,o,s),(0,zt.p1)(r.get("normal"),t,a,s);const p=r.get("position").indices.length;let m=0,y=0,g=Ut.f,b=Ut.f;const _=r.get("uvi")?.data;_&&_.length>=4&&(m=_[0],y=_[1],g=_[2],b=_[3]);for(let e=0;e<p;++e){const t=s+e;f.setValues(t,m,y,g,b)}if((0,zt.tb)(r.get("color"),4,l,s),(0,zt.Ue)(r.get("size"),c,s),(0,zt.uO)(r.get("rotation"),u,s),r.get("centerOffsetAndDistance")?(0,zt.Ut)(r.get("centerOffsetAndDistance"),d,s):(0,zt.Pq)(d,s,p),r.get("featureAttribute")?(0,zt.Ut)(r.get("featureAttribute"),h,s):(0,zt.Pq)(h,s,p),null!=i){const e=r.get("position")?.indices;if(e){const t=e.length,r=n.getField("olidColor",Mt.XP);(0,zt.vx)(i,r,t,s)}}return{numVerticesPerItem:1,numItems:p}}writeBaseInstance(e,t){const{uv0:r}=t;(0,zt.Ue)(e.get("uv0"),r,0)}intersect(e,t,r,i,n,s,o){const{options:{selectionMode:a,hud:l,excludeLabels:c},point:u,camera:d}=i;if(!a||!l||c&&t.isLabel||!u)return;const h=this.layout.createView(e),{position:f,normal:p,rotation:m,size:y,featureAttribute:g,centerOffsetAndDistance:b}=h,_="screen"===t.centerOffsetUnits,v=(0,Ut.c)(t);if(null==f||null==p||null==m||null==y||null==b||null==d)return;const w=null==g?null:g.getVec(0,xr),{scaleX:C,scaleY:S}=Br(w,t,d.pixelRatio),T=f.count;for(let e=0;e<T;e++){if(f.getVec(e,cr),null!=r&&(0,se.i)(cr,cr,r),(0,se.p)(cr,cr,d.viewMatrix),b.getVec(e,br),(0,se.h)(_r,br[0],br[1],br[2]),!_&&(cr[0]+=_r[0],cr[1]+=_r[1],0!==_r[2])){const e=_r[2];(0,se.n)(_r,cr),(0,se.e)(cr,cr,(0,se.j)(_r,_r,e))}p.getVec(e,ur),or(ur,d,wr);const n=Er(t,cr,wr.cosAngle,d,lr);if((0,se.c)(cr,cr,wr.normal,n),d.applyProjection(cr,dr),dr[0]>-1){_&&(_r[0]||_r[1])&&(dr[0]+=_r[0]*d.pixelRatio,0!==_r[1]&&(dr[1]+=lr.alignmentEvaluator.apply(_r[1])*d.pixelRatio),d.unapplyProjection(dr,cr)),dr[0]+=t.screenOffset[0]*d.pixelRatio,dr[1]+=t.screenOffset[1]*d.pixelRatio,dr[0]=Math.floor(dr[0]),dr[1]=Math.floor(dr[1]),y.getVec(e,Ar),lr.evaluator.applyVec2(Ar,Ar);const r=Cr*d.pixelRatio;let n=0;t.textureIsSignedDistanceField&&(n=Math.min(t.outlineSize,.5*Ar[0])*d.pixelRatio/2),Ar[0]*=C,Ar[1]*=S;const s=m.get(e),a=t.rotation+s;if(ar(u,dr[0],dr[1],Ar,r,n,a,t,v)){const t=i.ray;if((0,se.p)(fr,cr,(0,A.B8)(gr,d.viewMatrix)),dr[0]=u[0],dr[1]=u[1],d.unprojectFromRenderScreen(dr,cr)){const r=(0,x.vt)();(0,se.d)(r,t.direction);const i=1/(0,se.b)(r);(0,se.j)(r,r,i),o((0,se.B)(t.origin,cr)*i,r,e,fr)}}}}}}function Br(e,t,r){return null==e||null==t.vvSize?{scaleX:r,scaleY:r}:((0,Ot.VC)(vr,t,e),{scaleX:vr[0]*r,scaleY:vr[1]*r})}function Er(e,t,r,i,n){if(!e.verticalOffset?.screenLength){const i=(0,se.b)(t);return n.update(r,i,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const s=(0,se.b)(t),o=e.screenSizePerspectiveAlignment??e.screenSizePerspective,a=(0,Lt.kE)(i,s,e.verticalOffset,r,o,e.screenSizePerspectiveMinPixelReferenceSize);return n.update(r,s,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),a}class Mr{constructor(e,t){this._mainThreadDelegate=t,this._bufferWriters=new Map,this.globalViewingMode=1===e}createRenderCommandBuffer(e=[],t=[]){return{commands:e,transferList:t}}mergeRenderCommandBuffers(e){const t=this.createRenderCommandBuffer();for(const r of e)null!=r&&(t.commands.push(...r.commands),t.transferList.push(...r.transferList));return t}async createTexture(e){const{data:t,parameters:r}=e();return await this._mainThreadDelegate.createTexture(t,r)}async releaseTexture(e){const t=this._destroyTexture(e);return new p(this,t,[])}_destroyTexture(e){return{commands:[{id:"destroy-texture",textureId:e}],transferList:[]}}async createMaterial(e){const{type:t,parameters:r}=e,i=We("material");let n,s;switch(t){case"default":n=new Me.$U(e.parameters,{spherical:this.globalViewingMode}),s={type:t,materialId:i,parameters:e.parameters};break;case"hud":n=new nr(r,this.globalViewingMode),s={type:t,materialId:i,parameters:e.parameters}}return this._bufferWriters.set(i,n.createBufferWriter()),await this._mainThreadDelegate.createMaterial(s),i}destroyMaterial(e){return{commands:[{id:"destroy-material",materialId:e}],transferList:[]}}updateMaterial(e){return{commands:[{...e,id:"update-material"}],transferList:[]}}async createDirectRenderer(e){return await this._mainThreadDelegate.createDirectRenderer(e),e}async destroyDirectRenderer(e){await this._mainThreadDelegate.destroyDirectRenderer(e)}addDirectRendererGeometry(e,t,r){const{materialId:i}=t;if(null==this._bufferWriters.get(i))throw new Error(`no bufferwriter found for material ${i}`);const{renderGeometryBuffer:n,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.addDirectRendererGeometryBuffer(i,e,n,s,r)}updateDirectRendererGeometry(e,t,r){const{materialId:i}=t;if(null==this._bufferWriters.get(i))throw new Error(`no bufferwriter found for material ${i}`);const{renderGeometryBuffer:n,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.updateDirectRendererGeometryBuffer(i,e,n,s,r)}addDirectRendererGeometryBuffer(e,t,r,i,n){const{objectIds:s,visibilities:o}=i;return{commands:[{id:"add-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:i,localOrigin:n}],transferList:[r.data,s.buffer,o.buffer]}}updateDirectRendererGeometryBuffer(e,t,r,i,n){const{objectIds:s,visibilities:o}=i;return{commands:[{id:"update-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:i,localOrigin:n}],transferList:[r.data,s.buffer,o.buffer]}}removeDirectRendererGeometryBuffer(e,t){return{commands:[{id:"remove-direct-renderer-geometry-buffer",rendererId:e,groupId:t}],transferList:[]}}async createLodRenderer(e){const t=We("lod-renderer"),r=new Set,i={levels:e.levels.map(e=>({components:e.components.map(e=>{const t=e.attributes.get("position");if(!t||0===t.indices.length)throw new Error("positions attribute expected");const i=(0,U.tM)(t.indices.length/3),n=new It.j(i,3,t);if(null==this._bufferWriters.get(e.materialId))throw new Error("writer not found");const{renderGeometryBuffer:s}=this.createRenderGeometryBuffer(e,null);return r.add(s.data),{materialId:e.materialId,renderGeometryBuffer:s,boundingInfo:{bbMax:n.bbMax,bbMin:n.bbMin}}}),minScreenSpaceRadius:e.minScreenSpaceRadius}))};return await this._mainThreadDelegate.createLodRenderer(t,i,Array.from(r)),t}destroyLodRenderer(e){return{commands:[{id:"destroy-lod-renderer",rendererId:e}],transferList:[]}}addLodInstances(e,t,r){return{commands:[{id:"add-lod-instances",rendererId:e,groupId:t,data:r}],transferList:[r.featureIds.buffer,r.globalTransforms.buffer,r.localTransforms.buffer,r.visibility.buffer]}}removeLodInstances(e,t){return{commands:[{id:"remove-lod-instances",rendererId:e,groupId:t}],transferList:[]}}updateLodInstancesData(e,t,r){return{commands:[{id:"update-lod-instance-data",rendererId:e,groupId:t,globalTransforms:r}],transferList:[r.buffer]}}updateVisibility(e,t,r){return{commands:[{id:"update-visibility",rendererId:e,groupId:t,visibility:r}],transferList:[r.buffer]}}async dispatchRenderCommands(e){0!==e.commands.length&&await this._mainThreadDelegate.executeRenderCommands(e)}createRenderGeometryBuffer(e,t){const{materialId:r,visibilities:i,objectIds:n}=e,s=this._bufferWriters.get(r);if(null==s)throw new Error("no registered bufferWriter for material found");let o=null;if(e.transformation&&t)(0,A.C)(Or,e.transformation),Or[12]-=t[0],Or[13]-=t[1],Or[14]-=t[2],o=Or;else{if(t)throw new Error("not implemented");e.transformation&&(o=e.transformation)}let a=null;o&&((0,A.B8)(Rr,Or),(0,A.mg)(Rr,Rr),a=Rr);const l=e.attributes,c=s.elementCount(l),u=s.layout,d=u.stride/4;c>Math.floor(Dr/d)&&console.warn("geometry with very large number of elements encountered");const h=u.createBuffer(c),f=s.write(o,a,l,e.olidColor,h,0);if(null==f)throw new Error("Bufferwriter.write does not provide item information.");if(i.length!==f.numItems||n.length!==f.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");return{renderGeometryBuffer:{data:h.buffer,elementCount:c},renderGeometryBufferItems:{objectIds:n,visibilities:i,ranges:{numVertices:f.numVerticesPerItem,numItems:f.numItems}}}}async setBaseInstance(e,t){await this._mainThreadDelegate.setBaseInstance(e,t)}}const Or=(0,v.vt)(),Rr=(0,v.vt)(),Dr=4194304;var Fr=r(98764),jr=r(65806);const Vr=(0,x.vt)();var zr=r(53966),Lr=r(4341),Ur=r(11964),Nr=r(44280),Gr=r(32114);const Hr=()=>zr.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function qr(e=li){return{plane:(0,le.vt)(e.plane),origin:(0,x.o8)(e.origin),basis1:(0,x.o8)(e.basis1),basis2:(0,x.o8)(e.basis2)}}function kr(e,t=qr()){return $r(e.origin,e.basis1,e.basis2,t)}function $r(e,t,r,i=qr()){return(0,se.d)(i.origin,e),(0,se.d)(i.basis1,t),(0,se.d)(i.basis2,r),Zr(i),function(e,t){Math.abs((0,se.g)(e.basis1,e.basis2)/((0,se.b)(e.basis1)*(0,se.b)(e.basis2)))>1e-6&&Hr().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,se.g)(e.basis1,ii(e)))>1e-6&&Hr().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,se.g)(ii(e),e.origin)-e.plane[3])>1e-6&&Hr().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function Zr(e){(0,le.mR)(e.basis2,e.basis1,e.origin,e.plane)}function Yr(e,t,r){e!==r&&kr(e,r);const i=(0,se.j)(Gr.rq.get(),ii(e),t);return(0,se.i)(r.origin,r.origin,i),r.plane[3]-=t,r}function Xr(e,t=qr()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,se.h)(t.origin,e[0]+r,e[1]+i,0),(0,se.h)(t.basis1,r,0,0),(0,se.h)(t.basis2,0,i,0),(0,le.fA)(0,0,1,0,t.plane),t}function Wr(e,t,r){return!!(0,le.Ui)(e.plane,t,r)&&ni(e,r)}function Jr(e,t,r){const i=ci.get();ai(e,t,i,ci.get());let n=Number.POSITIVE_INFINITY;for(const s of fi){const o=oi(e,s,ui.get()),a=Gr.rq.get();if((0,le.T7)(i,o,a)){const e=(0,se.C)(Gr.rq.get(),t.origin,a),i=Math.abs((0,M.XM)((0,se.g)(t.direction,e)));i<n&&(n=i,(0,se.d)(r,a))}}return n===Number.POSITIVE_INFINITY?Qr(e,t,r):r}function Qr(e,t,r){if(Wr(e,t,r))return r;const i=ci.get(),n=ci.get();ai(e,t,i,n);let s=Number.POSITIVE_INFINITY;for(const o of fi){const a=oi(e,o,ui.get()),l=Gr.rq.get();if((0,le.gv)(i,a,l)){const e=(0,ce.kb)(t,l);if(!(0,le.Tj)(n,l))continue;e<s&&(s=e,(0,se.d)(r,l))}}return ti(e,t.origin)<s&&Kr(e,t.origin,r),r}function Kr(e,t,r){const i=(0,le._I)(e.plane,t,Gr.rq.get()),n=(0,Ur.H6)(si(e,e.basis1),i,-1,1,Gr.rq.get()),s=(0,Ur.H6)(si(e,e.basis2),i,-1,1,Gr.rq.get());return(0,se.e)(r,(0,se.i)(Gr.rq.get(),n,s),e.origin),r}function ei(e,t,r){const{origin:i,basis1:n,basis2:s}=e,o=(0,se.e)(Gr.rq.get(),t,i),a=(0,Nr.gr)(n,o),l=(0,Nr.gr)(s,o),c=(0,Nr.gr)(ii(e),o);return(0,se.h)(r,a,l,c)}function ti(e,t){const r=ei(e,t,Gr.rq.get()),{basis1:i,basis2:n}=e,s=(0,se.b)(i),o=(0,se.b)(n),a=Math.max(Math.abs(r[0])-s,0),l=Math.max(Math.abs(r[1])-o,0),c=r[2];return a*a+l*l+c*c}function ri(e,t){const r=-e.plane[3];return(0,Nr.gr)(ii(e),t)-r}function ii(e){return(0,le.Qj)(e.plane)}function ni(e,t){const r=(0,se.e)(Gr.rq.get(),t,e.origin),i=(0,se.D)(e.basis1),n=(0,se.D)(e.basis2),s=(0,se.g)(e.basis1,r),o=(0,se.g)(e.basis2,r);return-s-i<0&&s-i<0&&-o-n<0&&o-n<0}function si(e,t){const r=ui.get();return(0,se.d)(r.origin,e.origin),(0,se.d)(r.vector,t),r}function oi(e,t,r){const{basis1:i,basis2:n,origin:s}=e,o=(0,se.j)(Gr.rq.get(),i,t.origin[0]),a=(0,se.j)(Gr.rq.get(),n,t.origin[1]);(0,se.i)(r.origin,o,a),(0,se.i)(r.origin,r.origin,s);const l=(0,se.j)(Gr.rq.get(),i,t.direction[0]),c=(0,se.j)(Gr.rq.get(),n,t.direction[1]);return(0,se.j)(r.vector,(0,se.i)(l,l,c),2),r}function ai(e,t,r,i){const n=ii(e);(0,le.mR)(n,t.direction,t.origin,r),(0,le.mR)((0,le.Qj)(r),n,t.origin,i)}const li={plane:(0,le.vt)(),origin:(0,x.fA)(0,0,0),basis1:(0,x.fA)(1,0,0),basis2:(0,x.fA)(0,1,0)},ci=new Lr.I(le.vt),ui=new Lr.I(Ur.vt),di=(0,x.vt)(),hi=new Lr.I(()=>qr()),fi=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],pi=(0,v.vt)(),mi=(0,v.vt)(),yi=Object.freeze(Object.defineProperty({__proto__:null,altitudeAt:ri,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case 0:(0,se.d)(r,e.basis1),(0,se.n)(r,r);break;case 1:(0,se.d)(r,e.basis2),(0,se.n)(r,r);break;case 2:(0,se.d)(r,ii(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:Qr,closestPointOnSilhouette:Jr,copy:kr,copyWithoutVerify:function(e,t){(0,se.d)(t.origin,e.origin),(0,se.d)(t.basis1,e.basis1),(0,se.d)(t.basis2,e.basis2),(0,le.C)(t.plane,e.plane)},create:qr,distance:function(e,t){return Math.sqrt(ti(e,t))},distance2:ti,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of fi){const n=oi(e,i,ui.get()),s=(0,Ur.kb)(n,t);s>r&&(r=s)}return Math.sqrt(r)},elevate:Yr,equals:function(e,t){return(0,se.m)(e.basis1,t.basis1)&&(0,se.m)(e.basis2,t.basis2)&&(0,se.m)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,le.mN)(e.plane,t)>0&&ni(e,t)},fromAABoundingRect:Xr,fromValues:$r,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[n,s]=e.origin;return(0,I.fA)(n-r,s-i,n+r,s+i,t)},intersectRay:Wr,intersectRayClosestSilhouette:function(e,t,r){if(Wr(e,t,r))return r;const i=Jr(e,t,Gr.rq.get());return(0,se.i)(r,t.origin,(0,se.j)(Gr.rq.get(),t.direction,(0,se.B)(t.origin,i)/(0,se.b)(t.direction))),r},normal:ii,projectPoint:Kr,projectPointLocal:ei,rotate:function(e,t,r,i){return e!==i&&kr(e,i),(0,A.$0)(mi,t,r),(0,se.p)(i.basis1,e.basis1,mi),(0,se.p)(i.basis2,e.basis2,mi),Zr(i),i},setAltitudeAt:function(e,t,r,i){const n=ri(e,t),s=(0,se.j)(di,ii(e),r-n);return(0,se.i)(i,t,s),i},setExtent:function(e,t,r){return Xr(t,r),Yr(r,ri(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&kr(e,r),(0,A.B8)(pi,t),(0,A.mg)(pi,pi),(0,se.p)(r.basis1,e.basis1,pi),(0,se.p)(r.basis2,e.basis2,pi),(0,se.p)((0,le.Qj)(r.plane),(0,le.Qj)(e.plane),pi),(0,se.p)(r.origin,e.origin,t),(0,le.mP)(r.plane,r.plane,r.origin),r},up:li,updateUnboundedPlane:Zr,wrap:function(e,t,r){const i=hi.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,le.LV)(0,0,0,0),Zr(i),i}},Symbol.toStringTag,{value:"Module"}));var gi=r(94008);function bi(e,t,r=function(e){return{operations:e,value:e.create()}}(e)){return r.operations=e,e.copy(t,r.value),r}const _i=2**50;function vi(e,t,r,i){return e.operations.setAltitudeAt(e.value,t,r,i)}function xi(e,t,r){return e.operations.elevate(e.value,t,r.value)}const wi=(0,x.vt)();function Ci(e){return"point"===e.type}(0,x.vt)();class Si{constructor(e,t,r,i){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=r,this._coordinateSystem=i,this._tmpCoordinateSystem=function(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}(i),this.referenceEllipsoid=(0,ue.tO)(t),this.sphericalPCPF=(0,Fr.lO)(t)}set extent(e){e&&function(e,t,r){e.operations.setExtent(e.value,t,r.value)}(this._coordinateSystem,e,this._coordinateSystem)}get extent(){return e=this._coordinateSystem,t=(0,I.vt)(),e.operations.getExtent(e.value,t),t;var e,t}getAltitude(e){return function(e,t){return e.operations.altitudeAt(e.value,t)}(this._coordinateSystem,e)}setAltitude(e,t,r=e){return vi(this._coordinateSystem,r,t,e)}setAltitudeOfTransformation(e,t){var r,i,n,s;r=this._coordinateSystem,n=e,(i=t)!==(s=t)&&(0,A.C)(s,i),(0,se.h)(wi,s[12],s[13],s[14]),vi(r,wi,n,wi),s[12]=wi[0],s[13]=wi[1],s[14]=wi[2]}worldUpAtPosition(e,t){return function(e,t,r){return e.operations.axisAt(e.value,t,2,r)}(this._coordinateSystem,e,t)}worldBasisAtPosition(e,t,r){return function(e,t,r,i){return e.operations.axisAt(e.value,t,r,i)}(this._coordinateSystem,e,t,r)}basisMatrixAtPosition(e,t){const r=this.worldBasisAtPosition(e,0,Gr.rq.get()),i=this.worldBasisAtPosition(e,1,Gr.rq.get()),n=this.worldBasisAtPosition(e,2,Gr.rq.get());return(0,A.hZ)(t,r[0],r[1],r[2],0,i[0],i[1],i[2],0,n[0],n[1],n[2],0,0,0,0,1),t}headingAtPosition(e,t){const r=this.worldUpAtPosition(e,Gr.rq.get()),i=this.worldBasisAtPosition(e,1,Gr.rq.get()),n=(0,Nr.EJ)(t,i,r);return(0,M.KJ)(n)}intersectManifoldClosestSilhouette(e,t,r){return xi(this._coordinateSystem,t,this._tmpCoordinateSystem),function(e,t,r){e.operations.intersectRayClosestSilhouette(e.value,t,r)}(this._tmpCoordinateSystem,e,r),r}intersectManifold(e,t,r){xi(this._coordinateSystem,t,this._tmpCoordinateSystem);const i=Gr.rq.get();return function(e,t,r){return e.operations.intersectRay(e.value,t,r)}(this._tmpCoordinateSystem,e,i)?(0,se.d)(r,i):null}intersectInfiniteManifold(e,t,r){if(1===this.viewingMode)return this.intersectManifold(e,t,r);xi(this._coordinateSystem,t,this._tmpCoordinateSystem);const i=this._tmpCoordinateSystem.value,n=Gr.rq.get();return(0,le.Ui)(i.plane,e,n)?(0,se.d)(r,n):null}toRenderCoords(e,t,r){return Ci(e)?(0,jr.g)(e,t,this.spatialReference):(0,j.F)(e,t,r,this.spatialReference)}fromRenderCoords(e,t,r=null){return Ci(t)?(null!=r&&(t.spatialReference=r),function(e,t,r){return!!(0,j.F)(e,t,Vr,r.spatialReference)&&(r.x=Vr[0],r.y=Vr[1],r.z=Vr[2],!0)}(e,this.spatialReference,t)?t:null):(0,j.F)(e,this.spatialReference,t,r)?t:null}static create(e,t){switch(e){case 2:return new Si(2,t,(0,S.GA)(t),bi(yi,$r([0,0,0],[_i,0,0],[0,_i,0])));case 1:return new Si(1,t,1,function(e){return bi(gi.XG,new gi.iy(0,0,0,(0,ue.tO)(e).radius))}(t))}}static renderUnitScaleFactor(e,t){return(0,S.KX)(e)/(0,S.KX)(t)}}let Ai=class extends n.nJ{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new ut,this._tileLocks=new nt,this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,layerInfo:i,layerViewInfo:n}){const s=u.A.fromJSON(e);this._viewSpatialReference=s;const a=u.A.fromJSON(t);this._fetcher=new Pt(this._viewSpatialReference,h.A.fromJSON(i.baseQuery),i.url,i.objectIdField,i.capabilities),this._queryEngine=new d.do({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:i.objectIdField},fieldsIndex:i.fieldIndex,availableFields:[i.objectIdField],spatialReference:e,featureStore:this._featureStore,timeInfo:i.timeInfo}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const i={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",i,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})},setBaseInstance:async(e,t)=>{const r={rendererId:e,baseInstance:t};await this.remoteClient.invoke("setBaseInstance",r,{transferList:null!=t?[t.data]:void 0})}};const f=Si.create(r,a),p=new Mr(r,this._mainThreadDelegate);this._renderCommandContext=p;const m=new Ue(s,a,this._mainThreadDelegate,f,p,i,n);this._context=m,this._renderer=m.symbolRendererFactory.createSymbolRendererFromJSON(i.renderer),this._defaultQueryJSON=new h.A({outSpatialReference:s}).toJSON();let y=null;if(null!=i.fullExtent){const e=l.A.fromJSON(i.fullExtent);await(0,c.initializeProjection)(e.spatialReference,s),y=(0,c.project)(e,s)}return this._tileManager=new Ke({loadTile:(e,t)=>this._fetcher.fetch(e,t),createAddCommand:(e,t)=>this._createAddFeatureDataCommand(e,t),createRemoveCommand:e=>this._createRemoveFeatureDataCommand(e),createUpdateCommand:(e,t)=>this._createUpdateFeatureDataVisibilityCommand(e,t),tileLocks:this._tileLocks,extent:y}),this.addHandles((0,o.wB)(()=>this.updating,e=>{this.emit("notify-updating",{updating:e})}),o.Vh),null!=this._renderer&&await this._renderer.load(),Pi}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async executeAttributeBinsQuery(e,t){return{result:await this._queryEngine.executeAttributeBinsQuery(e,t)}}onTileTreeChange(e){return this._tileManager.onTileTreeChange(e),Promise.resolve(Pi)}async onElevationChange(e){return Pi}async onLayerViewOpacityChange(e){const{_context:t,_renderer:r}=this;if(t.layerViewInfo.fullOpacity=e,null==r)return Pi;const i=await r.createUpdateLayerViewOpacityCommand(e);return await i.execute(),Pi}async onRendererChange(e){const{_context:t}=this,r=t.symbolRendererFactory.createSymbolRendererFromJSON(e);await r.load();const n=this._renderer;this._renderer=r;const s=[...this._tileManager.loadedTiles()],o=s.map(e=>e.tileId);{const e={stack:[],error:void 0,hasError:!1};try{(0,i.mS)(e,await this._tileLocks.lock(o),!1);const a=s.flatMap(e=>[n.createRemoveCommand(e.id),r.createAddCommand(e)]),l=await Promise.all(a),c=t.joinPipelineCommands(l);await c.execute()}catch(t){e.error=t,e.hasError=!0}finally{(0,i.hk)(e)}}const a=await n.createDestroyCommand();return await a.execute(),Pi}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,i=this._renderer;let n;return n=null!=i?await i.createAddCommand(e):p.create(this._renderCommandContext),(0,s.Te)(t),n.appendPipelineStateCommand(()=>{r.addTile(e)}),n}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let i;return i=null!=r?await r.createRemoveCommand(e):p.create(this._renderCommandContext),i.appendPipelineStateCommand(()=>{t.removeTile(e)}),i}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer;let i;return i=null!=r?await r.createUpdateVisibilityCommand(e):p.create(this._renderCommandContext),(0,s.Te)(t),i}_ensureQuery(e){return e??this._defaultQueryJSON}};(0,i.Cg)([(0,a.MZ)()],Ai.prototype,"updating",null),Ai=(0,i.Cg)([(0,a.$K)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],Ai);const Ti=Ai,Pi={result:void 0}},47522:(e,t,r)=>{r.d(t,{K:()=>s});var i=r(32976),n=r(31821);function s(e){e.uniforms.add(new i.o("alignPixelEnabled",e=>e.alignPixelEnabled)),e.code.add(n.H`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) {
261
+ `)}},41628:(e,t,r)=>{r.d(t,{A:()=>l});var i,n=r(31635),s=r(91429),o=r(76357),a=r(93223);let l=class extends o.A{static{i=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new i({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,n.Cg)([(0,s.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]},isRequired:!0}}})],l.prototype,"maxValue",void 0),(0,n.Cg)([(0,s.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]},isRequired:!0}}})],l.prototype,"minValue",void 0),(0,n.Cg)([(0,a.e)({range:"range"})],l.prototype,"type",void 0),l=i=(0,n.Cg)([(0,s.$K)("esri.layers.support.RangeDomain")],l)},42152:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ti});var i=r(31635),n=r(65529),s=r(74887),o=r(36708),a=r(91429),l=r(5443),c=r(91218),u=r(16930),d=r(56390),h=r(61956),f=r(65494);class p{constructor(e,t,r){this.renderCommandContext=e,this.renderCommandBuffer=t,this.pipelineStateCommands=r}append(e){this.appendRenderCommands(e.renderCommandBuffer),this.appendPipelineStateCommands(e.pipelineStateCommands)}appendRenderCommands(e){this.renderCommandBuffer.commands.push(...e.commands),this.renderCommandBuffer.transferList.push(...e.transferList)}appendPipelineStateCommand(e){this.pipelineStateCommands.push(e)}appendPipelineStateCommands(e){for(const t of e)this.appendPipelineStateCommand(t)}async execute(){for(const e of this.pipelineStateCommands)e();await this.renderCommandContext.dispatchRenderCommands(this.renderCommandBuffer)}static create(e,t=[]){return new p(e,e.createRenderCommandBuffer(),t)}}var m=r(68197),y=r(80138),g=r(51216),b=r(28975);function _(){return new y.A({material:new b.A({color:new m.A("red")})})}var v=r(9093),x=r(51850),w=r(91829);const C="sphere";var S=r(86211),A=r(58083),T=r(87317),P=r(70328),I=r(19419);r(12359),r(95108),r(27615),r(52106),r(4718),r(65864);var B=r(37585),M=r(48163),E=r(34727),O=r(26857);new Map,(()=>{let e="";for(let t=32;t<127;t++)e+=String.fromCharCode(t)})();const R=[];{const e=16;for(let t=0;t<360;t+=360/e)R.push([Math.cos(Math.PI*t/180),Math.sin(Math.PI*t/180)])}Object.freeze({left:0,center:.5,right:1});const D=Object.freeze({"bottom-left":(0,M.fA)(0,0),bottom:(0,M.fA)(.5,0),"bottom-right":(0,M.fA)(1,0),left:(0,M.fA)(0,.5),center:(0,M.fA)(.5,.5),right:(0,M.fA)(1,.5),"top-left":(0,M.fA)(0,1),top:(0,M.fA)(.5,1),"top-right":(0,M.fA)(1,1)});var F=r(9762),j=r(27993);function V(e){const{featureCount:t}=e;if(0===t)return new Uint32Array;const r=new Uint32Array(t);return e.getObjectIdsArray(r),r}function z(e){const{featureCount:t}=e;if(0===t)return new Float64Array;const r=new Float64Array(3*t);return e.getCoordinatesArray(r),r}function L(e,t){const r=t.viewSpatialReference,i=t.renderSpatialReference,{extent:n}=e,s=(0,I.gX)(n),o=(0,x.vt)();return(0,j.F)([s[0],s[1],0],r,o,i),o}var U=r(97146);function N(e){const t=new Map;for(const[r,i]of e)t.set(r,{...i,indices:(0,U.Dg)(i.indices)});return t}r(46859);var G=r(63907);const q=(0,w.CN)(.25,.25,.75,.75);function H(e){return"cross"===e||"x"===e}function k(e,t=128,r=.5*t,i=0){switch(e){case"circle":default:return function(e,t){const r=e/2-.5;return W(e,Y(r,r,t/2))}(t,r);case"square":return function(e,t){return Z(e,t,!1)}(t,r);case"cross":return function(e,t,r=0){return $(e,t,!1,r)}(t,r,i);case"x":return function(e,t,r=0){return $(e,t,!0,r)}(t,r,i);case"kite":return function(e,t){return Z(e,t,!0)}(t,r);case"triangle":return function(e,t){return W(e,X(e/2,t,t/2))}(t,r);case"arrow":return function(e,t){const r=t,i=t/2,n=e/2,s=.8*r,o=Y(n,(e-t)/2-s,Math.sqrt(s*s+i*i)),a=X(n,r,i);return W(e,(e,t)=>Math.max(a(e,t),-o(e,t)))}(t,r)}}function Z(e,t,r){return r&&(t/=Math.SQRT2),W(e,(i,n)=>{let s=i-.5*e+.25,o=.5*e-n-.75;if(r){const e=(s+o)/Math.SQRT2;o=(o-s)/Math.SQRT2,s=e}return Math.max(Math.abs(s),Math.abs(o))-.5*t})}function $(e,t,r,i=0){t-=i,r&&(t*=Math.SQRT2);const n=.5*t;return W(e,(t,s)=>{let o,a=t-.5*e,l=.5*e-s-1;if(r){const e=(a+l)/Math.SQRT2;l=(l-a)/Math.SQRT2,a=e}return a=Math.abs(a),l=Math.abs(l),o=a>l?a>n?Math.sqrt((a-n)*(a-n)+l*l):l:l>n?Math.sqrt(a*a+(l-n)*(l-n)):a,o-=i/2,o})}function Y(e,t,r){return(i,n)=>{const s=i-e,o=n-t;return Math.sqrt(s*s+o*o)-r}}function X(e,t,r){const i=Math.sqrt(t*t+r*r);return(n,s)=>{const o=Math.abs(n-e)-r,a=s-e+t/2+.75,l=(t*o+r*a)/i,c=-a;return Math.max(l,c)}}function W(e,t){const r=new Float32Array(e*e);for(let i=0;i<e;i++)for(let n=0;n<e;n++)r[n+e*i]=t(n,i)/e;return r}var J=r(46610);class Q{constructor(e,t){this._context=null,this._symbolLayer=null,this._draped=!1,this._loaded=!1,this._loadingPromise=null,this._iconTextureID=null,this._materialId=null,this._context=t,this._symbolLayer=e}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}_destroy(){this._iconTextureID=null}async _load(){const e=this._context.renderCommandContext,t=await e.createTexture(()=>function(e,t=128,r=.5*t,i=0){return{data:k(e,t,r,i),parameters:{mipmap:!1,wrap:{s:33071,t:33071},width:t,height:t,noUnpackFlip:!0,dataType:G.ld.FLOAT,pixelFormat:6403,internalFormat:G.H0.R16F,reloadable:!0}}}("circle"));this._iconTextureID=t;const r={anchorPosition:D.center,useVisibilityPixel:!0,hasSlicePlane:!1,color:this._getFillColor(),outlineColor:this._getOutlineColor(),outlineSize:1,distanceFieldBoundingBox:q,textureId:t,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:H("circle")},i=new Uint8Array(8),n=255;i[0]=0,i[1]=0,i[2]=0,i[3]=n,i[4]=n,i[5]=0,i[6]=n,i[7]=n,this._materialId=await e.createMaterial({type:"hud",parameters:r}),await e.createDirectRenderer(this._materialId),await e.setBaseInstance(this._materialId,{data:i.buffer,elementCount:4}),this._loaded=!0}async createAddCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:i}=r;if(null==t)throw new Error("expected material not to be null");const n=await this._createGeometry(e);if(null==n)return r.createPipelineCommand();const s=L(e,r);return r.createPipelineCommand(i.addDirectRendererGeometry(e.id,n,s))}async _createGeometry(e){const{_materialId:t,_context:r}=this,{mainThreadDelegate:i}=r,{featureCount:n}=e;if(0===n||null==t)return null;const s=V(e),o=z(e),a=function(e,t){const r=e.length/3,i=t.viewSpatialReference,n=t.renderSpatialReference,s=new Float64Array(3*r);if(!(0,F.projectBuffer)(e,i,0,s,n,0,r))throw new Error("Failed to project coordinates");return s}(await i.applyElevationAlignmentTo(o),r),l=new Float64Array([0,0,1]),c=new Float64Array([255,255,255,255]),u=new Float64Array([24,24]),d=new Float64Array([0,0,0,1]),h=new Float64Array([0]),f=new Uint32Array(n);for(let e=0;e<n;++e)f[e]=e;const p=new Uint32Array(n);for(let e=0;e<n;++e)p[e]=0;const m=[["position",new J.n(a,f,3,!0)],["normal",new J.n(l,p,3,!0)],["color",new J.n(c,p,4,!0)],["rotation",new J.n(h,p,1,!0)],["size",new J.n(u,p,2,!0)],["centerOffsetAndDistance",new J.n(d,p,4,!0)]],y=new Uint8Array(n);return e.getVisibilityArray(y),{attributes:N(m),olidColor:void 0,transformation:(0,v.vt)(),materialId:t,objectIds:s,visibilities:y}}async createRemoveCommand(e){const{_materialId:t,_context:r}=this,i=r.renderCommandContext;return null==t?r.createPipelineCommand():r.createPipelineCommand(i.removeDirectRendererGeometryBuffer(t,e))}async createUpdateVisibilityCommand(e){const{_materialId:t,_context:r}=this,i=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const n=new Uint8Array(e.featureCount);return e.getVisibilityArray(n),r.createPipelineCommand(i.updateVisibility(t,e.id,n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_materialId:r}=this,i=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(i.updateMaterial({type:"hud",materialId:r,parameters:{color:this._getFillColor(),outlineColor:this._getOutlineColor()}}))}async createUpdateElevationCommand(e){const{_materialId:t,_context:r}=this,{renderCommandContext:i}=r,{featureCount:n,id:s}=e;if(null==t||0===n)return r.createPipelineCommand();const o=await this._createGeometry(e);if(null==o)return r.createPipelineCommand();const a=L(e,r);return r.createPipelineCommand(i.updateDirectRendererGeometry(s,o,a))}async createDestroyCommand(){const{_iconTextureID:e,_context:t}=this,r=t.renderCommandContext;let i;return i=null!=e?await r.releaseTexture(e):p.create(r),i.appendPipelineStateCommand(()=>this._destroy()),i}_getOutlineColor(){const e=this._getLayerOpacity(),t=this._symbolLayer,r=t?.outline?.color;if(null!=r){const t=r.toUnitRGB(),i=r.a*e;return[t[0],t[1],t[2],i]}return[0,0,0,0]}_getFillColor(){if(function(e){return null!=e&&("cross"===e||"x"===e)}(this._getPrimitive()))return ee;const e=null==this._getPrimitive(),t=this._symbolLayer?.material?.color;return this._getCombinedOpacityAndColor(t,{hasIntrinsicColor:e})}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}_getCombinedOpacity(e,t=K){const r=this._draped?1:this._getLayerOpacity();return e?r*e.a:t.hasIntrinsicColor?r:0}_getCombinedOpacityAndColor(e,t=K){const r=this._getCombinedOpacity(e,t);return function(e,t,r=null){const i=(0,w.o8)(w.Un);return null!=e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],e.length>3&&(i[3]=e[3])),null!=t&&(i[3]=t),r&&(0,T.s)(i,i,r),i}(e?.toUnitRGB()??x.Un,r)}_getPrimitive(){return e=this._symbolLayer,e.resource?.href?null:e.resource?.primitive??"circle";var e}}const K={hasIntrinsicColor:!1},ee=w.uY;class te{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._context=null,this._symbol=null,this._symbolLayerRenderers=[],this._context=t,this._symbol=e}_destroy(){}get loaded(){return this._loaded}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_context:e,_symbol:t,_symbolLayerRenderers:r}=this,i=[];for(const n of t.symbolLayers){const t=e.symbolRendererFactory.createSymbolRendererFromSymbolLayer(n);null!=t&&(i.push(t.load()),r.push(t))}await Promise.all(i),this._loaded=!0}async createDestroyCommand(){const{_context:e,_symbolLayerRenderers:t}=this,r=[];for(const e of t)r.push(e.createDestroyCommand());const i=e.joinPipelineCommands(await Promise.all(r));return i.appendPipelineStateCommand(()=>this._destroy()),i}async createAddCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createAddCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createRemoveCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createRemoveCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateVisibilityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateVisibilityCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateLayerViewOpacityCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateLayerViewOpacityCommand(e));return t.joinPipelineCommands(await Promise.all(i))}async createUpdateElevationCommand(e){const{_context:t,_symbolLayerRenderers:r}=this,i=[];for(const t of r)i.push(t.createUpdateElevationCommand(e));return t.joinPipelineCommands(await Promise.all(i))}}class re{constructor(e,t){this._symbol=null,this._featureData=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const{_renderer:e,_context:t}=this;this._symbol=t.symbolRendererFactory.createSymbolRendererFromSymbol(e.symbol),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=await this._provisionSymbol(),i=null==r?t.createPipelineCommand():await r.createAddCommand(e);return i.appendPipelineStateCommand(()=>this._featureData.set(e.id,e)),i}async createRemoveCommand(e){const t=this._context,r=await this._provisionSymbol(),i=null==r?t.createPipelineCommand():await r.createRemoveCommand(e);return i.appendPipelineStateCommand(()=>this._featureData.delete(e)),i}async createUpdateVisibilityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateVisibilityCommand(e)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=await this._provisionSymbol();return null==r?t.createPipelineCommand():await r.createUpdateLayerViewOpacityCommand(e)}async createUpdateElevationCommand(){const{_featureData:e,_context:t}=this,r=await this._provisionSymbol();if(null==r)return t.createPipelineCommand();const i=[];for(const t of e.values())i.push(r.createUpdateElevationCommand(t));const n=await Promise.all(i);return t.joinPipelineCommands(n)}async createDestroyCommand(){const{_symbol:e,_context:t,_featureData:r}=this;if(!e)return t.createPipelineCommand();const i=[];for(const e of r.keys())i.push(this.createRemoveCommand(e));i.push(e.createDestroyCommand());const n=await Promise.all(i);return t.joinPipelineCommands(n)}async _provisionSymbol(){const e=this._symbol;return e?(e.loaded||await e.load(),e):null}}var ie=r(48353),ne=r(8887),se=r(38954),oe=r(72385),ae=(r(4197),r(11868)),le=r(27921),ce=r(71351),ue=r(73941);function de(e,t){const r=e[t],i=e[t+1],n=e[t+2];return Math.sqrt(r*r+i*i+n*n)}function he(e,t){const r=e[t],i=e[t+1],n=e[t+2],s=1/Math.sqrt(r*r+i*i+n*n);e[t]*=s,e[t+1]*=s,e[t+2]*=s}function fe(e,t,r){e[t]*=r,e[t+1]*=r,e[t+2]*=r}r(37539),r(20498),r(87170),(0,M.vt)(),(0,M.vt)();var pe=r(620);r(78754);const me=new Array(36);for(let e=0;e<6;e++)for(let t=0;t<6;t++)me[6*e+t]=e;const ye=new Array(36);for(let e=0;e<6;e++)ye[6*e]=0,ye[6*e+1]=1,ye[6*e+2]=2,ye[6*e+3]=2,ye[6*e+4]=3,ye[6*e+5]=0;const ge=(0,oe.fA)(-.5,0,-.5),be=(0,oe.fA)(.5,0,-.5),_e=(0,oe.fA)(0,0,.5),ve=(0,oe.fA)(0,.5,0),xe=(0,oe.vt)(),we=(0,oe.vt)(),Ce=(0,oe.vt)(),Se=(0,oe.vt)(),Ae=(0,oe.vt)();(0,se.e)(xe,ge,ve),(0,se.e)(we,ge,be),(0,se.f)(Ce,xe,we),(0,se.n)(Ce,Ce),(0,se.e)(xe,be,ve),(0,se.e)(we,be,_e),(0,se.f)(Se,xe,we),(0,se.n)(Se,Se),(0,se.e)(xe,_e,ve),(0,se.e)(we,_e,ge),(0,se.f)(Ae,xe,we),(0,se.n)(Ae,Ae),Ce[0],Ce[1],Ce[2],Se[0],Se[1],Se[2],Ae[0],Ae[1],Ae[2],(0,x.vt)();var Te=r(4576);r(6867),r(87582);var Pe=r(57917);function Ie(e,t){const r=(e,r,i=!1)=>({levels:e.map(e=>{const n=N(r(e.tesselation));return i&&function(e){const t=e,r=t.get("position").data,i=t.get("normal").data;if(i){const t=Be(e,"normal").data;for(let e=0;e<i.length;e+=3){const r=i[e+1];t[e+1]=-i[e+2],t[e+2]=r}}if(r){const t=Be(e,"position").data;for(let e=0;e<r.length;e+=3){const i=r[e+1];t[e+1]=-r[e+2],t[e+2]=i}}}(n),{components:[{attributes:n,olidColor:void 0,transformation:null,materialId:t,visibilities:new Uint8Array([1]),objectIds:new Uint32Array([-1])}],minScreenSpaceRadius:e.minScreenSpaceRadius}})});switch(e){case"cone":return r(Me,e=>function(e,t,r,i,n=!0,s=!0){let o=0;const a=t,l=e;let c=(0,oe.fA)(0,o,0),u=(0,oe.fA)(0,o+l,0),d=(0,oe.fA)(0,-1,0),h=(0,oe.fA)(0,1,0);i&&(o=l,u=(0,oe.fA)(0,0,0),c=(0,oe.fA)(0,o,0),d=(0,oe.fA)(0,1,0),h=(0,oe.fA)(0,-1,0));const f=[u,c],p=[d,h],m=r+2,y=Math.sqrt(l*l+a*a);if(i)for(let e=r-1;e>=0;e--){const t=e*(2*Math.PI/r),i=(0,oe.fA)(Math.cos(t)*a,o,Math.sin(t)*a);f.push(i);const n=(0,oe.fA)(l*Math.cos(t)/y,-a/y,l*Math.sin(t)/y);p.push(n)}else for(let e=0;e<r;e++){const t=e*(2*Math.PI/r),i=(0,oe.fA)(Math.cos(t)*a,o,Math.sin(t)*a);f.push(i);const n=(0,oe.fA)(l*Math.cos(t)/y,a/y,l*Math.sin(t)/y);p.push(n)}const g=new Array,b=new Array;if(n){for(let e=3;e<f.length;e++)g.push(1),g.push(e-1),g.push(e),b.push(0),b.push(0),b.push(0);g.push(f.length-1),g.push(2),g.push(1),b.push(0),b.push(0),b.push(0)}if(s){for(let e=3;e<f.length;e++)g.push(e),g.push(e-1),g.push(0),b.push(e),b.push(e-1),b.push(1);g.push(0),g.push(2),g.push(f.length-1),b.push(1),b.push(2),b.push(p.length-1)}const _=(0,ae.oe)(3*m);for(let e=0;e<m;e++)_[3*e]=f[e][0],_[3*e+1]=f[e][1],_[3*e+2]=f[e][2];const v=(0,ae.oe)(3*m);for(let e=0;e<m;e++)v[3*e]=p[e][0],v[3*e+1]=p[e][1],v[3*e+2]=p[e][2];return[["position",new J.n(_,g,3,!0)],["normal",new J.n(v,b,3,!0)]]}(1,.5,e,!1),!0);case"sphere":return r([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],e=>function(e,t,r){const i=e;let n,s;if(r)n=[0,-1,0,1,0,0,0,0,1,-1,0,0,0,0,-1,0,1,0],s=[0,1,2,0,2,3,0,3,4,0,4,1,1,5,2,2,5,3,3,5,4,4,5,1];else{const e=i*(1+Math.sqrt(5))/2;n=[-i,e,0,i,e,0,-i,-e,0,i,-e,0,0,-i,e,0,i,e,0,-i,-e,0,i,-e,e,0,-i,e,0,i,-e,0,-i,-e,0,i],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1]}for(let t=0;t<n.length;t+=3)fe(n,t,e/de(n,t));let o={};function a(t,r){t>r&&([t,r]=[r,t]);const i=t.toString()+"."+r.toString();if(o[i])return o[i];let s=n.length;return n.length+=3,function(e,t,r,i,n,s=t){(n=n||e)[s]=e[t]+r[i],n[s+1]=e[t+1]+r[i+1],n[s+2]=e[t+2]+r[i+2]}(n,3*t,n,3*r,n,s),fe(n,s,e/de(n,s)),s/=3,o[i]=s,s}for(let e=0;e<t;e++){const e=s.length,t=new Array(4*e);for(let r=0;r<e;r+=3){const e=s[r],i=s[r+1],n=s[r+2],o=a(e,i),l=a(i,n),c=a(n,e),u=4*r;t[u]=e,t[u+1]=o,t[u+2]=c,t[u+3]=i,t[u+4]=l,t[u+5]=o,t[u+6]=n,t[u+7]=c,t[u+8]=l,t[u+9]=o,t[u+10]=l,t[u+11]=c}s=t,o={}}const l=(0,ae.Wz)(n);for(let e=0;e<l.length;e+=3)he(l,e);return[["position",new J.n((0,ae.Wz)(n),s,3,!0)],["normal",new J.n(l,s,3,!0)]]}(.5,e,!0));case"cube":case"inverted-cone":case"cylinder":case"tetrahedron":case"diamond":throw new Error("not implemented");default:return}}function Be(e,t){let r=e.get(t);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:(0,Pe.S)(r.data)},e.set(t,r)),r}const Me=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];var Ee=r(2495),Oe=r(74810);class Re{constructor(e,t){this._loaded=!1,this._loadingPromise=null,this._primitiveMaterialId=null,this._lodRendererId=null,this._context=null,this._symbolLayer=null,this._primitive=null,this._context=t,this._symbolLayer=e}_destroy(){this._lodRendererId=null,this._primitiveMaterialId=null}get loaded(){return this._loaded}get _isPrimitive(){return null!=this._primitive}load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){const e=this._context.renderCommandContext,t=this._getLayerOpacity();let r={usePBR:!0,isSchematic:!0,mrrFactors:Oe.Bt,ambient:x.Un,diffuse:x.Un,hasSlicePlane:!1,castShadows:!0,layerOpacity:t,offsetTransparentBackfaces:!1,screenSizePerspective:{}};if(r.externalColor=w.Un,r.instanced=!0,this._isPrimitive){const e=new Ee.fs;e.layerOpacity=t,r={...r,cullFace:De((0,Ee.ty)(e))}}const i=await e.createMaterial({type:"default",parameters:r}),n=this._symbolLayer.resource;this._primitive=n&&function(e){switch(e){case"sphere":case"cube":case"diamond":case"cylinder":case"cone":case"inverted-cone":case"tetrahedron":return!0}return!1}(n?.primitive)?n.primitive:C;const s=Ie(this._primitive,i);this._lodRendererId=await e.createLodRenderer(s),this._primitiveMaterialId=i,this._loaded=!0}async createDestroyCommand(){const{_lodRendererId:e,_primitiveMaterialId:t,_context:r}=this,i=r.renderCommandContext,n=[];return null!=e&&n.push(i.destroyLodRenderer(e)),null!=t&&n.push(i.destroyMaterial(t)),new p(i,i.mergeRenderCommandBuffers(n),[()=>this._destroy()])}async createAddCommand(e){const t=this._context,{renderCommandContext:r,mainThreadDelegate:i}=t;if(null==this._lodRendererId)throw new Error("expected lod renderer id to not be null");const{featureCount:n}=e;if(0===n)return t.createPipelineCommand();const s=this._isPrimitive,o=this._primitive||C,a=(0,P.vt)((0,ne.Fq)(o)),l=(0,x.ci)((0,P.Ej)(a)),c=(0,x.ci)((0,ne.Bb)(l,{isPrimitive:s,width:100,depth:null,height:null})),u=new Float64Array(16*n),d=new Float64Array(16*n),h=z(e),f=await i.applyElevationAlignmentTo(h);for(let e=0;e<n;++e){const t=e,r=f[3*e+0],i=f[3*e+1],n=f[3*e+2],s=this._computeGlobalTransform(r,i,n,this._context.viewSpatialReference,Ve),o=this._computeLocalTransform(c,l,je);this._writeMatrixToTypedBuffer(u,t,o),this._writeMatrixToTypedBuffer(d,t,s)}const p=V(e),m=new Uint8Array(n);e.getVisibilityArray(m);const y={featureIds:new Uint32Array(p),visibility:m,localTransforms:u,globalTransforms:d};return t.createPipelineCommand(r.addLodInstances(this._lodRendererId,e.id,y))}async createRemoveCommand(e){const{_context:t,_lodRendererId:r}=this,i=t.renderCommandContext;return null==r?t.createPipelineCommand():t.createPipelineCommand(i.removeLodInstances(r,e))}async createUpdateVisibilityCommand(e){const{_lodRendererId:t,_context:r}=this,i=r.renderCommandContext;if(null==t)return r.createPipelineCommand();const n=new Uint8Array(e.featureCount);return e.getVisibilityArray(n),r.createPipelineCommand(i.updateVisibility(t,e.id,n))}async createUpdateLayerViewOpacityCommand(e){const{_context:t}=this,r=t.renderCommandContext,i=this._primitiveMaterialId;if(null==i)return t.createPipelineCommand();const n=this._getLayerOpacity();let s={layerOpacity:n};if(this._isPrimitive){const e=new Ee.fs;e.layerOpacity=n,s={...s,cullFace:De((0,Ee.ty)(e))}}return t.createPipelineCommand(r.updateMaterial({type:"default",materialId:i,parameters:s}))}async createUpdateElevationCommand(e){const{_context:t,_lodRendererId:r}=this,{renderCommandContext:i,mainThreadDelegate:n}=t,{featureCount:s,id:o}=e;if(null==r||0===s)return t.createPipelineCommand();const a=new Float64Array(16*s),l=z(e),c=await n.applyElevationAlignmentTo(l);for(let e=0;e<s;++e){const t=e,r=c[3*e+0],i=c[3*e+1],n=c[3*e+2],s=this._computeGlobalTransform(r,i,n,this._context.viewSpatialReference,Ve);this._writeMatrixToTypedBuffer(a,t,s)}return t.createPipelineCommand(i.updateLodInstancesData(r,o,a))}_writeMatrixToTypedBuffer(e,t,r){let i=16*t;for(let t=0;t<16;t++)e[i++]=r[t]}_computeGlobalTransform(e,t,r,i,n){return Fe[0]=e,Fe[1]=t,Fe[2]=r,(0,ie.l)(i,Fe,n,this._context.renderSpatialReference),n}_computeLocalTransform(e,t,r){return(0,A.D_)(r),this._applyObjectScale(e,t,r),r}_applyObjectScale(e,t,r){const i=function(e=x.Un,t,r,i=1){const n=new Array(3);if(null==t||null==r)n[0]=1,n[1]=1,n[2]=1;else{let i,s=0;for(let o=2;o>=0;o--){const a=e[o],l=null!=a,c=0===o&&!i&&!l,u=r[o];let d;"symbol-value"===a||c?d=0!==u?t[o]/u:1:l&&"proportional"!==a&&isFinite(a)&&(d=0!==u?a/u:1),null!=d&&(n[o]=d,i=d,s=Math.max(s,Math.abs(d)))}for(let e=2;e>=0;e--)null==n[e]?n[e]=i:0===n[e]&&(n[e]=.001*s)}for(let e=2;e>=0;e--)n[e]/=i;return(0,x.ci)(n)}(e,e,t,this._context.renderCoordsHelper.unitInMeters);1===i[0]&&1===i[1]&&1===i[2]||(0,A.hs)(r,r,i)}_getLayerOpacity(){return this._context.layerViewInfo.fullOpacity}}function De(e){return e?0:2}const Fe=(0,x.vt)(),je=(0,v.vt)(),Ve=(0,v.vt)();class ze{constructor(e,t){this._symbols=new Array,this._featureDataPartitioning=new Map,this._loaded=!1,this._loadingPromise=null,this._renderer=null,this._context=t,this._renderer=e}async load(){return null==this._loadingPromise&&(this._loadingPromise=this._load()),this._loadingPromise}async _load(){this._symbols[0]=new Q(_(),this._context),this._symbols[1]=new Re(new g.A,this._context),this._loaded=!0}get loaded(){return this._loaded}async createAddCommand(e){const t=this._context,r=this._partition(e),i=await Promise.all(r.map(async({index:e,features:t})=>{const r=await this._provisionSymbol(e);return await(r?.createAddCommand(t))})),n=t.joinPipelineCommands(i);return n.appendPipelineStateCommand(()=>this._featureDataPartitioning.set(e.id,r)),n}async createRemoveCommand(e){const{_featureDataPartitioning:t,_context:r}=this,i=r.renderCommandContext,n=t.get(e);if(null==n)return new p(i,i.createRenderCommandBuffer(),[]);const s=await Promise.all(n.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createRemoveCommand(t.id))})),o=r.joinPipelineCommands(s);return o.appendPipelineStateCommand(()=>t.delete(e)),o}async createUpdateVisibilityCommand(e){const{_featureDataPartitioning:t,_context:r}=this,i=r.renderCommandContext,n=t.get(e.id);if(null==n)return new p(i,i.createRenderCommandBuffer(),[]);const s=await Promise.all(n.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateVisibilityCommand(t))}));return r.joinPipelineCommands(s)}async createUpdateLayerViewOpacityCommand(e){const t=this._context,r=[];for(let t=0;t<this._symbols.length;++t){const i=this._symbols[t];null!=i&&i.loaded&&r.push(i.createUpdateLayerViewOpacityCommand(e))}const i=await Promise.all(r);return t.joinPipelineCommands(i)}async createUpdateElevationCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.values()){const e=t.map(async({index:e,features:t})=>{const r=this._getLoadedSymbol(e);return await(r?.createUpdateElevationCommand(t))});r.push(...e)}const i=await Promise.all(r);return t.joinPipelineCommands(i)}async createDestroyCommand(){const{_featureDataPartitioning:e,_context:t}=this,r=[];for(const t of e.keys())r.push(this.createRemoveCommand(t));for(const e of this._symbols)r.push(e.createDestroyCommand());const i=await Promise.all(r);return t.joinPipelineCommands(i)}async _provisionSymbol(e){if(null==e)return null;const t=this._symbols[e];return t?(t.loaded||await t.load(),t):null}_getLoadedSymbol(e){if(null==e)return null;const t=this._symbols[e];return null!=t&&t.loaded?t:null}_partition(e){const t=V(e);if(null==t)throw new Error("unable to fetch objectIds");const{featureCount:r}=e,i=[[],[]];for(let e=0;e<r;++e)i[t[e]%2].push(e);return i.map((t,r)=>new Le(r,e.subset(new Uint32Array(t)))).filter(e=>e.features.featureCount>0)}}class Le{constructor(e,t){this.index=e,this.features=t}}class Ue{constructor(e,t,r,i,n,s,o){this.viewSpatialReference=e,this.renderSpatialReference=t,this.mainThreadDelegate=r,this.renderCoordsHelper=i,this.renderCommandContext=n,this.layerInfo=s,this.layerViewInfo=o,this.symbolRendererFactory=new Ne(this)}createPipelineCommand(e=this.renderCommandContext.createRenderCommandBuffer(),t=[]){return new p(this.renderCommandContext,e,t)}joinPipelineCommands(e){return 0===e.length?this.createPipelineCommand():e.filter(e=>null!=e).reduce((e,t)=>(e.append(t),e))}}class Ne{constructor(e){this.context=e}createSymbolRendererFromJSON(e){const t=(0,f.L)(e??Ge)??void 0;if(!t)throw new Error("Failed to create renderer");const r=t.type;switch(r){case"simple":return new re(t,this.context);case"unique-value":return new ze(t,this.context);default:return console.warn(`Unable to create symbolrenderer for renderer of ${r}`),this.createSymbolRendererFromJSON(Ge)}}createSymbolRendererFromSymbol(e){const t=e?.type;switch(t){case"point-3d":return new te(e,this.context);case"picture-marker":case"simple-marker":return new Q(_(),this.context);default:return console.warn(`Unable to create symbolrenderer for symbol of ${t}`),null}}createSymbolRendererFromSymbolLayer(e){const t=e.type;return"icon"===t?new Q(e,this.context):(console.warn(`Unable to create symbolrenderer for symbolLayer of ${t}`),null)}}const Ge={type:"simple"};var qe=r(69622),He=r(60999),ke=r(44208),Ze=r(32587),$e=r(76030),Ye=r(69397),Xe=r(24326);function We(e=""){return`${e}${(0,Xe.c)()}`}new Float64Array(3);class Je{constructor(e,t){this._parent=e,this._subsetIndices=t,this.id=We(`featureDataSubset-${e.id}-`)}get tileId(){return this._parent.tileId}get extent(){return this._parent.extent}get featureCount(){return this._subsetIndices.length}get usedMemory(){return this._parent.usedMemory+Ye.qK+this._subsetIndices.byteLength}get isFullyEnabled(){for(const e of this._subsetIndices)if(!this._parent.getEnabled(e))return!1;return!0}getObjectId(e){return this._parent.getObjectId(this._subsetIndices[e])}getAttribute(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributeAsTimestamp(e,t){return this._parent.getAttribute(this._subsetIndices[e],t)}getAttributes(e){return this._parent.getAttributes(this._subsetIndices[e])}getCoordinates(e,t,r){return this._parent.getCoordinates(this._subsetIndices[e],t,r)}getOptimizedGeometry(e){return this._parent.getOptimizedGeometry(this._subsetIndices[e])}getCentroid(e,t){return this._parent.getCentroid(this._subsetIndices[e],t)}getBounds(e){return this._parent.getBounds(this._subsetIndices[e])}getBoundingBox(e){return this._parent.getBoundingBox(this._subsetIndices[e])}getObjectIdsArray(e,t,r){return this._parent.getObjectIdsArray(e,this._translatedIndices(t),r)}getCoordinatesArray(e,t,r){return this._parent.getCoordinatesArray(e,this._translatedIndices(t),r)}objectIds(e){return this._parent.objectIds(this._translatedIndices(e))}subset(e){const{_subsetIndices:t}=this,r=new Uint32Array(e.length);for(let i=0;i<r.length;++i)r[i]=t[e[i]];return new Je(this._parent,r)}disableObjectIds(e){if(0===e.size)return;const{featureCount:t}=this,r=new Array;for(let i=0;i<t;++i)this.getEnabled(i)&&e.has(this.getObjectId(i))&&r.push(i);if(0!==r.length)for(const e of r)this.setEnabled(e,!1)}setEnabled(e,t){this._parent.setEnabled(this._subsetIndices[e],t)}getEnabled(e){return this._parent.getEnabled(this._subsetIndices[e])}enableAll(){const{_subsetIndices:e,_parent:t}=this;for(const r of e)t.setEnabled(r,!0)}getVisibilityArray(e,t,r){return this._parent.getVisibilityArray(e,this._translatedIndices(t),r)}enabledObjectIds(e){return this._parent.enabledObjectIds(this._translatedIndices(e))}*_translatedIndices(e){const{_subsetIndices:t}=this;if(null!=e)for(const r of e)yield t[r];else yield*t}}class Qe{constructor(e){this._tile=e,this.id=We(`featureData-${e.id}-`),this._enabled=new Array(e.featureCount).fill(!0)}get tileId(){return this._tile.id}get featureCount(){return this._tile.featureCount}get usedMemory(){return Ye.qK+(0,Ye.$B)(this.id)}get extent(){return this._tile.descriptor.extent}get isFullyEnabled(){return this._enabled.every(e=>e)}getObjectId(e){return this._tile.getObjectId(e)}getAttribute(e,t){return this._tile.getAttribute(e,t)}getAttributeAsTimestamp(e,t){return this._tile.getAttribute(e,t)}getAttributes(e){return this._tile.getAttributes(e)}getCoordinates(e,t,r){return this._tile.getCoordinates(e,t,r)}getOptimizedGeometry(e){return this._tile.getOptimizedGeometry(e)}getCentroid(e,t){return this._tile.getCentroid(e,t)}getBounds(e){return this._tile.getBounds(e)}getBoundingBox(e){return this._tile.getBoundingBox(e)}getObjectIdsArray(e,t,r){return this._tile.getObjectIdsArray(e,t,r)}getCoordinatesArray(e,t,r){return this._tile.getCoordinatesArray(e,t,r)}objectIds(e){return this._tile.objectIds(e)}subset(e){return new Je(this,e)}disableObjectIds(e){if(0===e.size)return;const{_enabled:t}=this,r=new Array;for(const i of this._allFeatureIndices())t[i]&&e.has(this.getObjectId(i))&&r.push(i);if(0!==r.length)for(const e of r)t[e]=!1}setEnabled(e,t){this._enabled[e]=t}getEnabled(e){return this._enabled[e]}enableAll(){this._enabled.fill(!0)}getVisibilityArray(e,t=this._allFeatureIndices(),r=0){const{_enabled:i}=this;for(const n of t)e[r++]=Number(i[n]);return r}*enabledObjectIds(e=this._allFeatureIndices()){const{_enabled:t}=this;for(const r of e)t[r]&&(yield this.getObjectId(r))}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}}let Ke=class extends qe.A{constructor(e){super(e),this.extent=null,this._tileHandles=new Ze.A,this._wanted=new Ze.A,this._updateRequested=!1,this._synchronizationTask=null,this._requestedTiles=new Array}destroy(){this._tileHandles.clear(),this._wanted.clear()}get updating(){return this._updateRequested||!(this._synchronizationTask?.finished??1)}get _boundingRect(){const{extent:e}=this;return null==e?null:(0,I.VY)(e)}get _missingTiles(){const e=new Array,t=this._wanted,r=this._tileHandles;for(const i of t.values())null==r.get(i.id)?.featureData&&e.push(i);return e}onTileTreeChange({tiles:e}){this._requestedTiles=e,this._scheduleTilesSync()}_scheduleTilesSync(){if(this._updateRequested)return;this._updateRequested=!0;const e=this._synchronizationTask,t=(0,He.UT)(async()=>{try{await(0,o.C_)(()=>e?.finished??!0),await(0,$e.NO)(),this._updateRequested=!1,await this._synchronizeTiles()}finally{this._synchronizationTask===t&&(this._synchronizationTask=null)}});this._synchronizationTask=t}async _synchronizeTiles(){const e=this._requestedTiles,t=this._tileHandles,r=new Array;for(const i of e)t.has(i.id)||r.push(i);const i=new Array;for(const r of t.values()){const{id:t}=r;e.every(e=>e.id!==t)&&i.push(r.descriptor)}const n=this._tileHandles,{_boundingRect:s}=this,o=null!=s?r.filter(e=>!e.extent||(0,I.HY)(s,e.extent)):r,a=this._wanted,l=new Array;for(const{id:e}of i)a.delete(e);for(const e of o)a.set(e.id,e);const c=this._missingTiles;for(const e of i){const{id:t}=e;if(c.some(t=>et(t,e)||et(e,t)))continue;const r=n.get(t);null!=r&&l.push(this._removeTile(r))}for(const e of o)l.push(this._addTile(e));const u=await Promise.allSettled(l);for(const e of u)"rejected"===e.status&&console.error(e.reason)}forEachTile(e){for(const t of this._tileHandles.values()){const r=t.featureData;null!=r&&e(r)}}*loadedTiles(){for(const e of this._tileHandles.values()){const t=e.featureData;null!=t&&(yield t)}}async _removeTile(e){e.loadTask.abort(),this._tileHandles.delete(e.id),this._validate();const{featureData:t}=e;if(null!=t){const e={stack:[],error:void 0,hasError:!1};try{(0,i.mS)(e,await this.tileLocks.lock([t.tileId]),!1);const r=await this.createRemoveCommand(t.id);await(r?.execute())}catch(t){e.error=t,e.hasError=!0}finally{(0,i.hk)(e)}}}async _addTile(e){const{_tileHandles:t}=this,r=t.get(e.id);if(null!=r){if(!rt(r)||r.featureData.isFullyEnabled)return;return r.featureData.enableAll(),void await this._onTileLoad(r)}const i=new tt(e,(0,He.UT)(async t=>{const r=await this.loadTile(e,t);return(0,s.Te)(t),new Qe(r)}));this._tileHandles.set(i.id,i);try{await i.loadTask.promise}catch(e){return void(0,s.jH)(e)}(function(e){if(!rt(e))throw new Error})(i),await this._onTileLoad(i)}async _onTileLoad(e){const t={stack:[],error:void 0,hasError:!1};try{const{_wanted:r,_tileHandles:n,_missingTiles:s}=this,o=e.descriptor,a=new Array,l=new Array,c=new Array,u=new Set;for(const t of n.values()){if(t===e)continue;const{descriptor:i,id:c}=t;if(!r.has(c)&&!s.some(e=>et(e,i)||et(i,e))){n.delete(c),t.loadTask.abort();const{featureData:e}=t;null!=e&&a.push(e);continue}if(rt(t)){if(et(o,i)){const e=t.featureData;for(const t of e.objectIds())u.add(t)}if(et(i,o)){const{featureData:e}=t;l.push(e)}}}u.size>0&&(e.featureData.disableObjectIds(u),this._validateRemoval(e.featureData,u)),this._validate(),c.push(e.featureData);const d=[...c,...a,...l].map(e=>e.tileId);if((0,i.mS)(t,await this.tileLocks.lock(d),!1),0!==l.length){const t=e.featureData,r=new Set(t.objectIds());for(const e of l)e.disableObjectIds(r),this._validateRemoval(e,r)}const h=a.map(e=>this.createRemoveCommand(e.id)),f=c.map(e=>this.createAddCommand(e)),p=l.map(e=>this.createUpdateCommand(e)),m=function(e){return 0===e.length?null:e.reduce((e,t)=>(e.append(t),e))}((await Promise.all([...h,...f,...p])).filter(Te.Ru));await(m?.execute())}catch(e){t.error=e,t.hasError=!0}finally{(0,i.hk)(t)}}_validate(){if(!(0,ke.A)("feature-pipeline-3d-test-validation"))return;const e=new Array;for(const t of this._tileHandles.values()){if(!rt(t))continue;const{featureData:r}=t;e.push({featureData:r,objectIds:new Set(r.enabledObjectIds())})}for(let t=0;t<e.length;++t){const{featureData:r,objectIds:i}=e[t];for(let n=t+1;n<e.length;++n){const{featureData:t,objectIds:s}=e[n];for(const e of s)if(i.has(e))throw new Error(`${r.id} and ${t.id} both contain ${e}.`)}}}_validateRemoval(e,t){if((0,ke.A)("feature-pipeline-3d-test-validation"))for(const r of e.enabledObjectIds())if(t.has(r))throw new Error(`Failed to remove ${r} from ${e.id}!`)}};function et({lij:[e,t,r]},{lij:[i,n,s]}){const o=i-e;return o>=0&&t===n>>o&&r===s>>o}(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"updating",null),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],Ke.prototype,"loadTile",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],Ke.prototype,"createAddCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],Ke.prototype,"createRemoveCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],Ke.prototype,"createUpdateCommand",void 0),(0,i.Cg)([(0,a.MZ)({constructOnly:!0})],Ke.prototype,"tileLocks",void 0),(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"extent",void 0),(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"_boundingRect",null),(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"_missingTiles",null),(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"_updateRequested",void 0),(0,i.Cg)([(0,a.MZ)()],Ke.prototype,"_synchronizationTask",void 0),Ke=(0,i.Cg)([(0,a.$K)("esri.views.3d.layers.graphics.pipeline.Tile3DManager")],Ke);class tt{constructor(e,t){this.descriptor=e,this.loadTask=t}get id(){return this.descriptor.id}get featureData(){return this.loadTask.value}}function rt(e){return null!=e.featureData}var it=r(36563);class nt{constructor(){this._previousActions=new Map}async lock(e){const{_previousActions:t}=this,r=e.map(e=>t.get(e)).filter(Te.Ru),i=Promise.allSettled(r),n=(0,s.Tw)(),o=(0,it.hA)(()=>n.resolve()),a=n.promise.finally(()=>{for(const r of e)t.get(r)===a&&t.delete(r)});for(const r of e)t.set(r,a);return await i,(0,it.Bf)(o)}}var st=r(75503),ot=r(27647);class at{constructor(e,t){this._index=e,this._view=t}get usedMemory(){return Ye.qK+Ye.RS}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(e){return this._view.getAttribute(this._index,e)}getAttributeAsTimestamp(e){return this._view.getAttributeAsTimestamp(this._index,e)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(e){return this._view.getCentroid(this._index,e)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(e){return new lt(this._index,this._view,e)}}class lt extends at{constructor(e,t,r){super(e,t),this._geometryOverride=r}getOptimizedGeometry(){return this._geometryOverride}getCentroid(e){return(0,ot.Q)(this._geometryOverride)}}class ct{constructor(e,t){this.featureData=e,this.bounds=t}}class ut{constructor(){this._tileBounds=new Map,this.events=new n.bk,this.featureAdapter=dt.shared}get usedMemory(){return Ye.qK+Ye.qK*this._tileBounds.size}addTile(e){const{featureCount:t}=e;if(0===t)return;const r=new st.wq(9,t=>e.getBounds(t)),i=new Array;for(let e=0;e<t;++e)i[e]=e;r.load(i),this._tileBounds.set(e.id,new ct(e,r)),this.events.emit("changed")}removeTile(e){this._tileBounds.delete(e),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(e){for(const{featureData:t,bounds:r}of this._tileBounds.values())r.all(r=>{t.getEnabled(r)&&e(new at(r,t))})}forEachInBounds(e,t){ht.minX=e[0],ht.minY=e[1],ht.maxX=e[2],ht.maxY=e[3];for(const{featureData:e,bounds:r}of this._tileBounds.values())r.search(ht,r=>{e.getEnabled(r)&&t(new at(r,e))})}forEachBounds(e,t){for(const r of e)t(r.getBoundingBox())}getFullExtent(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(const{bounds:e}of this._tileBounds.values()){const{minX:s,minY:o,maxX:a,maxY:l}=e.toJSON();t=Math.min(t,s),r=Math.min(r,o),i=Math.min(i,a),n=Math.min(n,l)}return{xmin:t,ymin:r,xmax:i,ymax:n,spatialReference:e}}}class dt{static{this.shared=new dt}getObjectId(e){return e.getObjectId()}getAttribute(e,t){return e.getAttribute(t)}getAttributeAsTimestamp(e,t){return e.getAttributeAsTimestamp(t)}getAttributes(e){return e.getAttributes()}getGeometry(e){return e.getOptimizedGeometry()}getCentroid(e,t){return e.getCentroid(t)}cloneWithGeometry(e,t,r){return e.cloneWithGeometry(t)}}const ht=new st.EC;var ft=r(80893);class pt{constructor(e,t,r){this.descriptor=e,this._pages=t,this._pageSize=r;const i=Ye.ez+t.reduce((e,{usedMemory:t})=>e+t,0),n=3*Ye.RS;this.usedMemory=Ye.qK+i+n,this.featureCount=t.reduce((e,t)=>e+t.featureCount,0)}get id(){return this.descriptor.id}getObjectId(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getObjectId(r)}getAttribute(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getAttribute(i,t)}getAttributeAsTimestamp(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getAttributeAsTimestamp(i,t)}getAttributes(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getAttributes(r)}getCoordinates(e,t,r){const{pageIndex:i,featurePageIndex:n}=this._translateIndex(e);this._pages[i].getCoordinates(n,t,r)}getOptimizedGeometry(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getOptimizedGeometry(r)}getCentroid(e,t){const{pageIndex:r,featurePageIndex:i}=this._translateIndex(e);return this._pages[r].getCentroid(i,t)}getBounds(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBounds(r)}getBoundingBox(e){const{pageIndex:t,featurePageIndex:r}=this._translateIndex(e);return this._pages[t].getBoundingBox(r)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){let i=r;for(const{page:r,indices:n}of this._batchPageIndices(t))i=r.getObjectIdsArray(e,n,i);return i}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){let i=r;for(const{page:r,indices:n}of this._batchPageIndices(t))i=r.getCoordinatesArray(e,n,i);return i}*objectIds(e=this._allFeatureIndices()){for(const{page:t,indices:r}of this._batchPageIndices(e))for(const e of t.objectIds(r))yield e}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_translateIndex(e){const{_pageSize:t}=this;return{pageIndex:Math.floor(e/t),featurePageIndex:e%t}}*_batchPageIndices(e){const t=new Array;{let r=0,i=new Array;for(const n of e){const{pageIndex:e,featurePageIndex:s}=this._translateIndex(n);r!==e&&(0!==i.length&&t.push({pageIndex:r,indices:i}),r=e,i=[]),i.push(s)}0!==i.length&&t.push({pageIndex:r,indices:i})}const{_pages:r}=this;for(const{pageIndex:e,indices:i}of t)yield{page:r[e],indices:i}}}var mt=r(49186),yt=r(51624),gt=r(62577),bt=r(92722),_t=r(95466),vt=r(53655);class xt{constructor(e){this._reader=new yt.A(new Uint8Array(e),new DataView(e)),this._index=function(e){for(;e.next();){if(2===e.tag())return wt(e.getMessage());e.skip()}St()}(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:i}}=this,n=r.get(t)?.index;if(null==n)return;const s=i[e*r.fields.length+n],o=this._reader;return o.move(s),At(o)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,i=e*t.fields.length,n=this._reader,s={};for(const e of t.fields){const t=r[i+e.index];n.move(t),s[e.name]=At(n)}return s}getCoordinates(e,t,r=0){const i=this._reader,{transform:n,featureIndices:s}=this._index,{scale:o,translate:a}=n;i.move(s[e]),this._readCoordinates(o,a,t,r)}getOptimizedGeometry(e){const t=(0,x.vt)();return this.getCoordinates(e,t),new bt.A([],t,!0,!1)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,Tt);const[i,n,s]=Tt,o=[i,n];return t&&(o[3]=s),r&&(o[t?4:3]=0),new bt.A([],o,t,r)}getBounds(e){this.getCoordinates(e,Tt);const[t,r]=Tt,i=new st.EC;return i.minX=t,i.minY=r,i.maxX=t,i.maxY=r,i}getBoundingBox(e){this.getCoordinates(e,Tt);const[t,r,i]=Tt;return(0,P.fA)(t,r,i,t,r,i)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const i=this._reader,{objectIdFieldName:n,attributeIndices:s,fieldsIndex:o}=this._index,a=o.get(n).index,l=o.fields.length;for(const n of t){const t=s[n*l+a];i.move(t),e[r++]=At(i)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const i=this._reader,{transform:n,featureIndices:s}=this._index,{scale:o,translate:a}=n;for(const n of t){const t=s[n];i.move(t),r=this._readCoordinates(o,a,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:i,fieldsIndex:n}=this._index,s=n.get(r).index,o=n.fields.length;for(const r of e){const e=i[r*o+s];t.move(e),yield At(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[i,n,s],o,a){const l=this._reader,c=l.getLength(),u=l.pos()+c;for(;l.pos()<u&&l.next();)switch(l.tag()){case 2:{const c=l.getLength(),u=l.pos()+c;for(;l.pos()<u&&l.next();)3===l.tag()?(l.getUInt32(),o[a++]=i+e*l.getSInt64(),o[a++]=n+t*l.getSInt64(),o[a++]=s+r*l.getSInt64()):l.skip();break}default:l.skip()}return a}}function wt(e){for(;e.next();){if(1===e.tag())return Ct(e.getMessage());e.skip()}St()}function Ct(e){let t,r,i=!1,n=!1,s=0;const o=new Array,a=new Array,l=new Array;for(;e.next();)switch(e.tag()){case 1:r=e.getString();break;case 7:0!==e.getEnum()&&St();break;case 9:i=e.getBool()??!1;break;case 12:t=(0,gt.Q1)(e.processMessage(vt.ae));break;case 13:{const t=e.processMessage(vt.cn);t.index=s++,o.push(t);break}case 15:{a.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)1===e.tag()?(l.push(e.pos()),e.skip()):e.skip();break}case 10:n=e.getBool()??!1;break;default:e.skip()}const c=new _t.A(o);return null!=t&&n&&null!=r&&c.has(r)||St(),{transform:t,exceededTransferLimit:i,fieldsIndex:c,objectIdFieldName:r,featureIndices:a,attributeIndices:l}}function St(){const e=new mt.A("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(e),e}function At(e){const t=e.getLength(),r=e.pos()+t;for(;e.pos()<r&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}const Tt=(0,x.vt)();class Pt{constructor(e,t,r,i,n){this.spatialReference=e,this.url=r,this.objectIdField=i,this.capabilities=n;const{supportsMaxRecordCountFactor:s,maxRecordCount:o}=this.capabilities.query,a=s?4:1,l=(o??8e3)*a;this._pageSize=Math.min(8e3,l);const c=t.clone();c.cacheHint=!0,c.resultType="tile",c.outSpatialReference=e,c.returnGeometry=!0,c.returnZ=!0,c.maxRecordCountFactor=a,c.num=this._pageSize,c.outFields=[i],this._baseQuery=c}async fetch(e,t){const{spatialReference:r,_pageSize:i}=this,n=(0,I.w1)(e.extent,r),o=this._baseQuery.clone();o.geometry=n;const a=new Array;let l=0,c=!1,u=1;for(;!c;){const e=[];for(let r=0;r<u;++r)e.push(this._fetchPage(o,l++,t));const r=await Promise.all(e);(0,s.Te)(t);for(const e of r){const t=0!==e.featureCount;c||=!e.exceededTransferLimit||!t,t&&a.push(e)}u=Math.min(u+1,4)}return new pt(e,a,i)}async _fetchPage(e,t,r){const i=e.clone();i.start=t*this._pageSize;const n=await(0,ft.kS)(this.url,i,{signal:r});return(0,s.Te)(r),new xt(n)}}var It=r(29920),Bt=r(77690),Mt=r(29242),Et=r(13030),Ot=r(78662),Rt=r(49255),Dt=r(40268),Ft=r(25634),jt=r(11725),Vt=r(77194),zt=r(59907),Lt=r(43616),Ut=r(13259),Nt=r(4431),Gt=r(1843),qt=r(13840),Ht=r(42958),kt=r(16943),Zt=r(33524),$t=r(90644);let Yt=class extends Ht.w{constructor(e,t){super(e,t,(0,Nt.U)(Wt).concat((0,Nt.U)(Kt()))),this.shader=new qt.r(Ut.H,()=>r.e(8241).then(r.bind(r,48241))),this.primitiveType=t.occlusionPass?G.WR.POINTS:G.WR.TRIANGLE_STRIP}initializePipeline(e){const{oitPass:t,hasEmission:r,hasPolygonOffset:i,draped:n,output:s,depthTestEnabled:o,occlusionPass:a}=e,l=o&&!n&&!(1===t)&&!a&&!(8===s);return(0,$t.Ey)({blending:(0,Rt._o)(s)?(0,Zt.Yf)(t,!0):null,depthTest:o&&!n?{func:515}:null,depthWrite:l?$t.Uy:null,drawBuffers:(0,Zt.Sv)(t,r),colorWrite:$t.kn,polygonOffset:i?Xt:null})}};Yt=(0,i.Cg)([(0,a.$K)("esri.views.3d.webgl-engine.shaders.HUDMaterialTechnique")],Yt);const Xt={factor:0,units:-4},Wt=(0,Gt.BP)().vec2u8("uv0",{glNormalized:!0}),Jt=(0,Gt.BP)().vec3f("position").vec3f("normal").vec4i16("uvi").vec4u8("color").vec2f("size").f32("rotation").vec4f("centerOffsetAndDistance").vec4f("featureAttribute"),Qt=Jt.clone().vec4u8("olidColor");function Kt(){return(0,kt.E)()?Qt:Jt}var er=r(51976),tr=r(99550);class rr extends tr.E{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.visibilityPixelEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.isFocused=!0,this.olidColorInstanced=!1,this.textureCoordinateType=0,this.emissionSource=0,this.discardInvisibleFragments=!0,this.hasVVInstancing=!1,this.snowCover=!1}}(0,i.Cg)([(0,er.W)()],rr.prototype,"screenCenterOffsetUnitsEnabled",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"visibilityPixelEnabled",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"signedDistanceFieldEnabled",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasVVSize",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasVVColor",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasVerticalOffset",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasScreenSizePerspective",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasRotation",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"debugDrawLabelBorder",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"hasPolygonOffset",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"depthTestEnabled",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"pixelSnappingEnabled",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"draped",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"terrainDepthTest",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"cullAboveTerrain",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"occlusionPass",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"occludedFragmentFade",void 0),(0,i.Cg)([(0,er.W)()],rr.prototype,"isFocused",void 0);var ir=r(49788);class nr extends jt.i{constructor(e,t){super(e,Pr),this.produces=new Map([[14,e=>(0,Rt.Lc)(e)&&!this.parameters.drawAsLabel],[15,e=>(0,Rt.Lc)(e)&&this.parameters.drawAsLabel],[13,()=>this.parameters.useVisibilityPixel],[19,e=>this.parameters.draped&&(0,Rt.Lc)(e)]]),this._visible=!0,this._configuration=new rr(t)}getConfiguration(e,t){const r=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=r,this._configuration.visibilityPixelEnabled=this.parameters.useVisibilityPixel,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.hasVVSize=!!this.parameters.vvSize,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.occlusionPass=13===t.slot,this._configuration.occludedFragmentFade=!r&&this.parameters.occludedFragmentFade,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||13===t.slot,(0,Rt._o)(e)&&(this._configuration.debugDrawLabelBorder=!!O.b.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,r,i,n,s){const{options:{selectionMode:o,hud:a,excludeLabels:l},point:c,camera:u}=r,{parameters:d}=this;if(!o||!a||l&&d.isLabel||!e.visible||!c||!u)return;const h=e.attributes.get("featureAttribute"),f=null==h?null:(0,w.ci)(h.data,xr),{scaleX:p,scaleY:m}=Br(f,d,u.pixelRatio),y=e.attributes.get("position"),g=e.attributes.get("size"),b=e.attributes.get("normal"),_=e.attributes.get("rotation"),v=e.attributes.get("centerOffsetAndDistance");(0,pe.vA)(y.size>=3);const C=(0,Ut.c)(d),S="screen"===this.parameters.centerOffsetUnits;for(let e=0;e<y.data.length/y.size;e++){const i=e*y.size;(0,se.h)(cr,y.data[i],y.data[i+1],y.data[i+2]),(0,se.p)(cr,cr,t),(0,se.p)(cr,cr,u.viewMatrix);const n=e*v.size;if((0,se.h)(_r,v.data[n],v.data[n+1],v.data[n+2]),!S&&(cr[0]+=_r[0],cr[1]+=_r[1],0!==_r[2])){const e=_r[2];(0,se.n)(_r,cr),(0,se.e)(cr,cr,(0,se.j)(_r,_r,e))}const o=e*b.size;(0,se.h)(ur,b.data[o],b.data[o+1],b.data[o+2]),(0,se.t)(ur,ur,(0,Bt.z0)(yr,t));const{normal:a,cosAngle:l}=or(ur,u,wr),h=Mr(this.parameters,cr,l,u,lr);if((0,se.c)(cr,cr,a,h),u.applyProjection(cr,dr),dr[0]>-1){S&&(_r[0]||_r[1])&&(dr[0]+=_r[0]*u.pixelRatio,0!==_r[1]&&(dr[1]+=lr.alignmentEvaluator.apply(_r[1])*u.pixelRatio),u.unapplyProjection(dr,cr)),dr[0]+=this.parameters.screenOffset[0]*u.pixelRatio,dr[1]+=this.parameters.screenOffset[1]*u.pixelRatio,dr[0]=Math.floor(dr[0]),dr[1]=Math.floor(dr[1]);const t=e*g.size;Ar[0]=g.data[t],Ar[1]=g.data[t+1],lr.evaluator.applyVec2(Ar,Ar);const i=Cr*u.pixelRatio;let n=0;d.textureIsSignedDistanceField&&(n=Math.min(d.outlineSize,.5*Ar[0])*u.pixelRatio/2),Ar[0]*=p,Ar[1]*=m;const o=e*_.size,a=d.rotation+_.data[o];if(ar(c,dr[0],dr[1],Ar,i,n,a,d,C)){const e=r.ray;if((0,se.p)(fr,cr,(0,A.B8)(gr,u.viewMatrix)),dr[0]=c[0],dr[1]=c[1],u.unprojectFromRenderScreen(dr,cr)){const t=(0,x.vt)();(0,se.d)(t,e.direction);const r=1/(0,se.b)(t);(0,se.j)(t,t,r),s((0,se.B)(e.origin,cr)*r,t,-1,fr)}}}}}intersectDraped(e,t,r,i,n){const s=e.attributes.get("position"),o=e.attributes.get("size"),a=e.attributes.get("rotation"),l=this.parameters,c=(0,Ut.c)(l),u=e.attributes.get("featureAttribute"),d=null==u?null:(0,w.ci)(u.data,xr),{scaleX:h,scaleY:f}=Br(d,l,e.screenToWorldRatio),p=Sr*e.screenToWorldRatio;for(let t=0;t<s.data.length/s.size;t++){const u=t*s.size,d=s.data[u],m=s.data[u+1],y=t*o.size;Ar[0]=o.data[y],Ar[1]=o.data[y+1];let g=0;l.textureIsSignedDistanceField&&(g=Math.min(l.outlineSize,.5*Ar[0])*e.screenToWorldRatio/2),Ar[0]*=h,Ar[1]*=f;const b=t*a.size,_=l.rotation+a.data[b];ar(r,d,m,Ar,p,g,_,l,c)&&i(n.distance,n.normal,-1)}}createBufferWriter(){return new Ir}applyShaderOffsets(e,t,r,i,n,s,o){(0,se.t)(hr,r,(0,Bt.z0)(yr,i));const a=or(hr,s,wr),l=function(e,t){const r=t.computeRenderPixelSizeAtDist(e)*Dt.R;return(t.aboveGround?1:-1)*r}((0,se.b)(t),s),c=Mr(this.parameters,t,a.cosAngle,s,o);(0,se.c)(t,t,a.normal,c+l),(0,se.c)(e,e,hr,c+l);const u=n[3]+c;this._applyPolygonOffsetView(t,a,u,s,t),this._applyCenterOffsetView(t,n,t)}applyShaderOffsetsNDC(e,t,r,i,n){return this._applyCenterOffsetNDC(e,t,r,i),null!=n&&(0,se.d)(n,i),this._applyPolygonOffsetNDC(i,t,r,i),i}_applyPolygonOffsetView(e,t,r,i,n){const s=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=s);const a=s*o;if(this.parameters.shaderPolygonOffset<=0)return(0,se.d)(n,e);const l=(0,E.qE)(Math.abs(t.cosAngle),.01,1),c=1-Math.sqrt(1-l*l)/l/i.viewport[2];return(0,se.j)(n,e,a>0?c:1/c),n}_applyCenterOffsetView(e,t,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&(0,se.d)(r,e),i&&(r[0]+=t[0],r[1]+=t[1],t[2]&&((0,se.n)(ur,r),(0,se.a)(r,r,(0,se.j)(ur,ur,t[2])))),r}_applyCenterOffsetNDC(e,t,r,i){const n="screen"!==this.parameters.centerOffsetUnits;return i!==e&&(0,se.d)(i,e),n||(i[0]+=t[0]/r.fullWidth*2,i[1]+=t[1]/r.fullHeight*2),i}_applyPolygonOffsetNDC(e,t,r,i){const n=this.parameters.shaderPolygonOffset;if(e!==i&&(0,se.d)(i,e),n){const e=r.aboveGround?1:-1,s=e*Math.sign(t[3]);i[2]-=(s||e)*n}return i}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:r}=this.parameters,i=e[3]>=ir.Q||t>=ir.Q&&r[3]>=ir.Q;return this._visible&&i}createGLMaterial(e){return new sr(e)}calculateRelativeScreenBounds(e,t,r=(0,I.vt)()){return function(e,t,r,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*r,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*r}(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class sr extends Ft.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(Yt,e)}}function or(e,t,r){return(0,se.p)(r.normal,e,t.viewInverseTransposeMatrix),r.cosAngle=(0,se.g)(r.normal,Tr),r}function ar(e,t,r,i,n,s,o,a,l){let c=t-n-i[0]*l[0],u=c+i[0]+2*n,d=r-n-i[1]*l[1],h=d+i[1]+2*n;const f=a.distanceFieldBoundingBox;return a.textureIsSignedDistanceField&&null!=f&&(c+=i[0]*f[0],d+=i[1]*f[1],u-=i[0]*(1-f[2]),h-=i[1]*(1-f[3]),c-=s,u+=s,d-=s,h+=s),(0,B.hZ)(mr,t,r),(0,B.e$)(pr,e,mr,(0,E.kU)(o)),pr[0]>c&&pr[0]<u&&pr[1]>d&&pr[1]<h}const lr=new Vt.fc,cr=(0,x.vt)(),ur=(0,x.vt)(),dr=(0,w.vt)(),hr=(0,x.vt)(),fr=(0,x.vt)(),pr=(0,M.vt)(),mr=(0,M.vt)(),yr=(0,Mt.vt)(),gr=(0,v.vt)(),br=(0,w.vt)(),_r=(0,x.vt)(),vr=(0,x.vt)(),xr=(0,w.vt)(),wr={normal:(0,x.vt)(),cosAngle:0},Cr=1,Sr=2,Ar=(0,M.fA)(0,0),Tr=(0,x.fA)(0,0,1);class Pr extends Ft.NV{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=(0,w.CN)(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=(0,M.fA)(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=(0,w.CN)(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=(0,w.vt)(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.useVisibilityPixel=!0,this.occludedFragmentFade=!1,this.occludedVisibilityMode="hidden",this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Ir{constructor(){this.layout=Kt(),this.baseInstanceLayout=Wt}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,r,i,n,s){const{position:o,normal:a,color:l,size:c,rotation:u,centerOffsetAndDistance:d,featureAttribute:h,uvi:f}=n;(0,zt.Hk)(r.get("position"),e,o,s),(0,zt.p1)(r.get("normal"),t,a,s);const p=r.get("position").indices.length;let m=0,y=0,g=Ut.f,b=Ut.f;const _=r.get("uvi")?.data;_&&_.length>=4&&(m=_[0],y=_[1],g=_[2],b=_[3]);for(let e=0;e<p;++e){const t=s+e;f.setValues(t,m,y,g,b)}if((0,zt.tb)(r.get("color"),4,l,s),(0,zt.Ue)(r.get("size"),c,s),(0,zt.uO)(r.get("rotation"),u,s),r.get("centerOffsetAndDistance")?(0,zt.Ut)(r.get("centerOffsetAndDistance"),d,s):(0,zt.Pq)(d,s,p),r.get("featureAttribute")?(0,zt.Ut)(r.get("featureAttribute"),h,s):(0,zt.Pq)(h,s,p),null!=i){const e=r.get("position")?.indices;if(e){const t=e.length,r=n.getField("olidColor",Et.XP);(0,zt.vx)(i,r,t,s)}}return{numVerticesPerItem:1,numItems:p}}writeBaseInstance(e,t){const{uv0:r}=t;(0,zt.Ue)(e.get("uv0"),r,0)}intersect(e,t,r,i,n,s,o){const{options:{selectionMode:a,hud:l,excludeLabels:c},point:u,camera:d}=i;if(!a||!l||c&&t.isLabel||!u)return;const h=this.layout.createView(e),{position:f,normal:p,rotation:m,size:y,featureAttribute:g,centerOffsetAndDistance:b}=h,_="screen"===t.centerOffsetUnits,v=(0,Ut.c)(t);if(null==f||null==p||null==m||null==y||null==b||null==d)return;const w=null==g?null:g.getVec(0,xr),{scaleX:C,scaleY:S}=Br(w,t,d.pixelRatio),T=f.count;for(let e=0;e<T;e++){if(f.getVec(e,cr),null!=r&&(0,se.i)(cr,cr,r),(0,se.p)(cr,cr,d.viewMatrix),b.getVec(e,br),(0,se.h)(_r,br[0],br[1],br[2]),!_&&(cr[0]+=_r[0],cr[1]+=_r[1],0!==_r[2])){const e=_r[2];(0,se.n)(_r,cr),(0,se.e)(cr,cr,(0,se.j)(_r,_r,e))}p.getVec(e,ur),or(ur,d,wr);const n=Mr(t,cr,wr.cosAngle,d,lr);if((0,se.c)(cr,cr,wr.normal,n),d.applyProjection(cr,dr),dr[0]>-1){_&&(_r[0]||_r[1])&&(dr[0]+=_r[0]*d.pixelRatio,0!==_r[1]&&(dr[1]+=lr.alignmentEvaluator.apply(_r[1])*d.pixelRatio),d.unapplyProjection(dr,cr)),dr[0]+=t.screenOffset[0]*d.pixelRatio,dr[1]+=t.screenOffset[1]*d.pixelRatio,dr[0]=Math.floor(dr[0]),dr[1]=Math.floor(dr[1]),y.getVec(e,Ar),lr.evaluator.applyVec2(Ar,Ar);const r=Cr*d.pixelRatio;let n=0;t.textureIsSignedDistanceField&&(n=Math.min(t.outlineSize,.5*Ar[0])*d.pixelRatio/2),Ar[0]*=C,Ar[1]*=S;const s=m.get(e),a=t.rotation+s;if(ar(u,dr[0],dr[1],Ar,r,n,a,t,v)){const t=i.ray;if((0,se.p)(fr,cr,(0,A.B8)(gr,d.viewMatrix)),dr[0]=u[0],dr[1]=u[1],d.unprojectFromRenderScreen(dr,cr)){const r=(0,x.vt)();(0,se.d)(r,t.direction);const i=1/(0,se.b)(r);(0,se.j)(r,r,i),o((0,se.B)(t.origin,cr)*i,r,e,fr)}}}}}}function Br(e,t,r){return null==e||null==t.vvSize?{scaleX:r,scaleY:r}:((0,Ot.VC)(vr,t,e),{scaleX:vr[0]*r,scaleY:vr[1]*r})}function Mr(e,t,r,i,n){if(!e.verticalOffset?.screenLength){const i=(0,se.b)(t);return n.update(r,i,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const s=(0,se.b)(t),o=e.screenSizePerspectiveAlignment??e.screenSizePerspective,a=(0,Lt.kE)(i,s,e.verticalOffset,r,o,e.screenSizePerspectiveMinPixelReferenceSize);return n.update(r,s,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),a}class Er{constructor(e,t){this._mainThreadDelegate=t,this._bufferWriters=new Map,this.globalViewingMode=1===e}createRenderCommandBuffer(e=[],t=[]){return{commands:e,transferList:t}}mergeRenderCommandBuffers(e){const t=this.createRenderCommandBuffer();for(const r of e)null!=r&&(t.commands.push(...r.commands),t.transferList.push(...r.transferList));return t}async createTexture(e){const{data:t,parameters:r}=e();return await this._mainThreadDelegate.createTexture(t,r)}async releaseTexture(e){const t=this._destroyTexture(e);return new p(this,t,[])}_destroyTexture(e){return{commands:[{id:"destroy-texture",textureId:e}],transferList:[]}}async createMaterial(e){const{type:t,parameters:r}=e,i=We("material");let n,s;switch(t){case"default":n=new Ee.$U(e.parameters,{spherical:this.globalViewingMode}),s={type:t,materialId:i,parameters:e.parameters};break;case"hud":n=new nr(r,this.globalViewingMode),s={type:t,materialId:i,parameters:e.parameters}}return this._bufferWriters.set(i,n.createBufferWriter()),await this._mainThreadDelegate.createMaterial(s),i}destroyMaterial(e){return{commands:[{id:"destroy-material",materialId:e}],transferList:[]}}updateMaterial(e){return{commands:[{...e,id:"update-material"}],transferList:[]}}async createDirectRenderer(e){return await this._mainThreadDelegate.createDirectRenderer(e),e}async destroyDirectRenderer(e){await this._mainThreadDelegate.destroyDirectRenderer(e)}addDirectRendererGeometry(e,t,r){const{materialId:i}=t;if(null==this._bufferWriters.get(i))throw new Error(`no bufferwriter found for material ${i}`);const{renderGeometryBuffer:n,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.addDirectRendererGeometryBuffer(i,e,n,s,r)}updateDirectRendererGeometry(e,t,r){const{materialId:i}=t;if(null==this._bufferWriters.get(i))throw new Error(`no bufferwriter found for material ${i}`);const{renderGeometryBuffer:n,renderGeometryBufferItems:s}=this.createRenderGeometryBuffer(t,r);return this.updateDirectRendererGeometryBuffer(i,e,n,s,r)}addDirectRendererGeometryBuffer(e,t,r,i,n){const{objectIds:s,visibilities:o}=i;return{commands:[{id:"add-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:i,localOrigin:n}],transferList:[r.data,s.buffer,o.buffer]}}updateDirectRendererGeometryBuffer(e,t,r,i,n){const{objectIds:s,visibilities:o}=i;return{commands:[{id:"update-direct-renderer-geometry-buffer",rendererId:e,groupId:t,renderGeometryBuffer:r,renderGeometryBufferItems:i,localOrigin:n}],transferList:[r.data,s.buffer,o.buffer]}}removeDirectRendererGeometryBuffer(e,t){return{commands:[{id:"remove-direct-renderer-geometry-buffer",rendererId:e,groupId:t}],transferList:[]}}async createLodRenderer(e){const t=We("lod-renderer"),r=new Set,i={levels:e.levels.map(e=>({components:e.components.map(e=>{const t=e.attributes.get("position");if(!t||0===t.indices.length)throw new Error("positions attribute expected");const i=(0,U.tM)(t.indices.length/3),n=new It.j(i,3,t);if(null==this._bufferWriters.get(e.materialId))throw new Error("writer not found");const{renderGeometryBuffer:s}=this.createRenderGeometryBuffer(e,null);return r.add(s.data),{materialId:e.materialId,renderGeometryBuffer:s,boundingInfo:{bbMax:n.bbMax,bbMin:n.bbMin}}}),minScreenSpaceRadius:e.minScreenSpaceRadius}))};return await this._mainThreadDelegate.createLodRenderer(t,i,Array.from(r)),t}destroyLodRenderer(e){return{commands:[{id:"destroy-lod-renderer",rendererId:e}],transferList:[]}}addLodInstances(e,t,r){return{commands:[{id:"add-lod-instances",rendererId:e,groupId:t,data:r}],transferList:[r.featureIds.buffer,r.globalTransforms.buffer,r.localTransforms.buffer,r.visibility.buffer]}}removeLodInstances(e,t){return{commands:[{id:"remove-lod-instances",rendererId:e,groupId:t}],transferList:[]}}updateLodInstancesData(e,t,r){return{commands:[{id:"update-lod-instance-data",rendererId:e,groupId:t,globalTransforms:r}],transferList:[r.buffer]}}updateVisibility(e,t,r){return{commands:[{id:"update-visibility",rendererId:e,groupId:t,visibility:r}],transferList:[r.buffer]}}async dispatchRenderCommands(e){0!==e.commands.length&&await this._mainThreadDelegate.executeRenderCommands(e)}createRenderGeometryBuffer(e,t){const{materialId:r,visibilities:i,objectIds:n}=e,s=this._bufferWriters.get(r);if(null==s)throw new Error("no registered bufferWriter for material found");let o=null;if(e.transformation&&t)(0,A.C)(Or,e.transformation),Or[12]-=t[0],Or[13]-=t[1],Or[14]-=t[2],o=Or;else{if(t)throw new Error("not implemented");e.transformation&&(o=e.transformation)}let a=null;o&&((0,A.B8)(Rr,Or),(0,A.mg)(Rr,Rr),a=Rr);const l=e.attributes,c=s.elementCount(l),u=s.layout,d=u.stride/4;c>Math.floor(Dr/d)&&console.warn("geometry with very large number of elements encountered");const h=u.createBuffer(c),f=s.write(o,a,l,e.olidColor,h,0);if(null==f)throw new Error("Bufferwriter.write does not provide item information.");if(i.length!==f.numItems||n.length!==f.numItems)throw new Error("Unexpected mismatch between number of RenderGeometryBufferItems and provided objectIds/visibility flags.");return{renderGeometryBuffer:{data:h.buffer,elementCount:c},renderGeometryBufferItems:{objectIds:n,visibilities:i,ranges:{numVertices:f.numVerticesPerItem,numItems:f.numItems}}}}async setBaseInstance(e,t){await this._mainThreadDelegate.setBaseInstance(e,t)}}const Or=(0,v.vt)(),Rr=(0,v.vt)(),Dr=4194304;var Fr=r(98764),jr=r(65806);const Vr=(0,x.vt)();var zr=r(53966),Lr=r(4341),Ur=r(11964),Nr=r(44280),Gr=r(32114);const qr=()=>zr.A.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");function Hr(e=li){return{plane:(0,le.vt)(e.plane),origin:(0,x.o8)(e.origin),basis1:(0,x.o8)(e.basis1),basis2:(0,x.o8)(e.basis2)}}function kr(e,t=Hr()){return Zr(e.origin,e.basis1,e.basis2,t)}function Zr(e,t,r,i=Hr()){return(0,se.d)(i.origin,e),(0,se.d)(i.basis1,t),(0,se.d)(i.basis2,r),$r(i),function(e,t){Math.abs((0,se.g)(e.basis1,e.basis2)/((0,se.b)(e.basis1)*(0,se.b)(e.basis2)))>1e-6&&qr().warn(t,"Provided basis vectors are not perpendicular"),Math.abs((0,se.g)(e.basis1,ii(e)))>1e-6&&qr().warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-(0,se.g)(ii(e),e.origin)-e.plane[3])>1e-6&&qr().warn(t,"Plane offset is not consistent with plane origin")}(i,"fromValues()"),i}function $r(e){(0,le.mR)(e.basis2,e.basis1,e.origin,e.plane)}function Yr(e,t,r){e!==r&&kr(e,r);const i=(0,se.j)(Gr.rq.get(),ii(e),t);return(0,se.i)(r.origin,r.origin,i),r.plane[3]-=t,r}function Xr(e,t=Hr()){const r=(e[2]-e[0])/2,i=(e[3]-e[1])/2;return(0,se.h)(t.origin,e[0]+r,e[1]+i,0),(0,se.h)(t.basis1,r,0,0),(0,se.h)(t.basis2,0,i,0),(0,le.fA)(0,0,1,0,t.plane),t}function Wr(e,t,r){return!!(0,le.Ui)(e.plane,t,r)&&ni(e,r)}function Jr(e,t,r){const i=ci.get();ai(e,t,i,ci.get());let n=Number.POSITIVE_INFINITY;for(const s of fi){const o=oi(e,s,ui.get()),a=Gr.rq.get();if((0,le.T7)(i,o,a)){const e=(0,se.C)(Gr.rq.get(),t.origin,a),i=Math.abs((0,E.XM)((0,se.g)(t.direction,e)));i<n&&(n=i,(0,se.d)(r,a))}}return n===Number.POSITIVE_INFINITY?Qr(e,t,r):r}function Qr(e,t,r){if(Wr(e,t,r))return r;const i=ci.get(),n=ci.get();ai(e,t,i,n);let s=Number.POSITIVE_INFINITY;for(const o of fi){const a=oi(e,o,ui.get()),l=Gr.rq.get();if((0,le.gv)(i,a,l)){const e=(0,ce.kb)(t,l);if(!(0,le.Tj)(n,l))continue;e<s&&(s=e,(0,se.d)(r,l))}}return ti(e,t.origin)<s&&Kr(e,t.origin,r),r}function Kr(e,t,r){const i=(0,le._I)(e.plane,t,Gr.rq.get()),n=(0,Ur.H6)(si(e,e.basis1),i,-1,1,Gr.rq.get()),s=(0,Ur.H6)(si(e,e.basis2),i,-1,1,Gr.rq.get());return(0,se.e)(r,(0,se.i)(Gr.rq.get(),n,s),e.origin),r}function ei(e,t,r){const{origin:i,basis1:n,basis2:s}=e,o=(0,se.e)(Gr.rq.get(),t,i),a=(0,Nr.gr)(n,o),l=(0,Nr.gr)(s,o),c=(0,Nr.gr)(ii(e),o);return(0,se.h)(r,a,l,c)}function ti(e,t){const r=ei(e,t,Gr.rq.get()),{basis1:i,basis2:n}=e,s=(0,se.b)(i),o=(0,se.b)(n),a=Math.max(Math.abs(r[0])-s,0),l=Math.max(Math.abs(r[1])-o,0),c=r[2];return a*a+l*l+c*c}function ri(e,t){const r=-e.plane[3];return(0,Nr.gr)(ii(e),t)-r}function ii(e){return(0,le.Qj)(e.plane)}function ni(e,t){const r=(0,se.e)(Gr.rq.get(),t,e.origin),i=(0,se.D)(e.basis1),n=(0,se.D)(e.basis2),s=(0,se.g)(e.basis1,r),o=(0,se.g)(e.basis2,r);return-s-i<0&&s-i<0&&-o-n<0&&o-n<0}function si(e,t){const r=ui.get();return(0,se.d)(r.origin,e.origin),(0,se.d)(r.vector,t),r}function oi(e,t,r){const{basis1:i,basis2:n,origin:s}=e,o=(0,se.j)(Gr.rq.get(),i,t.origin[0]),a=(0,se.j)(Gr.rq.get(),n,t.origin[1]);(0,se.i)(r.origin,o,a),(0,se.i)(r.origin,r.origin,s);const l=(0,se.j)(Gr.rq.get(),i,t.direction[0]),c=(0,se.j)(Gr.rq.get(),n,t.direction[1]);return(0,se.j)(r.vector,(0,se.i)(l,l,c),2),r}function ai(e,t,r,i){const n=ii(e);(0,le.mR)(n,t.direction,t.origin,r),(0,le.mR)((0,le.Qj)(r),n,t.origin,i)}const li={plane:(0,le.vt)(),origin:(0,x.fA)(0,0,0),basis1:(0,x.fA)(1,0,0),basis2:(0,x.fA)(0,1,0)},ci=new Lr.I(le.vt),ui=new Lr.I(Ur.vt),di=(0,x.vt)(),hi=new Lr.I(()=>Hr()),fi=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],pi=(0,v.vt)(),mi=(0,v.vt)(),yi=Object.freeze(Object.defineProperty({__proto__:null,altitudeAt:ri,axisAt:function(e,t,r,i){return function(e,t,r){switch(t){case 0:(0,se.d)(r,e.basis1),(0,se.n)(r,r);break;case 1:(0,se.d)(r,e.basis2),(0,se.n)(r,r);break;case 2:(0,se.d)(r,ii(e))}return r}(e,r,i)},cameraFrustumCoverage:function(e,t){return(t-e)/t},closestPoint:Qr,closestPointOnSilhouette:Jr,copy:kr,copyWithoutVerify:function(e,t){(0,se.d)(t.origin,e.origin),(0,se.d)(t.basis1,e.basis1),(0,se.d)(t.basis2,e.basis2),(0,le.C)(t.plane,e.plane)},create:Hr,distance:function(e,t){return Math.sqrt(ti(e,t))},distance2:ti,distanceToSilhouette:function(e,t){let r=Number.NEGATIVE_INFINITY;for(const i of fi){const n=oi(e,i,ui.get()),s=(0,Ur.kb)(n,t);s>r&&(r=s)}return Math.sqrt(r)},elevate:Yr,equals:function(e,t){return(0,se.m)(e.basis1,t.basis1)&&(0,se.m)(e.basis2,t.basis2)&&(0,se.m)(e.origin,t.origin)},extrusionContainsPoint:function(e,t){return(0,le.mN)(e.plane,t)>0&&ni(e,t)},fromAABoundingRect:Xr,fromValues:Zr,getExtent:function(e,t){const r=e.basis1[0],i=e.basis2[1],[n,s]=e.origin;return(0,I.fA)(n-r,s-i,n+r,s+i,t)},intersectRay:Wr,intersectRayClosestSilhouette:function(e,t,r){if(Wr(e,t,r))return r;const i=Jr(e,t,Gr.rq.get());return(0,se.i)(r,t.origin,(0,se.j)(Gr.rq.get(),t.direction,(0,se.B)(t.origin,i)/(0,se.b)(t.direction))),r},normal:ii,projectPoint:Kr,projectPointLocal:ei,rotate:function(e,t,r,i){return e!==i&&kr(e,i),(0,A.$0)(mi,t,r),(0,se.p)(i.basis1,e.basis1,mi),(0,se.p)(i.basis2,e.basis2,mi),$r(i),i},setAltitudeAt:function(e,t,r,i){const n=ri(e,t),s=(0,se.j)(di,ii(e),r-n);return(0,se.i)(i,t,s),i},setExtent:function(e,t,r){return Xr(t,r),Yr(r,ri(e,e.origin),r),r},transform:function(e,t,r){return e!==r&&kr(e,r),(0,A.B8)(pi,t),(0,A.mg)(pi,pi),(0,se.p)(r.basis1,e.basis1,pi),(0,se.p)(r.basis2,e.basis2,pi),(0,se.p)((0,le.Qj)(r.plane),(0,le.Qj)(e.plane),pi),(0,se.p)(r.origin,e.origin,t),(0,le.mP)(r.plane,r.plane,r.origin),r},up:li,updateUnboundedPlane:$r,wrap:function(e,t,r){const i=hi.get();return i.origin=e,i.basis1=t,i.basis2=r,i.plane=(0,le.LV)(0,0,0,0),$r(i),i}},Symbol.toStringTag,{value:"Module"}));var gi=r(94008);function bi(e,t,r=function(e){return{operations:e,value:e.create()}}(e)){return r.operations=e,e.copy(t,r.value),r}const _i=2**50;function vi(e,t,r,i){return e.operations.setAltitudeAt(e.value,t,r,i)}function xi(e,t,r){return e.operations.elevate(e.value,t,r.value)}const wi=(0,x.vt)();function Ci(e){return"point"===e.type}(0,x.vt)();class Si{constructor(e,t,r,i){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=r,this._coordinateSystem=i,this._tmpCoordinateSystem=function(e){const{value:t,operations:r}=e;return{operations:r,value:r.create(t)}}(i),this.referenceEllipsoid=(0,ue.tO)(t),this.sphericalPCPF=(0,Fr.lO)(t)}set extent(e){e&&function(e,t,r){e.operations.setExtent(e.value,t,r.value)}(this._coordinateSystem,e,this._coordinateSystem)}get extent(){return e=this._coordinateSystem,t=(0,I.vt)(),e.operations.getExtent(e.value,t),t;var e,t}getAltitude(e){return function(e,t){return e.operations.altitudeAt(e.value,t)}(this._coordinateSystem,e)}setAltitude(e,t,r=e){return vi(this._coordinateSystem,r,t,e)}setAltitudeOfTransformation(e,t){var r,i,n,s;r=this._coordinateSystem,n=e,(i=t)!==(s=t)&&(0,A.C)(s,i),(0,se.h)(wi,s[12],s[13],s[14]),vi(r,wi,n,wi),s[12]=wi[0],s[13]=wi[1],s[14]=wi[2]}worldUpAtPosition(e,t){return function(e,t,r){return e.operations.axisAt(e.value,t,2,r)}(this._coordinateSystem,e,t)}worldBasisAtPosition(e,t,r){return function(e,t,r,i){return e.operations.axisAt(e.value,t,r,i)}(this._coordinateSystem,e,t,r)}basisMatrixAtPosition(e,t){const r=this.worldBasisAtPosition(e,0,Gr.rq.get()),i=this.worldBasisAtPosition(e,1,Gr.rq.get()),n=this.worldBasisAtPosition(e,2,Gr.rq.get());return(0,A.hZ)(t,r[0],r[1],r[2],0,i[0],i[1],i[2],0,n[0],n[1],n[2],0,0,0,0,1),t}headingAtPosition(e,t){const r=this.worldUpAtPosition(e,Gr.rq.get()),i=this.worldBasisAtPosition(e,1,Gr.rq.get()),n=(0,Nr.EJ)(t,i,r);return(0,E.KJ)(n)}intersectManifoldClosestSilhouette(e,t,r){return xi(this._coordinateSystem,t,this._tmpCoordinateSystem),function(e,t,r){e.operations.intersectRayClosestSilhouette(e.value,t,r)}(this._tmpCoordinateSystem,e,r),r}intersectManifold(e,t,r){xi(this._coordinateSystem,t,this._tmpCoordinateSystem);const i=Gr.rq.get();return function(e,t,r){return e.operations.intersectRay(e.value,t,r)}(this._tmpCoordinateSystem,e,i)?(0,se.d)(r,i):null}intersectInfiniteManifold(e,t,r){if(1===this.viewingMode)return this.intersectManifold(e,t,r);xi(this._coordinateSystem,t,this._tmpCoordinateSystem);const i=this._tmpCoordinateSystem.value,n=Gr.rq.get();return(0,le.Ui)(i.plane,e,n)?(0,se.d)(r,n):null}toRenderCoords(e,t,r){return Ci(e)?(0,jr.g)(e,t,this.spatialReference):(0,j.F)(e,t,r,this.spatialReference)}fromRenderCoords(e,t,r=null){return Ci(t)?(null!=r&&(t.spatialReference=r),function(e,t,r){return!!(0,j.F)(e,t,Vr,r.spatialReference)&&(r.x=Vr[0],r.y=Vr[1],r.z=Vr[2],!0)}(e,this.spatialReference,t)?t:null):(0,j.F)(e,this.spatialReference,t,r)?t:null}static create(e,t){switch(e){case 2:return new Si(2,t,(0,S.GA)(t),bi(yi,Zr([0,0,0],[_i,0,0],[0,_i,0])));case 1:return new Si(1,t,1,function(e){return bi(gi.XG,new gi.iy(0,0,0,(0,ue.tO)(e).radius))}(t))}}static renderUnitScaleFactor(e,t){return(0,S.KX)(e)/(0,S.KX)(t)}}let Ai=class extends n.nJ{constructor(){super(...arguments),this.remoteClient=null,this._featureStore=new ut,this._tileLocks=new nt,this._tileManager=null,this._renderer=null,this._fetcher=null,this._queryEngine=null,this._defaultQueryJSON=null,this._mainThreadDelegate=null,this._viewSpatialReference=null,this._renderCommandContext=null,this._context=null}get updating(){return this._tileManager.updating}destroy(){this._featureStore.clear(),this._tileManager?.destroy()}async setup({viewSpatialReference:e,renderSpatialReference:t,viewingMode:r,layerInfo:i,layerViewInfo:n}){const s=u.A.fromJSON(e);this._viewSpatialReference=s;const a=u.A.fromJSON(t);this._fetcher=new Pt(this._viewSpatialReference,h.A.fromJSON(i.baseQuery),i.url,i.objectIdField,i.capabilities),this._queryEngine=new d.do({hasZ:!0,hasM:!1,geometryType:"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:i.objectIdField},fieldsIndex:i.fieldIndex,availableFields:[i.objectIdField],spatialReference:e,featureStore:this._featureStore,timeInfo:i.timeInfo}),this._mainThreadDelegate={createTexture:async(e,t)=>{const r={data:e,parameters:t};return await this.remoteClient.invoke("createTexture",r,{transferList:[e.buffer]})},releaseTexture:async e=>{const t={uid:e};await this.remoteClient.invoke("releaseTexture",t)},createMaterial:async e=>{const t={materialJSON:e};await this.remoteClient.invoke("createMaterial",t)},destroyMaterial:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyMaterial",t)},createDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("createDirectRenderer",t)},destroyDirectRenderer:async e=>{const t={materialId:e};await this.remoteClient.invoke("destroyDirectRenderer",t)},createLodRenderer:async(e,t,r)=>{const i={rendererId:e,lodRenderGeometry:t};await this.remoteClient.invoke("createLoDRenderer",i,{transferList:r})},destroyLodRenderer:async e=>{const t={rendererId:e};await this.remoteClient.invoke("destroyLoDRenderer",t)},executeRenderCommands:async e=>{const t={commands:e.commands};await this.remoteClient.invoke("dispatchRenderCommands",t,{transferList:e.transferList})},applyElevationAlignmentTo:async e=>{const t={mapPoints:e};return await this.remoteClient.invoke("applyElevationAlignment",t,{transferList:[e.buffer]})},setBaseInstance:async(e,t)=>{const r={rendererId:e,baseInstance:t};await this.remoteClient.invoke("setBaseInstance",r,{transferList:null!=t?[t.data]:void 0})}};const f=Si.create(r,a),p=new Er(r,this._mainThreadDelegate);this._renderCommandContext=p;const m=new Ue(s,a,this._mainThreadDelegate,f,p,i,n);this._context=m,this._renderer=m.symbolRendererFactory.createSymbolRendererFromJSON(i.renderer),this._defaultQueryJSON=new h.A({outSpatialReference:s}).toJSON();let y=null;if(null!=i.fullExtent){const e=l.A.fromJSON(i.fullExtent);await(0,c.initializeProjection)(e.spatialReference,s),y=(0,c.project)(e,s)}return this._tileManager=new Ke({loadTile:(e,t)=>this._fetcher.fetch(e,t),createAddCommand:(e,t)=>this._createAddFeatureDataCommand(e,t),createRemoveCommand:e=>this._createRemoveFeatureDataCommand(e),createUpdateCommand:(e,t)=>this._createUpdateFeatureDataVisibilityCommand(e,t),tileLocks:this._tileLocks,extent:y}),this.addHandles((0,o.wB)(()=>this.updating,e=>{this.emit("notify-updating",{updating:e})}),o.Vh),null!=this._renderer&&await this._renderer.load(),Pi}async executeQuery(e,t){return{result:await this._queryEngine.executeQuery(this._ensureQuery(e),t)}}async executeQueryForIds(e,t){const r=await this._queryEngine.executeQueryForIdSet(this._ensureQuery(e),t);return{result:Array.from(r)}}async executeQueryForCount(e,t){return{result:await this._queryEngine.executeQueryForCount(this._ensureQuery(e),t)}}async executeQueryForExtent(e,t){return{result:await this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t)}}async executeQueryForLatestObservations(e,t){return{result:await this._queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),t)}}async executeAttributeBinsQuery(e,t){return{result:await this._queryEngine.executeAttributeBinsQuery(e,t)}}onTileTreeChange(e){return this._tileManager.onTileTreeChange(e),Promise.resolve(Pi)}async onElevationChange(e){return Pi}async onLayerViewOpacityChange(e){const{_context:t,_renderer:r}=this;if(t.layerViewInfo.fullOpacity=e,null==r)return Pi;const i=await r.createUpdateLayerViewOpacityCommand(e);return await i.execute(),Pi}async onRendererChange(e){const{_context:t}=this,r=t.symbolRendererFactory.createSymbolRendererFromJSON(e);await r.load();const n=this._renderer;this._renderer=r;const s=[...this._tileManager.loadedTiles()],o=s.map(e=>e.tileId);{const e={stack:[],error:void 0,hasError:!1};try{(0,i.mS)(e,await this._tileLocks.lock(o),!1);const a=s.flatMap(e=>[n.createRemoveCommand(e.id),r.createAddCommand(e)]),l=await Promise.all(a),c=t.joinPipelineCommands(l);await c.execute()}catch(t){e.error=t,e.hasError=!0}finally{(0,i.hk)(e)}}const a=await n.createDestroyCommand();return await a.execute(),Pi}async _createAddFeatureDataCommand(e,t){const r=this._featureStore,i=this._renderer;let n;return n=null!=i?await i.createAddCommand(e):p.create(this._renderCommandContext),(0,s.Te)(t),n.appendPipelineStateCommand(()=>{r.addTile(e)}),n}async _createRemoveFeatureDataCommand(e){const t=this._featureStore,r=this._renderer;let i;return i=null!=r?await r.createRemoveCommand(e):p.create(this._renderCommandContext),i.appendPipelineStateCommand(()=>{t.removeTile(e)}),i}async _createUpdateFeatureDataVisibilityCommand(e,t){const r=this._renderer;let i;return i=null!=r?await r.createUpdateVisibilityCommand(e):p.create(this._renderCommandContext),(0,s.Te)(t),i}_ensureQuery(e){return e??this._defaultQueryJSON}};(0,i.Cg)([(0,a.MZ)()],Ai.prototype,"updating",null),Ai=(0,i.Cg)([(0,a.$K)("esri.views.3d.layers.graphics.pipeline.Feature3DPipelineWorker")],Ai);const Ti=Ai,Pi={result:void 0}},47522:(e,t,r)=>{r.d(t,{K:()=>s});var i=r(32976),n=r(31821);function s(e){e.uniforms.add(new i.o("alignPixelEnabled",e=>e.alignPixelEnabled)),e.code.add(n.H`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) {
275
262
  if (!alignPixelEnabled)
276
263
  return clipCoord;
277
264
  vec2 xy = vec2(0.500123) + 0.5 * clipCoord.xy / clipCoord.w;
@@ -311,4 +298,4 @@ gl_Position = posProjCenter;
311
298
  gl_PointSize = 1.0;`),o.main.add(s.H`fragColor = vec4(1);
312
299
  if(discardByTerrainDepth()) {
313
300
  fragColor.g = 0.5;
314
- }`)}},65215:(e,t,r)=>{r.d(t,{H:()=>i,R:()=>n});class i{constructor(e){this.layerViewUid=e}}class n extends i{constructor(e,t){super(e),this.graphicUid=t}}},65494:(e,t,r)=>{r.d(t,{L:()=>l,r:()=>o});var i=r(67076),n=r(90360),s=r(41214);function o(e,t){return l(e,null,t)}const a=(0,n.C)({types:s.Hg});function l(e,t,r){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(r?.messages&&r.messages.push(new i.A("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):a(e,t,r):null}},65864:(e,t,r)=>{r.d(t,{rS:()=>u,xD:()=>h});var i=r(5443),n=r(91075),s=r(48526),o=r(86738),a=r(39829),l=r(82799),c=r(60408);function u(e){return null==e?null:e instanceof n.A?e:(0,c.fT)(e)?o.A.fromJSON(e):(0,c.Rg)(e)?l.A.fromJSON(e):(0,c.Bi)(e)?a.A.fromJSON(e):(0,c.U9)(e)?s.A.fromJSON(e):(0,c.ZC)(e)?i.A.fromJSON(e):null}const d={esriGeometryPoint:o.A,esriGeometryPolyline:l.A,esriGeometryPolygon:a.A,esriGeometryEnvelope:i.A,esriGeometryMultipoint:s.A,esriGeometryMultiPatch:a.A};function h(e){return e&&d[e]||null}},72385:(e,t,r)=>{function i(){return new Float32Array(3)}function n(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function s(e,t,r){const i=new Float32Array(3);return i[0]=e,i[1]=t,i[2]=r,i}function o(){return i()}function a(){return s(1,1,1)}function l(){return s(1,0,0)}function c(){return s(0,1,0)}function u(){return s(0,0,1)}r.d(t,{fA:()=>s,o8:()=>n,vt:()=>i});const d=o(),h=a(),f=l(),p=c(),m=u();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_X:f,UNIT_Y:p,UNIT_Z:m,ZEROS:d,clone:n,create:i,fromValues:s,ones:a,unitX:l,unitY:c,unitZ:u,zeros:o},Symbol.toStringTag,{value:"Module"}))},73681:(e,t,r)=>{r.d(t,{n:()=>l});var i=r(49186),n=r(53966),s=r(46140),o=r(95466),a=r(55674);class l{static async from(e,t,r){const o=e.dictionary_version?s.A.parse(e.dictionary_version):null,u=new Set(e.itemsNames),d={};if(t)for(const e in t)d[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)d.hasOwnProperty(t.name)||(d[t.name]=t.value);const h=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))h.delete(e);h.size&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:h});const f=await(0,a.xR)(e.expression,null,d);if(!f)throw new i.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const p=!o||!o.greaterEqual(4,0);p&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const m=new c(r,p);return new l(p,u,f,m)}constructor(e,t,r,i){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=i}get itemNames(){return this._itemNames}evaluate(e,t,r,i){try{return this._reader.bind(e,r,i),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new o.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new o.A(t)}}class c extends a.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},75503:(e,t,r)=>{r.d(t,{EC:()=>A,wq:()=>a});var i=r(4576),n=r(21818),s=(r(44208),r(15142)),o=r(11006);class a{constructor(e=9,t){this._compareMinX=h,this._compareMinY=f,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),w.prune(),C.prune(),S.prune()}all(e){l(this._data,e)}search(e,t){let r=this._data;const i=this._toBBox;if(_(e,r))for(x.clear();r;){for(let n=0,s=r.children.length;n<s;n++){const s=r.children[n],o=r.leaf?i(s):s;_(e,o)&&(r.leaf?t(s):b(e,o)?l(s,t):x.push(s))}r=x.pop()}}collides(e){let t=this._data;const r=this._toBBox;if(!_(e,t))return!1;for(x.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],s=t.leaf?r(n):n;if(_(e,s)){if(t.leaf||b(e,s))return!0;x.push(n)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new P([]),this}remove(e){if(!e)return this;let t,r=this._data,s=null,o=0,a=!1;const l=this._toBBox(e);for(C.clear(),S.clear();r||C.length>0;){if(r||(r=C.pop(),s=C.data[C.length-1],o=S.pop()??0,a=!0),r.leaf&&(t=(0,i.qh)(r.children,(0,n.z)(e),r.children.length,r.indexHint),-1!==t))return r.children.splice(t,1),C.push(r),this._condense(C),this;a||r.leaf||!b(r,l)?s?(o++,r=s.children[o],a=!1):r=null:(C.push(r),S.push(o),o=0,s=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,r,i){const n=r-t+1;let s=this._maxEntries;if(n<=s){const i=new P(e.slice(t,r+1));return c(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(s)),s=Math.ceil(n/s**(i-1)));const o=new I([]);o.height=i;const a=Math.ceil(n/s),l=a*Math.ceil(Math.sqrt(s));v(e,t,r,l,this._compareMinX);for(let n=t;n<=r;n+=l){const t=Math.min(n+l-1,r);v(e,n,t,a,this._compareMinY);for(let r=n;r<=t;r+=a){const n=Math.min(r+a-1,t);o.children.push(this._build(e,r,n,i-1))}}return c(o,this._toBBox),o}_insert(e,t,r){const i=this._toBBox,n=r?e:i(e);C.clear();const s=function(e,t,r,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==r;){let r,i=1/0,n=1/0;for(let s=0,o=t.children.length;s<o;s++){const o=t.children[s],a=p(o),l=y(e,o)-a;l<n?(n=l,i=a<i?a:i,r=o):l===n&&a<i&&(i=a,r=o)}t=r||t.children[0]}return t}(n,this._data,t,C);for(s.children.push(e),d(s,n);t>=0&&C.data[t].children.length>this._maxEntries;)this._split(C,t),t--;!function(e,t,r){for(let i=r;i>=0;i--)d(t.data[i],e)}(n,C,t)}_split(e,t){const r=e.data[t],i=r.children.length,n=this._minEntries;this._chooseSplitAxis(r,n,i);const s=this._chooseSplitIndex(r,n,i);if(!s)return;const o=r.children.splice(s,r.children.length-s),a=r.leaf?new P(o):new I(o);a.height=r.height,c(r,this._toBBox),c(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(r,a)}_splitRoot(e,t){this._data=new I([e,t]),this._data.height=e.height+1,c(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let i,n,s;i=n=1/0;for(let o=t;o<=r-t;o++){const t=u(e,0,o,this._toBBox),a=u(e,o,r,this._toBBox),l=g(t,a),c=p(t)+p(a);l<i?(i=l,s=o,n=c<n?c:n):l===i&&c<n&&(n=c,s=o)}return s}_chooseSplitAxis(e,t,r){const i=e.leaf?this._compareMinX:h,n=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,r,i)<this._allDistMargin(e,t,r,n)&&e.children.sort(i)}_allDistMargin(e,t,r,i){e.children.sort(i);const n=this._toBBox,s=u(e,0,t,n),o=u(e,r-t,r,n);let a=m(s)+m(o);for(let i=t;i<r-t;i++){const t=e.children[i];d(s,e.leaf?n(t):t),a+=m(s)}for(let i=r-t-1;i>=t;i--){const t=e.children[i];d(o,e.leaf?n(t):t),a+=m(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(0===r.children.length)if(t>0){const n=e.data[t-1],s=n.children;s.splice((0,i.qh)(s,r,s.length,n.indexHint),1)}else this.clear();else c(r,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let r=e;for(w.clear();r;){if(!0===r.leaf)for(const e of r.children)t((0,n.z)(e));else w.pushArray(r.children);r=w.pop()??null}}function c(e,t){u(e,0,e.children.length,t,e)}function u(e,t,r,i,n){n||(n=new P([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let s,o=t;o<r;o++)s=e.children[o],d(n,e.leaf?i(s):s);return n}function d(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function p(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function y(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){const r=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,n-r)*Math.max(0,s-i)}function b(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e,t,r,i,n){const s=[t,r];for(;s.length;){const t=s.pop(),r=s.pop();if(t-r<=i)continue;const a=r+Math.ceil((t-r)/i/2)*i;(0,o.q)(e,a,r,t,n),s.push(r,a,a,t)}}const x=new s.A,w=new s.A,C=new s.A,S=new s.A({deallocator:void 0});class A{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class T extends A{constructor(){super(...arguments),this.height=1,this.indexHint=new i.vW}}class P extends T{constructor(e){super(),this.children=e,this.leaf=!0}}class I extends T{constructor(e){super(),this.children=e,this.leaf=!1}}},76357:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(31635),n=r(66552),s=r(25482),o=r(91429),a=r(93223);const l=new n.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends s.o{constructor(e){super(e),this.name=null,this.type=null}};(0,i.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,i.Cg)([(0,a.e)(l),(0,o.MZ)({json:{write:{isRequired:!0}}})],c.prototype,"type",void 0),c=(0,i.Cg)([(0,o.$K)("esri.layers.support.Domain")],c)},77548:(e,t,r)=>{r.d(t,{Gh:()=>g,tk:()=>f,BR:()=>h,wI:()=>d,G$:()=>m,$x:()=>p,Ov:()=>l,UC:()=>s,W_:()=>c,OP:()=>y,TU:()=>a,XX:()=>o,jy:()=>u});var i=r(70333),n=r(11254);function s(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph-sublayer"===e.type}r(7762),r(84952),r(36563),r(36708),r(4146),new WeakMap,r(16215);const o={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function a(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function l(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function c(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function u(e){return function(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)}async function d(e,t){const r=i.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const s=e.toLowerCase().indexOf("/rest/services");if(-1===s)return null;const o=`${e.slice(0,s)}/rest/info`,a=null!=t?t.signal:null,{data:l}=await(0,n.A)(o,{query:{f:"json"},responseType:"json",signal:a});return l?.owningSystemUrl||null}function h(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function f(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function p(e,t){return null}function m(e){return null}function y(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function g(e,t){if(!t||!y(e))return;const r=(e.url,null);r&&(e.url=r)}},79677:(e,t,r)=>{r.d(t,{A:()=>d});var i,n=r(31635),s=r(25482),o=r(88930),a=r(91429),l=r(98623),c=r(36005),u=r(43937);let d=class extends s.o{static{i=this}static get allTime(){return h}static get empty(){return f}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===i&&r===n}expandTo(e,t=l.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.lL)(r,e,t));let n=this.end;if(n){const r=(0,o.lL)(n,e,t);n=n.getTime()===r.getTime()?r:(0,o.S1)(r,1,e,t)}return new i({start:r,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,s=e.end?.getTime()??1/0;let o,a;return n>=t&&n<=r?o=n:t>=n&&t<=s&&(o=t),r>=n&&r<=s?a=r:s>=t&&s<=r&&(a=s),null==o||null==a||isNaN(o)||isNaN(a)?i.empty:new i({start:o===-1/0?null:new Date(o),end:a===1/0?null:new Date(a)})}offset(e,t,r=l.qU){if(this.isEmpty||this.isAllTime)return this.clone();const n=new i,{start:s,end:a}=this;return null!=s&&(n.start=(0,o.S1)(s,e,t,r)),null!=a&&(n.end=(0,o.S1)(a,e,t,r)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return h.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,n.Cg)([(0,c.w)("end")],d.prototype,"readEnd",null),(0,n.Cg)([(0,u.K)("end")],d.prototype,"writeEnd",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,n.Cg)([(0,c.w)("start")],d.prototype,"readStart",null),(0,n.Cg)([(0,u.K)("start")],d.prototype,"writeStart",null),d=i=(0,n.Cg)([(0,a.$K)("esri.time.TimeExtent")],d);const h=new d,f=new d({start:void 0,end:void 0})},81961:(e,t,r)=>{r.d(t,{V:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",2,(i,n,s)=>i.setUniform4fv(e,t(n,s),r))}}},82094:(e,t,r)=>{r.d(t,{Z:()=>i});const i=r(31821).H`vec4(0.0, 0.0, 2.0, 1.0)`},87582:(e,t,r)=>{r(6867),r(65215).R},95696:(e,t,r)=>{r.d(t,{A:()=>c});var i,n=r(31635),s=r(69540),o=r(25482),a=r(91429),l=r(93223);let c=class extends((0,s.OU)(o.o)){static{i=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new i}};(0,n.Cg)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],c.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],c.prototype,"origin",void 0),c=i=(0,n.Cg)([(0,a.$K)("esri.geometry.support.MeshGeoreferencedVertexSpace")],c)},96576:(e,t,r)=>{r.d(t,{A:()=>d});var i,n=r(31635),s=r(4718),o=r(91429),a=r(92438),l=r(63988),c=r(49849),u=r(93223);let d=i=class extends((0,l.h)(a.A)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.symbols.map(r=>r.collectRequiredFields(e,t)))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}get symbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){return this.symbols.reduce((e,t)=>e+JSON.stringify(t),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new i({description:this.description,label:this.label,symbol:(0,s.o8)(this.symbol),visualVariables:(0,s.o8)(this.visualVariables),authoringInfo:(0,s.o8)(this.authoringInfo)})}};(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],d.prototype,"description",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],d.prototype,"label",void 0),(0,n.Cg)([(0,o.MZ)(c.Wp)],d.prototype,"symbol",void 0),(0,n.Cg)([(0,u.e)({simple:"simple"})],d.prototype,"type",void 0),d=i=(0,n.Cg)([(0,o.$K)("esri.renderers.SimpleRenderer")],d)},98453:(e,t,r)=>{r.d(t,{m:()=>i});const i=new(r(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})}}]);
301
+ }`)}},65215:(e,t,r)=>{r.d(t,{H:()=>i,R:()=>n});class i{constructor(e){this.layerViewUid=e}}class n extends i{constructor(e,t){super(e),this.graphicUid=t}}},65494:(e,t,r)=>{r.d(t,{L:()=>l,r:()=>o});var i=r(67076),n=r(90360),s=r(41214);function o(e,t){return l(e,null,t)}const a=(0,n.C)({types:s.Hg});function l(e,t,r){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(r?.messages&&r.messages.push(new i.A("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):a(e,t,r):null}},65864:(e,t,r)=>{r.d(t,{rS:()=>u,xD:()=>h});var i=r(5443),n=r(91075),s=r(48526),o=r(86738),a=r(39829),l=r(82799),c=r(60408);function u(e){return null==e?null:e instanceof n.A?e:(0,c.fT)(e)?o.A.fromJSON(e):(0,c.Rg)(e)?l.A.fromJSON(e):(0,c.Bi)(e)?a.A.fromJSON(e):(0,c.U9)(e)?s.A.fromJSON(e):(0,c.ZC)(e)?i.A.fromJSON(e):null}const d={esriGeometryPoint:o.A,esriGeometryPolyline:l.A,esriGeometryPolygon:a.A,esriGeometryEnvelope:i.A,esriGeometryMultipoint:s.A,esriGeometryMultiPatch:a.A};function h(e){return e&&d[e]||null}},72385:(e,t,r)=>{function i(){return new Float32Array(3)}function n(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function s(e,t,r){const i=new Float32Array(3);return i[0]=e,i[1]=t,i[2]=r,i}function o(){return i()}function a(){return s(1,1,1)}function l(){return s(1,0,0)}function c(){return s(0,1,0)}function u(){return s(0,0,1)}r.d(t,{fA:()=>s,o8:()=>n,vt:()=>i});const d=o(),h=a(),f=l(),p=c(),m=u();Object.freeze(Object.defineProperty({__proto__:null,ONES:h,UNIT_X:f,UNIT_Y:p,UNIT_Z:m,ZEROS:d,clone:n,create:i,fromValues:s,ones:a,unitX:l,unitY:c,unitZ:u,zeros:o},Symbol.toStringTag,{value:"Module"}))},73681:(e,t,r)=>{r.d(t,{n:()=>l});var i=r(49186),n=r(53966),s=r(46140),o=r(95466),a=r(55674);class l{static async from(e,t,r){const o=e.dictionary_version?s.A.parse(e.dictionary_version):null,u=new Set(e.itemsNames),d={};if(t)for(const e in t)d[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)d.hasOwnProperty(t.name)||(d[t.name]=t.value);const h=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))h.delete(e);h.size&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:h});const f=await(0,a.xR)(e.expression,null,d);if(!f)throw new i.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const p=!o||!o.greaterEqual(4,0);p&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const m=new c(r,p);return new l(p,u,f,m)}constructor(e,t,r,i){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=i}get itemNames(){return this._itemNames}evaluate(e,t,r,i){try{return this._reader.bind(e,r,i),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new o.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new o.A(t)}}class c extends a.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},75503:(e,t,r)=>{r.d(t,{EC:()=>A,wq:()=>a});var i=r(4576),n=r(21818),s=(r(44208),r(15142)),o=r(11006);class a{constructor(e=9,t){this._compareMinX=h,this._compareMinY=f,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),w.prune(),C.prune(),S.prune()}all(e){l(this._data,e)}search(e,t){let r=this._data;const i=this._toBBox;if(_(e,r))for(x.clear();r;){for(let n=0,s=r.children.length;n<s;n++){const s=r.children[n],o=r.leaf?i(s):s;_(e,o)&&(r.leaf?t(s):b(e,o)?l(s,t):x.push(s))}r=x.pop()}}collides(e){let t=this._data;const r=this._toBBox;if(!_(e,t))return!1;for(x.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],s=t.leaf?r(n):n;if(_(e,s)){if(t.leaf||b(e,s))return!0;x.push(n)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,r=e.length;t<r;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new P([]),this}remove(e){if(!e)return this;let t,r=this._data,s=null,o=0,a=!1;const l=this._toBBox(e);for(C.clear(),S.clear();r||C.length>0;){if(r||(r=C.pop(),s=C.data[C.length-1],o=S.pop()??0,a=!0),r.leaf&&(t=(0,i.qh)(r.children,(0,n.z)(e),r.children.length,r.indexHint),-1!==t))return r.children.splice(t,1),C.push(r),this._condense(C),this;a||r.leaf||!b(r,l)?s?(o++,r=s.children[o],a=!1):r=null:(C.push(r),S.push(o),o=0,s=r,r=r.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,r,i){const n=r-t+1;let s=this._maxEntries;if(n<=s){const i=new P(e.slice(t,r+1));return c(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(s)),s=Math.ceil(n/s**(i-1)));const o=new I([]);o.height=i;const a=Math.ceil(n/s),l=a*Math.ceil(Math.sqrt(s));v(e,t,r,l,this._compareMinX);for(let n=t;n<=r;n+=l){const t=Math.min(n+l-1,r);v(e,n,t,a,this._compareMinY);for(let r=n;r<=t;r+=a){const n=Math.min(r+a-1,t);o.children.push(this._build(e,r,n,i-1))}}return c(o,this._toBBox),o}_insert(e,t,r){const i=this._toBBox,n=r?e:i(e);C.clear();const s=function(e,t,r,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==r;){let r,i=1/0,n=1/0;for(let s=0,o=t.children.length;s<o;s++){const o=t.children[s],a=p(o),l=y(e,o)-a;l<n?(n=l,i=a<i?a:i,r=o):l===n&&a<i&&(i=a,r=o)}t=r||t.children[0]}return t}(n,this._data,t,C);for(s.children.push(e),d(s,n);t>=0&&C.data[t].children.length>this._maxEntries;)this._split(C,t),t--;!function(e,t,r){for(let i=r;i>=0;i--)d(t.data[i],e)}(n,C,t)}_split(e,t){const r=e.data[t],i=r.children.length,n=this._minEntries;this._chooseSplitAxis(r,n,i);const s=this._chooseSplitIndex(r,n,i);if(!s)return;const o=r.children.splice(s,r.children.length-s),a=r.leaf?new P(o):new I(o);a.height=r.height,c(r,this._toBBox),c(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(r,a)}_splitRoot(e,t){this._data=new I([e,t]),this._data.height=e.height+1,c(this._data,this._toBBox)}_chooseSplitIndex(e,t,r){let i,n,s;i=n=1/0;for(let o=t;o<=r-t;o++){const t=u(e,0,o,this._toBBox),a=u(e,o,r,this._toBBox),l=g(t,a),c=p(t)+p(a);l<i?(i=l,s=o,n=c<n?c:n):l===i&&c<n&&(n=c,s=o)}return s}_chooseSplitAxis(e,t,r){const i=e.leaf?this._compareMinX:h,n=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,r,i)<this._allDistMargin(e,t,r,n)&&e.children.sort(i)}_allDistMargin(e,t,r,i){e.children.sort(i);const n=this._toBBox,s=u(e,0,t,n),o=u(e,r-t,r,n);let a=m(s)+m(o);for(let i=t;i<r-t;i++){const t=e.children[i];d(s,e.leaf?n(t):t),a+=m(s)}for(let i=r-t-1;i>=t;i--){const t=e.children[i];d(o,e.leaf?n(t):t),a+=m(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const r=e.data[t];if(0===r.children.length)if(t>0){const n=e.data[t-1],s=n.children;s.splice((0,i.qh)(s,r,s.length,n.indexHint),1)}else this.clear();else c(r,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let r=e;for(w.clear();r;){if(!0===r.leaf)for(const e of r.children)t((0,n.z)(e));else w.pushArray(r.children);r=w.pop()??null}}function c(e,t){u(e,0,e.children.length,t,e)}function u(e,t,r,i,n){n||(n=new P([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let s,o=t;o<r;o++)s=e.children[o],d(n,e.leaf?i(s):s);return n}function d(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function p(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function y(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){const r=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),s=Math.min(e.maxY,t.maxY);return Math.max(0,n-r)*Math.max(0,s-i)}function b(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function v(e,t,r,i,n){const s=[t,r];for(;s.length;){const t=s.pop(),r=s.pop();if(t-r<=i)continue;const a=r+Math.ceil((t-r)/i/2)*i;(0,o.q)(e,a,r,t,n),s.push(r,a,a,t)}}const x=new s.A,w=new s.A,C=new s.A,S=new s.A({deallocator:void 0});class A{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class T extends A{constructor(){super(...arguments),this.height=1,this.indexHint=new i.vW}}class P extends T{constructor(e){super(),this.children=e,this.leaf=!0}}class I extends T{constructor(e){super(),this.children=e,this.leaf=!1}}},76357:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(31635),n=r(66552),s=r(25482),o=r(91429),a=r(93223);const l=new n.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends s.o{constructor(e){super(e),this.name=null,this.type=null}};(0,i.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,i.Cg)([(0,a.e)(l),(0,o.MZ)({json:{write:{isRequired:!0}}})],c.prototype,"type",void 0),c=(0,i.Cg)([(0,o.$K)("esri.layers.support.Domain")],c)},77548:(e,t,r)=>{r.d(t,{Gh:()=>g,tk:()=>f,BR:()=>h,wI:()=>d,G$:()=>m,$x:()=>p,Ov:()=>l,UC:()=>s,W_:()=>c,OP:()=>y,TU:()=>a,XX:()=>o,jy:()=>u});var i=r(70333),n=r(11254);function s(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph-sublayer"===e.type}r(7762),r(84952),r(36563),r(36708),r(4146),new WeakMap,r(16215);const o={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function a(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function l(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function c(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function u(e){return function(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)}async function d(e,t){const r=i.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const s=e.toLowerCase().indexOf("/rest/services");if(-1===s)return null;const o=`${e.slice(0,s)}/rest/info`,a=null!=t?t.signal:null,{data:l}=await(0,n.A)(o,{query:{f:"json"},responseType:"json",signal:a});return l?.owningSystemUrl||null}function h(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function f(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function p(e,t){return null}function m(e){return null}function y(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function g(e,t){if(!t||!y(e))return;const r=(e.url,null);r&&(e.url=r)}},79677:(e,t,r)=>{r.d(t,{A:()=>d});var i,n=r(31635),s=r(25482),o=r(88930),a=r(91429),l=r(98623),c=r(36005),u=r(43937);let d=class extends s.o{static{i=this}static get allTime(){return h}static get empty(){return f}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===i&&r===n}expandTo(e,t=l.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.lL)(r,e,t));let n=this.end;if(n){const r=(0,o.lL)(n,e,t);n=n.getTime()===r.getTime()?r:(0,o.S1)(r,1,e,t)}return new i({start:r,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,s=e.end?.getTime()??1/0;let o,a;return n>=t&&n<=r?o=n:t>=n&&t<=s&&(o=t),r>=n&&r<=s?a=r:s>=t&&s<=r&&(a=s),null==o||null==a||isNaN(o)||isNaN(a)?i.empty:new i({start:o===-1/0?null:new Date(o),end:a===1/0?null:new Date(a)})}offset(e,t,r=l.qU){if(this.isEmpty||this.isAllTime)return this.clone();const n=new i,{start:s,end:a}=this;return null!=s&&(n.start=(0,o.S1)(s,e,t,r)),null!=a&&(n.end=(0,o.S1)(a,e,t,r)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return h.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,n.Cg)([(0,c.w)("end")],d.prototype,"readEnd",null),(0,n.Cg)([(0,u.K)("end")],d.prototype,"writeEnd",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,n.Cg)([(0,c.w)("start")],d.prototype,"readStart",null),(0,n.Cg)([(0,u.K)("start")],d.prototype,"writeStart",null),d=i=(0,n.Cg)([(0,a.$K)("esri.time.TimeExtent")],d);const h=new d,f=new d({start:void 0,end:void 0})},82094:(e,t,r)=>{r.d(t,{Z:()=>i});const i=r(31821).H`vec4(0.0, 0.0, 2.0, 1.0)`},87582:(e,t,r)=>{r(6867),r(65215).R},95696:(e,t,r)=>{r.d(t,{A:()=>c});var i,n=r(31635),s=r(69540),o=r(25482),a=r(91429),l=r(93223);let c=class extends((0,s.OU)(o.o)){static{i=this}constructor(e){super(e),this.type="georeferenced",this.origin=null}static{this.absolute=new i}};(0,n.Cg)([(0,l.e)({georeferenced:"georeferenced"},{readOnly:!0})],c.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)({type:[Number],nonNullable:!1,json:{write:!0}})],c.prototype,"origin",void 0),c=i=(0,n.Cg)([(0,a.$K)("esri.geometry.support.MeshGeoreferencedVertexSpace")],c)},96576:(e,t,r)=>{r.d(t,{A:()=>d});var i,n=r(31635),s=r(4718),o=r(91429),a=r(92438),l=r(63988),c=r(49849),u=r(93223);let d=i=class extends((0,l.h)(a.A)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.symbols.map(r=>r.collectRequiredFields(e,t)))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}get symbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){return this.symbols.reduce((e,t)=>e+JSON.stringify(t),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new i({description:this.description,label:this.label,symbol:(0,s.o8)(this.symbol),visualVariables:(0,s.o8)(this.visualVariables),authoringInfo:(0,s.o8)(this.authoringInfo)})}};(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],d.prototype,"description",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],d.prototype,"label",void 0),(0,n.Cg)([(0,o.MZ)(c.Wp)],d.prototype,"symbol",void 0),(0,n.Cg)([(0,u.e)({simple:"simple"})],d.prototype,"type",void 0),d=i=(0,n.Cg)([(0,o.$K)("esri.renderers.SimpleRenderer")],d)},98453:(e,t,r)=>{r.d(t,{m:()=>i});const i=new(r(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})}}]);