@arcgis/core 5.0.0-next.17 → 5.0.0-next.19

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 (192) hide show
  1. package/AttributeBinsGraphic.js +1 -1
  2. package/analysis/ElevationProfile/ElevationProfileLineGround.js +1 -1
  3. package/analysis/ElevationProfile/ElevationProfileLineInput.js +1 -1
  4. package/analysis/ElevationProfile/ElevationProfileLineQuery.js +1 -1
  5. package/analysis/ElevationProfile/ElevationProfileLineScene.js +1 -1
  6. package/arcade/featureSetUtils.js +1 -1
  7. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  8. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  9. package/arcade/featureset/sources/FeatureLayerOGC.js +5 -0
  10. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  11. package/arcade/featureset/support/FeatureSet.js +1 -1
  12. package/arcade/featureset/support/shared.js +1 -1
  13. package/assets/esri/core/workers/RemoteClient.js +1 -1
  14. package/assets/esri/core/workers/chunks/057d59ee6144e5890780.js +1 -0
  15. package/assets/esri/core/workers/chunks/{adf7ccf4ef629211c7ee.js → 08aacbfb651cc2e1c054.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{31b5900119dd7cd9e7d3.js → 0a6ad58ca4ca0cba2fa0.js} +1 -1
  17. package/assets/esri/core/workers/chunks/0d8d3d0de49064971874.js +1 -0
  18. package/assets/esri/core/workers/chunks/{b87bc987983b31c13f64.js → 0f1b9d69961dad0b922f.js} +1 -1
  19. package/assets/esri/core/workers/chunks/110cc01dd6af7ee125d4.js +1 -0
  20. package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +1 -0
  21. package/assets/esri/core/workers/chunks/{5f6df4a3376b52ead53f.js → 14f994b1dd682bf2d61a.js} +1 -1
  22. package/assets/esri/core/workers/chunks/3538eb39ebb58acedd67.js +1 -0
  23. package/assets/esri/core/workers/chunks/{658cd45b5fb304fd840a.js → 3aa77696c5ea54a238da.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{49571d6875de1f2e7e25.js → 4b9dfdc23ba3d6ebcc1b.js} +2 -2
  25. package/assets/esri/core/workers/chunks/{02a22dd6d208a925cc5a.js → 52cf643621662712dc85.js} +1 -1
  26. package/assets/esri/core/workers/chunks/5755b11272b777507612.js +1 -0
  27. package/assets/esri/core/workers/chunks/{d69265ceabfa92b40bb7.js → 58969dde8c3d0b2a9829.js} +1 -1
  28. package/assets/esri/core/workers/chunks/6e4829b52ade3e41ccc4.js +1 -0
  29. package/assets/esri/core/workers/chunks/{4a89e120be142ab58a27.js → 7224b321606116fd691c.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{888f188541f8bd68e33e.js → 72f1c3d97e7b9546c113.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{a4518f25b9f8fe704286.js → 76e945da8f30d8641c3d.js} +4 -4
  32. package/assets/esri/core/workers/chunks/{257f17b3836a623a9dbe.js → 795b09ff7a8f4e91f4dc.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{3ac7562ea90f91a9f30c.js → 82b2741e75c2e9b88252.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{5d2e5774768d8f290343.js → b656e8fd374113523404.js} +1 -1
  35. package/assets/esri/core/workers/chunks/bccb9ac572bc093fb177.js +1 -0
  36. package/assets/esri/core/workers/chunks/{79dbfa2b9b332ca0002f.js → c52161b94c0fb071747e.js} +1 -1
  37. package/assets/esri/core/workers/chunks/db76958fd9f54b6bd324.js +1 -0
  38. package/assets/esri/core/workers/chunks/e61d7762b56e36dc7e8a.js +1 -0
  39. package/assets/esri/core/workers/chunks/{b30897952494a3e5b9fe.js → e69c2b613bd0210e25ba.js} +1 -1
  40. package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +1 -0
  41. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  42. package/chunks/GlowComposition.glsl.js +46 -46
  43. package/chunks/ImageMaterial.glsl.js +1 -1
  44. package/chunks/ShadedColorMaterial.glsl.js +10 -10
  45. package/config.js +1 -1
  46. package/editing/templateUtils.js +1 -1
  47. package/interfaces.d.ts +167 -51
  48. package/intl/locale.js +1 -1
  49. package/kernel.js +1 -1
  50. package/layers/BingMapsLayer.js +1 -1
  51. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  52. package/layers/PointCloudLayer.js +1 -1
  53. package/layers/SceneLayer.js +1 -1
  54. package/layers/VideoLayer.js +1 -1
  55. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  56. package/layers/mixins/SceneService.js +1 -1
  57. package/layers/ogc/ogcFeatureUtils.js +1 -1
  58. package/libs/parquet/parquet.js +1 -1
  59. package/package.json +1 -1
  60. package/renderers/support/RasterSymbolizer.js +1 -1
  61. package/rest/support/QueryMixin.js +1 -1
  62. package/support/revision.js +1 -1
  63. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  64. package/symbols/cim/cimAnalyzer.js +1 -1
  65. package/undoredo/support/ServiceVersionInfo.js +1 -1
  66. package/undoredo/support/Services.js +1 -1
  67. package/views/2d/LabelManager.js +1 -1
  68. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  69. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  70. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  71. package/views/2d/engine/webgl/animations/store/AnimationStore.js +1 -1
  72. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
  73. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  74. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  75. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  76. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  77. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  78. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  79. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterHighlightShader.js +5 -0
  80. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterRangeHighlightShader.js +1 -1
  81. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterXYBandHighlightShader.js +5 -0
  82. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  83. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
  84. package/views/2d/engine/webgl/textureUtils.js +1 -1
  85. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  86. package/views/2d/layers/features/FeatureContainer.js +1 -1
  87. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  88. package/views/3d/GroundView3D.js +1 -1
  89. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  90. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  91. package/views/3d/analysis/images/Factory.js +1 -1
  92. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  93. package/views/3d/environment/EnvironmentManager.js +1 -1
  94. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  95. package/views/3d/environment/SunLighting.js +1 -1
  96. package/views/3d/environment/VirtualLighting.js +1 -1
  97. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  98. package/views/3d/layers/DrapedSubView3D.js +1 -1
  99. package/views/3d/layers/FlowSubView3D.js +1 -1
  100. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  101. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  102. package/views/3d/layers/MediaLayerView3D.js +1 -1
  103. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  104. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  105. package/views/3d/layers/SceneLayerView3D.js +1 -1
  106. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  107. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  108. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  109. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  110. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  111. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  112. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  113. package/views/3d/support/QualityProfile.js +5 -0
  114. package/views/3d/support/QualitySettings.js +1 -1
  115. package/views/3d/support/StreamTextureCollection.js +1 -1
  116. package/views/3d/support/TextureCollection.js +1 -1
  117. package/views/3d/support/engineContent/marker.js +1 -1
  118. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  119. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  120. package/views/3d/terrain/OverlayRenderer.js +1 -1
  121. package/views/3d/terrain/TerrainSurface.js +1 -1
  122. package/views/3d/terrain/TileCompositor.js +1 -1
  123. package/views/3d/webgl-engine/Stage.js +1 -1
  124. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  125. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  126. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  127. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  128. package/views/3d/webgl-engine/core/material/RenderTexture.js +1 -1
  129. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  130. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  131. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  132. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  133. package/views/3d/webgl-engine/lib/AnimationTimeStep.js +1 -1
  134. package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
  135. package/views/3d/webgl-engine/lib/DDSUtil.js +1 -1
  136. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  137. package/views/3d/webgl-engine/lib/ManagedTexture.js +5 -0
  138. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  139. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  140. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  141. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  142. package/views/3d/webgl-engine/lib/TextTextureFactory.js +1 -1
  143. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  144. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  145. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  146. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  147. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  148. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  149. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  150. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  151. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  152. package/views/GroundView.js +1 -1
  153. package/views/SceneView.js +1 -1
  154. package/views/support/layerViewUtils.js +1 -1
  155. package/views/webgl/Texture.js +1 -1
  156. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  157. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  158. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  159. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  160. package/widgets/Editor/VisibleElements.js +1 -1
  161. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  162. package/widgets/Editor/workflowUtils.js +1 -1
  163. package/widgets/Editor.js +1 -1
  164. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  165. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  166. package/widgets/FeatureTable/FieldColumn.js +1 -1
  167. package/widgets/FeatureTable/Grid/Column.js +1 -1
  168. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  169. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  170. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  171. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  172. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  173. package/widgets/OrientedImageryViewer.js +1 -1
  174. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  175. package/widgets/smartMapping/SizeSlider.js +1 -1
  176. package/widgets/support/SelectionList/VisibleElements.js +1 -1
  177. package/widgets/support/SelectionList.js +1 -1
  178. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  179. package/assets/esri/core/workers/chunks/080268f78436a2f0d996.js +0 -1
  180. package/assets/esri/core/workers/chunks/18474c017ddacd1d3d2c.js +0 -1
  181. package/assets/esri/core/workers/chunks/27e6a6c5610007ac6a54.js +0 -1
  182. package/assets/esri/core/workers/chunks/5415fbcc7ed203fc5575.js +0 -1
  183. package/assets/esri/core/workers/chunks/631fb2e62e48f8be4051.js +0 -1
  184. package/assets/esri/core/workers/chunks/722da7a39a0ad9300752.js +0 -1
  185. package/assets/esri/core/workers/chunks/9595aabbaf411eceea1e.js +0 -1
  186. package/assets/esri/core/workers/chunks/a470f662d73aa8d5d90f.js +0 -1
  187. package/assets/esri/core/workers/chunks/a57751f3d78524c876cd.js +0 -1
  188. package/assets/esri/core/workers/chunks/ac366221e8636b60aee5.js +0 -1
  189. package/assets/esri/core/workers/chunks/dec336700cfb83abbbeb.js +0 -1
  190. package/views/3d/support/DisplayQualityProfile.js +0 -5
  191. package/views/3d/webgl-engine/lib/Texture.js +0 -5
  192. /package/views/3d/webgl-engine/lib/{ITexture.js → IManagedTexture.js} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3081],{159:(e,t,n)=>{n.d(t,{A:()=>u});var i,r=n(31635),s=n(69622),o=n(10107),l=(n(44208),n(53966),n(87811),n(64108)),a=n(99157);let u=i=class extends s.A{constructor(e){super(e),this.steps=[]}getInverse(){const e=new i;for(let t=this.steps.length-1;t>=0;t--){const n=this.steps[t];e.steps.push(n.getInverse())}return e}};(0,r.Cg)([(0,o.MZ)({type:[a.A],nonNullable:!0})],u.prototype,"steps",void 0),u=i=(0,r.Cg)([(0,l.$)("esri.geometry.operators.support.GeographicTransformation")],u)},8303:(e,t,n)=>{n.d(t,{A:()=>S});var i=n(31635),r=n(92602),s=n(70333),o=n(11254),l=n(60999),a=n(49186),u=n(53966),c=n(97768),p=n(74887),d=n(84952),h=n(10107),f=(n(44208),n(87811),n(36005)),g=n(64108),y=n(43937),m=n(77548),v=n(20655),b=n(80812),M=n(41318),w=n(10407);const S=e=>{const t=e;let S=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,n){if(t.itemId)return new b.default({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await n.e(1204).then(n.bind(n,41204));return(0,p.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,p.QP)(e),!0)))}async setUserPrivileges(e,t){if(!r.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:n,fullEdit:i},content:{updateItem:r}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",r)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let n=this.portalItem;if(!e||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!s.id?.findCredential(this.url),r=e===n.id;if(r&&n.portal.user)return this._getUserPrivileges(n,i);let o,l;if(r)o=n.portal.url;else try{o=await(0,m.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!o||!(0,d.b8)(o,n.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;l=await(s.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const a=!0,u=!1,c=!1;if(!l)return{features:{edit:a,fullEdit:u},content:{updateItem:c}};try{if(r?await n.reload():(n=new b.default({id:e,portal:{url:o}}),await n.load(t)),n.portal.user)return this._getUserPrivileges(n,i)}catch(e){(0,p.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:c}}}_getUserPrivileges(e,t){const n=(0,w.It)(e);return t&&(n.features.edit=!0),n}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const n=x.credential===t?x.user:await this._fetchEditingUser(e);return x.credential=t,x.user=n,null==n?.privileges||n.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const n=s.id?.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const i=`${n.owningSystemUrl}/sharing/rest`,r=v.A.getDefault();if(r&&r.loaded&&(0,d.S8)(r.restUrl)===(0,d.S8)(i))return r.user;const a=`${i}/community/self`,u=null!=e?e.signal:null,c=await(0,l.Ke)((0,o.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?M.A.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const n=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return n&&i&&!(0,d.ut)(i.restUrl,n.restUrl)?(t.messages&&t.messages.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i.Cg)([(0,h.MZ)({type:b.default})],S.prototype,"portalItem",null),(0,i.Cg)([(0,f.w)("web-document","portalItem",["itemId"])],S.prototype,"readPortalItem",null),(0,i.Cg)([(0,y.K)("web-document","portalItem",{itemId:{type:String}})],S.prototype,"writePortalItem",null),(0,i.Cg)([(0,h.MZ)({clonable:!1})],S.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],S.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],S.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],S.prototype,"userHasUpdateItemPrivileges",void 0),S=(0,i.Cg)([(0,g.$)("esri.layers.mixins.PortalLayer")],S),S},x={credential:null,user:null}},9762:(e,t,n)=>{n.r(t),n.d(t,{projectBuffer:()=>r});var i=n(37539);function r(e,t,n,r,s,o,l=Math.floor(e.length/3)){const a=(0,i.jd)(t,s);if(null==a)return!1;if(a===i.pO){if(e===r&&n===o)return!0;const t=n+3*l;for(let i=n,s=o;i<t;i++,s++)r[s]=e[i];return!0}const u=n+3*l;for(let t=n,i=o;t<u;t+=3,i+=3)a(e,t,r,i);return!0}},10184:(e,t,n)=>{n.d(t,{A:()=>p});var i=n(31635),r=n(69540),s=n(25482),o=n(88930),l=n(10107),a=(n(44208),n(53966),n(87811),n(93223)),u=n(64108),c=n(73133);let p=class extends((0,r.OU)(s.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,o.t)(this.value,this.unit,"milliseconds")}};(0,i.Cg)([(0,a.e)(c.j,{nonNullable:!0})],p.prototype,"unit",void 0),(0,i.Cg)([(0,l.MZ)({type:Number,json:{write:!0},nonNullable:!0})],p.prototype,"value",void 0),p=(0,i.Cg)([(0,u.$)("esri.time.TimeInterval")],p)},10407:(e,t,n)=>{n.d(t,{It:()=>h,LG:()=>o,OM:()=>u,Sm:()=>c,Y:()=>l,bK:()=>a,mm:()=>d,sQ:()=>p});var i=n(91218),r=n(16930),s=n(28735);function o(e,t){if(!l(e,t)){const n=e.typeKeywords;n?n.push(t):e.typeKeywords=[t]}}function l(e,t){return!!e.typeKeywords?.includes(t)}function a(e){return l(e,d.HOSTED_SERVICE)}function u(e,t){const n=e.typeKeywords;if(n){const e=n.indexOf(t);e>-1&&n.splice(e,1)}}function c(e,t,n){n?o(e,t):u(e,t)}async function p(e){const t=e.clone().normalize();let n;if(t.length>1)for(const e of t)n?e.width>n.width&&(n=e):n=e;else n=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,s.ci)(e);const n=r.A.WGS84;return await(0,i.initializeProjection)(t,n),(0,i.project)(e,n)}(n)}const d={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function h(e){const{portal:t,isOrgItem:n,itemControl:i}=e,r=t.user?.privileges;let s=!r||r.includes("features:user:edit"),o=!!n&&!!r?.includes("features:user:fullEdit");const l="update"===i||"admin"===i;return l?o=s=!0:o&&(s=!0),{features:{edit:s,fullEdit:o},content:{updateItem:l}}}},18768:(e,t,n)=>{n.d(t,{b:()=>a});var i=n(31635),r=n(53966),s=n(10107),o=(n(44208),n(87811),n(64108)),l=n(60694);const a=e=>{const t=e;let n=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Jf)(e,r.A.getLogger(this)))}};return(0,i.Cg)([(0,s.MZ)()],n.prototype,"title",null),(0,i.Cg)([(0,s.MZ)({type:String})],n.prototype,"url",null),n=(0,i.Cg)([(0,o.$)("esri.layers.mixins.ArcGISService")],n),n}},21005:(e,t,n)=>{n.r(t),n.d(t,{default:()=>He});var i=n(31635),r=n(37838),s=n(7762),o=n(49186),l=n(53966),a=n(25728),u=n(74887),c=n(10107),p=n(56507),d=(n(44208),n(87811),n(36005)),h=n(64108),f=n(38954),g=n(51850),y=n(5443),m=n(60950),v=n(89808),b=n(99959);const M=Symbol("isVoxelGraphicOrigin");var w;class S extends b.A{get[(w=M,m.ym)](){return this.layer}get[v.Q](){return this.layer}constructor(e){super(),this[w]=!0,this.type="voxel",this.layer=e}get id(){return this.layer.id}}var x=n(4146),C=n(52136),A=n(18768),j=n(69208),I=n(16131),Z=n(8303),R=n(25036),T=n(58947),P=n(60694),V=n(10873),z=n(20437),N=n(95466),F=n(96184),_=n(69540),O=n(69052),q=n(25482),L=n(87024),E=n(67026),U=n(82534),$=n(34304);const D=(0,g.vt)(),k=(0,U.vt)(),B=(0,U.vt)(),H=(0,U.vt)(),G=(0,g.fA)(0,0,1),J=(0,g.fA)(0,1,0),W=(0,g.fA)(1,0,0);function Y(e){(0,f.d)(D,e),(0,f.n)(D,D);const t=Math.atan2(D[1],D[0]),n=(0,E.x8)((0,U.vt)(),G,-t);(0,f.v)(D,D,n);const i=-1*Math.atan2(D[2],D[0]);return[(0,$.ct)(t)+270,(0,$.ct)(i)+90]}function K(e,t){return(0,E.x8)(B,G,(0,$.DF)(e-270)),(0,E.x8)(H,J,(0,$.DF)(t-90)),(0,E.lw)(k,B,H),(0,f.d)(D,W),(0,f.v)(D,D,k),(0,f.n)(D,D),[D[0],D[1],D[2]]}var Q=n(79901);let X=class extends((0,_.OU)(q.o)){constructor(e){super(e),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=Y(this.normal);return O.ie.normalize((0,p.GB)(e),0,!0)}set orientation(e){const t=K(e,this.tilt);this._set("normal",t),this._set("orientation",e)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=Y(this.normal);return O.ie.normalize((0,p.GB)(t),0,!0)}set tilt(e){const t=K(this.orientation,e);this._set("normal",t),this._set("tilt",e)}};(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"enabled",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],X.prototype,"label",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,Q.w)(e=>O.ie.normalize((0,p.GB)(e),0,!0))],X.prototype,"orientation",null),(0,i.Cg)([(0,c.MZ)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,Q.w)(e=>O.ie.normalize((0,p.GB)(e),0,!0))],X.prototype,"tilt",null),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{write:{isRequired:!0}}})],X.prototype,"normal",void 0),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{write:{isRequired:!0}}})],X.prototype,"point",void 0),X=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelSlice")],X);var ee=n(97159);let te=class extends((0,_.OU)(q.o)){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=Y(this.normal);return O.ie.normalize((0,p.GB)(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=Y(this.normal);return O.ie.normalize((0,p.GB)(t),0,!0)}};(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{default:!0,write:!0}})],te.prototype,"enabled",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{origins:{service:{read:ee.r},"web-scene":{write:{isRequired:!0}}},write:!0}}),(0,L.P)({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],te.prototype,"href",void 0),(0,i.Cg)([(0,c.MZ)({type:p.jz,json:{write:{enabled:!0,isRequired:!0}}})],te.prototype,"id",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],te.prototype,"label",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],te.prototype,"orientation",null),(0,i.Cg)([(0,c.MZ)({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],te.prototype,"tilt",null),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],te.prototype,"normal",void 0),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],te.prototype,"point",void 0),(0,i.Cg)([(0,c.MZ)({type:[p.jz],json:{write:{enabled:!0,isRequired:!0}}})],te.prototype,"sizeInPixel",void 0),(0,i.Cg)([(0,c.MZ)({type:[X],json:{write:!0}})],te.prototype,"slices",void 0),(0,i.Cg)([(0,c.MZ)({type:p.jz,json:{default:0,write:!0}})],te.prototype,"timeId",void 0),(0,i.Cg)([(0,c.MZ)({type:p.jz,json:{write:{enabled:!0,isRequired:!0}}})],te.prototype,"variableId",void 0),te=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelSection")],te);let ne=class extends q.o{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};(0,i.Cg)([(0,c.MZ)({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],ne.prototype,"diffuseFactor",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],ne.prototype,"specularFactor",void 0),ne=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelSimpleShading")],ne);let ie=class extends q.o{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};(0,i.Cg)([(0,c.MZ)({type:["discrete","continuous"],json:{write:!0}})],ie.prototype,"continuity",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{write:!0}})],ie.prototype,"hasNoData",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:!0}})],ie.prototype,"noData",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:!0}})],ie.prototype,"offset",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:!0}})],ie.prototype,"scale",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],ie.prototype,"type",void 0),ie=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelFormat")],ie);const re=ie;let se=class extends q.o{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],se.prototype,"id",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],se.prototype,"description",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],se.prototype,"name",void 0),(0,i.Cg)([(0,c.MZ)({type:re,json:{write:!0}})],se.prototype,"originalFormat",void 0),(0,i.Cg)([(0,c.MZ)({type:re,json:{write:{enabled:!0,isRequired:!0}}})],se.prototype,"renderingFormat",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],se.prototype,"unit",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:!0}})],se.prototype,"volumeId",void 0),(0,i.Cg)([(0,c.MZ)({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],se.prototype,"type",void 0),se=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelVariable")],se);const oe=se;var le=n(4718),ae=n(68197);let ue=class extends((0,_.OU)(q.o)){constructor(){super(...arguments),this.color=ae.A.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};(0,i.Cg)([(0,c.MZ)({type:ae.A,json:{type:[p.jz],write:{enabled:!0,isRequired:!0}}})],ue.prototype,"color",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],ue.prototype,"value",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{default:!0,write:!0}})],ue.prototype,"enabled",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ue.prototype,"label",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{default:!1,write:!0}})],ue.prototype,"colorLocked",void 0),ue=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelIsosurface")],ue);var ce=n(62885),pe=n(34727);let de=class extends((0,_.OU)(q.o)){constructor(){super(...arguments),this.color=null,this.position=0}};(0,i.Cg)([(0,c.MZ)({type:ae.A,json:{type:[p.jz],write:{enabled:!0,isRequired:!0}}})],de.prototype,"color",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],de.prototype,"position",void 0),de=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelColorStop")],de);const he=de;let fe=class extends((0,_.OU)(q.o)){constructor(){super(...arguments),this.opacity=1,this.position=0}};(0,i.Cg)([(0,c.MZ)({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],fe.prototype,"opacity",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],fe.prototype,"position",void 0),fe=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelOpacityStop")],fe);const ge=fe;let ye=class extends((0,_.OU)(q.o)){constructor(){super(...arguments),this.enabled=!1,this.range=null}};(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{default:!1,write:!0}})],ye.prototype,"enabled",void 0),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{write:{isRequired:!0}}})],ye.prototype,"range",void 0),ye=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelRangeFilter")],ye);const me=ye;let ve=class extends((0,_.OU)(q.o)){constructor(e){super(e),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(s.A.ofType(he)),this.opacityStops=new(s.A.ofType(ge))}set colorStops(e){this._set("colorStops",(0,ce.V)(e,this._get("colorStops"),s.A.ofType(he)))}set opacityStops(e){this._set("opacityStops",(0,ce.V)(e,this._get("opacityStops"),s.A.ofType(ge)))}getPreviousNext(e,t,n){let i=e;for(;--i>0&&t[i].type!==n&&3!==t[i].type;);let r=e;const s=t.length;for(;++r<s&&t[r].type!==n&&3!==t[r].type;);return[i,r]}get rasterizedTransferFunction(){const e=[];if(this.colorStops.length<2)return e;const t=[],n=[];for(const t of this.colorStops){if(!t.color)return e;n.push({color:{r:t.color.r,g:t.color.g,b:t.color.b,a:Math.round(255*(1-t.color.a))},position:t.position,type:1})}if(0===this.opacityStops.length)for(const e of n)t.push({color:e.color,position:e.position});else{for(const e of this.opacityStops){const t=(0,pe.qE)(e.position,0,1),i=Math.round(255*(0,pe.qE)(1-e.opacity,0,1));let r=!1;for(const e of n)if(1===e.type&&Math.abs(e.position-t)<1e-5){e.color.a=i,e.type=3,r=!0;break}r||n.push({color:{r:0,g:0,b:0,a:i},position:e.position,type:2})}n.sort((e,t)=>e.position<t.position?-1:1);const e=n.length;for(let t=0;t<e;++t){const i=n[t];if(3!==i.type)if(1===i.type){const[r,s]=this.getPreviousNext(t,n,2);if(-1!==r&&s!==e){const e=(i.position-n[r].position)/(n[s].position-n[r].position);i.color.a=Math.round((0,pe.Cc)(n[r].color.a,n[s].color.a,e))}else i.color.a=-1!==r?n[r].color.a:n[s].color.a}else{const[r,s]=this.getPreviousNext(t,n,1);if(-1!==r&&s!==e){const e=(i.position-n[r].position)/(n[s].position-n[r].position),t=n[r].color,o=n[s].color;Me.forEach(n=>{i.color[n]=Math.round((0,pe.Cc)(t[n],o[n],e))})}else-1!==r?Me.forEach(e=>{i.color[e]=n[r].color[e]}):Me.forEach(e=>{i.color[e]=n[s].color[e]})}}for(const e of n)t.push({color:e.color,position:e.position})}t[0].position=0,t[t.length-1].position=1;let i=0,r=1;for(let n=0;n<this._colorMapSize;++n){const s=n/this._colorMapSize;for(;s>t[r].position;)i=r++;const o=(s-t[i].position)/(t[r].position-t[i].position),l=t[i].color,a=t[r].color,u=new ae.A;Me.forEach(e=>{u[e]=Math.round((0,pe.Cc)(l[e],a[e],o))}),u.a=(0,pe.qE)(1-(0,pe.Cc)(l.a,a.a,o)/255,0,1),e.push(u)}return e}getColorForContinuousDataValue(e,t){const n=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||n.length<256)return null;let i=this.stretchRange[0],r=this.stretchRange[1];if(i>r){const e=i;i=r,r=e}e=(0,pe.qE)(e,i,r);const s=n[Math.round((e-i)/(r-i)*(this._colorMapSize-1))].clone();return t||(s.a=1),s}};(0,i.Cg)([(0,c.MZ)({type:["linear","nearest"],json:{write:!0}})],ve.prototype,"interpolation",void 0),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],ve.prototype,"stretchRange",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(he),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],ve.prototype,"colorStops",null),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(ge),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],ve.prototype,"opacityStops",null),(0,i.Cg)([(0,c.MZ)({type:me,json:{write:!0}})],ve.prototype,"rangeFilter",void 0),(0,i.Cg)([(0,c.MZ)({type:[ae.A],clonable:!1,json:{read:!1}})],ve.prototype,"rasterizedTransferFunction",null),ve=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelTransferFunctionStyle")],ve);const be=ve,Me=["r","g","b"];let we=class extends((0,_.OU)(q.o)){constructor(){super(...arguments),this.color=ae.A.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};var Se;(0,i.Cg)([(0,c.MZ)({type:ae.A,json:{type:[p.jz],write:{enabled:!0,isRequired:!0}}})],we.prototype,"color",void 0),(0,i.Cg)([(0,c.MZ)({type:p.jz,json:{write:{enabled:!0,isRequired:!0}}})],we.prototype,"value",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{default:!0,write:!0}})],we.prototype,"enabled",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],we.prototype,"label",void 0),we=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelUniqueValue")],we);let xe=Se=class extends q.o{constructor(e){super(e),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(s.A.ofType(we)),this.isosurfaces=new(s.A.ofType(ue))}clone(){return new Se({variableId:this.variableId,label:this.label,transferFunction:(0,le.o8)(this.transferFunction),uniqueValues:(0,le.o8)(this.uniqueValues),isosurfaces:(0,le.o8)(this.isosurfaces)})}};(0,i.Cg)([(0,c.MZ)({type:p.jz,json:{write:{enabled:!0,isRequired:!0}}})],xe.prototype,"variableId",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],xe.prototype,"label",void 0),(0,i.Cg)([(0,c.MZ)({type:be,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],xe.prototype,"transferFunction",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(we),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],xe.prototype,"uniqueValues",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(ue),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,t=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&t}}}}})],xe.prototype,"isosurfaces",void 0),xe=Se=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelVariableStyle")],xe);var Ce=n(88930),Ae=n(86738),je=n(16930),Ie=n(21325);function Ze(e){const t=/^(days?|hours?|minutes?|seconds?|d|h|m|s) since (\d{1,4})-(\d{1,2})-(\d{1,2})[ |T](\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[\s|Z]?(([+|\-\s?])(\d{1,2}):(\d{1,2}))?$/i.exec(e);if(null==t)return{didParse:!1};const[,n,i,r,s,o,l,a,u,c,p,d,h]=t;let f="seconds";const g=n.charAt(0).toLowerCase();"d"===g?f="days":"h"===g?f="hours":"m"===g&&(f="minutes");const y=parseInt(i,10);if(Number.isNaN(y))return{didParse:!1};const m=parseInt(r,10);if(Number.isNaN(m)||m<1||m>12)return{didParse:!1};const v=parseInt(s,10);if(Number.isNaN(v)||v<1||v>31)return{didParse:!1};if(2===m){const e=y%4==0&&(y%100!=0||y%400==0);if(e&&v>29||!e&&v>28)return{didParse:!1}}else if((4===m||6===m||9===m||11===m)&&v>30)return{didParse:!1};const b=parseInt(o,10);if(Number.isNaN(b)||b<0||b>23)return{didParse:!1};const M=parseInt(l,10);if(Number.isNaN(M)||M<0||M>59)return{didParse:!1};const w=parseInt(a,10);if(Number.isNaN(w)||w<0||w>59)return{didParse:!1};let S=1,x=0,C=0;if(p&&(S="-"===p?-1:1),d){if(x=parseInt(d,10),Number.isNaN(x)||x<0)return{didParse:!1};if(0!==x){const e=S*x;if(e<-12||e>14)return{didParse:!1}}}if(h&&(C=parseInt(h,10),Number.isNaN(C)||C<0||C>59))return{didParse:!1};const A=`${y}`.padStart(4,"0"),j=`${m}`.padStart(2,"0"),I=`${v}`.padStart(2,"0"),Z=`${b}`.padStart(2,"0"),R=`${M}`.padStart(2,"0"),T=`${w}`.padStart(2,"0");let P="Z";return 0===x&&0===C||(P=S>0?"+":"-",P+=`${x}`.padStart(2,"0"),P+=":",P+=`${C}`.padStart(2,"0")),{didParse:!0,unit:f,reference:new Date(`${A}-${j}-${I}T${Z}:${R}:${T}.000${P}`)}}let Re=class extends q.o{constructor(){super(...arguments),this.values=null}};(0,i.Cg)([(0,c.MZ)({type:[Number],json:{write:!0}})],Re.prototype,"values",void 0),Re=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelIrregularSpacing")],Re);const Te=Re;let Pe=class extends q.o{constructor(){super(...arguments),this.scale=1,this.offset=0}};(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:!0}})],Pe.prototype,"scale",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:!0}})],Pe.prototype,"offset",void 0),Pe=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelRegularSpacing")],Pe);const Ve=Pe;let ze=class extends q.o{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(null==this.irregularSpacing||void 0===this.irregularSpacing)&&null!==this.regularSpacing}getRange(){return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray(this.irregularSpacing?.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};(0,i.Cg)([(0,c.MZ)({type:Te,json:{write:!0}})],ze.prototype,"irregularSpacing",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{write:!0}})],ze.prototype,"isPositiveUp",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{write:!0}})],ze.prototype,"isWrappedDateLine",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ze.prototype,"label",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ze.prototype,"name",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ze.prototype,"quantity",void 0),(0,i.Cg)([(0,c.MZ)({type:Ve,json:{write:!0}})],ze.prototype,"regularSpacing",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:!0}})],ze.prototype,"size",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],ze.prototype,"unit",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{read:!1}})],ze.prototype,"isRegular",null),ze=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelDimension")],ze);const Ne=ze;let Fe=class extends q.o{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=je.A.WGS84}get zDimension(){if(!this.dimensions)return-1;if(!Array.isArray(this.dimensions))return-1;if(4!==this.dimensions.length)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!(!this.dimensions||!Array.isArray(this.dimensions)||4!==this.dimensions.length||this.dimensions[0].size<1||this.dimensions[1].size<1||-1===this.zDimension||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),t=this.dimensions[1].getRange(),n=this.dimensions[2],i=n.isRegular?n.getRange():[0,n.size];return[e[0],t[0],i[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||"xyt"===this.volumeType)return[0,0,0];const e=this.dimensions[0].getRange(),t=this.dimensions[1].getRange(),n=this.dimensions[2],i=n.isRegular?n.getRange():[0,n.size],r=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let e=0;e<3;++e)r[e]<2?r[e]=1:r[e]-=1;return n.isRegular&&!n.isPositiveUp&&(r[2]*=-1),[(e[1]-e[0])/r[0],(t[1]-t[0])/r[1],(i[1]-i[0])/r[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0;let t=this.dimensions[3].size>0;if(t){const e=this.dimensions[3];t="time"===e.quantity,t&&null!==e.unit&&(t=Ze(e.unit).didParse)}if(!e&&t)return"xyt";if(e&&t)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}get timeStops(){if("xyzt"!==this.volumeType)return[];const e=this.dimensions[3],t=[],n=Ze(e.unit);if(n.didParse)if(e.isRegular){const i=e.regularSpacing?.offset??0,r=e.regularSpacing?.scale||1;for(let s=0;s<e.size;++s){const e=i+r*s;t.push((0,Ce.mi)(n.reference,e,n.unit))}}else if(Array.isArray(e.irregularSpacing?.values)&&e.irregularSpacing.values.length>0)for(let i=0;i<e.irregularSpacing.values.length;++i){const r=e.irregularSpacing.values[i];t.push((0,Ce.mi)(n.reference,r,n.unit))}return t}computeVoxelSpaceLocation(e){if(!this.isValid)return[0,0,0];if("xyt"===this.volumeType)return l.A.getLogger(this).error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!(0,Ie.aI)(this.spatialReference,e.spatialReference))return l.A.getLogger(this).error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const t=(0,g.fA)(e.x,e.y,e.z??0);(0,f.e)(t,t,this.originInLayerSpace3D),(0,f.D)(t,t,this.voxelSizeInLayerSpaceSigned);const n=this.dimensions[this.zDimension];if(!n.isRegular&&Array.isArray(n.irregularSpacing?.values)&&n.irregularSpacing.values.length>1){const i=e.z??0,r=n.irregularSpacing.values,s=n.isPositiveUp?1:-1,o=r.reduce((e,t)=>Math.abs(s*t-i)<Math.abs(s*e-i)?t:e);for(let e=0;e<r.length;++e)if(r[e]===o){t[2]=e;break}}return[t[0],t[1],t[2]]}computeLayerSpaceLocation(e){if(!this.isValid)return new Ae.A({x:0,y:0,spatialReference:this.spatialReference});const t=(0,g.ci)(e);if((0,f.C)(t,t,this.voxelSizeInLayerSpaceSigned),(0,f.g)(t,t,this.originInLayerSpace3D),"xyt"===this.volumeType)return new Ae.A({x:t[0],y:t[1],spatialReference:this.spatialReference});const n=this.dimensions[this.zDimension];return n.isRegular||Array.isArray(n.irregularSpacing?.values)&&(e[2]<0?t[2]=n.irregularSpacing.values[0]:e[2]<n.irregularSpacing.values.length?t[2]=n.irregularSpacing.values[e[2]]:t[2]=n.irregularSpacing.values[n.irregularSpacing.values.length-1],n.isPositiveUp||(t[2]*=-1)),new Ae.A({x:t[0],y:t[1],z:t[2],spatialReference:this.spatialReference})}};var _e;(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],Fe.prototype,"id",void 0),(0,i.Cg)([(0,c.MZ)({type:[Ne],json:{write:{enabled:!0,isRequired:!0}}})],Fe.prototype,"dimensions",void 0),(0,i.Cg)([(0,c.MZ)({type:je.A,json:{read:{enabled:!1}}})],Fe.prototype,"spatialReference",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{read:!1}})],Fe.prototype,"zDimension",null),(0,i.Cg)([(0,c.MZ)({type:[Boolean],json:{read:!1}})],Fe.prototype,"isValid",null),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{read:!1}})],Fe.prototype,"originInLayerSpace3D",null),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{read:!1}})],Fe.prototype,"voxelSizeInLayerSpaceSigned",null),(0,i.Cg)([(0,c.MZ)({type:["xyz","xyzt","xyt"],json:{read:{enabled:!1}}})],Fe.prototype,"volumeType",null),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{read:!1}})],Fe.prototype,"sizeInVoxels",null),(0,i.Cg)([(0,c.MZ)({type:[Date],json:{read:!1,write:!1}})],Fe.prototype,"timeStops",null),Fe=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelVolume")],Fe);let Oe=_e=class extends q.o{constructor(){super(...arguments),this.apronWidth=1,this.brickSize=[32,32,32],this.maxLodLevel=0,this.nodeSize=[4,4,4]}isValid(){const e=new _e;return e.apronWidth===this.apronWidth&&e.maxLodLevel===this.maxLodLevel&&!!this.brickSize&&!!this.nodeSize&&!(!Array.isArray(this.brickSize)||!Array.isArray(this.nodeSize))&&3===this.brickSize.length&&3===this.nodeSize.length&&32===this.brickSize[0]&&32===this.brickSize[1]&&32===this.brickSize[2]&&4===this.nodeSize[0]&&4===this.nodeSize[1]&&4===this.nodeSize[2]}};(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],Oe.prototype,"apronWidth",void 0),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],Oe.prototype,"brickSize",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],Oe.prototype,"maxLodLevel",void 0),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],Oe.prototype,"nodeSize",void 0),Oe=_e=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelVolumeIndex")],Oe);const qe=Oe;let Le=class extends((0,_.OU)(q.o)){constructor(e){super(e),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=Y(this.normal);return O.ie.normalize((0,p.GB)(e),0,!0)}set orientation(e){const t=K(e,this.tilt);this._set("normal",t),this._set("orientation",e)}get tilt(){if(!Array.isArray(this.normal)||3!==this.normal.length)return 0;const[e,t]=Y(this.normal);return O.ie.normalize((0,p.GB)(t),0,!0)}set tilt(e){const t=K(this.orientation,e);this._set("normal",t),this._set("tilt",e)}};var Ee;(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{default:!0,write:!0}})],Le.prototype,"enabled",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{write:!0}})],Le.prototype,"label",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,Q.w)(e=>O.ie.normalize((0,p.GB)(e),0,!0))],Le.prototype,"orientation",null),(0,i.Cg)([(0,c.MZ)({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),(0,Q.w)(e=>O.ie.normalize((0,p.GB)(e),0,!0))],Le.prototype,"tilt",null),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{write:{isRequired:!0}}})],Le.prototype,"normal",void 0),(0,i.Cg)([(0,c.MZ)({type:[Number],json:{write:{isRequired:!0}}})],Le.prototype,"point",void 0),Le=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelDynamicSection")],Le);let Ue=Ee=class extends q.o{constructor(e){super(e),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(s.A.ofType(X)),this.dynamicSections=new(s.A.ofType(Le))}set slices(e){this._set("slices",(0,ce.V)(e,this._get("slices"),s.A.ofType(X)))}set dynamicSections(e){this._set("dynamicSections",(0,ce.V)(e,this._get("dynamicSections"),s.A.ofType(Le)))}clone(){return new Ee({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:(0,le.o8)(this.slices),dynamicSections:(0,le.o8)(this.dynamicSections)})}};(0,i.Cg)([(0,c.MZ)({type:p.jz,json:{write:{enabled:!0,isRequired:!0}}})],Ue.prototype,"volumeId",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{default:1,write:!0}})],Ue.prototype,"verticalExaggeration",void 0),(0,i.Cg)([(0,c.MZ)({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],Ue.prototype,"exaggerationMode",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{default:0,write:!0}})],Ue.prototype,"verticalOffset",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(X),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],Ue.prototype,"slices",null),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(Le),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],Ue.prototype,"dynamicSections",null),Ue=Ee=(0,i.Cg)([(0,h.$)("esri.layers.voxel.VoxelVolumeStyle")],Ue);var $e=n(30291),De=n(79677),ke=n(10184);let Be=class extends((0,T.w)((0,A.b)((0,I.q)((0,Z.A)((0,R.j)((0,a.P)((0,j.d)((0,C.p)(x.A))))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.graphicOrigin=new S(this),this.shading=new ne,this.opacity=1,this.variables=new s.A,this.volumes=new s.A,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.popupTemplate=null,this.test=null,this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0,this.volumeStyles=new(s.A.ofType(Ue)),this.variableStyles=new(s.A.ofType(xe)),this.sections=new(s.A.ofType(te))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",(0,P.Jf)(e,l.A.getLogger(this)))}load(e){const t=null!=e?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(u.QP).then(()=>this._fetchService(t)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(n),Promise.resolve(this)}read(e,t){super.read(e,t),"service"===t?.origin&&this.version.major<=3&&this.version.minor<=0&&!this.getAtOrigin("popupTemplate","service")&&this.setAtOrigin("popupTemplate",this.createPopupTemplate(),"service");for(const e of this.volumes)e.spatialReference=this.spatialReference}readVersion(e,t){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new o.A("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new o.A("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new o.A("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,t,n){if(null!=e&&"object"==typeof e){const i=y.A.fromJSON(e,n);if(0===i.zmin&&0===i.zmax&&Array.isArray(t.volumes)){const e=Fe.fromJSON(t.volumes[0]);if(e.isValid&&"xyt"!==e.volumeType){const t=e.dimensions[2];if(t.isRegular){let e=t.regularSpacing.offset,n=t.regularSpacing.offset+t.regularSpacing.scale*(t.size-1);if(e>n){const t=e;e=n,n=t}i.zmin=e,i.zmax=n}}}return i}return null}get fields(){const e=[new z.A({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"}),new z.A({name:"Voxel.CurrentVariable",alias:"Current Variable",domain:null,editable:!1,length:128,type:"string"})];for(const t of this.variables){const n=new z.A({name:t.name,alias:t.description,domain:null,editable:!1,length:128,type:"discrete"===t.renderingFormat.continuity?"string":"double"});e.push(n)}const t=this.getVolume(null);if(null!=t){if("xyzt"===t.volumeType||"xyt"===t.volumeType){const t=new z.A({name:"Voxel.LocalTime",alias:"Local Time",domain:null,editable:!1,length:256,type:"date"});e.push(t);const n=new z.A({name:"Voxel.SourceTime",alias:"Source Time",domain:null,editable:!1,length:256,type:"string"});e.push(n)}if("xyt"!==t.volumeType){const t=new z.A({name:"Voxel.Depth",alias:"Depth",domain:null,editable:!1,length:128,type:"double"});e.push(t)}}return e}get fieldsIndex(){return this.loaded?new N.A(this.fields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.fields;return(0,$e.tn)({fields:t,title:"{Voxel.Position}"},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):""}getVariableStyle(e){let t=-1;if(t=null!=e?e:this.currentVariableId,!this.variableStyles||-1===t)return null;const n=this.variableStyles.findIndex(e=>e.variableId===t);return n<0?null:this.variableStyles.at(n)}getVariable(e){let t=-1;if(t=null!=e?e:this.currentVariableId,!this.variables||-1===t)return null;const n=this.variables.findIndex(e=>e.id===t);return n<0?null:this.variables.at(n)}getVolume(e){const t=this.getVariable(e);return null!=t?this.volumes.find(({id:e})=>e===t.volumeId):null}get timeInfo(){const e=this.getVolume(null);if("xyzt"!==e?.volumeType)return null;const t=e.timeStops;if(!t?.length)return null;const n=new De.A({start:t[0],end:t.at(-1)});return new F.A({fullTimeExtent:n,stops:t})}getVolumeStyle(e){const t=this.getVariable(e);return null!=t?this.volumeStyles.find(({volumeId:e})=>e===t.volumeId):null}getColorForContinuousDataValue(e,t,n){const i=this.getVariable(e);if(null==i||"continuous"!==i.renderingFormat?.continuity)return null;if(!this.variableStyles)return null;const r=this.variableStyles.findIndex(t=>t.variableId===e);if(r<0)return null;const s=this.variableStyles.at(r);return s?.transferFunction?s.transferFunction.getColorForContinuousDataValue(t,n):null}getSections(){const e=[];for(const t of this.sections)e.push(new te({enabled:t.enabled,href:t.href,id:t.id,label:t.label,normal:t.normal,point:t.point,sizeInPixel:t.sizeInPixel,slices:t.slices,timeId:t.timeId,variableId:t.variableId}));return e}getVariableStyles(){const e=[];for(const t of this.variableStyles){const n=this._getVariable(t);if(null!=n){const i=t.clone();i.isosurfaces.length>4&&(i.isosurfaces=i.isosurfaces.slice(0,3),l.A.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const e of i.isosurfaces)if(!e.colorLocked){const t=this.getColorForContinuousDataValue(i.variableId,e.value,!1);null==t||t.equals(e.color)||(e.color=t)}if("continuous"===n.renderingFormat.continuity)(null===i.transferFunction||i.transferFunction.colorStops.length<2)&&l.A.getLogger(this).error(`VoxelVariableStyle for variable ${n.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),null!==i.transferFunction&&(Array.isArray(i.transferFunction.stretchRange)&&2===i.transferFunction.stretchRange.length||(l.A.getLogger(this).error(`VoxelVariableStyle for variable ${n.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),i.transferFunction.stretchRange=[0,1],i.transferFunction.colorStops.removeAll()));else if("discrete"===n.renderingFormat.continuity)if(0===t.uniqueValues.length)l.A.getLogger(this).error(`VoxelVariableStyle for variable ${n.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const e of t.uniqueValues)null!==e.label&&void 0!==e.label||null===e.value||void 0===e.value||(e.label=e.value.toString());e.push(i)}else l.A.getLogger(this).error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const t of this.volumeStyles){const n=this._getVolumeFromVolumeId(t.volumeId);if(null!=n){const i=t.clone();for(const e of i.slices)this._isPlaneValid(e,[0,1,n.zDimension],n.dimensions)||(e.enabled=!1,e.label="invalid");for(const e of i.dynamicSections)this._isPlaneValid(e,[0,1,n.zDimension],n.dimensions)||(e.enabled=!1,e.label="invalid");e.push(i)}else l.A.getLogger(this).error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const t=e.variableId;for(const e of this.variables)if(e.id===t)return e;return null}_getVolumeFromVolumeId(e){for(const t of this.volumes)if(t.id===e)return t;return null}_isPlaneValid(e,t,n){if(!e.point)return!1;if(!Array.isArray(e.point)||3!==e.point.length)return!1;if(!e.normal)return!1;if(!Array.isArray(e.normal)||3!==e.normal.length)return!1;const i=(0,g.fA)(e.normal[0],e.normal[1],e.normal[2]);return(0,f.n)(i,i),!(Math.abs(i[0])+Math.abs(i[1])+Math.abs(i[2])<1e-6||(e.normal[0]=i[0],e.normal[1]=i[1],e.normal[2]=i[2],0))}};(0,i.Cg)([(0,c.MZ)({type:["Voxel"]})],Be.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,c.MZ)(V.fV)],Be.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,c.MZ)({json:{write:!0}})],Be.prototype,"title",void 0),(0,i.Cg)([(0,c.MZ)(V.OZ)],Be.prototype,"url",null),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(te),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],Be.prototype,"sections",void 0),(0,i.Cg)([(0,c.MZ)({type:p.jz,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],Be.prototype,"currentVariableId",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(Ue),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],Be.prototype,"volumeStyles",void 0),(0,i.Cg)([(0,c.MZ)({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],Be.prototype,"renderMode",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(xe),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],Be.prototype,"variableStyles",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],Be.prototype,"enableSlices",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],Be.prototype,"enableSections",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],Be.prototype,"enableDynamicSections",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],Be.prototype,"enableIsosurfaces",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Be.prototype,"graphicOrigin",void 0),(0,i.Cg)([(0,c.MZ)({type:ne,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],Be.prototype,"shading",void 0),(0,i.Cg)([(0,c.MZ)({type:["show","hide"]})],Be.prototype,"listMode",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],Be.prototype,"opacity",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(oe)})],Be.prototype,"variables",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(Fe)})],Be.prototype,"volumes",void 0),(0,i.Cg)([(0,c.MZ)({type:qe})],Be.prototype,"index",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],Be.prototype,"minScale",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],Be.prototype,"maxScale",void 0),(0,i.Cg)([(0,c.MZ)({json:{read:!1},readOnly:!0})],Be.prototype,"type",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,json:{name:"serviceVersion"}})],Be.prototype,"version",void 0),(0,i.Cg)([(0,d.w)("service","version")],Be.prototype,"readVersion",null),(0,i.Cg)([(0,c.MZ)({type:y.A})],Be.prototype,"fullExtent",void 0),(0,i.Cg)([(0,d.w)("service","fullExtent",["fullExtent"])],Be.prototype,"readFullExtent",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0,clonable:!1,json:{read:!1}})],Be.prototype,"fields",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],Be.prototype,"fieldsIndex",null),(0,i.Cg)([(0,c.MZ)({type:Boolean,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,t,n){t[n]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],Be.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:r.A,json:{name:"popupInfo",write:!0}})],Be.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],Be.prototype,"defaultPopupTemplate",null),(0,i.Cg)([(0,c.MZ)({type:F.A,readOnly:!0,json:{read:!1}})],Be.prototype,"timeInfo",null),(0,i.Cg)([(0,c.MZ)({type:De.A,json:{read:!1}})],Be.prototype,"timeExtent",void 0),(0,i.Cg)([(0,c.MZ)({type:ke.A,json:{read:!1}})],Be.prototype,"timeOffset",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:"timeAnimation",write:!0},service:{read:!1}}}})],Be.prototype,"useViewTime",void 0),Be=(0,i.Cg)([(0,h.$)("esri.layers.VoxelLayer")],Be);const He=Be},25036:(e,t,n)=>{n.d(t,{j:()=>o});var i=n(31635),r=n(10107),s=(n(44208),n(53966),n(87811),n(64108));const o=e=>{const t=e;let n=class extends t{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;void 0!==t?.effectiveScaleRange&&function(e,t){e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale}(e,t.effectiveScaleRange);const n=this._get("effectiveScaleRange");return n&&n.minScale===e.minScale&&n.maxScale===e.maxScale?n:e}};return(0,i.Cg)([(0,r.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],n.prototype,"minScale",void 0),(0,i.Cg)([(0,r.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],n.prototype,"maxScale",void 0),(0,i.Cg)([(0,r.MZ)({readOnly:!0})],n.prototype,"effectiveScaleRange",null),n=(0,i.Cg)([(0,s.$)("esri.layers.mixins.ScaleRangeLayer")],n),n}},30291:(e,t,n)=>{n.d(t,{tn:()=>u});var i=n(37838),r=n(30524),s=n(41227),o=n(89893),l=n(66159),a=n(68780);function u({displayField:e,editFieldsInfo:t,fields:n,objectIdField:a,title:u},h){if(!n)return null;const g=function(e,t){const n=t?.visibleFieldNames;return function({fields:e,ignoreFieldTypes:t,sortDisabled:n}){const i=e;return t&&(e=e.filter(e=>!t.includes(e.type))),e===i&&(e=e.slice()),!0!==n&&e.sort(p),e}({fields:e.fields??[],ignoreFieldTypes:t?.ignoreFieldTypes||f,sortDisabled:t?.sortDisabled}).map(t=>new s.A({fieldName:t.name,isEditable:(0,r.R$)(t,e),label:t.alias,format:d(t),visible:c(t,{...e,visibleFieldNames:n})}))}({editFieldsInfo:t,fields:n,objectIdField:a},h);if(!g.length)return null;const y=function(e){const t=(0,r.mB)(e),{titleBase:n}=e;return t?`${n}: {${t.trim()}}`:n??""}({titleBase:u,fields:n,displayField:e}),m=[new l.A,new o.A];return new i.A({title:y,content:m,fieldInfos:g})}const c=(e,t)=>t.visibleFieldNames?t.visibleFieldNames.has(e.name):(0,r.Bz)(e,t);function p(e,t){return"oid"===e.type?-1:"oid"===t.type?1:h(e)?-1:h(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function d(e){switch(e.type){case"small-integer":case"integer":return new a.A({digitSeparator:!0,places:0});case"single":case"double":return new a.A({digitSeparator:!0,places:2});case"string":return(0,r.JL)(e.name)?new a.A({digitSeparator:!0,places:0}):void 0;default:return}}function h(e){if("name"===(e.name&&e.name.toLowerCase()))return!0;const t=e.alias?.toLowerCase();return"name"===t}const f=["geometry","blob","raster","guid","xml"]},37539:(e,t,n)=>{n.d(t,{pO:()=>g,jd:()=>d,Tp:()=>h,w5:()=>p});var i=n(34727),r=n(83047),s=n(73941),o=n(79258);Math.PI;const l=o.$O.radius,a=o.$O.eccentricitySquared,u={a1:l*a,a2:l*a*l*a,a3:l*a*a/2,a4:l*a*l*a*2.5,a5:l*a+l*a*a/2,a6:1-a};o.$O.radius,o.$O.flattening,o.Sw.radius,o.Sw.flattening,o.sH.radius,o.sH.flattening,o.sH.radius;var c=n(21325);const p={2:{5:g,7:null,9:null,10:g,1:x,6:null,8:null,0:null,3:m,11:v,2:g,4:Z},5:{5:g,7:null,9:null,10:g,1:x,6:null,8:null,0:null,3:m,11:v,2:g,4:Z},7:{5:null,7:g,9:null,10:g,1:null,6:S,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:g,10:g,1:null,6:null,8:w,0:null,3:null,11:null,2:null,4:null},3:{5:y,7:null,9:null,10:y,1:function(e,t,n,i){const r=e[t]/N,s=z-2*Math.atan(Math.exp(-e[t+1]/N)),o=N+e[t+2],l=Math.cos(s)*o;n[i]=Math.cos(r)*l,n[i+1]=Math.sin(r)*l,n[i+2]=Math.sin(s)*o},6:null,8:null,0:null,3:g,11:function(e,t,n,i){y(e,t,n,i),v(n,i,n,i)},2:y,4:function(e,t,n,i){y(e,t,n,i),Z(n,i,n,i)}},4:{5:R,7:null,9:null,10:R,1:function(e,t,n,i){R(e,t,n,i),x(n,i,n,i)},6:null,8:null,0:null,3:function(e,t,n,i){R(e,t,n,i),m(n,i,n,i)},11:function(e,t,n,i){R(e,t,n,i),v(n,i,n,i)},2:R,4:g},1:{5:I,7:null,9:null,10:I,1:g,6:null,8:null,0:null,3:function(e,t,n,i){I(e,t,n,i),m(n,i,n,i)},11:function(e,t,n,i){I(e,t,n,i),v(n,i,n,i)},2:I,4:function(e,t,n,i){I(e,t,n,i),Z(n,i,n,i)}},6:{5:null,7:j,9:null,10:j,1:null,6:g,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:A,10:A,1:null,6:null,8:g,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:g,3:null,11:null,2:null,4:null},10:{5:g,7:g,9:g,10:g,1:x,6:S,8:w,0:null,3:m,11:v,2:g,4:Z},11:{5:b,7:null,9:null,10:b,1:function(e,t,n,i){b(e,t,n,i),x(n,i,n,i)},6:null,8:null,0:null,3:function(e,t,n,i){b(e,t,n,i),m(n,i,n,i)},11:g,2:b,4:function(e,t,n,i){b(e,t,n,i),Z(n,i,n,i)}}};function d(e,t){return h(e,t)?.projector}function h(e,t){if(null==e||null==t)return null;if(T.source.spatialReference===e&&T.dest.spatialReference===t)return T;const n=f(e,T.source),i=f(t,T.dest);return 0===n&&0===i?(0,c.aI)(e,t)?T.projector=g:T.projector=null:T.projector=p[n][i],T}function f(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,r.GA)(e,1)),(0,s.jA)(e)?t.spatialReferenceId=1:(0,c.oT)(e)?t.spatialReferenceId=2:(0,c.K8)(e)?t.spatialReferenceId=3:(0,c.r1)(e)?t.spatialReferenceId=11:e.wkt===s.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===s.FY.wkt?t.spatialReferenceId=6:e.wkt===s.LJ.wkt?t.spatialReferenceId=8:(0,c.q8)(e)?t.spatialReferenceId=7:(0,c.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function g(e,t,n,i){e!==n&&(n[i++]=e[t++],n[i++]=e[t++],n[i]=e[t])}function y(e,t,n,i){n[i]=V*(e[t]/N),n[i+1]=V*(z-2*Math.atan(Math.exp(-e[t+1]/N))),n[i+2]=e[t+2]}function m(e,t,n,r){!function(e,t,n,r,s){const o=.4999999*Math.PI,l=(0,i.qE)(P*e[t+1],-o,o),a=Math.sin(l);n[r++]=P*e[t]*s.radius,n[r++]=s.halfSemiMajorAxis*Math.log((1+a)/(1-a)),n[r]=e[t+2]}(e,t,n,r,o.$O)}function v(e,t,n,i){n[i]=e[t]*F,n[i+1]=e[t+1]*F,n[i+2]=e[t+2]}function b(e,t,n,i){n[i]=e[t]*_,n[i+1]=e[t+1]*_,n[i+2]=e[t+2]}function M(e,t,n,i,r){const s=r+e[t+2],o=P*e[t+1],l=P*e[t],a=Math.cos(o)*s;n[i]=Math.cos(l)*a,n[i+1]=Math.sin(l)*a,n[i+2]=Math.sin(o)*s}function w(e,t,n,i){M(e,t,n,i,o.Sw.radius)}function S(e,t,n,i){M(e,t,n,i,o.sH.radius)}function x(e,t,n,i){M(e,t,n,i,o.$O.radius)}function C(e,t,n,r,s){const o=e[t],l=e[t+1],a=e[t+2],u=Math.sqrt(o*o+l*l+a*a),c=(0,i.YN)(a/(0===u?1:u)),p=Math.atan2(l,o);n[r++]=V*p,n[r++]=V*c,n[r]=u-s}function A(e,t,n,i){C(e,t,n,i,o.Sw.radius)}function j(e,t,n,i){C(e,t,n,i,o.sH.radius)}function I(e,t,n,i){C(e,t,n,i,o.$O.radius)}function Z(e,t,n,i){!function(e,t,n,i,r){const s=P*e[t],o=P*e[t+1],l=e[t+2],a=Math.sin(o),u=Math.cos(o),c=r.radius/Math.sqrt(1-r.eccentricitySquared*a*a);n[i++]=(c+l)*u*Math.cos(s),n[i++]=(c+l)*u*Math.sin(s),n[i++]=(c*(1-r.eccentricitySquared)+l)*a}(e,t,n,i,o.$O)}function R(e,t,n,i){const r=u,s=e[t],l=e[t+1],a=e[t+2];let c,p,d,h,f,g,y,m,v,b,M,w,S,x,C,A,j,I,Z,R,T;c=Math.abs(a),p=s*s+l*l,d=Math.sqrt(p),h=p+a*a,f=Math.sqrt(h),R=Math.atan2(l,s),g=a*a/h,y=p/h,x=r.a2/f,C=r.a3-r.a4/f,y>.3?(m=c/f*(1+y*(r.a1+x+g*C)/f),Z=Math.asin(m),b=m*m,v=Math.sqrt(1-b)):(v=d/f*(1-g*(r.a5-x-y*C)/f),Z=Math.acos(v),b=1-v*v,m=Math.sqrt(b)),M=1-o.$O.eccentricitySquared*b,w=o.$O.radius/Math.sqrt(M),S=r.a6*w,x=d-w*v,C=c-S*m,j=v*x+m*C,A=v*C-m*x,I=A/(S/M+j),Z+=I,T=j+A*I/2,a<0&&(Z=-Z),n[i++]=V*R,n[i++]=V*Z,n[i]=T}const T={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:g},P=(0,i.kU)(1),V=(0,i.KJ)(1),z=.5*Math.PI,N=o.$O.radius,F=N*Math.PI/180,_=180/(N*Math.PI)},38954:(e,t,n)=>{n.d(t,{A:()=>f,B:()=>h,C:()=>c,D:()=>p,E:()=>z,F:()=>O,H:()=>L,a:()=>N,b:()=>s,c:()=>m,d:()=>o,e:()=>u,f:()=>C,g:()=>a,h:()=>y,i:()=>A,j:()=>l,k:()=>v,l:()=>j,m:()=>M,n:()=>x,o:()=>Z,q:()=>V,r:()=>S,s:()=>b,t:()=>I,u:()=>w,v:()=>R,w:()=>d,x:()=>q,y:()=>E,z:()=>g});var i=n(51850),r=n(34304);function s(e){const t=e[0],n=e[1],i=e[2];return Math.sqrt(t*t+n*n+i*i)}function o(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function l(e,t,n,i){return e[0]=t,e[1]=n,e[2]=i,e}function a(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function u(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function c(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function p(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e}function d(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}function h(e,t){return e[0]=Math.sign(t[0]),e[1]=Math.sign(t[1]),e[2]=Math.sign(t[2]),e}function f(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function g(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function y(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function m(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e[2]=t[2]+n[2]*i,e}function v(e,t){const n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return Math.sqrt(n*n+i*i+r*r)}function b(e,t){const n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2];return n*n+i*i+r*r}function M(e){const t=e[0],n=e[1],i=e[2];return t*t+n*n+i*i}function w(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function S(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function x(e,t){const n=t[0],i=t[1],r=t[2];let s=n*n+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s),e}function C(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function A(e,t,n){const i=t[0],r=t[1],s=t[2],o=n[0],l=n[1],a=n[2];return e[0]=r*a-s*l,e[1]=s*o-i*a,e[2]=i*l-r*o,e}function j(e,t,n,i){const r=t[0],s=t[1],o=t[2];return e[0]=r+i*(n[0]-r),e[1]=s+i*(n[1]-s),e[2]=o+i*(n[2]-o),e}function I(e,t,n){const i=t[0],r=t[1],s=t[2];return e[0]=n[0]*i+n[4]*r+n[8]*s+n[12],e[1]=n[1]*i+n[5]*r+n[9]*s+n[13],e[2]=n[2]*i+n[6]*r+n[10]*s+n[14],e}function Z(e,t,n){const i=t[0],r=t[1],s=t[2];return e[0]=i*n[0]+r*n[3]+s*n[6],e[1]=i*n[1]+r*n[4]+s*n[7],e[2]=i*n[2]+r*n[5]+s*n[8],e}function R(e,t,n){const i=n[0],r=n[1],s=n[2],o=n[3],l=t[0],a=t[1],u=t[2],c=r*u-s*a,p=s*l-i*u,d=i*a-r*l,h=r*d-s*p,f=s*c-i*d,g=i*p-r*c,y=2*o;return e[0]=l+c*y+2*h,e[1]=a+p*y+2*f,e[2]=u+d*y+2*g,e}const T=(0,i.vt)(),P=(0,i.vt)();function V(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function z(e,t,n){const i=n[0]-t[0],r=n[1]-t[1],s=n[2]-t[2];let o=i*i+r*r+s*s;return o>0?(o=1/Math.sqrt(o),e[0]=i*o,e[1]=r*o,e[2]=s*o,e):(e[0]=0,e[1]=0,e[2]=0,e)}const N=u,F=c,_=p,O=v,q=b,L=s,E=M;Object.freeze(Object.defineProperty({__proto__:null,abs:d,add:a,angle:function(e,t){x(T,e),x(P,t);const n=C(T,P);return n>1?0:n<-1?Math.PI:Math.acos(n)},bezier:function(e,t,n,i,r,s){const o=1-s,l=o*o,a=s*s,u=l*o,c=3*s*l,p=3*a*o,d=a*s;return e[0]=t[0]*u+n[0]*c+i[0]*p+r[0]*d,e[1]=t[1]*u+n[1]*c+i[1]*p+r[1]*d,e[2]=t[2]*u+n[2]*c+i[2]*p+r[2]*d,e},ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},clamp:function(e,t=0,n=1){return e[0]=Math.min(Math.max(e[0],t),n),e[1]=Math.min(Math.max(e[1],t),n),e[2]=Math.min(Math.max(e[2],t),n),e},copy:o,cross:A,crossAndNormalize:function(e,t,n){const i=t[0],r=t[1],s=t[2],o=n[0],l=n[1],a=n[2],u=r*a-s*l,c=s*o-i*a,p=i*l-r*o,d=Math.sqrt(u*u+c*c+p*p);return e[0]=u/d,e[1]=c/d,e[2]=p/d,e},direction:z,dist:O,distance:v,div:_,divide:p,dot:C,equals:function(e,t){if(e===t)return!0;const n=e[0],i=e[1],s=e[2],o=t[0],l=t[1],a=t[2],u=(0,r.FD)();return Math.abs(n-o)<=u*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-l)<=u*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(s-a)<=u*Math.max(1,Math.abs(s),Math.abs(a))},exactEquals:V,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},hermite:function(e,t,n,i,r,s){const o=s*s,l=o*(2*s-3)+1,a=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return e[0]=t[0]*l+n[0]*a+i[0]*u+r[0]*c,e[1]=t[1]*l+n[1]*a+i[1]*u+r[1]*c,e[2]=t[2]*l+n[2]*a+i[2]*u+r[2]*c,e},inverse:S,len:L,length:s,lerp:j,max:g,min:f,mul:F,multiply:c,negate:w,normalize:x,random:function(e,t=1){const n=r.Ov,i=2*n()*Math.PI,s=2*n()-1,o=Math.sqrt(1-s*s)*t;return e[0]=Math.cos(i)*o,e[1]=Math.sin(i)*o,e[2]=s*t,e},rotateX:function(e,t,n,i){const r=[],s=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],s[0]=r[0],s[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),s[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),e[0]=s[0]+n[0],e[1]=s[1]+n[1],e[2]=s[2]+n[2],e},rotateY:function(e,t,n,i){const r=[],s=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],s[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),s[1]=r[1],s[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),e[0]=s[0]+n[0],e[1]=s[1]+n[1],e[2]=s[2]+n[2],e},rotateZ:function(e,t,n,i){const r=[],s=[];return r[0]=t[0]-n[0],r[1]=t[1]-n[1],r[2]=t[2]-n[2],s[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),s[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),s[2]=r[2],e[0]=s[0]+n[0],e[1]=s[1]+n[1],e[2]=s[2]+n[2],e},round:function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},scale:y,scaleAndAdd:m,set:l,sign:h,sqrDist:q,sqrLen:E,squaredDistance:b,squaredLength:M,str:function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},sub:N,subtract:u,transformMat3:Z,transformMat4:I,transformQuat:R},Symbol.toStringTag,{value:"Module"}))},54239:(e,t,n)=>{n.d(t,{A:()=>m});var i,r=n(31635),s=n(4576),o=n(66552),l=n(25482),a=n(83047),u=n(67076),c=n(10107),p=(n(44208),n(53966),n(36005)),d=n(64108),h=n(43937);const f=(0,o.O)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),g=f.jsonValues.slice();(0,s.Xy)(g,"orthometric");const y=(0,o.O)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let m=i=class extends l.o{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,n){return f.write(e,t,n)}readHeightModel(e,t,n){return f.read(e)||(n?.messages&&n.messages.push(function(e,t){return new u.A("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:n})),null)}readHeightUnit(e,t,n){return y.read(e)||(n?.messages&&n.messages.push(v(e,{context:n})),null)}readHeightUnitService(e,t,n){return(0,a.LA)(e)||y.read(e)||(n?.messages&&n.messages.push(v(e,{context:n})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new i({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const n=(0,a.k1)(t);return new i({heightModel:e.heightModel,heightUnit:n??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new i;return t.read(e,{origin:"web-scene"}),t}};function v(e,t){return new u.A("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,r.Cg)([(0,c.MZ)({type:f.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:g,default:"ellipsoidal",write:{isRequired:!0}}}}})],m.prototype,"heightModel",void 0),(0,r.Cg)([(0,h.K)("web-scene","heightModel")],m.prototype,"writeHeightModel",null),(0,r.Cg)([(0,p.w)(["web-scene","service"],"heightModel")],m.prototype,"readHeightModel",null),(0,r.Cg)([(0,c.MZ)({type:y.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:y.jsonValues,write:{writer:y.write,isRequired:!0}}}}})],m.prototype,"heightUnit",void 0),(0,r.Cg)([(0,p.w)("web-scene","heightUnit")],m.prototype,"readHeightUnit",null),(0,r.Cg)([(0,p.w)("service","heightUnit")],m.prototype,"readHeightUnitService",null),(0,r.Cg)([(0,c.MZ)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],m.prototype,"vertCRS",void 0),(0,r.Cg)([(0,p.w)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],m.prototype,"readVertCRS",null),m=i=(0,r.Cg)([(0,d.$)("esri.geometry.HeightModelInfo")],m)},60999:(e,t,n)=>{n.d(t,{DZ:()=>f,Ke:()=>h,Tj:()=>c,UT:()=>g,aD:()=>m,jJ:()=>u});var i=n(31635),r=n(69622),s=n(97768),o=n(74887),l=n(10107),a=n(64108);function u(e,t,n){return(0,o.Lx)(e.map((e,i)=>t.apply(n,[e,i])))}async function c(e,t,n){return(await(0,o.Lx)(e.map((e,i)=>t.apply(n,[e,i])))).map(e=>e.value)}function p(e){return{ok:!0,value:e}}function d(e){return{ok:!1,error:e}}async function h(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return p(await e)}catch(e){return d(e)}}async function f(e){try{return p(await e)}catch(e){return(0,o.QP)(e),d(e)}}function g(e,t){return new y(e,t)}let y=class extends r.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,s.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:n}=this._abortController;this.promise=e(n),this.promise.then(e=>{this._result=p(e),this._cleanup()},e=>{this._result=d(e),this._cleanup()}),this._abortHandle=(0,o.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,s.xt)(this._abortHandle),this._abortController=null}};(0,i.Cg)([(0,l.MZ)()],y.prototype,"value",null),(0,i.Cg)([(0,l.MZ)()],y.prototype,"error",null),(0,i.Cg)([(0,l.MZ)()],y.prototype,"finished",null),(0,i.Cg)([(0,l.MZ)()],y.prototype,"promise",void 0),(0,i.Cg)([(0,l.MZ)()],y.prototype,"_result",void 0),y=(0,i.Cg)([(0,a.$)("esri.core.asyncUtils.ReactiveTask")],y);class m{constructor(){this._sequence=Promise.resolve()}async acquire(){let e;this._sequence=new Promise(t=>{e=this._sequence.then(()=>t,()=>t)});const t=await e;return{[Symbol.dispose]:t}}async run(e){const t={stack:[],error:void 0,hasError:!1};try{return(0,i.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,i.hk)(t)}}}},62815:(e,t,n)=>{n.d(t,{N:()=>o});var i=n(83047),r=n(73941),s=n(21325);function o(e,t,n){if(null==t||null==n||n.vcsWkid||(0,s.aI)(t,n)||(0,r.xP)(t)||(0,r.xP)(n))return null;const o=(0,i.G9)(t)/(0,i.G9)(n);if(1===o)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,o);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const n of e.paths)for(const e of n)e.length>2&&(e[2]*=t)}(e,o);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const n of e.rings)for(const e of n)e.length>2&&(e[2]*=t)}(e,o);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const n of e.points)n.length>2&&(n[2]*=t)}(e,o);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,o);default:return null}}},62885:(e,t,n)=>{n.d(t,{H:()=>s,V:()=>r});var i=n(7762);function r(e,t,n=i.A){return t||(t=new n),t===e||t.destroyed||(t.removeAll(),(r=e)&&(Array.isArray(r)||"items"in r&&Array.isArray(r.items))?t.addMany(e):e&&t.add(e)),t;var r}function s(e){return e}},67026:(e,t,n)=>{n.d(t,{A6:()=>g,Xd:()=>c,Xr:()=>h,hZ:()=>m,lw:()=>p,t2:()=>Z,x8:()=>u});var i=n(29242),r=n(82534),s=n(51850),o=n(34304),l=n(38954),a=n(87317);function u(e,t,n){n*=.5;const i=Math.sin(n);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(n),e}function c(e,t){const n=2*Math.acos(t[3]),i=Math.sin(n/2);return i>(0,o.FD)()?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),n}function p(e,t,n){const i=t[0],r=t[1],s=t[2],o=t[3],l=n[0],a=n[1],u=n[2],c=n[3];return e[0]=i*c+o*l+r*u-s*a,e[1]=r*c+o*a+s*l-i*u,e[2]=s*c+o*u+i*a-r*l,e[3]=o*c-i*l-r*a-s*u,e}function d(e,t,n,i){const r=t[0],s=t[1],l=t[2],a=t[3];let u,c,p,d,h,f=n[0],g=n[1],y=n[2],m=n[3];return c=r*f+s*g+l*y+a*m,c<0&&(c=-c,f=-f,g=-g,y=-y,m=-m),1-c>(0,o.FD)()?(u=Math.acos(c),p=Math.sin(u),d=Math.sin((1-i)*u)/p,h=Math.sin(i*u)/p):(d=1-i,h=i),e[0]=d*r+h*f,e[1]=d*s+h*g,e[2]=d*l+h*y,e[3]=d*a+h*m,e}function h(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function f(e,t){const n=t[0]+t[4]+t[8];let i;if(n>0)i=Math.sqrt(n+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let n=0;t[4]>t[0]&&(n=1),t[8]>t[3*n+n]&&(n=2);const r=(n+1)%3,s=(n+2)%3;i=Math.sqrt(t[3*n+n]-t[3*r+r]-t[3*s+s]+1),e[n]=.5*i,i=.5/i,e[3]=(t[3*r+s]-t[3*s+r])*i,e[r]=(t[3*r+n]+t[3*n+r])*i,e[s]=(t[3*s+n]+t[3*n+s])*i}return e}function g(e,t,n,i){const r=.5*Math.PI/180;t*=r,n*=r,i*=r;const s=Math.sin(t),o=Math.cos(t),l=Math.sin(n),a=Math.cos(n),u=Math.sin(i),c=Math.cos(i);return e[0]=s*a*c-o*l*u,e[1]=o*l*c+s*a*u,e[2]=o*a*u-s*l*c,e[3]=o*a*c+s*l*u,e}const y=a.d,m=a.s,v=a.h,b=p,M=a.c,w=a.g,S=a.l,x=a.i,C=x,A=a.b,j=A,I=a.n,Z=a.a,R=a.e,T=(0,s.vt)(),P=(0,s.fA)(1,0,0),V=(0,s.fA)(0,1,0),z=(0,r.vt)(),N=(0,r.vt)(),F=(0,i.vt)();Object.freeze(Object.defineProperty({__proto__:null,add:v,calculateW:function(e,t){const n=t[0],i=t[1],r=t[2];return e[0]=n,e[1]=i,e[2]=r,e[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),e},conjugate:h,copy:y,dot:w,equals:R,exactEquals:Z,fromEuler:g,fromMat3:f,getAxisAngle:c,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},invert:function(e,t){const n=t[0],i=t[1],r=t[2],s=t[3],o=n*n+i*i+r*r+s*s,l=o?1/o:0;return e[0]=-n*l,e[1]=-i*l,e[2]=-r*l,e[3]=s*l,e},len:C,length:x,lerp:S,mul:b,multiply:p,normalize:I,random:function(e){const t=o.Ov,n=t(),i=t(),r=t(),s=Math.sqrt(1-n),l=Math.sqrt(n);return e[0]=s*Math.sin(2*Math.PI*i),e[1]=s*Math.cos(2*Math.PI*i),e[2]=l*Math.sin(2*Math.PI*r),e[3]=l*Math.cos(2*Math.PI*r),e},rotateX:function(e,t,n){n*=.5;const i=t[0],r=t[1],s=t[2],o=t[3],l=Math.sin(n),a=Math.cos(n);return e[0]=i*a+o*l,e[1]=r*a+s*l,e[2]=s*a-r*l,e[3]=o*a-i*l,e},rotateY:function(e,t,n){n*=.5;const i=t[0],r=t[1],s=t[2],o=t[3],l=Math.sin(n),a=Math.cos(n);return e[0]=i*a-s*l,e[1]=r*a+o*l,e[2]=s*a+i*l,e[3]=o*a-r*l,e},rotateZ:function(e,t,n){n*=.5;const i=t[0],r=t[1],s=t[2],o=t[3],l=Math.sin(n),a=Math.cos(n);return e[0]=i*a+r*l,e[1]=r*a-i*l,e[2]=s*a+o*l,e[3]=o*a-s*l,e},rotationTo:function(e,t,n){const i=(0,l.f)(t,n);return i<-.999999?((0,l.i)(T,P,t),(0,l.H)(T)<1e-6&&(0,l.i)(T,V,t),(0,l.n)(T,T),u(e,T,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,l.i)(T,t,n),e[0]=T[0],e[1]=T[1],e[2]=T[2],e[3]=1+i,I(e,e))},scale:M,set:m,setAxes:function(e,t,n,i){const r=F;return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-t[0],r[5]=-t[1],r[8]=-t[2],I(e,f(e,r))},setAxisAngle:u,slerp:d,sqlerp:function(e,t,n,i,r,s){return d(z,t,r,s),d(N,n,i,s),d(e,z,N,2*s*(1-s)),e},sqrLen:j,squaredLength:A,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}},Symbol.toStringTag,{value:"Module"}))},68197:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(40876),r=n(34727),s=n(56507);function o(e){return(0,r.qE)((0,s.Vr)(e),0,255)}function l(e,t){const n=e.toString(16).padStart(2,"0");return t?n.slice(0,1):n}class a{static blendColors(e,t,n,i=new a){return i.r=Math.round(e.r+(t.r-e.r)*n),i.g=Math.round(e.g+(t.g-e.g)*n),i.b=Math.round(e.b+(t.b-e.b)*n),i.a=e.a+(t.a-e.a)*n,i._sanitize()}static fromRgb(e,t){const n=(0,i.lT)(e);return n?a.fromArray(n,t):null}static fromHex(e,t=new a){const n=(0,i.oW)(e);return n?a.fromArray(n,t):null}static fromArray(e,t=new a){return t._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3])),isNaN(t.a)&&(t.a=1),t._sanitize()}static fromString(e,t){const n=(0,i.Eq)(e);return n?a.fromArray(n,t):null}static fromJSON(e){return null!=e?new a([e[0],e[1],e[2],(e[3]??255)/255]):void 0}static toUnitRGB(e){return null!=e?[e.r/255,e.g/255,e.b/255]:null}static toUnitRGBA(e,t){return null==e?null:(t??=[0,0,0,0],t[0]=e.r/255,t[1]=e.g/255,t[2]=e.b/255,t[3]=null!=e.a?e.a:1,t)}constructor(e){this.r=255,this.g=255,this.b=255,this.a=1,e&&this.setColor(e)}get isBright(){return.299*this.r+.587*this.g+.114*this.b>=127}setColor(e){return"string"==typeof e?a.fromString(e,this):Array.isArray(e)?a.fromArray(e,this):(this._set(e.r??0,e.g??0,e.b??0,e.a??1),e instanceof a||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(e){const t=e?.capitalize??!1,n=e?.digits??6,i=3===n||4===n,r=4===n||8===n,s=`#${l(this.r,i)}${l(this.g,i)}${l(this.b,i)}${r?l(Math.round(255*this.a),i):""}`;return t?s.toUpperCase():s}toCss(e=!1){const t=this.r+", "+this.g+", "+this.b;return e?`rgba(${t}, ${this.a})`:`rgb(${t})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(e=0){const t=o(this.r),n=o(this.g),i=o(this.b);return 0===e||1!==this.a?[t,n,i,o(255*this.a)]:[t,n,i]}clone(){return new a(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(e){return null!=e&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}_sanitize(){return this.r=(0,i.c1)(this.r),this.g=(0,i.c1)(this.g),this.b=(0,i.c1)(this.b),this.a=(0,i.G1)(this.a),this}_set(e,t,n,i){this.r=e,this.g=t,this.b=n,this.a=i}}a.prototype.declaredClass="esri.Color"},69052:(e,t,n)=>{n.d(t,{hr:()=>r,ie:()=>a,uC:()=>l});var i=n(34727);class r{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,n=!1){return s(this.range,this.min,this.max,e,t,n)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,n){return e<t?t:t+o(this.range,e-t,n)}minimalMonotonic(e,t,n){return s(this.range,e,e+this.range,t,n)}center(e,t,n){return t=this.monotonic(e,t,n),this.normalize((e+t)/2,n)}diff(e,t,n){return this.monotonic(e,t,n)-e}shortestSignedDiff(e,t){e=this.normalize(e);const n=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(n)<Math.abs(i)?n:i}contains(e,t,n){return t=this.minimalMonotonic(e,t),(n=this.minimalMonotonic(e,n))>e&&n<t}}function s(e,t,n,i,r=0,s=!1){return(i-=r)<t?i+=o(e,t-i):i>n&&(i-=o(e,i-n)),s&&i===n&&(i=t),i+r}function o(e,t,n=0){return Math.ceil((t-n)/e)*e+n}const l=new r(0,2*Math.PI),a=(new r(-Math.PI,Math.PI),new r(0,360))},69208:(e,t,n)=>{n.d(t,{d:()=>o});var i=n(31635),r=n(10107),s=(n(44208),n(53966),n(87811),n(64108));const o=e=>{const t=e;let n=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,i.Cg)([(0,r.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],n.prototype,"customParameters",void 0),n=(0,i.Cg)([(0,s.$)("esri.layers.mixins.CustomParametersMixin")],n),n}},69540:(e,t,n)=>{n.d(t,{OU:()=>c,Pw:()=>p});var i=n(31635),r=n(69622),s=(n(44208),n(4718)),o=(n(53966),n(97768)),l=n(88620),a=n(64108);const u=Symbol("ClonableMixin"),c=e=>{var t;const n=e;let r=class extends n{constructor(){super(...arguments),this[t]=!0}static{t=u}clone(e){const t=(0,l.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");const n=t.metadata,i=t.store,r={},a=new Map;for(const t in n){const o=n[t],l=i?.originOf(t),u=o.clonable;if(o.readOnly||!1===u||7!==l&&0!==l&&5!==l&&4!==l)continue;const c=this[t];let p=null;if("function"==typeof u)p=u(c,e);else if("reference"===u)p=c;else if(p=(0,s.TU)(c,e),null!=c&&null==p)continue;0===l?a.set(t,p):r[t]=p}const u=new(0,Object.getPrototypeOf(this).constructor)(r);if(a.size){const e=(0,l.oY)(u)?.store;if(e)for(const[t,n]of a)e.set(t,n,0)}return u}};return r=(0,i.Cg)([(0,a.$)("esri.core.Clonable")],r),r},p=c(r.A)},73133:(e,t,n)=>{n.d(t,{j:()=>i});const i=(0,n(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0})},73179:(e,t,n)=>{n.d(t,{b:()=>a,h:()=>u});var i=n(4718),r=n(53966),s=n(84952),o=n(60694),l=n(10873);function a(e){const{nonStandardUrlAllowed:t=!1,separator:n}=e??{},s=(0,i.o8)(l.OZ),a=s.json?.write;return"object"==typeof a&&a&&(a.writer=function(e,t,i,r){(0,o.LS)(this,e,n,t,r)}),{...s,set:function(e){if(null==e)return void this._set("url",e);const n=(0,o.HZ)({layer:this,url:e,nonStandardUrlAllowed:t,logger:r.A.getLogger(this)});this._set("url",n.url),null!=n.layerId&&this._set("layerId",n.layerId)}}}function u(e,t){const{separator:n}=t??{},i=(0,s.An)(e.url);return null!=i&&(null!=e.dynamicDataSource?i.path=(0,s.fj)(i.path,"dynamicLayer"):null!=e.layerId&&(i.path=(0,s.fj)(i.path,n??"",e.layerId.toString()))),i}},80200:(e,t,n)=>{n.d(t,{T:()=>i,d:()=>g});const i={Base64:0,Hex:1,String:2,Raw:3},r=8,s=(1<<r)-1;function o(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function l(e){const t=[];for(let n=0,i=e.length*r;n<i;n+=r)t[n>>5]|=(e.charCodeAt(n/r)&s)<<n%32;return t}function a(e){const t=[];for(let n=0,i=32*e.length;n<i;n+=r)t.push(String.fromCharCode(e[n>>5]>>>n%32&s));return t.join("")}function u(e,t,n,i,r,s){return o(function(e,t){return e<<t|e>>>32-t}(o(o(t,e),o(i,s)),r),n)}function c(e,t,n,i,r,s,o){return u(t&n|~t&i,e,t,r,s,o)}function p(e,t,n,i,r,s,o){return u(t&i|n&~i,e,t,r,s,o)}function d(e,t,n,i,r,s,o){return u(t^n^i,e,t,r,s,o)}function h(e,t,n,i,r,s,o){return u(n^(t|~i),e,t,r,s,o)}function f(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;let n=1732584193,i=-271733879,r=-1732584194,s=271733878;for(let t=0;t<e.length;t+=16){const l=n,a=i,u=r,f=s;n=c(n,i,r,s,e[t],7,-680876936),s=c(s,n,i,r,e[t+1],12,-389564586),r=c(r,s,n,i,e[t+2],17,606105819),i=c(i,r,s,n,e[t+3],22,-1044525330),n=c(n,i,r,s,e[t+4],7,-176418897),s=c(s,n,i,r,e[t+5],12,1200080426),r=c(r,s,n,i,e[t+6],17,-1473231341),i=c(i,r,s,n,e[t+7],22,-45705983),n=c(n,i,r,s,e[t+8],7,1770035416),s=c(s,n,i,r,e[t+9],12,-1958414417),r=c(r,s,n,i,e[t+10],17,-42063),i=c(i,r,s,n,e[t+11],22,-1990404162),n=c(n,i,r,s,e[t+12],7,1804603682),s=c(s,n,i,r,e[t+13],12,-40341101),r=c(r,s,n,i,e[t+14],17,-1502002290),i=c(i,r,s,n,e[t+15],22,1236535329),n=p(n,i,r,s,e[t+1],5,-165796510),s=p(s,n,i,r,e[t+6],9,-1069501632),r=p(r,s,n,i,e[t+11],14,643717713),i=p(i,r,s,n,e[t],20,-373897302),n=p(n,i,r,s,e[t+5],5,-701558691),s=p(s,n,i,r,e[t+10],9,38016083),r=p(r,s,n,i,e[t+15],14,-660478335),i=p(i,r,s,n,e[t+4],20,-405537848),n=p(n,i,r,s,e[t+9],5,568446438),s=p(s,n,i,r,e[t+14],9,-1019803690),r=p(r,s,n,i,e[t+3],14,-187363961),i=p(i,r,s,n,e[t+8],20,1163531501),n=p(n,i,r,s,e[t+13],5,-1444681467),s=p(s,n,i,r,e[t+2],9,-51403784),r=p(r,s,n,i,e[t+7],14,1735328473),i=p(i,r,s,n,e[t+12],20,-1926607734),n=d(n,i,r,s,e[t+5],4,-378558),s=d(s,n,i,r,e[t+8],11,-2022574463),r=d(r,s,n,i,e[t+11],16,1839030562),i=d(i,r,s,n,e[t+14],23,-35309556),n=d(n,i,r,s,e[t+1],4,-1530992060),s=d(s,n,i,r,e[t+4],11,1272893353),r=d(r,s,n,i,e[t+7],16,-155497632),i=d(i,r,s,n,e[t+10],23,-1094730640),n=d(n,i,r,s,e[t+13],4,681279174),s=d(s,n,i,r,e[t],11,-358537222),r=d(r,s,n,i,e[t+3],16,-722521979),i=d(i,r,s,n,e[t+6],23,76029189),n=d(n,i,r,s,e[t+9],4,-640364487),s=d(s,n,i,r,e[t+12],11,-421815835),r=d(r,s,n,i,e[t+15],16,530742520),i=d(i,r,s,n,e[t+2],23,-995338651),n=h(n,i,r,s,e[t],6,-198630844),s=h(s,n,i,r,e[t+7],10,1126891415),r=h(r,s,n,i,e[t+14],15,-1416354905),i=h(i,r,s,n,e[t+5],21,-57434055),n=h(n,i,r,s,e[t+12],6,1700485571),s=h(s,n,i,r,e[t+3],10,-1894986606),r=h(r,s,n,i,e[t+10],15,-1051523),i=h(i,r,s,n,e[t+1],21,-2054922799),n=h(n,i,r,s,e[t+8],6,1873313359),s=h(s,n,i,r,e[t+15],10,-30611744),r=h(r,s,n,i,e[t+6],15,-1560198380),i=h(i,r,s,n,e[t+13],21,1309151649),n=h(n,i,r,s,e[t+4],6,-145523070),s=h(s,n,i,r,e[t+11],10,-1120210379),r=h(r,s,n,i,e[t+2],15,718787259),i=h(i,r,s,n,e[t+9],21,-343485551),n=o(n,l),i=o(i,a),r=o(r,u),s=o(s,f)}return[n,i,r,s]}function g(e,t=i.Hex){const n=t||i.Base64,s=f(l(e),e.length*r);switch(n){case i.Raw:return s;case i.Hex:return function(e){const t="0123456789abcdef",n=[];for(let i=0,r=4*e.length;i<r;i++)n.push(t.charAt(e[i>>2]>>i%4*8+4&15)+t.charAt(e[i>>2]>>i%4*8&15));return n.join("")}(s);case i.String:return a(s);case i.Base64:return function(e){const t=[];for(let n=0,i=4*e.length;n<i;n+=3){const i=(e[n>>2]>>n%4*8&255)<<16|(e[n+1>>2]>>(n+1)%4*8&255)<<8|e[n+2>>2]>>(n+2)%4*8&255;for(let r=0;r<4;r++)8*n+6*r>32*e.length?t.push("="):t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>6*(3-r)&63))}return t.join("")}(s)}}},82534:(e,t,n)=>{function i(){return[0,0,0,1]}function r(e){return[e[0],e[1],e[2],e[3]]}n.d(t,{o8:()=>r,vt:()=>i,zK:()=>s});const s=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:s,clone:r,create:i,fromValues:function(e,t,n,i){return[e,t,n,i]}},Symbol.toStringTag,{value:"Module"}))},85648:(e,t,n)=>{n.d(t,{n:()=>r});var i=n(84952);function r(e){return s[function(e){return"json"===e.type?"application/json":"blob"===e.type?e.blob.type:function(e){const t=(0,i.Zo)(e);return a[t]||o}(e.url)}(e)]||l}const s={},o="text/plain",l=s[o],a={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in a)s[a[e]]=e},87024:(e,t,n)=>{n.d(t,{P:()=>h});var i=n(49186),r=n(80200),s=n(76553),o=n(84952),l=n(13069),a=n(96156),u=n(35666),c=n(10107),p=n(85648),d=n(97159);function h(e){const t=e?.origins??[void 0];return(n,i)=>{const r=function(e,t,n){if("resource"===e?.type)return function(e,t,n){const i=(0,a.z4)(t,n);return{type:String,read:(e,t,n)=>{const r=(0,d.r)(e,t,n);return i.type===String?r:"function"==typeof i.type?new i.type({url:r}):void 0},write:{isRequired:i.json?.write?.isRequired,writer(t,r,l,a){if(!a?.resources)return"string"==typeof t?void(r[l]=(0,d.t)(t,a)):void(r[l]=t.write({},a));const c=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),h=(0,d.t)(c,{...a,verifyItemRelativeUrls:a?.verifyItemRelativeUrls?{writtenUrls:a.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},1),m=i.type!==String&&(!(0,s.H)(this)||a?.origin&&this.originIdOf(n)>(0,u.aB)(a.origin)),v={object:this,propertyName:n,value:t,targetUrl:h,dest:r,targetPropertyName:l,context:a,params:e};a?.portalItem&&h&&!(0,o.oP)(h)?m&&e?.contentAddressed?f(v):m?function(e){const{context:t,targetUrl:n,params:i,value:r,dest:s,targetPropertyName:l}=e;if(!t.portalItem)return;const a=t.portalItem.resourceFromPath(n),u=y(r,n,t),c=(0,p.n)(u),d=(0,o.Zo)(a.path),h=i?.compress??!1;c===d?(t.resources&&g({...e,resource:a,content:u,compress:h,updates:t.resources.toUpdate}),s[l]=n):f(e)}(v):function({context:e,targetUrl:t,dest:n,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),n[i]=t)}(v):a?.portalItem&&(null==h||null!=(0,d.i)(h)||(0,o.w8)(h)||m)?f(v):r[l]=h}}}}(e,t,n);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=d.b;return{read:e,write:t}}}}(e,n,i);for(const e of t){const t=(0,c.rM)(n,e,i);for(const e in r)t[e]=r[e]}}}function f(e){const{targetUrl:t,params:n,value:s,context:a,dest:u,targetPropertyName:c}=e;if(!a.portalItem)return;const h=(0,d.p)(t),f=y(s,t,a);if(n?.contentAddressed&&"json"!==f.type)return void a.messages?.push(new i.A("persistable:contentAddressingUnsupported",`Property "${c}" is trying to serializing a resource with content of type ${f.type} with content addressing. Content addressing is only supported for json resources.`,{content:f}));const m=n?.contentAddressed&&"json"===f.type?(0,r.d)(f.jsonString):h?.filename??(0,l.lk)(),v=(0,o.fj)(n?.prefix??h?.prefix,m),b=`${v}.${(0,p.n)(f)}`;if(n?.contentAddressed&&a.resources&&"json"===f.type){const e=a.resources.toKeep.find(({resource:e})=>e.path===b)??a.resources.toAdd.find(({resource:e})=>e.path===b);if(e)return void(u[c]=e.resource.itemRelativeUrl)}const M=a.portalItem.resourceFromPath(b);(0,o.w8)(t)&&a.resources&&a.resources.pendingOperations.push((0,o.tk)(t).then(e=>{M.path=`${v}.${(0,p.n)({type:"blob",blob:e})}`,u[c]=M.itemRelativeUrl}).catch(()=>{}));const w=n?.compress??!1;a.resources&&g({...e,resource:M,content:f,compress:w,updates:a.resources.toAdd}),u[c]=M.itemRelativeUrl}function g({object:e,propertyName:t,updates:n,resource:i,content:r,compress:s}){n.push({resource:i,content:r,compress:s,finish:n=>{!function(e,t,n){"string"==typeof e[t]?e[t]=n.url:e[t].url=n.url}(e,t,n)}})}function y(e,t,n){return"string"==typeof e?{type:"url",url:t}:{type:"json",jsonString:JSON.stringify(e.toJSON(n))}}},89808:(e,t,n)=>{n.d(t,{Q:()=>i});const i=Symbol("getSliceableSymbol")},91218:(e,t,n)=>{n.r(t),n.d(t,{canProjectWithoutEngine:()=>k,initializeProjection:()=>H,isEqualBaseGCS:()=>B,isLoaded:()=>T,isLoadedOrLoad:()=>P,isLoadedOrLoadFor:()=>V,load:()=>N,project:()=>F,projectExtent:()=>ne,projectMany:()=>_,projectMultipoint:()=>Y,projectOrLoad:()=>O,projectOrLoadMany:()=>q,projectPoint:()=>J,projectPolygon:()=>ee,projectPolyline:()=>Q,projectWithZConversion:()=>D,projectWithoutEngine:()=>G,requiresLoad:()=>z,test:()=>U,tryProjectWithZConversion:()=>$,unload:()=>E});var i=n(49186),r=n(74887),s=n(62788),o=n(95488),l=n(51850),a=n(21276),u=n(73941),c=n(5443),p=n(91075),d=n(48526),h=n(86738),f=n(39829),g=n(82799),y=n(16930),m=n(159),v=n(9762),b=n(37539);function M(e,t,n,i,r,s){return w[0]=e,w[1]=t,w[2]=n,(0,v.projectBuffer)(w,i,0,r,s,0)}const w=(0,l.vt)();var S=n(21325),x=n(62815);let C=null,A=null,j=null,I=null,Z={};const R=new o.I;function T(){return!!(A?.isLoaded()&&j?.isLoaded()&&I?.isLoaded())}function P(){return!!T()||((0,s.gc)(R),N(),!1)}function V(e,t){return!e||!t||k(e,t)||P()}function z(e,t){return!k(e,t)&&!T()}async function N(e){null==C&&(C=Promise.all([n.e(3276).then(n.bind(n,83276)).then(e=>(A=e,A.load())),n.e(8377).then(n.bind(n,8377)).then(e=>(j=e,j.load())),n.e(2158).then(n.bind(n,12158)).then(e=>(I=e,I.load()))])),await C,(0,r.Te)(e),R.notify()}function F(e,t,n){return Array.isArray(e)?0===e.length?[]:((0,a.H)(e),_(e,e[0].spatialReference,t,n)):((0,a.f)(e),_([e],e.spatialReference,t,n)[0])}function _(e,t,n,i){if(null==t||null==n)return e;if(k(t,n,i))return e.map(e=>G(e,t,n));if(null==i?.geographicTransformation&&(0,u.jA)(t))return e.map(e=>G(e,t,y.A.WGS84)).map(e=>$(e,n));if(null==i?.geographicTransformation&&(0,u.jA)(n))return e.map(e=>$(e,y.A.WGS84)).map(e=>G(e,y.A.WGS84,n));if(!T())throw new L;if(!i?.geographicTransformation)if(i?.extendedParams)i={...i,geographicTransformation:I.getTransformation(t,n,i.areaOfInterestExtent)||new m.A};else if(!i?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,n);let r=Z[e];r||(r=I.getTransformation(t,n)||new m.A,Z[e]=r),i={geographicTransformation:r}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof p.A?A.executeMany(e,n,i):j.executeMany(e,n,i)}function O(e,t){const n=q([e],t);return null!=n.pending?{pending:n.pending,geometry:null}:null!=n.geometries?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function q(e,t){if(!T())for(const n of e)if(null!=n&&!(0,S.aI)(n.spatialReference,t)&&(0,S.fn)(n.spatialReference)&&(0,S.fn)(t)&&!k(n.spatialReference,t))return(0,s.gc)(R),{pending:N(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,S.aI)(e.spatialReference,t)?e:(0,S.fn)(e.spatialReference)&&(0,S.fn)(t)?$(e,t):null)}}class L extends i.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function E(){C=null,A=null,j=null,I=null,Z={}}const U={get loadPromise(){return C}};function $(e,t){try{const n=F(e,t);if(null==n)return null;"xmin"in e&&"xmin"in n&&(n.zmin=e.zmin,n.zmax=e.zmax);const i=(0,x.N)(n.type,e.spatialReference,t);return null!=i&&i(n),n}catch(e){if(!(e instanceof L))throw e;return null}}async function D(e,t,n){const i=e.spatialReference;return null!=i&&null!=t&&await H(i,t,null,n),$(e,t)}function k(e,t,n){return!(n?.areaOfInterestExtent||n?.extendedParams||n?.geographicTransformation)&&(!!(0,S.aI)(e,t)||(0,S.fn)(e)&&(0,S.fn)(t)&&!!(0,b.jd)(e,t))}function B(e,t){if((0,S.aI)(e,t))return!0;if(!(0,S.fn)(e)||!(0,S.fn)(t))return!1;const n=(0,S.oT)(e)||(0,S.K8)(e)||(0,S.x1)(e),i=(0,S.oT)(t)||(0,S.K8)(t)||(0,S.x1)(t);return n&&i}async function H(e,t,n,i){if(T())return(0,r.NO)(i);if(Array.isArray(e)){for(const{source:t,dest:n,options:r}of e)if(t&&n&&!k(t,n,r))return N(i)}else if(e&&t&&!k(e,t,n))return N(i);return(0,r.NO)(i)}function G(e,t,n){return e?"x"in e?W(e,t,new h.A,n,0):"xmin"in e?ie(e,t,new c.A,n,0):"rings"in e?te(e,t,new f.A,n,0):"paths"in e?X(e,t,new g.A,n,0):"points"in e?K(e,t,new d.A,n,0):null:null}function J(e,t,n=t.spatialReference,i=0){return null!=n&&null!=e.spatialReference&&null!=W(e,e.spatialReference,t,n,i)}function W(e,t,n,i,r){se[0]=e.x,se[1]=e.y;const s=e.z;return se[2]=void 0!==s?s:r,(0,v.projectBuffer)(se,t,0,se,i,0)?(n.x=se[0],n.y=se[1],n.spatialReference=i,void 0!==s||(0,u.xP)(i)?(n.z=se[2],n.hasZ=!0):(n.z=void 0,n.hasZ=!1),void 0===e.m?(n.m=void 0,n.hasM=!1):(n.m=e.m,n.hasM=!0),n):null}function Y(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=K(e,e.spatialReference,t,n,i)}function K(e,t,n,i,r){const{points:s,hasZ:o,hasM:l}=e,a=[],c=s.length,p=[];for(const e of s)p.push(e[0],e[1],o?e[2]:r);if(!(0,v.projectBuffer)(p,t,0,p,i,0,c))return null;const d=o||(0,u.xP)(i);for(let e=0;e<c;++e){const t=3*e,n=p[t],i=p[t+1];d&&l?a.push([n,i,p[t+2],s[e][3]]):d?a.push([n,i,p[t+2]]):l?a.push([n,i,s[e][2]]):a.push([n,i])}return n.points=a,n.spatialReference=i,n.hasZ=o,n.hasM=l,n}function Q(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=X(e,e.spatialReference,t,n,i)}function X(e,t,n,i,r){const{paths:s,hasZ:o,hasM:l}=e,a=[];if(!re(s,o??!1,l??!1,t,a,i,r))return null;const c=o||(0,u.xP)(i);return n.paths=a,n.spatialReference=i,n.hasZ=c,n.hasM=l,n}function ee(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=te(e,e.spatialReference,t,n,i)}function te(e,t,n,i,r){const{rings:s,hasZ:o,hasM:l}=e,a=[];if(!re(s,o??!1,l??!1,t,a,i,r))return null;const c=o||(0,u.xP)(i);return n.rings=a,n.spatialReference=i,n.hasZ=c,n.hasM=l,n}function ne(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=ie(e,e.spatialReference,t,n,i)}function ie(e,t,n,i,r){const{xmin:s,ymin:o,xmax:l,ymax:a,hasZ:c,hasM:p}=e;if(!M(s,o,c?e.zmin:r,t,se,i))return null;const d=c||(0,u.xP)(i);return n.xmin=se[0],n.ymin=se[1],d&&(n.zmin=se[2]),M(l,a,c?e.zmax:r,t,se,i)?(n.xmax=se[0],n.ymax=se[1],d&&(n.zmax=se[2]),p&&(n.mmin=e.mmin,n.mmax=e.mmax),n.spatialReference=i,n):null}function re(e,t,n,i,r,s,o=0){const l=new Array;for(const n of e)for(const e of n)l.push(e[0],e[1],t?e[2]:o);if(!(0,v.projectBuffer)(l,i,0,l,s,0))return!1;let a=0;r.length=0;const c=t||(0,u.xP)(s);for(const t of e){const e=new Array;for(const i of t)c&&n?e.push([l[a++],l[a++],l[a++],i[3]]):c?e.push([l[a++],l[a++],l[a++]]):n?(e.push([l[a++],l[a++],i[2]]),a++):(e.push([l[a++],l[a++]]),a++);r.push(e)}return!0}const se=(0,l.vt)()},95466:(e,t,n)=>{n.d(t,{A:()=>h});var i=n(49186),r=n(53966),s=n(91869),o=n(3330),l=n(12195),a=n(30524),u=n(98623),c=n(56400),p=n(28097);const d=new Map;class h{static fromJSON(e){return new h(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new h(e.fields??[],m(e))}static fromLayerJSON(e){return new h(e.fields??[],m(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const e of this.fields){const t=e?.name,i=g(t);if(t&&i){const r=f(t);this._fieldsMap.set(t,e),this._fieldsMap.set(r,e),this._normalizedFieldsMap.set(i,e),n.push(`${r}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,a.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,a.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,a.te)(e)||(0,a.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,a.te)(e)||(0,a.Xz)(e)||e.nullable||void 0!==(0,a.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(f(e))??this._normalizedFieldsMap.get(g(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(r.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new i.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):y.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?o.GB.instance:t===u.n$?p.mQ.utcInstance:(0,s.tE)(d,t,()=>p.oh.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,a.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>(0,l.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function f(e){return e.trim().toLowerCase()}function g(e){return(0,a.rS)(e)?.toLowerCase()??""}const y=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function m(e){const t=new Map;if(!e.fields)return t;const n=!0===e.datesInUnknownTimezone,{timeInfo:i,editFieldsInfo:r}=e,s=(i?"startField"in i?i.startField:i.startTimeField:"")??"",o=(i?"endField"in i?i.endField:i.endTimeField:"")??"",l=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,c.ZS)(e.dateFieldsTimeReference):null,a=r?function(e){return"timeZone"in e}(r)?r.timeZone??l:r.dateFieldsTimeReference?(0,c.ZS)(r.dateFieldsTimeReference):l??u.n$:null,p=i?function(e){return"timeZone"in e}(i)?i.timeZone??l:i.timeReference?(0,c.ZS)(i.timeReference):l:null,d=new Map([[f(r?.creationDateField??""),a],[f(r?.editDateField??""),a],[f(s),p],[f(o),p]]);for(const{name:i,type:r}of e.fields)if(y.has(r))t.set(i,u.L5);else if("date"!==r&&"esriFieldTypeDate"!==r)t.set(i,null);else if(n)t.set(i,u.L5);else{const e=d.get(f(i??""))??l;t.set(i,e)}return t}},96184:(e,t,n)=>{n.d(t,{A:()=>f});var i=n(31635),r=n(69540),s=n(25482),o=n(10107),l=(n(44208),n(53966),n(87811),n(36005)),a=n(64108),u=n(43937),c=n(79677),p=n(10184),d=n(56400);function h(e,t){return p.A.fromJSON({value:e,unit:t})}let f=class extends((0,r.OU)(s.o)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,t){return t.timeExtent&&Array.isArray(t.timeExtent)&&2===t.timeExtent.length?c.A.fromArray(t.timeExtent):null}writeFullTimeExtent(e,t){null!=e?.start&&null!=e.end?t.timeExtent=e.toArray():t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?h(t.timeInterval,t.timeIntervalUnits):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?h(t.defaultTimeInterval,t.defaultTimeIntervalUnits):null}writeInterval(e,t){t.timeInterval=e?.toJSON().value??null,t.timeIntervalUnits=e?.toJSON().unit??null}};(0,i.Cg)([(0,o.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],f.prototype,"cumulative",void 0),(0,i.Cg)([(0,o.MZ)({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],f.prototype,"endField",void 0),(0,i.Cg)([(0,o.MZ)({type:c.A,json:{write:{enabled:!0,allowNull:!0}}})],f.prototype,"fullTimeExtent",void 0),(0,i.Cg)([(0,l.w)("fullTimeExtent",["timeExtent"])],f.prototype,"readFullTimeExtent",null),(0,i.Cg)([(0,u.K)("fullTimeExtent")],f.prototype,"writeFullTimeExtent",null),(0,i.Cg)([(0,o.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"hasLiveData",void 0),(0,i.Cg)([(0,o.MZ)({type:p.A,json:{write:{enabled:!0,allowNull:!0}}})],f.prototype,"interval",void 0),(0,i.Cg)([(0,l.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],f.prototype,"readInterval",null),(0,i.Cg)([(0,u.K)("interval")],f.prototype,"writeInterval",null),(0,i.Cg)([(0,o.MZ)({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],f.prototype,"startField",void 0),(0,i.Cg)([(0,o.MZ)((0,d.P6)("timeReference",!0))],f.prototype,"timeZone",void 0),(0,i.Cg)([(0,o.MZ)({type:String,json:{write:{enabled:!0,allowNull:!0}}})],f.prototype,"trackIdField",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],f.prototype,"useTime",void 0),(0,i.Cg)([(0,o.MZ)({type:[Date],json:{read:!1}})],f.prototype,"stops",void 0),f=(0,i.Cg)([(0,a.$)("esri.layers.support.TimeInfo")],f)},99157:(e,t,n)=>{n.d(t,{A:()=>a});var i,r=n(31635),s=n(69622),o=n(10107),l=(n(44208),n(53966),n(87811),n(64108));let a=i=class extends s.A{constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new i({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,r.Cg)([(0,o.MZ)()],a.prototype,"isInverse",void 0),(0,r.Cg)([(0,o.MZ)()],a.prototype,"wkt",void 0),(0,r.Cg)([(0,o.MZ)()],a.prototype,"wkid",void 0),a=i=(0,r.Cg)([(0,l.$)("esri.geometry.operators.support.GeographicTransformationStep")],a)},99959:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(31635),r=(n(53966),n(44208),n(87811),n(49186),n(64108));let s=class{};s=(0,i.Cg)([(0,r.$)("esri.graphic.GraphicOrigin")],s)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3693],{3693:(e,t,n)=>{n.r(t),n.d(t,{registerFunctions:()=>Te});var r=n(52106),i=n(66131),a=n(47609),s=n(66395),o=n(59534),l=n(85935),u=n(93833),d=n(47423),c=n(93818),f=n(78878),p=n(80672),h=n(48938),m=n(78502),y=n(87449),g=n(11221),w=n(33325),I=n(80609),F=n(1262),A=n(88368);class b{constructor(e){this.field=e,this.sqlRewritable=!1}postInitialization(e,t){}}class N extends b{constructor(e){super(e),this.sqlRewritable=!0}extractValue(e){return e.attributes[this.field.name]}rewriteSql(e){return{rewritten:this.sqlRewritable,where:e}}}class S extends b{constructor(e,t,n){super((0,w.ke)(e)),this.originalField=e,this.sqlRewritable=!0,this.field.name=t,this.field.alias=n}rewriteSql(e,t){return{rewritten:this.sqlRewritable,where:(0,I.bD)(e,this.field.name,this.originalField.name,t.getFieldsIndex())}}extractValue(e){return e.attributes[this.originalField.name]}}class T extends b{constructor(e,t,n){super(e),this.codefield=t,this._stringToCode=n,this._codeToString={};for(const e in n)this._codeToString[n[e]]=e;this.sqlRewritable=!0}static{this.BADNESS="_!!!_BAD_LKP_!!!!"}rewriteSql(e,t){const n=this.evaluateNodeToWhereClause(e.parseTree,0,this.field.name,this.codefield instanceof A.A?(0,I.YY)(this.codefield,0):this.codefield,e.parameters);return n.includes(T.BADNESS)?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:A.A.create(n,{fieldsIndex:t._parent.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})}}evaluateNodeToWhereClause(e,t,n=null,r=null,i){switch(e.type){case"interval":return(0,I.oj)(this.evaluateNodeToWhereClause(e.value,t,n,r,i),e.qualifier,e.op);case"case-expression":{let r=" CASE ";"simple"===e.format&&(r+=this.evaluateNodeToWhereClause(e.operand,t,n,T.BADNESS,i));for(const a of e.clauses)r+=" WHEN "+this.evaluateNodeToWhereClause(a.operand,t,n,T.BADNESS,i)+" THEN "+this.evaluateNodeToWhereClause(a.value,t,n,T.BADNESS,i);return null!==e.else&&(r+=" ELSE "+this.evaluateNodeToWhereClause(e.else,t,n,T.BADNESS,i)),r+=" END ",r}case"parameter":{const n=i[e.value.toLowerCase()];return"string"==typeof n?"'"+n.toString().replaceAll("'","''")+"'":(0,w.$P)(n)||(0,w.Lk)(n)?(0,I.bm)(n,t):(0,w.eg)(n)?(0,I.F1)(n,t):(0,w.rX)(n)?(0,I.R8)(n,t):(0,w.f0)(n)?(0,I.Nf)(n,t):Array.isArray(n)?n.map(e=>"string"==typeof e?"'"+e.toString().replaceAll("'","''")+"'":(0,w.$P)(e)||(0,w.Lk)(e)?(0,I.bm)(e,t):(0,w.eg)(e)?(0,I.F1)(e,t):(0,w.rX)(e)?(0,I.R8)(e,t):(0,w.f0)(e)?(0,I.Nf)(e,t):e.toString()):n.toString()}case"expression-list":{const a=[];for(const s of e.value)a.push(this.evaluateNodeToWhereClause(s,t,n,r,i));return a}case"unary-expression":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,t,n,T.BADNESS,i)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" AND "+this.evaluateNodeToWhereClause(e.right,t,n,r,i)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" OR "+this.evaluateNodeToWhereClause(e.right,t,n,r,i)+") ";case"IS":if("null"!==e.right.type)throw new F.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new F.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IS NOT NULL )";case"IN":{if("expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const a=[];let s=!0;for(const t of e.right.value){if("string"!==t.type){s=!1;break}if(void 0===this._stringToCode[t.value]){s=!1;break}a.push(this._stringToCode[t.value].toString())}if(s)return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+a.join(",")+")) "}const a=this.evaluateNodeToWhereClause(e.right,t,n,r,i);return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+a.join(",")+")) "}const a=this.evaluateNodeToWhereClause(e.right,t,n,r,i);return Array.isArray(a)?" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+a.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" IN ("+a+")) "}case"NOT IN":{if("expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const a=[];let s=!0;for(const t of e.right.value){if("string"!==t.type){s=!1;break}if(void 0===this._stringToCode[t.value]){s=!1;break}a.push(this._stringToCode[t.value].toString())}if(s)return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+a.join(",")+")) "}const a=this.evaluateNodeToWhereClause(e.right,t,n,r,i);return" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+a.join(",")+")) "}const a=this.evaluateNodeToWhereClause(e.right,t,n,r,i);return Array.isArray(a)?" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+a.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,r,i)+" NOT IN ("+a+")) "}case"BETWEEN":{const r=this.evaluateNodeToWhereClause(e.right,t,n,T.BADNESS,i);return" ("+this.evaluateNodeToWhereClause(e.left,t,n,T.BADNESS,i)+" BETWEEN "+r[0]+" AND "+r[1]+" ) "}case"NOTBETWEEN":{const r=this.evaluateNodeToWhereClause(e.right,t,n,T.BADNESS,i);return" ("+this.evaluateNodeToWhereClause(e.left,t,n,T.BADNESS,i)+" NOT BETWEEN "+r[0]+" AND "+r[1]+" ) "}case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,n,T.BADNESS,i)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,T.BADNESS,i)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,T.BADNESS,i)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,T.BADNESS,i)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,n,T.BADNESS,i)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,T.BADNESS,i)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,n,T.BADNESS,i)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,n,T.BADNESS,i)+") ";case"<>":case"=":if("column-reference"===e.left.type&&"string"===e.right.type){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&void 0!==this._stringToCode[e.right.value.toString()])return" ("+r+" "+e.operator+" "+this._stringToCode[e.right.value.toString()].toString()+") "}else if("column-reference"===e.right.type&&"string"===e.left.type&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this._stringToCode[e.left.value.toString()].toString()+" "+e.operator+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,n,T.BADNESS,i)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,n,T.BADNESS,i)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,n,T.BADNESS,i)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,n,T.BADNESS,i)+") "}case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return(0,I.C6)(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return n&&n.toLowerCase()===e.column.toLowerCase()?"("+r+")":(0,I.Kb)(e);case"data-type":return e.value;case"function":{const r=this.evaluateNodeToWhereClause(e.args,t,n,T.BADNESS,i);return(0,I.F6)(e.name,r,t)}}throw new F.L("UnsupportedSyntax",{node:e.type})}extractValue(e){if(this.codefield instanceof A.A){const t=this.codefield.calculateValueCompiled(e);return this._codeToString[A.A.convertValueToStorageFormat(t)]}return this._codeToString[e.attributes[this.codefield]]}}class _ extends b{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:(0,I.bD)(e,this.field.name,(0,I.YY)(this._sql,0),t.getFieldsIndex())}}extractValue(e){return A.A.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}class C extends g.t{static findField(e,t){for(const n of e)if(n.name.toLowerCase()===t.toString().toLowerCase())return n;return null}constructor(e){super(),this.declaredClass="esri.arcade.featureset.actions.Adapted",this._maxProcessing=30,this._parent=e.parentfeatureset,this._adaptedFields=e.adaptedFields,this._extraFilter=e.extraFilter}_initialiseFeatureSet(){this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.fields=[];for(const e of this._adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _queryAll(){return await this._ensureLoaded(),this._extraFilter?(await this.query({abortSignal:h._})).features:this._calculateFields(await this._parent.queryAll(h._))}async query(e){let t=e.where??null;const n=this._reformulateWithoutAdaptions(t),r=n.cannot;t=n.where;let i=!1,a=e.orderBy;if(null!=a){i=!0;const e=[];for(const t of this._adaptedFields)if(!(t instanceof N)&&!0===a.scanForField(t.field.name)){if(!(t instanceof S)){a=null,i=!1;break}e.push({field:t.field.name,newfield:t.originalField.name})}a&&e.length>0&&(a=a.replaceFields(e))}null!=t?null!=this._extraFilter&&(t=(0,I.kg)(this._extraFilter,t)):t=this._extraFilter,await this._ensureLoaded();const s=await this._parent.query({...e,where:t,orderBy:a});return(0,y.dZ)(e.abortSignal),r?{...s,filterApplied:!1,ordered:!!i&&s.ordered,features:this._calculateFields(s.features)}:{...s,ordered:!!i&&s.ordered,features:this._calculateFields(s.features)}}async*_calculateFields(e){for await(const t of e)yield t.map(e=>{const t={};for(const n of this._adaptedFields)t[n.field.name]=n.extractValue(e);return new r.A({attributes:t,geometry:(0,m.Yq)(e.geometry)})})}async queryStat(e){let t=!1,n=e.field,r=this._reformulateWithoutAdaptions(n);t=r.cannot,n=r.where;let i=e.where??null;if(r=this._reformulateWithoutAdaptions(i),t=t||r.cannot,i=r.where,null!=i?null!==this._extraFilter&&(i=(0,I.kg)(this._extraFilter,i)):i=this._extraFilter,t)return null==i&&null==e.spatialFilter?this._manualStat(e.stat,n,e.limit??w.gO,e.abortSignal):{calculated:!1};const a=await this._parent.queryStat({...e,field:n,where:i});return a.calculated?a:null==i&&null==e.spatialFilter?this._manualStat(e.stat,n,e.limit??w.gO,e.abortSignal):{calculated:!1}}async canQueryAggregate(e){for(const t of e.groupBy)for(const e of this._adaptedFields)if(t.toLowerCase()===e.field.name.toLowerCase()&&!(e instanceof N))return!1;const t=[];for(const n of e.statistics)if(null!==n.workingexpr){const e=this._reformulateWithoutAdaptions(n.workingexpr);if(e.cannot)return!1;const r=n.clone();r.workingexpr=e.where,t.push(r)}else t.push(n);let n=e.where??null;const r=this._reformulateWithoutAdaptions(n);return!r.cannot&&(n=r.where,null!==n?null!==this._extraFilter&&(n=(0,I.kg)(this._extraFilter,n)):n=this._extraFilter,this._parent.canQueryAggregate({...e,statistics:t,where:n}))}async queryAggregate(e){const t=[];for(const n of e.statistics)if(null!==n.workingexpr){const e=this._reformulateWithoutAdaptions(n.workingexpr);if(e.cannot)throw new y.dr("NeverReach");const r=n.clone();r.workingexpr=e.where,t.push(r)}else t.push(n);let n=e.where??null;const r=this._reformulateWithoutAdaptions(n);if(r.cannot)throw new y.dr("NeverReach");return n=r.where,null!==n?null!==this._extraFilter&&(n=(0,I.kg)(this._extraFilter,n)):n=this._extraFilter,this._parent.queryAggregate({...e,statistics:t,where:n})}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(null!==e)for(const n of this._adaptedFields)if(!0===(0,I.Ju)(e,n.field.name)){const r=n.rewriteSql(e,this);if(!0!==r.rewritten){t.cannot=!0,t.where=null;break}t.where=r.where}return t}}var v=n(35704),x=n(4576);class D extends g.t{constructor(e){super(),this.declaredClass="esri.arcade.featureset.actions.OrderBy",this._maxProcessing=100,this._parent=e.parentfeatureset,this._orderByClause=e.orderbyclause}async _queryAll(){return(await this.query({abortSignal:h._})).features}async query(e){await this._ensureLoaded();const t=await this._parent.query({...e,orderBy:null==e.orderBy?this._orderByClause:e.orderBy});return(0,y.dZ)(e.abortSignal),!1===t.ordered?{...t,ordered:!0,features:this._sortFeatures(t.features,e.abortSignal)}:t}async*_sortFeatures(e,t){const n=[];for await(const r of e)n.push(r),await(0,f.a2)(),(0,y.dZ)(t);const r=n.flat();this._orderByClause.order(r);for(const e of(0,x.Ho)(r,this._maxQueryRate()))yield e}async queryStat(e){const t=await this._parent.queryStat(e);return t.calculated?t:null==e.where&&null==e.spatialFilter?this._manualStat(e.stat,e.field,e.limit??w.gO,e.abortSignal):{calculated:!1}}async canQueryAggregate(e){return this._parent.canQueryAggregate(e)}async queryAggregate(e){return this._parent.queryAggregate(e)}getFieldsIndex(){return this._parent.getFieldsIndex()}}function E(e,t){return e===t?0:null===e?-1:null===t?1:e<t?-1:1}class k{constructor(e){const t=e.split(",");this._fields=[],this._directions=[];for(let e=0;e<t.length;e++){const n=t[e].match(/\S+/g);this._fields.push(n[0]),2===n.length?"asc"===n[1].toLowerCase()?this._directions.push(1):this._directions.push(0):this._directions.push(1)}}constructClause(){let e="";for(let t=0;t<this._fields.length;t++)0!==t&&(e+=","),e+=this._fields[t],1===this._directions[t]?e+=" ASC":e+=" DESC";return e}order(e){e.sort((e,t)=>{for(let n=0;n<this._fields.length;n++){const r=this.featureValue(e,this._fields[n],n),i=this.featureValue(t,this._fields[n],n);let a=0;if(a=1===this._directions[n]?E(r,i):-1*E(r,i),0!==a)return a}return 0})}scanForField(e){for(let t=0;t<this._fields.length;t++)if(this._fields[t].toLowerCase().trim()===e.toLowerCase().trim())return!0;return!1}replaceFields(e){let t="";for(let n=0;n<this._fields.length;n++){0!==n&&(t+=",");let r=this._fields[n];for(const t of e)if(r.toLowerCase()===t.field.toLowerCase()){r=t.newfield;break}t+=r,1===this._directions[n]?t+=" ASC":t+=" DESC"}return new k(t)}featureValue(e,t,n){const r=e.attributes[t];if(void 0!==r)return r;for(const r in e.attributes)if(t.toLowerCase()===r.toLowerCase())return this._fields[n]=r,e.attributes[r];return null}}class L{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new L;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,n,r){const i=new L;i.field=e;const a=A.A.create(t,{fieldsIndex:n,timeZone:r}),s=function(e){if("function"===e.parseTree.type){if(0===e.parseTree.args.value.length)return{name:e.parseTree.name,expr:null};if(e.parseTree.args.value.length>1)throw new F.L("MissingStatisticParameters");const t=A.A.create((0,I.Mi)(e.parseTree.args.value[0],0,e.parameters),{fieldsIndex:e.fieldsIndex,timeZone:e.timeZone,currentUser:e.currentUser});return{name:e.parseTree.name,expr:t}}return null}(a);if(null===s)throw new F.L("UnsupportedSqlFunction",{function:""});const o=s.name.toUpperCase().trim();if("MIN"===o){if(i.typeofstat="MIN",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"min"})}else if("MAX"===o){if(i.typeofstat="MAX",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"max"})}else if("COUNT"===o)i.typeofstat="COUNT",i.workingexpr=s.expr;else if("STDEV"===o){if(i.typeofstat="STDDEV",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"stdev"})}else if("SUM"===o){if(i.typeofstat="SUM",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"sum"})}else if("MEAN"===o){if(i.typeofstat="AVG",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:o})}else if("AVG"===o){if(i.typeofstat="AVG",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"avg"})}else{if("VAR"!==o)throw new F.L("UnsupportedSqlFunction",{function:o});if(i.typeofstat="VAR",i.workingexpr=s.expr,null===a)throw new F.L("InvalidFunctionParameters",{function:"var"})}return i}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}}var U=n(80200),$=n(74639),j=n(44729),Z=n(55612),B=n(15032),M=n(20437);const W=new o.b(["MIN","MAX","VAR","STDDEV","COUNT","SUM","AVG"],[["VARIANCE","VAR"],["AVERAGE","AVG"],["MEAN","AVG"],["STDEV","STDDEV"]]);class R extends g.t{constructor(e){super(),this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._decodedStatsFields=[],this._decodedGroupByFields=[],this._canDoSimpleGroupBy=!0,this._physicalGroupByFields=[],this.objectIdField="ROW__ID",this._adaptedFields=[],this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}_nextUniqueName(e){for(;1===e["T"+this._uniqueIds.toString()];)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e=this._parent.getFieldsIndex();this.objectIdField="ROW__ID",this.globalIdField="";let t=!1,n=1;for(;!1===t;){let e=!1;for(const t of this._config.groupbyfields)if(t.name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}if(!1===e)for(const t of this._config.statsfields)if(t.name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}!1===e?t=!0:(this.objectIdField="ROW__ID"+n.toString(),n++)}for(const t of this._config.statsfields){const n=new L;n.field=t.name,n.tofieldname=t.name,n.workingexpr=t.expression instanceof A.A?t.expression:A.A.create(t.expression,{fieldsIndex:e,timeZone:this.dateFieldsTimeZoneDefaultUTC}),n.typeofstat=W.lookup(t.statistic)??"COUNT",this._decodedStatsFields.push(n)}this._decodedGroupByFields=[];for(const t of this._config.groupbyfields){const n={name:t.name,singlefield:null,tofieldname:t.name,expression:t.expression instanceof A.A?t.expression:A.A.create(t.expression,{fieldsIndex:e,timeZone:this.dateFieldsTimeZoneDefaultUTC}),sqlType:null};this._decodedGroupByFields.push(n)}const r={};this.geometryType=this._parent.geometryType,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField="";for(const e of this._parent.fields)r[e.name.toUpperCase()]=1;this.types=null,this.subtypes=null,this.subtypeField="",this.fields=[];const i=new L;i.field=this._nextUniqueName(r),i.tofieldname=this.objectIdField,i.workingexpr=A.A.create(this._parent.objectIdField,{fieldsIndex:this._parent.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),i.typeofstat="MIN",this._decodedStatsFields.push(i);for(const e of this._decodedGroupByFields){const t=new M.A;if(e.name=this._nextUniqueName(r),t.name=e.tofieldname,t.alias=t.name,(0,I.DA)(e.expression)){const n=this._parent.getField((0,I.YY)(e.expression,0));if(!n)throw new y.dr("AggregationFieldNotFound");e.name=n.name,e.singlefield=n.name,this._physicalGroupByFields.push(n.name),t.type=n.type,e.sqlType=n.type}else{t.type=this._convertToEsriFieldType((0,I.IY)(e.expression,this._parent.fields));const n=new M.A;n.name=e.name,n.alias=n.name,this._physicalGroupByFields.push(e.name),this._adaptedFields.push(new _(n,e.expression)),this._canDoSimpleGroupBy=!1,e.sqlType=t.type}this.fields.push(t)}if(this._adaptedFields.length>0)for(const e of this._parent.fields)this._adaptedFields.push(new N(e));for(const e of this._decodedStatsFields){const t=new M.A;let n=null;e.field=this._nextUniqueName(r),t.name=e.tofieldname,t.alias=t.name;const i=null!==e.workingexpr&&(0,I.DA)(e.workingexpr)?(0,I.YY)(e.workingexpr,0):"";switch(e.typeofstat){case"SUM":if(""!==i){if(n=this._parent.getField(i),!n)throw new y.dr("AggregationFieldNotFound");t.type=n.type}else t.type="double";break;case"MIN":case"MAX":if(""!==i){if(n=this._parent.getField(i),!n)throw new y.dr("AggregationFieldNotFound");t.type=n.type}else t.type="double";break;case"COUNT":t.type="integer";break;case"STDDEV":case"VAR":case"AVG":if(""!==i&&(n=this._parent.getField(i),!n))throw new y.dr("AggregationFieldNotFound");t.type="double"}this.fields.push(t)}}async _queryAll(){return(await this.query({abortSignal:h._})).features}async query(e){if(null!=e.spatialFilter)return g.A;const t={ordered:!1,nowhereclause:!1};await this._ensureLoaded();let n=e.where;if(null!=n)for(const e of this._decodedStatsFields)if(!0===(0,I.Ju)(n,e.tofieldname)){t.nowhereclause=!0,n=null;break}let r=e.orderBy;if(null!=r){t.ordered=!0;for(const e of this._decodedStatsFields)if(!0===r.scanForField(e.tofieldname)){r=null,t.ordered=!1;break}if(null!==r)for(const e of this._decodedGroupByFields)if(null===e.singlefield&&!0===r.scanForField(e.tofieldname)){r=null,t.ordered=!1;break}}if(!1!==this._canDoSimpleGroupBy&&await this._parent.canQueryAggregate({groupBy:this._physicalGroupByFields,statistics:this._decodedStatsFields,where:null,spatialFilter:null,abortSignal:e.abortSignal})){const i=await this._parent.queryAggregate({groupBy:this._physicalGroupByFields,statistics:this._decodedStatsFields,where:n?this._reformulateWhereClauseWithoutGroupByFields(n):null,spatialFilter:null,orderBy:r?this._reformulateOrderClauseWithoutGroupByFields(r):null,abortSignal:e.abortSignal});return(0,y.dZ)(e.abortSignal),{...i,filterApplied:!t.nowhereclause&&i.filterApplied,ordered:!0===t.ordered&&i.ordered,features:this._fixAggregateAttributeNames(i.features)}}const i=this._adaptedFields.length>0?new C({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null}):this._parent;if(!0===t.nowhereclause){const t=new D({parentfeatureset:i,orderbyclause:new k(this._physicalGroupByFields.join(",")+","+this._parent.objectIdField+" ASC")});return{filterApplied:!1,spatialFilterApplied:!1,ordered:!1,features:this._aggregateSortedFeatureGroups((await t.query({abortSignal:e.abortSignal})).features,this._maxQuery,e.abortSignal)}}let a=i;null!=n&&(a=new v.A({parentfeatureset:a,whereclause:this._reformulateWhereClauseWithoutGroupByFields(n)}));const s=new D({parentfeatureset:a,orderbyclause:new k(this._physicalGroupByFields.join(",")+","+this._parent.objectIdField+" ASC")});return{filterApplied:!1,spatialFilterApplied:!1,ordered:!1,features:this._aggregateSortedFeatureGroups((await s.query({abortSignal:e.abortSignal})).features,this._maxQuery,e.abortSignal)}}async*_fixAggregateAttributeNames(e){for await(const t of e)yield t.map(e=>{const t={geometry:e.geometry,attributes:{}},n={};for(const t in e.attributes)n[t.toLowerCase()]=e.attributes[t];for(const e of this._decodedGroupByFields)t.attributes[e.tofieldname]=n[e.name.toLowerCase()];for(const e of this._decodedStatsFields)t.attributes[e.tofieldname]=n[e.field.toLowerCase()];return new r.A(t)})}async*_aggregateSortedFeatureGroups(e,t,n){let r=null,i=[];for await(const a of e){await(0,f.a2)(),(0,y.dZ)(n);for(const e of a){const t=this._generateAggregateHash(e);null==r?r={features:[e],id:t}:t!==r.id?(i.push(this._calculateAndAppendAggregateItem(r)),r={features:[e],id:t}):r.features.push(e)}i.length>=t&&(yield i,i=[])}null!=r&&(i.push(this._calculateAndAppendAggregateItem(r)),yield i)}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new y.dr("NeverReach")}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsFields)e=(0,I.bD)(e,t.tofieldname,(0,I.YY)(t.workingexpr,0),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupByFields)t.tofieldname!==t.name&&(e=(0,I.bD)(e,t.tofieldname,(0,I.YY)(t.expression,0),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const e of this._decodedGroupByFields)e.tofieldname!==e.name&&t.push({field:e.tofieldname,newfield:e.name});return t.length>0?e.replaceFields(t):e}_calculateFieldStat(e,t,n){const r=[];for(const n of e.features)if(null!==t.workingexpr){const e=t.workingexpr.calculateValue(n);null!==e&&(e instanceof j.n||e instanceof B.k?r.push(e.toNumber()):e instanceof Z.g?r.push(e.toMilliseconds()):r.push(e))}else r.push(null);n.attributes[t.tofieldname]=(0,$.s)(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{}};for(const n of this._decodedGroupByFields){const r=n.singlefield?e.features[0].attributes[n.singlefield]:A.A.convertValueToStorageFormat(n.expression.calculateValue(e.features[0]),n.sqlType);t.attributes[n.tofieldname]=r}for(const n of this._decodedStatsFields)this._calculateFieldStat(e,n,t);return new r.A(t)}_generateAggregateHash(e){let t="";for(const n of this._decodedGroupByFields){const r=n.singlefield?e.attributes[n.singlefield]:n.expression.calculateValue(e);t+=null==r?":":":"+r.toString()}return(0,U.d)(t,U.T.String)}async getFeatureByObjectId(){return null}}async function*q(e,t){let n=t;for await(const t of e)if(n>=t.length?(n-=t.length,yield t):(yield t.slice(0,n),n=0),n<=0)break}class P extends g.t{constructor(e){super(),this.declaredClass="esri.arcade.featureset.actions.Top",this._maxProcessing=100,this._parent=e.parentfeatureset,this._limit=e.topnum}async _queryAll(){return(await this.query({abortSignal:h._})).features}async query(e){await this._ensureLoaded();const t=await this._parent.queryAll(e.abortSignal);return{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter,ordered:!1,features:q(t,this._limit)}}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new y.dr("NeverReach")}getFieldsIndex(){return this._parent.getFieldsIndex()}}var O=n(85978),V=n(30235),G=n(334),K=n(74887),J=n(68654),H=n(20655),z=n(11254),Q=n(51447),Y=n(53966),X=n(66552);new X.J({Clean:"clean",Dirty:"dirty"}),new X.J({Physical:"physical",Virtual:"virtual"}),new X.J({"Start and end":"start-and-end",Start:"start",Midspan:"midspan",End:"end"}),new X.J({startingPoint:"starting-point",barrier:"barrier",stoppingPoint:"stopping-point"}),new X.J({connected:"connected",upstream:"upstream",downstream:"downstream",shortestPath:"shortest-path",subnetwork:"subnetwork",subnetworkController:"subnetwork-controller",loops:"loops",isolation:"isolation",path:"path",circuit:"circuit"});const ee="{00000000-0000-0000-0000-000000000000}",te=new X.J({junctionJunctionConnectivity:"junction-junction-connectivity",connectivity:"connectivity",attachment:"attachment",containment:"containment",junctionEdgeFromConnectivity:"junction-edge-from-connectivity",junctionEdgeMidspanConnectivity:"junction-edge-midspan-connectivity",junctionEdgeToConnectivity:"junction-edge-to-connectivity"});new X.J({normal:"normal",rebuild:"rebuild",forceRebuild:"force-rebuild"});var ne=n(2272),re=n(31635),ie=n(25482),ae=n(10107),se=(n(44208),n(87811),n(64108)),oe=n(36005),le=n(43937),ue=n(82799);let de=class extends ie.o{constructor(e){super(e),this.type="networkElement",this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null}};(0,re.Cg)([(0,ae.MZ)({json:{write:!1}})],de.prototype,"type",void 0),(0,re.Cg)([(0,ae.MZ)({type:Number,json:{write:!0}})],de.prototype,"assetGroupCode",void 0),(0,re.Cg)([(0,ae.MZ)({type:Number,json:{write:!0}})],de.prototype,"assetTypeCode",void 0),(0,re.Cg)([(0,ae.MZ)({type:String,json:{write:!0}})],de.prototype,"globalId",void 0),(0,re.Cg)([(0,ae.MZ)({type:Number,json:{write:!0}})],de.prototype,"networkSourceId",void 0),(0,re.Cg)([(0,ae.MZ)({type:Number,json:{write:!0}})],de.prototype,"objectId",void 0),(0,re.Cg)([(0,ae.MZ)({type:Number,json:{write:!0}})],de.prototype,"positionFrom",void 0),(0,re.Cg)([(0,ae.MZ)({type:Number,json:{write:!0}})],de.prototype,"positionTo",void 0),(0,re.Cg)([(0,ae.MZ)({type:Number,json:{write:!0}})],de.prototype,"terminalId",void 0),de=(0,re.Cg)([(0,se.$)("esri.rest.networks.support.NetworkElement")],de);let ce=class extends de{constructor(e){super(e),this.type="telecomNetworkElement",this.firstUnit=null,this.numUnits=null}};(0,re.Cg)([(0,ae.MZ)({json:{write:!1}})],ce.prototype,"type",void 0),(0,re.Cg)([(0,ae.MZ)({json:{write:!0}})],ce.prototype,"firstUnit",void 0),(0,re.Cg)([(0,ae.MZ)({json:{write:!0}})],ce.prototype,"numUnits",void 0),ce=(0,re.Cg)([(0,se.$)("esri.rest.networks.support.TelecomNetworkElement")],ce);let fe=class extends ie.o{constructor(e){super(e),this.globalId=null,this.associationType=null,this.fromNetworkElement=null,this.toNetworkElement=null,this.geometry=null,this.errorMessage=null,this.percentAlong=null,this.errorCode=null,this.isContentVisible=null,this.status=null}readFromNetworkElement(e,t){return t.fromFirstUnit||t.fromNumUnits?new ce({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId,firstUnit:t.fromFirstUnit,numUnits:t.fromNumUnits}):new de({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId})}writeFromNetworkElement(e,t){if(e&&(t.fromGlobalId=e.globalId,t.fromNetworkSourceId=e.networkSourceId,t.fromTerminalId=e.terminalId,"telecomNetworkElement"===e.type)){const n=e;t.fromFirstUnit=n.firstUnit,t.fromNumUnits=n.numUnits}}readToNetworkElement(e,t){return t.toFirstUnit||t.toNumUnits?new ce({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId,firstUnit:t.toFirstUnit,numUnits:t.toNumUnits}):new de({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId})}writeToNetworkElement(e,t){if(e&&(t.toGlobalId=e.globalId,t.toNetworkSourceId=e.networkSourceId,t.toTerminalId=e.terminalId,"telecomNetworkElement"===e.type)){const n=e;t.toFirstUnit=n.firstUnit,t.toNumUnits=n.numUnits}}equals(e){if(this.globalId===ee&&e.globalId===ee){function t(e,t){return e.networkSourceId===t.networkSourceId&&e.globalId===t.globalId&&e.terminalId===t.terminalId&&e.firstUnit===t.firstUnit&&e.numUnits===t.numUnits}const n=this.fromNetworkElement,r=this.toNetworkElement,i=e.fromNetworkElement,a=e.toNetworkElement,s=t(n,i),o=t(r,a);return s&&o&&this.associationType===e.associationType}return null!=this.globalId&&null!=e.globalId&&this.globalId===e.globalId}};(0,re.Cg)([(0,ae.MZ)({type:String,json:{write:!0}})],fe.prototype,"globalId",void 0),(0,re.Cg)([(0,ae.MZ)({type:te.apiValues,json:{type:te.jsonValues,read:te.read,write:te.write}})],fe.prototype,"associationType",void 0),(0,re.Cg)([(0,ae.MZ)({type:de,json:{write:{target:{fromGlobalId:{type:String},fromNetworkSourceId:{type:Number},fromTerminalId:{type:Number},fromFirstUnit:{type:Number},fromNumUnits:{type:Number}}},read:{source:["fromGlobalId","fromNetworkSourceId","fromTerminalId","fromFirstUnit","fromNumUnits"]}}})],fe.prototype,"fromNetworkElement",void 0),(0,re.Cg)([(0,oe.w)("fromNetworkElement")],fe.prototype,"readFromNetworkElement",null),(0,re.Cg)([(0,le.K)("fromNetworkElement")],fe.prototype,"writeFromNetworkElement",null),(0,re.Cg)([(0,ae.MZ)({type:de,json:{write:{target:{toGlobalId:{type:String},toNetworkSourceId:{type:Number},toTerminalId:{type:Number},toFirstUnit:{type:Number},toNumUnits:{type:Number}}},read:{source:["toGlobalId","toNetworkSourceId","toTerminalId","toFirstUnit","toNumUnits"]}}})],fe.prototype,"toNetworkElement",void 0),(0,re.Cg)([(0,oe.w)("toNetworkElement")],fe.prototype,"readToNetworkElement",null),(0,re.Cg)([(0,le.K)("toNetworkElement")],fe.prototype,"writeToNetworkElement",null),(0,re.Cg)([(0,ae.MZ)({type:ue.A,json:{write:!0}})],fe.prototype,"geometry",void 0),(0,re.Cg)([(0,ae.MZ)({type:String,json:{write:!0}})],fe.prototype,"errorMessage",void 0),(0,re.Cg)([(0,ae.MZ)({type:Number,json:{write:!0}})],fe.prototype,"percentAlong",void 0),(0,re.Cg)([(0,ae.MZ)({type:Number,json:{write:!0}})],fe.prototype,"errorCode",void 0),(0,re.Cg)([(0,ae.MZ)({type:Boolean,json:{write:!0}})],fe.prototype,"isContentVisible",void 0),(0,re.Cg)([(0,ae.MZ)({type:Number,json:{write:!0}})],fe.prototype,"status",void 0),fe=(0,re.Cg)([(0,se.$)("esri.rest.networks.support.Association")],fe);let pe=class extends ie.o{constructor(e){super(e),this.associations=[]}};function he(e){const{returnDeletes:t,elements:n,gdbVersion:r,moment:i}=e.toJSON();return{returnDeletes:t,elements:JSON.stringify(n.map(e=>({globalId:e.globalId,networkSourceId:e.networkSourceId,terminalId:e.terminalId}))),types:JSON.stringify(e.types.map(e=>te.toJSON(e))).replaceAll('"connectivity"','"junctionJunctionConnectivity"'),gdbVersion:r,moment:i??Date.now()}}(0,re.Cg)([(0,ae.MZ)({type:[fe],json:{write:!0}})],pe.prototype,"associations",void 0),pe=(0,re.Cg)([(0,se.$)("esri.rest.networks.support.QueryAssociationsResult")],pe);var me,ye=n(56507);let ge=me=class extends ie.o{static from(e){return(0,ye.PZ)(me,e)}constructor(e){super(e),this.returnDeletes=!1,this.elements=[],this.types=[],this.gdbVersion=null,this.moment=null}};(0,re.Cg)([(0,ae.MZ)({type:Boolean,json:{write:!0}})],ge.prototype,"returnDeletes",void 0),(0,re.Cg)([(0,ae.MZ)({type:[de],json:{write:!0}})],ge.prototype,"elements",void 0),(0,re.Cg)([(0,ae.MZ)({type:[te.apiValues],json:{type:te.jsonValues,read:te.read,write:te.write}})],ge.prototype,"types",void 0),(0,re.Cg)([(0,ae.MZ)({type:String,json:{write:!0}})],ge.prototype,"gdbVersion",void 0),(0,re.Cg)([(0,ae.MZ)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?.getTime()}}}})],ge.prototype,"moment",void 0),ge=me=(0,re.Cg)([(0,se.$)("esri.rest.networks.support.QueryAssociationsParameters")],ge);var we=n(54218);function Ie(e,t,n){const r=e.getVariables();if(r.length>0){const i={};for(const e of r)i[e]=t.evaluateIdentifier(n,{name:e});e.parameters=i}return e}function Fe(e,t,n=null){for(const n in e)if(n.toLowerCase()===t.toLowerCase())return e[n];return n}function Ae(e){if(null===e)return null;const t={type:Fe(e,"type",""),name:Fe(e,"name","")};if("range"===t.type)t.range=Fe(e,"range",[]);else{t.codedValues=[];for(const n of Fe(e,"codedValues",[]))t.codedValues.push({name:Fe(n,"name",""),code:Fe(n,"code",null)})}return t}function be(e){if(null===e)return null;const t={},n=Fe(e,"wkt");null!==n&&(t.wkt=n);const r=Fe(e,"wkid");return null!==r&&(t.wkid=r),t}function Ne(e){if(null===e)return null;const t={hasZ:Fe(e,"hasz",!1),hasM:Fe(e,"hasm",!1)},n=Fe(e,"spatialreference");null!=n&&(t.spatialReference=be(n));const r=Fe(e,"x",null);if(null!==r)return t.x=r,t.y=Fe(e,"y",null),t.hasZ&&(t.z=Fe(e,"z",null)),t.hasM&&(t.m=Fe(e,"m",null)),t;const i=Fe(e,"rings",null);if(null!==i)return t.rings=i,t;const a=Fe(e,"paths",null);if(null!==a)return t.paths=a,t;const s=Fe(e,"points",null);if(null!==s)return t.points=s,t;for(const n of["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"]){const r=Fe(e,n,null);null!==r&&(t[n]=r)}return t}function Se(e){return"utc"===e?.toLowerCase()?"UTC":"unknown"===e?.toLowerCase()?"Unknown":e}function Te(e){if("async"===e.mode){e.functions.timezone=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,a)=>{if((0,f.B)(a,1,2,t,n),(0,f.g)(a[0]))return"Unknown";if((0,f.f)(a[0]))return"Unknown";if((0,f.m)(a[0])){if(await a[0].load(),1===a.length||null===a[1])return a[0].datesInUnknownTimezone?Se("unknown"):Se(a[0].dateFieldsTimeZone);if(!(a[1]instanceof s.A)||!1===a[1].hasField("type"))throw new l.D$(t,"InvalidParameter",n);const e=a[1].field("type");if(!1===(0,we.Kg)(e))throw new l.D$(t,"InvalidParameter",n);switch((0,f.u)(e).toLowerCase()){case"preferredtimezone":return Se(a[0].preferredTimeZone);case"editfieldsinfo":return Se(a[0].editFieldsInfo?.timeZone??null);case"timeinfo":return Se(a[0].timeInfo?.timeZone??null);case"field":if(a[1].hasField("fieldname")&&(0,we.Kg)(a[1].field("fieldname")))return Se(a[0].fieldTimeZone((0,f.u)(a[1].field("fieldname"))))}throw new l.D$(t,"InvalidParameter",n)}const o=(0,f.O)(a[0],(0,f.K)(t));if(null===o)return null;const u=o.timeZone;return"system"===u?i.lY.systemTimeZoneCanonicalName:"utc"===u.toLowerCase()?"UTC":"unknown"===u.toLowerCase()?"Unknown":u})},e.functions.sqltimestamp=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{(0,f.B)(i,1,3,t,n);const a=i[0];if((0,f.e)(a)){if(1===i.length)return a.toSQLWithKeyword();if(2===i.length)return a.changeTimeZone((0,f.u)(i[1])).toSQLWithKeyword();throw new l.D$(t,"InvalidParameter",n)}if((0,f.f)(a))return a.toSQLWithKeyword();if((0,f.m)(a)){if(3!==i.length)throw new l.D$(t,"InvalidParameter",n);await a.load();const e=(0,f.u)(i[1]);if((0,f.f)(i[2]))return i[2].toSQLWithKeyword();if(!1===(0,f.e)(i[2]))throw new l.D$(t,"InvalidParameter",n);const r=a.fieldTimeZone(e);return null==r?i[2].toSQLWithKeyword():i[2].changeTimeZone(r).toSQLWithKeyword()}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"sqltimestamp",min:2,max:4}),e.functions.featuresetbyid=function(t,n){return e.standardFunctionAsync(t,n,(e,r,i)=>{if((0,f.B)(i,2,4,t,n),(0,f.l)(i[0])){const e=(0,f.u)(i[1]);let r=(0,f.J)(i[2],null);const a=(0,f.H)((0,f.J)(i[3],!0));if(null===r&&(r=["*"]),!1===(0,we.cy)(r))throw new l.D$(t,"InvalidParameter",n);return i[0].featureSetById(e,a,r)}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"featuresetbyid",min:2,max:4});const t=new o.b(["datasource","parent","root"]);e.functions.getfeatureset=function(n,r){return e.standardFunctionAsync(n,r,async(e,i,a)=>{if((0,f.B)(a,1,2,n,r),(0,f.k)(a[0])){const e=null==a[1]?"datasource":t.lookup((0,f.u)(a[1]));return(0,d.convertToFeatureSet)(a[0].fullSchema(),e,n.lrucache,n.interceptor,n.spatialReference)}throw new l.D$(n,"InvalidParameter",r)})},e.signatures.push({name:"getfeatureset",min:1,max:2}),e.functions.featuresetbyportalitem=function(t,n){return e.standardFunctionAsync(t,n,(e,r,i)=>{if((0,f.B)(i,2,5,t,n),null===i[0])throw new l.D$(t,"PortalRequired",n);if(i[0]instanceof a.A){const e=(0,f.u)(i[1]),r=(0,f.u)(i[2]);let a=(0,f.J)(i[3],null);const s=(0,f.H)((0,f.J)(i[4],!0));if(null===a&&(a=["*"]),!1===(0,we.cy)(a))throw new l.D$(t,"InvalidParameter",n);let o;return o=t.services?.portal?t.services.portal:H.A.getDefault(),o=(0,p.R)(i[0],o),(0,d.constructFeatureSetFromPortalItem)(e,r,t.spatialReference,a,s,o,t.lrucache,t.interceptor)}if(!1===(0,we.Kg)(i[0]))throw new l.D$(t,"PortalRequired",n);const s=(0,f.u)(i[0]),o=(0,f.u)(i[1]);let u=(0,f.J)(i[2],null);const c=(0,f.H)((0,f.J)(i[3],!0));if(null===u&&(u=["*"]),!1===(0,we.cy)(u))throw new l.D$(t,"InvalidParameter",n);return(0,d.constructFeatureSetFromPortalItem)(s,o,t.spatialReference,u,c,t.services?.portal??H.A.getDefault(),t.lrucache,t.interceptor)})},e.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),e.functions.featuresetbyname=function(t,n){return e.standardFunctionAsync(t,n,(e,r,i)=>{if((0,f.B)(i,2,4,t,n),(0,f.l)(i[0])){const e=(0,f.u)(i[1]);let r=(0,f.J)(i[2],null);const a=(0,f.H)((0,f.J)(i[3],!0));if(null===r&&(r=["*"]),!1===(0,we.cy)(r))throw new l.D$(t,"InvalidParameter",n);return i[0].featureSetByName(e,a,r)}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"featuresetbyname",min:2,max:4}),e.functions.featureset=function(t,n){return e.standardFunction(t,n,(e,r,i)=>{(0,f.B)(i,1,1,t,n);const a={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if((0,we.Kg)(i[0])){const e=JSON.parse(i[0]);void 0!==e.layerDefinition?(a.layerDefinition=e.layerDefinition,a.featureSet=e.featureSet,e.layerDefinition.spatialReference&&(a.layerDefinition.spatialReference=e.layerDefinition.spatialReference)):(a.featureSet.features=e.features,a.featureSet.geometryType=e.geometryType,a.layerDefinition.geometryType=a.featureSet.geometryType,a.layerDefinition.objectIdField=e.objectIdFieldName??"",a.layerDefinition.typeIdField=e.typeIdFieldName,a.layerDefinition.globalIdField=e.globalIdFieldName,a.layerDefinition.fields=e.fields,e.spatialReference&&(a.layerDefinition.spatialReference=e.spatialReference))}else{if(!(i[0]instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const e=JSON.parse(i[0].castToText(!0)),r=Fe(e,"layerdefinition");if(null!==r){a.layerDefinition.geometryType=Fe(r,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.globalIdField=Fe(r,"globalidfield",""),a.layerDefinition.objectIdField=Fe(r,"objectidfield",""),a.layerDefinition.typeIdField=Fe(r,"typeidfield",""),a.layerDefinition.hasZ=!0===Fe(r,"hasz",!1),a.layerDefinition.hasM=!0===Fe(r,"hasm",!1);const t=Fe(r,"spatialreference");t&&(a.layerDefinition.spatialReference=be(t));const n=[];for(const e of Fe(r,"fields",[])){const t={name:Fe(e,"name",""),alias:Fe(e,"alias",""),type:Fe(e,"type",""),nullable:Fe(e,"nullable",!0),editable:Fe(e,"editable",!0),length:Fe(e,"length",null),domain:Ae(Fe(e,"domain"))};n.push(t)}a.layerDefinition.fields=n;const i=Fe(e,"featureset");if(i){const e={};for(const t of n)e[t.name.toLowerCase()]=t.name;for(const t of Fe(i,"features",[])){const n={},r=Fe(t,"attributes",{});for(const t in r)n[e[t.toLowerCase()]]=r[t];a.featureSet.features.push({attributes:n,geometry:Ne(Fe(t,"geometry"))})}}}else{a.layerDefinition.hasZ=!0===Fe(e,"hasz",!1),a.layerDefinition.hasM=!0===Fe(e,"hasm",!1),a.layerDefinition.geometryType=Fe(e,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.objectIdField=Fe(e,"objectidfieldname",""),a.layerDefinition.typeIdField=Fe(e,"typeidfieldname","");const r=Fe(e,"spatialreference");r&&(a.layerDefinition.spatialReference=be(r));const i=[],s=Fe(e,"fields",null);if(!(0,we.cy)(s))throw new l.D$(t,"InvalidParameter",n);for(const e of s){const t={name:Fe(e,"name",""),alias:Fe(e,"alias",""),type:Fe(e,"type",""),nullable:Fe(e,"nullable",!0),editable:Fe(e,"editable",!0),length:Fe(e,"length",null),domain:Ae(Fe(e,"domain"))};i.push(t)}a.layerDefinition.fields=i;const o={};for(const e of i)o[e.name.toLowerCase()]=e.name;let u=Fe(e,"features",null);if((0,we.cy)(u))for(const e of u){const t={},n=Fe(e,"attributes",{});for(const e in n)t[o[e.toLowerCase()]]=n[e];a.featureSet.features.push({attributes:t,geometry:Ne(Fe(e,"geometry",null))})}else u=null,a.featureSet.features=u}}}if(!1===function(e){return!!e.layerDefinition&&!!e.featureSet&&!1!==function(e){for(const t of["",null,"esriGeometryNull","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])if(t===e)return!0;return!1}(e.layerDefinition.geometryType)&&!1!==(0,we.cy)(e.layerDefinition.fields)&&!1!==(0,we.cy)(e.featureSet.features)}(a))throw new l.D$(t,"InvalidParameter",n);return a.layerDefinition.geometryType||(a.layerDefinition.geometryType="esriGeometryNull"),V.A.create(a,t.spatialReference)})},e.signatures.push({name:"featureset",min:1,max:1}),e.functions.filter=function(t,n){return e.standardFunctionAsync(t,n,async(r,i,a)=>{if((0,f.B)(a,2,2,t,n),(0,we.cy)(a[0])||(0,f.j)(a[0])){const e=[];let r,i=a[0];if(i instanceof c.A&&(i=i.toArray()),!(0,f.i)(a[1]))throw new l.D$(t,"InvalidParameter",n);r=a[1].createFunction(t);for(const t of i){const n=r(t);(0,K.$X)(n)?!0===await n&&e.push(t):!0===n&&e.push(t)}return e}if((0,f.m)(a[0])){const n=await a[0].load(),r=A.A.create(a[1],{fieldsIndex:n.getFieldsIndex(),timeZone:n.dateFieldsTimeZoneDefaultUTC}),i=r.getVariables();if(i.length>0){const n={};for(const r of i)n[r]=e.evaluateIdentifier(t,{name:r});r.parameters=n}return new v.A({parentfeatureset:a[0],whereclause:r})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"filter",min:2,max:2}),e.functions.orderby=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,2,2,t,n),(0,f.m)(i[0])){const e=new k(i[1]);return new D({parentfeatureset:i[0],orderbyclause:e})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"orderby",min:2,max:2}),e.functions.top=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,2,2,t,n),(0,f.m)(i[0]))return new P({parentfeatureset:i[0],topnum:i[1]});if((0,we.cy)(i[0]))return(0,f.s)(i[1])>=i[0].length?i[0].slice():i[0].slice(0,(0,f.s)(i[1]));if((0,f.j)(i[0]))return(0,f.s)(i[1])>=i[0].length()?i[0].slice():i[0].slice(0,(0,f.s)(i[1]));throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"top",min:2,max:2}),e.functions.first=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,1,1,t,n),(0,f.m)(i[0])){const n=await i[0].first(e.abortSignal);if(null!==n){const e=u.Xj.createFromGraphicLikeObject(n.geometry,n.attributes,i[0],t.timeZone);return e._underlyingGraphic=n,e}return n}return(0,we.cy)(i[0])?0===i[0].length?null:i[0][0]:(0,f.j)(i[0])?0===i[0].length()?null:i[0].get(0):null})},e.signatures.push({name:"first",min:1,max:1}),e.functions.attachments=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{(0,f.B)(i,1,2,t,n);const a={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(i.length>1)if(i[1]instanceof s.A){if(i[1].hasField("minsize")&&(a.minsize=(0,f.s)(i[1].field("minsize"))),i[1].hasField("metadata")&&(a.returnMetadata=(0,f.H)(i[1].field("metadata"))),i[1].hasField("maxsize")&&(a.maxsize=(0,f.s)(i[1].field("maxsize"))),i[1].hasField("types")){const e=(0,f.M)(i[1].field("types"),!1);e.length>0&&(a.types=e)}}else if(null!==i[1])throw new l.D$(t,"InvalidParameter",n);if((0,f.k)(i[0])){const e=i[0]._layer;let n;if((0,f.m)(e))n=e;else{if(null==e||!(0,w.eB)(e))return[];n=(0,d.constructFeatureSet)(e,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)}return await n.load(),n.queryAttachments(i[0].field(n.objectIdField),a.minsize,a.maxsize,a.types,a.returnMetadata)}if(null===i[0])return[];throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"attachments",min:1,max:2}),e.functions.featuresetbyrelationshipname=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{(0,f.B)(i,2,4,t,n);const a=i[0],s=(0,f.u)(i[1]);let o=(0,f.J)(i[2],null);const u=(0,f.H)((0,f.J)(i[3],!0));if(null===o&&(o=["*"]),!1===(0,we.cy)(o))throw new l.D$(t,"InvalidParameter",n);if(null===i[0])return null;if(!(0,f.k)(i[0]))throw new l.D$(t,"InvalidParameter",n);const c=a._layer;let p;if((0,f.m)(c))p=c;else{if(null==c||!(0,w.eB)(c))return null;p=(0,d.constructFeatureSet)(c,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)}p=await p.load();const h=p.relationshipMetadata().filter(e=>e.name===s);if(0===h.length)return null;if(void 0!==h[0].relationshipTableId&&null!==h[0].relationshipTableId&&h[0].relationshipTableId>-1)return(0,d.constructFeatureSetFromRelationship)(p,h[0],a.field(p.objectIdField),p.spatialReference,o,u,t.lrucache,t.interceptor);let m=p.serviceUrl();if(!m)return null;m=m.endsWith("/")?m+h[0].relatedTableId.toString():m+"/"+h[0].relatedTableId.toString();const y=await(0,d.constructFeatureSetFromUrl)(m,p.spatialReference,o,u,t.lrucache,t.interceptor);await y.load();let g=y.relationshipMetadata();if(g=g.filter(e=>e.id===h[0].id),!1===a.hasField(h[0].keyField)||null===a.field(h[0].keyField)){const e=await p.getFeatureByObjectId(a.field(p.objectIdField),[h[0].keyField]);if(e){const t=A.A.create(g[0].keyField+"= @id",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});return t.parameters={id:e.attributes[h[0].keyField]},new v.A({parentfeatureset:y,whereclause:t})}return new O.A({parentfeatureset:y})}const I=A.A.create(g[0].keyField+"= @id",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});return I.parameters={id:a.field(h[0].keyField)},new v.A({parentfeatureset:y,whereclause:I})})},e.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),e.functions.featuresetbyassociation=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,a)=>{(0,f.B)(a,2,3,t,n);const s=a[0],u=(0,o.B)((0,f.u)((0,f.J)(a[1],""))),c=(0,we.Kg)(a[2])?(0,f.u)(a[2]):null;if(null===a[0])return null;if(!(0,f.k)(a[0]))throw new l.D$(t,"InvalidParameter",n);let p=s._layer;if(p instanceof J.default&&(p=(0,d.constructFeatureSet)(p,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===p)return null;if(!1===(0,f.m)(p))return null;await p.load();const h=p.serviceUrl(),m=await(0,d.constructAssociationMetaDataFeatureSetFromUrl)(h,t.spatialReference,!0);if(m.unVersion>=8)return await async function(e,t,n,i,a,s,o){const u=await e.getFeatureSetInfo();if(null===(u?.layerId??null))return null;if(!a.layerIdLookup.get(u.layerId))return null;const c=e.serviceUrl().replace(/\/FeatureServer/i,"/UtilityNetworkServer"),f=[];switch(n){case"connected":f.push("connectivity"),f.push("junction-edge-from-connectivity"),f.push("junction-edge-to-connectivity"),f.push("junction-edge-midspan-connectivity"),f.push("junction-junction-connectivity");break;case"container":case"content":f.push("containment");break;case"structure":case"attached":f.push("attachment");break;case"junctionedge":f.push("junction-edge-from-connectivity"),f.push("junction-edge-to-connectivity");break;case"midspan":f.push("junction-edge-midspan-connectivity");break;default:throw new l.D$(s,"InvalidParameter",o)}let p=null,h=!1;if(null!==i&&""!==i&&void 0!==i){for(const e of a.terminals)e.terminalName===i&&(p=e.terminalId);null===p&&(h=!0)}const m=[];if(!h){const i=new de({globalId:t.field(e.globalIdField),networkSourceId:a.layerIdLookup.get(u.layerId).sourceId,...p?{terminalId:p}:""}),s=await async function(e,t){const n=(0,ne.Dl)(e),r={...he(t),f:"json"},i=(0,ne.lF)({...n.query,...r}),a=(0,ne.jV)(i,{method:"post"}),s=`${n.path}/associations/query`,{data:o}=await(0,z.A)(s,a),l=pe.fromJSON(o);return t.types.includes("connectivity")&&(0,Q.Lx)(Y.A.getLogger("esri/rest/networks/support/QueryAssociationsParameters"),"types",{replacement:"Please use 'junction-junction-connectivity' instead of 'connectivity'.",see:"https://arcg.is/11Tr8a#types",version:"4.29",warnOnce:!0}),l}(c,new ge({types:f,elements:[i]}));let o=0;for(const e of s.associations){let t=null,s="",l="";if(e.fromNetworkElement?.globalId===i.globalId?(t=e.toNetworkElement,l="to"):e.toNetworkElement?.globalId===i.globalId&&(t=e.fromNetworkElement,l="from"),!t)continue;switch(n){case"attached":if("attachment"!==e.associationType)continue;if("to"!==l)continue;break;case"structure":if("attachment"!==e.associationType)continue;if("from"!==l)continue;break;case"container":if("containment"!==e.associationType)continue;if("from"!==l)continue;break;case"content":if("containment"!==e.associationType)continue;if("to"!==l)continue;break;case"connected":break;case"junctionedge":"junction-edge-to-connectivity"===e.associationType?s="to":"junction-edge-from-connectivity"===e.associationType&&(s="from");break;case"midspan":if("junction-edge-midspan-connectivity"!==e.associationType)continue}const u=a.sourceIdLookup.get(t.networkSourceId)?.className??"";m.push(new r.A({geometry:null,attributes:{objectId:o++,globalId:t.globalId,percentAlong:e.percentAlong??0,isContentVisible:e.isContentVisible?0:1,className:u,side:s}}))}}const y=new J.default({source:m,geometryType:null,objectIdField:"objectId",globalIdField:"globalId",fields:[new M.A({name:"objectId",alias:"objectId",type:"oid"}),new M.A({name:"globalId",alias:"globalId",type:"global-id"}),new M.A({name:"percentAlong",alias:"percentAlong",type:"double"}),new M.A({name:"side",alias:"side",type:"string"}),new M.A({name:"isContentVisible",alias:"isContentVisible",type:"integer"}),new M.A({name:"className",alias:"className",type:"string"})]});return(0,d.constructFeatureSet)(y)}(p,s,u,c,m,t,n);const y=m.associations;let g=null,I=null,F=!1;if(null!==c&&""!==c&&void 0!==c){for(const e of m.terminals)e.terminalName===c&&(I=e.terminalId);null===I&&(F=!0)}const b=y.getFieldsIndex(),v=b.get("TOGLOBALID").name,x=b.get("FROMGLOBALID").name,D=b.get("TOTERMINALID").name,E=b.get("FROMTERMINALID").name,k=b.get("FROMNETWORKSOURCEID").name,L=b.get("TONETWORKSOURCEID").name,U=b.get("ASSOCIATIONTYPE").name,$=b.get("ISCONTENTVISIBLE").name,j=b.get("OBJECTID").name;for(const e of p.fields)if("global-id"===e.type){g=s.field(e.name);break}let Z=null,B=new _(new M.A({name:"percentalong",alias:"percentalong",type:"double"}),A.A.create("0",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC})),W=new _(new M.A({name:"side",alias:"side",type:"string"}),A.A.create("''",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));const R="globalid",q="globalId",P={};for(const e in m.lkp)P[e]=m.lkp[e].sourceId;const O=new T(new M.A({name:"classname",alias:"classname",type:"string"}),null,P);let V="";switch(u){case"midspan":{V=`((${v}='${g}') OR ( ${x}='${g}')) AND (${U} IN (5))`,O.codefield=A.A.create(`CASE WHEN (${v}='${g}') THEN ${k} ELSE ${L} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});const e=(0,w.ke)(C.findField(y.fields,x));e.name=R,e.alias=R,Z=new _(e,A.A.create(`CASE WHEN (${x}='${g}') THEN ${v} ELSE ${x} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC})),B=m.unVersion>=4?new N(C.findField(y.fields,b.get("PERCENTALONG").name)):new _(new M.A({name:"percentalong",alias:"percentalong",type:"double"}),A.A.create("0",{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{V=`((${v}='${g}') OR ( ${x}='${g}')) AND (${U} IN (4,6))`,O.codefield=A.A.create(`CASE WHEN (${v}='${g}') THEN ${k} ELSE ${L} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});const e=(0,w.ke)(C.findField(y.fields,x));e.name=R,e.alias=R,Z=new _(e,A.A.create(`CASE WHEN (${x}='${g}') THEN ${v} ELSE ${x} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC})),W=new _(new M.A({name:"side",alias:"side",type:"string"}),A.A.create(`CASE WHEN (${U}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let e=`${v}='@T'`,t=`${x}='@T'`;null!==I&&(e+=` AND ${D}=@A`,t+=` AND ${E}=@A`),V="(("+e+") OR ("+t+"))",V=(0,f._)(V,"@T",g??""),e=(0,f._)(e,"@T",g??""),null!==I&&(e=(0,f._)(e,"@A",I.toString()),V=(0,f._)(V,"@A",I.toString())),O.codefield=A.A.create("CASE WHEN "+e+` THEN ${k} ELSE ${L} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC});const n=(0,w.ke)(C.findField(y.fields,x));n.name=R,n.alias=R,Z=new _(n,A.A.create("CASE WHEN "+e+` THEN ${x} ELSE ${v} END`,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}));break}case"container":V=`${v}='${g}' AND ${U} = 2`,null!==I&&(V+=` AND ${D} = `+I.toString()),O.codefield=k,V="( "+V+" )",Z=new S(C.findField(y.fields,x),R,R);break;case"content":V=`(${x}='${g}' AND ${U} = 2)`,null!==I&&(V+=` AND ${E} = `+I.toString()),O.codefield=L,V="( "+V+" )",Z=new S(C.findField(y.fields,v),R,R);break;case"structure":V=`(${v}='${g}' AND ${U} = 3)`,null!==I&&(V+=` AND ${D} = `+I.toString()),O.codefield=k,V="( "+V+" )",Z=new S(C.findField(y.fields,x),R,q);break;case"attached":V=`(${x}='${g}' AND ${U} = 3)`,null!==I&&(V+=` AND ${E} = `+I.toString()),O.codefield=L,V="( "+V+" )",Z=new S(C.findField(y.fields,v),R,q);break;default:throw new l.D$(t,"InvalidParameter",n)}return F&&(V="1 <> 1"),new C({parentfeatureset:y,adaptedFields:[new N(C.findField(y.fields,j)),new N(C.findField(y.fields,$)),Z,W,O,B],extraFilter:V?A.A.create(V,{fieldsIndex:y.getFieldsIndex(),timeZone:y.dateFieldsTimeZoneDefaultUTC}):null})})},e.signatures.push({name:"featuresetbyassociation",min:2,max:6}),e.functions.groupby=function(t,n){return e.standardFunctionAsync(t,n,async(r,i,a)=>{if((0,f.B)(a,3,3,t,n),!(0,f.m)(a[0]))throw new l.D$(t,"InvalidParameter",n);const o=await a[0].load(),u=[],d=[];let c=!1,p=[];if((0,we.Kg)(a[1]))p.push(a[1]);else if(a[1]instanceof s.A)p.push(a[1]);else if((0,we.cy)(a[1]))p=a[1];else{if(!(0,f.j)(a[1]))throw new l.D$(t,"InvalidParameter",n);p=a[1].toArray()}for(const e of p)if((0,we.Kg)(e)){const t=A.A.create((0,f.u)(e),{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,I.DA)(t)?(0,f.u)(e):"%%%%FIELDNAME";u.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(c=!0)}else{if(!(e instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const r=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",i=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===r&&(c=!0),!r)throw new l.D$(t,"InvalidParameter",n);u.push({name:r,expression:A.A.create(i||r,{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC})})}}if(p=[],(0,we.Kg)(a[2]))p.push(a[2]);else if((0,we.cy)(a[2]))p=a[2];else if((0,f.j)(a[2]))p=a[2].toArray();else{if(!(a[2]instanceof s.A))throw new l.D$(t,"InvalidParameter",n);p.push(a[2])}for(const e of p){if(!(e instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const r=e.hasField("name")?e.field("name"):"",i=e.hasField("statistic")?e.field("statistic"):"",a=e.hasField("expression")?e.field("expression"):"";if(!(r&&i&&(0,we.Kg)(i)&&a))throw new l.D$(t,"InvalidParameter",n);d.push({name:r,statistic:i,expression:A.A.create(a,{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC})})}}if(c){const e={};for(const t of o.fields)e[t.name.toLowerCase()]=1;for(const t of u)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);for(const t of d)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of u)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of u)Ie(n.expression,e,t);for(const n of d)Ie(n.expression,e,t);return new R({parentfeatureset:a[0],groupbyfields:u,statsfields:d})})},e.signatures.push({name:"groupby",min:3,max:3}),e.functions.distinct=function(t,n){return e.standardFunctionAsync(t,n,async(r,i,a)=>{if((0,f.m)(a[0])){(0,f.B)(a,2,2,t,n);const r=await a[0].load(),i=[];let o=[];if((0,we.Kg)(a[1]))o.push(a[1]);else if(a[1]instanceof s.A)o.push(a[1]);else if((0,we.cy)(a[1]))o=a[1];else{if(!(0,f.j)(a[1]))throw new l.D$(t,"InvalidParameter",n);o=a[1].toArray()}let u=!1;for(const e of o)if((0,we.Kg)(e)){const t=A.A.create((0,f.u)(e),{fieldsIndex:r.getFieldsIndex(),timeZone:r.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,I.DA)(t)?(0,f.u)(e):"%%%%FIELDNAME";i.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(u=!0)}else{if(!(e instanceof s.A))throw new l.D$(t,"InvalidParameter",n);{const a=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",s=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===a&&(u=!0),!a)throw new l.D$(t,"InvalidParameter",n);i.push({name:a,expression:A.A.create(s||a,{fieldsIndex:r.getFieldsIndex(),timeZone:r.dateFieldsTimeZoneDefaultUTC})})}}if(u){const e={};for(const t of r.fields)e[t.name.toLowerCase()]=1;for(const t of i)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of i)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of i)Ie(n.expression,e,t);return new R({parentfeatureset:a[0],groupbyfields:i,statsfields:[]})}return function(e){if(1===e.length){if((0,we.cy)(e[0]))return(0,G.t)("distinct",e[0],-1);if((0,f.j)(e[0]))return(0,G.t)("distinct",e[0].toArray(),-1)}return(0,G.t)("distinct",e,-1)}(a)})},e.functions.getfeaturesetinfo=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,1,1,t,n),!(0,f.m)(i[0]))return null;const a=await i[0].getFeatureSetInfo();return a?s.A.convertObjectToArcadeDictionary({layerId:a.layerId,layerName:a.layerName,itemId:a.itemId,serviceLayerUrl:a.serviceLayerUrl,webMapLayerId:a.webMapLayerId??null,webMapLayerTitle:a.webMapLayerTitle??null,className:null,objectClassId:null},(0,f.K)(t),!1,!1):null})},e.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),e.functions.filterbysubtypecode=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,i)=>{if((0,f.B)(i,2,2,t,n),(0,f.m)(i[0])){const e=await i[0].load(),r=i[1];if(!(0,we.Fq)(r))throw new l.D$(t,"InvalidParameter",n);if(e.subtypeField){const t=A.A.create(`${e.subtypeField}= ${i[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new v.A({parentfeatureset:i[0],whereclause:t})}if(null===e.typeIdField||""===e.typeIdField)throw new l.D$(t,"FeatureSetDoesNotHaveSubtypes",n);const a=A.A.create(`${e.typeIdField}= ${i[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new v.A({parentfeatureset:i[0],whereclause:a})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"filterbysubtypecode",min:2,max:2})}}},80672:(e,t,n)=>{n.d(t,{R:()=>i});var r=n(20655);function i(e,t){return null===e?t:new r.A({url:e.field("url")})}},85978:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(87449),i=n(11221),a=n(33325);class s extends i.t{constructor(e){super(),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._parent=e.parentfeatureset,this._databaseType=0}async _queryAll(){return i.A.features}async query(e){return i.A}async queryStat(e){return await this._manualStat(e.stat,e.field,e.limit??a.gO,e.abortSignal)}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new r.dr("NeverReach")}async queryAttachments(){return[]}}}}]);