@arcgis/core 4.30.0-next.20240213 → 4.30.0-next.20240215

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 (193) hide show
  1. package/TimeExtent.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/08ba549f9c4afc42a21c.js +1 -0
  4. package/assets/esri/core/workers/chunks/114afcee6a66415cd123.js +1 -0
  5. package/assets/esri/core/workers/chunks/1320562881294ce93806.js +1 -0
  6. package/assets/esri/core/workers/chunks/13451fa3e4b02ca2beb0.js +1 -0
  7. package/assets/esri/core/workers/chunks/{a384f29cb3256401962a.js → 1629a8c2085dce59cd1b.js} +1 -1
  8. package/assets/esri/core/workers/chunks/18512caeeb03b9759ab1.js +1 -0
  9. package/assets/esri/core/workers/chunks/{cc1c958aad790a44048b.js → 1ca28af7c516d8283bb0.js} +1 -1
  10. package/assets/esri/core/workers/chunks/1f8a0fb32b96e50f5909.js +1 -0
  11. package/assets/esri/core/workers/chunks/{abab3abb8ea7610d9fb8.js → 21e7a88478f5d15e0e71.js} +1 -1
  12. package/assets/esri/core/workers/chunks/24452a26b0c5322c7d2b.js +1 -0
  13. package/assets/esri/core/workers/chunks/25b88787ead0cc44cda4.js +1 -0
  14. package/assets/esri/core/workers/chunks/2649166d1a462c7f8338.js +1 -0
  15. package/assets/esri/core/workers/chunks/2c96771a365f8f70e996.js +1 -0
  16. package/assets/esri/core/workers/chunks/352e7f8d694f3f217a2d.js +1 -0
  17. package/assets/esri/core/workers/chunks/392214a3a1d712eda155.js +1 -0
  18. package/assets/esri/core/workers/chunks/397f15b5bce6838db084.js +1 -0
  19. package/assets/esri/core/workers/chunks/3bf281e979408b9363ed.js +1 -0
  20. package/assets/esri/core/workers/chunks/4edc667148d023b5b5af.js +1 -0
  21. package/assets/esri/core/workers/chunks/51e4f771bfe352967c97.js +1 -0
  22. package/assets/esri/core/workers/chunks/55cd747e06bb59d1a328.js +1 -0
  23. package/assets/esri/core/workers/chunks/5638d95e600ff271c5b1.js +1 -0
  24. package/assets/esri/core/workers/chunks/563d172caa15ea1b510d.js +1108 -0
  25. package/assets/esri/core/workers/chunks/58f088b08e12c5435dbc.js +1 -0
  26. package/assets/esri/core/workers/chunks/5aef1e898618f8dda2c9.js +1 -0
  27. package/assets/esri/core/workers/chunks/608be8ebf772aefc36a5.js +1 -0
  28. package/assets/esri/core/workers/chunks/64df2521b2814d2fb918.js +1 -0
  29. package/assets/esri/core/workers/chunks/65070fb591f6ef8313c3.js +1 -0
  30. package/assets/esri/core/workers/chunks/656ec8a14df0e4b68433.js +1 -0
  31. package/assets/esri/core/workers/chunks/6601fe99d587b9dff3c7.js +1 -0
  32. package/assets/esri/core/workers/chunks/{274e623323e24250ca46.js → 6ac424af4f2825fabceb.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{eb2d6f1ee63b40ae0736.js → 774b655498289b1b36bb.js} +1 -1
  34. package/assets/esri/core/workers/chunks/781bb63af571568358e3.js +1 -0
  35. package/assets/esri/core/workers/chunks/9e54d2cbe42f5552aaca.js +1 -0
  36. package/assets/esri/core/workers/chunks/{f03d62ab7806b68d0b62.js → 9fbf61675e2a5374f754.js} +1 -1
  37. package/assets/esri/core/workers/chunks/a5253543eae1708d11b9.js +1 -0
  38. package/assets/esri/core/workers/chunks/aa9b46bcb75c96731de3.js +1 -0
  39. package/assets/esri/core/workers/chunks/cfb8b6b5e9c21d582cf4.js +1 -0
  40. package/assets/esri/core/workers/chunks/d1b2372084c1e8c60f79.js +1 -0
  41. package/assets/esri/core/workers/chunks/{1c6914ded7db720f7bf7.js → daf6eab5dd198ca9a67b.js} +1 -1
  42. package/assets/esri/core/workers/chunks/e03edeaf3af46495449e.js +1 -0
  43. package/assets/esri/core/workers/chunks/e685214698fbc84276dd.js +1 -0
  44. package/assets/esri/core/workers/chunks/ebb294c82207f3ff9f04.js +1 -0
  45. package/assets/esri/core/workers/chunks/ec20e23aec9370df8a55.js +1 -0
  46. package/assets/esri/core/workers/chunks/{e4da908079417cc2f495.js → ee0c77889059815a31b2.js} +1 -1
  47. package/assets/esri/core/workers/chunks/f68b7bb88c444a7cbbd2.js +1 -0
  48. package/assets/esri/core/workers/chunks/f90bbebd2dc07a77ce09.js +1 -0
  49. package/assets/esri/core/workers/chunks/fa388680ff976a6b30f6.js +1 -0
  50. package/chunks/vec32.js +1 -1
  51. package/interfaces.d.ts +135 -68
  52. package/layers/WFSLayer.js +1 -1
  53. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  54. package/layers/graphics/applyEditsUtils.js +1 -1
  55. package/layers/graphics/editingSupport.js +1 -1
  56. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  57. package/layers/mixins/ArcGISImageService.js +1 -1
  58. package/layers/save/featureLayerUtils.js +1 -1
  59. package/layers/support/arcgisLayers.js +1 -1
  60. package/layers/support/fetchService.js +1 -1
  61. package/layers/support/fromPortalItem.js +1 -1
  62. package/networks/Network.js +1 -1
  63. package/package.json +1 -1
  64. package/portal/Portal.js +1 -1
  65. package/portal/PortalGroup.js +1 -1
  66. package/portal/PortalUser.js +1 -1
  67. package/portal/support/geometryServiceUtils.js +1 -1
  68. package/portal/support/layersLoader.js +1 -1
  69. package/portal/support/loadUtils.js +1 -1
  70. package/portal/support/portalLayers.js +1 -1
  71. package/renderers/visualVariables/SizeVariable.js +1 -1
  72. package/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js +1 -1
  73. package/rest/networks/support/Association.js +1 -1
  74. package/rest/places.js +1 -1
  75. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  76. package/rest/support/ImageSampleParameters.js +1 -1
  77. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  78. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  79. package/support/elevationInfoUtils.js +1 -1
  80. package/support/revision.js +1 -1
  81. package/symbols/cim/cimAnalyzer.js +1 -1
  82. package/symbols/cim/defaultCIMValues.js +1 -1
  83. package/symbols/cim/utils.js +1 -1
  84. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  85. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  86. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  87. package/views/2d/engine/webgl/definitions.js +1 -1
  88. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  89. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  90. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  91. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  92. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  93. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  94. package/views/2d/layers/features/Processor.js +1 -1
  95. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  96. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  97. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  98. package/views/2d/layers/features/schema/processor/VisualVariablesSchema.js +1 -1
  99. package/views/2d/layers/features/sources/strategies/SnapshotLoadStrategy.js +1 -1
  100. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  101. package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
  102. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  103. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  104. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  105. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  106. package/views/3d/layers/SceneLayerView3D.js +1 -1
  107. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  108. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  109. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  110. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  111. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  112. package/views/3d/support/orientedBoundingBox.js +1 -1
  113. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  114. package/views/3d/terrain/OverlayRenderer.js +1 -1
  115. package/views/3d/webgl/RenderNode.js +1 -1
  116. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  117. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  118. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +9 -7
  119. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceConstants.js +5 -0
  120. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +8 -8
  121. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  122. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  123. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  124. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  125. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  126. package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
  127. package/views/draw/DrawGraphicTool.js +1 -1
  128. package/views/draw/DrawOperation.js +1 -1
  129. package/views/draw/drawSurfaces.js +1 -1
  130. package/views/interactive/snapping/SnappingManager.js +1 -1
  131. package/views/interactive/snapping/SnappingOptions.js +1 -1
  132. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  133. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  134. package/views/layers/ImageryTileLayerView.js +1 -1
  135. package/webdoc/support/webdocLoadUtils.js +1 -1
  136. package/webdoc/support/webdocSaveUtils.js +1 -1
  137. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  138. package/widgets/Editor/EditorViewModel.js +1 -1
  139. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  140. package/widgets/Editor/UpdateWorkflow.js +1 -1
  141. package/widgets/Editor/components/FooterActions.js +1 -1
  142. package/widgets/Editor/support/EditorItem.js +1 -1
  143. package/widgets/Editor.js +1 -1
  144. package/widgets/FeatureForm.js +1 -1
  145. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  146. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  147. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  148. package/widgets/FeatureTable.js +1 -1
  149. package/widgets/Features/FeaturesViewModel.js +1 -1
  150. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  151. package/widgets/Print/PrintViewModel.js +1 -1
  152. package/widgets/Print.js +1 -1
  153. package/widgets/Search/support/locatorUtils.js +1 -1
  154. package/widgets/Sketch/SketchViewModel.js +1 -1
  155. package/assets/esri/core/workers/chunks/00b9e92f8df245a83921.js +0 -1
  156. package/assets/esri/core/workers/chunks/02a6c43ec17e7223fac5.js +0 -1
  157. package/assets/esri/core/workers/chunks/02ee044597c89c86b934.js +0 -1
  158. package/assets/esri/core/workers/chunks/05ebb9cec0e1826b283f.js +0 -1
  159. package/assets/esri/core/workers/chunks/143ccb14c9e915dd1412.js +0 -1
  160. package/assets/esri/core/workers/chunks/24649b410b757599a549.js +0 -1
  161. package/assets/esri/core/workers/chunks/24d19abc680b341d13bb.js +0 -1
  162. package/assets/esri/core/workers/chunks/2519b207894132d5ea91.js +0 -1
  163. package/assets/esri/core/workers/chunks/30f9b2a3417cbcfeecca.js +0 -1
  164. package/assets/esri/core/workers/chunks/42ab9c282bb267c3db03.js +0 -1
  165. package/assets/esri/core/workers/chunks/478815fc19b452d8317d.js +0 -1
  166. package/assets/esri/core/workers/chunks/49afeac45250b15b5f36.js +0 -1
  167. package/assets/esri/core/workers/chunks/50bb67f2eeace5d50673.js +0 -1
  168. package/assets/esri/core/workers/chunks/50cdc59426ba859027e2.js +0 -1
  169. package/assets/esri/core/workers/chunks/5401ec9c9fd62dcac6ec.js +0 -1
  170. package/assets/esri/core/workers/chunks/554d86df71821d671d2c.js +0 -1
  171. package/assets/esri/core/workers/chunks/58c5861d060c808813a1.js +0 -1
  172. package/assets/esri/core/workers/chunks/5dbb3ef6fdd25ac632ad.js +0 -1
  173. package/assets/esri/core/workers/chunks/61c4bb58ef9f2d99c75e.js +0 -1
  174. package/assets/esri/core/workers/chunks/6e50220f8e2d392e2855.js +0 -1
  175. package/assets/esri/core/workers/chunks/6fd8047741a0df006ddd.js +0 -1
  176. package/assets/esri/core/workers/chunks/7709248f59520aee6f51.js +0 -1
  177. package/assets/esri/core/workers/chunks/8852a64918caf80fc414.js +0 -1
  178. package/assets/esri/core/workers/chunks/8d119dc0a92ad3612daa.js +0 -1
  179. package/assets/esri/core/workers/chunks/94dfb80ab23dda92918b.js +0 -1
  180. package/assets/esri/core/workers/chunks/9ebbc75ba5c623a322aa.js +0 -1
  181. package/assets/esri/core/workers/chunks/a5babc10f47c24651d15.js +0 -1
  182. package/assets/esri/core/workers/chunks/a74c59cf5d1c4e63a4e1.js +0 -1
  183. package/assets/esri/core/workers/chunks/ada5d6fd70bd3e403442.js +0 -1
  184. package/assets/esri/core/workers/chunks/b95d69d84d60ac9828b9.js +0 -1
  185. package/assets/esri/core/workers/chunks/be562536212360943388.js +0 -1
  186. package/assets/esri/core/workers/chunks/ce823fc2d0e0095f398c.js +0 -1
  187. package/assets/esri/core/workers/chunks/d06d36815c2121484a13.js +0 -1
  188. package/assets/esri/core/workers/chunks/d5f06a7b0ea7951c8dd0.js +0 -1
  189. package/assets/esri/core/workers/chunks/ddc71fe66c7a49082920.js +0 -1
  190. package/assets/esri/core/workers/chunks/de6d54df7ae32694fd70.js +0 -1
  191. package/assets/esri/core/workers/chunks/f13c4b9692dad5802a32.js +0 -1106
  192. package/assets/esri/core/workers/chunks/f1e8f7d1a98b9e207b1b.js +0 -1
  193. package/assets/esri/core/workers/chunks/f9e9675f1c2287231653.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3912,6147],{25228:(e,t,i)=>{i.d(t,{c:()=>y});var r,l=i(41948),s=i(40504),n=i(94360),o=i(1580),a=(i(9456),i(66360),i(72052),i(33600)),c=i(12552),u=i(18996),p=i(28484);let d=r=class extends s.am{static get allTime(){return h}static get empty(){return g}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,i=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,l=e.end?.getTime()??e.end;return t===r&&i===l}expandTo(e,t=p.OX){if(this.isEmpty||this.isAllTime)return this.clone();let i=this.start;i&&(i=(0,n.aU)(i,e,t));let l=this.end;if(l){const i=(0,n.aU)(l,e,t);l=l.getTime()===i.getTime()?i:(0,n.g1)(i,1,e,t)}return new r({start:i,end:l})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,i=this.end?.getTime()??1/0,l=e.start?.getTime()??-1/0,s=e.end?.getTime()??1/0;let n,o;return l>=t&&l<=i?n=l:t>=l&&t<=s&&(n=t),i>=l&&i<=s?o=i:s>=t&&s<=i&&(o=s),null==n||null==o||isNaN(n)||isNaN(o)?r.empty:new r({start:n===-1/0?null:new Date(n),end:o===1/0?null:new Date(o)})}offset(e,t,i=p.OX){if(this.isEmpty||this.isAllTime)return this.clone();const l=new r,{start:s,end:o}=this;return null!=s&&(l.start=(0,n.g1)(s,e,t,i)),null!=o&&(l.end=(0,n.g1)(o,e,t,i)),l}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return h.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:i})}};(0,l._)([(0,o.qq)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,l._)([(0,a.E)("end")],d.prototype,"readEnd",null),(0,l._)([(0,u.G)("end")],d.prototype,"writeEnd",null),(0,l._)([(0,o.qq)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,l._)([(0,o.qq)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,l._)([(0,o.qq)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,l._)([(0,a.E)("start")],d.prototype,"readStart",null),(0,l._)([(0,u.G)("start")],d.prototype,"writeStart",null),d=r=(0,l._)([(0,c.c)("esri.TimeExtent")],d);const h=new d,g=new d({start:void 0,end:void 0}),y=d},8528:(e,t,i)=>{i.d(t,{c:()=>r,g:()=>l});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},48388:(e,t,i)=>{i.r(t),i.d(t,{default:()=>E});var r,l=i(41948),s=(i(60708),i(2600)),n=i(20744),o=i(14628),a=i(26496),c=i(1580),u=(i(9456),i(66360),i(72052),i(12552)),p=i(56156),d=i(95247),h=i(83372),g=i(81436),y=i(25216),w=i(26916),m=i(3116),f=i(80428),v=i(87576);const b=new(i(11712).g)("0/0/0",0,0,0,void 0);let q=r=class extends((0,y.W)((0,m.I)((0,w.G)(g.c)))){constructor(){super(...arguments),this.tileInfo=v.c.create({spatialReference:p.c.WebMercator,size:256}),this.type="base-tile",this.fullExtent=new d.c(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,p.c.WebMercator),this.spatialReference=p.c.WebMercator}getTileBounds(e,t,i,r){const l=r||(0,h.Su)();return b.level=e,b.row=t,b.col=i,b.extent=l,this.tileInfo.updateTileInfo(b),b.extent=void 0,l}fetchTile(e,t,i,r={}){const{signal:l}=r,n=this.getTileUrl(e,t,i),o={responseType:"image",signal:l,query:{...this.refreshParameters}};return(0,s.c)(n??"",o).then((e=>e.data))}async fetchImageBitmapTile(e,t,i,l={}){const{signal:n}=l;if(this.fetchTile!==r.prototype.fetchTile){const r=await this.fetchTile(e,t,i,l);return(0,f.G)(r,e,t,i,n)}const o=this.getTileUrl(e,t,i)??"",a={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:c}=await(0,s.c)(o,a);return(0,f.G)(c,e,t,i,n)}getTileUrl(){throw new n.c("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};(0,l._)([(0,c.qq)({type:v.c})],q.prototype,"tileInfo",void 0),(0,l._)([(0,c.qq)({type:["show","hide"]})],q.prototype,"listMode",void 0),(0,l._)([(0,c.qq)({readOnly:!0,value:"base-tile"})],q.prototype,"type",void 0),(0,l._)([(0,c.qq)({nonNullable:!0})],q.prototype,"fullExtent",void 0),(0,l._)([(0,c.qq)()],q.prototype,"spatialReference",void 0),q=r=(0,l._)([(0,u.c)("esri.layers.BaseTileLayer")],q);const _=q;var T=i(66576),M=i(22108),x=i(67776);const O=new o.O({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"});let S=class extends((0,y.W)((0,T.Y)((0,a.U)(_)))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new v.c({size:[256,256],dpi:96,origin:new x.c({x:-20037508.342787,y:20037508.342787,spatialReference:p.c.WebMercator}),spatialReference:p.c.WebMercator,lods:[new M.c({level:1,resolution:78271.5169639999,scale:295828763.795777}),new M.c({level:2,resolution:39135.7584820001,scale:147914381.897889}),new M.c({level:3,resolution:19567.8792409999,scale:73957190.948944}),new M.c({level:4,resolution:9783.93962049996,scale:36978595.474472}),new M.c({level:5,resolution:4891.96981024998,scale:18489297.737236}),new M.c({level:6,resolution:2445.98490512499,scale:9244648.868618}),new M.c({level:7,resolution:1222.99245256249,scale:4622324.434309}),new M.c({level:8,resolution:611.49622628138,scale:2311162.217155}),new M.c({level:9,resolution:305.748113140558,scale:1155581.108577}),new M.c({level:10,resolution:152.874056570411,scale:577790.554289}),new M.c({level:11,resolution:76.4370282850732,scale:288895.277144}),new M.c({level:12,resolution:38.2185141425366,scale:144447.638572}),new M.c({level:13,resolution:19.1092570712683,scale:72223.819286}),new M.c({level:14,resolution:9.55462853563415,scale:36111.909643}),new M.c({level:15,resolution:4.77731426794937,scale:18055.954822}),new M.c({level:16,resolution:2.38865713397468,scale:9027.977411}),new M.c({level:17,resolution:1.19432856685505,scale:4513.988705}),new M.c({level:18,resolution:.597164283559817,scale:2256.994353}),new M.c({level:19,resolution:.298582141647617,scale:1128.497176}),new M.c({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return null!=this.bingMetadata?this.bingMetadata.copyright:null}get operationalLayerType(){return O.toJSON(this.style)}get bingLogo(){return null!=this.bingMetadata?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then((()=>this._getMetadata()))):this.addResolvingPromise(Promise.reject(new n.c("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||null==this.bingMetadata)return null;const r=this.bingMetadata.resourceSets[0].resources[0],l=r.imageUrlSubdomains[t%r.imageUrlSubdomains.length],s=this._getQuadKey(e,t,i);return r.imageUrl.replace("{subdomain}",l).replace("{quadkey}",s)}async fetchAttributionData(){return this.load().then((()=>null==this.bingMetadata?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map((e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map((e=>({zoomMin:e.zoomMin,zoomMax:e.zoomMax,score:1,bbox:[e.bbox[0],e.bbox[1],e.bbox[2],e.bbox[3]]})))})))}))}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return(0,s.c)(`https://dev.virtualearth.net/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then((e=>{const t=e.data;if(200!==t.statusCode)throw new n.c("bingmapslayer:getmetadata",t.statusDescription);if(this.bingMetadata=t,0===this.bingMetadata.resourceSets.length)throw new n.c("bingmapslayer:getmetadata","no bing resourcesets");if(0===this.bingMetadata.resourceSets[0].resources.length)throw new n.c("bingmapslayer:getmetadata","no bing resources")})).catch((e=>{throw new n.c("bingmapslayer:getmetadata",e.message)}))}_getPortalBingKey(){return(0,s.c)(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then((e=>{if(!e.data.bingKey)throw new n.c("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey})).catch((e=>{throw new n.c("bingmapslayer:getportalbingkey",e.message)}))}_getQuadKey(e,t,i){let r="";for(let l=e;l>0;l--){let e=0;const s=1<<l-1;0!=(i&s)&&(e+=1),0!=(t&s)&&(e+=2),r+=e.toString()}return r}};(0,l._)([(0,c.qq)({json:{read:!1,write:!1},value:null})],S.prototype,"bingMetadata",null),(0,l._)([(0,c.qq)({json:{read:!1,write:!1},value:"bing-maps",readOnly:!0})],S.prototype,"type",void 0),(0,l._)([(0,c.qq)({type:v.c})],S.prototype,"tileInfo",void 0),(0,l._)([(0,c.qq)({type:String,readOnly:!0,json:{read:!1,write:!1}})],S.prototype,"copyright",null),(0,l._)([(0,c.qq)({type:String,json:{write:!1,read:!1}})],S.prototype,"key",void 0),(0,l._)([(0,c.qq)({type:O.apiValues,nonNullable:!0,json:{read:{source:"layerType",reader:O.read}}})],S.prototype,"style",void 0),(0,l._)([(0,c.qq)({type:["BingMapsAerial","BingMapsHybrid","BingMapsRoad"]})],S.prototype,"operationalLayerType",null),(0,l._)([(0,c.qq)({type:String,json:{write:!1,read:!1}})],S.prototype,"culture",void 0),(0,l._)([(0,c.qq)({type:String,json:{write:!1,read:!1}})],S.prototype,"region",void 0),(0,l._)([(0,c.qq)({type:String,json:{write:!0,read:!0}})],S.prototype,"portalUrl",void 0),(0,l._)([(0,c.qq)({type:Boolean,json:{write:!1,read:!1}})],S.prototype,"hasAttributionData",void 0),(0,l._)([(0,c.qq)({type:String,readOnly:!0})],S.prototype,"bingLogo",null),S=(0,l._)([(0,u.c)("esri.layers.BingMapsLayer")],S);const E=S},22108:(e,t,i)=>{i.d(t,{c:()=>u});var r,l=i(41948),s=i(40504),n=i(1580),o=i(53368),a=(i(72052),i(9456),i(12552));let c=r=class extends s.am{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,l._)([(0,n.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,l._)([(0,n.qq)({type:o.Ab,json:{write:!0}})],c.prototype,"level",void 0),(0,l._)([(0,n.qq)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,l._)([(0,n.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,l._)([(0,n.qq)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,l._)([(0,n.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,l._)([(0,n.qq)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=r=(0,l._)([(0,a.c)("esri.layers.support.LOD")],c);const u=c},87576:(e,t,i)=>{i.d(t,{c:()=>M});var r,l=i(41948),s=i(14628),n=i(40504),o=i(24296),a=i(1580),c=i(53368),u=(i(72052),i(9456),i(33600)),p=i(12552),d=i(18996),h=i(67776),g=i(56156),y=i(83372),w=i(60544),m=i(29120),f=i(22108),v=i(11712);const b=new s.O({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let q=r=class extends n.am{static create(e={}){const{resolutionFactor:t=1,scales:i,size:l=256,spatialReference:s=g.c.WebMercator,numLODs:n=24}=e;if(!(0,w.U3)(s)){const e=[];if(i)for(let t=0;t<i.length;t++){const r=i[t];e.push(new f.c({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let i=n-1;i>=0;i--)e.unshift(new f.c({level:i,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new h.c(0,0,s),size:[l,l],spatialReference:s})}const a=(0,w.Nq)(s),c=e.origin?new h.c({x:e.origin.x,y:e.origin.y,spatialReference:s}):new h.c(a?{x:a.origin[0],y:a.origin[1],spatialReference:s}:{x:0,y:0,spatialReference:s}),u=1/(39.37*(0,o.k8)(s)*96),p=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],r=t*u;p.push(new f.c({level:e,scale:t,resolution:r}))}else{let e=(0,w.Eb)(s)?512/l*591657527.5917094:256/l*591657527.591555;const i=Math.ceil(n/t);p.push(new f.c({level:0,scale:e,resolution:e*u}));for(let r=1;r<i;r++){const i=e/2**t,l=i*u;p.push(new f.c({level:r,scale:i,resolution:l})),e=i}}return new r({dpi:96,lods:p,origin:c,size:[l,l],spatialReference:s})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,w.Nq)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return h.c.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const r=[],l=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach((e=>{r.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,l[e.level]=e}))),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let r=0;for(;r<i;r++){const i=t[r],l=t[r+1];if(i<=e)return r;if(l===e)return r+1;if(i>e&&l<e)return r+Math.log(i/e)/Math.log(i/l)}return r}snapScale(e,t=.95){const i=this.scaleToZoom(e);return i%Math.floor(i)>=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,r){const l=this.lodAt(e);if(!l)return null;let s,n;if("number"==typeof t)s=t,n=i;else if((0,w.yK)(t.spatialReference,this.spatialReference))s=t.x,n=t.y,r=i;else{const e=(0,m.yU)(t,this.spatialReference);if(null==e)return null;s=e.x,n=e.y,r=i}const o=l.resolution*this.size[0],a=l.resolution*this.size[1];return r||(r=new v.g(null,0,0,0,(0,y.Su)())),r.level=e,r.row=Math.floor((this.origin.y-n)/a+.001),r.col=Math.floor((s-this.origin.x)/o+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=r.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===r.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const l=e.level-i.level,s=i.resolution*this.size[0]/2**l,n=i.resolution*this.size[1]/2**l;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,y.Su)()),e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*n,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+n}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:r}=i,l=r*this.size[0],s=r*this.size[1];return e[0]=this.origin.x+t.col*l,e[1]=this.origin.y-(t.row+1)*s,e[2]=e[0]+l,e[3]=e[1]+s,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const i=[],l=this.lods.length;for(let e=0;e<l;e++){const r=this.lods[e],l=r.resolution*t;i.push(new f.c({level:r.level,scale:r.scale,resolution:l}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const r=e[i];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};var _,T;(0,l._)([(0,a.qq)({type:Number,json:{write:!0}})],q.prototype,"compressionQuality",void 0),(0,l._)([(0,a.qq)({type:Number,json:{write:!0}})],q.prototype,"dpi",void 0),(0,l._)([(0,a.qq)({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],q.prototype,"format",void 0),(0,l._)([(0,a.qq)({readOnly:!0})],q.prototype,"isWrappable",null),(0,l._)([(0,a.qq)({type:h.c,json:{write:!0}})],q.prototype,"origin",void 0),(0,l._)([(0,u.E)("origin")],q.prototype,"readOrigin",null),(0,l._)([(0,a.qq)({type:[f.c],value:null,json:{write:!0}})],q.prototype,"lods",null),(0,l._)([(0,a.qq)({readOnly:!0})],q.prototype,"scales",void 0),(0,l._)([(0,a.qq)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],q.prototype,"size",void 0),(0,l._)([(0,u.E)("size",["rows","cols"])],q.prototype,"readSize",null),(0,l._)([(0,d.G)("size",{cols:{type:c.Ab},rows:{type:c.Ab}})],q.prototype,"writeSize",null),(0,l._)([(0,a.qq)({type:g.c,json:{write:!0}})],q.prototype,"spatialReference",void 0),q=r=(0,l._)([(0,p.c)("esri.layers.support.TileInfo")],q),(T=(_=q||(q={})).ExtrapolateOptions||(_.ExtrapolateOptions={}))[T.NONE=0]="NONE",T[T.POWER_OF_TWO=1]="POWER_OF_TWO";const M=q},11712:(e,t,i)=>{i.d(t,{g:()=>r});class r{constructor(e,t,i,r,l=void 0){this.id=e,this.level=t,this.row=i,this.col=r,this.extent=l}}},80428:(e,t,i)=>{i.d(t,{E:()=>s,G:()=>n});var r=i(20744),l=i(10860);async function s(e,t,i){let s;try{s=await createImageBitmap(e)}catch(e){throw new r.c("request:server",`Unable to load ${t}`,{url:t,error:e})}return(0,l.wp)(i),s}async function n(e,t,i,s,n){let o;try{o=await createImageBitmap(e)}catch(e){throw new r.c("request:server",`Unable to load tile ${t}/${i}/${s}`,{error:e,level:t,row:i,col:s})}return(0,l.wp)(n),o}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4203],{22156:(e,t,r)=>{r.d(t,{MR:()=>a,qm:()=>n});var i=r(41948),s=r(12552);let o=0;const a=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+o++})}};return t=(0,i._)([(0,s.c)("esri.core.Identifiable")],t),t},n=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:o++})}};return t=(0,i._)([(0,s.c)("esri.core.NumericIdentifiable")],t),t};let l=class extends(a(class{})){};l=(0,i._)([(0,s.c)("esri.core.Identifiable")],l)},26496:(e,t,r)=>{r.d(t,{U:()=>_,S:()=>w});var i=r(41948),s=r(43780),o=r(26784),a=r(62088),n=r(71448);class l{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(n.wh),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new l,r=this._originStores[n.sT.DEFAULTS];r&&r.forEach(((e,r)=>{t.set(r,(0,a.ct)(e),n.sT.DEFAULTS)}));for(let r=n.sT.SERVICE;r<n.wh;r++){const i=this._originStores[r];i&&i.forEach(((i,s)=>{e&&e.has(s)||t.set(s,(0,a.ct)(i),r)}))}return t}get(e,t){const r=void 0===t?this._values:this._originStores[t];return r?r.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,r=n.sT.USER){let i=this._originStores[r];if(i||(i=new Map,this._originStores[r]=i),i.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=r){const i=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),i!==t}return!1}delete(e,t=n.sT.USER){const r=this._originStores[t];if(!r)return;const i=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const t=this._originStores[r];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const r=void 0===t?this._values:this._originStores[t];return!!r&&r.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const r=this._originStores[t],i=r?.get(e),s=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),s!==i}originOf(e){return this._propertyOriginMap.get(e)||n.sT.DEFAULTS}forEach(e){this._values.forEach(e)}}var u=r(47727),p=r(20916),c=r(12552);const d=e=>{let t=class extends e{constructor(...e){super(...e);const t=(0,p.m6)(this),r=t.store,i=new l;t.store=i,(0,o.W)(t,r,i)}read(e,t){(0,u.g)(this,e,t)}getAtOrigin(e,t){const r=h(this),i=(0,n.CQ)(t);if("string"==typeof e)return r.get(e,i);const s={};return e.forEach((e=>{s[e]=r.get(e,i)})),s}originOf(e){return(0,n.Qz)(this.originIdOf(e))}originIdOf(e){return h(this).originOf(e)}revert(e,t){const r=h(this),i=(0,n.CQ)(t),s=(0,p.m6)(this);let o;o="string"==typeof e?"*"===e?r.keys(i):[e]:e,o.forEach((e=>{s.invalidate(e),r.revert(e,i),s.commit(e)}))}};return t=(0,i._)([(0,c.c)("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function h(e){return(0,p.m6)(e).store}let y=class extends(d(s.c)){};y=(0,i._)([(0,c.c)("esri.core.ReadOnlyMultiOriginJSONSupport")],y);var g=r(48424),f=r(31696);const m=e=>{let t=class extends e{constructor(...e){super(...e)}clear(e,t="user"){return v(this).delete(e,(0,n.CQ)(t))}write(e,t){return(0,f.G)(this,e=e||{},t),e}setAtOrigin(e,t,r){(0,p.m6)(this).setAtOrigin(e,t,(0,n.CQ)(r))}removeOrigin(e){const t=v(this),r=(0,n.CQ)(e),i=t.keys(r);for(const e of i)t.originOf(e)===r&&t.set(e,t.get(e,r),n.sT.USER)}updateOrigin(e,t){const r=v(this),i=(0,n.CQ)(t),s=(0,g._M)(this,e);for(let t=i+1;t<n.wh;++t)r.delete(e,t);r.set(e,s,i)}toJSON(e){return this.write({},e)}};return t=(0,i._)([(0,c.c)("esri.core.WriteableMultiOriginJSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function v(e){return(0,p.m6)(e).store}const _=e=>{let t=class extends(m(d(e))){constructor(...e){super(...e)}};return t=(0,i._)([(0,c.c)("esri.core.MultiOriginJSONSupport")],t),t};let w=class extends(_(s.c)){};w=(0,i._)([(0,c.c)("esri.core.MultiOriginJSONSupport")],w)},81436:(e,t,r)=>{r.d(t,{c:()=>_});var i=r(41948),s=(r(60708),r(2600)),o=r(20744),a=r(77860),n=r(22156),l=r(95800),u=r(66360),p=r(10860),c=r(28176),d=r(1580),h=(r(9456),r(72052),r(12552)),y=r(6220),g=r(95247),f=r(56156);let m=0,v=class extends(a.c.EventedMixin((0,n.MR)(l.c))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new g.c(-180,-90,180,90,f.c.WGS84),this.id=Date.now().toString(16)+"-layer-"+m++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=f.c.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(9232).then(r.bind(r,69232))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await r.e(2259).then(r.bind(r,12259));try{return await i(t)}catch(e){const r=t?.portalItem,i=r?.id||"unset",s=r?.portal?.url||y.default.portalUrl;throw u.c.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,p.mA)(e)||u.c.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,c.as)(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.c)(e,{query:{f:"json"},responseType:"json"})).data;throw new o.c("layer:no-attribution-data","Layer does not have attribution data")}};(0,i._)([(0,d.qq)({type:String})],v.prototype,"attributionDataUrl",void 0),(0,i._)([(0,d.qq)({type:g.c})],v.prototype,"fullExtent",void 0),(0,i._)([(0,d.qq)({readOnly:!0})],v.prototype,"hasAttributionData",null),(0,i._)([(0,d.qq)({type:String,clonable:!1})],v.prototype,"id",void 0),(0,i._)([(0,d.qq)({type:Boolean,nonNullable:!0})],v.prototype,"legendEnabled",void 0),(0,i._)([(0,d.qq)({type:["show","hide","hide-children"]})],v.prototype,"listMode",void 0),(0,i._)([(0,d.qq)({type:Number,range:{min:0,max:1},nonNullable:!0})],v.prototype,"opacity",void 0),(0,i._)([(0,d.qq)({clonable:!1})],v.prototype,"parent",void 0),(0,i._)([(0,d.qq)({readOnly:!0})],v.prototype,"parsedUrl",null),(0,i._)([(0,d.qq)({type:Boolean,readOnly:!0})],v.prototype,"persistenceEnabled",void 0),(0,i._)([(0,d.qq)({type:Boolean})],v.prototype,"popupEnabled",void 0),(0,i._)([(0,d.qq)({type:Boolean})],v.prototype,"attributionVisible",void 0),(0,i._)([(0,d.qq)({type:f.c})],v.prototype,"spatialReference",void 0),(0,i._)([(0,d.qq)({type:String})],v.prototype,"title",void 0),(0,i._)([(0,d.qq)({readOnly:!0,json:{read:!1}})],v.prototype,"type",void 0),(0,i._)([(0,d.qq)()],v.prototype,"url",void 0),(0,i._)([(0,d.qq)({type:Boolean,nonNullable:!0})],v.prototype,"visible",void 0),v=(0,i._)([(0,h.c)("esri.layers.Layer")],v);const _=v},56584:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var i=r(41948),s=r(20744),o=r(26496),a=r(66168),n=r(1580),l=(r(9456),r(66360),r(72052),r(12552)),u=r(81436),p=r(98768);let c=class extends((0,p.K)((0,o.U)(u.c))){constructor(e){super(e),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise(((e,t)=>{(0,a.Ow)((()=>{const e=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let r="Unknown layer type";e&&(r+=" "+e),t(new s.c("layer:unknown-layer-type",r,{layerType:e}))}))})))}read(e,t){super.read({resourceInfo:e},t)}write(e,t){return null}};(0,i._)([(0,n.qq)({readOnly:!0})],c.prototype,"resourceInfo",void 0),(0,i._)([(0,n.qq)({type:["show","hide"]})],c.prototype,"listMode",void 0),(0,i._)([(0,n.qq)({json:{read:!1},readOnly:!0,value:"unknown"})],c.prototype,"type",void 0),c=(0,i._)([(0,l.c)("esri.layers.UnknownLayer")],c);const d=c},98768:(e,t,r)=>{r.d(t,{K:()=>I});var i=r(41948),s=r(6220),o=r(47620),a=r(2600),n=r(40196),l=r(20744),u=r(66360),p=r(70680),c=r(10860),d=r(28176),h=r(1580),y=(r(9456),r(72052),r(33600)),g=r(12552),f=r(18996),m=r(71068),v=r(54872),_=r(9764),w=r(53039),b=r(46940);const I=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,p.mG)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new _.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await Promise.all([r.e(8828),r.e(4132)]).then(r.bind(r,94132));return(0,c.wp)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,c.mA)(e)||u.c.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,c.CE)(e),!0))))}async setUserPrivileges(e,t){if(!s.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,c.CE)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=e===r.id;if(i&&r.portal.user)return(0,b.CI)(r);let s,a;if(i)s=r.portal.url;else try{s=await(0,m.mK)(this.url,t)}catch(e){(0,c.CE)(e)}if(!s||!(0,d.Cs)(s,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;a=await(o.id?.getCredential(`${s}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.CE)(e)}if(!a)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(i?await r.reload():(r=new _.default({id:e,portal:{url:s}}),await r.load(t)),r.portal.user)return(0,b.CI)(r)}catch(e){(0,c.CE)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.CE)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?o.id?.findCredential(this.url):null;if(!t)return!0;const r=q.credential===t?q.user:await this._fetchEditingUser(e);return q.credential=t,q.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=o.id.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,s=v.c.getDefault();if(s&&s.loaded&&(0,d.k7)(s.restUrl)===(0,d.k7)(i))return s.user;const l=`${i}/community/self`,u=null!=e?e.signal:null,p=await(0,n.aG)((0,a.c)(l,{authMode:"no-prompt",query:{f:"json"},signal:u}));return p.ok?w.c.fromJSON(p.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||v.c.getDefault());return r&&i&&!(0,d.kF)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.c("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i._)([(0,h.qq)({type:_.default})],t.prototype,"portalItem",null),(0,i._)([(0,y.E)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,i._)([(0,f.G)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,i._)([(0,h.qq)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,i._)([(0,h.qq)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,i._)([(0,h.qq)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,i._)([(0,h.qq)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,i._)([(0,g.c)("esri.layers.mixins.PortalLayer")],t),t},q={credential:null,user:null}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5752,6147],{25228:(e,t,s)=>{s.d(t,{c:()=>f});var i,n=s(41948),r=s(40504),o=s(94360),a=s(1580),l=(s(9456),s(66360),s(72052),s(33600)),u=s(12552),h=s(18996),c=s(28484);let d=i=class extends r.am{static get allTime(){return p}static get empty(){return _}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,s=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===i&&s===n}expandTo(e,t=c.OX){if(this.isEmpty||this.isAllTime)return this.clone();let s=this.start;s&&(s=(0,o.aU)(s,e,t));let n=this.end;if(n){const s=(0,o.aU)(n,e,t);n=n.getTime()===s.getTime()?s:(0,o.g1)(s,1,e,t)}return new i({start:s,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,s=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let o,a;return n>=t&&n<=s?o=n:t>=n&&t<=r&&(o=t),s>=n&&s<=r?a=s:r>=t&&r<=s&&(a=r),null==o||null==a||isNaN(o)||isNaN(a)?i.empty:new i({start:o===-1/0?null:new Date(o),end:a===1/0?null:new Date(a)})}offset(e,t,s=c.OX){if(this.isEmpty||this.isAllTime)return this.clone();const n=new i,{start:r,end:a}=this;return null!=r&&(n.start=(0,o.g1)(r,e,t,s)),null!=a&&(n.end=(0,o.g1)(a,e,t,s)),n}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:s})}};(0,n._)([(0,a.qq)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,n._)([(0,l.E)("end")],d.prototype,"readEnd",null),(0,n._)([(0,h.G)("end")],d.prototype,"writeEnd",null),(0,n._)([(0,a.qq)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,n._)([(0,a.qq)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,n._)([(0,a.qq)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,n._)([(0,l.E)("start")],d.prototype,"readStart",null),(0,n._)([(0,h.G)("start")],d.prototype,"writeStart",null),d=i=(0,n._)([(0,u.c)("esri.TimeExtent")],d);const p=new d,_=new d({start:void 0,end:void 0}),f=d},8528:(e,t,s)=>{s.d(t,{c:()=>i,g:()=>n});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},80424:(e,t,s)=>{var i;s.d(t,{M:()=>i}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(i||(i={}))},3856:(e,t,s)=>{s.d(t,{m:()=>c,q:()=>h});var i=s(41948),n=s(43780),r=(s(9456),s(62088)),o=(s(66360),s(70680)),a=s(71448),l=s(20916),u=s(12552);const h=e=>{let t=class extends e{clone(){const e=(0,l.m6)(this);(0,o.EN)(e,"unable to clone instance of non-accessor class");const t=e.metadata,s=e.store,i={},n=new Map;for(const e in t){const o=t[e],l=s?.originOf(e),u=o.clonable;if(o.readOnly||!1===u||l!==a.sT.USER&&l!==a.sT.DEFAULTS&&l!==a.sT.WEB_MAP&&l!==a.sT.WEB_SCENE)continue;const h=this[e];let c=null;c="function"==typeof u?u(h):"reference"===u?h:(0,r.gx)(h),null!=h&&null==c||(l===a.sT.DEFAULTS?n.set(e,c):i[e]=c)}const u=new(0,Object.getPrototypeOf(this).constructor)(i);if(n.size){const e=(0,l.m6)(u)?.store;if(e)for(const[t,s]of n)e.set(t,s,a.sT.DEFAULTS)}return u}};return t=(0,i._)([(0,u.c)("esri.core.Clonable")],t),t};let c=class extends(h(n.c)){};c=(0,i._)([(0,u.c)("esri.core.Clonable")],c)},11004:(e,t,s)=>{s.d(t,{o:()=>n});var i=s(74452);class n{constructor(e,t){this._storage=new i.kB,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,s=1){this._storage.put(this,e,t,s,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(){}}},74452:(e,t,s)=>{s.d(t,{ML:()=>o,kB:()=>a});var i,n,r=s(24680);(n=i||(i={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,s,i=0){this._storage.put(this,e,t,s,i)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{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._removeFuncs=new r.c,this._users=new r.c}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const s=this._db.get(e.id+t);return s?.size??0}put(e,t,s,n,r){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==s&&this._notifyRemove(t,o.entry,o.size,i.ALL)),n>this._maxSize)return void this._notifyRemove(t,s,n,i.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,s,0,i.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(t,new u(s,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,s,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===s){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,s,n,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.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={},s=new Array;this._db.forEach(((e,i)=>{const n=e.lifetime;s[n]=(s[n]||0)+e.size,this._users.forAll((s=>{const{id:n,name:r}=s;if(i.startsWith(n)){const s=t[r]||0;t[r]=s+e.size}}))}));const i={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[s]||0;t[s]=n,i[s]=Math.round(100*e.hitRate)+"%"}else i[s]="0%"}));const n=Object.keys(t);n.sort(((e,s)=>t[s]-t[e])),n.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+i[s]));for(let t=s.length-1;t>=0;--t){const i=s[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,s,i){let n;return this._removeFuncs.some((r=>{if(e.startsWith(r[0])){const e=r[1](t,i,s);return"number"==typeof e&&(n=e),!0}return!1})),n}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const s=e?.id;let i=!0;for(;i;){i=!1;for(const[n,r]of this._db)if(0===r.lifetime&&(!s||n.startsWith(s))){if(this._purgeItem(n,r,e),t.size<=.9*t.maxSize)return;i||=this._db.has(n)}}for(const[i,n]of this._db)if((!s||i.startsWith(s))&&(this._purgeItem(i,n,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=n&&n>0&&(this._size+=n,s&&(s.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0;class u{constructor(e,t,s){this.entry=e,this.size=t,this.lifetime=s,this.lives=s}}},3024:(e,t,s)=>{s.d(t,{U:()=>o});var i=s(92400),n=s(24680),r=s(85304);class o{constructor(e=9,t){this._compareMinX=h,this._compareMinY=c,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(),v.prune(),w.prune(),E.prune(),x.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(m(e,s))for(v.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;m(e,o)&&(s.leaf?t(r):g(e,o)?this._all(r,t):v.push(r))}s=v.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!m(e,t))return!1;for(v.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(m(e,r)){if(t.leaf||g(e,r))return!0;v.push(n)}}t=v.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),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 I([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(E.clear(),x.clear();s||E.length>0;){if(s||(s=E.pop(),n=E.data[E.length-1],r=x.pop()??0,o=!0),s.leaf&&(t=(0,i.IP)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),E.push(s),this._condense(E),this;o||s.leaf||!g(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(E.push(s),x.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(w.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else w.pushArray(s.children);s=w.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new I(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new T([]);o.height=i;const l=Math.ceil(n/r),u=l*Math.ceil(Math.sqrt(r));y(e,t,s,u,this._compareMinX);for(let n=t;n<=s;n+=u){const t=Math.min(n+u-1,s);y(e,n,t,l,this._compareMinY);for(let s=n;s<=t;s+=l){const n=Math.min(s+l-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=d(o),l=_(e,o)-a;l<n?(n=l,i=a<i?a:i,s=o):l===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);E.clear();const r=this._chooseSubtree(n,this._data,t,E);for(r.children.push(e),u(r,n);t>=0&&E.data[t].children.length>this._maxEntries;)this._split(E,t),t--;this._adjustParentBBoxes(n,E,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),l=s.leaf?new I(o):new T(o);l.height=s.height,a(s,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(s,l)}_splitRoot(e,t){this._data=new T([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,s,this._toBBox),u=f(t,a),h=d(t)+d(a);u<i?(i=u,r=o,n=h<n?h:n):u===i&&h<n&&(n=h,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:h,n=e.leaf?this._compareMinY:c;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=l(e,0,t,n),o=l(e,s-t,s,n);let a=p(r)+p(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=p(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=p(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.IP)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,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 a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,s,i,n){n||(n=new I([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],u(n,e.leaf?i(r):r);return n}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(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 f(e,t){const s=Math.max(e.minX,t.minX),i=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-s)*Math.max(0,r-i)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function m(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const v=new n.c,w=new n.c,E=new n.c,x=new n.c({deallocator:void 0});class b{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class S extends b{constructor(){super(...arguments),this.height=1,this.indexHint=new i.is}}class I extends S{constructor(e){super(),this.children=e,this.leaf=!0}}class T extends S{constructor(e){super(),this.children=e,this.leaf=!1}}},57896:(e,t,s)=>{s.d(t,{Eq:()=>d,KG:()=>m,_8:()=>g,_I:()=>u,aE:()=>l,du:()=>f,on:()=>c}),s(40196),s(2952);var i=s(60976),n=s(38912),r=s(70680),o=s(10860),a=s(37176);function l(e,t,s={}){return h(e,t,s,p)}function u(e,t,s={}){return h(e,t,s,_)}function h(e,t,s={},i){let n=null;const o=s.once?(e,s)=>{i(e)&&((0,r.oR)(n),t(e,s))}:(e,s)=>{i(e)&&t(e,s)};if(n=(0,a.M9)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return n}function c(e,t,s,o={}){let a=null,u=null,h=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.oR)(h),s(e)}const p=l(e,((e,s)=>{c(),(0,i.sh)(e)&&(a=e,u=(0,i.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,n.uU)((()=>{p.remove(),c()})),h}function d(e,t){return function(e,t,s){if((0,o.wv)(s))return Promise.reject((0,o.Uh)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,r.oR)(a)}return new Promise(((i,r)=>{a=(0,n.Ip)([(0,o.wD)(s,(()=>{l(),r((0,o.Uh)())})),h(e,(e=>{l(),i(e)}),{sync:!1,once:!0},t??p)])}))}(e,_,t)}function p(e){return!0}function _(e){return!!e}s(41168);const f={sync:!0},g={initial:!0},m={sync:!0,initial:!0}},60936:(e,t,s)=>{s.d(t,{A:()=>h});var i=s(41948),n=s(43780),r=s(38912),o=s(57896),a=s(66168),l=s(1580),u=s(12552);let h=class extends n.c{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o.aE)}addWhen(e,t,s={}){return this._installWatch(e,t,s,o._I)}addOnCollectionChange(e,t,{initial:s=!1,final:i=!1}={}){const n=++this._handleId;return this.addHandles([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.du),(0,o.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:i?e=>t({added:[],removed:e.toArray()}):void 0})],n),(0,r.uU)((()=>this.removeHandles(n)))}addPromise(e){if(null==e)return e;const t=++this._handleId;this.addHandles((0,r.uU)((()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this.hasHandles(c)||this._set("updating",!1))})),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},i){const n=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,n);const o=i(e,t,s);return this.addHandles(o,n),(0,r.uU)((()=>this.removeHandles(n)))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),i=(0,o.aE)(e,s,{sync:!0,equals:()=>!1});return this.addHandles(i,t),i}_createSyncUpdatingCallback(){return()=>{this.removeHandles(c),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,a.Ow)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(c))})),c)}}};(0,i._)([(0,l.qq)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,i._)([(0,u.c)("esri.core.support.UpdatingHandles")],h);const c=-42},6904:(e,t,s)=>{s.d(t,{c:()=>a});var i=s(9456),n=s(3024),r=s(83372);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.U(9,(0,i.c)("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(((s,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.FZ)();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,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(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()))}}},9107:(e,t,s)=>{s.d(t,{c:()=>_});var i=s(92400),n=s(20744),r=s(77860),o=s(66360),a=s(77048),l=s(83372),u=s(97088),h=s(6904),c=s(83624),d=s(51752);const p=(0,a.Su)();class _{constructor(e){this.geometryInfo=e,this._boundsStore=new h.c,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.c,this.featureAdapter=d.u}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,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,c.C6)(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.G6)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}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 s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.Qv)(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))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):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.C_)(null!=i?i:(0,l.Su)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.C_)((0,l.Su)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},600:(e,t,s)=>{s.d(t,{c:()=>g});var i,n=s(41948),r=s(14628),o=s(40504),a=s(1580),l=s(53368),u=(s(72052),s(9456),s(9968)),h=s(33600),c=s(12552),d=s(89812),p=s(36408);const _=new r.O({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let f=i=class extends o.am{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 s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?.value??null}readValueType(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?_.fromJSON(s.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,n._)([(0,a.qq)({type:String,json:{write:!0}})],f.prototype,"alias",void 0),(0,n._)([(0,a.qq)({type:[String,Number],json:{write:{allowNull:!0}}})],f.prototype,"defaultValue",void 0),(0,n._)([(0,a.qq)()],f.prototype,"description",void 0),(0,n._)([(0,h.E)("description")],f.prototype,"readDescription",null),(0,n._)([(0,a.qq)({types:d.i2,json:{read:{reader:d.h4},write:!0}})],f.prototype,"domain",void 0),(0,n._)([(0,a.qq)({type:Boolean,json:{write:!0}})],f.prototype,"editable",void 0),(0,n._)([(0,a.qq)({type:l.Ab,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],f.prototype,"length",void 0),(0,n._)([(0,a.qq)({type:String,json:{write:!0}})],f.prototype,"name",void 0),(0,n._)([(0,a.qq)({type:Boolean,json:{write:!0}})],f.prototype,"nullable",void 0),(0,n._)([(0,u.G)(p.M)],f.prototype,"type",void 0),(0,n._)([(0,a.qq)()],f.prototype,"valueType",void 0),(0,n._)([(0,h.E)("valueType",["description"])],f.prototype,"readValueType",null),(0,n._)([(0,a.qq)({type:Boolean,json:{read:!1}})],f.prototype,"visible",void 0),f=i=(0,n._)([(0,c.c)("esri.layers.support.Field")],f);const g=f},22108:(e,t,s)=>{s.d(t,{c:()=>h});var i,n=s(41948),r=s(40504),o=s(1580),a=s(53368),l=(s(72052),s(9456),s(12552));let u=i=class extends r.am{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new i({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,o.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"cols",void 0),(0,n._)([(0,o.qq)({type:a.Ab,json:{write:!0}})],u.prototype,"level",void 0),(0,n._)([(0,o.qq)({type:String,json:{write:!0}})],u.prototype,"levelValue",void 0),(0,n._)([(0,o.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"origin",void 0),(0,n._)([(0,o.qq)({type:Number,json:{write:!0}})],u.prototype,"resolution",void 0),(0,n._)([(0,o.qq)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"rows",void 0),(0,n._)([(0,o.qq)({type:Number,json:{write:!0}})],u.prototype,"scale",void 0),u=i=(0,n._)([(0,l.c)("esri.layers.support.LOD")],u);const h=u},87576:(e,t,s)=>{s.d(t,{c:()=>S});var i,n=s(41948),r=s(14628),o=s(40504),a=s(24296),l=s(1580),u=s(53368),h=(s(72052),s(9456),s(33600)),c=s(12552),d=s(18996),p=s(67776),_=s(56156),f=s(83372),g=s(60544),m=s(29120),y=s(22108),v=s(11712);const w=new r.O({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let E=i=class extends o.am{static create(e={}){const{resolutionFactor:t=1,scales:s,size:n=256,spatialReference:r=_.c.WebMercator,numLODs:o=24}=e;if(!(0,g.U3)(r)){const e=[];if(s)for(let t=0;t<s.length;t++){const i=s[t];e.push(new y.c({level:t,scale:i,resolution:i}))}else{let t=5e-4;for(let s=o-1;s>=0;s--)e.unshift(new y.c({level:s,scale:t,resolution:t})),t*=2}return new i({dpi:96,lods:e,origin:new p.c(0,0,r),size:[n,n],spatialReference:r})}const l=(0,g.Nq)(r),u=e.origin?new p.c({x:e.origin.x,y:e.origin.y,spatialReference:r}):new p.c(l?{x:l.origin[0],y:l.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),h=1/(39.37*(0,a.k8)(r)*96),c=[];if(s)for(let e=0;e<s.length;e++){const t=s[e],i=t*h;c.push(new y.c({level:e,scale:t,resolution:i}))}else{let e=(0,g.Eb)(r)?512/n*591657527.5917094:256/n*591657527.591555;const s=Math.ceil(o/t);c.push(new y.c({level:0,scale:e,resolution:e*h}));for(let i=1;i<s;i++){const s=e/2**t,n=s*h;c.push(new y.c({level:i,scale:s,resolution:n})),e=s}}return new i({dpi:96,lods:c,origin:u,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const s=(0,g.Nq)(e);return e.isWrappable&&!!s&&Math.abs(s.origin[0]-t.x)<=s.dx}return!1}readOrigin(e,t){return p.c.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,s=0;const i=[],n=this._levelToLOD={};e&&(t=-1/0,s=1/0,e.forEach((e=>{i.push(e.scale),t=e.scale>t?e.scale:t,s=e.scale<s?e.scale:s,n[e.level]=e}))),this._set("scales",i),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;i<s;i++){const s=t[i],n=t[i+1];if(s<=e)return i;if(n===e)return i+1;if(s>e&&n<e)return i+Math.log(s/e)/Math.log(s/n)}return i}snapScale(e,t=.95){const s=this.scaleToZoom(e);return s%Math.floor(s)>=t?this.zoomToScale(Math.ceil(s)):this.zoomToScale(Math.floor(s))}tileAt(e,t,s,i){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=s;else if((0,g.yK)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,i=s;else{const e=(0,m.yU)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,i=s}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return i||(i=new v.g(null,0,0,0,(0,f.Su)())),i.level=e,i.row=Math.floor((this.origin.y-o)/l+.001),i.col=Math.floor((r-this.origin.x)/a+.001),this.updateTileInfo(i),i}updateTileInfo(e,t=i.ExtrapolateOptions.NONE){let s=this.lodAt(e.level);if(!s&&t===i.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(s=t)}if(!s)return;const n=e.level-s.level,r=s.resolution*this.size[0]/2**n,o=s.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,f.Su)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const s=this.lodAt(t.level);if(null==s)return null;const{resolution:i}=s,n=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return i.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const s=[],n=this.lods.length;for(let e=0;e<n;e++){const i=this.lods[e],n=i.resolution*t;s.push(new y.c({level:i.level,scale:i.scale,resolution:n}))}return new i({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;s<e.length;s++){const i=e[s];this._upsampleLevels[i.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/i.resolution:0},t=i}}};var x,b;(0,n._)([(0,l.qq)({type:Number,json:{write:!0}})],E.prototype,"compressionQuality",void 0),(0,n._)([(0,l.qq)({type:Number,json:{write:!0}})],E.prototype,"dpi",void 0),(0,n._)([(0,l.qq)({type:String,json:{read:w.read,write:w.write,origins:{"web-scene":{read:!1,write:!1}}}})],E.prototype,"format",void 0),(0,n._)([(0,l.qq)({readOnly:!0})],E.prototype,"isWrappable",null),(0,n._)([(0,l.qq)({type:p.c,json:{write:!0}})],E.prototype,"origin",void 0),(0,n._)([(0,h.E)("origin")],E.prototype,"readOrigin",null),(0,n._)([(0,l.qq)({type:[y.c],value:null,json:{write:!0}})],E.prototype,"lods",null),(0,n._)([(0,l.qq)({readOnly:!0})],E.prototype,"scales",void 0),(0,n._)([(0,l.qq)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],E.prototype,"size",void 0),(0,n._)([(0,h.E)("size",["rows","cols"])],E.prototype,"readSize",null),(0,n._)([(0,d.G)("size",{cols:{type:u.Ab},rows:{type:u.Ab}})],E.prototype,"writeSize",null),(0,n._)([(0,l.qq)({type:_.c,json:{write:!0}})],E.prototype,"spatialReference",void 0),E=i=(0,n._)([(0,c.c)("esri.layers.support.TileInfo")],E),x=E||(E={}),(b=x.ExtrapolateOptions||(x.ExtrapolateOptions={}))[b.NONE=0]="NONE",b[b.POWER_OF_TWO=1]="POWER_OF_TWO";const S=E},11712:(e,t,s)=>{s.d(t,{g:()=>i});class i{constructor(e,t,s,i,n=void 0){this.id=e,this.level=t,this.row=s,this.col=i,this.extent=n}}},48212:(e,t,s)=>{s.d(t,{Ab:()=>v,Ej:()=>d,K0:()=>c,M9:()=>p,Wq:()=>f,YB:()=>h,_2:()=>m,oR:()=>g,q_:()=>_,wn:()=>y});var i=s(28176),n=s(91952);const r={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer"},o=Object.values(r),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function h(e){return!!a.test(e)}function c(e){if(null==e)return null;const t=(0,i.as)(e),s=t?.path.match(a)||t?.path.match(l);if(!s)return null;const[,n,o,u,h]=s,c=o.indexOf("/");return{title:p(-1!==c?o.slice(c+1):o),serverType:r[u.toLowerCase()],sublayer:null!=h&&""!==h?parseInt(h,10):null,url:{path:n}}}function d(e){const t=(0,i.as)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function p(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function _(e,t){const s=[];if(e){const t=c(e);null!=t&&t.title&&s.push(t.title)}if(t){const e=p(t);s.push(e)}if(2===s.length){if(s[0].toLowerCase().includes(s[1].toLowerCase()))return s[0];if(s[1].toLowerCase().includes(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function f(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),s=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&s}function g(e,t){return e?(0,i.ai)((0,i.kN)(e,t)):e}function m(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.kN)(t,e.logger);const s=(0,i.as)(t),n=c(s.path);let r;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(r=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=d(s.path);null!=e&&(t=e.serviceUrl,r=e.sublayerId)}return{url:(0,i.ai)(t),layerId:r}}function y(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.kn)(r.url,s,e.layerId.toString()))}function v(e){if(!e)return!1;const t=e.toLowerCase(),s=t.includes("/services/"),i=t.includes("/mapserver/wmsserver"),n=t.includes("/imageserver/wmsserver"),r=t.includes("/wmsserver");return s&&(i||n||r)}},89812:(e,t,s)=>{s.d(t,{h4:()=>S,i2:()=>b}),s(9456);var i,n=s(41948),r=s(62088),o=s(1580),a=(s(66360),s(9968)),l=s(12552),u=s(40504);s(72052);let h=i=class extends u.am{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,n._)([(0,o.qq)({type:String,json:{write:!0}})],h.prototype,"name",void 0),(0,n._)([(0,o.qq)({type:[String,Number],json:{write:!0}})],h.prototype,"code",void 0),h=i=(0,n._)([(0,l.c)("esri.layers.support.CodedValue")],h);const c=new(s(14628).O)({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends u.am{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,o.qq)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,n._)([(0,a.G)(c)],d.prototype,"type",void 0),d=(0,n._)([(0,l.c)("esri.layers.support.Domain")],d);const p=d;var _;let f=_=class extends p{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const s=String(e);this.codedValues.some((e=>(String(e.code)===s&&(t=e.name),!!t)))}return t}clone(){return new _({codedValues:(0,r.ct)(this.codedValues),name:this.name})}};(0,n._)([(0,o.qq)({type:[h],json:{write:!0}})],f.prototype,"codedValues",void 0),(0,n._)([(0,a.G)({codedValue:"coded-value"})],f.prototype,"type",void 0),f=_=(0,n._)([(0,l.c)("esri.layers.support.CodedValueDomain")],f);const g=f;var m;s(20744);let y=m=class extends p{constructor(e){super(e),this.type="inherited"}clone(){return new m}};(0,n._)([(0,a.G)({inherited:"inherited"})],y.prototype,"type",void 0),y=m=(0,n._)([(0,l.c)("esri.layers.support.InheritedDomain")],y);const v=y;var w;let E=w=class extends p{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new w({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,n._)([(0,o.qq)({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,s){t[s]=[this.minValue||0,e]}}}})],E.prototype,"maxValue",void 0),(0,n._)([(0,o.qq)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,s){t[s]=[e,this.maxValue||0]}}}})],E.prototype,"minValue",void 0),(0,n._)([(0,a.G)({range:"range"})],E.prototype,"type",void 0),E=w=(0,n._)([(0,l.c)("esri.layers.support.RangeDomain")],E);const x=E,b={key:"type",base:p,typeMap:{range:E,"coded-value":g,inherited:v}};function S(e){if(!e?.type)return null;switch(e.type){case"range":return x.fromJSON(e);case"codedValue":return g.fromJSON(e);case"inherited":return v.fromJSON(e)}return null}},12780:(e,t,s)=>{s.d(t,{s:()=>r});var i=s(24296),n=s(67932);const r={unknown:1,inches:(0,i.ck)(1,"meters","inches"),feet:(0,i.ck)(1,"meters","feet"),"us-feet":(0,i.ck)(1,"meters","us-feet"),yards:(0,i.ck)(1,"meters","yards"),miles:(0,i.ck)(1,"meters","miles"),"nautical-miles":(0,i.ck)(1,"meters","nautical-miles"),millimeters:(0,i.ck)(1,"meters","millimeters"),centimeters:(0,i.ck)(1,"meters","centimeters"),decimeters:(0,i.ck)(1,"meters","decimeters"),meters:(0,i.ck)(1,"meters","meters"),kilometers:(0,i.ck)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.M9)(1,"meters",n.ug.radius)}},21012:(e,t,s)=>{s.d(t,{M:()=>n});var i=s(37924);function n(e,t,s){if(!s?.features||!s.hasZ)return;const n=(0,i.O)(s.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of s.features)n(e.geometry)}},27136:(e,t,s)=>{s.d(t,{c:()=>w});var i,n=s(41948),r=s(14628),o=s(40504),a=s(70680),l=s(1580),u=(s(9456),s(66360),s(72052),s(33600)),h=s(12552),c=s(18996),d=s(564);let p=i=class extends o.am{constructor(e){super(e)}async collectRequiredFields(e,t){return(0,d.AN)(e,t,this.expression)}clone(){return new i({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,n._)([(0,l.qq)({type:String,json:{write:!0}})],p.prototype,"expression",void 0),(0,n._)([(0,l.qq)({type:String,json:{write:!0}})],p.prototype,"title",void 0),p=i=(0,n._)([(0,h.c)("esri.layers.support.FeatureExpressionInfo")],p);const _=p;var f,g=s(35764);const m=(0,r.w)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new r.O({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let v=f=class extends o.am{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,s,i){t[s]=e.write({},i),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new f({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,a.O4)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,n._)([(0,l.qq)({type:_,json:{write:!0}})],v.prototype,"featureExpressionInfo",void 0),(0,n._)([(0,u.E)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],v.prototype,"readFeatureExpressionInfo",null),(0,n._)([(0,c.G)("featureExpressionInfo",{featureExpressionInfo:{type:_},"featureExpression.value":{type:[0]}})],v.prototype,"writeFeatureExpressionInfo",null),(0,n._)([(0,l.qq)({type:m.apiValues,nonNullable:!0,json:{type:m.jsonValues,read:m.read,write:{writer:m.write,isRequired:!0}}})],v.prototype,"mode",null),(0,n._)([(0,l.qq)({type:Number,json:{write:!0}})],v.prototype,"offset",void 0),(0,n._)([(0,l.qq)({type:g.eA,json:{type:String,read:y.read,write:y.write}})],v.prototype,"unit",null),v=f=(0,n._)([(0,h.c)("esri.layers.support.ElevationInfo")],v);const w=v},35764:(e,t,s)=>{s.d(t,{QV:()=>n,eA:()=>r});var i=s(12780);function n(e){return 1/(i.s[e]||1)}const r=function(){const e=Object.keys(i.s);return e.sort(),e}()},25476:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ee});var i=s(41948),n=(s(60708),s(77860)),r=s(10860),o=s(57896),a=s(1580),l=(s(9456),s(66360)),u=(s(72052),s(12552)),h=s(60936),c=s(56156),d=s(9107),p=s(47302),_=s(87576),f=s(95776),g=s(27136),m=s(11004),y=s(86916),v=s(24296),w=s(35764);function E(e=!1,t){if(e){const{elevationInfo:e,alignPointsInFeatures:s}=t;return new b(e,s)}return new x}class x{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}}class b{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new m.o(1024),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return null==i||"absolute-height"!==i.mode||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(this._alignAbsoluteElevationCandidates(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,t,s){const{offset:i,unit:n}=s;if(null==i)return;const r=(0,v.gl)(t),o=i*((0,w.QV)(n??"meters")/r);for(const t of e)switch(t.type){case"edge":t.start.z+=o,t.end.z+=o;continue;case"vertex":t.target.z+=o;continue}}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const t of e)(0,y.wJ)(i,t.objectId,T).push(t);const[n,o,a]=this._prepareQuery(i,t),l=await this._alignPointsInFeatures(n,s);if((0,r.wp)(s),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(n,l,o);const{drapedObjectIds:u,failedObjectIds:h}=l,c=[];for(const t of e){const{objectId:e}=t;u.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||c.push(t)}return c}_prepareQuery(e,t){const s=[],i=[];for(const[t,n]of e){const e=[];for(const s of n)this._addToQueriesOrCachedResult(t,s.target,e,i),"edge"===s.type&&(this._addToQueriesOrCachedResult(t,s.start,e,i),this._addToQueriesOrCachedResult(t,s.end,e,i));0!==e.length&&s.push({objectId:t,points:e})}return[{spatialReference:t.toJSON(),pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const n=I(e,t),r=this._alignmentsCache.get(n);null==r?s.push(t):i.push(new S(t,r))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},n){for(const e of n)e.apply();let r=0;const o=this._alignmentsCache;for(const{objectId:n,points:a}of e.pointsInFeatures){if(i.has(n)){r+=a.length;continue}const e=!s.has(n);for(const s of a){const i=I(n,s),a=t[r++];s.z=a,e&&o.put(i,a,1)}}}}class S{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function I(e,{x:t,y:s,z:i,spatialReference:n}){return`${e}-${t}-${s}-${i??0}}-wkid:${n?.wkid}`}function T(){return[]}class F{filter(e,t){return t}notifyElevationSourceChange(){}}class C{filter(e,t){const{point:s,distance:i}=e,{z:n}=s;if(null==n)return t;if(0===t.length)return t;const r=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(i),o=this._updateCandidatesTo3D(t,s,r).filter(q);return o.sort(R),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":z(i,t,s);continue;case"vertex":A(i,t,s);continue}return e}}function q(e){return e.distance<=1}function O(e=!1){return e?new C:new F}function z(e,t,{x:s,y:i,z:n}){const{start:r,end:o,target:a}=e;e.draped||function(e,t,s,i){const n=i.x-s.x,r=i.y-s.y,o=i.z-s.z,a=n*n+r*r+o*o,l=(t.x-s.x)*n+(t.y-s.y)*r+o*(t.z-s.z),u=Math.min(1,Math.max(0,l/a)),h=s.x+n*u,c=s.y+r*u,d=s.z+o*u;e.x=h,e.y=c,e.z=d}(a,t,r,o);const l=(t.x-a.x)/s,u=(t.y-a.y)/i,h=(t.z-a.z)/n;e.distance=Math.sqrt(l*l+u*u+h*h)}function A(e,t,{x:s,y:i,z:n}){const{target:r}=e,o=(t.x-r.x)/s,a=(t.y-r.y)/i,l=(t.z-r.z)/n,u=Math.sqrt(o*o+a*a+l*l);e.distance=u}function R(e,t){return e.distance-t.distance}var M=s(62088),B=s(88264);function N(e=!1,t){return e?new j(t):new P}class P{async fetch(){return[]}notifySymbologyChange(){}}class j{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new m.o(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];const s=[],i=[],n=this._candidatesCache;for(const t of e){const e=H(t),r=n.get(e);if(r)for(const e of r)i.push((0,M.ct)(e));else s.push(t),n.put(e,[],1)}if(0===s.length)return i;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(s,t);if((0,r.wp)(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:h}=a;for(let e=0;e<h;++e){const t=a[e],i=H(s[l[e]]),r=n.get(i);r.push(t),n.put(i,r,r.length),u.push((0,M.ct)(t))}return i.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function H(e){switch(e.type){case"vertex":{const{objectId:t,target:s}=e,i=`${t}-vertex-${s.x}-${s.y}-${s.z??0}`;return(0,B.sV)(i).toString()}case"edge":{const{objectId:t,start:s,end:i}=e,n=`${t}-edge-${s.x}-${s.y}-${s.z??0}-to-${i.x}-${i.y}-${i.z??0}`;return(0,B.sV)(n).toString()}default:return""}}var D=s(43780),k=s(92400);let U=class extends D.c{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(e,t){this._pending.push({promise:e,callback:t}),1===this._pending.length&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const e=this._pending[0];e.promise.then((t=>e.callback(t))).catch((()=>{})).then((()=>{this._pending.shift(),this._process()}))}};(0,i._)([(0,a.qq)()],U.prototype,"updating",void 0),U=(0,i._)([(0,u.c)("esri.core.AsyncSequence")],U);var L,V=s(40196),Y=s(38912),X=s(33456),G=s(95247),W=s(83372),J=s(97088),$=s(48212),Q=s(87280),Z=s(32848);class K{constructor(e,t){this.data=e,this.resolution=t,this.state={type:L.CREATED},this.alive=!0}process(e){switch(this.state.type){case L.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case L.FETCH_COUNT:break;case L.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case L.FETCH_FEATURES:break;case L.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case L.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case L.CREATED:case L.FETCH_COUNT:return 0;case L.FETCHED_COUNT:return this.state.featureCount;case L.FETCH_FEATURES:return this.state.previous.featureCount;case L.FETCHED_FEATURES:return this.state.features.length;case L.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case L.CREATED:return"created";case L.FETCH_COUNT:return"fetch-count";case L.FETCHED_COUNT:return"fetched-count";case L.FETCH_FEATURES:return"fetch-features";case L.FETCHED_FEATURES:return"fetched-features";case L.DONE:return"done"}}_gotoFetchCount(e,t){return{type:L.FETCH_COUNT,previous:e,task:(0,V.kn)((async e=>{const s=await(0,V.SO)(t.fetchCount(this,e));this.state.type===L.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,s.ok?s.value:1/0))}))}}_gotoFetchedCount(e,t){return{type:L.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:L.FETCH_FEATURES,previous:e,task:(0,V.kn)((async s=>{const i=await(0,V.SO)(t.fetchFeatures(this,e.featureCount,s));this.state.type===L.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,i.ok?i.value:[]))}))}}_gotoFetchedFeatures(e,t){return{type:L.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:L.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:L.CREATED},e.type){case L.CREATED:case L.FETCHED_COUNT:case L.FETCHED_FEATURES:case L.DONE:break;case L.FETCH_COUNT:case L.FETCH_FEATURES:e.task.abort()}}intersects(e){return null==e||!this.data.extent||((0,W.ER)(e,ee),(0,W.K0)(this.data.extent,ee))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(L||(L={}));const ee=(0,W.Su)();let te=class extends D.c{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=(0,X.SQ)(e,this._mandatoryOutFields);(0,X.yK)(s,t)||(this._set("outFields",s),(0,X.Cs)(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new h.A,this._pendingEdits=new U,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this._updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{(0,k.yK)(e,t,(({id:e},{id:t})=>e===t))||this._process()}),o.du),this.addHandles((0,o._I)((()=>!this.suspended),(()=>this._process())))}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this._pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,e]of this._pendingTiles)e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this._updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this._pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,$.Wq)(this.url))return;const e=(0,V.kn)((async e=>{try{const t=await(0,Z.A7)(this.url,new f.c({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=G.c.fromJSON(t.data?.extent)}catch(e){(0,r.CE)(e),l.c.getLogger(this).warn("Failed to fetch data extent",e)}}));this._updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.addHandles((0,Y.uU)((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:s}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=s,e.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,((e,t)=>this._verifyTileComplexity(e,t)),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,s)=>this._fetchFeatures(e,t,s),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<ne}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const s=this.tileSize*t;return e*(re/(s*s))<oe}_ensureFetchAllCounts(e){let t=!0;for(const[,s]of this._pendingTiles)s.state.type<L.FETCHED_COUNT&&this._updatingHandles.addPromise(s.process(e)),s.state.type<=L.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const s=new K(e,t);return this._pendingTiles.set(e.id,s),s}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:ie,signal:t})}async _fetchFeatures(e,t,s){let i=0;const n=[];let r=0,o=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,i,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,s);l&&(i+=a.num),r+=u.length;for(const e of u)n.push(e);if(o=t-r,!l||!h||o<=0)return n}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,s=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let i=null;if(this.store.featureStore.forEach((n=>{e===n.attributes[t]&&(i=n.objectId??n.attributes[s])})),null==i)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Z.aA)(this.url,e,new Q.g({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,J.w3)(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Z.EL)(this.url,e,s,{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,J.ui)(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,i=(0,X.SQ)((0,X.o1)(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new f.c({returnZ:this.hasZ,returnM:!1,geometry:null!=this.tileInfo&&null!=e?(0,W.WU)(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return null!=s&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:n,tileMaxRecordCount:r,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?f.c.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||n)&&r?r:o||se);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/u)),e.num=Math.min(s,e.maxRecordCountFactor*u)):e.num=Math.min(s,u),!0}};(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"url",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"objectIdField",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"globalIdField",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"capabilities",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"spatialReference",void 0),(0,i._)([(0,a.qq)({constructOnly:!0})],te.prototype,"store",void 0),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"_minimumVerticesPerFeature",null),(0,i._)([(0,a.qq)()],te.prototype,"_mandatoryOutFields",null),(0,i._)([(0,a.qq)()],te.prototype,"outFields",null),(0,i._)([(0,a.qq)()],te.prototype,"suspended",void 0),(0,i._)([(0,a.qq)()],te.prototype,"filter",null),(0,i._)([(0,a.qq)()],te.prototype,"customParameters",null),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"_configuration",null),(0,i._)([(0,a.qq)()],te.prototype,"tileInfo",null),(0,i._)([(0,a.qq)()],te.prototype,"tileSize",null),(0,i._)([(0,a.qq)()],te.prototype,"tilesOfInterest",void 0),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"updating",null),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.qq)({readOnly:!0})],te.prototype,"availability",void 0),(0,i._)([(0,a.qq)()],te.prototype,"hasZ",null),te=(0,i._)([(0,u.c)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],te);const se=2e3,ie=6e5,ne=1e6,re=25,oe=1;var ae=s(33184),le=s(80424),ue=s(6904),he=s(11712);class ce{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(null!=t&&(this._byteSize-=t.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[s,i]of this._store){if(this._byteSize<=e)break;this.delete(s),t(i)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}}let de=class extends D.c{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*le.M.MEGABYTES,this._tileBounds=new ue.c,this._tiles=new ce,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,W.Su)()}add(e,t){for(const e of t)this._referenceFeature(e.objectId);const s=this.featureStore.upsertMany(t),i=s.map((e=>new Set(Object.keys(e.attributes)))).reduce(((e,t)=>(0,X.WR)(e,t)),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map((e=>e.objectId))),function(e){return e.reduce(((e,t)=>e+function(e){return 32+function(e){if(null==e)return 0;const t=(0,ae.qC)(e.lengths,4);return 32+(0,ae.qC)(e.coords,8)+t}(e.geometry)+(0,ae.aC)(e.attributes)}(t)),0)}(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,(e=>this._removeTileStorage(e)))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const n=e.id;this._tiles.set(n,new pe(e,t,s,i)),this._tileBounds.set(n,e.extent),this._tileFeatureCounts.set(n,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const s of e.objectIds)this._unreferenceFeature(s)===ye.REMOVED&&t.push(s);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){const i=(await t(e,s)).features,{hasZ:n,hasM:r}=this.featureStore;for(const e of i){const t=(0,J.C_)(this._tmpBoundingRect,e.geometry,n,r);null!=t&&this._tileBounds.forEachInBounds(t,(t=>{const s=this._tiles.get(t);this.featureStore.add(e);const i=e.objectId;s.objectIds.has(i)||(s.objectIds.add(i),this._referenceFeature(i),this._tileFeatureCounts.set(s.data.id,s.objectIds.size))}))}}process(e,t=(()=>!0),s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,W.K0)((0,W.ER)(this.extent,this._tmpBoundingRect),e.extent))return new fe(e);const i=this.getAttributesForTile(e.id);if((0,X.Cs)(s,i))return new fe(e);const n=this._createTileTree(e,this.tileInfo);return this._simplify(n,t,null,0,1),this._collectMissingTiles(e,n,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map((({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const n=this._tileFeatureCounts.get(e.id);if(null!=n)return n;const r=await(0,Z.WE)(t,s,i);return this._tileFeatureCounts.set(e.id,r.data.count),r.data.count}_createTileTree(e,t){const s=new _e(e.level,e.row,e.col);return t.updateTileInfo(s,_.c.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,(i=>{const n=this._tiles.get(i)?.data;n&&this._tilesAreRelated(e,n)&&this._populateChildren(s,n,t,this._tileFeatureCounts.get(n.id)||0)})),s}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,n=s?t:e,r=1<<n.level-i.level;return Math.floor(n.row/r)===i.row&&Math.floor(n.col/r)===i.col}_populateChildren(e,t,s,i){const n=t.level-e.level-1;if(n<0)return void(e.isLeaf=!0);const r=t.row>>n,o=t.col>>n,a=e.row<<1,l=o-(e.col<<1)+(r-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,s,i);else{const n=new _e(e.level+1,r,o);s.updateTileInfo(n,_.c.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=n,this._populateChildren(n,t,s,i)}}_simplify(e,t,s,i,n){const r=n*n;if(e.isLeaf)return t(this.getFeatureCount(e),n)?0:(this._remove(e),null!=s&&(s.children[i]=null),r);const o=n/2,a=o*o;let l=0;for(let s=0;s<e.children.length;s++){const i=e.children[s];l+=null!=i?this._simplify(i,t,e,s,o):a}return 0===l?this._mergeChildren(e):1-l/r<me&&(this._purge(e),null!=s&&(s.children[i]=null),l=r),l}_mergeChildren(e){const t=new Set;let s,i=0;this._forEachLeaf(e,(e=>{const n=this._tiles.get(e.id);if(n){s=s?(0,X.WR)(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const e of n.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const n=new ge(s,e,this.extent);return this._collectMissingTilesRecurse(t,n,1,i),n.info}_collectMissingTilesRecurse(e,t,s,i){const n=this.getAttributesForTile(e.id),r=n&&!(0,X.Cs)(i,n);if(r&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(r||t.addMissing(e.level,e.row,e.col,s));const o=s/2;for(let s=0;s<e.children.length;s++){const n=e.children[s];null==n?t.addMissing(e.level+1,(e.row<<1)+((2&s)>>1),(e.col<<1)+(1&s),o):this._collectMissingTilesRecurse(n,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?ye.ADDED:ye.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),ye.REMOVED):(t>0&&this._refCounts.set(e,t),ye.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map((e=>`${e.data.id}:[${Array.from(e.objectIds)}]`)),featureReferences:Array.from(this._refCounts.keys()).map((e=>`${e}:${this._refCounts.get(e)}`))}}};(0,i._)([(0,a.qq)({constructOnly:!0})],de.prototype,"featureStore",void 0),(0,i._)([(0,a.qq)()],de.prototype,"tileInfo",void 0),(0,i._)([(0,a.qq)()],de.prototype,"extent",void 0),(0,i._)([(0,a.qq)()],de.prototype,"maximumByteSize",void 0),de=(0,i._)([(0,u.c)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],de);class pe{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}}class _e{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class fe{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,W.wd)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class ge{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new fe(t),null!=s&&(this._extent=(0,W.ER)(s))}addMissing(e,t,s,i){const n=new he.g(null,e,t,s);this._tileInfo.updateTileInfo(n,_.c.ExtrapolateOptions.POWER_OF_TWO),null==n.extent||null!=this._extent&&!(0,W.K0)(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:i}),this.info.coveredArea-=(0,W.wd)(n.extent))}}const me=.18751;var ye;!function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"}(ye||(ye={}));var ve=s(6704);let we=class extends n.c.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=(0,r.qG)(),this._elevationAligner=E(),this._elevationFilter=O(),this._symbologyCandidatesFetcher=N(),this._updatingHandles=new h.A,this._editsUpdatingHandles=new h.A,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return(0,r.wp)(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return(0,r.wp)(t),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:n}=e.serviceInfo,{hasZ:r}=e,a=c.c.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new d.c({...e.serviceInfo,hasZ:r,hasM:!1}),this._queryEngine=new p.U({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:r,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new te({store:new de({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:c.c.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const l="3d"===e.configuration.viewType;return this._elevationAligner=E(l,{elevationInfo:null!=e.elevationInfo?g.c.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=O(l),this.addHandles([(0,o.aE)((()=>this._featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),o.du),(0,o.aE)((()=>this.updating),(()=>this._notifyUpdating()))]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),xe}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.suspended=e,xe}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.outFields=new Set(e??[]),xe}async fetchCandidates(e,t){await this._whenSetup.promise,(0,r.wp)(t);const s=function(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:n,timeExtent:r,objectIds:o}=e.filter,a={geometry:e.filter.geometry?(0,ve.h4)(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:r,objectIds:o,where:n??"1=1"};return{...e,query:a}}(e),i=t?.signal,n=await this._queryEngine.executeQueryForSnapping(s,i);(0,r.wp)(i);const o=await this._elevationAligner.alignCandidates(n.candidates,c.c.fromJSON(e.point.spatialReference)??c.c.WGS84,i);(0,r.wp)(i);const a=await this._symbologyCandidatesFetcher.fetch(o,i);(0,r.wp)(i);const l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(s,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?_.c.fromJSON(e.tileInfo):null,xe}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),this._featureFetcher.refresh(),xe}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t),await(0,o.Eq)((()=>!this.updatingExcludingEdits),t),(0,r.wp)(t),xe}async getDebugInfo(e,t){return(0,r.wp)(t),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,t){this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.wp)(t);const s=(0,r.qG)();return this._pendingApplyEdits.set(e.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),xe}async endApplyEdits(e,t){const s=this._pendingApplyEdits.get(e.id);return s&&s.resolve(e.edits),(0,r.wp)(t),xe}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),xe}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),xe}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=N(e,this._getSymbologyCandidates),xe}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?f.c.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,i._)([(0,a.qq)({readOnly:!0})],we.prototype,"updating",null),(0,i._)([(0,a.qq)({readOnly:!0})],we.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.qq)()],we.prototype,"_isInitializing",void 0),we=(0,i._)([(0,u.c)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],we);const Ee=we,xe={result:{}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[972],{10212:(e,a,t)=>{t.d(a,{S:()=>n});var r=t(4644);function n(e){e?.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:a,newOrigin:t})=>{(0,r.w)(e)&&t&&e.originOf(a)!==t&&e.updateOrigin(a,t)}))}},4644:(e,a,t)=>{function r(e){return e&&"getAtOrigin"in e&&"originOf"in e}t.d(a,{w:()=>r})},70972:(e,a,t)=>{t.d(a,{save:()=>g,saveAs:()=>O});var r=t(92400),n=(t(20744),t(24516)),i=t(48212),s=t(13608),o=t(71068),l=t(83928),u=t(46940);const c="Feature Service",y="feature-layer-utils",d=`${y}-save`,f=`${y}-save-as`;function p(e){return{isValid:(0,o.UB)(e)&&("feature"!==e.type||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function m(e){const a=[],t=[];for(const{layer:r,layerJSON:n}of e)r.isTable?t.push(n):a.push(n);return{layers:a,tables:t}}function w(e){return m([e])}async function h(e,a){return/\/\d+\/?$/.test(e.url)?w(a[0]):async function(e,a){if(e.reverse(),!a)return m(e);const t=await async function(e,a){let t=await e.fetchData("json");if(function(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}(t))return t;t||={},function(e){e.layers||=[],e.tables||=[]}(t);const{layer:{url:r,customParameters:n,apiKey:i}}=a[0];return await async function(e,a,t){const{url:r,customParameters:n,apiKey:i}=a,{serviceJSON:o,layersJSON:u}=await(0,s.I)(r,{customParameters:n,apiKey:i}),c=P(e.layers,o.layers,t),y=P(e.tables,o.tables,t);e.layers=c.itemResources,e.tables=y.itemResources;const d=[...c.added,...y.added],f=u?[...u.layers,...u.tables]:[];await async function(e,a,t,r){const n=await async function(e){const a=[];e.forEach((({type:e})=>{const t=(0,s.w)(e),r=l.q[t];a.push(r())}));const t=await Promise.all(a),r=new Map;return e.forEach((({type:e},a)=>{r.set(e,t[a])})),r}(a),i=a.map((({id:e,type:a})=>new(n.get(a))({url:t,layerId:e,sourceJSON:r.find((({id:a})=>a===e))})));await Promise.allSettled(i.map((e=>e.load()))),i.forEach((a=>{const{layerId:t,loaded:r,defaultPopupTemplate:n}=a;if(!r||null==n)return;const i={id:t,popupInfo:n.toJSON()};"ArcGISFeatureLayer"!==a.operationalLayerType&&(i.layerType=a.operationalLayerType),S(a,i,e)}))}(e,d,r,f)}(t,{url:r??"",customParameters:n,apiKey:i},a.map((e=>e.layer.layerId))),t}(a,e);for(const a of e)S(a.layer,a.layerJSON,t);return function(e,a){const t=[],r=[];for(const{layer:e}of a){const{isTable:a,layerId:n}=e;a?r.push(n):t.push(n)}b(e.layers,t),b(e.tables,r)}(t,e),t}(a,e)}function b(e,a){if(e.length<2)return;const t=[];for(const{id:a}of e)t.push(a);(0,r.yK)(t.sort(L),a.slice().sort(L))&&e.sort(((e,t)=>{const r=a.indexOf(e.id),n=a.indexOf(t.id);return r<n?-1:r>n?1:0}))}function L(e,a){return e<a?-1:e>a?1:0}function P(e,a,t){const n=(0,r.o1)(e,a,((e,a)=>e.id===a.id));e=e.filter((e=>!n.removed.some((a=>a.id===e.id))));const i=n.added;return i.forEach((({id:a})=>{e.push({id:a})})),{itemResources:e,added:i.filter((({id:e})=>!t.includes(e)))}}function S(e,a,t){e.isTable?v(t.tables,a):v(t.layers,a)}function v(e,a){const t=e.findIndex((({id:e})=>e===a.id));-1===t?e.push(a):e[t]=a}async function I(e,a){const{url:t,layerId:r,title:n,fullExtent:s,isTable:o}=e,l=(0,i.K0)(t);a.url="FeatureServer"===l?.serverType?t:`${t}/${r}`,a.title||=n,a.extent=null,o||null==s||(a.extent=await(0,u.oj)(s)),(0,u.KI)(a,u.qk.METADATA),(0,u.KI)(a,u.qk.MULTI_LAYER),(0,u.O2)(a,u.qk.SINGLE_LAYER),o&&(0,u.O2)(a,u.qk.TABLE)}async function g(e,a){return(0,n.eI)({layer:e,itemType:c,validateLayer:p,createItemData:(e,a)=>h(a,[e]),errorNamePrefix:d},a)}async function O(e,a,t){return(0,n.ER)({layer:e,itemType:c,validateLayer:p,createItemData:(e,a)=>Promise.resolve(w(e)),errorNamePrefix:f,newItem:a,setItemProperties:I},t)}},24516:(e,a,t)=>{t.d(a,{ER:()=>P,eI:()=>L});var r=t(20744),n=t(10212),i=t(54872),s=t(9764),o=t(58648),l=t(46940),u=t(4424),c=t(13448);async function y(e){const{layer:a,errorNamePrefix:t,validateLayer:n}=e;await a.load(),function(e,a,t){const n=t(e);if(!n.isValid)throw new r.c(`${a}:invalid-parameters`,n.errorMessage,{layer:e})}(a,t,n)}function d(e,a){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${a}`}function f(e){const{item:a,errorNamePrefix:t,layer:n,validateItem:i}=e;if((0,u.y)(a),function(e){const{item:a,itemType:t,additionalItemType:n,errorNamePrefix:i,layer:s}=e,o=[t];if(n&&o.push(n),!o.includes(a.type)){const e=o.map((e=>`'${e}'`)).join(", ");throw new r.c(`${i}:portal-item-wrong-type`,`Portal item type should be one of: "${e}"`,{item:a,layer:s})}}(e),i){const e=i(a);if(!e.isValid)throw new r.c(`${t}:invalid-parameters`,e.errorMessage,{layer:n})}}function p(e){const{layer:a,errorNamePrefix:t}=e,{portalItem:n}=a;if(!n)throw new r.c(`${t}:portal-item-not-set`,d(a,"requires the portalItem property to be set"));if(!n.loaded)throw new r.c(`${t}:portal-item-not-loaded`,d(a,"cannot be saved to a portal item that does not exist or is inaccessible"));f({...e,item:n})}function m(e){const{newItem:a,itemType:t}=e;let r=s.default.from(a);return r.id&&(r=r.clone(),r.id=null),r.type??=t,r.portal??=i.c.getDefault(),f({...e,item:r}),r}function w(e){return(0,o.a)(e,"portal-item")}async function h(e,a,t){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const r=e.write({},a);return await Promise.all(a.resources?.pendingOperations??[]),(0,c.e)(a,{errorName:"layer-write:unsupported"},t),r}function b(e){(0,l.O2)(e,l.qk.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,a,t)=>t.indexOf(e)===a)))}async function L(e,a){const{layer:t,createItemData:r,createJSONContext:i,saveResources:s,supplementalUnsupportedErrors:o}=e;await y(e),p(e);const l=t.portalItem,u=i?i(l):w(l),c=await h(t,u,{...a,supplementalUnsupportedErrors:o}),d=await r({layer:t,layerJSON:c},l);return b(l),await l.update({data:d}),(0,n.S)(u),await(s?.(l,u)),l}async function P(e,a){const{layer:t,createItemData:r,createJSONContext:i,setItemProperties:s,saveResources:o,supplementalUnsupportedErrors:l}=e;await y(e);const u=m(e),c=i?i(u):w(u),d=await h(t,c,{...a,supplementalUnsupportedErrors:l}),f=await r({layer:t,layerJSON:d},u);return await s(t,u),b(u),await async function(e,a,t){const r=e.portal;await r.signIn(),await(r.user?.addItem({item:e,data:a,folder:t?.folder}))}(u,f,a),t.portalItem=u,(0,n.S)(c),await(o?.(u,c)),u}},13608:(e,a,t)=>{t.d(a,{I:()=>i,w:()=>d});var r=t(66668);const n=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function i(e,a){const{loadContext:t,...n}=a||{},i=t?await t.fetchServiceMetadata(e,n):await(0,r.S)(e,n);y(i),l(i);const s={serviceJSON:i};if((i.currentVersion??0)<10.5)return s;const o=`${e}/layers`,u=t?await t.fetchServiceMetadata(o,n):await(0,r.S)(o,n);return y(u),l(u),s.layersJSON={layers:u.layers,tables:u.tables},s}function s(e){const{type:a}=e;return!!a&&n.has(a)}function o(e){return"Table"===e.type}function l(e){e.layers=e.layers?.filter(s),e.tables=e.tables?.filter(o)}function u(e){e.type||="Feature Layer"}function c(e){e.type||="Table"}function y(e){e.layers?.forEach(u),e.tables?.forEach(c)}function d(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}},83928:(e,a,t)=>{t.d(a,{q:()=>r});const r={BingMapsLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3912)]).then(t.bind(t,48388))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(3180),t.e(9644),t.e(8344),t.e(9420),t.e(7064),t.e(5928)]).then(t.bind(t,10948))).default,CatalogLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(2664),t.e(2848),t.e(5468),t.e(572),t.e(8772)]).then(t.bind(t,20324))).default,CSVLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(2292)]).then(t.bind(t,79468))).default,DimensionLayer:async()=>(await Promise.all([t.e(5612),t.e(7832)]).then(t.bind(t,28320))).default,ElevationLayer:async()=>(await Promise.all([t.e(5612),t.e(2968),t.e(8380)]).then(t.bind(t,47104))).default,FeatureLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(3645)]).then(t.bind(t,672))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(6584)]).then(t.bind(t,92768))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(7988),t.e(5472),t.e(8404)]).then(t.bind(t,43984))).default,GroupLayer:async()=>(await Promise.all([t.e(5612),t.e(7456)]).then(t.bind(t,44080))).default,ImageryLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(2848),t.e(6128),t.e(9884),t.e(2124)]).then(t.bind(t,7896))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(6128),t.e(9884),t.e(7048),t.e(5496)]).then(t.bind(t,82744))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(5612),t.e(9644),t.e(7024)]).then(t.bind(t,96584))).default,KMLLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(236),t.e(1312)]).then(t.bind(t,53688))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(5612),t.e(3536)]).then(t.bind(t,91884))).default,LinkChartLayer:async()=>(await Promise.all([t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(9512),t.e(3220),t.e(1512),t.e(6680),t.e(8080)]).then(t.bind(t,54192))).default,MapImageLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(2848),t.e(5468),t.e(7804),t.e(3089)]).then(t.bind(t,3089))).default,MapNotesLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(8528)]).then(t.bind(t,37784))).default,MediaLayer:async()=>(await Promise.all([t.e(5612),t.e(2364)]).then(t.bind(t,66664))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(4384),t.e(8224)]).then(t.bind(t,56288))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3632),t.e(1244)]).then(t.bind(t,1244))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(2664),t.e(6556),t.e(672),t.e(8640)]).then(t.bind(t,75432))).default,PointCloudLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(9644),t.e(2296)]).then(t.bind(t,21680))).default,RouteLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(236),t.e(8520)]).then(t.bind(t,40900))).default,SceneLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(3180),t.e(9644),t.e(9904),t.e(8344),t.e(9420),t.e(4716),t.e(7064),t.e(712)]).then(t.bind(t,3688))).default,StreamLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(1136)]).then(t.bind(t,18e3))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(2664),t.e(6556),t.e(5368),t.e(8792)]).then(t.bind(t,8444))).default,TileLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(2848),t.e(5468),t.e(2968),t.e(7804),t.e(0)]).then(t.bind(t,5e4))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([t.e(5612),t.e(7752)]).then(t.bind(t,71316))).default,UnknownLayer:async()=>(await t.e(4203).then(t.bind(t,56584))).default,UnsupportedLayer:async()=>(await t.e(2456).then(t.bind(t,12456))).default,VectorTileLayer:async()=>(await Promise.all([t.e(5612),t.e(8980),t.e(2968),t.e(1272),t.e(7936)]).then(t.bind(t,65632))).default,VoxelLayer:async()=>(await Promise.all([t.e(5612),t.e(2692),t.e(9644),t.e(8256)]).then(t.bind(t,59496))).default,WFSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(8980),t.e(5472),t.e(5864),t.e(1744),t.e(5776),t.e(236),t.e(8976),t.e(9512),t.e(4808),t.e(2612)]).then(t.bind(t,53440))).default,WMSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(2692),t.e(7988),t.e(5472),t.e(7052)]).then(t.bind(t,85024))).default,WMTSLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3632),t.e(4832)]).then(t.bind(t,54832))).default,WebTileLayer:async()=>(await Promise.all([t.e(5612),t.e(5156),t.e(3632)]).then(t.bind(t,32896))).default}},58648:(e,a,t)=>{t.d(a,{a:()=>s,s:()=>i});var r=t(28176),n=t(54872);function i(e,a){return{...o(e,a),readResourcePaths:[]}}function s(e,a,t){const n=(0,r.as)(e.itemUrl);return{...o(e,a),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:n?{rootPath:n.path,writtenUrls:[]}:null,resources:t?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function o(e,a){return{origin:a,url:(0,r.as)(e.itemUrl),portal:e.portal||n.c.getDefault(),portalItem:e}}},66668:(e,a,t)=>{t.d(a,{S:()=>n});var r=t(2600);async function n(e,a){const{data:t}=await(0,r.c)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return t}},4424:(e,a,t)=>{t.d(a,{y:()=>s});var r=t(6220),n=t(20744),i=t(20572);function s(e){if(r.default.apiKey&&(0,i.s)(e.portal.url))throw new n.c("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${e.portal.url} when using an api key`)}},13448:(e,a,t)=>{t.d(a,{W:()=>n,e:()=>s});var r=t(20744);async function n(e){const a=[];for(const t of e.allLayers)if("beforeSave"in t&&"function"==typeof t.beforeSave){const e=t.beforeSave();e&&a.push(e)}await Promise.allSettled(a)}const i=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function s(e,a,t){let n=(e.messages??[]).filter((({type:e})=>"error"===e)).map((({name:e,message:a,details:t})=>new r.c(e,a,t)));if(e.blockedRelativeUrls&&(n=n.concat(e.blockedRelativeUrls.map((e=>new r.c("url:unsupported",`Relative url '${e}' is not supported`))))),t){const{ignoreUnsupported:e,supplementalUnsupportedErrors:a=[],requiredPropertyChecksDisabled:r}=t;e&&(n=n.filter((({name:e})=>!(i.has(e)||a.includes(e))))),r&&(n=n.filter((e=>"web-document-write:property-required"!==e.name)))}if(n.length>0)throw new r.c(a.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:n})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6680],{16976:(e,t,r)=>{r.d(t,{c:()=>s});var n=r(41948),o=(r(66360),r(9456),r(72052),r(20744),r(12552)),i=r(59124);let a=class extends i.c{constructor(e){super(e)}};a=(0,n._)([(0,o.c)("esri.rest.knowledgeGraph.EntityType")],a);const s=a},57968:(e,t,r)=>{r.d(t,{c:()=>l});var n=r(41948),o=r(40504),i=r(1580),a=(r(9456),r(66360),r(72052),r(12552));let s=class extends o.am{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"name",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"unique",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"ascending",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"description",void 0),(0,n._)([(0,i.qq)({type:[String],json:{write:!0}})],s.prototype,"fieldNames",void 0),s=(0,n._)([(0,a.c)("esri.rest.knowledgeGraph.FieldIndex")],s);const l=s},59124:(e,t,r)=>{r.d(t,{c:()=>p});var n=r(41948),o=r(40504),i=r(1580),a=(r(9456),r(66360),r(72052),r(12552)),s=r(57968),l=r(83632);let d=class extends o.am{constructor(e){super(e),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null}};(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],d.prototype,"alias",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],d.prototype,"role",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],d.prototype,"strict",void 0),(0,n._)([(0,i.qq)({type:[l.c],json:{write:!0}})],d.prototype,"properties",void 0),(0,n._)([(0,i.qq)({type:[s.c],json:{write:!0}})],d.prototype,"fieldIndexes",void 0),d=(0,n._)([(0,a.c)("esri.rest.knowledgeGraph.GraphObjectType")],d);const p=d},83632:(e,t,r)=>{r.d(t,{c:()=>l});var n=r(41948),o=r(40504),i=r(1580),a=(r(9456),r(66360),r(72052),r(12552));let s=class extends o.am{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"name",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"alias",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"fieldType",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"geometryType",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"hasM",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"hasZ",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"nullable",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"editable",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"required",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"defaultVisibility",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"systemMaintained",void 0),(0,n._)([(0,i.qq)()],s.prototype,"role",void 0),(0,n._)([(0,i.qq)({type:Object,json:{type:String,write:{writer:(e,t)=>{t.defaultValue=null!=e?e.toString():null}}}})],s.prototype,"defaultValue",void 0),s=(0,n._)([(0,a.c)("esri.rest.knowledgeGraph.GraphProperty")],s);const l=s},64640:(e,t,r)=>{r.d(t,{c:()=>l});var n=r(41948),o=r(1580),i=(r(9456),r(66360),r(72052),r(12552)),a=r(59124);let s=class extends a.c{constructor(e){super(e),this.endPoints=[]}};(0,n._)([(0,o.qq)()],s.prototype,"endPoints",void 0),s=(0,n._)([(0,i.c)("esri.rest.knowledgeGraph.RelationshipType")],s);const l=s},76332:(e,t,r)=>{var n,o,i,a,s,l,d;r.d(t,{Kx:()=>l,Oe:()=>a,Qb:()=>s,br:()=>o,cT:()=>d,eU:()=>n,qi:()=>i}),function(e){e[e.Regular=0]="Regular",e[e.Provenance=1]="Provenance",e[e.Document=2]="Document"}(n||(n={})),function(e){e[e.esriFieldTypeSmallInteger=0]="esriFieldTypeSmallInteger",e[e.esriFieldTypeInteger=1]="esriFieldTypeInteger",e[e.esriFieldTypeSingle=2]="esriFieldTypeSingle",e[e.esriFieldTypeDouble=3]="esriFieldTypeDouble",e[e.esriFieldTypeString=4]="esriFieldTypeString",e[e.esriFieldTypeDate=5]="esriFieldTypeDate",e[e.esriFieldTypeOID=6]="esriFieldTypeOID",e[e.esriFieldTypeGeometry=7]="esriFieldTypeGeometry",e[e.esriFieldTypeBlob=8]="esriFieldTypeBlob",e[e.esriFieldTypeRaster=9]="esriFieldTypeRaster",e[e.esriFieldTypeGUID=10]="esriFieldTypeGUID",e[e.esriFieldTypeGlobalID=11]="esriFieldTypeGlobalID",e[e.esriFieldTypeXML=12]="esriFieldTypeXML",e[e.esriFieldTypeBigInteger=13]="esriFieldTypeBigInteger",e[e.esriFieldTypeDateOnly=14]="esriFieldTypeDateOnly",e[e.esriFieldTypeTimeOnly=15]="esriFieldTypeTimeOnly",e[e.esriFieldTypeTimestampOffset=16]="esriFieldTypeTimestampOffset"}(o||(o={})),function(e){e[e.esriGeometryNull=0]="esriGeometryNull",e[e.esriGeometryPoint=1]="esriGeometryPoint",e[e.esriGeometryMultipoint=2]="esriGeometryMultipoint",e[e.esriGeometryPolyline=3]="esriGeometryPolyline",e[e.esriGeometryPolygon=4]="esriGeometryPolygon",e[e.esriGeometryEnvelope=5]="esriGeometryEnvelope",e[e.esriGeometryAny=6]="esriGeometryAny",e[e.esriGeometryMultiPatch=7]="esriGeometryMultiPatch"}(i||(i={})),function(e){e[e.esriMethodHintUNSPECIFIED=0]="esriMethodHintUNSPECIFIED",e[e.esriUUIDESRI=1]="esriUUIDESRI",e[e.esriUUIDRFC4122=2]="esriUUIDRFC4122"}(a||(a={})),function(e){e[e.esriTypeUNSPECIFIED=0]="esriTypeUNSPECIFIED",e[e.esriTypeEntity=1]="esriTypeEntity",e[e.esriTypeRelationship=2]="esriTypeRelationship",e[e.esriTypeBoth=4]="esriTypeBoth"}(s||(s={})),function(e){e[e.esriGraphPropertyUNSPECIFIED=0]="esriGraphPropertyUNSPECIFIED",e[e.esriGraphPropertyRegular=1]="esriGraphPropertyRegular",e[e.esriGraphPropertyDocumentName=2]="esriGraphPropertyDocumentName",e[e.esriGraphPropertyDocumentTitle=3]="esriGraphPropertyDocumentTitle",e[e.esriGraphPropertyDocumentUrl=4]="esriGraphPropertyDocumentUrl",e[e.esriGraphPropertyDocumentText=5]="esriGraphPropertyDocumentText",e[e.esriGraphPropertyDocumentKeywords=6]="esriGraphPropertyDocumentKeywords",e[e.esriGraphPropertyDocumentContentType=7]="esriGraphPropertyDocumentContentType",e[e.esriGraphPropertyDocumentMetadata=8]="esriGraphPropertyDocumentMetadata",e[e.esriGraphPropertyDocumentFileExtension=9]="esriGraphPropertyDocumentFileExtension"}(l||(l={})),function(e){e[e.esriIdentifierInfoTypeUNSPECIFIED=0]="esriIdentifierInfoTypeUNSPECIFIED",e[e.esriIdentifierInfoTypeDatabaseNative=1]="esriIdentifierInfoTypeDatabaseNative",e[e.esriIdentifierInfoTypeUniformProperty=2]="esriIdentifierInfoTypeUniformProperty"}(d||(d={}))},1324:(e,t,r)=>{r.d(t,{gx:()=>l});var n=r(24832),o=r(9456);const i="esri/rest/knowledgeGraph/wasmInterface/";let a,s=null;async function l(){const e=s??a;if(e)return e;const t=(0,o.c)("wasm-simd");return a=d(t),a}async function d(e){if(e){const{default:e}=await r.e(7892).then(r.bind(r,77892)).then((e=>e.a));return e({locateFile:e=>(0,n.O)(i+e)})}const{default:t}=await r.e(296).then(r.bind(r,60296)).then((e=>e.a));return t({locateFile:e=>(0,n.O)(i+e)})}},6680:(e,t,r)=>{r.r(t),r.d(t,{_fetchWrapper:()=>Ge,executeApplyEdits:()=>ge,executeQuery:()=>me,executeQueryStreaming:()=>we,executeSearch:()=>Ee,executeSearchStreaming:()=>qe,fetchKnowledgeGraph:()=>Te,kgRestServices:()=>_e,refreshDataModel:()=>ve,refreshServiceDefinition:()=>Ie}),r(60708);var n=r(47620),o=r(2600),i=r(20744),a=r(66360),s=r(41948),l=r(43780),d=r(1580),p=(r(9456),r(72052),r(12552));let c=class extends l.c{constructor(e){super(e),this.resultRows=[]}};(0,s._)([(0,d.qq)()],c.prototype,"resultRows",void 0),c=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.GraphQueryResult")],c);const u=c;let y=class extends l.c{constructor(e){super(e),this.resultRowsStream=new ReadableStream}};(0,s._)([(0,d.qq)()],y.prototype,"resultRowsStream",void 0),y=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.GraphQueryResult")],y);const h=y;var f=r(40504),_=r(56156),g=r(16976),m=r(64640);let w=class extends f.am{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null}};(0,s._)([(0,d.qq)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e?.getTime()}}}})],w.prototype,"timestamp",void 0),(0,s._)([(0,d.qq)({type:_.c,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],w.prototype,"strict",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],w.prototype,"objectIdField",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],w.prototype,"globalIdField",void 0),(0,s._)([(0,d.qq)()],w.prototype,"arcgisManaged",void 0),(0,s._)([(0,d.qq)()],w.prototype,"identifierInfo",void 0),(0,s._)([(0,d.qq)()],w.prototype,"searchIndexes",void 0),(0,s._)([(0,d.qq)({type:[g.c],json:{write:!0}})],w.prototype,"entityTypes",void 0),(0,s._)([(0,d.qq)({type:[m.c],json:{write:!0}})],w.prototype,"relationshipTypes",void 0),w=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.DataModel")],w);const E=w;let q=class extends f.am{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1}};(0,s._)([(0,d.qq)({type:[String],json:{write:!0}})],q.prototype,"capabilities",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],q.prototype,"supportsSearch",void 0),(0,s._)([(0,d.qq)({type:[String],json:{write:!0}})],q.prototype,"supportedQueryFormats",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],q.prototype,"allowGeometryUpdates",void 0),(0,s._)([(0,d.qq)({type:Number,json:{write:!0}})],q.prototype,"searchMaxRecordCount",void 0),(0,s._)([(0,d.qq)({type:Object,json:{write:!0}})],q.prototype,"serviceCapabilities",void 0),(0,s._)([(0,d.qq)({type:Number,json:{write:!0}})],q.prototype,"maxRecordCount",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],q.prototype,"description",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],q.prototype,"copyrightText",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],q.prototype,"units",void 0),(0,s._)([(0,d.qq)({type:Object,json:{write:!0}})],q.prototype,"spatialReference",void 0),(0,s._)([(0,d.qq)({type:Number,json:{write:!0}})],q.prototype,"currentVersion",void 0),(0,s._)([(0,d.qq)({type:Object,json:{write:!0}})],q.prototype,"dateFieldsTimeReference",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],q.prototype,"serviceItemId",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],q.prototype,"supportsDocuments",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],q.prototype,"dataEditingNotSupported",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],q.prototype,"schemaEditingNotSupported",void 0),q=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.ServiceDefinition")],q);const T=q;let v=class extends f.am{constructor(e){super(e),this.dataModel=null,this.serviceDefinition=null}};(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],v.prototype,"url",void 0),(0,s._)([(0,d.qq)({type:E,json:{write:!0}})],v.prototype,"dataModel",void 0),(0,s._)([(0,d.qq)({type:T,json:{write:!0}})],v.prototype,"serviceDefinition",void 0),v=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.KnowledgeGraph")],v);const I=v;var G=r(1324),R=r(53004),b=r(67776),S=r(7488),x=r(48516),M=r(50853);function O(e,t){const r=new t.ArrayValue;return r.deleteLater(),e.forEach((e=>{r.add_value(j(e,t))})),r}function k(e,t){const r=new t.ObjectValue;r.deleteLater();for(const[n,o]of Object.entries(e))r.set_key_value(n,j(o,t));return r}function P(e,t){if(e instanceof R.c)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=r.geometry_type=t.esriGeometryType.esriGeometryMultipoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let i=0;return e.points.forEach((e=>{e.forEach((e=>{n[i]=e,i++}))})),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);if(e instanceof b.c)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=t.esriGeometryType.esriGeometryPoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let i=2;return e.hasZ&&(n[i]=e.z,i++),e.hasM&&(n[i]=e.m,i++),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);if(e instanceof x.c||e instanceof S.c)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];let i=[];e instanceof x.c?(r.geometry_type=t.esriGeometryType.esriGeometryPolyline,i=e.paths):e instanceof S.c&&(r.geometry_type=t.esriGeometryType.esriGeometryPolygon,i=e.rings);let a=0,s=0;return i.forEach((e=>{let t=0;e.forEach((e=>{t++,e.forEach((e=>{n[s]=e,s++}))})),o[a]=t,a++})),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);throw new i.c("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function j(e,t){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof M.c)return P(e,t);if(Array.isArray(e)){const r=new t.ArrayValue;return r.deleteLater(),e.forEach((e=>{r.add_value(j(e,t))})),r}return k(e,t)}var F=r(8808),D=r(88812);function N(e,t){if(!e.typeName)throw new i.c("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof F.c){const r=new t.EntityValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))r.set_key_value(n,A(o,t));return e.id&&r.set_id(e.id),r}if(e instanceof D.c){const r=new t.RelationshipValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))r.set_key_value(n,A(o,t));return e.id&&r.set_id(e.id),e.originId&&e.destinationId&&r.set_related_entity_ids(e.originId,e.destinationId),r}throw new i.c("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function A(e,t){return null==e?"":"object"!=typeof e||e instanceof Date?e:e instanceof M.c?P(e,t):""}var z=r(57968),C=(r(59124),r(83632));let L=class extends l.c{constructor(e){super(e),this.name=null,this.supportedCategory=null,this.analyzers=[],this.searchProperties=new Map}};(0,s._)([(0,d.qq)()],L.prototype,"name",void 0),(0,s._)([(0,d.qq)()],L.prototype,"supportedCategory",void 0),(0,s._)([(0,d.qq)()],L.prototype,"analyzers",void 0),(0,s._)([(0,d.qq)()],L.prototype,"searchProperties",void 0),L=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.SearchIndex")],L);const U=L;var Y=r(76332);function Q(e){return e.deleteLater(),new g.c(V(e))}function B(e){return e.deleteLater(),new z.c({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:Z(e.fields)})}function V(e){return{name:e.name,alias:e.alias,role:Y.eU[e.role.value]?Y.eU[e.role.value]:null,strict:e.strict,properties:$(e.properties),fieldIndexes:J(e.field_indexes)}}function W(e){return e.deleteLater(),new C.c({alias:e.alias,name:e.name,fieldType:Y.br[e.field_type.value]?Y.br[e.field_type.value]:null,geometryType:Y.qi[e.geometry_type.value]?Y.qi[e.geometry_type.value]:null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:Y.Kx[e.role.value],defaultValue:e.default_value})}function H(e){e.deleteLater();const t=V(e),r=[];for(let t=0;t<e.end_points.size();t++){const n=e.end_points.get(t);r.push({originEntityType:n.origin_entity_type,destinationEntityType:n.dest_entity_type})}return e.end_points.delete(),new m.c(Object.assign({endPoints:r},t))}function K(e){const t=[];for(let r=0;r<e.size();r++)t.push(Q(e.get(r)));return e.delete(),t}function Z(e){const t=[];for(let r=0;r<e.size();r++)t.push(e.get(r));return e.delete(),t}function $(e){const t=[];for(let r=0;r<e.size();r++)t.push(W(e.get(r)));return e.delete(),t}function J(e){const t=[];for(let r=0;r<e.size();r++)t.push(B(e.get(r)));return e.delete(),t}function X(e){const t=[];for(let r=0;r<e.size();r++)t.push(H(e.get(r)));return e.delete(),t}function ee(e){const t=[];for(let r=0;r<e.size();r++){const r=new U,n=e.get(0);r.name=n.name,r.supportedCategory=Y.Qb[n.supported_category.value];const o=n.analyzers.size();for(let e=0;e<o;e++)r.analyzers.push({name:n.analyzers.get(e).name});n.analyzers.delete();for(let e=0;e<n.search_properties.keys().size();e++){const t=n.search_properties.keys().get(e),o=n.search_properties.get(t),i=[];for(let e=0;e<o.property_names.size();e++)i.push(o.property_names.get(e));r.searchProperties.set(t,{propertyNames:i})}t.push(r)}return e.delete(),t}r(14080);var te,re,ne,oe=r(59940),ie=r(87987);function ae(e,t){const r={spatialReference:t},n=se(e,r),o=e.lengths,a=e.coords;let s="";if(e.geometry_type.value===te.ESRI_GEOMETRY_POLYGON)s="rings";else{if(e.geometry_type.value!==te.ESRI_GEOMETRY_POLYLINE)throw new i.c("KnowledgeGraph:illegal-geometry-type","Illegal Geometry type for multipath conversion");s="paths"}r[s]=[];let l=0;return o.forEach((e=>{const t=[];for(let r=0;r<e;r++){const e=[];for(let t=0;t<n;t++)e[t]=a[l],l++;t.push(e)}r[s].push(t)})),r}function se(e,t){let r=2;return e.has_z?(t.hasZ=e.has_z,r++):t.hasZ=!1,e.has_m?(t.hasM=e.has_m,r++):t.hasM=!1,r}!function(e){e[e.ESRI_GEOMETRY_NULL=0]="ESRI_GEOMETRY_NULL",e[e.ESRI_GEOMETRY_POINT=1]="ESRI_GEOMETRY_POINT",e[e.ESRI_GEOMETRY_MULTIPOINT=2]="ESRI_GEOMETRY_MULTIPOINT",e[e.ESRI_GEOMETRY_POLYLINE=3]="ESRI_GEOMETRY_POLYLINE",e[e.ESRI_GEOMETRY_POLYGON=4]="ESRI_GEOMETRY_POLYGON",e[e.ESRI_GEOMETRY_ENVELOPE=5]="ESRI_GEOMETRY_ENVELOPE",e[e.ESRI_GEOMETRY_ANY=6]="ESRI_GEOMETRY_ANY",e[e.ESRI_GEOMETRY_MULTI_PATCH=7]="ESRI_GEOMETRY_MULTI_PATCH"}(te||(te={})),function(e){e[e.OBJECT=0]="OBJECT",e[e.ENTITY=1]="ENTITY",e[e.RELATIONSHIP=2]="RELATIONSHIP",e[e.PATH=3]="PATH",e[e.ARRAY=4]="ARRAY"}(re||(re={})),function(e){e[e.view=0]="view",e[e.edit=1]="edit"}(ne||(ne={}));const le=()=>a.c.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),de={decodedWasmObjToQueryResponseObj:(e,t,r)=>{if(null==e)return null;if("object"!=typeof e)return e;if("getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case te.ESRI_GEOMETRY_POINT:return function(e,t){const r={spatialReference:t};let n=2;se(e,r);const o=e.coords;return r.x=o[0],r.y=o[1],e.has_z&&(r.z=o[n],n++),e.has_m&&(r.m=o[n]),new b.c(r)}(e,r);case te.ESRI_GEOMETRY_MULTIPOINT:return function(e,t){const r={spatialReference:t},n=se(e,r),o=e.lengths,i=e.coords,a=o[0];r.points=[];let s=0;for(let e=0;e<a;e++){const e=[];for(let t=0;t<n;t++)e[t]=i[s],s++;r.points.push(e)}return new R.c(r)}(e,r);case te.ESRI_GEOMETRY_POLYLINE:return function(e,t){return new x.c(ae(e,t))}(e,r);case te.ESRI_GEOMETRY_POLYGON:return function(e,t){return new S.c(ae(e,t))}(e,r);case te.ESRI_GEOMETRY_ENVELOPE:case te.ESRI_GEOMETRY_MULTI_PATCH:return le().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case te.ESRI_GEOMETRY_NULL:case te.ESRI_GEOMETRY_ANY:default:return le().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return le().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case re.OBJECT:return function(e,t,r){return new oe.c(ue(e,t,r))}(e,t,r);case re.ENTITY:return ce(e,t,r);case re.RELATIONSHIP:return ye(e,t,r);case re.PATH:return function(e,t,r){const n=e.entity_count(),o=e.relationship_count(),i=[];for(let a=0;a<n;a++)i.push(ce(e.get_entity_at(a),t,r)),a<o&&i.push(ye(e.get_relationship_at(a),t,r));return new ie.c({path:i})}(e,t,r);case re.ARRAY:return function(e,t,r){const n=[],o=e.count();for(let i=0;i<o;i++){const o=e.get_value_at(i);n.push(pe(o,t,r))}return n}(e,t,r);default:return le().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function pe(e,t,r){return de.decodedWasmObjToQueryResponseObj(e,t,r)}function ce(e,t,r){const n=e.type_name,o=ue(e,t,r),i=e.get_id();return new F.c(Object.assign({typeName:n,id:i},o))}function ue(e,t,r){const n={},o=e.key_count();for(let i=0;i<o;i++)n[e.get_key_at(i)]=pe(e.get_value_at(i),t,r);return{properties:n}}function ye(e,t,r){const n=e.type_name,o=ue(e,t,r);return new D.c(Object.assign({typeName:n,id:e.get_id(),originId:e.get_origin_entity_id(),destinationId:e.get_destination_entity_id()},o))}let he=class extends l.c{constructor(e){super(e),this.hasError=null,this.error=null,this.editResults=[]}};(0,s._)([(0,d.qq)()],he.prototype,"hasError",void 0),(0,s._)([(0,d.qq)()],he.prototype,"error",void 0),(0,s._)([(0,d.qq)()],he.prototype,"editResults",void 0),he=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.GraphApplyEdits")],he);const fe=he,_e={fetchKnowledgeGraph:async e=>{const t=new I({url:e}),r=[];return r.push(ve(t)),r.push(Ie(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await ke(e)},refreshServiceDefinition:async e=>{const t=(await(0,o.c)(e.url,{query:{f:"json"}})).data;return t.capabilities=t?.capabilities?.split(","),t.supportedQueryFormats=t?.supportedQueryFormats?.split(","),e.serviceDefinition=new T(t),e.serviceDefinition},executeQueryStreaming:async(e,t,r)=>{const n=`${e.url}/graph/query`;await Re(e);const o=await xe(n,r);o.data.body=await async function(e,t){const r=await(0,G.gx)(),n=new r.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=r.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[t,o]of Object.entries(e.bindParameters))Se(t,o,n,r);if(e.bindGeometryQuantizationParameters)!function(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await ve(t),4326!==t.dataModel?.spatialReference?.wkid)throw new i.c("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=r.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&function(e,t,r){if(!e.extent)throw new i.c("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new i.c("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new i.c("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);t.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:r.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}(e.outputQuantizationParameters,n,r);try{n.encode()}catch(e){throw new i.c("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:e})}const o=n.get_encoding_result();if(0!==o.error.error_code)throw new i.c("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}(t,e);const a=await Ge(o.data.url,o.data);if(e.dataModel)return new h({resultRowsStream:await Oe(a,e.dataModel,t.outputSpatialReference??void 0)});throw new i.c("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,r)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new i.c("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await Re(e);const o=await xe(n,r);return o.data.body=await async function(e,t){if(t.dataModel||await ve(t),!t.dataModel)throw new i.c("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const r=await(0,G.gx)(),n=!!e.options?.cascadeDelete,o=new r.GraphApplyEditsEncoder(r.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?function(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.options?.inputQuantizationParameters):r.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n;try{let t;e.entityAdds?.forEach((e=>{t=o.add_entity(N(e,r)),be(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")})),e.relationshipAdds?.forEach((e=>{if(!e.originId||!e.destinationId)throw new i.c("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");t=o.add_relationship(N(e,r)),be(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")})),e.entityUpdates?.forEach((e=>{if(!e.id)throw new i.c("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=o.update_entity(N(e,r)),be(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")})),e.relationshipUpdates?.forEach((e=>{if(!e.id)throw new i.c("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=o.update_relationship(N(e,r)),be(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")})),e.entityDeletes?.forEach((e=>{if(!e.typeName)throw new i.c("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=o.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach((e=>{t.delete_by_id(e)}))})),e.relationshipDeletes?.forEach((e=>{if(!e.typeName)throw new i.c("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=o.make_delete_helper(e.typeName,!1);e.ids?.forEach((e=>{t.delete_by_id(e)}))})),o.encode()}catch(e){throw new i.c("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:e})}const a=o.get_encoding_result();return be(a.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(a.get_byte_buffer())}(t,e),async function(e){const t=e.headers.get("content-type");if(t?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),r=new((await(0,G.gx)()).GraphApplyEditsDecoder);return r.deleteLater(),r.decode(new Uint8Array(t)),function(e){const t=new fe;t.hasError=e.has_error(),t.hasError&&(t.error={errorCode:e.error.error_code,errorMessage:e.error.error_message});const r=e.get_edit_results_count();for(let n=0;n<r;n++){const r=e.get_edit_results_at(n),o=e.get_edit_results_type_name_at(n),i=[],a=[],s=[],l=r.get_add_results_count(),d=r.get_update_results_count(),p=r.get_delete_results_count();for(let e=0;e<l;e++){const t=r.get_add_result_at(e);i.push({id:t.id,error:{errorCode:t.error.error_code,errorMessage:t.error.error_message}})}for(let e=0;e<d;e++){const t=r.get_update_result_at(e);a.push({id:t.id,error:{errorCode:t.error.error_code,errorMessage:t.error.error_message}})}for(let e=0;e<p;e++){const t=r.get_delete_result_at(e);s.push({id:t.id,error:{errorCode:t.error.error_code,errorMessage:t.error.error_message}})}t.editResults.push({typeName:o,adds:i,updates:a,deletes:s})}return t}(r)}throw new i.c("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:t,data:e.text()})}(await Ge(o.data.url,o.data))},executeQuery:async(e,t,r)=>{const n=`${e.url}/graph/query`,a=await(0,o.c)(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:t.openCypherQuery,...r?.query},signal:r?.signal,timeout:r?.timeout}),s=a.getHeader?.("content-type"),l=a.data;if(s?.includes("application/x-protobuf")){const t=new((await(0,G.gx)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel)return new u({resultRows:Me(t,l,e.dataModel)});throw new i.c("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.c("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:a.data})},executeSearch:async(e,t,r)=>{const n=t.typeCategoryFilter,a=`${e.url}/graph/search`,s=await(0,o.c)(a,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${t.searchQuery}"`,typeCategoryFilter:n,...r?.query},signal:r?.signal,timeout:r?.timeout}),l=s.getHeader?.("content-type"),d=s.data;if(l?.includes("application/x-protobuf")){const t=new((await(0,G.gx)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel)return new u({resultRows:Me(t,d,e.dataModel)});throw new i.c("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.c("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:l,data:s.data})},executeSearchStreaming:async(e,t,r)=>{const n=`${e.url}/graph/search`;await Re(e);const o=await xe(n,r);o.data.body=await async function(e){const t=await(0,G.gx)(),r=new t.GraphSearchRequestEncoder;if(r.deleteLater(),r.search_query=e.searchQuery,r.type_category_filter=t.esriNamedTypeCategory[e.typeCategoryFilter],!0===e.returnSearchContext&&(r.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(r.start_index=e.start),null!=e.num&&(r.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{r.set_ids_filter(O(e.idsFilter,t))}catch(e){throw new i.c("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:e})}e.namedTypesFilter?.forEach((e=>{r.add_named_type_filter(e)}));try{r.encode()}catch(e){throw new i.c("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:e})}const n=r.get_encoding_result();if(0!==n.error.error_code)throw new i.c("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return structuredClone(n.get_byte_buffer())}(t);const a=await Ge(o.data.url,o.data);if(e.dataModel)return new h({resultRowsStream:await Oe(a,e.dataModel)});throw new i.c("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},_fetchWrapper:async(e,t)=>fetch(e,t)};async function ge(e,t,r){return _e.executeApplyEdits(e,t,r)}async function me(e,t,r){return _e.executeQuery(e,t,r)}async function we(e,t,r){return _e.executeQueryStreaming(e,t,r)}async function Ee(e,t,r){return _e.executeSearch(e,t,r)}async function qe(e,t,r){return _e.executeSearchStreaming(e,t,r)}async function Te(e){return _e.fetchKnowledgeGraph(e)}async function ve(e){return _e.refreshDataModel(e)}async function Ie(e){return _e.refreshServiceDefinition(e)}async function Ge(e,t){return _e._fetchWrapper(e,t)}async function Re(e){const t=n.id?.findCredential(e.url);t||(e.dataModel?await ke(e):await ve(e))}function be(e,t,r){if(0!==e.error_code)throw new i.c(t,r,{errorCode:e.error_code,errorMessage:e.error_message})}function Se(e,t,r,n){null==t?r.set_param_key_value(e,""):"object"!=typeof t||t instanceof Date?r.set_param_key_value(e,t):t instanceof M.c?r.set_param_key_value(e,P(t,n)):t instanceof Array?r.set_param_key_value(e,O(t,n)):r.set_param_key_value(e,k(t,n))}async function xe(e,t){return(0,o.c)(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...t?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:t?.signal,timeout:t?.timeout})}function Me(e,t,r,n=new _.c({wkid:_.c.WGS84.wkid})){e.push_buffer(new Uint8Array(t));const o=[];let a=0;for(;e.next_row();){a||(a=e.get_header_keys().size());const t=new Array(a);for(let o=0;o<a;o++){const i=e.get_value(o);t[o]=pe(i,r,n)}o.push(t)}if(e.has_error())throw new i.c("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return o}async function Oe(e,t,r){const n=e.headers.get("content-type");if(e.headers.get("content-length")&&a.c.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("Found `Content-Length` header when expecting a streaming HTTP response! Please investigate whether all intermediate HTTP proxies and/or load balancers are configured such that they don't forcefully buffer the entire response before returning it to the client. A valid HTTP streaming response should use Chunked Transfer Encoding and not have a Content Length defined."),n?.includes("application/x-protobuf")){const n=e.body?.getReader(),o=new((await(0,G.gx)()).GraphQueryDecoder);return o.deleteLater(),new ReadableStream({async start(e){try{return function a(){return n?.read().then((({done:s,value:l})=>{if(s){let t;if(o.has_error()&&(t=new i.c("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded",{errorCode:o.error.error_code,errorMessage:o.error.error_message})),n.releaseLock(),t)throw e.error(t),t;return void e.close()}const d=Me(o,l,t,r);return d.length>0&&e.enqueue(d),a()}))}()}catch(t){n?.releaseLock(),e.error(new i.c("knowledge-graph:stream-decoding-error","The server returned a valid response, but there was an error decoding the response stream",{error:t})),e.close()}}})}throw new i.c("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:e.text()})}async function ke(e){const t=`${e.url}/dataModel/queryDataModel`,r=await(0,o.c)(t,{responseType:"array-buffer",query:{f:"pbf"}}),n=r.getHeader?.("content-type"),a=r.data;if(n?.includes("application/x-protobuf")){const e=(await(0,G.gx)()).decode_data_model_from_protocol_buffer(new Uint8Array(a));if(!e)throw new i.c("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return function(e){return e.deleteLater(),new E({timestamp:e.timestamp,spatialReference:new _.c(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:Y.cT[e.identifier_info?.identifier_mapping_info?.identifier_info_type?.value],databaseNativeIdentifier:e.identifier_info?.identifier_mapping_info?.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:e.identifier_info?.identifier_mapping_info?.uniform_property_identifier?.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:Y.Oe[e.identifier_info?.identifier_generation_info?.uuid_method_hint?.value]}},searchIndexes:ee(e.search_indexes),entityTypes:K(e.entity_types),relationshipTypes:X(e.relationship_types)})}(e)}throw new i.c("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:r.data})}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6680],{16976:(e,t,r)=>{r.d(t,{c:()=>s});var n=r(41948),o=(r(66360),r(9456),r(72052),r(20744),r(12552)),i=r(59124);let a=class extends i.c{constructor(e){super(e)}};a=(0,n._)([(0,o.c)("esri.rest.knowledgeGraph.EntityType")],a);const s=a},57968:(e,t,r)=>{r.d(t,{c:()=>l});var n=r(41948),o=r(40504),i=r(1580),a=(r(9456),r(66360),r(72052),r(12552));let s=class extends o.am{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"name",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"unique",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"ascending",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"description",void 0),(0,n._)([(0,i.qq)({type:[String],json:{write:!0}})],s.prototype,"fieldNames",void 0),s=(0,n._)([(0,a.c)("esri.rest.knowledgeGraph.FieldIndex")],s);const l=s},59124:(e,t,r)=>{r.d(t,{c:()=>p});var n=r(41948),o=r(40504),i=r(1580),a=(r(9456),r(66360),r(72052),r(12552)),s=r(57968),l=r(83632);let d=class extends o.am{constructor(e){super(e),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null}};(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],d.prototype,"alias",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],d.prototype,"role",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],d.prototype,"strict",void 0),(0,n._)([(0,i.qq)({type:[l.c],json:{write:!0}})],d.prototype,"properties",void 0),(0,n._)([(0,i.qq)({type:[s.c],json:{write:!0}})],d.prototype,"fieldIndexes",void 0),d=(0,n._)([(0,a.c)("esri.rest.knowledgeGraph.GraphObjectType")],d);const p=d},83632:(e,t,r)=>{r.d(t,{c:()=>l});var n=r(41948),o=r(40504),i=r(1580),a=(r(9456),r(66360),r(72052),r(12552));let s=class extends o.am{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"name",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"alias",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"fieldType",void 0),(0,n._)([(0,i.qq)({type:String,json:{write:!0}})],s.prototype,"geometryType",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"hasM",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"hasZ",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"nullable",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"editable",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"required",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"defaultVisibility",void 0),(0,n._)([(0,i.qq)({type:Boolean,json:{write:!0}})],s.prototype,"systemMaintained",void 0),(0,n._)([(0,i.qq)()],s.prototype,"role",void 0),(0,n._)([(0,i.qq)({type:Object,json:{type:String,write:{writer:(e,t)=>{t.defaultValue=null!=e?e.toString():null}}}})],s.prototype,"defaultValue",void 0),s=(0,n._)([(0,a.c)("esri.rest.knowledgeGraph.GraphProperty")],s);const l=s},64640:(e,t,r)=>{r.d(t,{c:()=>l});var n=r(41948),o=r(1580),i=(r(9456),r(66360),r(72052),r(12552)),a=r(59124);let s=class extends a.c{constructor(e){super(e),this.endPoints=[]}};(0,n._)([(0,o.qq)()],s.prototype,"endPoints",void 0),s=(0,n._)([(0,i.c)("esri.rest.knowledgeGraph.RelationshipType")],s);const l=s},76332:(e,t,r)=>{var n,o,i,a,s,l,d;r.d(t,{Kx:()=>l,Oe:()=>a,Qb:()=>s,br:()=>o,cT:()=>d,eU:()=>n,qi:()=>i}),function(e){e[e.Regular=0]="Regular",e[e.Provenance=1]="Provenance",e[e.Document=2]="Document"}(n||(n={})),function(e){e[e.esriFieldTypeSmallInteger=0]="esriFieldTypeSmallInteger",e[e.esriFieldTypeInteger=1]="esriFieldTypeInteger",e[e.esriFieldTypeSingle=2]="esriFieldTypeSingle",e[e.esriFieldTypeDouble=3]="esriFieldTypeDouble",e[e.esriFieldTypeString=4]="esriFieldTypeString",e[e.esriFieldTypeDate=5]="esriFieldTypeDate",e[e.esriFieldTypeOID=6]="esriFieldTypeOID",e[e.esriFieldTypeGeometry=7]="esriFieldTypeGeometry",e[e.esriFieldTypeBlob=8]="esriFieldTypeBlob",e[e.esriFieldTypeRaster=9]="esriFieldTypeRaster",e[e.esriFieldTypeGUID=10]="esriFieldTypeGUID",e[e.esriFieldTypeGlobalID=11]="esriFieldTypeGlobalID",e[e.esriFieldTypeXML=12]="esriFieldTypeXML",e[e.esriFieldTypeBigInteger=13]="esriFieldTypeBigInteger",e[e.esriFieldTypeDateOnly=14]="esriFieldTypeDateOnly",e[e.esriFieldTypeTimeOnly=15]="esriFieldTypeTimeOnly",e[e.esriFieldTypeTimestampOffset=16]="esriFieldTypeTimestampOffset"}(o||(o={})),function(e){e[e.esriGeometryNull=0]="esriGeometryNull",e[e.esriGeometryPoint=1]="esriGeometryPoint",e[e.esriGeometryMultipoint=2]="esriGeometryMultipoint",e[e.esriGeometryPolyline=3]="esriGeometryPolyline",e[e.esriGeometryPolygon=4]="esriGeometryPolygon",e[e.esriGeometryEnvelope=5]="esriGeometryEnvelope",e[e.esriGeometryAny=6]="esriGeometryAny",e[e.esriGeometryMultiPatch=7]="esriGeometryMultiPatch"}(i||(i={})),function(e){e[e.esriMethodHintUNSPECIFIED=0]="esriMethodHintUNSPECIFIED",e[e.esriUUIDESRI=1]="esriUUIDESRI",e[e.esriUUIDRFC4122=2]="esriUUIDRFC4122"}(a||(a={})),function(e){e[e.esriTypeUNSPECIFIED=0]="esriTypeUNSPECIFIED",e[e.esriTypeEntity=1]="esriTypeEntity",e[e.esriTypeRelationship=2]="esriTypeRelationship",e[e.esriTypeBoth=4]="esriTypeBoth"}(s||(s={})),function(e){e[e.esriGraphPropertyUNSPECIFIED=0]="esriGraphPropertyUNSPECIFIED",e[e.esriGraphPropertyRegular=1]="esriGraphPropertyRegular",e[e.esriGraphPropertyDocumentName=2]="esriGraphPropertyDocumentName",e[e.esriGraphPropertyDocumentTitle=3]="esriGraphPropertyDocumentTitle",e[e.esriGraphPropertyDocumentUrl=4]="esriGraphPropertyDocumentUrl",e[e.esriGraphPropertyDocumentText=5]="esriGraphPropertyDocumentText",e[e.esriGraphPropertyDocumentKeywords=6]="esriGraphPropertyDocumentKeywords",e[e.esriGraphPropertyDocumentContentType=7]="esriGraphPropertyDocumentContentType",e[e.esriGraphPropertyDocumentMetadata=8]="esriGraphPropertyDocumentMetadata",e[e.esriGraphPropertyDocumentFileExtension=9]="esriGraphPropertyDocumentFileExtension"}(l||(l={})),function(e){e[e.esriIdentifierInfoTypeUNSPECIFIED=0]="esriIdentifierInfoTypeUNSPECIFIED",e[e.esriIdentifierInfoTypeDatabaseNative=1]="esriIdentifierInfoTypeDatabaseNative",e[e.esriIdentifierInfoTypeUniformProperty=2]="esriIdentifierInfoTypeUniformProperty"}(d||(d={}))},1324:(e,t,r)=>{r.d(t,{gx:()=>l});var n=r(24832),o=r(9456);const i="esri/rest/knowledgeGraph/wasmInterface/";let a,s=null;async function l(){const e=s??a;if(e)return e;const t=(0,o.c)("wasm-simd");return a=d(t),a}async function d(e){if(e){const{default:e}=await r.e(7892).then(r.bind(r,77892)).then((e=>e.a));return e({locateFile:e=>(0,n.O)(i+e)})}const{default:t}=await r.e(296).then(r.bind(r,60296)).then((e=>e.a));return t({locateFile:e=>(0,n.O)(i+e)})}},6680:(e,t,r)=>{r.r(t),r.d(t,{_fetchWrapper:()=>Ge,executeApplyEdits:()=>ge,executeQuery:()=>me,executeQueryStreaming:()=>we,executeSearch:()=>Ee,executeSearchStreaming:()=>qe,fetchKnowledgeGraph:()=>Te,kgRestServices:()=>_e,refreshDataModel:()=>ve,refreshServiceDefinition:()=>Ie}),r(60708);var n=r(47620),o=r(2600),i=r(20744),a=r(66360),s=r(41948),l=r(43780),d=r(1580),p=(r(9456),r(72052),r(12552));let c=class extends l.c{constructor(e){super(e),this.resultRows=[]}};(0,s._)([(0,d.qq)()],c.prototype,"resultRows",void 0),c=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.GraphQueryResult")],c);const u=c;let y=class extends l.c{constructor(e){super(e),this.resultRowsStream=new ReadableStream}};(0,s._)([(0,d.qq)()],y.prototype,"resultRowsStream",void 0),y=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.GraphQueryResult")],y);const h=y;var f=r(40504),_=r(56156),g=r(16976),m=r(64640);let w=class extends f.am{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null}};(0,s._)([(0,d.qq)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e?.getTime()}}}})],w.prototype,"timestamp",void 0),(0,s._)([(0,d.qq)({type:_.c,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],w.prototype,"strict",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],w.prototype,"objectIdField",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],w.prototype,"globalIdField",void 0),(0,s._)([(0,d.qq)()],w.prototype,"arcgisManaged",void 0),(0,s._)([(0,d.qq)()],w.prototype,"identifierInfo",void 0),(0,s._)([(0,d.qq)()],w.prototype,"searchIndexes",void 0),(0,s._)([(0,d.qq)({type:[g.c],json:{write:!0}})],w.prototype,"entityTypes",void 0),(0,s._)([(0,d.qq)({type:[m.c],json:{write:!0}})],w.prototype,"relationshipTypes",void 0),w=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.DataModel")],w);const E=w;let q=class extends f.am{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1}};(0,s._)([(0,d.qq)({type:[String],json:{write:!0}})],q.prototype,"capabilities",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],q.prototype,"supportsSearch",void 0),(0,s._)([(0,d.qq)({type:[String],json:{write:!0}})],q.prototype,"supportedQueryFormats",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],q.prototype,"allowGeometryUpdates",void 0),(0,s._)([(0,d.qq)({type:Number,json:{write:!0}})],q.prototype,"searchMaxRecordCount",void 0),(0,s._)([(0,d.qq)({type:Object,json:{write:!0}})],q.prototype,"serviceCapabilities",void 0),(0,s._)([(0,d.qq)({type:Number,json:{write:!0}})],q.prototype,"maxRecordCount",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],q.prototype,"description",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],q.prototype,"copyrightText",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],q.prototype,"units",void 0),(0,s._)([(0,d.qq)({type:Object,json:{write:!0}})],q.prototype,"spatialReference",void 0),(0,s._)([(0,d.qq)({type:Number,json:{write:!0}})],q.prototype,"currentVersion",void 0),(0,s._)([(0,d.qq)({type:Object,json:{write:!0}})],q.prototype,"dateFieldsTimeReference",void 0),(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],q.prototype,"serviceItemId",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],q.prototype,"supportsDocuments",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],q.prototype,"dataEditingNotSupported",void 0),(0,s._)([(0,d.qq)({type:Boolean,json:{write:!0}})],q.prototype,"schemaEditingNotSupported",void 0),q=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.ServiceDefinition")],q);const T=q;let v=class extends f.am{constructor(e){super(e),this.dataModel=null,this.serviceDefinition=null}};(0,s._)([(0,d.qq)({type:String,json:{write:!0}})],v.prototype,"url",void 0),(0,s._)([(0,d.qq)({type:E,json:{write:!0}})],v.prototype,"dataModel",void 0),(0,s._)([(0,d.qq)({type:T,json:{write:!0}})],v.prototype,"serviceDefinition",void 0),v=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.KnowledgeGraph")],v);const I=v;var G=r(1324),R=r(53004),b=r(67776),S=r(7488),x=r(48516),M=r(50853);function O(e,t){const r=new t.ArrayValue;return r.deleteLater(),e.forEach((e=>{r.add_value(j(e,t))})),r}function k(e,t){const r=new t.ObjectValue;r.deleteLater();for(const[n,o]of Object.entries(e))r.set_key_value(n,j(o,t));return r}function P(e,t){if(e instanceof R.c)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=r.geometry_type=t.esriGeometryType.esriGeometryMultipoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let i=0;return e.points.forEach((e=>{e.forEach((e=>{n[i]=e,i++}))})),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);if(e instanceof b.c)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=t.esriGeometryType.esriGeometryPoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let i=2;return e.hasZ&&(n[i]=e.z,i++),e.hasM&&(n[i]=e.m,i++),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);if(e instanceof x.c||e instanceof S.c)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];let i=[];e instanceof x.c?(r.geometry_type=t.esriGeometryType.esriGeometryPolyline,i=e.paths):e instanceof S.c&&(r.geometry_type=t.esriGeometryType.esriGeometryPolygon,i=e.rings);let a=0,s=0;return i.forEach((e=>{let t=0;e.forEach((e=>{t++,e.forEach((e=>{n[s]=e,s++}))})),o[a]=t,a++})),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);throw new i.c("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function j(e,t){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof M.c)return P(e,t);if(Array.isArray(e)){const r=new t.ArrayValue;return r.deleteLater(),e.forEach((e=>{r.add_value(j(e,t))})),r}return k(e,t)}var F=r(8808),D=r(88812);function N(e,t){if(!e.typeName)throw new i.c("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof F.c){const r=new t.EntityValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))r.set_key_value(n,A(o,t));return e.id&&r.set_id(e.id),r}if(e instanceof D.c){const r=new t.RelationshipValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))r.set_key_value(n,A(o,t));return e.id&&r.set_id(e.id),e.originId&&e.destinationId&&r.set_related_entity_ids(e.originId,e.destinationId),r}throw new i.c("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function A(e,t){return null==e?"":"object"!=typeof e||e instanceof Date?e:e instanceof M.c?P(e,t):""}var z=r(57968),C=(r(59124),r(83632));let L=class extends l.c{constructor(e){super(e),this.name=null,this.supportedCategory=null,this.analyzers=[],this.searchProperties=new Map}};(0,s._)([(0,d.qq)()],L.prototype,"name",void 0),(0,s._)([(0,d.qq)()],L.prototype,"supportedCategory",void 0),(0,s._)([(0,d.qq)()],L.prototype,"analyzers",void 0),(0,s._)([(0,d.qq)()],L.prototype,"searchProperties",void 0),L=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.SearchIndex")],L);const U=L;var Y=r(76332);function Q(e){return e.deleteLater(),new g.c(V(e))}function B(e){return e.deleteLater(),new z.c({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:Z(e.fields)})}function V(e){return{name:e.name,alias:e.alias,role:Y.eU[e.role.value]?Y.eU[e.role.value]:null,strict:e.strict,properties:$(e.properties),fieldIndexes:J(e.field_indexes)}}function W(e){return e.deleteLater(),new C.c({alias:e.alias,name:e.name,fieldType:Y.br[e.field_type.value]?Y.br[e.field_type.value]:null,geometryType:Y.qi[e.geometry_type.value]?Y.qi[e.geometry_type.value]:null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:Y.Kx[e.role.value],defaultValue:e.default_value})}function H(e){e.deleteLater();const t=V(e),r=[];for(let t=0;t<e.end_points.size();t++){const n=e.end_points.get(t);r.push({originEntityType:n.origin_entity_type,destinationEntityType:n.dest_entity_type})}return e.end_points.delete(),new m.c(Object.assign({endPoints:r},t))}function K(e){const t=[];for(let r=0;r<e.size();r++)t.push(Q(e.get(r)));return e.delete(),t}function Z(e){const t=[];for(let r=0;r<e.size();r++)t.push(e.get(r));return e.delete(),t}function $(e){const t=[];for(let r=0;r<e.size();r++)t.push(W(e.get(r)));return e.delete(),t}function J(e){const t=[];for(let r=0;r<e.size();r++)t.push(B(e.get(r)));return e.delete(),t}function X(e){const t=[];for(let r=0;r<e.size();r++)t.push(H(e.get(r)));return e.delete(),t}function ee(e){const t=[];for(let r=0;r<e.size();r++){const r=new U,n=e.get(0);r.name=n.name,r.supportedCategory=Y.Qb[n.supported_category.value];const o=n.analyzers.size();for(let e=0;e<o;e++)r.analyzers.push({name:n.analyzers.get(e).name});n.analyzers.delete();for(let e=0;e<n.search_properties.keys().size();e++){const t=n.search_properties.keys().get(e),o=n.search_properties.get(t),i=[];for(let e=0;e<o.property_names.size();e++)i.push(o.property_names.get(e));r.searchProperties.set(t,{propertyNames:i})}t.push(r)}return e.delete(),t}r(14080);var te,re,ne,oe=r(59940),ie=r(87987);function ae(e,t){const r={spatialReference:t},n=se(e,r),o=e.lengths,a=e.coords;let s="";if(e.geometry_type.value===te.ESRI_GEOMETRY_POLYGON)s="rings";else{if(e.geometry_type.value!==te.ESRI_GEOMETRY_POLYLINE)throw new i.c("KnowledgeGraph:illegal-geometry-type","Illegal Geometry type for multipath conversion");s="paths"}r[s]=[];let l=0;return o.forEach((e=>{const t=[];for(let r=0;r<e;r++){const e=[];for(let t=0;t<n;t++)e[t]=a[l],l++;t.push(e)}r[s].push(t)})),r}function se(e,t){let r=2;return e.has_z?(t.hasZ=e.has_z,r++):t.hasZ=!1,e.has_m?(t.hasM=e.has_m,r++):t.hasM=!1,r}!function(e){e[e.ESRI_GEOMETRY_NULL=0]="ESRI_GEOMETRY_NULL",e[e.ESRI_GEOMETRY_POINT=1]="ESRI_GEOMETRY_POINT",e[e.ESRI_GEOMETRY_MULTIPOINT=2]="ESRI_GEOMETRY_MULTIPOINT",e[e.ESRI_GEOMETRY_POLYLINE=3]="ESRI_GEOMETRY_POLYLINE",e[e.ESRI_GEOMETRY_POLYGON=4]="ESRI_GEOMETRY_POLYGON",e[e.ESRI_GEOMETRY_ENVELOPE=5]="ESRI_GEOMETRY_ENVELOPE",e[e.ESRI_GEOMETRY_ANY=6]="ESRI_GEOMETRY_ANY",e[e.ESRI_GEOMETRY_MULTI_PATCH=7]="ESRI_GEOMETRY_MULTI_PATCH"}(te||(te={})),function(e){e[e.OBJECT=0]="OBJECT",e[e.ENTITY=1]="ENTITY",e[e.RELATIONSHIP=2]="RELATIONSHIP",e[e.PATH=3]="PATH",e[e.ARRAY=4]="ARRAY"}(re||(re={})),function(e){e[e.view=0]="view",e[e.edit=1]="edit"}(ne||(ne={}));const le=()=>a.c.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),de={decodedWasmObjToQueryResponseObj:(e,t,r)=>{if(null==e)return null;if("object"!=typeof e)return e;if("getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case te.ESRI_GEOMETRY_POINT:return function(e,t){const r={spatialReference:t};let n=2;se(e,r);const o=e.coords;return r.x=o[0],r.y=o[1],e.has_z&&(r.z=o[n],n++),e.has_m&&(r.m=o[n]),new b.c(r)}(e,r);case te.ESRI_GEOMETRY_MULTIPOINT:return function(e,t){const r={spatialReference:t},n=se(e,r),o=e.lengths,i=e.coords,a=o[0];r.points=[];let s=0;for(let e=0;e<a;e++){const e=[];for(let t=0;t<n;t++)e[t]=i[s],s++;r.points.push(e)}return new R.c(r)}(e,r);case te.ESRI_GEOMETRY_POLYLINE:return function(e,t){return new x.c(ae(e,t))}(e,r);case te.ESRI_GEOMETRY_POLYGON:return function(e,t){return new S.c(ae(e,t))}(e,r);case te.ESRI_GEOMETRY_ENVELOPE:case te.ESRI_GEOMETRY_MULTI_PATCH:return le().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case te.ESRI_GEOMETRY_NULL:case te.ESRI_GEOMETRY_ANY:default:return le().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return le().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case re.OBJECT:return function(e,t,r){return new oe.c(ue(e,t,r))}(e,t,r);case re.ENTITY:return ce(e,t,r);case re.RELATIONSHIP:return ye(e,t,r);case re.PATH:return function(e,t,r){const n=e.entity_count(),o=e.relationship_count(),i=[];for(let a=0;a<n;a++)i.push(ce(e.get_entity_at(a),t,r)),a<o&&i.push(ye(e.get_relationship_at(a),t,r));return new ie.c({path:i})}(e,t,r);case re.ARRAY:return function(e,t,r){const n=[],o=e.count();for(let i=0;i<o;i++){const o=e.get_value_at(i);n.push(pe(o,t,r))}return n}(e,t,r);default:return le().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function pe(e,t,r){return de.decodedWasmObjToQueryResponseObj(e,t,r)}function ce(e,t,r){const n=e.type_name,o=ue(e,t,r),i=e.get_id();return new F.c(Object.assign({typeName:n,id:i},o))}function ue(e,t,r){const n={},o=e.key_count();for(let i=0;i<o;i++)n[e.get_key_at(i)]=pe(e.get_value_at(i),t,r);return{properties:n}}function ye(e,t,r){const n=e.type_name,o=ue(e,t,r);return new D.c(Object.assign({typeName:n,id:e.get_id(),originId:e.get_origin_entity_id(),destinationId:e.get_destination_entity_id()},o))}let he=class extends l.c{constructor(e){super(e),this.hasError=null,this.error=null,this.editResults=[]}};(0,s._)([(0,d.qq)()],he.prototype,"hasError",void 0),(0,s._)([(0,d.qq)()],he.prototype,"error",void 0),(0,s._)([(0,d.qq)()],he.prototype,"editResults",void 0),he=(0,s._)([(0,p.c)("esri.rest.knowledgeGraph.GraphApplyEdits")],he);const fe=he,_e={fetchKnowledgeGraph:async e=>{const t=new I({url:e}),r=[];return r.push(ve(t)),r.push(Ie(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await ke(e)},refreshServiceDefinition:async e=>{const t=(await(0,o.c)(e.url,{query:{f:"json"}})).data;return t.capabilities=t?.capabilities?.split(","),t.supportedQueryFormats=t?.supportedQueryFormats?.split(","),e.serviceDefinition=new T(t),e.serviceDefinition},executeQueryStreaming:async(e,t,r)=>{const n=`${e.url}/graph/query`;await Re(e);const o=await xe(n,r);o.data.body=await async function(e,t){const r=await(0,G.gx)(),n=new r.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=r.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[t,o]of Object.entries(e.bindParameters))Se(t,o,n,r);if(e.bindGeometryQuantizationParameters)!function(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await ve(t),4326!==t.dataModel?.spatialReference?.wkid)throw new i.c("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=r.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&function(e,t,r){if(!e.extent)throw new i.c("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new i.c("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new i.c("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);t.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:r.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}(e.outputQuantizationParameters,n,r);try{n.encode()}catch(e){throw new i.c("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:e})}const o=n.get_encoding_result();if(0!==o.error.error_code)throw new i.c("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}(t,e);const a=await Ge(o.data.url,o.data);if(e.dataModel)return new h({resultRowsStream:await Oe(a,e.dataModel,t.outputSpatialReference??void 0)});throw new i.c("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,r)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new i.c("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await Re(e);const o=await xe(n,r);return o.data.body=await async function(e,t){if(t.dataModel||await ve(t),!t.dataModel)throw new i.c("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const r=await(0,G.gx)(),n=!!e.options?.cascadeDelete,o=new r.GraphApplyEditsEncoder(r.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?function(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.options?.inputQuantizationParameters):r.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n;try{let t;e.entityAdds?.forEach((e=>{t=o.add_entity(N(e,r)),be(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")})),e.relationshipAdds?.forEach((e=>{if(!e.originId||!e.destinationId)throw new i.c("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");t=o.add_relationship(N(e,r)),be(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")})),e.entityUpdates?.forEach((e=>{if(!e.id)throw new i.c("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=o.update_entity(N(e,r)),be(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")})),e.relationshipUpdates?.forEach((e=>{if(!e.id)throw new i.c("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=o.update_relationship(N(e,r)),be(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")})),e.entityDeletes?.forEach((e=>{if(!e.typeName)throw new i.c("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=o.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach((e=>{t.delete_by_id(e)}))})),e.relationshipDeletes?.forEach((e=>{if(!e.typeName)throw new i.c("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=o.make_delete_helper(e.typeName,!1);e.ids?.forEach((e=>{t.delete_by_id(e)}))})),o.encode()}catch(e){throw new i.c("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:e})}const a=o.get_encoding_result();return be(a.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(a.get_byte_buffer())}(t,e),async function(e){const t=e.headers.get("content-type");if(t?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),r=new((await(0,G.gx)()).GraphApplyEditsDecoder);return r.deleteLater(),r.decode(new Uint8Array(t)),function(e){const t=e.has_error(),r=new fe({hasError:t,error:t?{errorCode:e.error.error_code,errorMessage:e.error.error_message}:null}),n=e.get_edit_results_count();for(let t=0;t<n;t++){const n=e.get_edit_results_at(t),o=e.get_edit_results_type_name_at(t),i=[],a=[],s=[],l=n.get_add_results_count(),d=n.get_update_results_count(),p=n.get_delete_results_count();for(let e=0;e<l;e++){const t=n.get_add_result_at(e);i.push({id:t.id,error:{errorCode:t.error.error_code,errorMessage:t.error.error_message}})}for(let e=0;e<d;e++){const t=n.get_update_result_at(e);a.push({id:t.id,error:{errorCode:t.error.error_code,errorMessage:t.error.error_message}})}for(let e=0;e<p;e++){const t=n.get_delete_result_at(e);s.push({id:t.id,error:{errorCode:t.error.error_code,errorMessage:t.error.error_message}})}r.editResults.push({typeName:o,adds:i,updates:a,deletes:s})}return r}(r)}throw new i.c("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:t,data:e.text()})}(await Ge(o.data.url,o.data))},executeQuery:async(e,t,r)=>{const n=`${e.url}/graph/query`,a=await(0,o.c)(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:t.openCypherQuery,...r?.query},signal:r?.signal,timeout:r?.timeout}),s=a.getHeader?.("content-type"),l=a.data;if(s?.includes("application/x-protobuf")){const t=new((await(0,G.gx)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel)return new u({resultRows:Me(t,l,e.dataModel)});throw new i.c("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.c("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:a.data})},executeSearch:async(e,t,r)=>{const n=t.typeCategoryFilter,a=`${e.url}/graph/search`,s=await(0,o.c)(a,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${t.searchQuery}"`,typeCategoryFilter:n,...r?.query},signal:r?.signal,timeout:r?.timeout}),l=s.getHeader?.("content-type"),d=s.data;if(l?.includes("application/x-protobuf")){const t=new((await(0,G.gx)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel)return new u({resultRows:Me(t,d,e.dataModel)});throw new i.c("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.c("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:l,data:s.data})},executeSearchStreaming:async(e,t,r)=>{const n=`${e.url}/graph/search`;await Re(e);const o=await xe(n,r);o.data.body=await async function(e){const t=await(0,G.gx)(),r=new t.GraphSearchRequestEncoder;if(r.deleteLater(),r.search_query=e.searchQuery,r.type_category_filter=t.esriNamedTypeCategory[e.typeCategoryFilter],!0===e.returnSearchContext&&(r.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(r.start_index=e.start),null!=e.num&&(r.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{r.set_ids_filter(O(e.idsFilter,t))}catch(e){throw new i.c("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:e})}e.namedTypesFilter?.forEach((e=>{r.add_named_type_filter(e)}));try{r.encode()}catch(e){throw new i.c("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:e})}const n=r.get_encoding_result();if(0!==n.error.error_code)throw new i.c("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return structuredClone(n.get_byte_buffer())}(t);const a=await Ge(o.data.url,o.data);if(e.dataModel)return new h({resultRowsStream:await Oe(a,e.dataModel)});throw new i.c("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},_fetchWrapper:async(e,t)=>fetch(e,t)};async function ge(e,t,r){return _e.executeApplyEdits(e,t,r)}async function me(e,t,r){return _e.executeQuery(e,t,r)}async function we(e,t,r){return _e.executeQueryStreaming(e,t,r)}async function Ee(e,t,r){return _e.executeSearch(e,t,r)}async function qe(e,t,r){return _e.executeSearchStreaming(e,t,r)}async function Te(e){return _e.fetchKnowledgeGraph(e)}async function ve(e){return _e.refreshDataModel(e)}async function Ie(e){return _e.refreshServiceDefinition(e)}async function Ge(e,t){return _e._fetchWrapper(e,t)}async function Re(e){const t=n.id?.findCredential(e.url);t||(e.dataModel?await ke(e):await ve(e))}function be(e,t,r){if(0!==e.error_code)throw new i.c(t,r,{errorCode:e.error_code,errorMessage:e.error_message})}function Se(e,t,r,n){null==t?r.set_param_key_value(e,""):"object"!=typeof t||t instanceof Date?r.set_param_key_value(e,t):t instanceof M.c?r.set_param_key_value(e,P(t,n)):t instanceof Array?r.set_param_key_value(e,O(t,n)):r.set_param_key_value(e,k(t,n))}async function xe(e,t){return(0,o.c)(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...t?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:t?.signal,timeout:t?.timeout})}function Me(e,t,r,n=new _.c({wkid:_.c.WGS84.wkid})){e.push_buffer(new Uint8Array(t));const o=[];let a=0;for(;e.next_row();){a||(a=e.get_header_keys().size());const t=new Array(a);for(let o=0;o<a;o++){const i=e.get_value(o);t[o]=pe(i,r,n)}o.push(t)}if(e.has_error())throw new i.c("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return o}async function Oe(e,t,r){const n=e.headers.get("content-type");if(e.headers.get("content-length")&&a.c.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("Found `Content-Length` header when expecting a streaming HTTP response! Please investigate whether all intermediate HTTP proxies and/or load balancers are configured such that they don't forcefully buffer the entire response before returning it to the client. A valid HTTP streaming response should use Chunked Transfer Encoding and not have a Content Length defined."),n?.includes("application/x-protobuf")){const n=e.body?.getReader(),o=new((await(0,G.gx)()).GraphQueryDecoder);return o.deleteLater(),new ReadableStream({async start(e){try{return function a(){return n?.read().then((({done:s,value:l})=>{if(s){let t;if(o.has_error()&&(t=new i.c("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded",{errorCode:o.error.error_code,errorMessage:o.error.error_message})),n.releaseLock(),t)throw e.error(t),t;return void e.close()}const d=Me(o,l,t,r);return d.length>0&&e.enqueue(d),a()}))}()}catch(t){n?.releaseLock(),e.error(new i.c("knowledge-graph:stream-decoding-error","The server returned a valid response, but there was an error decoding the response stream",{error:t})),e.close()}}})}throw new i.c("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:e.text()})}async function ke(e){const t=`${e.url}/dataModel/queryDataModel`,r=await(0,o.c)(t,{responseType:"array-buffer",query:{f:"pbf"}}),n=r.getHeader?.("content-type"),a=r.data;if(n?.includes("application/x-protobuf")){const e=(await(0,G.gx)()).decode_data_model_from_protocol_buffer(new Uint8Array(a));if(!e)throw new i.c("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return function(e){return e.deleteLater(),new E({timestamp:e.timestamp,spatialReference:new _.c(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:Y.cT[e.identifier_info?.identifier_mapping_info?.identifier_info_type?.value],databaseNativeIdentifier:e.identifier_info?.identifier_mapping_info?.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:e.identifier_info?.identifier_mapping_info?.uniform_property_identifier?.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:Y.Oe[e.identifier_info?.identifier_generation_info?.uuid_method_hint?.value]}},searchIndexes:ee(e.search_indexes),entityTypes:K(e.entity_types),relationshipTypes:X(e.relationship_types)})}(e)}throw new i.c("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:r.data})}}}]);