@arcgis/core 5.0.0-next.30 → 5.0.0-next.32

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 (182) hide show
  1. package/Basemap.js +1 -1
  2. package/applications/SceneViewer/sceneViewerUtils.d.ts +3 -0
  3. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{406d270ae2b3cf9e1f1b.js → 05e55118dc0023d500fc.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{93fe46be3c7fe34b5361.js → 1432e789aa4cba627337.js} +1 -1
  7. package/assets/esri/core/workers/chunks/1dd867fa7c58c06b79ea.js +1 -0
  8. package/assets/esri/core/workers/chunks/{6e9d731cb20307b83ab0.js → 1e55f152b60145f33b61.js} +1 -1
  9. package/assets/esri/core/workers/chunks/22d66d1c8dfccdbbcf30.js +1 -0
  10. package/assets/esri/core/workers/chunks/27bd88e1101873d4ce12.js +1 -0
  11. package/assets/esri/core/workers/chunks/{5f2cf73fb2944f82661d.js → 433d249c35c56bf15806.js} +34 -34
  12. package/assets/esri/core/workers/chunks/444026d1938c1078ca97.js +1 -0
  13. package/assets/esri/core/workers/chunks/{a425ffec91d07bbfeb80.js → 565358ea8d1bdc4d1ebc.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{b2fbb44e219232e61cbd.js → 794960ec36e11f4416c2.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{0bfb7db0a151a5e85dd1.js → 8ad6595ad44c2d60c1ce.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{11bb437437272d8f3e2c.js → 9252854b512237b6a0ef.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{e615983fab688d515205.js → 944dfa9309da8f49a616.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{f2f4e34247882eceb50d.js → a2cee5ac0d4df0108425.js} +3 -3
  19. package/assets/esri/core/workers/chunks/a4b7ba8aec109beb5b4d.js +1 -0
  20. package/assets/esri/core/workers/chunks/{d769c1b18e2710e0388b.js → a6324f5f560ffadc6e5d.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{a091623bbfb3d771c8d8.js → d8db2c51b2fb42f37b2a.js} +1 -1
  22. package/assets/esri/core/workers/chunks/da517b4b07d4d27ce94c.js +1 -0
  23. package/assets/esri/core/workers/chunks/{984bb0943d07c86b7e77.js → ded3ef385d5a3a2ec8ca.js} +1 -1
  24. package/assets/esri/core/workers/chunks/defc6b50df5018bd9e86.js +1 -0
  25. package/assets/esri/core/workers/chunks/ed1dabed10ff9f4e0369.js +1 -0
  26. package/assets/esri/core/workers/chunks/{14dc21fe66c7b98fb456.js → f3127bdf28a1d9b8db27.js} +1 -1
  27. package/assets/esri/core/workers/chunks/fee942ef802a162e0248.js +1 -0
  28. package/assets/esri/themes/base/widgets/_Attribution.scss +8 -0
  29. package/assets/esri/themes/dark/main.css +1 -1
  30. package/assets/esri/themes/light/main.css +1 -1
  31. package/assets/esri/themes/light/view.css +1 -1
  32. package/chunks/BlendLayers.glsl.js +1 -1
  33. package/config.js +1 -1
  34. package/core/Message.js +1 -1
  35. package/core/deprecate.js +1 -1
  36. package/core/keyboard.js +5 -0
  37. package/geometry/Circle.js +1 -1
  38. package/geometry/Extent.js +1 -1
  39. package/geometry/geodesicUtils.js +5 -0
  40. package/geometry/support/geodesicUtils.js +1 -1
  41. package/interfaces.d.ts +482 -190
  42. package/kernel.js +1 -1
  43. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  44. package/layers/graphics/OptimizedGeometry.js +1 -1
  45. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  46. package/layers/knowledgeGraph/SessionMemoryStorage.js +1 -1
  47. package/layers/support/BuildingFilterBlock.js +1 -1
  48. package/package.json +2 -2
  49. package/rest/support/QueryMixin.js +1 -1
  50. package/support/revision.js +1 -1
  51. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +1 -1
  52. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementController.js +1 -1
  53. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  54. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  55. package/views/2d/grid/gridUtils.js +1 -1
  56. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  57. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  58. package/views/2d/layers/MediaLayerView2D.js +1 -1
  59. package/views/2d/layers/OGCFeatureLayerView2D.js +1 -1
  60. package/views/2d/layers/StreamLayerView2D.js +1 -1
  61. package/views/3d/GroundView3D.js +1 -1
  62. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  63. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  64. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  65. package/views/3d/layers/DimensionLayerView3D.js +1 -1
  66. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  67. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  68. package/views/3d/layers/I3SMeshView3D.js +1 -1
  69. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  70. package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
  71. package/views/3d/layers/MediaLayerView3D.js +1 -1
  72. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  73. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  74. package/views/3d/layers/StreamLayerView3D.js +1 -1
  75. package/views/3d/layers/ViewshedLayerView3D.js +1 -1
  76. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  77. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  78. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  79. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  80. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  81. package/views/3d/support/Attribution3D.js +5 -0
  82. package/views/3d/terrain/TileBlendTechniqueConfiguration.js +1 -1
  83. package/views/3d/terrain/TileCompositor.js +1 -1
  84. package/views/3d/terrain/TileRenderer.js +1 -1
  85. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  86. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  87. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  88. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  89. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  90. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +6 -6
  91. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +4 -4
  92. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  93. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  94. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  95. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  96. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  97. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  98. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  99. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  100. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  101. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  102. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  103. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  104. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  105. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  106. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  107. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +4 -4
  108. package/views/Attribution.js +5 -0
  109. package/views/DOMContainer.js +1 -1
  110. package/views/SceneView.js +1 -1
  111. package/views/View.js +1 -1
  112. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  113. package/views/draw/support/managers/DrawTooltipManager.js +5 -0
  114. package/views/interactive/sketch/constraintUtils.js +1 -1
  115. package/views/interactive/sketch/constraints.js +1 -1
  116. package/views/interactive/tooltip/content/TooltipContentDynamic.js +5 -0
  117. package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
  118. package/views/interactive/tooltip/fields/TooltipField.js +1 -1
  119. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +5 -0
  120. package/views/layers/DimensionLayerView.js +1 -1
  121. package/views/layers/DimensionLayerViewMixin.js +5 -0
  122. package/views/layers/FeatureLayerView.js +1 -1
  123. package/views/layers/FeatureLayerViewMixin.d.ts +2 -2
  124. package/views/layers/FeatureLayerViewMixin.js +5 -0
  125. package/views/layers/ImageryLayerView.js +1 -1
  126. package/views/layers/ImageryLayerViewMixin.js +5 -0
  127. package/views/layers/LayerView.js +1 -1
  128. package/views/layers/LineOfSightLayerView.js +1 -1
  129. package/views/layers/LineOfSightLayerViewMixin.js +5 -0
  130. package/views/layers/MediaLayerView.js +1 -1
  131. package/views/layers/MediaLayerViewMixin.js +5 -0
  132. package/views/layers/OGCFeatureLayerView.js +1 -1
  133. package/views/layers/PointCloudLayerView.js +1 -1
  134. package/views/layers/StreamLayerView.js +1 -1
  135. package/views/layers/ViewshedLayerView.js +1 -1
  136. package/views/layers/ViewshedLayerViewMixin.js +5 -0
  137. package/views/support/AttributionItem.d.ts +4 -0
  138. package/views/support/AttributionItem.js +5 -0
  139. package/views/support/LayerLayerViewInfo.js +1 -1
  140. package/views/support/LayerViewManager.js +1 -1
  141. package/views/support/PromiseQueue.js +1 -1
  142. package/views/support/angularMeasurementUtils.js +1 -1
  143. package/views/support/attributionUtils.js +5 -0
  144. package/views/support/drapedUtils.js +1 -1
  145. package/views/support/geodesicAreaMeasurementUtils.js +1 -1
  146. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  147. package/views/support/geodesicMeasurementUtils.js +1 -1
  148. package/views/ui/2d/DefaultUI2D.js +1 -1
  149. package/views/ui/3d/DefaultUI3D.js +1 -1
  150. package/webscene/Environment.js +1 -1
  151. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  152. package/widgets/Attribution/AttributionViewModel.js +1 -1
  153. package/widgets/Attribution.js +1 -1
  154. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  155. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  156. package/widgets/ElevationProfile/ElevationProfileLine.js +1 -1
  157. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  158. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  159. package/widgets/ElevationProfile.js +1 -1
  160. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  161. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  162. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  163. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  164. package/widgets/Popup.js +1 -1
  165. package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
  166. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  167. package/widgets/Widget.js +1 -1
  168. package/widgets/support/decorators/accessibleHandler.js +1 -1
  169. package/widgets/support/forms/expressions/FormExpressionArcadeExecutor.js +1 -1
  170. package/widgets/support/jsxWidgetSupport.js +1 -1
  171. package/widgets/support/widget.js +1 -1
  172. package/widgets/support/widgetUtils.js +1 -1
  173. package/assets/esri/core/workers/chunks/25143b919e75d5d2da05.js +0 -1
  174. package/assets/esri/core/workers/chunks/2d17ed5321ca05acb8e3.js +0 -1
  175. package/assets/esri/core/workers/chunks/447b53a9280b2b19b7a6.js +0 -1
  176. package/assets/esri/core/workers/chunks/6ce7ca6bebdc61d8eada.js +0 -1
  177. package/assets/esri/core/workers/chunks/8fbda0b85731ac77e1d8.js +0 -1
  178. package/assets/esri/core/workers/chunks/98c32d10a2344cd7a50b.js +0 -1
  179. package/assets/esri/core/workers/chunks/b66e41d626a7d1b81d48.js +0 -1
  180. package/assets/esri/core/workers/chunks/d5b464ff83ce29b51968.js +0 -1
  181. package/assets/esri/core/workers/chunks/d777d7cb8df3f21ac97e.js +0 -1
  182. package/layers/support/attributionUtils.js +0 -5
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8969],{2272:(e,t,n)=>{n.d(t,{Dl:()=>u,gf:()=>h,jV:()=>l,lF:()=>c});var i=n(92602),s=n(70333),r=n(4718),o=n(84952),a=n(926);function l(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function u(e){return"string"==typeof e?(0,o.An)(e):(0,r.o8)(e)}function c(e,t,n){const i={};for(const s in e){if("declaredClass"===s)continue;const r=e[s];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))i[s]=r.map(e=>c(e));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(n?.[s]);i[s]=t?e:JSON.stringify(e)}else i[s]=t?r:JSON.stringify(r);else i[s]=r}return i}async function h(e,t,r){const o=function(e,t){return e?t&&(0,a.Qc)(e)?t:(0,a.CG)(e)??s.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!s.id&&i.A.request.useIdentity&&await Promise.all([n.e(7330),n.e(168),n.e(148)]).then(n.bind(n,50148));const l=await s.id.getCredential(e,r);return l?.token}},6518:(e,t,n)=>{n.d(t,{F:()=>a});var i=n(44208),s=n(75503),r=n(19419);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new s.wq(9,(0,i.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((n,i)=>{e[t++]=i}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,n){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,n)}(this._index,e,e=>t(this._idByBounds.get(e)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},13043:(e,t,n)=>{function i(e,t){if(e&&t)for(const n of e.children)if(n.localName in t){const e=t[n.localName];if("function"==typeof e){const t=e(n);t&&i(n,t)}else i(n,e)}}function*s(e,t){for(const n of e.children)if(n.localName in t){const e=t[n.localName];"function"==typeof e?yield e(n):yield*s(n,e)}}n.d(t,{i:()=>s,p:()=>i})},20437:(e,t,n)=>{n.d(t,{A:()=>m});var i,s=n(31635),r=n(66552),o=n(25482),a=n(91429),l=n(56507),u=n(80451),c=n(98453),h=n(36005),d=n(93223);const p=new r.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let m=class extends o.o{static{i=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let n=null;try{n=t?JSON.parse(t):null}catch(e){}return n?.value??null}readValueType(e,{description:t}){let n=null;try{n=t?JSON.parse(t):null}catch(e){}return n?p.fromJSON(n.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,s.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],m.prototype,"alias",void 0),(0,s.Cg)([(0,a.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],m.prototype,"defaultValue",void 0),(0,s.Cg)([(0,a.MZ)()],m.prototype,"description",void 0),(0,s.Cg)([(0,h.w)("description")],m.prototype,"readDescription",null),(0,s.Cg)([(0,a.MZ)({types:u.gK,json:{read:{reader:u.rS},write:!0}})],m.prototype,"domain",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),(0,s.Cg)([(0,a.MZ)({type:l.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],m.prototype,"length",void 0),(0,s.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],m.prototype,"name",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],m.prototype,"nullable",void 0),(0,s.Cg)([(0,d.e)(c.m)],m.prototype,"type",void 0),(0,s.Cg)([(0,a.MZ)()],m.prototype,"valueType",void 0),(0,s.Cg)([(0,h.w)("valueType",["description"])],m.prototype,"readValueType",null),(0,s.Cg)([(0,a.MZ)({type:Boolean,json:{read:!1}})],m.prototype,"visible",void 0),m=i=(0,s.Cg)([(0,a.$K)("esri.layers.support.Field")],m)},33771:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var i=n(60999),s=n(49186),r=n(53966),o=n(34727),a=n(74887),l=n(67076),u=n(21325),c=n(90708),h=n(83221),d=n(31464),p=n(56390),m=n(85113),f=n(82832),y=n(34322),g=n(95466),_=n(54218),b=n(98623);const w="esri.layers.WFSLayer";class x{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:n,getFeatureOutputFormat:i,fields:r,geometryType:o,featureType:l,maxRecordCount:u,maxTotalRecordCount:c,maxPageCount:m,objectIdField:f,customParameters:_}=e,{spatialReference:w,getFeatureSpatialReference:x}=(0,y.UH)(n,l,e.spatialReference);try{await(0,d.Nk)(x,w)}catch{throw new s.A("unsupported-projection","Projection not supported",{inSpatialReference:x,outSpatialReference:w})}(0,a.Te)(t),this._customParameters=_,this._featureType=l,this._fieldsIndex=g.A.fromLayerJSON({fields:r,dateFieldsTimeReference:r.some(e=>"esriFieldTypeDate"===e.type)?{timeZoneIANA:b.n$}:null}),this._geometryType=o,this._getFeatureUrl=n,this._getFeatureOutputFormat=i,this._getFeatureSpatialReference=x,this._maxRecordCount=u,this._maxTotalRecordCount=c,this._maxPageCount=m,this._objectIdField=f,this._spatialReference=w;let C=await this._snapshotFeatures(t);if(C.errors.length>0&&(this._supportsPagination=!1,C=await this._snapshotFeatures(t),C.errors.length>0))throw C.errors[0];const v={type:"object-id",fieldName:f};return this._queryEngine=new p.do({fieldsIndex:this._fieldsIndex,geometryType:o,hasM:!1,hasZ:!1,featureIdInfo:v,spatialReference:w,timeInfo:null,featureStore:new h.A({geometryType:o,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(C.features),{warnings:S(C),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new s.A("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),(await this._queryEngine.executeQueryForIds(e,t.signal)).filter(_.Et)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),await this._queryEngine.executeQueryForSnapping(e,t.signal)}async queryAttributeBins(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeAttributeBinsQuery(e,t.signal)}async refresh(e){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=(0,i.UT)(e=>this._snapshotFeatures({signal:e})),this._snapshotTask.promise.then(e=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(e.features);for(const t of S(e))r.A.getLogger(w).warn(new l.A("wfs-layer:refresh-warning",t.message,t.details));e.errors?.length&&r.A.getLogger(w).warn(new l.A("wfs-layer:refresh-error","Refresh completed with errors",{errors:e.errors}))},()=>{this._queryEngine.featureStore.clear()}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,n=this._maxTotalRecordCount,i=this._maxPageCount,s=this._supportsPagination&&i>1?await(0,y.E)(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let r=[];const l=[];if(null==s)try{r=await this._singleQuery(t)}catch(e){(0,a.zf)(e)||l.push(e)}else{const e=Math.min(s,n),u=function*(e,t,n){for(let i=0;i<t;i++)yield e._pageQuery(i,n)}(this,(0,o.qE)(Math.ceil(e/this._maxRecordCount),1,i),t);await Promise.allSettled(Array.from({length:10}).map(()=>async function(e,t,n){let i=e.next();for(;!i.done;){try{const e=await i.value;t.push(...e)}catch(e){(0,a.zf)(e)||n.push(e)}i=e.next()}}(u,r,l)))}return(0,a.Te)(t),{features:r,totalRecordCount:s,maxTotalRecordCount:n,maxPageCount:i,errors:l}}async _singleQuery(e){const t=Number.isFinite(this._maxRecordCount)&&this._maxRecordCount>0?this._maxRecordCount:void 0,n=await(0,y.x$)(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,count:t,signal:e});return this._processGeoJSON(n,{signal:e})}async _pageQuery(e,t){const n=e*this._maxRecordCount,i=await(0,y.x$)(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:n,count:this._maxRecordCount,signal:t});return this._processGeoJSON(i,{startIndex:n,signal:t})}_processGeoJSON(e,t){(0,m.sO)(e,this._getFeatureSpatialReference.wkid);const{startIndex:n,signal:i}=t;(0,a.Te)(i);const s=(0,m.bd)(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!(0,u.aI)(this._spatialReference,this._getFeatureSpatialReference))for(const e of s)null!=e.geometry&&(e.geometry=(0,c.Ux)((0,d.Cv)((0,c.zv)(e.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let r=n??1;for(const e of s){const t={};(0,f.MB)(this._fieldsIndex,t,e.attributes,!0),e.attributes=t,null==t[this._objectIdField]&&(e.objectId=t[this._objectIdField]=r++)}return s}}function S(e){const t=[];return null!=e.totalRecordCount&&(e.features.length<e.totalRecordCount&&t.push({name:"wfs-layer:maxRecordCount-too-low",message:`Could only fetch ${e.features.length} of ${e.totalRecordCount} in ${e.maxPageCount} queries. Try increasing the value of WFSLayer.maxRecordCount.`,details:{recordCount:e.features.length,totalRecordCount:e.totalRecordCount}}),e.totalRecordCount>e.maxTotalRecordCount&&t.push({name:"wfs-layer:large-dataset",message:`The number of ${e.totalRecordCount} features exceeds the maximum allowed of ${e.maxTotalRecordCount}.`,details:{recordCount:e.features.length,totalRecordCount:e.totalRecordCount,maxTotalRecordCount:e.maxTotalRecordCount}})),t}},34322:(e,t,n)=>{n.d(t,{E:()=>X,Fu:()=>I,O8:()=>k,UH:()=>$,YW:()=>j,i5:()=>b,mG:()=>N,x$:()=>Y});var i=n(11254),s=n(49186),r=n(5479),o=n(84952),a=n(5443),l=n(91218),u=n(16930),c=n(21325),h=n(50498),d=n(85113),p=n(13043),m=n(60694),f=n(20437),y=n(30524);const g="xlink:href",_="2.0.0",b="__esri_wfs_id__",w="wfs-layer:getWFSLayerTypeInfo-error",x="wfs-layer:empty-service",S="wfs-layer:feature-type-not-found",C="wfs-layer:geojson-not-supported",v="wfs-layer:kvp-encoding-not-supported",T="wfs-layer:malformed-json",F="wfs-layer:unknown-geometry-type",M="wfs-layer:unknown-field-type",A="wfs-layer:unsupported-spatial-reference",R="wfs-layer:unsupported-wfs-version";async function I(e,t){const n=function(e){const t=V(e);(function(e){const t=e.firstElementChild?.getAttribute("version");if(t&&t!==_)throw new s.A(R,`Unsupported WFS version ${t}. Supported version: ${_}`)})(t),U(t);const n=t.firstElementChild,i=(0,r.PP)(function(e){return(0,p.i)(e,{FeatureTypeList:{FeatureType:e=>{const t={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",defaultSpatialReference:4326,supportedSpatialReferences:[]},n=new Set;return(0,p.p)(e,{Name:e=>{const{name:n,prefix:i}=D(e.textContent);t.typeName=`${i}:${n}`,t.name=n,t.namespacePrefix=i,t.namespaceUri=e.lookupNamespaceURI(i)},Abstract:e=>{t.description=e.textContent},Title:e=>{t.title=e.textContent},WGS84BoundingBox:e=>{t.extent=a.A.fromJSON(function(e){let t,n,i,s;for(const r of e.children)switch(r.localName){case"LowerCorner":[t,n]=r.textContent.split(" ").map(e=>Number.parseFloat(e));break;case"UpperCorner":[i,s]=r.textContent.split(" ").map(e=>Number.parseFloat(e))}return{xmin:t,ymin:n,xmax:i,ymax:s,spatialReference:c.KK}}(e))},DefaultCRS:e=>{const i=z(e);i&&(t.defaultSpatialReference=i,n.add(i))},OtherCRS:e=>{const t=z(e);t&&n.add(t)}}),t.title||(t.title=t.name),n.add(4326),t.supportedSpatialReferences.push(...n),t}}})}(n));return{operations:P(n),get featureTypes(){return Array.from(i())},readFeatureTypes:i}}((await(0,i.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:_,...t?.customParameters},signal:t?.signal})).data);return function(e,t){(0,o.m3)(e)&&((0,o.FX)(e,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=(0,o.lM)(t.operations.DescribeFeatureType.url)),(0,o.FX)(e,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=(0,o.lM)(t.operations.GetFeature.url)))}(e,n),n}const E=["json","application/json; subtype=geojson; charset=utf-8","application/json; subtype=geojson","application/json","geojson","application/geo+json"];function B(e){for(const t of E){const n=e.findIndex(e=>e.toLowerCase()===t);if(n>=0)return e[n]}return null}function P(e){let t=!0;const n={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}},i=[],r=[];if((0,p.p)(e,{OperationsMetadata:{Parameter:e=>{if("outputformat"===e.getAttribute("name")?.toLowerCase())return{AllowedValues:{Value:({textContent:e})=>{e&&i.push(e)}}}},Operation:e=>{switch(e.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:e=>{n.GetCapabilities.url=e.getAttribute(g)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:e=>{n.DescribeFeatureType.url=e.getAttribute(g)}}}};case"GetFeature":return{DCP:{HTTP:{Get:e=>{n.GetFeature.url=e.getAttribute(g)}}},Parameter:e=>{if("outputformat"===e.getAttribute("name")?.toLowerCase())return{AllowedValues:{Value:({textContent:e})=>{e&&r.push(e)}}}}}}},Constraint:e=>{switch(e.getAttribute("name")){case"KVPEncoding":return{DefaultValue:e=>{t="true"===e.textContent.toLowerCase()}};case"ImplementsResultPaging":return{DefaultValue:e=>{n.GetFeature.supportsPagination="true"===e.textContent.toLowerCase()}}}}}}),n.GetFeature.outputFormat=B(r)??B(i),!t)throw new s.A(v,"WFS service doesn't support key/value pair (KVP) encoding");if(null==n.GetFeature.outputFormat)throw new s.A(C,"WFS service doesn't support GeoJSON output format");return n}function z(e){const t=parseInt(e.textContent?.match(/(?<wkid>\d+$)/i)?.groups?.wkid??"",10);if(!Number.isNaN(t))return t}function N(e,t,n){return(0,r.I6)(e,e=>n?e.name===t&&e.namespaceUri===n:e.typeName===t||e.name===t)}async function k(e,t,n,i={}){const{featureType:r,extent:o}=await async function(e,t,n,i={}){const r=e.readFeatureTypes(),o=t?N(r,t,n):r.next().value,{spatialReference:a=new u.A({wkid:o?.defaultSpatialReference})}=i;if(null==o)throw t?new s.A(S,`The type '${t}' could not be found in the service`):new s.A(x,"The service is empty");let h=o.extent;if(h&&!(0,c.aI)(h.spatialReference,a))try{await(0,l.initializeProjection)(h.spatialReference,a,void 0,i),h=(0,l.project)(h,a)}catch{throw new s.A(A,"Projection not supported")}return{extent:h,spatialReference:a,featureType:o}}(e,t,n,i),{spatialReference:a}=$(e.operations.GetFeature.url,r,i.spatialReference),{fields:h,geometryType:d,swapXY:p,objectIdField:m,geometryField:f}=await async function(e,t,n,i={}){const{typeName:r}=t,[o,a]=await Promise.allSettled([q(e.operations.DescribeFeatureType.url,r,i),O(e,r,n,i)]),l=e=>new s.A(w,`An error occurred while getting info about the feature type '${r}'`,{error:e});if("rejected"===o.status)throw l(o.reason);if("rejected"===a.status)throw l(a.reason);const{fields:u,errors:c}=o.value??{},h=o.value?.geometryType||a.value?.geometryType,d=a.value?.swapXY??!1;if(null==h)throw new s.A(F,`The geometry type could not be determined for type '${r}`,{typeName:r,geometryType:h,fields:u,errors:c});return{...j(u??[]),geometryType:h,swapXY:d}}(e,r,a,i);return{url:e.operations.GetCapabilities.url,name:r.name,namespaceUri:r.namespaceUri,fields:h,geometryField:f,geometryType:d,objectIdField:m,spatialReference:i.spatialReference??new u.A({wkid:r.defaultSpatialReference}),extent:o,swapXY:p,wfsCapabilities:e,customParameters:i.customParameters}}function j(e){const t=e.find(e=>"geometry"===e.type);let n=e.find(e=>"oid"===e.type);return e=e.filter(e=>"geometry"!==e.type),n||(n=new f.A({name:b,type:"oid",alias:b}),e.unshift(n)),{geometryField:t?.name??null,objectIdField:n.name,fields:e}}async function O(e,t,n,s={}){let r,o=!1;const[a,l]=await Promise.all([Y(e.operations.GetFeature.url,t,n,e.operations.GetFeature.outputFormat,{...s,count:1}),(0,i.A)(e.operations.GetFeature.url,{responseType:"text",query:L(t,n,void 0,{...s,count:1}),signal:s?.signal})]),u="FeatureCollection"===a.type&&a.features[0]?.geometry;if(u){let e;switch(r=h.gy.fromJSON((0,d.xD)(u.type)),u.type){case"Point":e=u.coordinates;break;case"LineString":case"MultiPoint":e=u.coordinates[0];break;case"MultiLineString":case"Polygon":e=u.coordinates[0][0];break;case"MultiPolygon":e=u.coordinates[0][0][0]}const t=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(l.data);if(t){const n=e[0].toFixed(3),i=e[1].toFixed(3),s=parseFloat(t[1]).toFixed(3);n===parseFloat(t[2]).toFixed(3)&&i===s&&(o=!0)}}return{geometryType:r,swapXY:o}}async function q(e,t,n){return function(e,t){const{name:n}=D(e),i=V(t);U(i);const o=(0,r.I6)((0,p.i)(i.firstElementChild,{element:e=>e}),e=>e.getAttribute("name")===n);if(null!=o){const e=o.getAttribute("type"),t=e?(0,r.I6)((0,p.i)(i.firstElementChild,{complexType:e=>e}),t=>t.getAttribute("name")===D(e).name):(0,r.I6)((0,p.i)(o,{complexType:e=>e}),()=>!0);if(t)return function(e){const t=[],n=[];let i;const r=(0,p.i)(e,{complexContent:{extension:{sequence:{element:e=>e}}}});for(const o of r){const r=o.getAttribute("name");if(!r)continue;let a,l;if(o.hasAttribute("type")?a=D(o.getAttribute("type")).name:(0,p.p)(o,{simpleType:{restriction:e=>(a=D(e.getAttribute("base")).name,{maxLength:e=>{l=+e.getAttribute("value")}})}}),!a)continue;const u="true"===o.getAttribute("nillable");let c=!1;switch(a.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":n.push(new f.A({name:r,alias:r,type:"integer",nullable:u,length:(0,y._b)("integer")}));break;case"float":case"double":case"decimal":n.push(new f.A({name:r,alias:r,type:"double",nullable:u,length:(0,y._b)("double")}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":n.push(new f.A({name:r,alias:r,type:"string",nullable:u,length:l??(0,y._b)("string")}));break;case"datetime":case"date":n.push(new f.A({name:r,alias:r,type:"date",nullable:u,length:l??(0,y._b)("date")}));break;case"pointpropertytype":i="point",c=!0;break;case"multipointpropertytype":i="multipoint",c=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":i="polyline",c=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":i="polygon",c=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":c=!0,t.push(new s.A(F,`geometry type '${a}' is not supported`,{type:(new XMLSerializer).serializeToString(e)}));break;default:t.push(new s.A(M,`Unknown field type '${a}'`,{type:(new XMLSerializer).serializeToString(e)}))}c&&n.push(new f.A({name:r,alias:r,type:"geometry",nullable:u}))}for(const e of n)if("integer"===e.type&&!e.nullable&&G.has(e.name.toLowerCase())){e.type="oid";break}return{geometryType:i,fields:n,errors:t}}(t)}throw new s.A(S,`Type '${e}' not found in document`,{document:(new XMLSerializer).serializeToString(i)})}(t,(await(0,i.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:_,TYPENAME:t,TYPENAMES:t,...n?.customParameters},signal:n?.signal})).data)}const G=new Set(["objectid","fid"]);async function Y(e,t,n,r,o){let{data:a}=await(0,i.A)(e,{responseType:"text",query:L(t,n,r,o),signal:o?.signal});a=a.replaceAll(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{return JSON.parse(a)}catch(e){throw new s.A(T,"Error while parsing the response",{response:a,error:e})}}function L(e,t,n,i){const s="number"==typeof t?t:t.wkid;return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:_,TYPENAMES:e,OUTPUTFORMAT:n,SRSNAME:"EPSG:"+s,STARTINDEX:i?.startIndex,COUNT:i?.count,...i?.customParameters}}async function X(e,t,n){const s=await(0,i.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:_,TYPENAMES:t,RESULTTYPE:"hits",...n?.customParameters},signal:n?.signal}),r=/numberMatched=["'](?<numberMatched>\d+)["']/gi.exec(s.data);if(r?.groups)return+r.groups.numberMatched}function V(e){return(new DOMParser).parseFromString(e.trim(),"text/xml")}function D(e){const[t,n]=e.split(":");return{prefix:n?t:"",name:n??t}}function U(e){let t="",n="";if((0,p.p)(e.firstElementChild,{Exception:e=>(t=e.getAttribute("exceptionCode"),{ExceptionText:e=>{n=e.textContent}})}),t)throw new s.A(`wfs-layer:${t}`,n)}function $(e,t,n){const i={wkid:t.defaultSpatialReference},s=null!=n?.wkid?{wkid:n.wkid}:i;return{spatialReference:s,getFeatureSpatialReference:(0,m.Fi)(e)||s.wkid&&t.supportedSpatialReferences.includes(s.wkid)?{wkid:s.wkid}:{wkid:t.defaultSpatialReference}}}},36708:(e,t,n)=>{n.d(t,{C_:()=>d,OH:()=>f,Vh:()=>y,on:()=>h,pc:()=>g,wB:()=>l,z7:()=>u});var i=n(37955),s=n(36563),r=n(97768),o=n(74887),a=n(14012);function l(e,t,n={}){return c(e,t,n,p)}function u(e,t,n={}){return c(e,t,n,m)}function c(e,t,n={},i){let s=null;const o=n.once?(e,n)=>{i(e)&&((0,r.xt)(s),t(e,n))}:(e,n)=>{i(e)&&t(e,n)};if(s=(0,a.Cn)(e,o,n.sync,n.equals),n.initial){const t=e();o(t,t)}return s}function h(e,t,n,o={}){let a=null,u=null,c=null;function h(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.xt)(c),n(e)}const p=l(e,(e,n)=>{h(),(0,i.wb)(e)&&(a=e,u=(0,i.on)(e,t,d),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return c=(0,s.hA)(()=>{p.remove(),h()}),c}function d(e,t){return function(e,t,n){if((0,o.G4)(n))return Promise.reject((0,o.NK)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,r.xt)(a)}return new Promise((i,r)=>{a=(0,s.vE)([(0,o.u7)(n,()=>{l(),r((0,o.NK)())}),c(e,e=>{l(),i(e)},{sync:!1,once:!0},t??p)])})}(e,m,t)}function p(e){return!0}function m(e){return!!e}n(80559);const f={sync:!0},y={initial:!0},g={sync:!0,initial:!0}},37730:(e,t,n)=>{n.d(t,{T:()=>s});var i=n(43334);const s={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new i.Om(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)}},39357:(e,t,n)=>{n.d(t,{H:()=>a});var i,s=n(31635),r=n(25482),o=n(91429);let a=i=class extends r.o{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,s.Cg)([(0,o.MZ)({type:String,json:{write:{isRequired:!0}}})],a.prototype,"name",void 0),(0,s.Cg)([(0,o.MZ)({type:[String,Number],json:{write:{isRequired:!0}}})],a.prototype,"code",void 0),a=i=(0,s.Cg)([(0,o.$K)("esri.layers.support.CodedValue")],a)},50498:(e,t,n)=>{n.d(t,{Ye:()=>h,gy:()=>c,yR:()=>d});var i=n(66552),s=n(5443),r=n(91075),o=n(48526),a=n(86738),l=n(39829),u=n(82799);const c=(0,i.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),h=(0,i.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),d={base:r.A,key:"type",typeMap:{extent:s.A,multipoint:o.A,point:a.A,polyline:u.A,polygon:l.A}}},53177:(e,t,n)=>{n.d(t,{A:()=>c});var i,s=n(31635),r=n(4718),o=n(91429),a=n(39357),l=n(76357),u=n(93223);let c=class extends l.A{static{i=this}constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const n=String(e);this.codedValues.some(e=>(String(e.code)===n&&(t=e.name),!!t))}return t}clone(){return new i({codedValues:(0,r.o8)(this.codedValues),name:this.name})}};(0,s.Cg)([(0,o.MZ)({type:[a.H],json:{write:{isRequired:!0}}})],c.prototype,"codedValues",void 0),(0,s.Cg)([(0,u.e)({codedValue:"coded-value"})],c.prototype,"type",void 0),c=i=(0,s.Cg)([(0,o.$K)("esri.layers.support.CodedValueDomain")],c)},60999:(e,t,n)=>{n.d(t,{DZ:()=>m,Ke:()=>p,Tj:()=>c,UT:()=>f,aD:()=>g,jJ:()=>u});var i=n(31635),s=n(69622),r=n(97768),o=n(74887),a=n(10107),l=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 h(e){return{ok:!0,value:e}}function d(e){return{ok:!1,error:e}}async function p(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return h(await e)}catch(e){return d(e)}}async function m(e){try{return h(await e)}catch(e){return(0,o.QP)(e),d(e)}}function f(e,t){return new y(e,t)}let y=class extends s.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,r.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=h(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,r.xt)(this._abortHandle),this._abortController=null}};(0,i.Cg)([(0,a.MZ)()],y.prototype,"value",null),(0,i.Cg)([(0,a.MZ)()],y.prototype,"error",null),(0,i.Cg)([(0,a.MZ)()],y.prototype,"finished",null),(0,i.Cg)([(0,a.MZ)()],y.prototype,"promise",void 0),(0,i.Cg)([(0,a.MZ)()],y.prototype,"_result",void 0),y=(0,i.Cg)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],y);class g{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)}}}},66344:(e,t,n)=>{n.d(t,{q:()=>a});const i=!!(0,n(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class s{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._users=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._users.clear(),this._db.clear()}register(e){this._users.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._users.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const n=this._db.get(e.id+t);return n?.size??0}put(e,t,n,s,o){t=e.id+t;const a=this._db.get(t);if(a&&(this._size-=a.size,e.size-=a.size,this._db.delete(t),a.entry!==n&&this._notifyRemove(t,a.entry,a.size,0)),s>this._maxSize)return void this._notifyRemove(t,n,s,0);if(void 0===n)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return i||console.warn(`Refusing to cache entry with size ${s} for key ${t}`),void this._notifyRemove(t,n,0,0);const l=1+Math.max(o,-4)- -3;this._db.set(t,new r(n,s,l)),this._size+=s,e.size+=s,this._checkSize()}updateSize(e,t){t=e.id+t;const n=this._db.get(t);if(!n)return;this._size-=n.size,e.size-=n.size;let i=n.entry.usedMemory;for(;i>this._maxSize;){const e=this._notifyRemove(t,n.entry,i,1);if(!(null!=e&&e>0))return void this._db.delete(t);i=e}n.size=i,this._size+=i,e.size+=i,this._checkSize()}pop(e,t){t=e.id+t;const n=this._db.get(t);if(n)return this._size-=n.size,e.size-=n.size,this._db.delete(t),++this._hit,n.entry;++this._miss}get(e,t){t=e.id+t;const n=this._db.get(t);if(void 0!==n)return this._db.delete(t),n.lives=n.lifetime,this._db.set(t,n),++this._hit,n.entry;++this._miss}peek(e,t){const n=this._db.get(e.id+t);return n?++this._hit:++this._miss,n?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},n=new Array;this._db.forEach((e,i)=>{const s=e.lifetime;n[s]=(n[s]||0)+e.size,this._users.forEach(n=>{const{id:s,name:r}=n;if(i.startsWith(s)){const n=t[r]||0;t[r]=n+e.size}})});const i={};this._users.forEach(e=>{const n=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const s=t[n]||0;t[n]=s,i[n]=Math.round(100*e.hitRate)+"%"}else i[n]="0%"});const s=Object.keys(t);s.sort((e,n)=>t[n]-t[e]),s.forEach(n=>e[n]=Math.round(t[n]/2**20)+"MB / "+i[n]);for(let t=n.length-1;t>=0;--t){const i=n[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forEach(e=>e.resetHitRate())}clear(e){const t=e.id;this._db.forEach((e,n)=>{n.startsWith(t)&&(this._size-=e.size,this._db.delete(n),this._notifyRemove(n,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._users.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(const[t,n]of this._db)t.startsWith(e.id)&&(yield n.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,n,i){const s=this._users.get(e.split(o)[0])?.removeFunc,r=s?.(t,i,n);return"number"==typeof r?r:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._checkSizeLimits(this.maxSize)}setMaxSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){const n=t??this;if(n.size<=e)return;const i=t?.id;let s=!0;for(;s;){s=!1;for(const[r,a]of this._db)if(0===a.lifetime&&(!i||r.startsWith(i))){const i=t??this._users.get(r.split(o)[0]);if(this._purgeItem(r,a,i),n.size<=.9*e)return;s||=this._db.has(r)}}for(const[s,r]of this._db)if(!i||s.startsWith(i)){const i=t??this._users.get(s.split(o)[0]);if(this._purgeItem(s,r,i),n.size<=.9*e)return}}_purgeItem(e,t,n){if(this._db.delete(e),t.lives<=1){this._size-=t.size,n&&(n.size-=t.size);const i=this._notifyRemove(e,t.entry,t.size,1);null!=i&&i>0&&(this._size+=i,n&&(n.size+=i),t.lives=t.lifetime,t.size=i,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new s(0);class r{constructor(e,t,n){this.entry=e,this.size=t,this.lifetime=n,this.lives=n}}const o=":";class a{constructor(e,t){this.removeFunc=t,this._storage=new s,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy(),this._storage=null}put(e,t,n=1){this._storage.put(this,e,t,n,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},67482:(e,t,n)=>{function i(e){return null!=a(e)||null!=o(e)}function s(e){return l.test(e)}function r(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let n=!0;if(c&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,i=0;for(;!t&&i<=e.length;)t=!u.test(e[i]),i++;n=!t}}return n}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=l.exec(e);if(!t?.groups)return null;const n=t.groups,i=+n.year,s=+n.month-1,r=+n.day,o=+(n.hours??"0"),a=+(n.minutes??"0"),u=+(n.seconds??"0");if(o>23)return null;if(a>59)return null;if(u>59)return null;const c=n.ms??"0",h=c?+c.padEnd(3,"0").slice(0,3):0;let d;if(n.isUTC||!n.offsetSign)d=Date.UTC(i,s,r,o,a,u,h);else{const e=+n.offsetHours,t=+n.offsetMinutes;d=6e4*("+"===n.offsetSign?-1:1)*(60*e+t)+Date.UTC(i,s,r,o,a,u,h)}return Number.isNaN(d)?null:d}n.d(t,{Br:()=>s,Cq:()=>i,_U:()=>r});const l=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,u=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,c=!Number.isNaN(new Date("technology 10").getTime())},69540:(e,t,n)=>{n.d(t,{OU:()=>c,Pw:()=>h});var i=n(31635),s=n(69622),r=(n(44208),n(4718)),o=(n(53966),n(97768)),a=n(88620),l=n(64108);const u=Symbol("ClonableMixin"),c=e=>{var t;const n=e;let s=class extends n{constructor(){super(...arguments),this[t]=!0}static{t=u}clone(e){const t=(0,a.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");const n=t.metadata,i=t.store,s={},l=new Map;for(const t in n){const o=n[t],a=i?.originOf(t),u=o.clonable;if(o.readOnly||!1===u||7!==a&&0!==a&&5!==a&&4!==a)continue;const c=this[t];let h=null;if("function"==typeof u)h=u(c,e);else if("reference"===u)h=c;else if(h=(0,r.TU)(c,e),null!=c&&null==h)continue;0===a?l.set(t,h):s[t]=h}const u=new(0,Object.getPrototypeOf(this).constructor)(s);if(l.size){const e=(0,a.oY)(u)?.store;if(e)for(const[t,n]of l)e.set(t,n,0)}return u}};return s=(0,i.Cg)([(0,l.$)("esri.core.Clonable")],s),s},h=c(s.A)},75503:(e,t,n)=>{n.d(t,{EC:()=>T,wq:()=>a});var i=n(4576),s=n(21818),r=(n(44208),n(15142)),o=n(11006);class a{constructor(e=9,t){this._compareMinX=d,this._compareMinY=p,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),S.prune(),C.prune(),v.prune()}all(e){l(this._data,e)}search(e,t){let n=this._data;const i=this._toBBox;if(b(e,n))for(x.clear();n;){for(let s=0,r=n.children.length;s<r;s++){const r=n.children[s],o=n.leaf?i(r):r;b(e,o)&&(n.leaf?t(r):_(e,o)?l(r,t):x.push(r))}n=x.pop()}}collides(e){let t=this._data;const n=this._toBBox;if(!b(e,t))return!1;for(x.clear();t;){for(let i=0,s=t.children.length;i<s;i++){const s=t.children[i],r=t.leaf?n(s):s;if(b(e,r)){if(t.leaf||_(e,r))return!0;x.push(s)}}t=x.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,n=e.length;t<n;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new M([]),this}remove(e){if(!e)return this;let t,n=this._data,r=null,o=0,a=!1;const l=this._toBBox(e);for(C.clear(),v.clear();n||C.length>0;){if(n||(n=C.pop(),r=C.data[C.length-1],o=v.pop()??0,a=!0),n.leaf&&(t=(0,i.qh)(n.children,(0,s.zI)(e),n.children.length,n.indexHint),-1!==t))return n.children.splice(t,1),C.push(n),this._condense(C),this;a||n.leaf||!_(n,l)?r?(o++,n=r.children[o],a=!1):n=null:(C.push(n),v.push(o),o=0,r=n,n=n.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,n,i){const s=n-t+1;let r=this._maxEntries;if(s<=r){const i=new M(e.slice(t,n+1));return u(i,this._toBBox),i}i||(i=Math.ceil(Math.log(s)/Math.log(r)),r=Math.ceil(s/r**(i-1)));const o=new A([]);o.height=i;const a=Math.ceil(s/r),l=a*Math.ceil(Math.sqrt(r));w(e,t,n,l,this._compareMinX);for(let s=t;s<=n;s+=l){const t=Math.min(s+l-1,n);w(e,s,t,a,this._compareMinY);for(let n=s;n<=t;n+=a){const s=Math.min(n+a-1,t);o.children.push(this._build(e,n,s,i-1))}}return u(o,this._toBBox),o}_insert(e,t,n){const i=this._toBBox,s=n?e:i(e);C.clear();const r=function(e,t,n,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==n;){let n,i=1/0,s=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=m(o),l=y(e,o)-a;l<s?(s=l,i=a<i?a:i,n=o):l===s&&a<i&&(i=a,n=o)}t=n||t.children[0]}return t}(s,this._data,t,C);for(r.children.push(e),h(r,s);t>=0&&C.data[t].children.length>this._maxEntries;)this._split(C,t),t--;!function(e,t,n){for(let i=n;i>=0;i--)h(t.data[i],e)}(s,C,t)}_split(e,t){const n=e.data[t],i=n.children.length,s=this._minEntries;this._chooseSplitAxis(n,s,i);const r=this._chooseSplitIndex(n,s,i);if(!r)return;const o=n.children.splice(r,n.children.length-r),a=n.leaf?new M(o):new A(o);a.height=n.height,u(n,this._toBBox),u(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this._data=new A([e,t]),this._data.height=e.height+1,u(this._data,this._toBBox)}_chooseSplitIndex(e,t,n){let i,s,r;i=s=1/0;for(let o=t;o<=n-t;o++){const t=c(e,0,o,this._toBBox),a=c(e,o,n,this._toBBox),l=g(t,a),u=m(t)+m(a);l<i?(i=l,r=o,s=u<s?u:s):l===i&&u<s&&(s=u,r=o)}return r}_chooseSplitAxis(e,t,n){const i=e.leaf?this._compareMinX:d,s=e.leaf?this._compareMinY:p;this._allDistMargin(e,t,n,i)<this._allDistMargin(e,t,n,s)&&e.children.sort(i)}_allDistMargin(e,t,n,i){e.children.sort(i);const s=this._toBBox,r=c(e,0,t,s),o=c(e,n-t,n,s);let a=f(r)+f(o);for(let i=t;i<n-t;i++){const t=e.children[i];h(r,e.leaf?s(t):t),a+=f(r)}for(let i=n-t-1;i>=t;i--){const t=e.children[i];h(o,e.leaf?s(t):t),a+=f(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const n=e.data[t];if(0===n.children.length)if(t>0){const s=e.data[t-1],r=s.children;r.splice((0,i.qh)(r,n,r.length,s.indexHint),1)}else this.clear();else u(n,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let n=e;for(S.clear();n;){if(!0===n.leaf)for(const e of n.children)t((0,s.zI)(e));else S.pushArray(n.children);n=S.pop()??null}}function u(e,t){c(e,0,e.children.length,t,e)}function c(e,t,n,i,s){s||(s=new M([])),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let r,o=t;o<n;o++)r=e.children[o],h(s,e.leaf?i(r):r);return s}function h(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function d(e,t){return e.minX-t.minX}function p(e,t){return e.minY-t.minY}function m(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function y(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){const n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,s-n)*Math.max(0,r-i)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function b(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function w(e,t,n,i,s){const r=[t,n];for(;r.length;){const t=r.pop(),n=r.pop();if(t-n<=i)continue;const a=n+Math.ceil((t-n)/i/2)*i;(0,o.q)(e,a,n,t,s),r.push(n,a,a,t)}}const x=new r.A,S=new r.A,C=new r.A,v=new r.A({deallocator:void 0});class T{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class F extends T{constructor(){super(...arguments),this.height=1,this.indexHint=new i.vW}}class M extends F{constructor(e){super(),this.children=e,this.leaf=!0}}class A extends F{constructor(e){super(),this.children=e,this.leaf=!1}}},76357:(e,t,n)=>{n.d(t,{A:()=>u});var i=n(31635),s=n(66552),r=n(25482),o=n(91429),a=n(93223);const l=new s.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let u=class extends r.o{constructor(e){super(e),this.name=null,this.type=null}};(0,i.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],u.prototype,"name",void 0),(0,i.Cg)([(0,a.e)(l),(0,o.MZ)({json:{write:{isRequired:!0}}})],u.prototype,"type",void 0),u=(0,i.Cg)([(0,o.$K)("esri.layers.support.Domain")],u)},80451:(e,t,n)=>{n.d(t,{rS:()=>p,gK:()=>d}),n(44208);var i,s=n(53177),r=n(76357),o=n(31635),a=n(91429),l=n(93223);let u=class extends r.A{static{i=this}constructor(e){super(e),this.type="inherited"}clone(){return new i}};var c;(0,o.Cg)([(0,l.e)({inherited:"inherited"})],u.prototype,"type",void 0),u=i=(0,o.Cg)([(0,a.$K)("esri.layers.support.InheritedDomain")],u);let h=class extends r.A{static{c=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new c({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,o.Cg)([(0,a.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,n){t[n]=[this.minValue||0,e]},isRequired:!0}}})],h.prototype,"maxValue",void 0),(0,o.Cg)([(0,a.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,n){t[n]=[e,this.maxValue||0]},isRequired:!0}}})],h.prototype,"minValue",void 0),(0,o.Cg)([(0,l.e)({range:"range"})],h.prototype,"type",void 0),h=c=(0,o.Cg)([(0,a.$K)("esri.layers.support.RangeDomain")],h);const d={key:"type",base:r.A,typeMap:{range:h,"coded-value":s.A,inherited:u}};function p(e){if(!e?.type)return null;switch(e.type){case"range":return h.fromJSON(e);case"codedValue":return s.A.fromJSON(e);case"inherited":return u.fromJSON(e)}return null}},82832:(e,t,n)=>{n.d(t,{$1:()=>y,CR:()=>f,MB:()=>d,PC:()=>g,Yx:()=>l,bP:()=>c});var i=n(67482),s=n(21325),r=n(30524);class o{constructor(e){this.description=e,this.code=null}}class a{constructor(e){this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error=new o(e)}}function l(e){return new a(e)}class u{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function c(e){return new u(e)}const h=new Set;function d(e,t,n,i=!1){h.clear();for(const s in n){const o=e.get(s);if(!o)continue;const a=p(o,n[s]);if(h.add(o.name),o&&(i||o.editable)){const e=(0,r.CJ)(o,a);if(e)return l((0,r.uo)(e,o,a));t[o.name]=a}}for(const t of e.requiredFields??[])if(!h.has(t.name))return l(`missing required field "${t.name}"`);return null}function p(e,t){let n=t;return(0,r.WA)(e)&&"string"==typeof t?n=parseFloat(t):(0,r.yM)(e)&&null!=t&&"string"!=typeof t?n=String(t):(0,r.vE)(e)&&"string"==typeof t&&(n=(0,i._U)(t)),(0,r.WX)(n)}let m;function f(e,t){if(!e||!(0,s.fn)(t))return e;if("rings"in e||"paths"in e){if(null==m)throw new TypeError("geometry engine not loaded");return m.simplify(t,e)}return e}async function y(e,t){!(0,s.fn)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==m&&(m=await Promise.all([n.e(3209),n.e(7559)]).then(n.bind(n,47559))),m}()}const g={supportsAutoIntervalBin:!0,supportsFixedIntervalBin:!0,supportsFixedBoundariesBin:!0,supportsDateBin:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsNormalization:!0,supportedStatisticTypes:["COUNT","SUM","AVG","VAR","STDDEV","MIN","MAX","PERCENTILE_CONT","PERCENTILE_DISC","CentroidAggregate","EnvelopeAggregate","ConvexHullAggregate"],supportedNormalizationTypes:["field","log","naturalLog","percentOfTotal","squareRoot"]}},83221:(e,t,n)=>{n.d(t,{A:()=>m});var i=n(4576),s=n(49186),r=n(65529),o=n(53966),a=n(70328),l=n(19419),u=n(90708),c=n(6518),h=n(51441),d=n(37730);const p=(0,a.vt)();class m{constructor(e){this.geometryInfo=e,this._boundsStore=new c.F,this._featuresById=new Map,this._usedMemory=0,this.events=new r.bk,this.featureAdapter=d.T}get usedMemory(){return this._usedMemory}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,n,i,s]=this.fullBounds;return{xmin:t,ymin:n,xmax:i,ymax:s,spatialReference:(0,h.ag)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(e=>this._upsert(e));return this._emitChanged(),t.filter(i.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const n of e){const e=this._boundsStore.get(n.objectId);e&&t((0,a.Jt)(p,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,e=>{t(this._featuresById.get(e))})}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new s.A("featurestore:invalid-feature","feature id is missing",{feature:e}));const n=this._featuresById.get(t);let i;if(n?(e.displayId=n.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(n)??0):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.jQ)(null!=i?i:(0,l.vt)(),e.geometry),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e),this._usedMemory+=this.estimateFeatureUsedMemory?.(e)??0}_upsert(e){const t=e?.objectId;if(null==t)return o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new s.A("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const n=this._featuresById.get(t);if(!n)return this._add(e),e;this._usedMemory-=this.estimateFeatureUsedMemory?.(n)??0;const{geometry:i,attributes:r}=e;for(const e in r)n.attributes[e]=r[e];return i&&(n.geometry=i,this._boundsStore.set(t,(0,u.jQ)((0,l.vt)(),i)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(n)??0,n}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._boundsStore.delete(t),this._featuresById.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(e)??0,e}}},85113:(e,t,n)=>{n.d(t,{BM:()=>T,bd:()=>F,sO:()=>v,xD:()=>h});var i=n(67482),s=n(49186),r=n(21325),o=n(90708),a=n(43334),l=n(92722),u=n(30524);const c={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function h(e){return c[e]}function*d(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*p(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function m(e){for(const t of e)if(t.length>2)return!0;return!1}function f(e){let t=0;for(let n=0;n<e.length;n++){const i=e[n],s=e[(n+1)%e.length];t+=i[0]*s[1]-s[0]*i[1]}return t<=0}function y(e){const t=e[0],n=e[e.length-1];t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]||e.push(t)}function g(e,t){const{coordinates:n,type:i}=e,s=t.hasZ??!1,r=!0;switch(i){case"Point":return new l.A([],[...n],s,!1);case"LineString":return(0,o.Ap)({paths:[n],hasZ:r},s,!1);case"MultiLineString":return(0,o.Ap)({paths:n,hasZ:r},s,!1);case"MultiPoint":return(0,o.PR)({points:n,hasZ:r},s,!1);case"Polygon":case"MultiPolygon":{const e=new l.A([],[],s,!1);for(const t of"Polygon"===i?[n]:n){_(e,t[0],s);for(let n=1;n<t.length;n++)b(e,t[n],s)}return e}}}function _(e,t,n){y(t),function(e){return!f(e)}(t)?x(e,t,n):w(e,t,n)}function b(e,t,n){y(t),function(e){return f(e)}(t)?x(e,t,n):w(e,t,n)}function w(e,t,n){for(const i of t)S(e,i,n);e.lengths.push(t.length)}function x(e,t,n){for(let i=t.length-1;i>=0;i--)S(e,t[i],n);e.lengths.push(t.length)}function S(e,[t,n,i],s){e.coords.push(t,n),s&&e.coords.push(i||0)}function C(e){switch(typeof e){case"string":return(0,i.Br)(e)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function v(e,t=4326){if(!e)throw new s.A("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new s.A("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:n}=e;if(!n)return;const i="string"==typeof n?n:"name"===n.type?n.properties.name:"EPSG"===n.type?n.properties.code:null,o=(0,r.oT)({wkid:t})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${t})$`,"i");if(!i||!o.test(i))throw new s.A("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:n})}function T(e,t={}){const n=[],i=new Set,s=new Set;let r,o=!1,a=null,l=!1,{geometryType:c=null}=t;for(const t of d(e)){const{geometry:e,properties:d,id:f}=t;if((!e||(c||(c=h(e.type)),h(e.type)===c))&&(o||(o=m(p(e))),l||(l=null!=f,l&&(r=typeof f,d&&(a=Object.keys(d).filter(e=>d[e]===f)))),d&&a&&l&&null!=f&&(a.length>1?a=a.filter(e=>d[e]===f):1===a.length&&(a=d[a[0]]===f?a:[])),d))for(const e in d){if(i.has(e))continue;const t=C(d[e]);if("unknown"===t){s.add(e);continue}s.delete(e),i.add(e);const r=(0,u.rS)(e);r&&n.push({name:r,alias:e,type:t})}}const f=(0,u.rS)(1===a?.length&&a[0]||null)??void 0;if(f)for(const e of n)if(e.name===f&&(0,u.WA)(e)){e.type="esriFieldTypeOID";break}return{fields:n,geometryType:c,hasZ:o,objectIdFieldName:f,objectIdFieldType:r,unknownFields:Array.from(s)}}function F(e,t){return Array.from(function*(e,t={}){const{geometryType:n,objectIdField:i}=t;for(const s of e){const{geometry:e,properties:r,id:o}=s;if(e&&h(e.type)!==n)continue;const l=r||{};let u;i&&(u=l[i],null==o||u||(l[i]=u=o)),yield new a.Om(e&&g(e,t),l,null,u)}}(d(e),t))}},98453:(e,t,n)=>{n.d(t,{m:()=>i});const i=new(n(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9801],{17136:(e,t,r)=>{r.d(t,{Y_:()=>v,O7:()=>N,el:()=>I});var n=r(92602),s=r(69052),o=r(49186),i=r(53966),c=r(39829),a=r(82799),u=r(16930),l=r(80754),h=r(21325),f=r(28735),d=r(11254),g=r(65864),y=r(2272),m=r(84952),p=r(92300);const w=()=>i.A.getLogger("esri.geometry.support.normalizeUtils");function _(e){return"polygon"===e[0].type}function b(e){return"polyline"===e[0].type}function S(e,t,r){if(t){const t=function(e,t){if(!(e instanceof a.A||e instanceof c.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw w().error(e),new o.A("internal:geometry",e)}const r=(0,l.r8)(e),n=[];for(const e of r){const r=[];n.push(r),r.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const s=e[n][0],o=e[n][1],i=e[n+1][0],c=e[n+1][1],a=Math.sqrt((i-s)*(i-s)+(c-o)*(c-o)),u=(c-o)/a,l=(i-s)/a,h=a/t;if(h>1){for(let e=1;e<=h-1;e++){const n=e*t,i=l*n+s,c=u*n+o;r.push([i,c])}const e=(a+Math.floor(h-1)*t)/2,n=l*e+s,i=u*e+o;r.push([n,i])}r.push([i,c])}}return function(e){return"polygon"===e.type}(e)?new c.A({rings:n,spatialReference:e.spatialReference}):new a.A({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,f.ci)(t,!0)}return r&&(e=(0,l.kS)(e,r)),e}function A(e,t,r){if(Array.isArray(e)){const n=e[0];if(n>t){const r=(0,l.kd)(n,t);e[0]=n+r*(-2*t)}else if(n<r){const t=(0,l.kd)(n,r);e[0]=n+t*(-2*r)}}else{const n=e.x;if(n>t){const r=(0,l.kd)(n,t);e=e.clone().offset(r*(-2*t),0)}else if(n<r){const t=(0,l.kd)(n,r);e=e.clone().offset(t*(-2*r),0)}}return e}function k(e,t){let r=-1;for(let n=0;n<t.cutIndexes.length;n++){const s=t.cutIndexes[n],o=t.geometries[n],i=(0,l.r8)(o);for(let e=0;e<i.length;e++){const t=i[e];t.some(r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const n=t[e][0];r=n>r?n:r}r=Number(r.toFixed(9));const n=-360*(0,l.kd)(r,180);for(let r=0;r<t.length;r++){const t=o.getPoint(e,r);o.setPoint(e,r,t.clone().offset(n,0))}return!0}})}if(s===r){if(_(e))for(const t of(0,l.r8)(o))e[s]=e[s].addRing(t);else if(b(e))for(const t of(0,l.r8)(o))e[s]=e[s].addPath(t)}else r=s,e[s]=o}return e}async function I(e,t,r){if(!Array.isArray(e))return I([e],t);t&&"string"!=typeof t&&w().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const s="string"==typeof t?t:t?.url??n.A.geometryServiceUrl;let o,i,u,_,b,N,M,v,F=0;const x=[],R=[];for(const t of e)if(null!=t)if(o||(o=t.spatialReference,i=(0,h.Vp)(o),u=o.isWebMercator,N=u?102100:4326,_=l.j7[N].maxX,b=l.j7[N].minX,M=l.j7[N].plus180Line,v=l.j7[N].minus180Line),i)if("mesh"===t.type)R.push(t);else if("point"===t.type)R.push(A(t.clone(),_,b));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>A(e,_,b)),R.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,i);R.push(e.rings?new c.A(e):e)}else if(t.extent){const e=t.extent,r=(0,l.kd)(e.xmin,b)*(2*_);let n=0===r?t.clone():(0,l.kS)(t.clone(),r);e.offset(r,0);let{xmin:s,xmax:o}=e;s=Number(s.toFixed(9)),o=Number(o.toFixed(9)),e.intersects(M)&&o!==_?(F=o>F?o:F,n=S(n,u),x.push(n),R.push("cut")):e.intersects(v)&&s!==b?(F=o*(2*_)>F?o*(2*_):F,n=S(n,u,360),x.push(n),R.push("cut")):R.push(n)}else R.push(t.clone());else R.push(t);else R.push(t);let T=(0,l.kd)(F,_),C=-90;const P=T,q=new a.A;for(;T>0;){const e=360*T-180;q.addPath([[e,C],[e,-1*C]]),C*=-1,T--}if(x.length>0&&P>0){const t=k(x,await async function(e,t,r,n){const s=(0,y.Dl)(e),o=t[0].spatialReference,i={...n,responseType:"json",query:{...s.query,f:"json",sr:(0,h.YX)(o),target:JSON.stringify({geometryType:(0,g.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},c=await(0,d.A)(s.path+"/cut",i),{cutIndexes:a,geometries:u=[]}=c.data;return{cutIndexes:a,geometries:u.map(e=>{const t=(0,g.rS)(e);return t.spatialReference=o,t})}}(s,x,q,r)),n=[],o=[];for(let r=0;r<R.length;r++){const s=R[r];if("cut"!==s)o.push(s);else{const s=t.shift(),i=e[r];null!=i&&"polygon"===i.type&&i.rings&&i.rings.length>1&&s.rings.length>=i.rings.length?(n.push(s),o.push("simplify")):o.push(u?(0,f.Gh)(s):s)}}if(!n.length)return o;const i=await async function(e,t,r){const n="string"==typeof e?(0,m.An)(e):e,s=t[0].spatialReference,o=(0,g.$B)(t[0]),i={...r,query:{...n.query,f:"json",sr:(0,h.YX)(s),geometries:JSON.stringify((0,p.X)(t))}},{data:c}=await(0,d.A)(n.path+"/simplify",i);return(0,p.V)(c.geometries,o,s)}(s,n,r),c=[];for(let e=0;e<o.length;e++){const t=o[e];"simplify"!==t?c.push(t):c.push(u?(0,f.Gh)(i.shift()):i.shift())}return c}const L=[];for(let e=0;e<R.length;e++){const t=R[e];if("cut"!==t)L.push(t);else{const e=x.shift();L.push(!0===u?(0,f.Gh)(e):e)}}return L}function N(e,t,r){const n=(0,h.Vp)(r);if(null==n)return e;const[s,o]=n.valid,i=2*o;let c=0,a=0;t>o?c=Math.ceil(Math.abs(t-o)/i):t<s&&(c=-Math.ceil(Math.abs(t-s)/i)),e>o?a=Math.ceil(Math.abs(e-o)/i):e<s&&(a=-Math.ceil(Math.abs(e-s)/i));let u=e+(c-a)*i;const l=u-t;return l>o?u-=i:l<s&&(u+=i),u}function M(e){const t=(0,h.Vp)(e);if(null==t)return null;const[r,n]=t.valid;return new s.hr(r,n)}const v=M(u.A.WGS84);M(u.A.WebMercator)},27647:(e,t,r)=>{r.d(t,{Q:()=>o});var n=r(92722);function s(e,t){return e?t?4:3:t?3:2}function o(e){if(null==e)return null;if(!e?.lengths.length)return null;const{lengths:t,coords:r,stride:s,hasZ:o,hasM:a}=e,u=new n.A([],[],o,!1),l=u.coords,h=[],f=o?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];let d=0;for(const e of t){const t=i(f,r,d,e,o,a);t&&h.push(t),d+=e*s}if(h.sort((e,t)=>{let r=e[2]-t[2];return 0===r&&o&&(r=e[4]-t[4]),r}),h.length){let e=6*h[0][2];l[0]=h[0][0]/e,l[1]=h[0][1]/e,o&&(e=6*h[0][4],l[2]=0!==e?h[0][3]/e:0),(l[0]<f[0]||l[0]>f[1]||l[1]<f[2]||l[1]>f[3]||o&&(l[2]<f[4]||l[2]>f[5]))&&(l.length=0)}if(!l.length){const n=e.lengths[0]?c(r,0,t[0],o,a):null;if(!n)return null;l[0]=n[0],l[1]=n[1],o&&(l[2]=n[2]??0)}return u}function i(e,t,r,n,o,i){const c=s(o,i);let a=r,u=r+c,l=0,h=0,f=0,d=0,g=0;for(let r=0,s=n-1;r<s;r++,a+=c,u+=c){const r=t[a],n=t[a+1],s=t[a+2],i=t[u],c=t[u+1],y=t[u+2];let m=r*c-i*n;d+=m,l+=(r+i)*m,h+=(n+c)*m,o&&(m=r*y-i*s,f+=(s+y)*m,g+=m),r<e[0]&&(e[0]=r),r>e[1]&&(e[1]=r),n<e[2]&&(e[2]=n),n>e[3]&&(e[3]=n),o&&(s<e[4]&&(e[4]=s),s>e[5]&&(e[5]=s))}if(d>0&&(d*=-1),g>0&&(g*=-1),!d)return null;const y=[l,h,.5*d];return o&&(y[3]=f,y[4]=.5*g),y}function c(e,t,r,n,o){const i=s(n,o);let c=t,f=t+i,d=0,g=0,y=0,m=0;for(let t=0,s=r-1;t<s;t++,c+=i,f+=i){const t=e[c],r=e[c+1],s=e[c+2],o=e[f],i=e[f+1],p=e[f+2],w=n?u(t,r,s,o,i,p):a(t,r,o,i);if(w)if(d+=w,n){const e=h(t,r,s,o,i,p);g+=w*e[0],y+=w*e[1],m+=w*e[2]}else{const e=l(t,r,o,i);g+=w*e[0],y+=w*e[1]}}return d>0?n?[g/d,y/d,m/d]:[g/d,y/d]:r>0?n?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function a(e,t,r,n){const s=r-e,o=n-t;return Math.sqrt(s*s+o*o)}function u(e,t,r,n,s,o){const i=n-e,c=s-t,a=o-r;return Math.sqrt(i*i+c*c+a*a)}function l(e,t,r,n){return[e+.5*(r-e),t+.5*(n-t)]}function h(e,t,r,n,s,o){return[e+.5*(n-e),t+.5*(s-t),r+.5*(o-r)]}},30624:(e,t,r)=>{r.r(t),r.d(t,{createConnection:()=>k});var n=r(31635),s=r(11254),o=r(49186),i=r(53966),c=r(74887),a=r(84952),u=r(91429),l=r(16930),h=r(65864),f=r(62815),d=r(65529);let g=class extends d.nJ{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new o.A("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};(0,n.Cg)([(0,u.MZ)({readOnly:!0})],g.prototype,"connectionError",null),g=(0,n.Cg)([(0,u.$K)("esri.layers.support.StreamConnection")],g);let y=class extends g{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:n}=e;this._config=e,this._featureZScaler=(0,f.N)(t,n,r),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case 0:case 1:return"connected";case 2:case 3:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const t=(0,a.a6)(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(n){const s=t/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(i.A.getLogger(this).error(new o.A("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(i.A.getLogger(this).error(new o.A("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,n)),await(0,c.Pl)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(e){return void i.A.getLogger(this).error(new o.A("websocket-connection","Failed to parse message, invalid JSON",{error:e}))}}}_createWebSocket(e){return new Promise((t,r)=>{const n=new WebSocket(e);n.onopen=()=>{if(n.onopen=null,this.destroyed)return n.onclose=null,void n.close();n.onclose=e=>this._onClose(e),n.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(n),t(n)},n.onclose=e=>{n.onopen=n.onclose=null,r(e)}})}async _handshake(e=1e4){const t=this._websocket;if(null==t)return;const r=(0,c.Tw)(),n=t.onmessage,{filter:s,outFields:a,spatialReference:u}=this._config;return r.timeout(e),t.onmessage=e=>{let c=null;try{c=JSON.parse(e.data)}catch(e){}c&&"object"==typeof c||(i.A.getLogger(this).error(new o.A("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),r.reject(),this.destroy()),c.spatialReference?.wkid!==u?.wkid&&(i.A.getLogger(this).error(new o.A("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${u.wkid}`,e.data)),r.reject(),this.destroy()),"json"!==c.format&&(i.A.getLogger(this).error(new o.A("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),r.reject(),this.destroy()),s&&c.filter!==s&&i.A.getLogger(this).error(new o.A("websocket-connection","Tried to set filter, but server doesn't support it")),a&&c.outFields!==a&&i.A.getLogger(this).error(new o.A("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=n;for(const e of this._outstandingMessages)t.send(JSON.stringify(e));this._outstandingMessages=[],r.resolve()},t.send(JSON.stringify({filter:s,outFields:a,format:"json",spatialReference:{wkid:u.wkid}})),r.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),i.A.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&i.A.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,n.Cg)([(0,u.MZ)()],y.prototype,"connectionStatus",null),(0,n.Cg)([(0,u.MZ)()],y.prototype,"errorString",void 0),y=(0,n.Cg)([(0,u.$K)("esri.layers.graphics.sources.connections.WebSocketConnection")],y);var m=r(80893),p=r(61956);const w={maxQueryDepth:5,maxRecordCountFactor:3};let _=class extends y{constructor(e){super({...w,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||i.A.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:n}=this._config;this.destroyed||this._setFilter(r,n)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(t.geometry)}catch(e){return void i.A.getLogger(this).error(new o.A("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=(0,s.A)(e.path,{query:t,responseType:"json"}),n=(await r).data;return this._serviceDefinition=n,n}_fetchWebSocketUrl(e,t){const r=e[0],{urls:n,token:s}=r,o=this._inferWebSocketBaseUrl(n);return(0,a.a6)(`${o}/subscribe`,{outSR:""+t.wkid,token:s})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return i.A.getLogger(this).error(new o.A("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(null==r||null==e&&null==t)return;const n=JSON.stringify({filter:this._serializeFilter(e,t)});let s=!1;const a=(0,c.Tw)();return r.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(i.A.getLogger(this).error(new o.A("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),a.reject(t.error)),this._setWebSocketJSONParseHandler(r),s=!0,a.resolve())},r.send(n),setTimeout(()=>{s||(this.destroyed||this._websocket!==r||i.A.getLogger(this).error(new o.A("geoevent-connection","Server timed out when setting filter")),a.reject())},1e4),a.promise}_serializeFilter(e,t){const r={};if(null==e&&null==t)return r;if(e?.geometry)try{const t=(0,h.rS)(e.geometry);if("extent"!==t.type)throw new o.A("geoevent-connection",`Expected extent but found type ${t.type}`);r.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){i.A.getLogger(this).error(new o.A("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(r.where=e.where),null!=t&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],n=this._relatedFeatures.get(r);if(!n)return i.A.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:s,geometry:c}=n;for(const t in s)e.attributes[t]=s[t];return c&&(e.geometry=c),e.geometry||e.centroid||i.A.getLogger(this).error(new o.A("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),n=this._queryArchive(t);await r;const s=await n;if(!s)return;for(const e of s.features)this.onFeature(this._enrich(e))}catch(e){i.A.getLogger(this).error(new o.A("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([r.e(7330),r.e(3508),r.e(6554),r.e(2869),r.e(3910),r.e(4903),r.e(1214),r.e(9953),r.e(8399),r.e(1017),r.e(957),r.e(9708),r.e(8654),r.e(6647),r.e(812),r.e(655),r.e(2561)]).then(r.bind(r,68654))).default)({url:e}),{capabilities:n}=await t.load(),s=n.query.supportsMaxRecordCountFactor,o=n.query.supportsPagination,i=n.query.supportsCentroid,c=this._config.maxRecordCountFactor,a=t.capabilities.query.maxRecordCount,u=s?a*c:a,h=new p.A;if(h.outFields=this._config.outFields??["*"],h.where=this._config.filter?.where??"1=1",h.returnGeometry=!0,h.returnExceededLimitFeatures=!0,h.outSpatialReference=l.A.fromJSON(this._config.spatialReference),i&&(h.returnCentroid=!0),s&&(h.maxRecordCountFactor=c),o)return h.num=u,t.destroy(),this._queryPages(e,h);const f=await(0,m.eW)(e,h,this._config.sourceSpatialReference);return t.destroy(),f}async _queryPages(e,t,r=[],n=0){t.start=null!=t.num?n*t.num:null;const s=await(0,m.eW)(e,t,this._config.sourceSpatialReference);return s.exceededTransferLimit&&n<(this._config.maxQueryDepth??0)?(s.features.forEach(e=>r.push(e)),this._queryPages(e,t,r,n+1)):(r.forEach(e=>s.features.push(e)),s)}_addRelatedFeatures(e){const t=new Map,r=e.features,n=this._serviceDefinition.relatedFeatures.joinField;for(const e of r){const r=e.attributes[n];t.set(r,e)}this._relatedFeatures=t}};_=(0,n.Cg)([(0,u.$K)("esri.layers.graphics.sources.connections.GeoEventConnection")],_);var b=r(64108);let S=class extends g{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:n}=e;this._featureZScaler=(0,f.N)(t,n,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};function A(e,t){if(null==e&&null==t)return null;const r={};return null!=t&&(r.geometry=t),null!=e&&(r.where=e),r}function k(e,t,r,n,s,o,i,c,a){const u={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:n,filter:A(s,o),maxReconnectionAttempts:i,maxReconnectionInterval:c,customParameters:a};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new y(u):new _(u):new S(u)}(0,n.Cg)([(0,u.MZ)()],S.prototype,"connectionStatus",void 0),(0,n.Cg)([(0,u.MZ)()],S.prototype,"errorString",void 0),S=(0,n.Cg)([(0,b.$)("esri.layers.support.ClientSideConnection")],S)},43334:(e,t,r)=>{r.d(t,{N3:()=>c,Om:()=>i});var n=r(69397),s=r(27647),o=r(92722);class i{constructor(e=null,t={},r,n,s=0){this.geometry=e,this.attributes=t,this.centroid=r,this.objectId=n,this.displayId=s}static fromJSON(e){const t=e.geometry?o.A.fromJSON(e.geometry):null,r=e.centroid?o.A.fromJSON(e.centroid):null,n=e.objectId;return new i(t,e.attributes,r,n)}weakClone(){const e=new i(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e}clone(){const e=this.geometry?.clone(),t=new i(e,{...this.attributes},this.centroid?.clone(),this.objectId);return t.displayId=this.displayId,t}ensureCentroid(e){return this.centroid??=(0,s.Q)(this.geometry),this.centroid}get usedMemory(){return 128+(0,n.lM)(this.attributes)+(this.geometry?.usedMemory??0)}}function c(e){return!!e.geometry?.coords?.length}},58501:(e,t,r)=>{r.d(t,{q:()=>s});var n=r(62815);function s(e,t,r){if(!r?.features||!r.hasZ)return;const s=(0,n.N)(r.geometryType,t,e.outSpatialReference);if(s)for(const e of r.features)s(e.geometry)}},58512:(e,t,r)=>{r.d(t,{A:()=>n});class n{constructor(){this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new n;return e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}},69052:(e,t,r)=>{r.d(t,{hr:()=>s,ie:()=>a,uC:()=>c});var n=r(34727);class s{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,n.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+i(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,n=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(n)?r:n}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,n,s=0,o=!1){return(n-=s)<t?n+=i(e,t-n):n>r&&(n-=i(e,n-r)),o&&n===r&&(n=t),n+s}function i(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const c=new s(0,2*Math.PI),a=(new s(-Math.PI,Math.PI),new s(0,360))},69397:(e,t,r)=>{r.d(t,{$B:()=>s,Qf:()=>u,Qh:()=>c,RS:()=>o,ez:()=>f,lM:()=>i,qK:()=>h});var n=r(34275);function s(e){return 32+e.length}const o=16;function i(e){if(!e)return 0;let t=h;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r],!1));return t}function c(e){if(!e)return 0;if("number"==typeof e[0])return u(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=f;for(let n=0;n<t;n++)r+=a(e[n]);return r}(e);let t=h;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?c(e):h;case"string":return s(e);case"number":return o;case"boolean":return 4;default:return 8}}function u(...e){return e.reduce((e,t)=>e+(t?(0,n.iu)(t)?t.byteLength+d:Array.isArray(t)?l(t,o):0:0),0)}function l(e,t){return f+e.length*t}const h=32,f=16,d=145},80754:(e,t,r)=>{r.d(t,{j7:()=>i,kS:()=>a,kd:()=>c,r8:()=>u});var n=r(82799),s=r(16930),o=r(65864);const i={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator}),minus180Line:new n.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.A({paths:[[[180,-180],[180,180]]],spatialReference:s.A.WGS84}),minus180Line:new n.A({paths:[[[-180,-180],[-180,180]]],spatialReference:s.A.WGS84})}};function c(e,t){return Math.ceil((e-t)/(2*t))}function a(e,t){const r=u(e);for(const e of r)for(const r of e)r[0]+=t;return e}function u(e){return(0,o.Bi)(e)?e.rings:e.paths}},92300:(e,t,r)=>{r.d(t,{V:()=>o,X:()=>s});var n=r(65864);function s(e){return{geometryType:(0,n.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function o(e,t,r){const s=(0,n.xD)(t);return e.map(e=>{const t=s.fromJSON(e);return t.spatialReference=r,t})}},92722:(e,t,r)=>{r.d(t,{A:()=>s});var n=r(69397);class s{constructor(e=[],t=[],r=!1,n=!1){this.lengths=e??[],this.coords=t??[],this.hasZ=r,this.hasM=n}static fromJSON({lengths:e,coords:t,hasZ:r,hasM:n}){return new s(e,t,r||!1,n||!1)}static fromRect([e,t,r,n]){const o=r-e,i=n-t;return new s([5],[e,t,o,0,0,i,-o,0,0,-i])}get isPoint(){return 0===this.lengths.length&&this.coords.length>=2}get maxLength(){return Math.max(...this.lengths)}get size(){return this.isPoint?1:this.lengths.reduce((e,t)=>e+t,0)}get usedMemory(){return 64+(0,n.Qf)(this.lengths,this.coords)}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}area(){if(this.isPoint)return 0;let e=0,t=0;for(const r of this.lengths){if(r<3)continue;const{stride:n}=this;let s=this.coords[n*t],o=this.coords[n*t+1];for(let i=1;i<r;i+=1){const r=n*(t+i),c=this.coords[r],a=this.coords[r+1];e+=-.5*(c-s)*(a+o),s=c,o=a}t+=r}return e}forEachVertex(e){let t=0;if(this.isPoint)return e(this.coords[0],this.coords[1]);const{stride:r}=this;for(const n of this.lengths){for(let s=0;s<n;s++){const n=r*(t+s);e(this.coords[n],this.coords[n+1])}t+=n}}deltaDecode(){const e=this.clone(),{coords:t,lengths:r}=e;let n=0;const{stride:s}=this;for(const e of r){for(let r=1;r<e;r++){const e=s*(n+r);t[e]+=t[e-s],t[e+1]+=t[e+1-s]}n+=e}return e}clone(e){if(this.isPoint)return new s([],Array.from(this.coords.slice(0,this.stride)),this.hasZ,this.hasM);const{stride:t,size:r}=this,n=r*t,o=this.coords.slice(0,n);return e?(e.set(o),new s(this.lengths,e)):new s(Array.from(this.lengths),Array.from(o),this.hasZ,this.hasM)}justXY(){const{stride:e,size:t}=this;if(2===e)return this;const r=new Array(t*e);for(let t=0,n=0;t<r.length;t+=e)r[n++]=this.coords[t],r[n++]=this.coords[t+1];return new s(this.lengths,r,!1,!1)}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9801],{17136:(e,t,r)=>{r.d(t,{Y_:()=>v,O7:()=>N,el:()=>I});var n=r(92602),s=r(69052),o=r(49186),i=r(53966),c=r(39829),a=r(82799),u=r(16930),l=r(80754),h=r(21325),f=r(28735),d=r(11254),g=r(65864),y=r(2272),m=r(84952),p=r(92300);const w=()=>i.A.getLogger("esri.geometry.support.normalizeUtils");function _(e){return"polygon"===e[0].type}function b(e){return"polyline"===e[0].type}function S(e,t,r){if(t){const t=function(e,t){if(!(e instanceof a.A||e instanceof c.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw w().error(e),new o.A("internal:geometry",e)}const r=(0,l.r8)(e),n=[];for(const e of r){const r=[];n.push(r),r.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const s=e[n][0],o=e[n][1],i=e[n+1][0],c=e[n+1][1],a=Math.sqrt((i-s)*(i-s)+(c-o)*(c-o)),u=(c-o)/a,l=(i-s)/a,h=a/t;if(h>1){for(let e=1;e<=h-1;e++){const n=e*t,i=l*n+s,c=u*n+o;r.push([i,c])}const e=(a+Math.floor(h-1)*t)/2,n=l*e+s,i=u*e+o;r.push([n,i])}r.push([i,c])}}return function(e){return"polygon"===e.type}(e)?new c.A({rings:n,spatialReference:e.spatialReference}):new a.A({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,f.ci)(t,!0)}return r&&(e=(0,l.kS)(e,r)),e}function A(e,t,r){if(Array.isArray(e)){const n=e[0];if(n>t){const r=(0,l.kd)(n,t);e[0]=n+r*(-2*t)}else if(n<r){const t=(0,l.kd)(n,r);e[0]=n+t*(-2*r)}}else{const n=e.x;if(n>t){const r=(0,l.kd)(n,t);e=e.clone().offset(r*(-2*t),0)}else if(n<r){const t=(0,l.kd)(n,r);e=e.clone().offset(t*(-2*r),0)}}return e}function k(e,t){let r=-1;for(let n=0;n<t.cutIndexes.length;n++){const s=t.cutIndexes[n],o=t.geometries[n],i=(0,l.r8)(o);for(let e=0;e<i.length;e++){const t=i[e];t.some(r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const n=t[e][0];r=n>r?n:r}r=Number(r.toFixed(9));const n=-360*(0,l.kd)(r,180);for(let r=0;r<t.length;r++){const t=o.getPoint(e,r);o.setPoint(e,r,t.clone().offset(n,0))}return!0}})}if(s===r){if(_(e))for(const t of(0,l.r8)(o))e[s]=e[s].addRing(t);else if(b(e))for(const t of(0,l.r8)(o))e[s]=e[s].addPath(t)}else r=s,e[s]=o}return e}async function I(e,t,r){if(!Array.isArray(e))return I([e],t);t&&"string"!=typeof t&&w().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const s="string"==typeof t?t:t?.url??n.A.geometryServiceUrl;let o,i,u,_,b,N,M,v,F=0;const x=[],R=[];for(const t of e)if(null!=t)if(o||(o=t.spatialReference,i=(0,h.Vp)(o),u=o.isWebMercator,N=u?102100:4326,_=l.j7[N].maxX,b=l.j7[N].minX,M=l.j7[N].plus180Line,v=l.j7[N].minus180Line),i)if("mesh"===t.type)R.push(t);else if("point"===t.type)R.push(A(t.clone(),_,b));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>A(e,_,b)),R.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,i);R.push(e.rings?new c.A(e):e)}else if(t.extent){const e=t.extent,r=(0,l.kd)(e.xmin,b)*(2*_);let n=0===r?t.clone():(0,l.kS)(t.clone(),r);e.offset(r,0);let{xmin:s,xmax:o}=e;s=Number(s.toFixed(9)),o=Number(o.toFixed(9)),e.intersects(M)&&o!==_?(F=o>F?o:F,n=S(n,u),x.push(n),R.push("cut")):e.intersects(v)&&s!==b?(F=o*(2*_)>F?o*(2*_):F,n=S(n,u,360),x.push(n),R.push("cut")):R.push(n)}else R.push(t.clone());else R.push(t);else R.push(t);let T=(0,l.kd)(F,_),C=-90;const P=T,q=new a.A;for(;T>0;){const e=360*T-180;q.addPath([[e,C],[e,-1*C]]),C*=-1,T--}if(x.length>0&&P>0){const t=k(x,await async function(e,t,r,n){const s=(0,y.Dl)(e),o=t[0].spatialReference,i={...n,responseType:"json",query:{...s.query,f:"json",sr:(0,h.YX)(o),target:JSON.stringify({geometryType:(0,g.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},c=await(0,d.A)(s.path+"/cut",i),{cutIndexes:a,geometries:u=[]}=c.data;return{cutIndexes:a,geometries:u.map(e=>{const t=(0,g.rS)(e);return t.spatialReference=o,t})}}(s,x,q,r)),n=[],o=[];for(let r=0;r<R.length;r++){const s=R[r];if("cut"!==s)o.push(s);else{const s=t.shift(),i=e[r];null!=i&&"polygon"===i.type&&i.rings&&i.rings.length>1&&s.rings.length>=i.rings.length?(n.push(s),o.push("simplify")):o.push(u?(0,f.Gh)(s):s)}}if(!n.length)return o;const i=await async function(e,t,r){const n="string"==typeof e?(0,m.An)(e):e,s=t[0].spatialReference,o=(0,g.$B)(t[0]),i={...r,query:{...n.query,f:"json",sr:(0,h.YX)(s),geometries:JSON.stringify((0,p.X)(t))}},{data:c}=await(0,d.A)(n.path+"/simplify",i);return(0,p.V)(c.geometries,o,s)}(s,n,r),c=[];for(let e=0;e<o.length;e++){const t=o[e];"simplify"!==t?c.push(t):c.push(u?(0,f.Gh)(i.shift()):i.shift())}return c}const L=[];for(let e=0;e<R.length;e++){const t=R[e];if("cut"!==t)L.push(t);else{const e=x.shift();L.push(!0===u?(0,f.Gh)(e):e)}}return L}function N(e,t,r){const n=(0,h.Vp)(r);if(null==n)return e;const[s,o]=n.valid,i=2*o;let c=0,a=0;t>o?c=Math.ceil(Math.abs(t-o)/i):t<s&&(c=-Math.ceil(Math.abs(t-s)/i)),e>o?a=Math.ceil(Math.abs(e-o)/i):e<s&&(a=-Math.ceil(Math.abs(e-s)/i));let u=e+(c-a)*i;const l=u-t;return l>o?u-=i:l<s&&(u+=i),u}function M(e){const t=(0,h.Vp)(e);if(null==t)return null;const[r,n]=t.valid;return new s.hr(r,n)}const v=M(u.A.WGS84);M(u.A.WebMercator)},27647:(e,t,r)=>{r.d(t,{Q:()=>o});var n=r(92722);function s(e,t){return e?t?4:3:t?3:2}function o(e){if(null==e)return null;if(!e?.lengths.length)return null;const{lengths:t,coords:r,stride:s,hasZ:o,hasM:a}=e,u=new n.A([],[],o,!1),l=u.coords,h=[],f=o?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];let d=0;for(const e of t){const t=i(f,r,d,e,o,a);t&&h.push(t),d+=e*s}if(h.sort((e,t)=>{let r=e[2]-t[2];return 0===r&&o&&(r=e[4]-t[4]),r}),h.length){let e=6*h[0][2];l[0]=h[0][0]/e,l[1]=h[0][1]/e,o&&(e=6*h[0][4],l[2]=0!==e?h[0][3]/e:0),(l[0]<f[0]||l[0]>f[1]||l[1]<f[2]||l[1]>f[3]||o&&(l[2]<f[4]||l[2]>f[5]))&&(l.length=0)}if(!l.length){const n=e.lengths[0]?c(r,0,t[0],o,a):null;if(!n)return null;l[0]=n[0],l[1]=n[1],o&&(l[2]=n[2]??0)}return u}function i(e,t,r,n,o,i){const c=s(o,i);let a=r,u=r+c,l=0,h=0,f=0,d=0,g=0;for(let r=0,s=n-1;r<s;r++,a+=c,u+=c){const r=t[a],n=t[a+1],s=t[a+2],i=t[u],c=t[u+1],y=t[u+2];let m=r*c-i*n;d+=m,l+=(r+i)*m,h+=(n+c)*m,o&&(m=r*y-i*s,f+=(s+y)*m,g+=m),r<e[0]&&(e[0]=r),r>e[1]&&(e[1]=r),n<e[2]&&(e[2]=n),n>e[3]&&(e[3]=n),o&&(s<e[4]&&(e[4]=s),s>e[5]&&(e[5]=s))}if(d>0&&(d*=-1),g>0&&(g*=-1),!d)return null;const y=[l,h,.5*d];return o&&(y[3]=f,y[4]=.5*g),y}function c(e,t,r,n,o){const i=s(n,o);let c=t,f=t+i,d=0,g=0,y=0,m=0;for(let t=0,s=r-1;t<s;t++,c+=i,f+=i){const t=e[c],r=e[c+1],s=e[c+2],o=e[f],i=e[f+1],p=e[f+2],w=n?u(t,r,s,o,i,p):a(t,r,o,i);if(w)if(d+=w,n){const e=h(t,r,s,o,i,p);g+=w*e[0],y+=w*e[1],m+=w*e[2]}else{const e=l(t,r,o,i);g+=w*e[0],y+=w*e[1]}}return d>0?n?[g/d,y/d,m/d]:[g/d,y/d]:r>0?n?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function a(e,t,r,n){const s=r-e,o=n-t;return Math.sqrt(s*s+o*o)}function u(e,t,r,n,s,o){const i=n-e,c=s-t,a=o-r;return Math.sqrt(i*i+c*c+a*a)}function l(e,t,r,n){return[e+.5*(r-e),t+.5*(n-t)]}function h(e,t,r,n,s,o){return[e+.5*(n-e),t+.5*(s-t),r+.5*(o-r)]}},30624:(e,t,r)=>{r.r(t),r.d(t,{createConnection:()=>k});var n=r(31635),s=r(11254),o=r(49186),i=r(53966),c=r(74887),a=r(84952),u=r(91429),l=r(16930),h=r(65864),f=r(62815),d=r(65529);let g=class extends d.nJ{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new o.A("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};(0,n.Cg)([(0,u.MZ)({readOnly:!0})],g.prototype,"connectionError",null),g=(0,n.Cg)([(0,u.$K)("esri.layers.support.StreamConnection")],g);let y=class extends g{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:n}=e;this._config=e,this._featureZScaler=(0,f.N)(t,n,r),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case 0:case 1:return"connected";case 2:case 3:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const t=(0,a.a6)(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(n){const s=t/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(i.A.getLogger(this).error(new o.A("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(i.A.getLogger(this).error(new o.A("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,n)),await(0,c.Pl)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(e){return void i.A.getLogger(this).error(new o.A("websocket-connection","Failed to parse message, invalid JSON",{error:e}))}}}_createWebSocket(e){return new Promise((t,r)=>{const n=new WebSocket(e);n.onopen=()=>{if(n.onopen=null,this.destroyed)return n.onclose=null,void n.close();n.onclose=e=>this._onClose(e),n.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(n),t(n)},n.onclose=e=>{n.onopen=n.onclose=null,r(e)}})}async _handshake(e=1e4){const t=this._websocket;if(null==t)return;const r=(0,c.Tw)(),n=t.onmessage,{filter:s,outFields:a,spatialReference:u}=this._config;return r.timeout(e),t.onmessage=e=>{let c=null;try{c=JSON.parse(e.data)}catch(e){}c&&"object"==typeof c||(i.A.getLogger(this).error(new o.A("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),r.reject(),this.destroy()),c.spatialReference?.wkid!==u?.wkid&&(i.A.getLogger(this).error(new o.A("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${u.wkid}`,e.data)),r.reject(),this.destroy()),"json"!==c.format&&(i.A.getLogger(this).error(new o.A("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),r.reject(),this.destroy()),s&&c.filter!==s&&i.A.getLogger(this).error(new o.A("websocket-connection","Tried to set filter, but server doesn't support it")),a&&c.outFields!==a&&i.A.getLogger(this).error(new o.A("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=n;for(const e of this._outstandingMessages)t.send(JSON.stringify(e));this._outstandingMessages=[],r.resolve()},t.send(JSON.stringify({filter:s,outFields:a,format:"json",spatialReference:{wkid:u.wkid}})),r.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),i.A.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&i.A.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,n.Cg)([(0,u.MZ)()],y.prototype,"connectionStatus",null),(0,n.Cg)([(0,u.MZ)()],y.prototype,"errorString",void 0),y=(0,n.Cg)([(0,u.$K)("esri.layers.graphics.sources.connections.WebSocketConnection")],y);var m=r(80893),p=r(61956);const w={maxQueryDepth:5,maxRecordCountFactor:3};let _=class extends y{constructor(e){super({...w,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||i.A.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:n}=this._config;this.destroyed||this._setFilter(r,n)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(t.geometry)}catch(e){return void i.A.getLogger(this).error(new o.A("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=(0,s.A)(e.path,{query:t,responseType:"json"}),n=(await r).data;return this._serviceDefinition=n,n}_fetchWebSocketUrl(e,t){const r=e[0],{urls:n,token:s}=r,o=this._inferWebSocketBaseUrl(n);return(0,a.a6)(`${o}/subscribe`,{outSR:""+t.wkid,token:s})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return i.A.getLogger(this).error(new o.A("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(null==r||null==e&&null==t)return;const n=JSON.stringify({filter:this._serializeFilter(e,t)});let s=!1;const a=(0,c.Tw)();return r.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(i.A.getLogger(this).error(new o.A("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),a.reject(t.error)),this._setWebSocketJSONParseHandler(r),s=!0,a.resolve())},r.send(n),setTimeout(()=>{s||(this.destroyed||this._websocket!==r||i.A.getLogger(this).error(new o.A("geoevent-connection","Server timed out when setting filter")),a.reject())},1e4),a.promise}_serializeFilter(e,t){const r={};if(null==e&&null==t)return r;if(e?.geometry)try{const t=(0,h.rS)(e.geometry);if("extent"!==t.type)throw new o.A("geoevent-connection",`Expected extent but found type ${t.type}`);r.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){i.A.getLogger(this).error(new o.A("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(r.where=e.where),null!=t&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],n=this._relatedFeatures.get(r);if(!n)return i.A.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:s,geometry:c}=n;for(const t in s)e.attributes[t]=s[t];return c&&(e.geometry=c),e.geometry||e.centroid||i.A.getLogger(this).error(new o.A("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),n=this._queryArchive(t);await r;const s=await n;if(!s)return;for(const e of s.features)this.onFeature(this._enrich(e))}catch(e){i.A.getLogger(this).error(new o.A("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([r.e(7330),r.e(3508),r.e(6554),r.e(2869),r.e(3910),r.e(4903),r.e(1214),r.e(9953),r.e(8399),r.e(1017),r.e(957),r.e(9708),r.e(8654),r.e(6647),r.e(812),r.e(655),r.e(2561)]).then(r.bind(r,68654))).default)({url:e}),{capabilities:n}=await t.load(),s=n.query.supportsMaxRecordCountFactor,o=n.query.supportsPagination,i=n.query.supportsCentroid,c=this._config.maxRecordCountFactor,a=t.capabilities.query.maxRecordCount,u=s?a*c:a,h=new p.A;if(h.outFields=this._config.outFields??["*"],h.where=this._config.filter?.where??"1=1",h.returnGeometry=!0,h.returnExceededLimitFeatures=!0,h.outSpatialReference=l.A.fromJSON(this._config.spatialReference),i&&(h.returnCentroid=!0),s&&(h.maxRecordCountFactor=c),o)return h.num=u,t.destroy(),this._queryPages(e,h);const f=await(0,m.eW)(e,h,this._config.sourceSpatialReference);return t.destroy(),f}async _queryPages(e,t,r=[],n=0){t.start=null!=t.num?n*t.num:null;const s=await(0,m.eW)(e,t,this._config.sourceSpatialReference);return s.exceededTransferLimit&&n<(this._config.maxQueryDepth??0)?(s.features.forEach(e=>r.push(e)),this._queryPages(e,t,r,n+1)):(r.forEach(e=>s.features.push(e)),s)}_addRelatedFeatures(e){const t=new Map,r=e.features,n=this._serviceDefinition.relatedFeatures.joinField;for(const e of r){const r=e.attributes[n];t.set(r,e)}this._relatedFeatures=t}};_=(0,n.Cg)([(0,u.$K)("esri.layers.graphics.sources.connections.GeoEventConnection")],_);var b=r(64108);let S=class extends g{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:n}=e;this._featureZScaler=(0,f.N)(t,n,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};function A(e,t){if(null==e&&null==t)return null;const r={};return null!=t&&(r.geometry=t),null!=e&&(r.where=e),r}function k(e,t,r,n,s,o,i,c,a){const u={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:n,filter:A(s,o),maxReconnectionAttempts:i,maxReconnectionInterval:c,customParameters:a};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new y(u):new _(u):new S(u)}(0,n.Cg)([(0,u.MZ)()],S.prototype,"connectionStatus",void 0),(0,n.Cg)([(0,u.MZ)()],S.prototype,"errorString",void 0),S=(0,n.Cg)([(0,b.$)("esri.layers.support.ClientSideConnection")],S)},43334:(e,t,r)=>{r.d(t,{N3:()=>c,Om:()=>i});var n=r(69397),s=r(27647),o=r(92722);class i{constructor(e=null,t={},r,n,s=0){this.geometry=e,this.attributes=t,this.centroid=r,this.objectId=n,this.displayId=s}static fromJSON(e){const t=e.geometry?o.A.fromJSON(e.geometry):null,r=e.centroid?o.A.fromJSON(e.centroid):null,n=e.objectId;return new i(t,e.attributes,r,n)}weakClone(){const e=new i(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e}clone(){const e=this.geometry?.clone(),t=new i(e,{...this.attributes},this.centroid?.clone(),this.objectId);return t.displayId=this.displayId,t}ensureCentroid(e){return this.centroid??=(0,s.Q)(this.geometry),this.centroid}get usedMemory(){return 128+(0,n.lM)(this.attributes)+(this.geometry?.usedMemory??0)}}function c(e){return!!e.geometry?.coords?.length}},58501:(e,t,r)=>{r.d(t,{q:()=>s});var n=r(62815);function s(e,t,r){if(!r?.features||!r.hasZ)return;const s=(0,n.N)(r.geometryType,t,e.outSpatialReference);if(s)for(const e of r.features)s(e.geometry)}},58512:(e,t,r)=>{r.d(t,{A:()=>n});class n{constructor(){this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new n;return e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}},69052:(e,t,r)=>{r.d(t,{hr:()=>s,ie:()=>a,uC:()=>c});var n=r(34727);class s{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,n.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+i(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,n=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(n)?r:n}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,n,s=0,o=!1){return(n-=s)<t?n+=i(e,t-n):n>r&&(n-=i(e,n-r)),o&&n===r&&(n=t),n+s}function i(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const c=new s(0,2*Math.PI),a=(new s(-Math.PI,Math.PI),new s(0,360))},69397:(e,t,r)=>{r.d(t,{$B:()=>s,Qf:()=>u,Qh:()=>c,RS:()=>o,ez:()=>f,lM:()=>i,qK:()=>h});var n=r(34275);function s(e){return 32+e.length}const o=16;function i(e){if(!e)return 0;let t=h;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r],!1));return t}function c(e){if(!e)return 0;if("number"==typeof e[0])return u(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=f;for(let n=0;n<t;n++)r+=a(e[n]);return r}(e);let t=h;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?c(e):h;case"string":return s(e);case"number":return o;case"boolean":return 4;default:return 8}}function u(...e){return e.reduce((e,t)=>e+(t?(0,n.iu)(t)?t.byteLength+d:Array.isArray(t)?l(t,o):0:0),0)}function l(e,t){return f+e.length*t}const h=32,f=16,d=145},80754:(e,t,r)=>{r.d(t,{j7:()=>i,kS:()=>a,kd:()=>c,r8:()=>u});var n=r(82799),s=r(16930),o=r(65864);const i={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator}),minus180Line:new n.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.A({paths:[[[180,-180],[180,180]]],spatialReference:s.A.WGS84}),minus180Line:new n.A({paths:[[[-180,-180],[-180,180]]],spatialReference:s.A.WGS84})}};function c(e,t){return Math.ceil((e-t)/(2*t))}function a(e,t){const r=u(e);for(const e of r)for(const r of e)r[0]+=t;return e}function u(e){return(0,o.Bi)(e)?e.rings:e.paths}},92300:(e,t,r)=>{r.d(t,{V:()=>o,X:()=>s});var n=r(65864);function s(e){return{geometryType:(0,n.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function o(e,t,r){const s=(0,n.xD)(t);return e.map(e=>{const t=s.fromJSON(e);return t.spatialReference=r,t})}},92722:(e,t,r)=>{r.d(t,{A:()=>s});var n=r(69397);class s{constructor(e=[],t=[],r=!1,n=!1){this.lengths=e??[],this.coords=t??[],this.hasZ=r,this.hasM=n}static fromJSON({lengths:e,coords:t,hasZ:r,hasM:n}){return new s(e,t,r||!1,n||!1)}static fromRect([e,t,r,n]){const o=r-e,i=n-t;return new s([5],[e,t,o,0,0,i,-o,0,0,-i])}get isPoint(){return 0===this.lengths.length&&this.coords.length>=2}get maxLength(){return Math.max(...this.lengths)}get size(){return this.isPoint?1:this.lengths.reduce((e,t)=>e+t,0)}get usedMemory(){return 64+(0,n.Qf)(this.lengths,this.coords)}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}area(){if(this.isPoint)return 0;let e=0,t=0;for(const r of this.lengths){if(r<3)continue;const{stride:n}=this;let s=this.coords[n*t],o=this.coords[n*t+1];for(let i=1;i<r;i+=1){const r=n*(t+i),c=this.coords[r],a=this.coords[r+1];e+=-.5*(c-s)*(a+o),s=c,o=a}t+=r}return e}forEachVertex(e){let t=0;if(this.isPoint)return e(this.coords[0],this.coords[1]);const{stride:r}=this;for(const n of this.lengths){for(let s=0;s<n;s++){const n=r*(t+s);e(this.coords[n],this.coords[n+1])}t+=n}}deltaDecode(){const e=this.clone(),{coords:t,lengths:r}=e;let n=0;const{stride:s}=this;for(const e of r){for(let r=1;r<e;r++){const e=s*(n+r);t[e]+=t[e-s],t[e+1]+=t[e+1-s]}n+=e}return e}clone(e){if(this.isPoint)return new s([],Array.from(this.coords.slice(0,this.stride)),this.hasZ,this.hasM);const t=Array.from(this.lengths),{stride:r,size:n}=this,o=this.coords.slice(0,n*r);return e?(e.set(o),new s(t,e)):new s(t,Array.from(o),this.hasZ,this.hasM)}justXY(){const{stride:e,size:t}=this;if(2===e)return this;const r=new Array(t*e);for(let t=0,n=0;t<r.length;t+=e)r[n++]=this.coords[t],r[n++]=this.coords[t+1];return new s(this.lengths,r,!1,!1)}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[708],{27647:(t,e,r)=>{r.d(e,{Q:()=>s});var n=r(92722);function o(t,e){return t?e?4:3:e?3:2}function s(t){if(null==t)return null;if(!t?.lengths.length)return null;const{lengths:e,coords:r,stride:o,hasZ:s,hasM:l}=t,c=new n.A([],[],s,!1),h=c.coords,f=[],a=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];let d=0;for(const t of e){const e=i(a,r,d,t,s,l);e&&f.push(e),d+=t*o}if(f.sort((t,e)=>{let r=t[2]-e[2];return 0===r&&s&&(r=t[4]-e[4]),r}),f.length){let t=6*f[0][2];h[0]=f[0][0]/t,h[1]=f[0][1]/t,s&&(t=6*f[0][4],h[2]=0!==t?f[0][3]/t:0),(h[0]<a[0]||h[0]>a[1]||h[1]<a[2]||h[1]>a[3]||s&&(h[2]<a[4]||h[2]>a[5]))&&(h.length=0)}if(!h.length){const n=t.lengths[0]?u(r,0,e[0],s,l):null;if(!n)return null;h[0]=n[0],h[1]=n[1],s&&(h[2]=n[2]??0)}return c}function i(t,e,r,n,s,i){const u=o(s,i);let l=r,c=r+u,h=0,f=0,a=0,d=0,m=0;for(let r=0,o=n-1;r<o;r++,l+=u,c+=u){const r=e[l],n=e[l+1],o=e[l+2],i=e[c],u=e[c+1],g=e[c+2];let y=r*u-i*n;d+=y,h+=(r+i)*y,f+=(n+u)*y,s&&(y=r*g-i*o,a+=(o+g)*y,m+=y),r<t[0]&&(t[0]=r),r>t[1]&&(t[1]=r),n<t[2]&&(t[2]=n),n>t[3]&&(t[3]=n),s&&(o<t[4]&&(t[4]=o),o>t[5]&&(t[5]=o))}if(d>0&&(d*=-1),m>0&&(m*=-1),!d)return null;const g=[h,f,.5*d];return s&&(g[3]=a,g[4]=.5*m),g}function u(t,e,r,n,s){const i=o(n,s);let u=e,a=e+i,d=0,m=0,g=0,y=0;for(let e=0,o=r-1;e<o;e++,u+=i,a+=i){const e=t[u],r=t[u+1],o=t[u+2],s=t[a],i=t[a+1],p=t[a+2],I=n?c(e,r,o,s,i,p):l(e,r,s,i);if(I)if(d+=I,n){const t=f(e,r,o,s,i,p);m+=I*t[0],g+=I*t[1],y+=I*t[2]}else{const t=h(e,r,s,i);m+=I*t[0],g+=I*t[1]}}return d>0?n?[m/d,g/d,y/d]:[m/d,g/d]:r>0?n?[t[e],t[e+1],t[e+2]]:[t[e],t[e+1]]:null}function l(t,e,r,n){const o=r-t,s=n-e;return Math.sqrt(o*o+s*s)}function c(t,e,r,n,o,s){const i=n-t,u=o-e,l=s-r;return Math.sqrt(i*i+u*u+l*l)}function h(t,e,r,n){return[t+.5*(r-t),e+.5*(n-e)]}function f(t,e,r,n,o,s){return[t+.5*(n-t),e+.5*(o-e),r+.5*(s-r)]}},43334:(t,e,r)=>{r.d(e,{N3:()=>u,Om:()=>i});var n=r(69397),o=r(27647),s=r(92722);class i{constructor(t=null,e={},r,n,o=0){this.geometry=t,this.attributes=e,this.centroid=r,this.objectId=n,this.displayId=o}static fromJSON(t){const e=t.geometry?s.A.fromJSON(t.geometry):null,r=t.centroid?s.A.fromJSON(t.centroid):null,n=t.objectId;return new i(e,t.attributes,r,n)}weakClone(){const t=new i(this.geometry,this.attributes,this.centroid,this.objectId);return t.displayId=this.displayId,t}clone(){const t=this.geometry?.clone(),e=new i(t,{...this.attributes},this.centroid?.clone(),this.objectId);return e.displayId=this.displayId,e}ensureCentroid(t){return this.centroid??=(0,o.Q)(this.geometry),this.centroid}get usedMemory(){return 128+(0,n.lM)(this.attributes)+(this.geometry?.usedMemory??0)}}function u(t){return!!t.geometry?.coords?.length}},58512:(t,e,r)=>{r.d(e,{A:()=>n});class n{constructor(){this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const t=new n;return t.globalIdFieldName=this.globalIdFieldName,t.geohashFieldName=this.geohashFieldName,t.geometryProperties=this.geometryProperties,t.geometryType=this.geometryType,t.spatialReference=this.spatialReference,t.hasZ=this.hasZ,t.hasM=this.hasM,t.features=this.features,t.fields=this.fields,t.transform=this.transform,t.exceededTransferLimit=this.exceededTransferLimit,t.uniqueIdField=this.uniqueIdField,t.queryGeometry=this.queryGeometry,t.queryGeometryType=this.queryGeometryType,t}}},69397:(t,e,r)=>{r.d(e,{$B:()=>o,Qf:()=>c,Qh:()=>u,RS:()=>s,ez:()=>a,lM:()=>i,qK:()=>f});var n=r(34275);function o(t){return 32+t.length}const s=16;function i(t){if(!t)return 0;let e=f;for(const r in t)t.hasOwnProperty(r)&&(e+=l(t[r],!1));return e}function u(t){if(!t)return 0;if("number"==typeof t[0])return c(t);if(Array.isArray(t))return function(t){const e=t.length;if(0===e||"number"==typeof t[0])return h(t,8);let r=a;for(let n=0;n<e;n++)r+=l(t[n]);return r}(t);let e=f;for(const r in t)t.hasOwnProperty(r)&&(e+=l(t[r]));return e}function l(t,e=!0){switch(typeof t){case"object":return e?u(t):f;case"string":return o(t);case"number":return s;case"boolean":return 4;default:return 8}}function c(...t){return t.reduce((t,e)=>t+(e?(0,n.iu)(e)?e.byteLength+d:Array.isArray(e)?h(e,s):0:0),0)}function h(t,e){return a+t.length*e}const f=32,a=16,d=145},90708:(t,e,r)=>{r.d(e,{Ap:()=>F,B2:()=>y,DF:()=>T,Di:()=>q,E2:()=>k,IE:()=>g,Nl:()=>C,PR:()=>G,Rk:()=>J,Ux:()=>x,Ye:()=>E,ZF:()=>S,aQ:()=>$,eY:()=>_,hK:()=>K,jH:()=>L,jQ:()=>U,kz:()=>j,oN:()=>Y,q3:()=>W,qN:()=>P,zv:()=>V});var n=r(49186),o=r(53966),s=r(97768),i=r(70328),u=r(19419),l=r(65864),c=r(43334),h=r(58512),f=r(92722),a=r(54339);const d=()=>o.A.getLogger("esri.layers.graphics.featureConversionUtils"),m={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0};function g({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function y({scale:t,translate:e},r){return Math.round((e[1]-r)/t[1])}function p({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function I({scale:t,translate:e},r){return Math.round((r-e[1])/t[1])}function N({scale:t,translate:e},r,n){return r*t[n]+e[n]}function b(t,e,r){return e&&(t.hasZ=!0),r&&(t.hasM=!0),t}function w(t,e,r,n){if(e&&n&&t!==r)return(e,r,n,o)=>{n[o++]=e[r++],n[o++]=e[r++],t?r++:n[o++]=0,n[o++]=e[r++]??0};const o=2+(r?1:0)+(n?1:0),s=o-((!t&&r?1:0)+(!e&&n?1:0));return(t,e,r,n)=>{for(let i=0;i<o;++i)r[n++]=i<s?t[e++]??0:0}}function T(t,e,r){if(!t)return null;const{coords:n,hasZ:o,hasM:s}=t,[i,u]=n,l=o?n[2]:0,c=s?n[2+(o?1:0)]:0;return{x:i,y:u,z:e?l:void 0,m:r?c:void 0}}function P(t,e=(0,l.Pv)(t),r=(0,l.W0)(t)){const{x:n,y:o,z:s,m:i}=t,u=[n,o];return e&&u.push(s??0),r&&u.push(i??0),new f.A([],u,e,r)}function M(t,e,r){if(null==t)return null;const{coords:n,stride:o,hasZ:s,hasM:i}=t,u=w(s,i,e,r),l=[];for(let t=0;t<n.length;t+=o){const e=[];u(n,t,e,0),l.push(e)}return b({points:l},e,r)}function G(t,e=(0,l.Pv)(t),r=(0,l.W0)(t)){const{points:n,hasZ:o,hasM:s}=t,i=new f.A([n.length],[],e,r),{coords:u,stride:c}=i;let h=0;const a=w(o??!1,s??!1,e,r);for(const t of n)a(t,0,u,h),h+=c;return i}function A(t,e,r){if(!t)return null;const{coords:n,lengths:o,stride:s,hasZ:i,hasM:u}=t;let l=0;const c=w(i,u,e,r),h=[];for(const t of o){const e=[];for(let r=0;r<t;r++){const t=[];c(n,l,t,0),l+=s,e.push(t)}h.push(e)}return b({paths:h},e,r)}function F(t,e=(0,l.Pv)(t),r=(0,l.W0)(t)){const{paths:n,hasZ:o,hasM:s}=t,i=w(o??!1,s??!1,e,r),u=new f.A([],[],e,r),{lengths:c,coords:h,stride:a}=u;let d=0;for(const t of n){for(const e of t)i(e,0,h,d),d+=a;c.push(t.length)}return u}function v(t,e,r){if(!t)return null;const{coords:n,lengths:o,stride:s,hasZ:i,hasM:u}=t;let l=0;const c=w(i,u,e,r),h=[];for(const t of o){const e=[];for(let r=0;r<t;r++){const t=[];c(n,l,t,0),l+=s,e.push(t)}h.push(e)}return b({rings:h},e,r)}function E(t,e=(0,l.Pv)(t),r=(0,l.W0)(t)){const{rings:n,hasZ:o,hasM:s}=t,i=new f.A([],[],e,r),{lengths:u,coords:c,stride:h}=i;let a=0;const d=w(o??!1,s??!1,e,r);for(const t of n){for(const e of t)d(e,0,c,a),a+=h;u.push(t.length)}return i}const Z=[],O=[];function k(t,e,r,n,o){Z[0]=t;const[s]=q(O,Z,e,r,n,o);return H(Z),H(O),s}function q(t,e,r,o,s,i){if(H(t),!r){for(const r of e){const e=(0,a.W)(r,i);t.push(new c.Om(null,r.attributes,null,e))}return t}switch(r){case"esriGeometryPoint":return function(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:i,centroid:u}=s,h=(0,l.Pv)(e),f=(0,l.W0)(e);t.push(new c.Om(e?P(e,r&&h,n&&f):null,i,u?P(u,!1,!1):null,(0,a.W)(s,o)))}return t}(t,e,o,s,i);case"esriGeometryMultipoint":return function(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:i}=s,u=(0,l.Pv)(e),h=(0,l.W0)(e);t.push(new c.Om(e?G(e,r&&u,n&&h):null,i,null,(0,a.W)(s,o)))}return t}(t,e,o,s,i);case"esriGeometryPolyline":return function(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:i,centroid:u}=s,h=(0,l.Pv)(e),f=(0,l.W0)(e);t.push(new c.Om(e?F(e,r&&h,n&&f):null,i,u?P(u,!1,!1):null,(0,a.W)(s,o)))}return t}(t,e,o,s,i);case"esriGeometryPolygon":case"esriGeometryMultiPatch":return function(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:i,centroid:u}=s,h=(0,l.Pv)(e),f=(0,l.W0)(e);t.push(new c.Om(e?E(e,r&&h,n&&f):null,i,u?P(u,!1,!1):null,(0,a.W)(s,o)))}return t}(t,e,o,s,i);default:d().error("convertToFeatureSet:unknown-geometry",new n.A("internal:geometry",`Unable to parse unknown geometry type '${r}'`)),H(t)}return t}function Y(t,e,r,n){O[0]=t,R(Z,O,e,r,n);const o=Z[0];return H(Z),H(O),o}function x(t,e=(0,l.Pv)(t),r=(0,l.W0)(t)){return null==t?null:(0,l.fT)(t)?P(t,e,r):(0,l.Bi)(t)?E(t,e,r):(0,l.Rg)(t)?F(t,e,r):(0,l.U9)(t)?G(t,e,r):void d().error("convertFromGeometry:unknown-geometry",new n.A("internal:geometry",`Unable to parse unknown geometry type '${t}'`))}function V(t,e,r,o){if(null==t)return null;const s="coords"in t?t:t.geometry;if(null==s)return null;switch(e){case"esriGeometryPoint":return T(s,r,o);case"esriGeometryMultipoint":return M(s,r,o);case"esriGeometryPolyline":return A(s,r,o);case"esriGeometryPolygon":return v(s,r,o);default:return d().error("convertToGeometry:unknown-geometry",new n.A("internal:geometry",`Unable to parse unknown geometry type '${e}'`)),null}}function R(t,e,r,o,s){if(H(t),null==r)return function(t,e){for(const r of e)t.push({attributes:r.attributes});return t}(t,e);switch(r){case"esriGeometryPoint":return function(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({attributes:s,geometry:T(o,r,n)});return t}(t,e,o,s);case"esriGeometryMultipoint":return function(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&M(o,r,n),attributes:s});return t}(t,e,o,s);case"esriGeometryPolyline":return function(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&A(o,r,n),attributes:s});return t}(t,e,o,s);case"esriGeometryPolygon":return function(t,e,r,n){for(const{geometry:o,attributes:s,centroid:i}of e){const e=v(o,r,n),u=T(i,!1,!1);t.push(i?{geometry:e,attributes:s,centroid:u}:{geometry:e,attributes:s})}return t}(t,e,o,s);default:d().error("convertToFeatureSet:unknown-geometry",new n.A("internal:geometry",`Unable to parse unknown geometry type '${r}'`))}return t}function S(t){const{spatialReference:e,transform:r,fields:n,hasM:o,hasZ:s,features:i,geometryType:u,exceededTransferLimit:l,queryGeometry:c,queryGeometryType:h}=t,f={features:R([],i,u,s,o),fields:n,geometryType:u,spatialReference:e,queryGeometry:V(c,h,s,o)};return r&&(f.transform=r),l&&(f.exceededTransferLimit=l),o&&(f.hasM=o),s&&(f.hasZ=s),f}function W(t,e){const r=new h.A,{hasM:n,hasZ:o,features:s,spatialReference:i,geometryType:u,exceededTransferLimit:l,transform:c,fields:f}=t;return f&&(r.fields=f),r.geometryType=u??null,r.spatialReference=i??null,s&&q(r.features,s,u,o,n,e),l&&(r.exceededTransferLimit=l),n&&(r.hasM=n),o&&(r.hasZ=o),c&&(r.transform=c),r}function _(t){const{transform:e,features:r}=t;if(!e)return t;for(const t of r)null!=t.geometry&&$(t.geometry,e),null!=t.centroid&&$(t.centroid,e);return t.transform=null,t}function L(t,e){const{geometryType:r,features:n}=e;if(!t)return e;for(let e=0;e<n.length;e++){const o=n[e],s=o.weakClone();s.geometry=C(o.geometry,r,t),s.centroid=C(o.centroid,"esriGeometryPoint",t),n[e]=s}return e.transform=t,e}function C(t,e,r,n,o){if(null==t)return null;if(!t?.coords.length)return null;const s=m[e],{coords:i,lengths:u,stride:l,hasZ:c,hasM:h}=t;n??=c,o??=h;const a=new f.A([],[],n,o),d=a.stride,p=w(c,h,n,o);let I=0;const N=[0,0,0,0].slice(d);function b(){p(i,I,N,0),I+=l,N[0]=g(r,N[0]),N[1]=y(r,N[1])}if(t.isPoint)return b(),a.coords.push(...N),a;let T=0;for(const t of u){if(t<s)continue;let e=1;b(),a.coords.push(...N);let[r,n]=N;for(let o=1;o<t;o++){b();const[t,o]=N;r===t&&n===o||(N[0]-=r,N[1]-=n,a.coords.push(...N),r=t,n=o,e++)}e>=s?(a.lengths.push(e),T=a.coords.length):H(a.coords,T)}return H(a.coords,T),a.coords.length?a:null}function j(t,e,r,n=t.hasZ,o=t.hasM){if(!t.coords.length)return null;const s=m[e],{coords:i,lengths:u,stride:l,hasZ:c,hasM:h}=t,a=new f.A([],[],n,o),d=a.stride,g=w(c,h,n,o);if(t.isPoint)return g(i,0,a.coords,0),a;let y=0;const p=r*r;for(const t of u){if(t<s){y+=t*l;continue}const e=a.coords.length/d,r=y,n=y+(t-1)*l;g(i,r,a.coords,a.coords.length),Q(a.coords,i,l,p,g,r,n),g(i,n,a.coords,a.coords.length);const o=a.coords.length/d-e;o>=s?a.lengths.push(o):H(a.coords,e*d),y+=t*l}return a.coords.length?a:null}function z(t,e,r,n){const o=t[e],s=t[e+1],i=t[r],u=t[r+1],l=t[n],c=t[n+1];let h=i,f=u,a=l-h,d=c-f;if(0!==a||0!==d){const t=((o-h)*a+(s-f)*d)/(a*a+d*d);t>1?(h=l,f=c):t>0&&(h+=a*t,f+=d*t)}return a=o-h,d=s-f,a*a+d*d}function Q(t,e,r,n,o,s,i){let u,l=n,c=0;for(let t=s+r;t<i;t+=r)u=z(e,t,s,i),u>l&&(c=t,l=u);l>n&&(c-s>r&&Q(t,e,r,n,o,s,c),o(e,c,t,t.length),i-c>r&&Q(t,e,r,n,o,c,i))}function U(t,e){if(!e?.coords?.length)return null;let r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if(e&&e.coords){const{coords:t,stride:i}=e;for(let e=0;e<t.length;e+=i){const i=t[e],u=t[e+1];r=Math.min(r,i),o=Math.max(o,i),n=Math.min(n,u),s=Math.max(s,u)}}return(0,i.is)(t)?(0,i.BI)(t,r,n,o,s):(0,u.fA)(r,n,o,s,t),t}function $(t,e){const{coords:r,lengths:n,stride:o}=t;if(!r.length)return void(n.length=0);(0,s.Lw)(e);const{originPosition:i,scale:u,translate:l}=e,c=X;c.originPosition=i;const h=c.scale;h[0]=u[0]??1,h[1]=-(u[1]??1),h[2]=u[2]??1,h[3]=u[3]??1;const f=c.translate;if(f[0]=l[0]??0,f[1]=l[1]??0,f[2]=l[2]??0,f[3]=l[3]??0,!n.length){for(let t=0;t<o;++t)r[t]=N(c,r[t],t);return void(n.length=0)}let a=0;for(let t=0;t<n.length;t++){const e=n[t];n[t]=e;for(let t=0;t<o;++t)r[a+t]=N(c,r[a+t],t);let s=r[a],i=r[a+1];a+=o;for(let t=1;t<e;t++,a+=o){s+=r[a]*h[0],i+=r[a+1]*h[1],r[a]=s,r[a+1]=i;for(let t=2;t<o;++t)r[a+t]=N(c,r[a+t],t)}}}function B(t,e,r,n){let o=0,s=t[n*e],i=t[n*(e+1)];for(let u=1;u<r;u++){const r=s+t[n*(e+u)],l=i+t[n*(e+u)+1],c=(r-s)*(l+i);s=r,i=l,o+=c}return.5*o}function J(t,e){const{coords:r,lengths:n}=t;let o=0,s=0;for(let t=0;t<n.length;t++){const i=n[t];s+=B(r,o,i,e),o+=i}return Math.abs(s)}function D(t,e,r,n){return 0===t*n-r*e&&t*r+e*n>0}function K(t,e,r){const{stride:n}=t;if(t.isPoint){if(t.coords.length<2)return null;const[r,n]=t.coords,o=p(e,r),s=I(e,n);return new f.A([],[o,s])}const o=new f.A([],[0,0]),s=m[r],i="esriGeometryPolygon"===r||"esriGeometryPolyline"===r;let u=0,l=0;for(let r=0;r<t.lengths.length;r++){const c=t.lengths[r],h=l;let f=p(e,t.coords[n*u]),a=I(e,t.coords[n*u+1]);o.coords[l++]=f,o.coords[l++]=a;let d=0,m=0,g=1;for(let r=1;r<c;r++){const s=p(e,t.coords[n*(r+u)]),c=I(e,t.coords[n*(r+u)+1]);if(s!==f||c!==a){const t=s-f,e=c-a;i&&D(d,m,t,e)?(o.coords[l-2]+=t,o.coords[l-1]+=e,f+=t,a+=e):(o.coords[l++]=s,o.coords[l++]=c,f=s,a=c,d=t,m=e,g+=1)}}g<s?l=h:o.lengths.push(g),u+=c}return 0===o.lengths.length?null:o}function H(t,e=0){t.length!==e&&(t.length=e)}const X={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]}},92722:(t,e,r)=>{r.d(e,{A:()=>o});var n=r(69397);class o{constructor(t=[],e=[],r=!1,n=!1){this.lengths=t??[],this.coords=e??[],this.hasZ=r,this.hasM=n}static fromJSON({lengths:t,coords:e,hasZ:r,hasM:n}){return new o(t,e,r||!1,n||!1)}static fromRect([t,e,r,n]){const s=r-t,i=n-e;return new o([5],[t,e,s,0,0,i,-s,0,0,-i])}get isPoint(){return 0===this.lengths.length&&this.coords.length>=2}get maxLength(){return Math.max(...this.lengths)}get size(){return this.isPoint?1:this.lengths.reduce((t,e)=>t+e,0)}get usedMemory(){return 64+(0,n.Qf)(this.lengths,this.coords)}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}area(){if(this.isPoint)return 0;let t=0,e=0;for(const r of this.lengths){if(r<3)continue;const{stride:n}=this;let o=this.coords[n*e],s=this.coords[n*e+1];for(let i=1;i<r;i+=1){const r=n*(e+i),u=this.coords[r],l=this.coords[r+1];t+=-.5*(u-o)*(l+s),o=u,s=l}e+=r}return t}forEachVertex(t){let e=0;if(this.isPoint)return t(this.coords[0],this.coords[1]);const{stride:r}=this;for(const n of this.lengths){for(let o=0;o<n;o++){const n=r*(e+o);t(this.coords[n],this.coords[n+1])}e+=n}}deltaDecode(){const t=this.clone(),{coords:e,lengths:r}=t;let n=0;const{stride:o}=this;for(const t of r){for(let r=1;r<t;r++){const t=o*(n+r);e[t]+=e[t-o],e[t+1]+=e[t+1-o]}n+=t}return t}clone(t){if(this.isPoint)return new o([],Array.from(this.coords.slice(0,this.stride)),this.hasZ,this.hasM);const{stride:e,size:r}=this,n=r*e,s=this.coords.slice(0,n);return t?(t.set(s),new o(this.lengths,t)):new o(Array.from(this.lengths),Array.from(s),this.hasZ,this.hasM)}justXY(){const{stride:t,size:e}=this;if(2===t)return this;const r=new Array(e*t);for(let e=0,n=0;e<r.length;e+=t)r[n++]=this.coords[e],r[n++]=this.coords[e+1];return new o(this.lengths,r,!1,!1)}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[708],{27647:(t,e,r)=>{r.d(e,{Q:()=>s});var n=r(92722);function o(t,e){return t?e?4:3:e?3:2}function s(t){if(null==t)return null;if(!t?.lengths.length)return null;const{lengths:e,coords:r,stride:o,hasZ:s,hasM:c}=t,l=new n.A([],[],s,!1),h=l.coords,f=[],a=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];let d=0;for(const t of e){const e=i(a,r,d,t,s,c);e&&f.push(e),d+=t*o}if(f.sort((t,e)=>{let r=t[2]-e[2];return 0===r&&s&&(r=t[4]-e[4]),r}),f.length){let t=6*f[0][2];h[0]=f[0][0]/t,h[1]=f[0][1]/t,s&&(t=6*f[0][4],h[2]=0!==t?f[0][3]/t:0),(h[0]<a[0]||h[0]>a[1]||h[1]<a[2]||h[1]>a[3]||s&&(h[2]<a[4]||h[2]>a[5]))&&(h.length=0)}if(!h.length){const n=t.lengths[0]?u(r,0,e[0],s,c):null;if(!n)return null;h[0]=n[0],h[1]=n[1],s&&(h[2]=n[2]??0)}return l}function i(t,e,r,n,s,i){const u=o(s,i);let c=r,l=r+u,h=0,f=0,a=0,d=0,m=0;for(let r=0,o=n-1;r<o;r++,c+=u,l+=u){const r=e[c],n=e[c+1],o=e[c+2],i=e[l],u=e[l+1],g=e[l+2];let y=r*u-i*n;d+=y,h+=(r+i)*y,f+=(n+u)*y,s&&(y=r*g-i*o,a+=(o+g)*y,m+=y),r<t[0]&&(t[0]=r),r>t[1]&&(t[1]=r),n<t[2]&&(t[2]=n),n>t[3]&&(t[3]=n),s&&(o<t[4]&&(t[4]=o),o>t[5]&&(t[5]=o))}if(d>0&&(d*=-1),m>0&&(m*=-1),!d)return null;const g=[h,f,.5*d];return s&&(g[3]=a,g[4]=.5*m),g}function u(t,e,r,n,s){const i=o(n,s);let u=e,a=e+i,d=0,m=0,g=0,y=0;for(let e=0,o=r-1;e<o;e++,u+=i,a+=i){const e=t[u],r=t[u+1],o=t[u+2],s=t[a],i=t[a+1],p=t[a+2],I=n?l(e,r,o,s,i,p):c(e,r,s,i);if(I)if(d+=I,n){const t=f(e,r,o,s,i,p);m+=I*t[0],g+=I*t[1],y+=I*t[2]}else{const t=h(e,r,s,i);m+=I*t[0],g+=I*t[1]}}return d>0?n?[m/d,g/d,y/d]:[m/d,g/d]:r>0?n?[t[e],t[e+1],t[e+2]]:[t[e],t[e+1]]:null}function c(t,e,r,n){const o=r-t,s=n-e;return Math.sqrt(o*o+s*s)}function l(t,e,r,n,o,s){const i=n-t,u=o-e,c=s-r;return Math.sqrt(i*i+u*u+c*c)}function h(t,e,r,n){return[t+.5*(r-t),e+.5*(n-e)]}function f(t,e,r,n,o,s){return[t+.5*(n-t),e+.5*(o-e),r+.5*(s-r)]}},43334:(t,e,r)=>{r.d(e,{N3:()=>u,Om:()=>i});var n=r(69397),o=r(27647),s=r(92722);class i{constructor(t=null,e={},r,n,o=0){this.geometry=t,this.attributes=e,this.centroid=r,this.objectId=n,this.displayId=o}static fromJSON(t){const e=t.geometry?s.A.fromJSON(t.geometry):null,r=t.centroid?s.A.fromJSON(t.centroid):null,n=t.objectId;return new i(e,t.attributes,r,n)}weakClone(){const t=new i(this.geometry,this.attributes,this.centroid,this.objectId);return t.displayId=this.displayId,t}clone(){const t=this.geometry?.clone(),e=new i(t,{...this.attributes},this.centroid?.clone(),this.objectId);return e.displayId=this.displayId,e}ensureCentroid(t){return this.centroid??=(0,o.Q)(this.geometry),this.centroid}get usedMemory(){return 128+(0,n.lM)(this.attributes)+(this.geometry?.usedMemory??0)}}function u(t){return!!t.geometry?.coords?.length}},58512:(t,e,r)=>{r.d(e,{A:()=>n});class n{constructor(){this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const t=new n;return t.globalIdFieldName=this.globalIdFieldName,t.geohashFieldName=this.geohashFieldName,t.geometryProperties=this.geometryProperties,t.geometryType=this.geometryType,t.spatialReference=this.spatialReference,t.hasZ=this.hasZ,t.hasM=this.hasM,t.features=this.features,t.fields=this.fields,t.transform=this.transform,t.exceededTransferLimit=this.exceededTransferLimit,t.uniqueIdField=this.uniqueIdField,t.queryGeometry=this.queryGeometry,t.queryGeometryType=this.queryGeometryType,t}}},69397:(t,e,r)=>{r.d(e,{$B:()=>o,Qf:()=>l,Qh:()=>u,RS:()=>s,ez:()=>a,lM:()=>i,qK:()=>f});var n=r(34275);function o(t){return 32+t.length}const s=16;function i(t){if(!t)return 0;let e=f;for(const r in t)t.hasOwnProperty(r)&&(e+=c(t[r],!1));return e}function u(t){if(!t)return 0;if("number"==typeof t[0])return l(t);if(Array.isArray(t))return function(t){const e=t.length;if(0===e||"number"==typeof t[0])return h(t,8);let r=a;for(let n=0;n<e;n++)r+=c(t[n]);return r}(t);let e=f;for(const r in t)t.hasOwnProperty(r)&&(e+=c(t[r]));return e}function c(t,e=!0){switch(typeof t){case"object":return e?u(t):f;case"string":return o(t);case"number":return s;case"boolean":return 4;default:return 8}}function l(...t){return t.reduce((t,e)=>t+(e?(0,n.iu)(e)?e.byteLength+d:Array.isArray(e)?h(e,s):0:0),0)}function h(t,e){return a+t.length*e}const f=32,a=16,d=145},90708:(t,e,r)=>{r.d(e,{Ap:()=>F,B2:()=>y,DF:()=>T,Di:()=>q,E2:()=>k,IE:()=>g,Nl:()=>C,PR:()=>G,Rk:()=>J,Ux:()=>x,Ye:()=>E,ZF:()=>S,aQ:()=>$,eY:()=>_,hK:()=>K,jH:()=>L,jQ:()=>U,kz:()=>j,oN:()=>Y,q3:()=>W,qN:()=>P,zv:()=>V});var n=r(49186),o=r(53966),s=r(97768),i=r(70328),u=r(19419),c=r(65864),l=r(43334),h=r(58512),f=r(92722),a=r(54339);const d=()=>o.A.getLogger("esri.layers.graphics.featureConversionUtils"),m={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0};function g({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function y({scale:t,translate:e},r){return Math.round((e[1]-r)/t[1])}function p({scale:t,translate:e},r){return Math.round((r-e[0])/t[0])}function I({scale:t,translate:e},r){return Math.round((r-e[1])/t[1])}function N({scale:t,translate:e},r,n){return r*t[n]+e[n]}function b(t,e,r){return e&&(t.hasZ=!0),r&&(t.hasM=!0),t}function w(t,e,r,n){if(e&&n&&t!==r)return(e,r,n,o)=>{n[o++]=e[r++],n[o++]=e[r++],t?r++:n[o++]=0,n[o++]=e[r++]??0};const o=2+(r?1:0)+(n?1:0),s=o-((!t&&r?1:0)+(!e&&n?1:0));return(t,e,r,n)=>{for(let i=0;i<o;++i)r[n++]=i<s?t[e++]??0:0}}function T(t,e,r){if(!t)return null;const{coords:n,hasZ:o,hasM:s}=t,[i,u]=n,c=o?n[2]:0,l=s?n[2+(o?1:0)]:0;return{x:i,y:u,z:e?c:void 0,m:r?l:void 0}}function P(t,e=(0,c.Pv)(t),r=(0,c.W0)(t)){const{x:n,y:o,z:s,m:i}=t,u=[n,o];return e&&u.push(s??0),r&&u.push(i??0),new f.A([],u,e,r)}function M(t,e,r){if(null==t)return null;const{coords:n,stride:o,hasZ:s,hasM:i}=t,u=w(s,i,e,r),c=[];for(let t=0;t<n.length;t+=o){const e=[];u(n,t,e,0),c.push(e)}return b({points:c},e,r)}function G(t,e=(0,c.Pv)(t),r=(0,c.W0)(t)){const{points:n,hasZ:o,hasM:s}=t,i=new f.A([n.length],[],e,r),{coords:u,stride:l}=i;let h=0;const a=w(o??!1,s??!1,e,r);for(const t of n)a(t,0,u,h),h+=l;return i}function A(t,e,r){if(!t)return null;const{coords:n,lengths:o,stride:s,hasZ:i,hasM:u}=t;let c=0;const l=w(i,u,e,r),h=[];for(const t of o){const e=[];for(let r=0;r<t;r++){const t=[];l(n,c,t,0),c+=s,e.push(t)}h.push(e)}return b({paths:h},e,r)}function F(t,e=(0,c.Pv)(t),r=(0,c.W0)(t)){const{paths:n,hasZ:o,hasM:s}=t,i=w(o??!1,s??!1,e,r),u=new f.A([],[],e,r),{lengths:l,coords:h,stride:a}=u;let d=0;for(const t of n){for(const e of t)i(e,0,h,d),d+=a;l.push(t.length)}return u}function v(t,e,r){if(!t)return null;const{coords:n,lengths:o,stride:s,hasZ:i,hasM:u}=t;let c=0;const l=w(i,u,e,r),h=[];for(const t of o){const e=[];for(let r=0;r<t;r++){const t=[];l(n,c,t,0),c+=s,e.push(t)}h.push(e)}return b({rings:h},e,r)}function E(t,e=(0,c.Pv)(t),r=(0,c.W0)(t)){const{rings:n,hasZ:o,hasM:s}=t,i=new f.A([],[],e,r),{lengths:u,coords:l,stride:h}=i;let a=0;const d=w(o??!1,s??!1,e,r);for(const t of n){for(const e of t)d(e,0,l,a),a+=h;u.push(t.length)}return i}const Z=[],O=[];function k(t,e,r,n,o){Z[0]=t;const[s]=q(O,Z,e,r,n,o);return H(Z),H(O),s}function q(t,e,r,o,s,i){if(H(t),!r){for(const r of e){const e=(0,a.W)(r,i);t.push(new l.Om(null,r.attributes,null,e))}return t}switch(r){case"esriGeometryPoint":return function(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:i,centroid:u}=s,h=(0,c.Pv)(e),f=(0,c.W0)(e);t.push(new l.Om(e?P(e,r&&h,n&&f):null,i,u?P(u,!1,!1):null,(0,a.W)(s,o)))}return t}(t,e,o,s,i);case"esriGeometryMultipoint":return function(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:i}=s,u=(0,c.Pv)(e),h=(0,c.W0)(e);t.push(new l.Om(e?G(e,r&&u,n&&h):null,i,null,(0,a.W)(s,o)))}return t}(t,e,o,s,i);case"esriGeometryPolyline":return function(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:i,centroid:u}=s,h=(0,c.Pv)(e),f=(0,c.W0)(e);t.push(new l.Om(e?F(e,r&&h,n&&f):null,i,u?P(u,!1,!1):null,(0,a.W)(s,o)))}return t}(t,e,o,s,i);case"esriGeometryPolygon":case"esriGeometryMultiPatch":return function(t,e,r,n,o){for(const s of e){const{geometry:e,attributes:i,centroid:u}=s,h=(0,c.Pv)(e),f=(0,c.W0)(e);t.push(new l.Om(e?E(e,r&&h,n&&f):null,i,u?P(u,!1,!1):null,(0,a.W)(s,o)))}return t}(t,e,o,s,i);default:d().error("convertToFeatureSet:unknown-geometry",new n.A("internal:geometry",`Unable to parse unknown geometry type '${r}'`)),H(t)}return t}function Y(t,e,r,n){O[0]=t,R(Z,O,e,r,n);const o=Z[0];return H(Z),H(O),o}function x(t,e=(0,c.Pv)(t),r=(0,c.W0)(t)){return null==t?null:(0,c.fT)(t)?P(t,e,r):(0,c.Bi)(t)?E(t,e,r):(0,c.Rg)(t)?F(t,e,r):(0,c.U9)(t)?G(t,e,r):void d().error("convertFromGeometry:unknown-geometry",new n.A("internal:geometry",`Unable to parse unknown geometry type '${t}'`))}function V(t,e,r,o){if(null==t)return null;const s="coords"in t?t:t.geometry;if(null==s)return null;switch(e){case"esriGeometryPoint":return T(s,r,o);case"esriGeometryMultipoint":return M(s,r,o);case"esriGeometryPolyline":return A(s,r,o);case"esriGeometryPolygon":return v(s,r,o);default:return d().error("convertToGeometry:unknown-geometry",new n.A("internal:geometry",`Unable to parse unknown geometry type '${e}'`)),null}}function R(t,e,r,o,s){if(H(t),null==r)return function(t,e){for(const r of e)t.push({attributes:r.attributes});return t}(t,e);switch(r){case"esriGeometryPoint":return function(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({attributes:s,geometry:T(o,r,n)});return t}(t,e,o,s);case"esriGeometryMultipoint":return function(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&M(o,r,n),attributes:s});return t}(t,e,o,s);case"esriGeometryPolyline":return function(t,e,r,n){for(const{geometry:o,attributes:s}of e)t.push({geometry:o&&A(o,r,n),attributes:s});return t}(t,e,o,s);case"esriGeometryPolygon":return function(t,e,r,n){for(const{geometry:o,attributes:s,centroid:i}of e){const e=v(o,r,n),u=T(i,!1,!1);t.push(i?{geometry:e,attributes:s,centroid:u}:{geometry:e,attributes:s})}return t}(t,e,o,s);default:d().error("convertToFeatureSet:unknown-geometry",new n.A("internal:geometry",`Unable to parse unknown geometry type '${r}'`))}return t}function S(t){const{spatialReference:e,transform:r,fields:n,hasM:o,hasZ:s,features:i,geometryType:u,exceededTransferLimit:c,queryGeometry:l,queryGeometryType:h}=t,f={features:R([],i,u,s,o),fields:n,geometryType:u,spatialReference:e,queryGeometry:V(l,h,s,o)};return r&&(f.transform=r),c&&(f.exceededTransferLimit=c),o&&(f.hasM=o),s&&(f.hasZ=s),f}function W(t,e){const r=new h.A,{hasM:n,hasZ:o,features:s,spatialReference:i,geometryType:u,exceededTransferLimit:c,transform:l,fields:f}=t;return f&&(r.fields=f),r.geometryType=u??null,r.spatialReference=i??null,s&&q(r.features,s,u,o,n,e),c&&(r.exceededTransferLimit=c),n&&(r.hasM=n),o&&(r.hasZ=o),l&&(r.transform=l),r}function _(t){const{transform:e,features:r}=t;if(!e)return t;for(const t of r)null!=t.geometry&&$(t.geometry,e),null!=t.centroid&&$(t.centroid,e);return t.transform=null,t}function L(t,e){const{geometryType:r,features:n}=e;if(!t)return e;for(let e=0;e<n.length;e++){const o=n[e],s=o.weakClone();s.geometry=C(o.geometry,r,t),s.centroid=C(o.centroid,"esriGeometryPoint",t),n[e]=s}return e.transform=t,e}function C(t,e,r,n,o){if(null==t)return null;if(!t?.coords.length)return null;const s=m[e],{coords:i,lengths:u,stride:c,hasZ:l,hasM:h}=t;n??=l,o??=h;const a=new f.A([],[],n,o),d=a.stride,p=w(l,h,n,o);let I=0;const N=[0,0,0,0].slice(d);function b(){p(i,I,N,0),I+=c,N[0]=g(r,N[0]),N[1]=y(r,N[1])}if(t.isPoint)return b(),a.coords.push(...N),a;let T=0;for(const t of u){if(t<s)continue;let e=1;b(),a.coords.push(...N);let[r,n]=N;for(let o=1;o<t;o++){b();const[t,o]=N;r===t&&n===o||(N[0]-=r,N[1]-=n,a.coords.push(...N),r=t,n=o,e++)}e>=s?(a.lengths.push(e),T=a.coords.length):H(a.coords,T)}return H(a.coords,T),a.coords.length?a:null}function j(t,e,r,n=t.hasZ,o=t.hasM){if(!t.coords.length)return null;const s=m[e],{coords:i,lengths:u,stride:c,hasZ:l,hasM:h}=t,a=new f.A([],[],n,o),d=a.stride,g=w(l,h,n,o);if(t.isPoint)return g(i,0,a.coords,0),a;let y=0;const p=r*r;for(const t of u){if(t<s){y+=t*c;continue}const e=a.coords.length/d,r=y,n=y+(t-1)*c;g(i,r,a.coords,a.coords.length),Q(a.coords,i,c,p,g,r,n),g(i,n,a.coords,a.coords.length);const o=a.coords.length/d-e;o>=s?a.lengths.push(o):H(a.coords,e*d),y+=t*c}return a.coords.length?a:null}function z(t,e,r,n){const o=t[e],s=t[e+1],i=t[r],u=t[r+1],c=t[n],l=t[n+1];let h=i,f=u,a=c-h,d=l-f;if(0!==a||0!==d){const t=((o-h)*a+(s-f)*d)/(a*a+d*d);t>1?(h=c,f=l):t>0&&(h+=a*t,f+=d*t)}return a=o-h,d=s-f,a*a+d*d}function Q(t,e,r,n,o,s,i){let u,c=n,l=0;for(let t=s+r;t<i;t+=r)u=z(e,t,s,i),u>c&&(l=t,c=u);c>n&&(l-s>r&&Q(t,e,r,n,o,s,l),o(e,l,t,t.length),i-l>r&&Q(t,e,r,n,o,l,i))}function U(t,e){if(!e?.coords?.length)return null;let r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if(e&&e.coords){const{coords:t,stride:i}=e;for(let e=0;e<t.length;e+=i){const i=t[e],u=t[e+1];r=Math.min(r,i),o=Math.max(o,i),n=Math.min(n,u),s=Math.max(s,u)}}return(0,i.is)(t)?(0,i.BI)(t,r,n,o,s):(0,u.fA)(r,n,o,s,t),t}function $(t,e){const{coords:r,lengths:n,stride:o}=t;if(!r.length)return void(n.length=0);(0,s.Lw)(e);const{originPosition:i,scale:u,translate:c}=e,l=X;l.originPosition=i;const h=l.scale;h[0]=u[0]??1,h[1]=-(u[1]??1),h[2]=u[2]??1,h[3]=u[3]??1;const f=l.translate;if(f[0]=c[0]??0,f[1]=c[1]??0,f[2]=c[2]??0,f[3]=c[3]??0,!n.length){for(let t=0;t<o;++t)r[t]=N(l,r[t],t);return void(n.length=0)}let a=0;for(let t=0;t<n.length;t++){const e=n[t];n[t]=e;for(let t=0;t<o;++t)r[a+t]=N(l,r[a+t],t);let s=r[a],i=r[a+1];a+=o;for(let t=1;t<e;t++,a+=o){s+=r[a]*h[0],i+=r[a+1]*h[1],r[a]=s,r[a+1]=i;for(let t=2;t<o;++t)r[a+t]=N(l,r[a+t],t)}}}function B(t,e,r,n){let o=0,s=t[n*e],i=t[n*(e+1)];for(let u=1;u<r;u++){const r=s+t[n*(e+u)],c=i+t[n*(e+u)+1],l=(r-s)*(c+i);s=r,i=c,o+=l}return.5*o}function J(t,e){const{coords:r,lengths:n}=t;let o=0,s=0;for(let t=0;t<n.length;t++){const i=n[t];s+=B(r,o,i,e),o+=i}return Math.abs(s)}function D(t,e,r,n){return 0===t*n-r*e&&t*r+e*n>0}function K(t,e,r){const{stride:n}=t;if(t.isPoint){if(t.coords.length<2)return null;const[r,n]=t.coords,o=p(e,r),s=I(e,n);return new f.A([],[o,s])}const o=new f.A([],[0,0]),s=m[r],i="esriGeometryPolygon"===r||"esriGeometryPolyline"===r;let u=0,c=0;for(let r=0;r<t.lengths.length;r++){const l=t.lengths[r],h=c;let f=p(e,t.coords[n*u]),a=I(e,t.coords[n*u+1]);o.coords[c++]=f,o.coords[c++]=a;let d=0,m=0,g=1;for(let r=1;r<l;r++){const s=p(e,t.coords[n*(r+u)]),l=I(e,t.coords[n*(r+u)+1]);if(s!==f||l!==a){const t=s-f,e=l-a;i&&D(d,m,t,e)?(o.coords[c-2]+=t,o.coords[c-1]+=e,f+=t,a+=e):(o.coords[c++]=s,o.coords[c++]=l,f=s,a=l,d=t,m=e,g+=1)}}g<s?c=h:o.lengths.push(g),u+=l}return 0===o.lengths.length?null:o}function H(t,e=0){t.length!==e&&(t.length=e)}const X={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]}},92722:(t,e,r)=>{r.d(e,{A:()=>o});var n=r(69397);class o{constructor(t=[],e=[],r=!1,n=!1){this.lengths=t??[],this.coords=e??[],this.hasZ=r,this.hasM=n}static fromJSON({lengths:t,coords:e,hasZ:r,hasM:n}){return new o(t,e,r||!1,n||!1)}static fromRect([t,e,r,n]){const s=r-t,i=n-e;return new o([5],[t,e,s,0,0,i,-s,0,0,-i])}get isPoint(){return 0===this.lengths.length&&this.coords.length>=2}get maxLength(){return Math.max(...this.lengths)}get size(){return this.isPoint?1:this.lengths.reduce((t,e)=>t+e,0)}get usedMemory(){return 64+(0,n.Qf)(this.lengths,this.coords)}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}area(){if(this.isPoint)return 0;let t=0,e=0;for(const r of this.lengths){if(r<3)continue;const{stride:n}=this;let o=this.coords[n*e],s=this.coords[n*e+1];for(let i=1;i<r;i+=1){const r=n*(e+i),u=this.coords[r],c=this.coords[r+1];t+=-.5*(u-o)*(c+s),o=u,s=c}e+=r}return t}forEachVertex(t){let e=0;if(this.isPoint)return t(this.coords[0],this.coords[1]);const{stride:r}=this;for(const n of this.lengths){for(let o=0;o<n;o++){const n=r*(e+o);t(this.coords[n],this.coords[n+1])}e+=n}}deltaDecode(){const t=this.clone(),{coords:e,lengths:r}=t;let n=0;const{stride:o}=this;for(const t of r){for(let r=1;r<t;r++){const t=o*(n+r);e[t]+=e[t-o],e[t+1]+=e[t+1-o]}n+=t}return t}clone(t){if(this.isPoint)return new o([],Array.from(this.coords.slice(0,this.stride)),this.hasZ,this.hasM);const e=Array.from(this.lengths),{stride:r,size:n}=this,s=this.coords.slice(0,n*r);return t?(t.set(s),new o(e,t)):new o(e,Array.from(s),this.hasZ,this.hasM)}justXY(){const{stride:t,size:e}=this;if(2===t)return this;const r=new Array(e*t);for(let e=0,n=0;e<r.length;e+=t)r[n++]=this.coords[e],r[n++]=this.coords[e+1];return new o(this.lengths,r,!1,!1)}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1185],{2272:(e,t,i)=>{i.d(t,{Dl:()=>u,gf:()=>h,jV:()=>l,lF:()=>c});var s=i(92602),n=i(70333),r=i(4718),o=i(84952),a=i(926);function l(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function u(e){return"string"==typeof e?(0,o.An)(e):(0,r.o8)(e)}function c(e,t,i){const s={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))s[n]=r.map(e=>c(e));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i?.[n]);s[n]=t?e:JSON.stringify(e)}else s[n]=t?r:JSON.stringify(r);else s[n]=r}return s}async function h(e,t,r){const o=function(e,t){return e?t&&(0,a.Qc)(e)?t:(0,a.CG)(e)??n.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!n.id&&s.A.request.useIdentity&&await Promise.all([i.e(7330),i.e(168),i.e(148)]).then(i.bind(i,50148));const l=await n.id.getCredential(e,r);return l?.token}},6518:(e,t,i)=>{i.d(t,{F:()=>a});var s=i(44208),n=i(75503),r=i(19419);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.wq(9,(0,s.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((i,s)=>{e[t++]=s}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,i){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,i)}(this._index,e,e=>t(this._idByBounds.get(e)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},14607:(e,t,i)=>{i.d(t,{B:()=>u,GP:()=>a,qg:()=>c});var s=i(799),n=i(73444);const r={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],no:[","," "],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function o(e=(0,n.JK)()){let t=(e=e.toLowerCase())in r;if(!t){const i=e.split("-");i.length>1&&i[0]in r&&(e=i[0],t=!0),t||(e="en")}const[i,s,o="#,##0.###"]=r[e];return{decimal:i,group:s,pattern:o}}function a(e,t){const i=o((t={...t}).locale);t.customs=i;const s=t.pattern||i.pattern;return isNaN(e)||Math.abs(e)===1/0?null:function(e,t,i){const s=(i=i||{}).customs.group,n=i.customs.decimal,r=t.split(";"),o=r[0];if((t=r[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const a=l,u=o.match(a);if(!u)throw new Error("unable to find a number expression in pattern: "+t);return!1===i.fractional&&(i.places=0),t.replace(a,function(e,t,i){!0===(i=i||{}).places&&(i.places=0),i.places===1/0&&(i.places=6);const s=t.split("."),n="string"==typeof i.places&&i.places.indexOf(",");let r=i.places;n?r=i.places.slice(n+1):+r>=0||(r=(s[1]||[]).length),i.round<0||(e=Number(e.toFixed(Number(r))));const o=String(Math.abs(e)).split("."),a=o[1]||"";if(s[1]||i.places){n&&(i.places=i.places.slice(0,Math.max(0,n)));const e=void 0!==i.places?i.places:s[1]&&s[1].lastIndexOf("0")+1;+e>a.length&&(o[1]=a.padEnd(Number(e),"0")),+r<a.length&&(o[1]=a.slice(0,Math.max(0,Number(r))))}else o[1]&&o.pop();const l=s[0].replace(",","");let u=l.indexOf("0");-1!==u&&(u=l.length-u,u>o[0].length&&(o[0]=o[0].padStart(u,"0")),l.includes("#")||(o[0]=o[0].slice(-u)));let c,h,d=s[0].lastIndexOf(",");if(-1!==d){c=s[0].length-d-1;const e=s[0].slice(0,d);d=e.lastIndexOf(","),-1!==d&&(h=e.length-d-1)}const f=[];for(let e=o[0];e;){const t=e.length-c;f.push(t>0?e.slice(Math.max(0,t)):e),e=t>0?e.slice(0,t):"",h&&(c=h,h=void 0)}return o[0]=f.reverse().join(i.group||","),o.join(i.decimal||".")}(e,u[0],{decimal:n,group:s,places:i.places,round:i.round}))}(e,s,t)}const l=/[#0,]*[#0](?:\.0*#*)?/;function u(e){const t=o((e=e||{}).locale),i=e.pattern||t.pattern,n=t.group,r=t.decimal;let a=1;if(i.includes("%"))a/=100;else if(i.includes("‰"))a/=1e3;else if(i.includes("¤"))throw new Error("currency notation not supported");const u=i.split(";");1===u.length&&u.push("-"+u[0]);const c=d(u,t=>(t="(?:"+(0,s.Cj)(t,".")+")").replace(l,t=>{const i={signed:!1,separator:e.strict?n:[n,""],fractional:e.fractional,decimal:r,exponent:!1},s=t.split(".");let o=e.places;1===s.length&&1!==a&&(s[1]="###"),1===s.length||0===o?i.fractional=!1:(void 0===o&&(o=e.pattern?s[1].lastIndexOf("0")+1:1/0),o&&null==e.fractional&&(i.fractional=!0),!e.places&&+o<s[1].length&&(o+=","+s[1].length),i.places=o);const l=s[0].split(",");return l.length>1&&(i.groupSize=l.pop().length,l.length>1&&(i.groupSize2=l.pop().length)),"("+function(e){"places"in(e=e||{})||(e.places=1/0),"string"!=typeof e.decimal&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=h(e),i=d(e.fractional,t=>{let i="";return t&&0!==e.places&&(i="\\"+e.decimal,e.places===1/0?i="(?:"+i+"\\d+)?":i+="\\d{"+e.places+"}"),i},!0);let s=t+i;return i&&(s="(?:(?:"+s+")|(?:"+i+"))"),s+d(e.exponent,t=>t?"([eE]"+h({signed:e.eSigned})+")":"")}(i)+")"}),!0);return{regexp:c.replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:n,decimal:r,factor:a}}function c(e,t){const i=u(t),s=new RegExp("^"+i.regexp+"$").exec(e);if(!s)return NaN;let n=s[1];if(!s[1]){if(!s[2])return NaN;n=s[2],i.factor*=-1}return n=n.replaceAll(new RegExp("["+i.group+"\\s\\xa0]","g"),"").replace(i.decimal,"."),Number(n)*i.factor}function h(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",d(e.signed,e=>e?"[-+]":"",!0)+d(e.separator,t=>{if(!t)return"(?:\\d+)";" "===(t=(0,s.Cj)(t))?t="\\s":" "===t&&(t="\\s\\xa0");const i=e.groupSize,n=e.groupSize2;if(n){const e="(?:0|[1-9]\\d{0,"+(n-1)+"}(?:["+t+"]\\d{"+n+"})*["+t+"]\\d{"+i+"})";return i-n>0?"(?:"+e+"|(?:0|[1-9]\\d{0,"+(i-1)+"}))":e}return"(?:0|[1-9]\\d{0,"+(i-1)+"}(?:["+t+"]\\d{"+i+"})*)"},!0)}const d=(e,t,i)=>{if(!Array.isArray(e))return t(e);const s=[];for(let i=0;i<e.length;i++)s.push(t(e[i]));return f(s.join("|"),Boolean(i))},f=(e,t)=>"("+(t?"?:":"")+e+")"},25209:(e,t,i)=>{i.r(t),i.d(t,{default:()=>$});var s=i(11254),n=i(60999),r=i(67482),o=i(49186),a=i(53966),l=i(74887),u=i(84952),c=i(91218),h=i(16930),d=i(21325),f=i(28735),p=i(43334),m=i(92722),_=i(83221),y=i(31464),g=i(56390),x=i(14607),b=i(30524),S=i(54625);const I=/^\s*"([\S\s]*)"\s*$/,w=/""/g,v=[","," ",";","|","\t"];function*F(e,t,i){let s=0;for(;s<=e.length;){const n=e.indexOf(t,s),r=e.slice(s,n>-1?n:void 0);s+=r.length+t.length,i&&!r.trim()||(yield r)}}function M(e){const t=e.includes("\r\n")?"\r\n":"\n";return F(e,t,!0)}function B(e,t){return F(e,t,!1)}function z(e,t,i){e=e.trim(),t=t?.trim();const s=[],n=Array.from(new Set([i?.delimiter,...v])).filter(e=>null!=e);for(const i of n){const n=E(e,i).length,r=E(t,i).length??n;n>1&&s.push({weight:Math.min(n,r),delimiter:i})}const r=s.sort(({weight:e},{weight:t})=>t-e).map(({delimiter:e})=>e);for(const t of r){const s=N(e,t).names,n=(0,S.i_)(s,i?.longitudeField,i?.latitudeField);if(n.longitudeFieldName&&n.latitudeFieldName)return{delimiter:t,locationInfo:n}}return{delimiter:r[0],locationInfo:null}}function*T(e,t,i,s=()=>Object.create(null)){const n=M(e);n.next();let r="",o="",a=0,l=s(),u=0;e:for(const e of n){const n=B(e,i);for(const e of n)if(r+=o+e,o="",a+=C(e),a%2==0){if(a>0){const e=I.exec(r);if(!e){l=s(),u=0,r="",a=0;continue e}l[t[u]]=e[1].replaceAll(w,'"'),u++}else l[t[u]]=r,u++;r="",a=0}else o=i;0===a?(yield l,l=s(),u=0):o="\n"}}function N(e,t){const i=E(e,t).filter(e=>null!=e),s=i.map(e=>(0,b.rS)(e));for(let e=s.length-1;e>=0;e--)s[e]||(s.splice(e,1),i.splice(e,1));return{names:s,aliases:i}}function E(e,t){if(!e?.length)return[];const i=[];let s="",n="",r=0;const o=B(e,t);for(const e of o)if(s+=n+e,n="",r+=C(e),r%2==0){if(r>0){const e=I.exec(s);e&&i.push(e[1].replaceAll(w,'"'))}else i.push(s);s="",r=0}else n=t;return i}function C(e){let t=0,i=0;for(i=e.indexOf('"',i);i>=0;)t++,i=e.indexOf('"',i+1);return t}function A(e,t,i,s,n){const r=[],o=T(e,i,t),a=[];for(const e of o){if(10===a.length)break;a.push(e)}for(let e=0;e<i.length;e++){const t=i[e],o=s[e];if(t===n.longitudeFieldName||t===n.latitudeFieldName)r.push({name:t,type:"esriFieldTypeDouble",alias:o});else{let e;switch(O(a.map(e=>e[t]))){case"integer":e="esriFieldTypeInteger";break;case"double":e="esriFieldTypeDouble";break;case"date":e="esriFieldTypeDate";break;default:e="esriFieldTypeString"}r.push({name:t,type:e,alias:o,length:(0,b._b)(e)})}}return r}function O(e){if(!e.length)return"string";const t=/[^+\-.,0-9]/;return e.map(e=>{if(""!==e){if(!t.test(e)){let t=R(e);if(!isNaN(t))return/[.,]/.test(e)||!Number.isInteger(t)||t>214783647||t<-214783648?"double":"integer";if(e.includes("E")){if(t=Number(e),!Number.isNaN(t))return"double";if(e.includes(",")&&(e=e.replace(",","."),t=Number(e),!Number.isNaN(t)))return"double"}}return(0,r.Cq)(e)?"date":"string"}}).reduce((e,t)=>void 0===e?t:void 0===t?e:e===t?t:"string"===e||"string"===t?"string":"double"===e||"double"===t?"double":void 0)}const R=function(){const e=(0,x.B)(),t=new RegExp("^"+e.regexp+"$"),i=new RegExp("["+e.group+"\\s\\xa0]","g"),s=e.factor;return n=>{const r=t.exec(n);if(e.factor=s,!r)return NaN;let o=r[1];if(!r[1]){if(!r[2])return NaN;o=r[2],e.factor*=-1}return o=o.replace(i,"").replace(e.decimal,"."),+o*e.factor}}();function k(e){return JSON.parse(JSON.stringify(e))}var q=i(64714),Y=i(95466),L=i(54218),X=i(98623);const j=(0,q.F0)("esriGeometryPoint"),D=["csv"],P=[0,0];class U{constructor(e,t){this.x=e,this.y=t}}class ${constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){this._loadOptions=e;const[i]=await Promise.all([this._fetch(t.signal),this._checkProjection(e?.parsingOptions?.spatialReference)]),s=function(e,t){const i=t.parsingOptions||{},s={delimiter:i.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:i.latitudeField,longitudeFieldName:i.longitudeField}},n=s.layerDefinition={name:(0,u.e7)(t.url,D)||"csv",dateFieldsTimeReference:{timeZoneIANA:X.n$},drawingInfo:j,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:i.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:i.spatialReference||{wkid:4326}}},r=M(e),a=r.next().value?.trim(),l=r.next().value?.trim();if(!a)throw new o.A("csv-layer:empty-csv","CSV is empty",{csv:e});const{delimiter:c,locationInfo:h}=z(a,l,i);if(!c)throw new o.A("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:a,secondLine:l,parsingOptions:i});if(!h)throw new o.A("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:a,secondLine:l,parsingOptions:i});s.locationInfo=h,s.delimiter=c;const{names:d,aliases:f}=N(a,c),p=A(e,s.delimiter,d,f,s.locationInfo);if(i.fields?.length){const e=new Y.A(i.fields);for(const t of p){const i=e.get(t.name);i&&Object.assign(t,i)}}if(!p.some(e=>"esriFieldTypeOID"===e.type&&(n.objectIdField=e.name,!0))){const e={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=e.name,p.unshift(e)}n.fields=p;const m=new Y.A(n.fields);if(s.locationInfo&&(s.locationInfo.latitudeFieldName=m.get(s.locationInfo.latitudeFieldName).name,s.locationInfo.longitudeFieldName=m.get(s.locationInfo.longitudeFieldName).name),n.timeInfo){const e=n.timeInfo;if(e.startTimeField){const t=m.get(e.startTimeField);t?(e.startTimeField=t.name,t.type="esriFieldTypeDate"):e.startTimeField=null}if(e.endTimeField){const t=m.get(e.endTimeField);t?(e.endTimeField=t.name,t.type="esriFieldTypeDate"):e.endTimeField=null}if(e.trackIdField){const t=m.get(e.trackIdField);e.trackIdField=t?t.name:null}e.startTimeField||e.endTimeField||(n.timeInfo=null)}return s}(i,e);this._locationInfo=s.locationInfo,this._delimiter=s.delimiter,this._queryEngine=this._createQueryEngine(s);const n=this._createFeatures(i);this._queryEngine.featureStore.addMany(n);const{fullExtent:r,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();if(s.layerDefinition.extent=r,a){const{start:e,end:t}=a;s.layerDefinition.timeInfo.timeExtent=[e,t]}return s}async applyEdits(){throw new o.A("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),(await this._queryEngine.executeQueryForIds(e,t.signal)).filter(L.Et)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),await this._queryEngine.executeQueryForSnapping(e,t.signal)}async queryAttributeBins(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeAttributeBinsQuery(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=(0,n.UT)(this._snapshotFeatures),this._snapshotTask.promise.then(e=>{this._queryEngine.featureStore.clear(),e&&this._queryEngine.featureStore.addMany(e)},e=>{this._queryEngine.featureStore.clear(),(0,l.zf)(e)||a.A.getLogger("esri.layers.CSVLayer").error(new o.A("csv-layer:refresh","An error occurred during refresh",{error:e}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:i}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:i}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:i}=this._loadOptions;if(!t)throw new o.A("csv-layer:invalid-source","url not defined");const n=(0,u.An)(t);return(await(0,s.A)(n.path,{query:{...n.query,...i},responseType:"text",signal:e})).data}_createQueryEngine(e){const{objectIdField:t,fields:i,extent:s,timeInfo:n}=e.layerDefinition,r=new _.A({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1}),o={type:"object-id",fieldName:t};return new g.do({fieldsIndex:Y.A.fromLayerJSON({fields:i,dateFieldsTimeReference:{timeZoneIANA:X.n$}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:n,featureIdInfo:o,spatialReference:s.spatialReference||{wkid:4326},featureStore:r})}_createFeatures(e){const{latitudeFieldName:t,longitudeFieldName:i}=this._locationInfo,{objectIdField:s,fieldsIndex:n,spatialReference:o}=this._queryEngine;let a=[];const l=[],u=n.fields.filter(e=>e.name!==s).map(e=>e.name);let _=0;const y={};for(const e of n.fields)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=(0,b.lD)(e);void 0!==t&&(y[e.name]=t)}const g=T(e,u,this._delimiter,(0,q.Vx)(y,s));for(const e of g){const o=this._parseCoordinateValue(e[t]),u=this._parseCoordinateValue(e[i]);if(null!=u&&null!=o&&!isNaN(o)&&!isNaN(u)){e[t]=o,e[i]=u;for(const s in e)if(s!==t&&s!==i)if(n.isDateField(s))e[s]=(0,r._U)(e[s]);else if(n.isNumericField(s)){const t=R(e[s]);isNaN(t)?e[s]=null:e[s]=t}else null!=e[s]&&(e[s]=k(e[s]));e[s]=_,_++,a.push(new U(u,o)),l.push(e)}}if(!(0,d.aI)({wkid:4326},o))if((0,d.K8)(o))for(const e of a)[e.x,e.y]=(0,f.je)(e.x,e.y,P);else a=(0,c.projectMany)(a,h.A.WGS84,o);const x=[];for(let e=0;e<a.length;e++){const{x:t,y:i}=a[e],n=l[e];n[s]=e+1,x.push(new p.Om(new m.A([],[t,i]),n,null,n[s]))}return x}_parseCoordinateValue(e){if(null==e||""===e)return null;let t=R(e);return(isNaN(t)||Math.abs(t)>181)&&(t=parseFloat(e)),t}async _checkProjection(e){try{await(0,y.Nk)(d.KK,e)}catch{throw new o.A("csv-layer:projection-not-supported","Projection not supported")}}}},36708:(e,t,i)=>{i.d(t,{C_:()=>d,OH:()=>m,Vh:()=>_,on:()=>h,pc:()=>y,wB:()=>l,z7:()=>u});var s=i(37955),n=i(36563),r=i(97768),o=i(74887),a=i(14012);function l(e,t,i={}){return c(e,t,i,f)}function u(e,t,i={}){return c(e,t,i,p)}function c(e,t,i={},s){let n=null;const o=i.once?(e,i)=>{s(e)&&((0,r.xt)(n),t(e,i))}:(e,i)=>{s(e)&&t(e,i)};if(n=(0,a.Cn)(e,o,i.sync,i.equals),i.initial){const t=e();o(t,t)}return n}function h(e,t,i,o={}){let a=null,u=null,c=null;function h(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.xt)(c),i(e)}const f=l(e,(e,i)=>{h(),(0,s.wb)(e)&&(a=e,u=(0,s.on)(e,t,d),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return c=(0,n.hA)(()=>{f.remove(),h()}),c}function d(e,t){return function(e,t,i){if((0,o.G4)(i))return Promise.reject((0,o.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,r.xt)(a)}return new Promise((s,r)=>{a=(0,n.vE)([(0,o.u7)(i,()=>{l(),r((0,o.NK)())}),c(e,e=>{l(),s(e)},{sync:!1,once:!0},t??f)])})}(e,p,t)}function f(e){return!0}function p(e){return!!e}i(80559);const m={sync:!0},_={initial:!0},y={sync:!0,initial:!0}},37730:(e,t,i)=>{i.d(t,{T:()=>n});var s=i(43334);const n={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new s.Om(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)}},54625:(e,t,i)=>{i.d(t,{i_:()=>n});var s=i(30524);function n(e,t,i){t=(0,s.rS)(t)?.toLowerCase(),i=(0,s.rS)(i)?.toLowerCase();const n=e.map(e=>e.toLowerCase()),a=t?e[n.indexOf(t)]:null,l=i?e[n.indexOf(i)]:null;return{longitudeFieldName:a||e[n.indexOf(o.find(e=>n.includes(e)))],latitudeFieldName:l||e[n.indexOf(r.find(e=>n.includes(e)))]}}const r=["lat","lat83","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],o=["lon","lng","lng83","long","long83","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"]},60999:(e,t,i)=>{i.d(t,{DZ:()=>p,Ke:()=>f,Tj:()=>c,UT:()=>m,aD:()=>y,jJ:()=>u});var s=i(31635),n=i(69622),r=i(97768),o=i(74887),a=i(10107),l=i(64108);function u(e,t,i){return(0,o.Lx)(e.map((e,s)=>t.apply(i,[e,s])))}async function c(e,t,i){return(await(0,o.Lx)(e.map((e,s)=>t.apply(i,[e,s])))).map(e=>e.value)}function h(e){return{ok:!0,value:e}}function d(e){return{ok:!1,error:e}}async function f(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return h(await e)}catch(e){return d(e)}}async function p(e){try{return h(await e)}catch(e){return(0,o.QP)(e),d(e)}}function m(e,t){return new _(e,t)}let _=class extends n.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,r.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:i}=this._abortController;this.promise=e(i),this.promise.then(e=>{this._result=h(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,r.xt)(this._abortHandle),this._abortController=null}};(0,s.Cg)([(0,a.MZ)()],_.prototype,"value",null),(0,s.Cg)([(0,a.MZ)()],_.prototype,"error",null),(0,s.Cg)([(0,a.MZ)()],_.prototype,"finished",null),(0,s.Cg)([(0,a.MZ)()],_.prototype,"promise",void 0),(0,s.Cg)([(0,a.MZ)()],_.prototype,"_result",void 0),_=(0,s.Cg)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],_);class y{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,s.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,s.hk)(t)}}}},64714:(e,t,i)=>{i.d(t,{F0:()=>a,Vx:()=>c,e2:()=>d,f:()=>f});var s=i(44208),n=i(4718),r=i(99352),o=i(93470);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.Cb:"esriGeometryPolyline"===e?o.yM:o.WR}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function c(e,t){if((0,s.A)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let i=`this${h(t)} = null;`;for(const t in e)i+=`this${h(t)} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${i};\n }\n }\n `)();return()=>new s}catch(i){return()=>({[t]:null,...e})}}function h(e){return l.test(e)?`.${e}`:`["${e}"]`}function d(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,n.o8)(e)}}]}function f(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:r.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},66344:(e,t,i)=>{i.d(t,{q:()=>a});const s=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class n{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._users=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._users.clear(),this._db.clear()}register(e){this._users.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._users.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const i=this._db.get(e.id+t);return i?.size??0}put(e,t,i,n,o){t=e.id+t;const a=this._db.get(t);if(a&&(this._size-=a.size,e.size-=a.size,this._db.delete(t),a.entry!==i&&this._notifyRemove(t,a.entry,a.size,0)),n>this._maxSize)return void this._notifyRemove(t,i,n,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return s||console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,i,0,0);const l=1+Math.max(o,-4)- -3;this._db.set(t,new r(i,n,l)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t){t=e.id+t;const i=this._db.get(t);if(!i)return;this._size-=i.size,e.size-=i.size;let s=i.entry.usedMemory;for(;s>this._maxSize;){const e=this._notifyRemove(t,i.entry,s,1);if(!(null!=e&&e>0))return void this._db.delete(t);s=e}i.size=s,this._size+=s,e.size+=s,this._checkSize()}pop(e,t){t=e.id+t;const i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;const i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){const i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=new Array;this._db.forEach((e,s)=>{const n=e.lifetime;i[n]=(i[n]||0)+e.size,this._users.forEach(i=>{const{id:n,name:r}=i;if(s.startsWith(n)){const i=t[r]||0;t[r]=i+e.size}})});const s={};this._users.forEach(e=>{const i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[i]||0;t[i]=n,s[i]=Math.round(100*e.hitRate)+"%"}else s[i]="0%"});const n=Object.keys(t);n.sort((e,i)=>t[i]-t[e]),n.forEach(i=>e[i]=Math.round(t[i]/2**20)+"MB / "+s[i]);for(let t=i.length-1;t>=0;--t){const s=i[t];s&&(e["Priority "+(t+-3-1)]=Math.round(s/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forEach(e=>e.resetHitRate())}clear(e){const t=e.id;this._db.forEach((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._users.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(const[t,i]of this._db)t.startsWith(e.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,s){const n=this._users.get(e.split(o)[0])?.removeFunc,r=n?.(t,s,i);return"number"==typeof r?r:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._checkSizeLimits(this.maxSize)}setMaxSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){const i=t??this;if(i.size<=e)return;const s=t?.id;let n=!0;for(;n;){n=!1;for(const[r,a]of this._db)if(0===a.lifetime&&(!s||r.startsWith(s))){const s=t??this._users.get(r.split(o)[0]);if(this._purgeItem(r,a,s),i.size<=.9*e)return;n||=this._db.has(r)}}for(const[n,r]of this._db)if(!s||n.startsWith(s)){const s=t??this._users.get(n.split(o)[0]);if(this._purgeItem(n,r,s),i.size<=.9*e)return}}_purgeItem(e,t,i){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);const s=this._notifyRemove(e,t.entry,t.size,1);null!=s&&s>0&&(this._size+=s,i&&(i.size+=s),t.lives=t.lifetime,t.size=s,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new n(0);class r{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}const o=":";class a{constructor(e,t){this.removeFunc=t,this._storage=new n,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy(),this._storage=null}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},67482:(e,t,i)=>{function s(e){return null!=a(e)||null!=o(e)}function n(e){return l.test(e)}function r(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let i=!0;if(c&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,s=0;for(;!t&&s<=e.length;)t=!u.test(e[s]),s++;i=!t}}return i}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=l.exec(e);if(!t?.groups)return null;const i=t.groups,s=+i.year,n=+i.month-1,r=+i.day,o=+(i.hours??"0"),a=+(i.minutes??"0"),u=+(i.seconds??"0");if(o>23)return null;if(a>59)return null;if(u>59)return null;const c=i.ms??"0",h=c?+c.padEnd(3,"0").slice(0,3):0;let d;if(i.isUTC||!i.offsetSign)d=Date.UTC(s,n,r,o,a,u,h);else{const e=+i.offsetHours,t=+i.offsetMinutes;d=6e4*("+"===i.offsetSign?-1:1)*(60*e+t)+Date.UTC(s,n,r,o,a,u,h)}return Number.isNaN(d)?null:d}i.d(t,{Br:()=>n,Cq:()=>s,_U:()=>r});const l=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,u=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,c=!Number.isNaN(new Date("technology 10").getTime())},69540:(e,t,i)=>{i.d(t,{OU:()=>c,Pw:()=>h});var s=i(31635),n=i(69622),r=(i(44208),i(4718)),o=(i(53966),i(97768)),a=i(88620),l=i(64108);const u=Symbol("ClonableMixin"),c=e=>{var t;const i=e;let n=class extends i{constructor(){super(...arguments),this[t]=!0}static{t=u}clone(e){const t=(0,a.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");const i=t.metadata,s=t.store,n={},l=new Map;for(const t in i){const o=i[t],a=s?.originOf(t),u=o.clonable;if(o.readOnly||!1===u||7!==a&&0!==a&&5!==a&&4!==a)continue;const c=this[t];let h=null;if("function"==typeof u)h=u(c,e);else if("reference"===u)h=c;else if(h=(0,r.TU)(c,e),null!=c&&null==h)continue;0===a?l.set(t,h):n[t]=h}const u=new(0,Object.getPrototypeOf(this).constructor)(n);if(l.size){const e=(0,a.oY)(u)?.store;if(e)for(const[t,i]of l)e.set(t,i,0)}return u}};return n=(0,s.Cg)([(0,l.$)("esri.core.Clonable")],n),n},h=c(n.A)},75503:(e,t,i)=>{i.d(t,{EC:()=>F,wq:()=>a});var s=i(4576),n=i(21818),r=(i(44208),i(15142)),o=i(11006);class a{constructor(e=9,t){this._compareMinX=d,this._compareMinY=f,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),S.prune(),I.prune(),w.prune(),v.prune()}all(e){l(this._data,e)}search(e,t){let i=this._data;const s=this._toBBox;if(x(e,i))for(S.clear();i;){for(let n=0,r=i.children.length;n<r;n++){const r=i.children[n],o=i.leaf?s(r):r;x(e,o)&&(i.leaf?t(r):g(e,o)?l(r,t):S.push(r))}i=S.pop()}}collides(e){let t=this._data;const i=this._toBBox;if(!x(e,t))return!1;for(S.clear();t;){for(let s=0,n=t.children.length;s<n;s++){const n=t.children[s],r=t.leaf?i(n):n;if(x(e,r)){if(t.leaf||g(e,r))return!0;S.push(n)}}t=S.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new B([]),this}remove(e){if(!e)return this;let t,i=this._data,r=null,o=0,a=!1;const l=this._toBBox(e);for(w.clear(),v.clear();i||w.length>0;){if(i||(i=w.pop(),r=w.data[w.length-1],o=v.pop()??0,a=!0),i.leaf&&(t=(0,s.qh)(i.children,(0,n.zI)(e),i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),w.push(i),this._condense(w),this;a||i.leaf||!g(i,l)?r?(o++,i=r.children[o],a=!1):i=null:(w.push(i),v.push(o),o=0,r=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,i,s){const n=i-t+1;let r=this._maxEntries;if(n<=r){const s=new B(e.slice(t,i+1));return u(s,this._toBBox),s}s||(s=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(s-1)));const o=new z([]);o.height=s;const a=Math.ceil(n/r),l=a*Math.ceil(Math.sqrt(r));b(e,t,i,l,this._compareMinX);for(let n=t;n<=i;n+=l){const t=Math.min(n+l-1,i);b(e,n,t,a,this._compareMinY);for(let i=n;i<=t;i+=a){const n=Math.min(i+a-1,t);o.children.push(this._build(e,i,n,s-1))}}return u(o,this._toBBox),o}_insert(e,t,i){const s=this._toBBox,n=i?e:s(e);w.clear();const r=function(e,t,i,s){for(;s.push(t),!0!==t.leaf&&s.length-1!==i;){let i,s=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=p(o),l=_(e,o)-a;l<n?(n=l,s=a<s?a:s,i=o):l===n&&a<s&&(s=a,i=o)}t=i||t.children[0]}return t}(n,this._data,t,w);for(r.children.push(e),h(r,n);t>=0&&w.data[t].children.length>this._maxEntries;)this._split(w,t),t--;!function(e,t,i){for(let s=i;s>=0;s--)h(t.data[s],e)}(n,w,t)}_split(e,t){const i=e.data[t],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);const r=this._chooseSplitIndex(i,n,s);if(!r)return;const o=i.children.splice(r,i.children.length-r),a=i.leaf?new B(o):new z(o);a.height=i.height,u(i,this._toBBox),u(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this._data=new z([e,t]),this._data.height=e.height+1,u(this._data,this._toBBox)}_chooseSplitIndex(e,t,i){let s,n,r;s=n=1/0;for(let o=t;o<=i-t;o++){const t=c(e,0,o,this._toBBox),a=c(e,o,i,this._toBBox),l=y(t,a),u=p(t)+p(a);l<s?(s=l,r=o,n=u<n?u:n):l===s&&u<n&&(n=u,r=o)}return r}_chooseSplitAxis(e,t,i){const s=e.leaf?this._compareMinX:d,n=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,i,s)<this._allDistMargin(e,t,i,n)&&e.children.sort(s)}_allDistMargin(e,t,i,s){e.children.sort(s);const n=this._toBBox,r=c(e,0,t,n),o=c(e,i-t,i,n);let a=m(r)+m(o);for(let s=t;s<i-t;s++){const t=e.children[s];h(r,e.leaf?n(t):t),a+=m(r)}for(let s=i-t-1;s>=t;s--){const t=e.children[s];h(o,e.leaf?n(t):t),a+=m(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const i=e.data[t];if(0===i.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,s.qh)(r,i,r.length,n.indexHint),1)}else this.clear();else u(i,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let i=e;for(I.clear();i;){if(!0===i.leaf)for(const e of i.children)t((0,n.zI)(e));else I.pushArray(i.children);i=I.pop()??null}}function u(e,t){c(e,0,e.children.length,t,e)}function c(e,t,i,s,n){n||(n=new B([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<i;o++)r=e.children[o],h(n,e.leaf?s(r):r);return n}function h(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function d(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function p(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function _(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function y(e,t){const i=Math.max(e.minX,t.minX),s=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,r-s)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function x(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function b(e,t,i,s,n){const r=[t,i];for(;r.length;){const t=r.pop(),i=r.pop();if(t-i<=s)continue;const a=i+Math.ceil((t-i)/s/2)*s;(0,o.q)(e,a,i,t,n),r.push(i,a,a,t)}}const S=new r.A,I=new r.A,w=new r.A,v=new r.A({deallocator:void 0});class F{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class M extends F{constructor(){super(...arguments),this.height=1,this.indexHint=new s.vW}}class B extends M{constructor(e){super(),this.children=e,this.leaf=!0}}class z extends M{constructor(e){super(),this.children=e,this.leaf=!1}}},83221:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(4576),n=i(49186),r=i(65529),o=i(53966),a=i(70328),l=i(19419),u=i(90708),c=i(6518),h=i(51441),d=i(37730);const f=(0,a.vt)();class p{constructor(e){this.geometryInfo=e,this._boundsStore=new c.F,this._featuresById=new Map,this._usedMemory=0,this.events=new r.bk,this.featureAdapter=d.T}get usedMemory(){return this._usedMemory}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,i,s,n]=this.fullBounds;return{xmin:t,ymin:i,xmax:s,ymax:n,spatialReference:(0,h.ag)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(e=>this._upsert(e));return this._emitChanged(),t.filter(s.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const i of e){const e=this._boundsStore.get(i.objectId);e&&t((0,a.Jt)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,e=>{t(this._featuresById.get(e))})}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:e}));const i=this._featuresById.get(t);let s;if(i?(e.displayId=i.displayId,s=this._boundsStore.get(t),this._boundsStore.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);s=(0,u.jQ)(null!=s?s:(0,l.vt)(),e.geometry),null!=s&&this._boundsStore.set(t,s),this._featuresById.set(t,e),this._usedMemory+=this.estimateFeatureUsedMemory?.(e)??0}_upsert(e){const t=e?.objectId;if(null==t)return o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const i=this._featuresById.get(t);if(!i)return this._add(e),e;this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0;const{geometry:s,attributes:r}=e;for(const e in r)i.attributes[e]=r[e];return s&&(i.geometry=s,this._boundsStore.set(t,(0,u.jQ)((0,l.vt)(),s)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(i)??0,i}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._boundsStore.delete(t),this._featuresById.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(e)??0,e}}},93470:(e,t,i)=>{i.d(t,{Cb:()=>r,HW:()=>c,JR:()=>n,JZ:()=>l,WR:()=>a,b6:()=>h,fT:()=>s,nC:()=>u,yM:()=>o});const s=[252,146,31,255],n=[153,153,153,255],r={type:"esriSMS",style:"esriSMSCircle",size:6,color:s,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:s},a={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},l={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},u={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},c={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},h={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}},98453:(e,t,i)=>{i.d(t,{m:()=>s});const s=new(i(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})}}]);