@arcgis/core 5.1.0-next.67 → 5.1.0-next.69

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 (132) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{2e1aecdf59ad3421bbad.js → 0e2e4cb34ac6aac88ebf.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{38816f95e801f1c5bbad.js → 1c742bfe3b0aa51823d1.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{27262083d37fe623ca9c.js → 210629f3c28d4339c655.js} +1 -1
  5. package/assets/esri/core/workers/chunks/27643750dce502fedef3.js +1 -0
  6. package/assets/esri/core/workers/chunks/29878b52aa12b3815230.js +1 -0
  7. package/assets/esri/core/workers/chunks/{7fb9a5bc22d7581f1d20.js → 29b1a4ce7646b403008e.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{eb7392799a01c2a8497a.js → 2da62687ff678b690839.js} +1 -1
  9. package/assets/esri/core/workers/chunks/2fd4220131bfc3f5e2dd.js +1 -0
  10. package/assets/esri/core/workers/chunks/{a118de5a163ae42bee60.js → 333a0038d782d8a34d58.js} +1 -1
  11. package/assets/esri/core/workers/chunks/38328a785365c4783b1e.js +1 -0
  12. package/assets/esri/core/workers/chunks/{e268e5be096392c2e69b.js → 3eef3c2e94aa2a00d76a.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{a5b395e518e4c5fc95d0.js → 40d6ad030614099155cd.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{427183ea93e759943a78.js → 43678e08a3d9d51c2a6d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{af007ec833ab49e4c958.js → 453280ea87a696a4df81.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{921c30b7f4dfc3e018d9.js → 4605a68e40c5c3ac6e3e.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{abd5c1d4b7b91d9ea1eb.js → 478879ba965798f61bf3.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{aa69cbaa38b49677ddff.js → 499b899bf88aaf29230d.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{8a0f254d45d00b293479.js → 49fb9c47070641bce9a9.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{f8eb14170f927aecfbc8.js → 4f9d027055f3a616173c.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{4e7b084f7104deea1ddb.js → 53b797e384be9628fc94.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{ff0cb1eec14d34214f12.js → 5fe97253f80c797fad7f.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{2f8ed1e7c1b10cb30972.js → 678c9f15712cf3d3bb9e.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{4005d37d03c834da7629.js → 68a313155ddc29bd024d.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{684ea7f75a7a5fb52cde.js → 6a21c9a4aeebe806ea39.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{0f196ec93925dfefc69a.js → 6bb090f3e5c18604cb39.js} +1 -1
  27. package/assets/esri/core/workers/chunks/73e000cc3c4da10e9937.js +1 -0
  28. package/assets/esri/core/workers/chunks/{79df97e3f5975b42dc4d.js → 75669912cddcb5db52c8.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{749c368f5cc2366716f1.js → 7bd1d624f4f4a11a31e8.js} +1 -1
  30. package/assets/esri/core/workers/chunks/7cadfd7444a2a05cf2fb.js +1 -0
  31. package/assets/esri/core/workers/chunks/{1515824f11ef5ab95378.js → 7d0350f459844162d3a7.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{4d069a0ebadb9c53b550.js → 7e39e9d4d68843b60e4c.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{8d5bc17557a31ed79ed8.js → 81750c5177d8d52a3e05.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{7d73472696ec76458758.js → 81b2985b83be8f8f1090.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{a8ef9ed9b59de95f2b23.js → 823127b23bec07e1f9d0.js} +2 -2
  36. package/assets/esri/core/workers/chunks/{b8bf3e8b8b870f69f231.js → 8969788c57bcc11bf77b.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{4e7bb224bde9e5039263.js → 8b8f391f27774aec6db9.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{0e90e9ea1ad587eb3495.js → 8ea4584e07ccc85caabd.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{6c40b3c2b9071edb758d.js → 8fb336c2066113300d0d.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{b5648a0b92cf1a2c81ad.js → 915a5e8aecf25f3bc72b.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{7ffcd308087c35adda04.js → 9bd713d96502ddc2ce25.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{9622a83b29acb768fcb5.js → a25acccda8febac71a3d.js} +1 -1
  43. package/assets/esri/core/workers/chunks/a30815a0155a3b8790b4.js +1 -0
  44. package/assets/esri/core/workers/chunks/{90cef6f96df7dc27db39.js → a43decc8ede8b4910553.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{dd26e3a29161ea411e41.js → a94bd20551c1179c7ec5.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{fa7ae035472540999721.js → b2120c4c56656be941ae.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{a59db907ec1e31002100.js → b85c9ceeece1bae67a16.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{c4e936879c6cb25cf586.js → b8a11d32a4847513619b.js} +1 -1
  49. package/assets/esri/core/workers/chunks/bbaf1d9835671c0165ca.js +1 -0
  50. package/assets/esri/core/workers/chunks/{cb9185ed31109781fe59.js → bc887bd62579dba81e2b.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{7e9b790fe01b89acdf6d.js → bcefdf9753d9d2f6f1be.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{927773ed23b1fc245bf7.js → be61ea8e1883b915bbb1.js} +1 -1
  53. package/assets/esri/core/workers/chunks/c02ba921c0a32d2021e3.js +1 -0
  54. package/assets/esri/core/workers/chunks/{9a95c28d4a3b3b4b2c50.js → c49c078be08c38a6088d.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{d94dfb2ce31e59b3306b.js → c79827f879d1d58d3f1b.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{56036327e721f9c42b33.js → c7ca47f5d4b2f3885239.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{d83ac66478a419e08af6.js → d3d9d40556c847bba1a7.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{789357e0f79823f145dd.js → d4e55eb75fa4d3ac1e84.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{fee31d9297648219375d.js → d8d7331600d93bbca2b4.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{e907acaec4c62adac2f2.js → e0fe23019410dea8236b.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{4f847a426973bd350c11.js → e5801b0f3893d4d4f5b0.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{6ab8ed12d162d79a8c55.js → e62d08f5488a74cbda82.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{b4fb4484fa39eede1f62.js → e66b9d00d02fc08cbb2d.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{69520cad347947b09f21.js → ecb7ede6a8e6c05e4c6c.js} +1 -1
  65. package/assets/esri/core/workers/chunks/ef9d74f8d5a502fda809.js +1 -0
  66. package/assets/esri/core/workers/chunks/f0bc5e8e44d53b73d431.js +1 -0
  67. package/assets/esri/core/workers/chunks/f11ea0d3de93ec0392af.js +1 -0
  68. package/assets/esri/core/workers/chunks/{cc8e6d1eb90221103023.js → f1e5626a0cc1631a1efb.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{afea4a4b072c329d3749.js → fc64ae69581e4c38fa8a.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{3f8e8f83ebda07d29ca8.js → fd6bbe47773bbd9f7dd9.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{8418ad9ad7b6481ebe82.js → ffb70e9358c0b171a315.js} +1 -1
  72. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  73. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  74. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  75. package/chunks/arcgis-knowledge-client-core.js +1 -1
  76. package/config.js +1 -1
  77. package/core/string.js +1 -1
  78. package/geometry/support/lineSegment.js +1 -1
  79. package/kernel.js +1 -1
  80. package/layers/GroupLayer.js +1 -1
  81. package/layers/SceneLayer.js +1 -1
  82. package/layers/VoxelWasmPerSceneView.js +1 -1
  83. package/layers/mixins/OperationalLayer.js +1 -1
  84. package/layers/support/arcgisLayers.js +1 -1
  85. package/layers/support/layersCreator.js +1 -1
  86. package/layers/support/{lazyLayerLoader.js → layersLoader.js} +1 -1
  87. package/layers/support/layersMapping.js +2 -0
  88. package/package.json +2 -2
  89. package/popup/Feature.d.ts +3 -3
  90. package/popup/Features.d.ts +1 -13
  91. package/popup/Features.js +1 -1
  92. package/popup/actionUtils.js +1 -1
  93. package/portal/support/portalLayers.js +1 -1
  94. package/rest/knowledgeGraph/GraphQueryResultHeader.js +1 -1
  95. package/rest/knowledgeGraph/wasmInterface/wasmToQueryResponseObjFactories.js +1 -1
  96. package/support/revision.js +1 -1
  97. package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
  98. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  99. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  100. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  101. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
  102. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  103. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  104. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  105. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  106. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  107. package/views/3d/webgl.js +1 -1
  108. package/views/SelectionManager.d.ts +1 -1
  109. package/views/VideoView.js +1 -1
  110. package/views/draw/DrawManipulator.js +1 -1
  111. package/views/draw/DrawManipulator3D.js +2 -0
  112. package/views/draw/DrawTool.js +1 -1
  113. package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
  114. package/webscene/spec-certification/api.js +1 -1
  115. package/widgets/Compass/CompassViewModel.d.ts +1 -0
  116. package/widgets/Compass/CompassViewModel.js +1 -1
  117. package/widgets/Compass.js +1 -1
  118. package/assets/esri/core/workers/chunks/12294f8c32c34788b6de.js +0 -1
  119. package/assets/esri/core/workers/chunks/151c2766a4cacc6adbd6.js +0 -1
  120. package/assets/esri/core/workers/chunks/1984c0f037065acd21d3.js +0 -1
  121. package/assets/esri/core/workers/chunks/4fd1bf82939e3bb9bc03.js +0 -1
  122. package/assets/esri/core/workers/chunks/61794a861a9209b72622.js +0 -1
  123. package/assets/esri/core/workers/chunks/644dd906bee3ef465ec0.js +0 -1
  124. package/assets/esri/core/workers/chunks/6f079f1fd6d00d2d174c.js +0 -1
  125. package/assets/esri/core/workers/chunks/751f3cfb000045ac78bb.js +0 -1
  126. package/assets/esri/core/workers/chunks/a80eb704e75d13732878.js +0 -1
  127. package/assets/esri/core/workers/chunks/c72e90a952543d06d84b.js +0 -1
  128. package/assets/esri/core/workers/chunks/e9f2b573f482718306e6.js +0 -1
  129. package/assets/esri/core/workers/chunks/f62e42659b406435573d.js +0 -1
  130. package/layers/mixins/operationalLayerModuleMap.js +0 -2
  131. package/layers/mixins/operationalLayers.js +0 -2
  132. /package/assets/esri/core/workers/chunks/{a8ef9ed9b59de95f2b23.js.LICENSE.txt → 823127b23bec07e1f9d0.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5335,7716],{69540(e,t,n){n.d(t,{OU:()=>c,Pw:()=>h});var i=n(5482),s=n(69622),r=(n(44208),n(4718)),l=(n(53966),n(97768)),o=n(88620),a=n(64108);const u=Symbol("ClonableMixin"),c=e=>{var t;const n=e;let s=class extends n{constructor(){super(...arguments),this[t]=!0}static{t=u}clone(e){const t=(0,o.oY)(this);(0,l.Lw)(t,"unable to clone instance of non-accessor class");const n=t.metadata,i=t.store,s={},a=new Map;for(const t in n){const l=n[t],o=i?.originOf(t),u=l.clonable;if(l.readOnly||!1===u||7!==o&&0!==o&&5!==o&&4!==o)continue;const c=this[t];let h=null;if("function"==typeof u)h=u(c,e);else if("reference"===u)h=c;else if(h=(0,r.TU)(c,e),null!=c&&null==h)continue;0===o?a.set(t,h):s[t]=h}const u=new(0,Object.getPrototypeOf(this).constructor)(s);if(a.size){const e=(0,o.oY)(u)?.store;if(e)for(const[t,n]of a)e.set(t,n,0)}return u}};return s=(0,i.Cg)([(0,a.$)("esri.core.Clonable")],s),s},h=c(s.A)},7762(e,t,n){n.d(t,{A:()=>O});var i,s=n(5482),r=n(98291),l=n(4576),o=n(65529),a=n(36563),u=n(4718),c=n(53966),h=n(93687),f=n(76030),d=n(56507),p=n(62788),g=n(10107),m=n(7695),y=n(64108),_=n(95488),v=n(12195);class b{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}}class w{constructor(e,t,n,i,s){this.target=e,this.added=t,this.removed=n,this.start=i,this.deleteCount=s}}const A=new h.A(()=>new b,void 0,e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1});function C(e){e&&"object"==typeof e&&"destroy"in e&&"function"==typeof e.destroy&&e.destroy()}function M(e){return e?e instanceof L?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function I(e){if(e?.length)return e[0]}function S(e,t,n,i){const s=Math.min(e.length-n,t.length-i);let r=0;for(;r<s&&e[n+r]===t[i+r];)r++;return r}function E(e,t,n,i){t&&t.forEach((t,s,r)=>{e.push(t),E(e,n.call(i,t,s,r),n,i)})}const R=new Set,z=new Set,P=new Set,x=new Map;let T=0,L=i=class extends o.nJ{static ofType(e){if(!e)return i;if(x.has(e))return x.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const n in e.typeMap){const i=e.typeMap[n].prototype.declaredClass;t?t+=` | ${i}`:t=i}let n=class extends i{};return(0,s.Cg)([(0,m.u)({Type:e,ensureType:"function"==typeof e?(0,d.dp)(e):(0,d.aq)(e)})],n.prototype,"itemType",void 0),n=(0,s.Cg)([(0,y.$)(`esri.core.Collection<${t}>`)],n),x.set(e,n),n}static isCollection(e){return null!=e&&e instanceof i}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new _.I,this._length=0,this._items=[],Object.defineProperty(this,"uid",{value:T++})}normalizeCtorArgs(e){return e?(0,l.yc)(e)||e instanceof i?{items:e}:e:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),super.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get length(){return this._length}set length(e){e>this._length?c.A.getLogger(this).error("#length=","Cannot increase the length of the collection by assigning to the length property."):this.splice(e,Math.max(0,this._length-e))}get items(){return(0,p.gc)(this._observable),this._items}set items(e){this._emitBeforeChanges(1)||(this._splice(0,this.length,M(e)),this._emitAfterChanges(1))}hasEventListener(e){return!this.destroyed&&("change"===e?this._chgListeners.length>0:super.hasEventListener(e))}on(e,t){if(this.destroyed)return(0,a.hA)();if("change"===e){const e=this._chgListeners,n={removed:!1,callback:t};return e.push(n),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),(0,a.hA)(()=>{n.removed=!0,e.splice(e.indexOf(n),1)})}return super.on(e,t)}once(e,t){const n="deref"in t?()=>t.deref():()=>t,i=this.on(e,e=>{n()?.call(null,e),i.remove()});return i}add(e,t){if((0,p.gc)(this._observable),this._emitBeforeChanges(1))return this;const n=this.getNextIndex(t??null);return this._splice(n,0,[e]),this._emitAfterChanges(1),this}addMany(e,t=this._items.length){if((0,p.gc)(this._observable),!e?.length)return this;if(this._emitBeforeChanges(1))return this;const n=this.getNextIndex(t);return this._splice(n,0,M(e)),this._emitAfterChanges(1),this}at(e){if((0,p.gc)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(2))return[];const e=this._removeAllRaw();return this._emitAfterChanges(2),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return(0,p.gc)(this._observable),this._createNewInstance({items:this._items.map(u.o8)})}concat(...e){(0,p.gc)(this._observable);const t=e.map(M);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(2))return;const n=this._splice(0,this.length),i=n.length;for(let s=0;s<i;s++)e.call(t,n[s],s,n);this._emitAfterChanges(2)}destroyAll(){this.drain(C)}destroyMany(e){const t=this.removeMany(e);return t.forEach(C),t}every(e,t){return(0,p.gc)(this._observable),this._items.every(e,t)}filter(e,t){(0,p.gc)(this._observable);const n=2===arguments.length?this._items.filter(e,t):this._items.filter(e);return this._createNewInstance({items:n})}find(e,t){return(0,p.gc)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,p.gc)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,p.gc)(this._observable);const n=[];return E(n,this,e,t),new i(n)}forEach(e,t){return(0,p.gc)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,p.gc)(this._observable),this._items[e]}getNextIndex(e){(0,p.gc)(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,p.gc)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,p.gc)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,p.gc)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,p.gc)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,p.gc)(this._observable);const n=this._items.map(e,t);return new i({items:n})}reorder(e,t=this.length-1){(0,p.gc)(this._observable);const n=this.indexOf(e);if(-1!==n){if(t<0?t=0:t>=this.length&&(t=this.length-1),n!==t){if(this._emitBeforeChanges(4))return e;this._splice(n,1),this._splice(t,0,[e]),this._emitAfterChanges(4)}return e}}pop(){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(2))return;const e=I(this._splice(this.length-1,1));return this._emitAfterChanges(2),e}push(...e){return(0,p.gc)(this._observable),this._emitBeforeChanges(1)||(this._splice(this.length,0,e),this._emitAfterChanges(1)),this.length}reduce(e,t){(0,p.gc)(this._observable);const n=this._items;return 2===arguments.length?n.reduce(e,t):n.reduce(e)}reduceRight(e,t){(0,p.gc)(this._observable);const n=this._items;return 2===arguments.length?n.reduceRight(e,t):n.reduceRight(e)}remove(e){return(0,p.gc)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,p.gc)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(2))return;const t=I(this._splice(e,1));return this._emitAfterChanges(2),t}removeMany(e){if((0,p.gc)(this._observable),!e?.length||this._emitBeforeChanges(2))return[];const t=e instanceof i?e.toArray():e,n=this._items,s=[],r=t.length;for(let e=0;e<r;e++){const i=t[e],r=n.indexOf(i);if(r>-1){const i=1+S(t,n,e+1,r+1),l=this._splice(r,i);l&&l.length>0&&s.push.apply(s,l),e+=i-1}}return this._emitAfterChanges(2),s}reverse(){if((0,p.gc)(this._observable),this._emitBeforeChanges(4))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(4),this}shift(){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(2))return;const e=I(this._splice(0,1));return this._emitAfterChanges(2),e}slice(e=0,t=this.length){return(0,p.gc)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,p.gc)(this._observable),this._items.some(e,t)}sort(e){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(4)||!this._requiresSort(e))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(4),this}_requiresSort(e=(e,t)=>e===t?0:e<t?-1:1){const t=this.length-1;for(let n=0;n<t;n++)if(e(this.items[n],this.items[n+1])>0)return!0;return!1}splice(e,t,...n){(0,p.gc)(this._observable),1===arguments.length&&(t=this.length),t??=0;const i=(t?2:0)|(n.length?1:0);if(this._emitBeforeChanges(i))return[];const s=this._splice(e,t,n)||[];return this._emitAfterChanges(i),s}toArray(){return(0,p.gc)(this._observable),this._items.slice()}toJSON(e){return(0,p.gc)(this._observable),this.toArray().map(t=>(0,v.W)(t)?t.toJSON(e):t)}toLocaleString(){return(0,p.gc)(this._observable),this._items.toLocaleString()}toString(){return(0,p.gc)(this._observable),this._items.toString()}unshift(...e){return(0,p.gc)(this._observable),!e.length||this._emitBeforeChanges(1)||(this._splice(0,0,e),this._emitAfterChanges(1)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,n){const i=this._items,s=this.itemType;let r,l;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=(0,f._)(()=>this._dispatchChange())),e<0&&(e+=this.length),t){if(l=i.splice(e,t),this.hasEventListener("before-remove")){const t=A.acquire();t.target=this,t.cancellable=!0;for(let n=0,s=l.length;n<s;n++)r=l[n],t.reset(r),this.emit("before-remove",t),t.defaultPrevented&&(l.splice(n,1),i.splice(e,0,r),e+=1,n-=1,s-=1);A.release(t)}if(this._length=this._items.length,this.hasEventListener("after-remove")){const e=A.acquire();e.target=this,e.cancellable=!1;const t=l.length;for(let n=0;n<t;n++)e.reset(l[n]),this.emit("after-remove",e);A.release(e)}}if(n?.length){if(s){const e=[];for(const t of n){const n=s.ensureType(t);null==n&&null!=t||e.push(n)}n=e}const t=this.hasEventListener("before-add"),r=this.hasEventListener("after-add"),l=e===this.length;if(t||r){const s=A.acquire();s.target=this,s.cancellable=!0;const o=A.acquire();o.target=this,o.cancellable=!1;for(const a of n)t?(s.reset(a),this.emit("before-add",s),s.defaultPrevented||(l?i.push(a):i.splice(e++,0,a),this._length=i.length,r&&(o.reset(a),this.emit("after-add",o)))):(l?i.push(a):i.splice(e++,0,a),this._length=i.length,o.reset(a),this.emit("after-add",o));A.release(o),A.release(s)}else{if(l)for(const e of n)i.push(e);else i.splice(e,0,...n);this._length=i.length}}if((n?.length||l?.length)&&this._notifyChangeEvent(n,l),this.hasEventListener("after-splice")){const i=new w(this,n,l,e,t);this.emit("after-splice",i)}return l}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const n=A.acquire();n.target=this,n.cancellable=!0,n.type=e,this.emit("before-changes",n),t=n.defaultPrevented,A.release(n)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=A.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),A.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),this._updating=!1,!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;R.clear(),z.clear(),P.clear();for(const{added:t,removed:n}of e){if(t)if(0===P.size&&0===z.size)for(const e of t)R.add(e);else for(const e of t)z.has(e)?(P.add(e),z.delete(e)):P.has(e)||R.add(e);if(n)if(0===P.size&&0===R.size)for(const e of n)z.add(e);else for(const e of n)R.has(e)?R.delete(e):(P.delete(e),z.add(e))}const n=r.A.acquire();R.forEach(e=>{n.push(e)});const i=r.A.acquire();z.forEach(e=>{i.push(e)});const s=this._items,l=t.items,o=r.A.acquire();if(P.forEach(e=>{l.indexOf(e)!==s.indexOf(e)&&o.push(e)}),t.listeners&&(n.length||i.length||o.length)){const e={target:this,added:n,removed:i,moved:o},s=t.listeners.length;for(let n=0;n<s;n++){const i=t.listeners[n];i.removed||i.callback.call(this,e)}}r.A.release(n),r.A.release(i),r.A.release(o)}R.clear(),z.clear(),P.clear()}};(0,s.Cg)([(0,g.MZ)()],L.prototype,"_updating",void 0),(0,s.Cg)([(0,g.MZ)()],L.prototype,"_length",void 0),(0,s.Cg)([(0,g.MZ)()],L.prototype,"length",null),(0,s.Cg)([(0,g.MZ)()],L.prototype,"items",null),(0,s.Cg)([(0,g.MZ)({readOnly:!0})],L.prototype,"updating",null),L=i=(0,s.Cg)([(0,y.$)("esri.core.Collection")],L);const O=L},4902(e,t,n){n.d(t,{s:()=>l});var i=n(5482),s=n(64108);let r=0;const l=e=>{const t=e;let n=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+r++})}};return n=(0,i.Cg)([(0,s.$)("esri.core.Identifiable")],n),n};l(class{})},66344(e,t,n){n.d(t,{q:()=>o});const i=!!(0,n(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class s{get size(){return this._size}constructor(e=10485760,t=.3){this._maxSize=e,this._maxClientSizeRatio=t,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._clients=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._clients.clear(),this._db.clear()}register(e){this._clients.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._clients.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}get _maxClientSize(){return this._maxSize*this._maxClientSizeRatio}getSize(e,t){const n=this._db.get(e.id+t);return n?.size??0}put(e,t,n,s,l){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!==n&&this._notifyRemove(t,o.entry,o.size,0)),s>this._maxSize)return void this._notifyRemove(t,n,s,0);if(void 0===n)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return i||console.warn(`Refusing to cache entry with size ${s} for key ${t}`),void this._notifyRemove(t,n,0,0);const a=1+Math.max(l,-4)- -3;this._db.set(t,new r(n,s,a)),this._size+=s,e.size+=s,this._checkSize()}updateSize(e,t){t=e.id+t;const n=this._db.get(t);if(!n)return;this._size-=n.size,e.size-=n.size;let i=n.entry.usedMemory;for(;i>this._maxSize;){const e=this._notifyRemove(t,n.entry,i,1);if(!(null!=e&&e>0))return void this._db.delete(t);i=e}n.size=i,this._size+=i,e.size+=i,this._checkSize()}pop(e,t){t=e.id+t;const n=this._db.get(t);if(n)return this._size-=n.size,e.size-=n.size,this._db.delete(t),++this._hit,n.entry;++this._miss}get(e,t){t=e.id+t;const n=this._db.get(t);if(void 0!==n)return this._db.delete(t),n.lives=n.lifetime,this._db.set(t,n),++this._hit,n.entry;++this._miss}peek(e,t){const n=this._db.get(e.id+t);return n?++this._hit:++this._miss,n?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},n=new Array;this._db.forEach((e,i)=>{const s=e.lifetime;n[s]=(n[s]||0)+e.size,this._clients.forEach(n=>{const{id:s,name:r}=n;if(i.startsWith(s)){const n=t[r]||0;t[r]=n+e.size}})});const i={};this._clients.forEach(e=>{const n=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const s=t[n]||0;t[n]=s,i[n]=Math.round(100*e.hitRate)+"%"}else i[n]="0%"});const s=Object.keys(t);s.sort((e,n)=>t[n]-t[e]),s.forEach(n=>e[n]=Math.round(t[n]/2**20)+"MB / "+i[n]);for(let t=n.length-1;t>=0;--t){const i=n[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._clients.forEach(e=>e.resetHitRate())}clear(e){const t=e.id;this._db.forEach((e,n)=>{n.startsWith(t)&&(this._size-=e.size,this._db.delete(n),this._notifyRemove(n,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._clients.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(const[t,n]of this._db)t.startsWith(e.id)&&(yield n.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,n,i){const s=this._clients.get(e.split(l)[0])?.removeFunc,r=s?.(t,i,n);return"number"==typeof r?r:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._clients.forEach(e=>this._checkSizeLimits(this._maxClientSize,e)),this._checkSizeLimits(this.maxSize)}setMaxClientSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){const n=t??this;if(n.size<=e)return;const i=t?.id;let s=!0;for(;s;){s=!1;for(const[r,o]of this._db)if(0===o.lifetime&&(!i||r.startsWith(i))){const i=t??this._clients.get(r.split(l)[0]);if(this._purgeItem(r,o,i),n.size<=.9*e)return;s||=this._db.has(r)}}for(const[s,r]of this._db)if(!i||s.startsWith(i)){const i=t??this._clients.get(s.split(l)[0]);if(this._purgeItem(s,r,i),n.size<=.9*e)return}}_purgeItem(e,t,n){if(this._db.delete(e),t.lives<=1){this._size-=t.size,n&&(n.size-=t.size);const i=this._notifyRemove(e,t.entry,t.size,1);null!=i&&i>0&&(this._size+=i,n&&(n.size+=i),t.lives=t.lifetime,t.size=i,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new s(0);class r{constructor(e,t,n){this.entry=e,this.size=t,this.lifetime=n,this.lives=n}}const l=":";class o{constructor(e,t){this.removeFunc=t,this.id="",this.name="",this.size=0,this._storage=new s(e,1),this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,n=1){this._storage.put(this,e,t,n,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},7695(e,t,n){function i(e){return(t,n)=>{t[n]=e}}n.d(t,{u:()=>i})},60999(e,t,n){n.d(t,{DZ:()=>p,Ke:()=>d,Tj:()=>c,UT:()=>g,aD:()=>y,jJ:()=>u});var i=n(5482),s=n(69622),r=n(97768),l=n(17676),o=n(10107),a=n(64108);function u(e,t,n){return(0,l.Lx)(e.map((e,i)=>t.apply(n,[e,i])))}async function c(e,t,n){return(await(0,l.Lx)(e.map((e,i)=>t.apply(n,[e,i])))).map(e=>e.value)}function h(e){return{ok:!0,value:e}}function f(e){return{ok:!1,error:e}}async function d(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return h(await e)}catch(e){return f(e)}}async function p(e){try{return h(await e)}catch(e){return(0,l.QP)(e),f(e)}}function g(e,t){return new m(e,t)}let m=class extends s.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,r.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:n}=this._abortController;this.promise=e(n),this.promise.then(e=>{this._result=h(e),this._cleanup()},e=>{this._result=f(e),this._cleanup()}),this._abortHandle=(0,l.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,r.xt)(this._abortHandle),this._abortController=null}};(0,i.Cg)([(0,o.MZ)()],m.prototype,"value",null),(0,i.Cg)([(0,o.MZ)()],m.prototype,"error",null),(0,i.Cg)([(0,o.MZ)()],m.prototype,"finished",null),(0,i.Cg)([(0,o.MZ)()],m.prototype,"promise",void 0),(0,i.Cg)([(0,o.MZ)()],m.prototype,"_result",void 0),m=(0,i.Cg)([(0,a.$)("esri.core.asyncUtils.ReactiveTask")],m);class y{constructor(){this._sequence=Promise.resolve()}async acquire(){let e;this._sequence=new Promise(t=>{e=this._sequence.then(()=>t,()=>t)});const t=await e;return{[Symbol.dispose]:t}}async run(e){const t={stack:[],error:void 0,hasError:!1};try{return(0,i.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,i.hk)(t)}}}},36708(e,t,n){n.d(t,{C_:()=>f,OH:()=>g,Vh:()=>m,on:()=>h,pc:()=>y,wB:()=>a,z7:()=>u});var i=n(37955),s=n(36563),r=n(97768),l=n(17676),o=n(14012);function a(e,t,n={}){return c(e,t,n,d)}function u(e,t,n={}){return c(e,t,n,p)}function c(e,t,n={},i){let s=null;const l=n.once?(e,n)=>{i(e)&&((0,r.xt)(s),t(e,n))}:(e,n)=>{i(e)&&t(e,n)};if(s=(0,o.Cn)(e,l,n.sync,n.equals),n.initial){const t=e();l(t,t)}return s}function h(e,t,n,l={}){let o=null,u=null,c=null;function h(){o&&u&&(u.remove(),l.onListenerRemove?.(o),o=null,u=null)}function f(e){l.once&&l.once&&(0,r.xt)(c),n(e)}const d=a(e,(e,n)=>{h(),(0,i.wb)(e)&&(o=e,u=(0,i.on)(e,t,f),l.onListenerAdd?.(e))},{sync:l.sync,initial:!0});return c=(0,s.hA)(()=>{d.remove(),h()}),c}function f(e,t){return function(e,t,n){if((0,l.G4)(n))return Promise.reject((0,l.NK)());const i=e();if(t?.(i))return Promise.resolve(i);let o=null;function a(){o=(0,r.xt)(o)}return new Promise((i,r)=>{o=(0,s.vE)([(0,l.u7)(n,()=>{a(),r((0,l.NK)())}),c(e,e=>{a(),i(e)},{sync:!1,once:!0},t??d)])})}(e,p,t)}function d(e){return!0}function p(e){return!!e}n(80559);const g={sync:!0},m={initial:!0},y={sync:!0,initial:!0}},83027(e,t,n){n.d(t,{h:()=>i});const i=n(29953).ho},159(e,t,n){n.d(t,{A:()=>u});var i,s=n(5482),r=n(69540),l=n(25482),o=n(91429),a=n(99157);let u=i=class extends((0,r.OU)(l.o)){constructor(e){super(e),this.steps=[]}getInverse(){const e=new i;for(let t=this.steps.length-1;t>=0;t--){const n=this.steps[t];e.steps.push(n.getInverse())}return e}};(0,s.Cg)([(0,o.MZ)({type:[a.A],nonNullable:!0,json:{name:"geoTransforms"}})],u.prototype,"steps",void 0),u=i=(0,s.Cg)([(0,o.$K)("esri.geometry.operators.support.GeographicTransformation")],u)},99157(e,t,n){n.d(t,{A:()=>a});var i,s=n(5482),r=n(69540),l=n(25482),o=n(91429);let a=i=class extends((0,r.OU)(l.o)){constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new i({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,s.Cg)([(0,o.MZ)({json:{name:"transformForward",read:e=>!e,write:(e,t,n)=>{t[n]=!e}}})],a.prototype,"isInverse",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0}})],a.prototype,"wkt",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0}})],a.prototype,"wkid",void 0),a=i=(0,s.Cg)([(0,o.$K)("esri.geometry.operators.support.GeographicTransformationStep")],a)},9762(e,t,n){n.r(t),n.d(t,{projectBuffer:()=>s});var i=n(49208);function s(e,t,n,s,r,l,o=Math.floor(e.length/3)){const a=(0,i.jd)(t,r);if(null==a)return!1;if(a===i.pO){if(e===s&&n===l)return!0;const t=n+3*o;for(let i=n,r=l;i<t;i++,r++)s[r]=e[i]??0;return!0}const u=n+3*o;for(let t=n,i=l;t<u;t+=3,i+=3)a(e,t,s,i);return!0}},49208(e,t,n){n.d(t,{Tp:()=>h,jd:()=>c,pO:()=>d,w5:()=>u});var i=n(34727),s=n(86211),r=n(73941),l=n(79258),o=n(34403),a=n(21325);const u={2:{5:d,7:null,9:null,10:d,1:w,6:null,8:null,0:null,3:g,11:m,2:d,4:S},5:{5:d,7:null,9:null,10:d,1:w,6:null,8:null,0:null,3:g,11:m,2:d,4:S},7:{5:null,7:d,9:null,10:d,1:null,6:b,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:d,10:d,1:null,6:null,8:v,0:null,3:null,11:null,2:null,4:null},3:{5:p,7:null,9:null,10:p,1:function(e,t,n,i){const s=e[t]/T,r=x-2*Math.atan(Math.exp(-e[t+1]/T)),l=T+(e[t+2]??0),o=Math.cos(r)*l;n[i]=Math.cos(s)*o,n[i+1]=Math.sin(s)*o,n[i+2]=Math.sin(r)*l},6:null,8:null,0:null,3:d,11:function(e,t,n,i){p(e,t,n,i),m(n,i,n,i)},2:p,4:function(e,t,n,i){p(e,t,n,i),S(n,i,n,i)}},4:{5:E,7:null,9:null,10:E,1:function(e,t,n,i){E(e,t,n,i),w(n,i,n,i)},6:null,8:null,0:null,3:function(e,t,n,i){E(e,t,n,i),g(n,i,n,i)},11:function(e,t,n,i){E(e,t,n,i),m(n,i,n,i)},2:E,4:d},1:{5:I,7:null,9:null,10:I,1:d,6:null,8:null,0:null,3:function(e,t,n,i){I(e,t,n,i),g(n,i,n,i)},11:function(e,t,n,i){I(e,t,n,i),m(n,i,n,i)},2:I,4:function(e,t,n,i){I(e,t,n,i),S(n,i,n,i)}},6:{5:null,7:M,9:null,10:M,1:null,6:d,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:C,10:C,1:null,6:null,8:d,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:d,3:null,11:null,2:null,4:null},10:{5:d,7:d,9:d,10:d,1:w,6:b,8:v,0:null,3:g,11:m,2:d,4:S},11:{5:y,7:null,9:null,10:y,1:function(e,t,n,i){y(e,t,n,i),w(n,i,n,i)},6:null,8:null,0:null,3:function(e,t,n,i){y(e,t,n,i),g(n,i,n,i)},11:d,2:y,4:function(e,t,n,i){y(e,t,n,i),S(n,i,n,i)}}};function c(e,t){return h(e,t)?.projector}function h(e,t){if(null==e||null==t)return null;if(R.source.spatialReference===e&&R.dest.spatialReference===t)return R;const n=f(e,R.source),i=f(t,R.dest);return 0===n&&0===i?(0,a.aI)(e,t)?R.projector=d:R.projector=null:R.projector=u[n][i],R}function f(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,s.GA)(e,1)),(0,r.jA)(e)?t.spatialReferenceId=1:(0,a.oT)(e)?t.spatialReferenceId=2:(0,a.K8)(e)?t.spatialReferenceId=3:(0,a.r1)(e)?t.spatialReferenceId=11:e.wkt===r.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===r.FY.wkt?t.spatialReferenceId=6:e.wkt===r.LJ.wkt?t.spatialReferenceId=8:(0,r.q8)(e)?t.spatialReferenceId=7:(0,r.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function d(e,t,n,i){e!==n&&(n[i++]=e[t++],n[i++]=e[t++],n[i]=e[t]??0)}function p(e,t,n,i){n[i]=P*(e[t]/T),n[i+1]=P*(x-2*Math.atan(Math.exp(-e[t+1]/T))),n[i+2]=e[t+2]??0}function g(e,t,n,s){!function(e,t,n,s,r){const l=.4999999*Math.PI,o=(0,i.qE)(z*e[t+1],-l,l),a=Math.sin(o);n[s++]=z*e[t]*r.radius,n[s++]=r.halfSemiMajorAxis*Math.log((1+a)/(1-a)),n[s]=e[t+2]??0}(e,t,n,s,l.$O)}function m(e,t,n,i){n[i]=e[t]*L,n[i+1]=e[t+1]*L,n[i+2]=e[t+2]??0}function y(e,t,n,i){n[i]=e[t]*O,n[i+1]=e[t+1]*O,n[i+2]=e[t+2]??0}function _(e,t,n,i,s){const r=s+(e[t+2]??0),l=z*e[t],o=z*e[t+1],a=Math.cos(o)*r;n[i]=Math.cos(l)*a,n[i+1]=Math.sin(l)*a,n[i+2]=Math.sin(o)*r}function v(e,t,n,i){_(e,t,n,i,l.Sw.radius)}function b(e,t,n,i){_(e,t,n,i,l.sH.radius)}function w(e,t,n,i){_(e,t,n,i,l.$O.radius)}function A(e,t,n,s,r){const l=e[t],o=e[t+1],a=e[t+2]??0,u=Math.sqrt(l*l+o*o+a*a),c=(0,i.YN)(a/(0===u?1:u)),h=Math.atan2(o,l);n[s++]=P*h,n[s++]=P*c,n[s]=u-r}function C(e,t,n,i){A(e,t,n,i,l.Sw.radius)}function M(e,t,n,i){A(e,t,n,i,l.sH.radius)}function I(e,t,n,i){A(e,t,n,i,l.$O.radius)}function S(e,t,n,i){!function(e,t,n,i,s){const r=z*e[t],l=z*e[t+1],o=e[t+2]??0,a=Math.sin(l),u=Math.cos(l),c=s.radius/Math.sqrt(1-s.eccentricitySquared*a*a);n[i++]=(c+o)*u*Math.cos(r),n[i++]=(c+o)*u*Math.sin(r),n[i++]=(c*(1-s.eccentricitySquared)+o)*a}(e,t,n,i,l.$O)}function E(e,t,n,i){const s=o.TP,r=e[t],a=e[t+1],u=e[t+2]??0;let c,h,f,d,p,g,m,y,_,v,b,w,A,C,M,I,S,E,R,z,x;c=Math.abs(u),h=r*r+a*a,f=Math.sqrt(h),d=h+u*u,p=Math.sqrt(d),z=Math.atan2(a,r),g=u*u/d,m=h/d,C=s.a2/p,M=s.a3-s.a4/p,m>.3?(y=c/p*(1+m*(s.a1+C+g*M)/p),R=Math.asin(y),v=y*y,_=Math.sqrt(1-v)):(_=f/p*(1-g*(s.a5-C-m*M)/p),R=Math.acos(_),v=1-_*_,y=Math.sqrt(v)),b=1-l.$O.eccentricitySquared*v,w=l.$O.radius/Math.sqrt(b),A=s.a6*w,C=f-w*_,M=c-A*y,S=_*C+y*M,I=_*M-y*C,E=I/(A/b+S),R+=E,x=S+I*E/2,u<0&&(R=-R),n[i++]=P*z,n[i++]=P*R,n[i]=x}const R={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:d},z=(0,i.kU)(1),P=(0,i.KJ)(1),x=.5*Math.PI,T=l.$O.radius,L=T*Math.PI/180,O=180/(T*Math.PI)},91218(e,t,n){n.r(t),n.d(t,{canProjectWithoutEngine:()=>K,initializeProjection:()=>W,isEqualBaseGCS:()=>F,isLoaded:()=>T,isLoadedOrLoad:()=>L,isLoadedOrLoadFor:()=>O,load:()=>U,project:()=>k,projectAsync:()=>G,projectExtent:()=>se,projectMany:()=>Z,projectMultipoint:()=>Q,projectOrLoad:()=>D,projectOrLoadMany:()=>q,projectPoint:()=>V,projectPolygon:()=>ne,projectPolyline:()=>ee,projectWithoutEngine:()=>Y,requiresLoad:()=>j,test:()=>H,tryProject:()=>B,unload:()=>N});var i=n(49186),s=n(17676),r=n(62788),l=n(95488),o=n(51850),a=n(21276),u=n(73941),c=n(5443),h=n(91075),f=n(48526),d=n(86738),p=n(39829),g=n(82799),m=n(16930),y=n(98764),_=n(159),v=n(9762),b=n(49208);function w(e,t,n,i,s,r){return A[0]=e,A[1]=t,A[2]=n,(0,v.projectBuffer)(A,i,0,s,r,0)}const A=(0,o.vt)();var C=n(60408),M=n(21325),I=n(52006);let S=null,E=null,R=null,z=null,P={};const x=new l.I;function T(){return!!(E?.isLoaded()&&R?.isLoaded()&&z?.isLoaded())}function L(){return!!T()||((0,r.gc)(x),U(),!1)}function O(e,t){return!e||!t||K(e,t)||L()}function j(e,t){return!K(e,t)&&!T()}async function U(e){null==S&&(S=Promise.all([n.e(3276).then(n.bind(n,83276)).then(e=>(E=e,E.load())),n.e(8377).then(n.bind(n,8377)).then(e=>(R=e,R.load())),n.e(2158).then(n.bind(n,12158)).then(e=>(z=e,z.load()))])),await S,(0,s.Te)(e),x.notify()}function k(e,t,n){return Array.isArray(e)?0===e.length?[]:((0,a.H)(e),Z(e,e[0].spatialReference,t,n)):((0,a.f)(e),Z([e],e.spatialReference,t,n)[0])}function Z(e,t,n,i){if(null==t||null==n)return e;if(K(t,n,i))return e.map(e=>Y(e,t,n));if(null==i?.geographicTransformation&&(0,u.jA)(t))return Z(e.map(e=>Y(e,t,m.A.WGS84)),m.A.WGS84,n,{zConversionDisabled:i?.zConversionDisabled});if(null==i?.geographicTransformation&&(0,u.jA)(n))return Z(e,t,m.A.WGS84).map(e=>Y(e,m.A.WGS84,n));if(!T())throw new $;if(!i?.geographicTransformation)if(i?.extendedParams)i={...i,geographicTransformation:z.getTransformation(t,n,i.areaOfInterestExtent)||new _.A};else if(!i?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,n);let s=P[e];s||(s=z.getTransformation(t,n)||new _.A,P[e]=s),i={geographicTransformation:s,zConversionDisabled:i?.zConversionDisabled}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof h.A?E.executeMany(e,n,i):R.executeMany(e,n,i)}function B(e,t,n){try{return k(e,t,n)}catch(e){return null}}function D(e,t){const n=q([e],t);return null!=n.pending?{pending:n.pending,geometry:null}:null!=n.geometries?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function q(e,t,n){if(!T())for(const n of e)if(null!=n&&!(0,M.aI)(n.spatialReference,t)&&(0,M.fn)(n.spatialReference)&&(0,M.fn)(t)&&!K(n.spatialReference,t))return(0,r.gc)(x),{pending:U(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,M.aI)(e.spatialReference,t)?e:(0,M.fn)(e.spatialReference)&&(0,M.fn)(t)?k(e,t,n):null)}}class $ extends i.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function N(){S=null,E=null,R=null,z=null,P={}}const H={get loadPromise(){return S}};async function G(e,t,n){if((0,s.Te)(n),!e)return e;const i=q(Array.isArray(e)?e:[e],t,n);if(i.pending)return await i.pending,(0,s.Te)(n),G(e,t,n);const r=i.geometries??[];return Array.isArray(e)?r:r[0]}function K(e,t,n){return!(n?.areaOfInterestExtent||n?.extendedParams||n?.geographicTransformation)&&(!!(0,M.aI)(e,t)||(0,M.fn)(e)&&(0,M.fn)(t)&&!!(0,b.jd)(e,t))}function F(e,t){if((0,M.aI)(e,t))return!0;if(!(0,M.fn)(e)||!(0,M.fn)(t))return!1;const n=(0,M.oT)(e)||(0,M.K8)(e)||(0,M.x1)(e),i=(0,M.oT)(t)||(0,M.K8)(t)||(0,M.x1)(t);return n&&i}async function W(e,t,n,i){if(T())return(0,s.NO)(i);if(Array.isArray(e)){for(const{source:t,dest:n,options:s}of e)if(t&&n&&!K(t,n,s))return U(i)}else if(e&&t&&!K(e,t,n))return U(i);return(0,s.NO)(i)}function Y(e,t,n){return e?(0,C.fT)(e)?J(e,t,new d.A,n,0):(0,C.ZC)(e)?re(e,t,new c.A,n,0):(0,C.Bi)(e)?ie(e,t,new p.A,n,0):(0,C.Rg)(e)?te(e,t,new g.A,n,0):(0,C.U9)(e)?X(e,t,new f.A,n,0):null:null}function V(e,t,n=t.spatialReference,i=0){return null!=n&&null!=e.spatialReference&&null!=J(e,e.spatialReference,t,n,i)}function J(e,t,n,i,s){ue[0]=e.x,ue[1]=e.y;const r=e.z;return ue[2]=void 0!==r?r:s,(0,v.projectBuffer)(ue,t,0,ue,i,0)?(n.x=ue[0],n.y=ue[1],n.spatialReference=i,void 0!==r||(0,u.xP)(i)?(n.z=ue[2],n.hasZ=!0):(n.z=void 0,n.hasZ=!1),void 0===e.m?(n.m=void 0,n.hasM=!1):(n.m=e.m,n.hasM=!0),n):null}function Q(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=X(e,e.spatialReference,t,n,i)}function X(e,t,n,i,s){const{points:r,hasZ:l,hasM:o}=e,a=[],u=r.length,c=[];for(const e of r)c.push(e[0],e[1],l?e[2]:s);if(!(0,v.projectBuffer)(c,t,0,c,i,0,u))return null;const h=ae(l,i);for(let e=0;e<u;++e){const t=3*e,n=c[t],i=c[t+1];h&&o?a.push([n,i,c[t+2],r[e][3]]):h?a.push([n,i,c[t+2]]):o?a.push([n,i,r[e][2]]):a.push([n,i])}return n.points=a,n.spatialReference=i,n.hasZ=l,n.hasM=o,n}function ee(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=te(e,e.spatialReference,t,n,i)}function te(e,t,n,i,s){const{curvePaths:r,paths:l,hasZ:o,hasM:a}=e;if(!(r?oe(r,o??!1,a??!1,t,n.curvePaths=[],i,s):le(l,o??!1,a??!1,t,n.paths,i,s)))return null;const u=ae(o,i);return n.spatialReference=i,n.hasZ=u,n.hasM=a,n}function ne(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=ie(e,e.spatialReference,t,n,i)}function ie(e,t,n,i,s){const{curveRings:r,rings:l,hasZ:o,hasM:a}=e;return(r?oe(r,o??!1,a??!1,t,n.curveRings=[],i,s):le(l,o??!1,a??!1,t,n.rings,i,s))?(n.spatialReference=i,n.hasZ=ae(o,i),n.hasM=a,n):null}function se(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=re(e,e.spatialReference,t,n,i)}function re(e,t,n,i,s){const{xmin:r,ymin:l,xmax:o,ymax:a,hasZ:u,hasM:c}=e;if(!w(r,l,u?e.zmin:s,t,ue,i))return null;const h=ae(u,i);return n.xmin=ue[0],n.ymin=ue[1],h&&(n.zmin=ue[2]),w(o,a,u?e.zmax:s,t,ue,i)?(n.xmax=ue[0],n.ymax=ue[1],h&&(n.zmax=ue[2]),c&&(n.mmin=e.mmin,n.mmax=e.mmax),n.spatialReference=i,n):null}function le(e,t,n,i,s,r,l=0){const o=new Array;for(const n of e)for(const e of n)o.push(e[0],e[1],t?e[2]:l);if(!(0,v.projectBuffer)(o,i,0,o,r,0))return!1;let a=0;s.length=0;const u=t?3:2,c=ae(t,r);for(const t of e){const e=new Array;for(const i of t){const t=o.slice(a,a+=3);c||t.pop(),n&&t.push(i[u]),e.push(t)}s.push(e)}return!0}function oe(e,t,n,i,s,r,l=0){const o=new Array;for(const n of e)for(const e of n){if((0,I.FG)(e))return!1;if((0,I.aO)(e)){const[n,i]=e.c;o.push(n[0],n[1],t?n[2]:l,i[0],i[1],l);continue}if((0,I.n1)(e)){const[n,i,s]=e.b;o.push(n[0],n[1],t?n[2]:l,i[0],i[1],l,s[0],s[1],l);continue}const n=e;o.push(n[0],n[1],t?n[2]:l)}if(!(0,v.projectBuffer)(o,i,0,o,r,0))return!1;let a=0;s.length=0;const u=t?3:2,c=ae(t,r);for(const t of e){const e=new Array;for(const i of t){const t=o.slice(a,a+=3);if(c||t.pop(),n&&t.push((0,I.yP)(i)[u]),(0,I.FG)(i))return!1;if((0,I.aO)(i)){const n=o[a++],i=o[a++];++a,e.push({c:[t,[n,i]]});continue}if((0,I.n1)(i)){const n=o[a++],i=o[a++];++a;const s=o[a++],r=o[a++];++a,e.push({b:[t,[n,i],[s,r]]});continue}e.push(t)}s.push(e)}return!0}function ae(e,t){return e||(0,u.xP)(t)||(0,M.aI)(t,y.Y0)}const ue=(0,o.vt)()},98764(e,t,n){n.d(t,{GD:()=>l,Y0:()=>u,lO:()=>c});var i=n(73941),s=n(16930),r=n(21325);const l=new s.A(i.fv),o=new s.A(i.FY),a=new s.A(i.LJ),u=new s.A(i.Ro);function c(e){const t=h.get(e);if(t)return t;let n=l;if(e)if(e===o)n=o;else if(e===a)n=a;else{const t=e.wkid,i=e.latestWkid;if(null!=t||null!=i)(0,r.tl)(t)||(0,r.tl)(i)?n=o:((0,r.ZL)(t)||(0,r.ZL)(i))&&(n=a);else{const t=e.wkt2??e.wkt;if(t){const e=t.toUpperCase();e===f?n=o:e===d&&(n=a)}}}return h.set(e,n),n}const h=new Map,f=o.wkt.toUpperCase(),d=a.wkt.toUpperCase()},34403(e,t,n){n.d(t,{TP:()=>l});var i=n(79258);Math.PI;const s=i.$O.radius,r=i.$O.eccentricitySquared,l={a1:s*r,a2:s*r*s*r,a3:s*r*r/2,a4:s*r*s*r*2.5,a5:s*r+s*r*r/2,a6:1-r};i.$O.radius,i.$O.flattening,i.Sw.radius,i.Sw.flattening,i.sH.radius,i.sH.flattening,i.sH.radius},4146(e,t,n){n.d(t,{A:()=>_});var i=n(5482),s=n(11254),r=n(49186),l=n(65529),o=n(4902),a=n(92474),u=n(53966),c=n(17676),h=n(84952),f=n(91429),d=n(5443),p=n(16930),g=n(92602),m=n(79677);let y=0,_=class extends((0,l.Zt)((0,o.s)(a.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new d.A(-180,-90,180,90,p.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+y++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=p.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([n.e(812),n.e(7982)]).then(n.bind(n,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await Promise.all([n.e(812),n.e(5613),n.e(5710)]).then(n.bind(n,45613));try{return await i(t)}catch(e){const n=t?.portalItem,i=n?.id||"unset",s=n?.portal?.url||g.A.portalUrl;throw u.A.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,c.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,h.An)(this.url)}createLayerView(e,t){return Promise.reject(new r.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new r.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,f.MZ)({type:String})],_.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],_.prototype,"effectiveVisible",null),(0,i.Cg)([(0,f.MZ)({type:d.A})],_.prototype,"fullExtent",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],_.prototype,"hasAttributionData",null),(0,i.Cg)([(0,f.MZ)({type:String,clonable:!1})],_.prototype,"id",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,f.MZ)({type:["show","hide","hide-children"]})],_.prototype,"listMode",void 0),(0,i.Cg)([(0,f.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],_.prototype,"opacity",void 0),(0,i.Cg)([(0,f.MZ)({clonable:!1})],_.prototype,"parent",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,i.Cg)([(0,f.MZ)({type:Boolean,readOnly:!0})],_.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean})],_.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean})],_.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,f.MZ)({type:p.A})],_.prototype,"spatialReference",void 0),(0,i.Cg)([(0,f.MZ)({type:String})],_.prototype,"title",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],_.prototype,"type",void 0),(0,i.Cg)([(0,f.MZ)()],_.prototype,"url",void 0),(0,i.Cg)([(0,f.MZ)({type:m.A})],_.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"visible",void 0),_=(0,i.Cg)([(0,f.$K)("esri.layers.Layer")],_)},8303(e,t,n){n.d(t,{A:()=>w});var i=n(5482),s=n(92602),r=n(70333),l=n(11254),o=n(60999),a=n(49186),u=n(53966),c=n(97768),h=n(17676),f=n(84952),d=n(91429),p=n(77548),g=n(20655),m=n(80812),y=n(41318),_=n(10407),v=n(36005),b=n(43937);const w=e=>{const t=e;let w=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,n){if(t.itemId)return new m.default({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await n.e(1204).then(n.bind(n,41204));return(0,h.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,h.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,h.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:n,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,h.QP)(e)}}async _fetchUserPrivileges(e,t){let n=this.portalItem;if(!e||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!r.id?.findCredential(this.url),s=e===n.id;if(s&&n.portal.user)return this._getUserPrivileges(n,i);let l,o;if(s)l=n.portal.url;else try{l=await(0,p.wI)(this.url,t)}catch(e){(0,h.QP)(e)}if(!l||!(0,f.b8)(l,n.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(r.id?.getCredential(`${l}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.QP)(e)}const a=!0,u=!1,c=!1;if(!o)return{features:{edit:a,fullEdit:u},content:{updateItem:c}};try{if(s?await n.reload():(n=new m.default({id:e,portal:{url:l}}),await n.load(t)),n.portal.user)return this._getUserPrivileges(n,i)}catch(e){(0,h.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:c}}}_getUserPrivileges(e,t){const n=(0,_.It)(e);return t&&(n.features.edit=!0),n}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,h.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?r.id?.findCredential(this.url):null;if(!t)return!0;const n=A.credential===t?A.user:await this._fetchEditingUser(e);return A.credential=t,A.user=n,null==n?.privileges||n.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const n=r.id?.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const i=`${n.owningSystemUrl}/sharing/rest`,s=g.A.getDefault();if(s&&s.loaded&&(0,f.S8)(s.restUrl)===(0,f.S8)(i))return s.user;const a=`${i}/community/self`,u=null!=e?e.signal:null,c=await(0,o.Ke)((0,l.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?y.A.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const n=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||g.A.getDefault());return n&&i&&!(0,f.ut)(i.restUrl,n.restUrl)?(t.messages&&t.messages.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i.Cg)([(0,d.MZ)({type:m.default})],w.prototype,"portalItem",null),(0,i.Cg)([(0,v.w)("web-document","portalItem",["itemId"])],w.prototype,"readPortalItem",null),(0,i.Cg)([(0,b.K)("web-document","portalItem",{itemId:{type:String}})],w.prototype,"writePortalItem",null),(0,i.Cg)([(0,d.MZ)({clonable:!1})],w.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],w.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],w.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],w.prototype,"userHasUpdateItemPrivileges",void 0),w=(0,i.Cg)([(0,d.$K)("esri.layers.mixins.PortalLayer")],w),w},A={credential:null,user:null}},77548(e,t,n){n.d(t,{Gh:()=>x,tk:()=>S,BR:()=>I,p2:()=>C,qd:()=>E,wI:()=>M,G$:()=>z,$x:()=>R,Ov:()=>v,cM:()=>f,UC:()=>d,W_:()=>b,Qz:()=>p,OP:()=>P,TU:()=>_,F2:()=>g,XX:()=>y,jy:()=>w});var i=n(70333),s=n(11254),r=n(7762),l=(n(84952),n(36563)),o=n(36708),a=n(4146);const u=new WeakMap;function c(e){return!e.destroyed&&(u.has(e)||e.addHandles([(0,o.wB)(()=>{const{parent:t}=e;return!!(t&&t instanceof a.A)&&("catalog-dynamic-group"===t.type||c(t))},t=>u.set(e,t),o.pc),(0,l.hA)(()=>u.delete(e))]),u.get(e))}function h(e,t){return null!=e&&"object"==typeof e&&"type"in e&&e.type===t}function f(e){return h(e,"knowledge-graph")&&"layers"in e}function d(e){return h(e,"knowledge-graph-sublayer")}function p(e){return h(e,"link-chart")&&"layers"in e}function g(e){return h(e,"subtype-group")&&"sublayers"in e}function m(e){const t=e.parent;return function(e){return"group"===e?.type}(t)&&t.tables.includes(e)}n(16215);const y={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function _(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function v(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function b(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function w(e){return function(e){return null!=e&&"object"==typeof e&&"type"in e&&"oriented-imagery"===e.type}(e)||function(e){return h(e,"feature")}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)}function A(e){const t=e?.type;return"binning"===t||"cluster"===t}function C(e,t){if(!w(e))return;const n=t?.graphic,i=e.featureReduction;if(n){if(n.isAggregate){const e=n.origin;return e&&"featureReductionProvider"in e&&i?A(i)?i:null:void 0}return e}return t?.checkFeatureReduction&&i?A(i)?i:null:e}async function M(e,t){const n=i.id?.findServerInfo(e);if(null!=n?.currentVersion)return n.owningSystemUrl||null;const r=e.toLowerCase().indexOf("/rest/services");if(-1===r)return null;const l=`${e.slice(0,r)}/rest/info`,o=null!=t?t.signal:null,{data:a}=await(0,s.A)(l,{query:{f:"json"},responseType:"json",signal:o});return a?.owningSystemUrl||null}function I(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function S(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function E(e){const t=new r.A;for(const n of e.allLayers.concat(e.allTables))c(n)||m(n)||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function R(e,t){return null}function z(e){return null}function P(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function x(e,t){if(!t||!P(e))return;const n=(e.url,null);n&&(e.url=n)}},10407(e,t,n){n.d(t,{It:()=>d,LG:()=>l,OM:()=>u,Sm:()=>c,Y:()=>o,bK:()=>a,mm:()=>f,sQ:()=>h});var i=n(91218),s=n(16930),r=n(28735);function l(e,t){if(!o(e,t)){const n=e.typeKeywords;n?n.push(t):e.typeKeywords=[t]}}function o(e,t){return!!e.typeKeywords?.includes(t)}function a(e){return o(e,f.HOSTED_SERVICE)}function u(e,t){const n=e.typeKeywords;if(n){const e=n.indexOf(t);e>-1&&n.splice(e,1)}}function c(e,t,n){n?l(e,t):u(e,t)}async function h(e){const t=e.clone().normalize();let n;if(t.length>1)for(const e of t)n?e.width>n.width&&(n=e):n=e;else n=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,r.ci)(e);const n=s.A.WGS84;return await(0,i.initializeProjection)(t,n),(0,i.project)(e,n)}(n)}const f={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function d(e){const{portal:t,isOrgItem:n,itemControl:i}=e,s=t.user?.privileges;let r=!s||s.includes("features:user:edit"),l=!!n&&!!s?.includes("features:user:fullEdit");const o="update"===i||"admin"===i;return o?l=r=!0:l&&(r=!0),{features:{edit:r,fullEdit:l},content:{updateItem:o}}}},73133(e,t,n){n.d(t,{j:()=>i});const i=(0,n(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:"unknown"})},16215(e,t,n){n.d(t,{S:()=>s,Y:()=>i});const i=Symbol("BasemapInstance");function s(e){return null!=e&&"object"==typeof e&&i in e}},79677(e,t,n){n.d(t,{A:()=>f});var i,s=n(5482),r=n(25482),l=n(88930),o=n(91429),a=n(98623),u=n(10184),c=n(36005),h=n(43937);let f=class extends r.o{static{i=this}static get allTime(){return d}static get empty(){return p}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===i&&n===s}expandTo(e,t=a.qU){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let n=this.start;n&&(n=(0,l.lL)(n,new u.A({value:1,unit:e}),t));let s=this.end;if(s){const n=(0,l.lL)(s,new u.A({value:1,unit:e}),t);s=s.getTime()===n.getTime()?n:(0,l.S1)(n,1,e,t)}return new i({start:n,end:s})}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,n=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let l,o;return s>=t&&s<=n?l=s:t>=s&&t<=r&&(l=t),n>=s&&n<=r?o=n:r>=t&&r<=n&&(o=r),null==l||null==o||isNaN(l)||isNaN(o)?i.empty:new i({start:l===-1/0?null:new Date(l),end:o===1/0?null:new Date(o)})}offset(e,t,n=a.qU){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();const s=new i,{start:r,end:o}=this;return null!=r&&(s.start=(0,l.S1)(r,e,t,n)),null!=o&&(s.end=(0,l.S1)(o,e,t,n)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return d.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:n})}};(0,s.Cg)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],f.prototype,"end",void 0),(0,s.Cg)([(0,c.w)("end")],f.prototype,"readEnd",null),(0,s.Cg)([(0,h.K)("end")],f.prototype,"writeEnd",null),(0,s.Cg)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],f.prototype,"isAllTime",null),(0,s.Cg)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],f.prototype,"isEmpty",null),(0,s.Cg)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],f.prototype,"start",void 0),(0,s.Cg)([(0,c.w)("start")],f.prototype,"readStart",null),(0,s.Cg)([(0,h.K)("start")],f.prototype,"writeStart",null),f=i=(0,s.Cg)([(0,o.$K)("esri.time.TimeExtent")],f);const d=new f,p=new f({start:void 0,end:void 0})},10184(e,t,n){n.d(t,{A:()=>c});var i=n(5482),s=n(69540),r=n(25482),l=n(88930),o=n(91429),a=n(73133),u=n(93223);let c=class extends((0,s.OU)(r.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,l.t)(this.value,this.unit,"milliseconds")}};(0,i.Cg)([(0,u.e)(a.j,{nonNullable:!0})],c.prototype,"unit",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,json:{write:!0},nonNullable:!0})],c.prototype,"value",void 0),c=(0,i.Cg)([(0,o.$K)("esri.time.TimeInterval")],c)},78553(e,t,n){n.d(t,{D:()=>r,p:()=>s});var i=n(56507);function s(e){const t=(0,i.Vr)(100*(1-e));return Math.max(0,Math.min(t,100))}function r(e){const t=1-e/100;return Math.max(0,Math.min(t,1))}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5335,7716],{69540(e,t,n){n.d(t,{OU:()=>c,Pw:()=>h});var i=n(5482),s=n(69622),r=(n(44208),n(4718)),l=(n(53966),n(97768)),o=n(88620),a=n(64108);const u=Symbol("ClonableMixin"),c=e=>{var t;const n=e;let s=class extends n{constructor(){super(...arguments),this[t]=!0}static{t=u}clone(e){const t=(0,o.oY)(this);(0,l.Lw)(t,"unable to clone instance of non-accessor class");const n=t.metadata,i=t.store,s={},a=new Map;for(const t in n){const l=n[t],o=i?.originOf(t),u=l.clonable;if(l.readOnly||!1===u||7!==o&&0!==o&&5!==o&&4!==o)continue;const c=this[t];let h=null;if("function"==typeof u)h=u(c,e);else if("reference"===u)h=c;else if(h=(0,r.TU)(c,e),null!=c&&null==h)continue;0===o?a.set(t,h):s[t]=h}const u=new(0,Object.getPrototypeOf(this).constructor)(s);if(a.size){const e=(0,o.oY)(u)?.store;if(e)for(const[t,n]of a)e.set(t,n,0)}return u}};return s=(0,i.Cg)([(0,a.$)("esri.core.Clonable")],s),s},h=c(s.A)},7762(e,t,n){n.d(t,{A:()=>O});var i,s=n(5482),r=n(98291),l=n(4576),o=n(65529),a=n(36563),u=n(4718),c=n(53966),h=n(93687),f=n(76030),d=n(56507),p=n(62788),g=n(10107),m=n(7695),y=n(64108),_=n(95488),v=n(12195);class b{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}}class w{constructor(e,t,n,i,s){this.target=e,this.added=t,this.removed=n,this.start=i,this.deleteCount=s}}const A=new h.A(()=>new b,void 0,e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1});function C(e){e&&"object"==typeof e&&"destroy"in e&&"function"==typeof e.destroy&&e.destroy()}function M(e){return e?e instanceof L?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function I(e){if(e?.length)return e[0]}function S(e,t,n,i){const s=Math.min(e.length-n,t.length-i);let r=0;for(;r<s&&e[n+r]===t[i+r];)r++;return r}function E(e,t,n,i){t&&t.forEach((t,s,r)=>{e.push(t),E(e,n.call(i,t,s,r),n,i)})}const R=new Set,z=new Set,P=new Set,x=new Map;let T=0,L=i=class extends o.nJ{static ofType(e){if(!e)return i;if(x.has(e))return x.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const n in e.typeMap){const i=e.typeMap[n].prototype.declaredClass;t?t+=` | ${i}`:t=i}let n=class extends i{};return(0,s.Cg)([(0,m.u)({Type:e,ensureType:"function"==typeof e?(0,d.dp)(e):(0,d.aq)(e)})],n.prototype,"itemType",void 0),n=(0,s.Cg)([(0,y.$)(`esri.core.Collection<${t}>`)],n),x.set(e,n),n}static isCollection(e){return null!=e&&e instanceof i}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new _.I,this._length=0,this._items=[],Object.defineProperty(this,"uid",{value:T++})}normalizeCtorArgs(e){return e?(0,l.yc)(e)||e instanceof i?{items:e}:e:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),super.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get length(){return this._length}set length(e){e>this._length?c.A.getLogger(this).error("#length=","Cannot increase the length of the collection by assigning to the length property."):this.splice(e,Math.max(0,this._length-e))}get items(){return(0,p.gc)(this._observable),this._items}set items(e){this._emitBeforeChanges(1)||(this._splice(0,this.length,M(e)),this._emitAfterChanges(1))}hasEventListener(e){return!this.destroyed&&("change"===e?this._chgListeners.length>0:super.hasEventListener(e))}on(e,t){if(this.destroyed)return(0,a.hA)();if("change"===e){const e=this._chgListeners,n={removed:!1,callback:t};return e.push(n),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),(0,a.hA)(()=>{n.removed=!0,e.splice(e.indexOf(n),1)})}return super.on(e,t)}once(e,t){const n="deref"in t?()=>t.deref():()=>t,i=this.on(e,e=>{n()?.call(null,e),i.remove()});return i}add(e,t){if((0,p.gc)(this._observable),this._emitBeforeChanges(1))return this;const n=this.getNextIndex(t??null);return this._splice(n,0,[e]),this._emitAfterChanges(1),this}addMany(e,t=this._items.length){if((0,p.gc)(this._observable),!e?.length)return this;if(this._emitBeforeChanges(1))return this;const n=this.getNextIndex(t);return this._splice(n,0,M(e)),this._emitAfterChanges(1),this}at(e){if((0,p.gc)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(2))return[];const e=this._removeAllRaw();return this._emitAfterChanges(2),e}_removeAllRaw(){return 0===this.length?[]:this._splice(0,this.length)||[]}clone(){return(0,p.gc)(this._observable),this._createNewInstance({items:this._items.map(u.o8)})}concat(...e){(0,p.gc)(this._observable);const t=e.map(M);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(2))return;const n=this._splice(0,this.length),i=n.length;for(let s=0;s<i;s++)e.call(t,n[s],s,n);this._emitAfterChanges(2)}destroyAll(){this.drain(C)}destroyMany(e){const t=this.removeMany(e);return t.forEach(C),t}every(e,t){return(0,p.gc)(this._observable),this._items.every(e,t)}filter(e,t){(0,p.gc)(this._observable);const n=2===arguments.length?this._items.filter(e,t):this._items.filter(e);return this._createNewInstance({items:n})}find(e,t){return(0,p.gc)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,p.gc)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,p.gc)(this._observable);const n=[];return E(n,this,e,t),new i(n)}forEach(e,t){return(0,p.gc)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,p.gc)(this._observable),this._items[e]}getNextIndex(e){(0,p.gc)(this._observable);const t=this.length;return(e=e??t)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,p.gc)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,p.gc)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,p.gc)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,p.gc)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,p.gc)(this._observable);const n=this._items.map(e,t);return new i({items:n})}reorder(e,t=this.length-1){(0,p.gc)(this._observable);const n=this.indexOf(e);if(-1!==n){if(t<0?t=0:t>=this.length&&(t=this.length-1),n!==t){if(this._emitBeforeChanges(4))return e;this._splice(n,1),this._splice(t,0,[e]),this._emitAfterChanges(4)}return e}}pop(){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(2))return;const e=I(this._splice(this.length-1,1));return this._emitAfterChanges(2),e}push(...e){return(0,p.gc)(this._observable),this._emitBeforeChanges(1)||(this._splice(this.length,0,e),this._emitAfterChanges(1)),this.length}reduce(e,t){(0,p.gc)(this._observable);const n=this._items;return 2===arguments.length?n.reduce(e,t):n.reduce(e)}reduceRight(e,t){(0,p.gc)(this._observable);const n=this._items;return 2===arguments.length?n.reduceRight(e,t):n.reduceRight(e)}remove(e){return(0,p.gc)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,p.gc)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(2))return;const t=I(this._splice(e,1));return this._emitAfterChanges(2),t}removeMany(e){if((0,p.gc)(this._observable),!e?.length||this._emitBeforeChanges(2))return[];const t=e instanceof i?e.toArray():e,n=this._items,s=[],r=t.length;for(let e=0;e<r;e++){const i=t[e],r=n.indexOf(i);if(r>-1){const i=1+S(t,n,e+1,r+1),l=this._splice(r,i);l&&l.length>0&&s.push.apply(s,l),e+=i-1}}return this._emitAfterChanges(2),s}reverse(){if((0,p.gc)(this._observable),this._emitBeforeChanges(4))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(4),this}shift(){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(2))return;const e=I(this._splice(0,1));return this._emitAfterChanges(2),e}slice(e=0,t=this.length){return(0,p.gc)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,p.gc)(this._observable),this._items.some(e,t)}sort(e){if((0,p.gc)(this._observable),!this.length||this._emitBeforeChanges(4)||!this._requiresSort(e))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(4),this}_requiresSort(e=(e,t)=>e===t?0:e<t?-1:1){const t=this.length-1;for(let n=0;n<t;n++)if(e(this.items[n],this.items[n+1])>0)return!0;return!1}splice(e,t,...n){(0,p.gc)(this._observable),1===arguments.length&&(t=this.length),t??=0;const i=(t?2:0)|(n.length?1:0);if(this._emitBeforeChanges(i))return[];const s=this._splice(e,t,n)||[];return this._emitAfterChanges(i),s}toArray(){return(0,p.gc)(this._observable),this._items.slice()}toJSON(e){return(0,p.gc)(this._observable),this.toArray().map(t=>(0,v.W)(t)?t.toJSON(e):t)}toLocaleString(){return(0,p.gc)(this._observable),this._items.toLocaleString()}toString(){return(0,p.gc)(this._observable),this._items.toString()}unshift(...e){return(0,p.gc)(this._observable),!e.length||this._emitBeforeChanges(1)||(this._splice(0,0,e),this._emitAfterChanges(1)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,n){const i=this._items,s=this.itemType;let r,l;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=(0,f._)(()=>this._dispatchChange())),e<0&&(e+=this.length),t){if(l=i.splice(e,t),this.hasEventListener("before-remove")){const t=A.acquire();t.target=this,t.cancellable=!0;for(let n=0,s=l.length;n<s;n++)r=l[n],t.reset(r),this.emit("before-remove",t),t.defaultPrevented&&(l.splice(n,1),i.splice(e,0,r),e+=1,n-=1,s-=1);A.release(t)}if(this._length=this._items.length,this.hasEventListener("after-remove")){const e=A.acquire();e.target=this,e.cancellable=!1;const t=l.length;for(let n=0;n<t;n++)e.reset(l[n]),this.emit("after-remove",e);A.release(e)}}if(n?.length){if(s){const e=[];for(const t of n){const n=s.ensureType(t);null==n&&null!=t||e.push(n)}n=e}const t=this.hasEventListener("before-add"),r=this.hasEventListener("after-add"),l=e===this.length;if(t||r){const s=A.acquire();s.target=this,s.cancellable=!0;const o=A.acquire();o.target=this,o.cancellable=!1;for(const a of n)t?(s.reset(a),this.emit("before-add",s),s.defaultPrevented||(l?i.push(a):i.splice(e++,0,a),this._length=i.length,r&&(o.reset(a),this.emit("after-add",o)))):(l?i.push(a):i.splice(e++,0,a),this._length=i.length,o.reset(a),this.emit("after-add",o));A.release(o),A.release(s)}else{if(l)for(const e of n)i.push(e);else i.splice(e,0,...n);this._length=i.length}}if((n?.length||l?.length)&&this._notifyChangeEvent(n,l),this.hasEventListener("after-splice")){const i=new w(this,n,l,e,t);this.emit("after-splice",i)}return l}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const n=A.acquire();n.target=this,n.cancellable=!0,n.type=e,this.emit("before-changes",n),t=n.defaultPrevented,A.release(n)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=A.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),A.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),this._updating=!1,!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;R.clear(),z.clear(),P.clear();for(const{added:t,removed:n}of e){if(t)if(0===P.size&&0===z.size)for(const e of t)R.add(e);else for(const e of t)z.has(e)?(P.add(e),z.delete(e)):P.has(e)||R.add(e);if(n)if(0===P.size&&0===R.size)for(const e of n)z.add(e);else for(const e of n)R.has(e)?R.delete(e):(P.delete(e),z.add(e))}const n=r.A.acquire();R.forEach(e=>{n.push(e)});const i=r.A.acquire();z.forEach(e=>{i.push(e)});const s=this._items,l=t.items,o=r.A.acquire();if(P.forEach(e=>{l.indexOf(e)!==s.indexOf(e)&&o.push(e)}),t.listeners&&(n.length||i.length||o.length)){const e={target:this,added:n,removed:i,moved:o},s=t.listeners.length;for(let n=0;n<s;n++){const i=t.listeners[n];i.removed||i.callback.call(this,e)}}r.A.release(n),r.A.release(i),r.A.release(o)}R.clear(),z.clear(),P.clear()}};(0,s.Cg)([(0,g.MZ)()],L.prototype,"_updating",void 0),(0,s.Cg)([(0,g.MZ)()],L.prototype,"_length",void 0),(0,s.Cg)([(0,g.MZ)()],L.prototype,"length",null),(0,s.Cg)([(0,g.MZ)()],L.prototype,"items",null),(0,s.Cg)([(0,g.MZ)({readOnly:!0})],L.prototype,"updating",null),L=i=(0,s.Cg)([(0,y.$)("esri.core.Collection")],L);const O=L},4902(e,t,n){n.d(t,{s:()=>l});var i=n(5482),s=n(64108);let r=0;const l=e=>{const t=e;let n=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+r++})}};return n=(0,i.Cg)([(0,s.$)("esri.core.Identifiable")],n),n};l(class{})},66344(e,t,n){n.d(t,{q:()=>o});const i=!!(0,n(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class s{get size(){return this._size}constructor(e=10485760,t=.3){this._maxSize=e,this._maxClientSizeRatio=t,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._clients=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._clients.clear(),this._db.clear()}register(e){this._clients.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._clients.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}get _maxClientSize(){return this._maxSize*this._maxClientSizeRatio}getSize(e,t){const n=this._db.get(e.id+t);return n?.size??0}put(e,t,n,s,l){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!==n&&this._notifyRemove(t,o.entry,o.size,0)),s>this._maxSize)return void this._notifyRemove(t,n,s,0);if(void 0===n)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return i||console.warn(`Refusing to cache entry with size ${s} for key ${t}`),void this._notifyRemove(t,n,0,0);const a=1+Math.max(l,-4)- -3;this._db.set(t,new r(n,s,a)),this._size+=s,e.size+=s,this._checkSize()}updateSize(e,t){t=e.id+t;const n=this._db.get(t);if(!n)return;this._size-=n.size,e.size-=n.size;let i=n.entry.usedMemory;for(;i>this._maxSize;){const e=this._notifyRemove(t,n.entry,i,1);if(!(null!=e&&e>0))return void this._db.delete(t);i=e}n.size=i,this._size+=i,e.size+=i,this._checkSize()}pop(e,t){t=e.id+t;const n=this._db.get(t);if(n)return this._size-=n.size,e.size-=n.size,this._db.delete(t),++this._hit,n.entry;++this._miss}get(e,t){t=e.id+t;const n=this._db.get(t);if(void 0!==n)return this._db.delete(t),n.lives=n.lifetime,this._db.set(t,n),++this._hit,n.entry;++this._miss}peek(e,t){const n=this._db.get(e.id+t);return n?++this._hit:++this._miss,n?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},n=new Array;this._db.forEach((e,i)=>{const s=e.lifetime;n[s]=(n[s]||0)+e.size,this._clients.forEach(n=>{const{id:s,name:r}=n;if(i.startsWith(s)){const n=t[r]||0;t[r]=n+e.size}})});const i={};this._clients.forEach(e=>{const n=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const s=t[n]||0;t[n]=s,i[n]=Math.round(100*e.hitRate)+"%"}else i[n]="0%"});const s=Object.keys(t);s.sort((e,n)=>t[n]-t[e]),s.forEach(n=>e[n]=Math.round(t[n]/2**20)+"MB / "+i[n]);for(let t=n.length-1;t>=0;--t){const i=n[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._clients.forEach(e=>e.resetHitRate())}clear(e){const t=e.id;this._db.forEach((e,n)=>{n.startsWith(t)&&(this._size-=e.size,this._db.delete(n),this._notifyRemove(n,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._clients.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(const[t,n]of this._db)t.startsWith(e.id)&&(yield n.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,n,i){const s=this._clients.get(e.split(l)[0])?.removeFunc,r=s?.(t,i,n);return"number"==typeof r?r:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._clients.forEach(e=>this._checkSizeLimits(this._maxClientSize,e)),this._checkSizeLimits(this.maxSize)}setMaxClientSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){const n=t??this;if(n.size<=e)return;const i=t?.id;let s=!0;for(;s;){s=!1;for(const[r,o]of this._db)if(0===o.lifetime&&(!i||r.startsWith(i))){const i=t??this._clients.get(r.split(l)[0]);if(this._purgeItem(r,o,i),n.size<=.9*e)return;s||=this._db.has(r)}}for(const[s,r]of this._db)if(!i||s.startsWith(i)){const i=t??this._clients.get(s.split(l)[0]);if(this._purgeItem(s,r,i),n.size<=.9*e)return}}_purgeItem(e,t,n){if(this._db.delete(e),t.lives<=1){this._size-=t.size,n&&(n.size-=t.size);const i=this._notifyRemove(e,t.entry,t.size,1);null!=i&&i>0&&(this._size+=i,n&&(n.size+=i),t.lives=t.lifetime,t.size=i,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new s(0);class r{constructor(e,t,n){this.entry=e,this.size=t,this.lifetime=n,this.lives=n}}const l=":";class o{constructor(e,t){this.removeFunc=t,this.id="",this.name="",this.size=0,this._storage=new s(e,1),this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,n=1){this._storage.put(this,e,t,n,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},7695(e,t,n){function i(e){return(t,n)=>{t[n]=e}}n.d(t,{u:()=>i})},60999(e,t,n){n.d(t,{DZ:()=>p,Ke:()=>d,Tj:()=>c,UT:()=>g,aD:()=>y,jJ:()=>u});var i=n(5482),s=n(69622),r=n(97768),l=n(17676),o=n(10107),a=n(64108);function u(e,t,n){return(0,l.Lx)(e.map((e,i)=>t.apply(n,[e,i])))}async function c(e,t,n){return(await(0,l.Lx)(e.map((e,i)=>t.apply(n,[e,i])))).map(e=>e.value)}function h(e){return{ok:!0,value:e}}function f(e){return{ok:!1,error:e}}async function d(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return h(await e)}catch(e){return f(e)}}async function p(e){try{return h(await e)}catch(e){return(0,l.QP)(e),f(e)}}function g(e,t){return new m(e,t)}let m=class extends s.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,r.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:n}=this._abortController;this.promise=e(n),this.promise.then(e=>{this._result=h(e),this._cleanup()},e=>{this._result=f(e),this._cleanup()}),this._abortHandle=(0,l.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,r.xt)(this._abortHandle),this._abortController=null}};(0,i.Cg)([(0,o.MZ)()],m.prototype,"value",null),(0,i.Cg)([(0,o.MZ)()],m.prototype,"error",null),(0,i.Cg)([(0,o.MZ)()],m.prototype,"finished",null),(0,i.Cg)([(0,o.MZ)()],m.prototype,"promise",void 0),(0,i.Cg)([(0,o.MZ)()],m.prototype,"_result",void 0),m=(0,i.Cg)([(0,a.$)("esri.core.asyncUtils.ReactiveTask")],m);class y{constructor(){this._sequence=Promise.resolve()}async acquire(){let e;this._sequence=new Promise(t=>{e=this._sequence.then(()=>t,()=>t)});const t=await e;return{[Symbol.dispose]:t}}async run(e){const t={stack:[],error:void 0,hasError:!1};try{return(0,i.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,i.hk)(t)}}}},36708(e,t,n){n.d(t,{C_:()=>f,OH:()=>g,Vh:()=>m,on:()=>h,pc:()=>y,wB:()=>a,z7:()=>u});var i=n(37955),s=n(36563),r=n(97768),l=n(17676),o=n(14012);function a(e,t,n={}){return c(e,t,n,d)}function u(e,t,n={}){return c(e,t,n,p)}function c(e,t,n={},i){let s=null;const l=n.once?(e,n)=>{i(e)&&((0,r.xt)(s),t(e,n))}:(e,n)=>{i(e)&&t(e,n)};if(s=(0,o.Cn)(e,l,n.sync,n.equals),n.initial){const t=e();l(t,t)}return s}function h(e,t,n,l={}){let o=null,u=null,c=null;function h(){o&&u&&(u.remove(),l.onListenerRemove?.(o),o=null,u=null)}function f(e){l.once&&l.once&&(0,r.xt)(c),n(e)}const d=a(e,(e,n)=>{h(),(0,i.wb)(e)&&(o=e,u=(0,i.on)(e,t,f),l.onListenerAdd?.(e))},{sync:l.sync,initial:!0});return c=(0,s.hA)(()=>{d.remove(),h()}),c}function f(e,t){return function(e,t,n){if((0,l.G4)(n))return Promise.reject((0,l.NK)());const i=e();if(t?.(i))return Promise.resolve(i);let o=null;function a(){o=(0,r.xt)(o)}return new Promise((i,r)=>{o=(0,s.vE)([(0,l.u7)(n,()=>{a(),r((0,l.NK)())}),c(e,e=>{a(),i(e)},{sync:!1,once:!0},t??d)])})}(e,p,t)}function d(e){return!0}function p(e){return!!e}n(80559);const g={sync:!0},m={initial:!0},y={sync:!0,initial:!0}},83027(e,t,n){n.d(t,{h:()=>i});const i=n(29953).ho},159(e,t,n){n.d(t,{A:()=>u});var i,s=n(5482),r=n(69540),l=n(25482),o=n(91429),a=n(99157);let u=i=class extends((0,r.OU)(l.o)){constructor(e){super(e),this.steps=[]}getInverse(){const e=new i;for(let t=this.steps.length-1;t>=0;t--){const n=this.steps[t];e.steps.push(n.getInverse())}return e}};(0,s.Cg)([(0,o.MZ)({type:[a.A],nonNullable:!0,json:{name:"geoTransforms"}})],u.prototype,"steps",void 0),u=i=(0,s.Cg)([(0,o.$K)("esri.geometry.operators.support.GeographicTransformation")],u)},99157(e,t,n){n.d(t,{A:()=>a});var i,s=n(5482),r=n(69540),l=n(25482),o=n(91429);let a=i=class extends((0,r.OU)(l.o)){constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new i({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,s.Cg)([(0,o.MZ)({json:{name:"transformForward",read:e=>!e,write:(e,t,n)=>{t[n]=!e}}})],a.prototype,"isInverse",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0}})],a.prototype,"wkt",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0}})],a.prototype,"wkid",void 0),a=i=(0,s.Cg)([(0,o.$K)("esri.geometry.operators.support.GeographicTransformationStep")],a)},9762(e,t,n){n.r(t),n.d(t,{projectBuffer:()=>s});var i=n(49208);function s(e,t,n,s,r,l,o=Math.floor(e.length/3)){const a=(0,i.jd)(t,r);if(null==a)return!1;if(a===i.pO){if(e===s&&n===l)return!0;const t=n+3*o;for(let i=n,r=l;i<t;i++,r++)s[r]=e[i]??0;return!0}const u=n+3*o;for(let t=n,i=l;t<u;t+=3,i+=3)a(e,t,s,i);return!0}},49208(e,t,n){n.d(t,{Tp:()=>h,jd:()=>c,pO:()=>d,w5:()=>u});var i=n(34727),s=n(86211),r=n(73941),l=n(79258),o=n(34403),a=n(21325);const u={2:{5:d,7:null,9:null,10:d,1:w,6:null,8:null,0:null,3:g,11:m,2:d,4:S},5:{5:d,7:null,9:null,10:d,1:w,6:null,8:null,0:null,3:g,11:m,2:d,4:S},7:{5:null,7:d,9:null,10:d,1:null,6:b,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:d,10:d,1:null,6:null,8:v,0:null,3:null,11:null,2:null,4:null},3:{5:p,7:null,9:null,10:p,1:function(e,t,n,i){const s=e[t]/T,r=x-2*Math.atan(Math.exp(-e[t+1]/T)),l=T+(e[t+2]??0),o=Math.cos(r)*l;n[i]=Math.cos(s)*o,n[i+1]=Math.sin(s)*o,n[i+2]=Math.sin(r)*l},6:null,8:null,0:null,3:d,11:function(e,t,n,i){p(e,t,n,i),m(n,i,n,i)},2:p,4:function(e,t,n,i){p(e,t,n,i),S(n,i,n,i)}},4:{5:E,7:null,9:null,10:E,1:function(e,t,n,i){E(e,t,n,i),w(n,i,n,i)},6:null,8:null,0:null,3:function(e,t,n,i){E(e,t,n,i),g(n,i,n,i)},11:function(e,t,n,i){E(e,t,n,i),m(n,i,n,i)},2:E,4:d},1:{5:I,7:null,9:null,10:I,1:d,6:null,8:null,0:null,3:function(e,t,n,i){I(e,t,n,i),g(n,i,n,i)},11:function(e,t,n,i){I(e,t,n,i),m(n,i,n,i)},2:I,4:function(e,t,n,i){I(e,t,n,i),S(n,i,n,i)}},6:{5:null,7:M,9:null,10:M,1:null,6:d,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:C,10:C,1:null,6:null,8:d,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:d,3:null,11:null,2:null,4:null},10:{5:d,7:d,9:d,10:d,1:w,6:b,8:v,0:null,3:g,11:m,2:d,4:S},11:{5:y,7:null,9:null,10:y,1:function(e,t,n,i){y(e,t,n,i),w(n,i,n,i)},6:null,8:null,0:null,3:function(e,t,n,i){y(e,t,n,i),g(n,i,n,i)},11:d,2:y,4:function(e,t,n,i){y(e,t,n,i),S(n,i,n,i)}}};function c(e,t){return h(e,t)?.projector}function h(e,t){if(null==e||null==t)return null;if(R.source.spatialReference===e&&R.dest.spatialReference===t)return R;const n=f(e,R.source),i=f(t,R.dest);return 0===n&&0===i?(0,a.aI)(e,t)?R.projector=d:R.projector=null:R.projector=u[n][i],R}function f(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,s.GA)(e,1)),(0,r.jA)(e)?t.spatialReferenceId=1:(0,a.oT)(e)?t.spatialReferenceId=2:(0,a.K8)(e)?t.spatialReferenceId=3:(0,a.r1)(e)?t.spatialReferenceId=11:e.wkt===r.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===r.FY.wkt?t.spatialReferenceId=6:e.wkt===r.LJ.wkt?t.spatialReferenceId=8:(0,r.q8)(e)?t.spatialReferenceId=7:(0,r.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function d(e,t,n,i){e!==n&&(n[i++]=e[t++],n[i++]=e[t++],n[i]=e[t]??0)}function p(e,t,n,i){n[i]=P*(e[t]/T),n[i+1]=P*(x-2*Math.atan(Math.exp(-e[t+1]/T))),n[i+2]=e[t+2]??0}function g(e,t,n,s){!function(e,t,n,s,r){const l=.4999999*Math.PI,o=(0,i.qE)(z*e[t+1],-l,l),a=Math.sin(o);n[s++]=z*e[t]*r.radius,n[s++]=r.halfSemiMajorAxis*Math.log((1+a)/(1-a)),n[s]=e[t+2]??0}(e,t,n,s,l.$O)}function m(e,t,n,i){n[i]=e[t]*L,n[i+1]=e[t+1]*L,n[i+2]=e[t+2]??0}function y(e,t,n,i){n[i]=e[t]*O,n[i+1]=e[t+1]*O,n[i+2]=e[t+2]??0}function _(e,t,n,i,s){const r=s+(e[t+2]??0),l=z*e[t],o=z*e[t+1],a=Math.cos(o)*r;n[i]=Math.cos(l)*a,n[i+1]=Math.sin(l)*a,n[i+2]=Math.sin(o)*r}function v(e,t,n,i){_(e,t,n,i,l.Sw.radius)}function b(e,t,n,i){_(e,t,n,i,l.sH.radius)}function w(e,t,n,i){_(e,t,n,i,l.$O.radius)}function A(e,t,n,s,r){const l=e[t],o=e[t+1],a=e[t+2]??0,u=Math.sqrt(l*l+o*o+a*a),c=(0,i.YN)(a/(0===u?1:u)),h=Math.atan2(o,l);n[s++]=P*h,n[s++]=P*c,n[s]=u-r}function C(e,t,n,i){A(e,t,n,i,l.Sw.radius)}function M(e,t,n,i){A(e,t,n,i,l.sH.radius)}function I(e,t,n,i){A(e,t,n,i,l.$O.radius)}function S(e,t,n,i){!function(e,t,n,i,s){const r=z*e[t],l=z*e[t+1],o=e[t+2]??0,a=Math.sin(l),u=Math.cos(l),c=s.radius/Math.sqrt(1-s.eccentricitySquared*a*a);n[i++]=(c+o)*u*Math.cos(r),n[i++]=(c+o)*u*Math.sin(r),n[i++]=(c*(1-s.eccentricitySquared)+o)*a}(e,t,n,i,l.$O)}function E(e,t,n,i){const s=o.TP,r=e[t],a=e[t+1],u=e[t+2]??0;let c,h,f,d,p,g,m,y,_,v,b,w,A,C,M,I,S,E,R,z,x;c=Math.abs(u),h=r*r+a*a,f=Math.sqrt(h),d=h+u*u,p=Math.sqrt(d),z=Math.atan2(a,r),g=u*u/d,m=h/d,C=s.a2/p,M=s.a3-s.a4/p,m>.3?(y=c/p*(1+m*(s.a1+C+g*M)/p),R=Math.asin(y),v=y*y,_=Math.sqrt(1-v)):(_=f/p*(1-g*(s.a5-C-m*M)/p),R=Math.acos(_),v=1-_*_,y=Math.sqrt(v)),b=1-l.$O.eccentricitySquared*v,w=l.$O.radius/Math.sqrt(b),A=s.a6*w,C=f-w*_,M=c-A*y,S=_*C+y*M,I=_*M-y*C,E=I/(A/b+S),R+=E,x=S+I*E/2,u<0&&(R=-R),n[i++]=P*z,n[i++]=P*R,n[i]=x}const R={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:d},z=(0,i.kU)(1),P=(0,i.KJ)(1),x=.5*Math.PI,T=l.$O.radius,L=T*Math.PI/180,O=180/(T*Math.PI)},91218(e,t,n){n.r(t),n.d(t,{canProjectWithoutEngine:()=>K,initializeProjection:()=>W,isEqualBaseGCS:()=>F,isLoaded:()=>T,isLoadedOrLoad:()=>L,isLoadedOrLoadFor:()=>O,load:()=>U,project:()=>k,projectAsync:()=>G,projectExtent:()=>se,projectMany:()=>Z,projectMultipoint:()=>Q,projectOrLoad:()=>D,projectOrLoadMany:()=>q,projectPoint:()=>V,projectPolygon:()=>ne,projectPolyline:()=>ee,projectWithoutEngine:()=>Y,requiresLoad:()=>j,test:()=>H,tryProject:()=>B,unload:()=>N});var i=n(49186),s=n(17676),r=n(62788),l=n(95488),o=n(51850),a=n(21276),u=n(73941),c=n(5443),h=n(91075),f=n(48526),d=n(86738),p=n(39829),g=n(82799),m=n(16930),y=n(98764),_=n(159),v=n(9762),b=n(49208);function w(e,t,n,i,s,r){return A[0]=e,A[1]=t,A[2]=n,(0,v.projectBuffer)(A,i,0,s,r,0)}const A=(0,o.vt)();var C=n(60408),M=n(21325),I=n(52006);let S=null,E=null,R=null,z=null,P={};const x=new l.I;function T(){return!!(E?.isLoaded()&&R?.isLoaded()&&z?.isLoaded())}function L(){return!!T()||((0,r.gc)(x),U(),!1)}function O(e,t){return!e||!t||K(e,t)||L()}function j(e,t){return!K(e,t)&&!T()}async function U(e){null==S&&(S=Promise.all([n.e(3276).then(n.bind(n,83276)).then(e=>(E=e,E.load())),n.e(8377).then(n.bind(n,8377)).then(e=>(R=e,R.load())),n.e(2158).then(n.bind(n,12158)).then(e=>(z=e,z.load()))])),await S,(0,s.Te)(e),x.notify()}function k(e,t,n){return Array.isArray(e)?0===e.length?[]:((0,a.H)(e),Z(e,e[0].spatialReference,t,n)):((0,a.f)(e),Z([e],e.spatialReference,t,n)[0])}function Z(e,t,n,i){if(null==t||null==n)return e;if(K(t,n,i))return e.map(e=>Y(e,t,n));if(null==i?.geographicTransformation&&(0,u.jA)(t))return Z(e.map(e=>Y(e,t,m.A.WGS84)),m.A.WGS84,n,{zConversionDisabled:i?.zConversionDisabled});if(null==i?.geographicTransformation&&(0,u.jA)(n))return Z(e,t,m.A.WGS84).map(e=>Y(e,m.A.WGS84,n));if(!T())throw new $;if(!i?.geographicTransformation)if(i?.extendedParams)i={...i,geographicTransformation:z.getTransformation(t,n,i.areaOfInterestExtent)||new _.A};else if(!i?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,n);let s=P[e];s||(s=z.getTransformation(t,n)||new _.A,P[e]=s),i={geographicTransformation:s,zConversionDisabled:i?.zConversionDisabled}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof h.A?E.executeMany(e,n,i):R.executeMany(e,n,i)}function B(e,t,n){try{return k(e,t,n)}catch(e){return null}}function D(e,t){const n=q([e],t);return null!=n.pending?{pending:n.pending,geometry:null}:null!=n.geometries?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function q(e,t,n){if(!T())for(const n of e)if(null!=n&&!(0,M.aI)(n.spatialReference,t)&&(0,M.fn)(n.spatialReference)&&(0,M.fn)(t)&&!K(n.spatialReference,t))return(0,r.gc)(x),{pending:U(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,M.aI)(e.spatialReference,t)?e:(0,M.fn)(e.spatialReference)&&(0,M.fn)(t)?k(e,t,n):null)}}class $ extends i.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function N(){S=null,E=null,R=null,z=null,P={}}const H={get loadPromise(){return S}};async function G(e,t,n){if((0,s.Te)(n),!e)return e;const i=q(Array.isArray(e)?e:[e],t,n);if(i.pending)return await i.pending,(0,s.Te)(n),G(e,t,n);const r=i.geometries??[];return Array.isArray(e)?r:r[0]}function K(e,t,n){return!(n?.areaOfInterestExtent||n?.extendedParams||n?.geographicTransformation)&&(!!(0,M.aI)(e,t)||(0,M.fn)(e)&&(0,M.fn)(t)&&!!(0,b.jd)(e,t))}function F(e,t){if((0,M.aI)(e,t))return!0;if(!(0,M.fn)(e)||!(0,M.fn)(t))return!1;const n=(0,M.oT)(e)||(0,M.K8)(e)||(0,M.x1)(e),i=(0,M.oT)(t)||(0,M.K8)(t)||(0,M.x1)(t);return n&&i}async function W(e,t,n,i){if(T())return(0,s.NO)(i);if(Array.isArray(e)){for(const{source:t,dest:n,options:s}of e)if(t&&n&&!K(t,n,s))return U(i)}else if(e&&t&&!K(e,t,n))return U(i);return(0,s.NO)(i)}function Y(e,t,n){return e?(0,C.fT)(e)?J(e,t,new d.A,n,0):(0,C.ZC)(e)?re(e,t,new c.A,n,0):(0,C.Bi)(e)?ie(e,t,new p.A,n,0):(0,C.Rg)(e)?te(e,t,new g.A,n,0):(0,C.U9)(e)?X(e,t,new f.A,n,0):null:null}function V(e,t,n=t.spatialReference,i=0){return null!=n&&null!=e.spatialReference&&null!=J(e,e.spatialReference,t,n,i)}function J(e,t,n,i,s){ue[0]=e.x,ue[1]=e.y;const r=e.z;return ue[2]=void 0!==r?r:s,(0,v.projectBuffer)(ue,t,0,ue,i,0)?(n.x=ue[0],n.y=ue[1],n.spatialReference=i,void 0!==r||(0,u.xP)(i)?(n.z=ue[2],n.hasZ=!0):(n.z=void 0,n.hasZ=!1),void 0===e.m?(n.m=void 0,n.hasM=!1):(n.m=e.m,n.hasM=!0),n):null}function Q(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=X(e,e.spatialReference,t,n,i)}function X(e,t,n,i,s){const{points:r,hasZ:l,hasM:o}=e,a=[],u=r.length,c=[];for(const e of r)c.push(e[0],e[1],l?e[2]:s);if(!(0,v.projectBuffer)(c,t,0,c,i,0,u))return null;const h=ae(l,i);for(let e=0;e<u;++e){const t=3*e,n=c[t],i=c[t+1];h&&o?a.push([n,i,c[t+2],r[e][3]]):h?a.push([n,i,c[t+2]]):o?a.push([n,i,r[e][2]]):a.push([n,i])}return n.points=a,n.spatialReference=i,n.hasZ=l,n.hasM=o,n}function ee(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=te(e,e.spatialReference,t,n,i)}function te(e,t,n,i,s){const{curvePaths:r,paths:l,hasZ:o,hasM:a}=e;if(!(r?oe(r,o??!1,a??!1,t,n.curvePaths=[],i,s):le(l,o??!1,a??!1,t,n.paths,i,s)))return null;const u=ae(o,i);return n.spatialReference=i,n.hasZ=u,n.hasM=a,n}function ne(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=ie(e,e.spatialReference,t,n,i)}function ie(e,t,n,i,s){const{curveRings:r,rings:l,hasZ:o,hasM:a}=e;return(r?oe(r,o??!1,a??!1,t,n.curveRings=[],i,s):le(l,o??!1,a??!1,t,n.rings,i,s))?(n.spatialReference=i,n.hasZ=ae(o,i),n.hasM=a,n):null}function se(e,t,n=t.spatialReference,i=0){return null!=e.spatialReference&&null!=n&&null!=re(e,e.spatialReference,t,n,i)}function re(e,t,n,i,s){const{xmin:r,ymin:l,xmax:o,ymax:a,hasZ:u,hasM:c}=e;if(!w(r,l,u?e.zmin:s,t,ue,i))return null;const h=ae(u,i);return n.xmin=ue[0],n.ymin=ue[1],h&&(n.zmin=ue[2]),w(o,a,u?e.zmax:s,t,ue,i)?(n.xmax=ue[0],n.ymax=ue[1],h&&(n.zmax=ue[2]),c&&(n.mmin=e.mmin,n.mmax=e.mmax),n.spatialReference=i,n):null}function le(e,t,n,i,s,r,l=0){const o=new Array;for(const n of e)for(const e of n)o.push(e[0],e[1],t?e[2]:l);if(!(0,v.projectBuffer)(o,i,0,o,r,0))return!1;let a=0;s.length=0;const u=t?3:2,c=ae(t,r);for(const t of e){const e=new Array;for(const i of t){const t=o.slice(a,a+=3);c||t.pop(),n&&t.push(i[u]),e.push(t)}s.push(e)}return!0}function oe(e,t,n,i,s,r,l=0){const o=new Array;for(const n of e)for(const e of n){if((0,I.FG)(e))return!1;if((0,I.aO)(e)){const[n,i]=e.c;o.push(n[0],n[1],t?n[2]:l,i[0],i[1],l);continue}if((0,I.n1)(e)){const[n,i,s]=e.b;o.push(n[0],n[1],t?n[2]:l,i[0],i[1],l,s[0],s[1],l);continue}const n=e;o.push(n[0],n[1],t?n[2]:l)}if(!(0,v.projectBuffer)(o,i,0,o,r,0))return!1;let a=0;s.length=0;const u=t?3:2,c=ae(t,r);for(const t of e){const e=new Array;for(const i of t){const t=o.slice(a,a+=3);if(c||t.pop(),n&&t.push((0,I.yP)(i)[u]),(0,I.FG)(i))return!1;if((0,I.aO)(i)){const n=o[a++],i=o[a++];++a,e.push({c:[t,[n,i]]});continue}if((0,I.n1)(i)){const n=o[a++],i=o[a++];++a;const s=o[a++],r=o[a++];++a,e.push({b:[t,[n,i],[s,r]]});continue}e.push(t)}s.push(e)}return!0}function ae(e,t){return e||(0,u.xP)(t)||(0,M.aI)(t,y.Y0)}const ue=(0,o.vt)()},98764(e,t,n){n.d(t,{GD:()=>l,Y0:()=>u,lO:()=>c});var i=n(73941),s=n(16930),r=n(21325);const l=new s.A(i.fv),o=new s.A(i.FY),a=new s.A(i.LJ),u=new s.A(i.Ro);function c(e){const t=h.get(e);if(t)return t;let n=l;if(e)if(e===o)n=o;else if(e===a)n=a;else{const t=e.wkid,i=e.latestWkid;if(null!=t||null!=i)(0,r.tl)(t)||(0,r.tl)(i)?n=o:((0,r.ZL)(t)||(0,r.ZL)(i))&&(n=a);else{const t=e.wkt2??e.wkt;if(t){const e=t.toUpperCase();e===f?n=o:e===d&&(n=a)}}}return h.set(e,n),n}const h=new Map,f=o.wkt.toUpperCase(),d=a.wkt.toUpperCase()},34403(e,t,n){n.d(t,{TP:()=>l});var i=n(79258);Math.PI;const s=i.$O.radius,r=i.$O.eccentricitySquared,l={a1:s*r,a2:s*r*s*r,a3:s*r*r/2,a4:s*r*s*r*2.5,a5:s*r+s*r*r/2,a6:1-r};i.$O.radius,i.$O.flattening,i.Sw.radius,i.Sw.flattening,i.sH.radius,i.sH.flattening,i.sH.radius},4146(e,t,n){n.d(t,{A:()=>_});var i=n(5482),s=n(11254),r=n(49186),l=n(65529),o=n(4902),a=n(92474),u=n(53966),c=n(17676),h=n(84952),f=n(91429),d=n(5443),p=n(16930),g=n(92602),m=n(79677);let y=0,_=class extends((0,l.Zt)((0,o.s)(a.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new d.A(-180,-90,180,90,p.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+y++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=p.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([n.e(812),n.e(7982)]).then(n.bind(n,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await Promise.all([n.e(812),n.e(5613),n.e(909)]).then(n.bind(n,45613));try{return await i(t)}catch(e){const n=t?.portalItem,i=n?.id||"unset",s=n?.portal?.url||g.A.portalUrl;throw u.A.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,c.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,h.An)(this.url)}createLayerView(e,t){return Promise.reject(new r.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new r.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,f.MZ)({type:String})],_.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],_.prototype,"effectiveVisible",null),(0,i.Cg)([(0,f.MZ)({type:d.A})],_.prototype,"fullExtent",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],_.prototype,"hasAttributionData",null),(0,i.Cg)([(0,f.MZ)({type:String,clonable:!1})],_.prototype,"id",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,f.MZ)({type:["show","hide","hide-children"]})],_.prototype,"listMode",void 0),(0,i.Cg)([(0,f.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],_.prototype,"opacity",void 0),(0,i.Cg)([(0,f.MZ)({clonable:!1})],_.prototype,"parent",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,i.Cg)([(0,f.MZ)({type:Boolean,readOnly:!0})],_.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean})],_.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean})],_.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,f.MZ)({type:p.A})],_.prototype,"spatialReference",void 0),(0,i.Cg)([(0,f.MZ)({type:String})],_.prototype,"title",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],_.prototype,"type",void 0),(0,i.Cg)([(0,f.MZ)()],_.prototype,"url",void 0),(0,i.Cg)([(0,f.MZ)({type:m.A})],_.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"visible",void 0),_=(0,i.Cg)([(0,f.$K)("esri.layers.Layer")],_)},8303(e,t,n){n.d(t,{A:()=>w});var i=n(5482),s=n(92602),r=n(70333),l=n(11254),o=n(60999),a=n(49186),u=n(53966),c=n(97768),h=n(17676),f=n(84952),d=n(91429),p=n(77548),g=n(20655),m=n(80812),y=n(41318),_=n(10407),v=n(36005),b=n(43937);const w=e=>{const t=e;let w=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,n){if(t.itemId)return new m.default({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await n.e(1204).then(n.bind(n,41204));return(0,h.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,h.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,h.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:n,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,h.QP)(e)}}async _fetchUserPrivileges(e,t){let n=this.portalItem;if(!e||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!r.id?.findCredential(this.url),s=e===n.id;if(s&&n.portal.user)return this._getUserPrivileges(n,i);let l,o;if(s)l=n.portal.url;else try{l=await(0,p.wI)(this.url,t)}catch(e){(0,h.QP)(e)}if(!l||!(0,f.b8)(l,n.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(r.id?.getCredential(`${l}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.QP)(e)}const a=!0,u=!1,c=!1;if(!o)return{features:{edit:a,fullEdit:u},content:{updateItem:c}};try{if(s?await n.reload():(n=new m.default({id:e,portal:{url:l}}),await n.load(t)),n.portal.user)return this._getUserPrivileges(n,i)}catch(e){(0,h.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:c}}}_getUserPrivileges(e,t){const n=(0,_.It)(e);return t&&(n.features.edit=!0),n}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,h.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?r.id?.findCredential(this.url):null;if(!t)return!0;const n=A.credential===t?A.user:await this._fetchEditingUser(e);return A.credential=t,A.user=n,null==n?.privileges||n.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const n=r.id?.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const i=`${n.owningSystemUrl}/sharing/rest`,s=g.A.getDefault();if(s&&s.loaded&&(0,f.S8)(s.restUrl)===(0,f.S8)(i))return s.user;const a=`${i}/community/self`,u=null!=e?e.signal:null,c=await(0,o.Ke)((0,l.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?y.A.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const n=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||g.A.getDefault());return n&&i&&!(0,f.ut)(i.restUrl,n.restUrl)?(t.messages&&t.messages.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i.Cg)([(0,d.MZ)({type:m.default})],w.prototype,"portalItem",null),(0,i.Cg)([(0,v.w)("web-document","portalItem",["itemId"])],w.prototype,"readPortalItem",null),(0,i.Cg)([(0,b.K)("web-document","portalItem",{itemId:{type:String}})],w.prototype,"writePortalItem",null),(0,i.Cg)([(0,d.MZ)({clonable:!1})],w.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],w.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],w.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],w.prototype,"userHasUpdateItemPrivileges",void 0),w=(0,i.Cg)([(0,d.$K)("esri.layers.mixins.PortalLayer")],w),w},A={credential:null,user:null}},77548(e,t,n){n.d(t,{Gh:()=>x,tk:()=>S,BR:()=>I,p2:()=>C,qd:()=>E,wI:()=>M,G$:()=>z,$x:()=>R,Ov:()=>v,cM:()=>f,UC:()=>d,W_:()=>b,Qz:()=>p,OP:()=>P,TU:()=>_,F2:()=>g,XX:()=>y,jy:()=>w});var i=n(70333),s=n(11254),r=n(7762),l=(n(84952),n(36563)),o=n(36708),a=n(4146);const u=new WeakMap;function c(e){return!e.destroyed&&(u.has(e)||e.addHandles([(0,o.wB)(()=>{const{parent:t}=e;return!!(t&&t instanceof a.A)&&("catalog-dynamic-group"===t.type||c(t))},t=>u.set(e,t),o.pc),(0,l.hA)(()=>u.delete(e))]),u.get(e))}function h(e,t){return null!=e&&"object"==typeof e&&"type"in e&&e.type===t}function f(e){return h(e,"knowledge-graph")&&"layers"in e}function d(e){return h(e,"knowledge-graph-sublayer")}function p(e){return h(e,"link-chart")&&"layers"in e}function g(e){return h(e,"subtype-group")&&"sublayers"in e}function m(e){const t=e.parent;return function(e){return"group"===e?.type}(t)&&t.tables.includes(e)}n(16215);const y={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function _(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function v(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function b(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function w(e){return function(e){return null!=e&&"object"==typeof e&&"type"in e&&"oriented-imagery"===e.type}(e)||function(e){return h(e,"feature")}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)}function A(e){const t=e?.type;return"binning"===t||"cluster"===t}function C(e,t){if(!w(e))return;const n=t?.graphic,i=e.featureReduction;if(n){if(n.isAggregate){const e=n.origin;return e&&"featureReductionProvider"in e&&i?A(i)?i:null:void 0}return e}return t?.checkFeatureReduction&&i?A(i)?i:null:e}async function M(e,t){const n=i.id?.findServerInfo(e);if(null!=n?.currentVersion)return n.owningSystemUrl||null;const r=e.toLowerCase().indexOf("/rest/services");if(-1===r)return null;const l=`${e.slice(0,r)}/rest/info`,o=null!=t?t.signal:null,{data:a}=await(0,s.A)(l,{query:{f:"json"},responseType:"json",signal:o});return a?.owningSystemUrl||null}function I(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function S(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function E(e){const t=new r.A;for(const n of e.allLayers.concat(e.allTables))c(n)||m(n)||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function R(e,t){return null}function z(e){return null}function P(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function x(e,t){if(!t||!P(e))return;const n=(e.url,null);n&&(e.url=n)}},10407(e,t,n){n.d(t,{It:()=>d,LG:()=>l,OM:()=>u,Sm:()=>c,Y:()=>o,bK:()=>a,mm:()=>f,sQ:()=>h});var i=n(91218),s=n(16930),r=n(28735);function l(e,t){if(!o(e,t)){const n=e.typeKeywords;n?n.push(t):e.typeKeywords=[t]}}function o(e,t){return!!e.typeKeywords?.includes(t)}function a(e){return o(e,f.HOSTED_SERVICE)}function u(e,t){const n=e.typeKeywords;if(n){const e=n.indexOf(t);e>-1&&n.splice(e,1)}}function c(e,t,n){n?l(e,t):u(e,t)}async function h(e){const t=e.clone().normalize();let n;if(t.length>1)for(const e of t)n?e.width>n.width&&(n=e):n=e;else n=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,r.ci)(e);const n=s.A.WGS84;return await(0,i.initializeProjection)(t,n),(0,i.project)(e,n)}(n)}const f={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function d(e){const{portal:t,isOrgItem:n,itemControl:i}=e,s=t.user?.privileges;let r=!s||s.includes("features:user:edit"),l=!!n&&!!s?.includes("features:user:fullEdit");const o="update"===i||"admin"===i;return o?l=r=!0:l&&(r=!0),{features:{edit:r,fullEdit:l},content:{updateItem:o}}}},73133(e,t,n){n.d(t,{j:()=>i});const i=(0,n(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:"unknown"})},16215(e,t,n){n.d(t,{S:()=>s,Y:()=>i});const i=Symbol("BasemapInstance");function s(e){return null!=e&&"object"==typeof e&&i in e}},79677(e,t,n){n.d(t,{A:()=>f});var i,s=n(5482),r=n(25482),l=n(88930),o=n(91429),a=n(98623),u=n(10184),c=n(36005),h=n(43937);let f=class extends r.o{static{i=this}static get allTime(){return d}static get empty(){return p}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===i&&n===s}expandTo(e,t=a.qU){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let n=this.start;n&&(n=(0,l.lL)(n,new u.A({value:1,unit:e}),t));let s=this.end;if(s){const n=(0,l.lL)(s,new u.A({value:1,unit:e}),t);s=s.getTime()===n.getTime()?n:(0,l.S1)(n,1,e,t)}return new i({start:n,end:s})}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,n=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let l,o;return s>=t&&s<=n?l=s:t>=s&&t<=r&&(l=t),n>=s&&n<=r?o=n:r>=t&&r<=n&&(o=r),null==l||null==o||isNaN(l)||isNaN(o)?i.empty:new i({start:l===-1/0?null:new Date(l),end:o===1/0?null:new Date(o)})}offset(e,t,n=a.qU){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();const s=new i,{start:r,end:o}=this;return null!=r&&(s.start=(0,l.S1)(r,e,t,n)),null!=o&&(s.end=(0,l.S1)(o,e,t,n)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return d.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:n})}};(0,s.Cg)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],f.prototype,"end",void 0),(0,s.Cg)([(0,c.w)("end")],f.prototype,"readEnd",null),(0,s.Cg)([(0,h.K)("end")],f.prototype,"writeEnd",null),(0,s.Cg)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],f.prototype,"isAllTime",null),(0,s.Cg)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],f.prototype,"isEmpty",null),(0,s.Cg)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],f.prototype,"start",void 0),(0,s.Cg)([(0,c.w)("start")],f.prototype,"readStart",null),(0,s.Cg)([(0,h.K)("start")],f.prototype,"writeStart",null),f=i=(0,s.Cg)([(0,o.$K)("esri.time.TimeExtent")],f);const d=new f,p=new f({start:void 0,end:void 0})},10184(e,t,n){n.d(t,{A:()=>c});var i=n(5482),s=n(69540),r=n(25482),l=n(88930),o=n(91429),a=n(73133),u=n(93223);let c=class extends((0,s.OU)(r.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,l.t)(this.value,this.unit,"milliseconds")}};(0,i.Cg)([(0,u.e)(a.j,{nonNullable:!0})],c.prototype,"unit",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,json:{write:!0},nonNullable:!0})],c.prototype,"value",void 0),c=(0,i.Cg)([(0,o.$K)("esri.time.TimeInterval")],c)},78553(e,t,n){n.d(t,{D:()=>r,p:()=>s});var i=n(56507);function s(e){const t=(0,i.Vr)(100*(1-e));return Math.max(0,Math.min(t,100))}function r(e){const t=1-e/100;return Math.max(0,Math.min(t,1))}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2555],{49403(e,t,r){r.d(t,{Eq:()=>p,G3:()=>i,GH:()=>a,bV:()=>l,nP:()=>o,r5:()=>u,ti:()=>d,vy:()=>s,wr:()=>n});const n={esriMethodHintUNSPECIFIED:0,esriUUIDESRI:1,esriUUIDRFC4122:2},a={esriSplitPolicyType_UNSPECIFIED:0,esriSplitPolicyTypeGeometryRatio:1,esriSplitPolicyTypeDuplicate:2,esriSplitPolicyTypeDefaultValue:3},o={esriTypeUNSPECIFIED:0,esriTypeEntity:1,esriTypeRelationship:2,esriTypeBoth:4,esriTypeMetaEntityProvenance:8},i={esriMergePolicyType_UNSPECIFIED:0,esriMergePolicyTypeSumValues:1,esriMergePolicyTypeAreaWeighted:2,esriMergePolicyTypeDefaultValue:3},s={esriIdentifierInfoTypeUNSPECIFIED:0,esriIdentifierInfoTypeDatabaseNative:1,esriIdentifierInfoTypeUniformProperty:2},d={esriGraphPropertyUNSPECIFIED:0,esriGraphPropertyRegular:1,esriGraphPropertyDocumentName:2,esriGraphPropertyDocumentTitle:3,esriGraphPropertyDocumentUrl:4,esriGraphPropertyDocumentText:5,esriGraphPropertyDocumentKeywords:6,esriGraphPropertyDocumentContentType:7,esriGraphPropertyDocumentMetadata:8,esriGraphPropertyDocumentFileExtension:9,esriGraphPropertyProvenanceInstanceId:10,esriGraphPropertyProvenanceSourceType:11,esriGraphPropertyProvenanceSourceName:12,esriGraphPropertyProvenanceSource:13,esriGraphPropertyProvenanceComment:14,esriGraphPropertyProvenanceTypeName:15,esriGraphPropertyProvenancePropertyName:16},l={esriGeometryNull:0,esriGeometryPoint:1,esriGeometryMultipoint:2,esriGeometryPolyline:3,esriGeometryPolygon:4,esriGeometryEnvelope:5,esriGeometryAny:7,esriGeometryMultiPatch:9},u={esriFieldTypeSmallInteger:0,esriFieldTypeInteger:1,esriFieldTypeSingle:2,esriFieldTypeDouble:3,esriFieldTypeString:4,esriFieldTypeDate:5,esriFieldTypeOID:6,esriFieldTypeGeometry:7,esriFieldTypeBlob:8,esriFieldTypeRaster:9,esriFieldTypeGUID:10,esriFieldTypeGlobalID:11,esriFieldTypeXML:12,esriFieldTypeBigInteger:13,esriFieldTypeDateOnly:14,esriFieldTypeTimeOnly:15,esriFieldTypeTimestampOffset:16},p={Regular:0,Provenance:1,Document:2}},45724(e,t,r){r.d(t,{I:()=>s});var n=r(2741),a=r(44208);const o="esri/rest/knowledgeGraph/wasmInterface/";let i;async function s(){if(i)return i;const e=!!(0,a.A)("wasm-simd");return i=d(e),i}async function d(e){if(e){const{default:e}=await r.e(5367).then(r.bind(r,15367));return e({locateFile:e=>(0,n.s)(o+e)})}const{default:t}=await r.e(9013).then(r.bind(r,29013));return t({locateFile:e=>(0,n.s)(o+e)})}},2555(e,t,r){r.r(t),r.d(t,{_checkAuthentication:()=>Gr,_esriRequestWrapper:()=>Ar,_fetchWrapper:()=>br,_getClientDataCacheCopy:()=>Jt,_setMaxQueryParsingDurationForTesting:()=>Sr,_submitJobWrapper:()=>Cr,clearClientDataCache:()=>vr,clientDataCache:()=>zt,executeAddDomain:()=>wr,executeAddGraphFieldIndex:()=>rr,executeAddGraphProperties:()=>Xt,executeAddNamedTypes:()=>Ht,executeApplyEdits:()=>Bt,executeDeleteDomain:()=>_r,executeDeleteGraphFieldIndex:()=>nr,executeDeleteGraphProperty:()=>er,executeDeleteNamedType:()=>Wt,executeFindPaths:()=>gr,executeFindPathsAsynchronous:()=>hr,executeQuery:()=>or,executeQueryStreaming:()=>ir,executeSearch:()=>sr,executeSearchStreaming:()=>dr,executeUpdateDomain:()=>mr,executeUpdateGraphProperty:()=>tr,executeUpdateNamedType:()=>Yt,executeUpdateSearchIndex:()=>ar,fetchAllClientDataKeys:()=>lr,fetchAsynchronousFindPathsResultData:()=>fr,fetchClientDataAtKeys:()=>ur,fetchKnowledgeGraph:()=>pr,kgRestServices:()=>Qt,refreshDataModel:()=>cr,refreshServiceDefinition:()=>yr});var n,a=r(70333),o=r(11254),i=r(49186),s=r(53966),d=r(17676),l=r(91075),u=r(16930),p=r(5482),c=r(69622),y=r(91429),h=r(56507),g=r(5443);let f=n=class extends c.A{constructor(e){super(e),this.outSpatialReference=null,this.processExtent=null,this.processSpatialReference=null,this.returnColumnName=!1,this.returnFeatureCollection=!1,this.returnM=!1,this.returnZ=!1}static from(e){return(0,h.PZ)(n,e)}};(0,p.Cg)([(0,y.MZ)({type:u.A})],f.prototype,"outSpatialReference",void 0),(0,p.Cg)([(0,y.MZ)({type:g.A})],f.prototype,"processExtent",void 0),(0,p.Cg)([(0,y.MZ)({type:u.A})],f.prototype,"processSpatialReference",void 0),(0,p.Cg)([(0,y.MZ)({nonNullable:!0})],f.prototype,"returnColumnName",void 0),(0,p.Cg)([(0,y.MZ)({nonNullable:!0})],f.prototype,"returnFeatureCollection",void 0),(0,p.Cg)([(0,y.MZ)({nonNullable:!0})],f.prototype,"returnM",void 0),(0,p.Cg)([(0,y.MZ)({nonNullable:!0})],f.prototype,"returnZ",void 0),f=n=(0,p.Cg)([(0,y.$K)("esri.rest.geoprocessor.GPOptions")],f);var w=r(17136),m=r(20437),_=r(25482);let v=class extends _.o{constructor(e){super(e),this.extent=null,this.height=null,this.href=null,this.opacity=1,this.rotation=0,this.scale=null,this.visible=!0,this.width=null}};(0,p.Cg)([(0,y.MZ)({type:g.A})],v.prototype,"extent",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"height",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"href",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"opacity",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"rotation",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"scale",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"visible",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"width",void 0),v=(0,p.Cg)([(0,y.$K)("esri.layers.support.MapImage")],v);var b=r(2272),C=r(2073),A=r(93223);let G=class extends _.o{constructor(e){super(e),this.area=0,this.units=null}};(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],G.prototype,"area",void 0),(0,p.Cg)([(0,A.e)(C.UO)],G.prototype,"units",void 0),G=(0,p.Cg)([(0,y.$K)("esri.rest.support.ArealUnit")],G);let M=class extends _.o{constructor(e){super(e),this.itemId=null,this.url=null}};(0,p.Cg)([(0,y.MZ)({type:String,json:{read:{source:"itemID"},write:{target:"itemID"}}})],M.prototype,"itemId",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],M.prototype,"url",void 0),M=(0,p.Cg)([(0,y.$K)("esri.rest.support.DataFile")],M);var T=r(22671);let x=class extends _.o{constructor(e){super(e),this.distance=0,this.units=null}};(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],x.prototype,"distance",void 0),(0,p.Cg)([(0,A.e)(C.Y8)],x.prototype,"units",void 0),x=(0,p.Cg)([(0,y.$K)("esri.rest.support.LinearUnit")],x);var P=r(66552);const S="multi-value-",k=new P.J({GPArealUnit:"areal-unit",GPBoolean:"boolean",GPComposite:"composite",GPDataFile:"data-file",GPDate:"date",GPDouble:"double",GPFeatureRecordSetLayer:"feature-record-set-layer",Field:"field",GPLinearUnit:"linear-unit",GPLong:"long",GPRasterData:"raster-data",GPRasterDataLayer:"raster-data-layer",GPRecordSet:"record-set",GPString:"string",GPTimeUnit:"time-unit",GPValueTable:"value-table","GPMultiValue:GPArealUnit":`${S}areal-unit`,"GPMultiValue:GPBoolean":`${S}boolean`,"GPMultiValue:GPComposite":`${S}composite`,"GPMultiValue:GPDataFile":`${S}data-file`,"GPMultiValue:GPDate":`${S}date`,"GPMultiValue:GPDouble":`${S}double`,"GPMultiValue:GPFeatureRecordSetLayer":`${S}feature-record-set-layer`,"GPMultiValue:Field":`${S}field`,"GPMultiValue:GPLinearUnit":`${S}linear-unit`,"GPMultiValue:GPLong":`${S}long`,"GPMultiValue:GPRasterData":`${S}raster-data`,"GPMultiValue:GPRasterDataLayer":`${S}raster-data-layer`,"GPMultiValue:GPRecordSet":`${S}record-set`,"GPMultiValue:GPString":`${S}string`,"GPMultiValue:GPTimeUnit":`${S}time-unit`});let D=class extends _.o{constructor(e){super(e),this.dataType=null,this.paramName=null,this.value=null}};(0,p.Cg)([(0,A.e)(k,{ignoreUnknown:!1})],D.prototype,"dataType",void 0),(0,p.Cg)([(0,y.MZ)()],D.prototype,"paramName",void 0),(0,p.Cg)([(0,y.MZ)()],D.prototype,"value",void 0),D=(0,p.Cg)([(0,y.$K)("esri.rest.support.ParameterValue")],D);var R=r(36005);let j=class extends _.o{constructor(e){super(e),this.format=null,this.itemId=null,this.type=null,this.url=null}readType(e){return"ImageService"===e?"image-service":null}};(0,p.Cg)([(0,y.MZ)()],j.prototype,"format",void 0),(0,p.Cg)([(0,y.MZ)({json:{name:"itemID",write:!0}})],j.prototype,"itemId",void 0),(0,p.Cg)([(0,y.MZ)()],j.prototype,"type",void 0),(0,p.Cg)([(0,R.w)("type")],j.prototype,"readType",null),(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],j.prototype,"url",void 0),j=(0,p.Cg)([(0,y.$K)("esri.rest.support.RasterData")],j);var I=r(73133);let Z=class extends _.o{constructor(e){super(e),this.time=0,this.units=null}};async function E(e,t){switch(e){case"time-unit":return Z.fromJSON(t);case"areal-unit":return G.fromJSON(t);case"boolean":case"double":case"long":case"string":case"value-table":return t;case"date":return new Date(t);case"data-file":return M.fromJSON(t);case"linear-unit":return x.fromJSON(t);case"feature-record-set-layer":if("url"in t)return M.fromJSON(t);if("layerDefinition"in t){const e=new(0,(await Promise.all([r.e(7632),r.e(8278),r.e(7865),r.e(6554),r.e(9953),r.e(8303),r.e(1733),r.e(1214),r.e(1956),r.e(8399),r.e(1017),r.e(4674),r.e(6606),r.e(8589),r.e(7609),r.e(1135)]).then(r.bind(r,18589))).default),{layerDefinition:n,featureSet:a}=t;return e.read({layerDefinition:n,featureSet:a},{origin:"portal-item"}),e.spatialReference=u.A.fromJSON(a.spatialReference??n.spatialReference??n.extent.spatialReference),e}return T.A.fromJSON(t);case"record-set":return"url"in t?M.fromJSON(t):T.A.fromJSON(t);case"raster-data":case"raster-data-layer":return"mapImage"in t?v.fromJSON(t.mapImage):j.fromJSON(t);case"field":return m.A.fromJSON(t)}}function F(e){return e.startsWith(S)}function N(e){return e.replace(S,"")}async function $(e){const t=k.fromJSON(e.dataType),{paramName:r}=e,n=F(t)?await async function(e,t){const r=N(e),n="composite"===r?t.map(e=>E(k.fromJSON(e.dataType),e.value)):t.map(e=>E(r,e));return Promise.all(n)}(t,e.value):await E(t,e.value);return new D({dataType:t,paramName:r,value:n})}function O(e,t,r){for(const t in e){const r=e[t];Array.isArray(r)?e[t]=JSON.stringify(r.map(e=>O({item:e},!0).item)):r instanceof Date&&(e[t]=r.getTime())}return(0,b.lF)(e,t,r)}(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],Z.prototype,"time",void 0),(0,p.Cg)([(0,A.e)(I.j)],Z.prototype,"units",void 0),Z=(0,p.Cg)([(0,y.$K)("esri.rest.support.TimeUnit")],Z);var q,K=r(37807);const U=(0,P.O)()({esriJobCancelled:"job-cancelled",esriJobCancelling:"job-cancelling",esriJobDeleted:"job-deleted",esriJobDeleting:"job-deleting",esriJobTimedOut:"job-timed-out",esriJobExecuting:"job-executing",esriJobFailed:"job-failed",esriJobNew:"job-new",esriJobSubmitted:"job-submitted",esriJobSucceeded:"job-succeeded",esriJobWaiting:"job-waiting"},{ignoreUnknown:!1}),L=1e3;let V=class extends _.o{static{q=this}constructor(e){super(e),this.jobId=null,this.jobStatus=null,this.messages=null,this.progress=null,this.requestOptions=null,this.sourceUrl=null,this._cancelJobTimer=void 0,this._jobCompletionTimer=void 0}async cancelJob(e){const{jobId:t,sourceUrl:r}=this,{path:n}=(0,b.Dl)(r),a={...this.requestOptions,...e,query:{f:"json"}},i=`${n}/jobs/${t}/cancel`,{data:s}=await(0,o.A)(i,a),{messages:l,jobStatus:u,progress:p}=q.fromJSON(s);return this.set({messages:l,jobStatus:u,progress:p}),"job-cancelled"===u?this:new Promise((t,r)=>{(0,d.u7)(a.signal,()=>{this.clearCancelJobTimer(),r((0,d.NK)())}),this.clearCancelJobTimer();const n=()=>{this._cancelJobTimer||r((0,d.NK)()),this.checkJobStatus(e).then(({jobStatus:e})=>{switch(e){case"job-cancelling":default:this._cancelJobTimer=setTimeout(n,L);break;case"job-deleted":case"job-deleting":case"job-executing":case"job-failed":case"job-new":case"job-submitted":case"job-succeeded":case"job-timed-out":case"job-waiting":r(this);break;case"job-cancelled":t(this)}}).catch(e=>{r(e)})};this._cancelJobTimer=setTimeout(n,L)})}destroy(){clearInterval(this._cancelJobTimer),clearInterval(this._jobCompletionTimer)}async checkJobStatus(e){const{path:t}=(0,b.Dl)(this.sourceUrl),r={...this.requestOptions,...e,query:{...e?.query,f:"json"}},n=`${t}/jobs/${this.jobId}`,{data:a}=await(0,o.A)(n,r),{messages:i,jobStatus:s,progress:d}=q.fromJSON(a);return this.set({messages:i,jobStatus:s,progress:d}),this}async fetchResultData(e,t,r){t=f.from(t||{});const{returnColumnName:n,returnFeatureCollection:a,returnM:i,returnZ:s,outSpatialReference:d}=t,{path:l}=(0,b.Dl)(this.sourceUrl),u=O({returnColumnName:n||null,returnFeatureCollection:a||null,returnM:i||null,returnZ:s||null,outSR:d,returnType:"data",f:"json",...r?.query},null),p={...this.requestOptions,...r,query:u},c=`${l}/jobs/${this.jobId}/results/${e}`,{data:y}=await(0,o.A)(c,p);return $(y)}async fetchResultImage(e,t,r){const{path:n}=(0,b.Dl)(this.sourceUrl),a=O({...t.toJSON(),f:"json"}),i={...this.requestOptions,...r,query:a},s=`${n}/jobs/${this.jobId}/results/${e}`,{data:d}=await(0,o.A)(s,i);return $(d)}async fetchResultMapImageLayer(){const{path:e}=(0,b.Dl)(this.sourceUrl),t=e.indexOf("/GPServer/"),n=`${e.slice(0,Math.max(0,t))}/MapServer/jobs/${this.jobId}`;return new(0,(await Promise.all([r.e(8278),r.e(7865),r.e(6554),r.e(8303),r.e(1733),r.e(1214),r.e(1956),r.e(8399),r.e(4674),r.e(893),r.e(7048),r.e(2733)]).then(r.bind(r,7656))).default)({url:n})}async waitForJobCompletion(e={}){const{interval:t=L,signal:r,statusCallback:n,apiKey:a}=e;return new Promise((e,o)=>{(0,d.u7)(r,()=>{this.clearJobCompletionTimer(),o((0,d.NK)())}),this.clearJobCompletionTimer();const i=()=>{this._jobCompletionTimer||o((0,d.NK)()),this.checkJobStatus({query:{token:a}}).then(({jobStatus:r})=>{switch(r){case"job-succeeded":e(this);break;case"job-executing":case"job-new":case"job-submitted":case"job-waiting":n&&n(this),this._jobCompletionTimer=setTimeout(i,t);break;case"job-cancelled":case"job-cancelling":case"job-deleted":case"job-deleting":case"job-failed":case"job-timed-out":o(this);break;default:this._jobCompletionTimer=setTimeout(i,t)}}).catch(e=>{o(e)})};this._jobCompletionTimer=setTimeout(i,t)})}clearCancelJobTimer(){clearTimeout(this._cancelJobTimer),this._cancelJobTimer=void 0}clearJobCompletionTimer(){clearTimeout(this._jobCompletionTimer),this._jobCompletionTimer=void 0}};(0,p.Cg)([(0,y.MZ)()],V.prototype,"jobId",void 0),(0,p.Cg)([(0,A.e)(U,{ignoreUnknown:!1})],V.prototype,"jobStatus",void 0),(0,p.Cg)([(0,y.MZ)({type:[K.A]})],V.prototype,"messages",void 0),(0,p.Cg)([(0,y.MZ)()],V.prototype,"progress",void 0),(0,p.Cg)([(0,y.MZ)()],V.prototype,"requestOptions",void 0),(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],V.prototype,"sourceUrl",void 0),V=q=(0,p.Cg)([(0,y.$K)("esri.rest.support.JobInfo")],V);let z=class extends c.A{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1,this.dataModelTimestamp=null}};(0,p.Cg)([(0,y.MZ)()],z.prototype,"headerKeys",void 0),(0,p.Cg)([(0,y.MZ)()],z.prototype,"outSpatialReference",void 0),(0,p.Cg)([(0,y.MZ)()],z.prototype,"exceededTransferLimit",void 0),(0,p.Cg)([(0,y.MZ)()],z.prototype,"dataModelTimestamp",void 0),z=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphQueryResultHeader")],z);let J=class extends c.A{constructor(e){super(e),this.resultRows=[],this.resultHeader=new z}};(0,p.Cg)([(0,y.MZ)()],J.prototype,"resultRows",void 0),(0,p.Cg)([(0,y.MZ)()],J.prototype,"resultHeader",void 0),J=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphQueryResult")],J);let Q=class extends c.A{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new z}};(0,p.Cg)([(0,y.MZ)()],Q.prototype,"resultRowsStream",void 0),(0,p.Cg)([(0,y.MZ)()],Q.prototype,"resultHeader",void 0),Q=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],Q);var B=r(8631);let H=class extends _.o{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=!0,this.description="",this.fieldNames=[]}};(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],H.prototype,"name",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],H.prototype,"unique",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],H.prototype,"ascending",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],H.prototype,"description",void 0),(0,p.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],H.prototype,"fieldNames",void 0),H=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.FieldIndex")],H);let W=class extends _.o{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=!0,this.required=!1,this.defaultVisibility=!0,this.systemMaintained=null,this.role="esriGraphPropertyUNSPECIFIED",this.domain=null,this.defaultValue=null}};(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"name",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"alias",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"fieldType",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"geometryType",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"hasM",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"hasZ",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"nullable",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"editable",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"required",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"defaultVisibility",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"systemMaintained",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"role",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"domain",void 0),(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],W.prototype,"defaultValue",void 0),W=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphProperty")],W);let Y=class extends _.o{constructor(e){super(e),this.name=null,this.alias=null,this.role="Regular",this.strict=null,this.properties=[],this.fieldIndexes=[],this.type=null}};(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Y.prototype,"name",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Y.prototype,"alias",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Y.prototype,"role",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Y.prototype,"strict",void 0),(0,p.Cg)([(0,y.MZ)({type:[W],json:{write:!0}})],Y.prototype,"properties",void 0),(0,p.Cg)([(0,y.MZ)({type:[H],json:{write:!0}})],Y.prototype,"fieldIndexes",void 0),Y=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphObjectType")],Y);let X=class extends Y{constructor(e){super(e),this.type="entity"}};X=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.EntityType")],X);let ee=class extends Y{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],ee.prototype,"endPoints",void 0),ee=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.RelationshipType")],ee);let te=class extends _.o{constructor(e){super(e),this.value=null,this.behavior=null}};(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],te.prototype,"value",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],te.prototype,"behavior",void 0),te=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],te);let re=class extends _.o{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=[],this.entityTypes=[],this.relationshipTypes=[],this.metaEntityTypes=[],this.provenanceSourceTypeValues=[],this.domains=[]}};(0,p.Cg)([(0,y.MZ)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e?.getTime()}}}})],re.prototype,"timestamp",void 0),(0,p.Cg)([(0,y.MZ)({type:u.A,json:{write:!0}})],re.prototype,"spatialReference",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],re.prototype,"strict",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],re.prototype,"objectIdField",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],re.prototype,"globalIdField",void 0),(0,p.Cg)([(0,y.MZ)()],re.prototype,"arcgisManaged",void 0),(0,p.Cg)([(0,y.MZ)()],re.prototype,"identifierInfo",void 0),(0,p.Cg)([(0,y.MZ)()],re.prototype,"searchIndexes",void 0),(0,p.Cg)([(0,y.MZ)({type:[X],json:{write:!0}})],re.prototype,"entityTypes",void 0),(0,p.Cg)([(0,y.MZ)({type:[ee],json:{write:!0}})],re.prototype,"relationshipTypes",void 0),(0,p.Cg)([(0,y.MZ)({type:[X],json:{write:!0}})],re.prototype,"metaEntityTypes",void 0),(0,p.Cg)([(0,y.MZ)({type:[te],json:{write:!0}})],re.prototype,"provenanceSourceTypeValues",void 0),(0,p.Cg)([(0,y.MZ)({types:[B.g],json:{write:!0}})],re.prototype,"domains",void 0),re=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.DataModel")],re);let ne=class extends _.o{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,this.supportsProvenance=!1}};(0,p.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],ne.prototype,"capabilities",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"supportsSearch",void 0),(0,p.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],ne.prototype,"supportedQueryFormats",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"allowGeometryUpdates",void 0),(0,p.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ne.prototype,"searchMaxRecordCount",void 0),(0,p.Cg)([(0,y.MZ)({type:Object,json:{write:!0}})],ne.prototype,"serviceCapabilities",void 0),(0,p.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ne.prototype,"maxRecordCount",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ne.prototype,"description",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ne.prototype,"copyrightText",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ne.prototype,"units",void 0),(0,p.Cg)([(0,y.MZ)({type:u.A,json:{write:!0}})],ne.prototype,"spatialReference",void 0),(0,p.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ne.prototype,"currentVersion",void 0),(0,p.Cg)([(0,y.MZ)({type:Object,json:{write:!0}})],ne.prototype,"dateFieldsTimeReference",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ne.prototype,"serviceItemId",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"supportsDocuments",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"dataEditingNotSupported",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"schemaEditingNotSupported",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"supportsProvenance",void 0),ne=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.ServiceDefinition")],ne);let ae=class extends _.o{constructor(e){super(e),this.url=null,this.dataModel=null,this.serviceDefinition=null}};function oe(e,t,r){if(0!==e.error_code)throw new i.A(t,r,{errorCode:e.error_code,errorMessage:e.error_message})}function ie(e){return e?.error_code?new i.A("knowledgeGraphService:server-or-decoding-error",e.error_message,{errorCode:e.error_code}):void 0}function se(e,t,r,n=!1){const a=new r.ClientDataFetchRequestEncoder;a.deleteLater();for(const o of e){const e=de(o,t,r,n);a.add_client_data_fetch_request_parameter(e)}a.encode();const o=a.get_encoding_result();return oe(o.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(o.get_byte_buffer())}function de(e,t,r,n){const a=new r.ClientDataKey;a.deleteLater(),a.key_string=e;const o=new r.ClientDataFetchRequestParameter;o.deleteLater(),o.set_key(a);const i=t.get(e);return i&&!n&&(o.v_tag={v_tag:i.version}),o}(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ae.prototype,"url",void 0),(0,p.Cg)([(0,y.MZ)({type:re,json:{write:!0}})],ae.prototype,"dataModel",void 0),(0,p.Cg)([(0,y.MZ)({type:ne,json:{write:!0}})],ae.prototype,"serviceDefinition",void 0),ae=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.KnowledgeGraph")],ae);var le=r(45724),ue=r(48526),pe=r(86738),ce=r(39829),ye=r(82799);const he={exclude:0,include:1};function ge(e,t){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(me(e,t))}),r}function fe(e,t){const r=new t.ObjectValue;r.deleteLater();for(const[n,a]of Object.entries(e))r.set_key_value(n,me(a,t));return r}function we(e,t){if(e instanceof ue.A)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=[],a=[];a[0]=e.points.length;let o=0;return e.points.forEach(e=>{e.forEach(e=>{n[o]=e,o++})}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(a),r}(e,t);if(e instanceof pe.A)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=[],a=[];a[0]=1,n[0]=e.x,n[1]=e.y;let o=2;return e.hasZ&&(n[o]=e.z,o++),e.hasM&&(n[o]=e.m,o++),r.coords=new Float64Array(n),r.lengths=new Uint32Array(a),r}(e,t);if(e instanceof ye.A||e instanceof ce.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],a=[];let o=[];e instanceof ye.A?(r.geometry_type=t.esriGeometryType.esriGeometryPolyline,o=e.paths):e instanceof ce.A&&(r.geometry_type=t.esriGeometryType.esriGeometryPolygon,o=e.rings);let i=0,s=0;return o.forEach(e=>{let t=0;e.forEach(e=>{t++,e.forEach(e=>{n[s]=e,s++})}),a[i]=t,i++}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(a),r}(e,t);throw new i.A("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function me(e,t){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof l.A)return we(e,t);if(Array.isArray(e)){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(me(e,t))}),r}return fe(e,t)}var _e=r(49403);function ve(e,t){if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(!("originId"in e)){const r=new t.EntityValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,a]of Object.entries(e.properties))r.set_key_value(n,Te(a,t));return e.id&&r.set_id(e.id),r}if("originId"in e&&"destinationId"in e){const r=new t.RelationshipValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,a]of Object.entries(e.properties))r.set_key_value(n,Te(a,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.A("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function be(e,t){const r=new t.GraphProperty;return r.deleteLater(),r.name=e.name,r.alias=e.alias??"",r.field_type={value:_e.r5[e.fieldType]},r.geometry_type={value:e.geometryType?_e.bV[e.geometryType]:_e.bV.esriGeometryNull},r.has_m=e.hasM??!1,r.has_z=e.hasZ??!1,r.nullable=e.nullable??!1,r.editable=e.editable,r.required=e.required,r.default_visibility=e.defaultVisibility,r.system_maintained=e.systemMaintained??!1,r.role={value:_e.ti[e.role]},r.default_value=Te(e.defaultValue,t),r.domain=e.domain??"",r}function Ce(e,t){const r=new t.SearchIndexProperties;r.deleteLater();for(const t of e.propertyNames)r.add_search_property_name(t);return r}function Ae(e,t,r,n){const a=new t.Domain;a.deleteLater(),a.name=e.name;const o=_e.r5[r];a.field_type={value:o};let i=o;if(o!==_e.r5.esriFieldTypeTimeOnly&&o!==_e.r5.esriFieldTypeDateOnly&&o!==_e.r5.esriFieldTypeTimestampOffset||(i=_e.r5.esriFieldTypeString),n&&(a.merge_policy_type={value:_e.G3[n.mergePolicy]},a.split_policy_type={value:_e.GH[n.splitPolicy]}),"coded-value"===e.type){const r=e;a.type="codedValue";const n=new t.CodedValueDomain;n.deleteLater();for(const e of r.codedValues){const r=new t.CodedValue;r.deleteLater(),r.name=e.name,r.set_code(e.code,{value:i}),n.add_coded_value(r)}a.coded_value_domain=n}else if("range"===e.type){const r=e;a.type="range";const n=new t.RangeDomain;n.deleteLater(),n.add_value(r.minValue,{value:i}),n.add_value(r.maxValue,{value:i}),a.range_domain=n}else a.type=e.type??"unspecified";return a}function Ge(e,t,r){r.name=e.name,r.alias=e.alias??"",r.role={value:_e.Eq[e.role]},r.strict=e.strict;for(const n of e.properties){const e=be(n,t);r.add_property(e)}return r}function Me(e,t){return e.hasOwnProperty("alias")&&(t.alias=e.alias),t}function Te(e,t){return null==e?null:"object"!=typeof e||e instanceof Date?e:e instanceof l.A?we(e,t):null}let xe=class extends c.A{constructor(e){super(e),this.decoderError=null,this.resultsCount=0,this.results=[],this.updatedKnowledgeGraph=null}};(0,p.Cg)([(0,y.MZ)()],xe.prototype,"decoderError",void 0),(0,p.Cg)([(0,y.MZ)()],xe.prototype,"resultsCount",void 0),(0,p.Cg)([(0,y.MZ)()],xe.prototype,"results",void 0),(0,p.Cg)([(0,y.MZ)()],xe.prototype,"updatedKnowledgeGraph",void 0),xe=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphDataModelOperationResult")],xe);const Pe=xe;let Se=class extends Pe{constructor(e){super(e)}};Se=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphAddFieldIndexResult")],Se);const ke=Se;let De=class extends Pe{constructor(e){super(e),this.entityAddResultsCount=0,this.relationshipAddResultsCount=0,this.entityAddResults=[],this.relationshipAddResults=[]}};(0,p.Cg)([(0,y.MZ)()],De.prototype,"entityAddResultsCount",void 0),(0,p.Cg)([(0,y.MZ)()],De.prototype,"relationshipAddResultsCount",void 0),(0,p.Cg)([(0,y.MZ)()],De.prototype,"entityAddResults",void 0),(0,p.Cg)([(0,y.MZ)()],De.prototype,"relationshipAddResults",void 0),De=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphAddNamedTypesResult")],De);const Re=De;let je=class extends Pe{constructor(e){super(e)}};je=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphAddPropertyResult")],je);const Ie=je;let Ze=class extends c.A{constructor(e){super(e),this.decoderError=null,this.updatedKnowledgeGraph=null}};(0,p.Cg)([(0,y.MZ)()],Ze.prototype,"decoderError",void 0),(0,p.Cg)([(0,y.MZ)()],Ze.prototype,"updatedKnowledgeGraph",void 0),Ze=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphDataModelSingletonOperationResult")],Ze);const Ee=Ze;let Fe=class extends Pe{constructor(e){super(e)}};Fe=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphDeleteFieldIndexResult")],Fe);const Ne=Fe;let $e=class extends Pe{constructor(e){super(e)}};$e=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphDeleteNamedTypeResult")],$e);const Oe=$e;let qe=class extends Pe{constructor(e){super(e)}};qe=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphDeletePropertyResult")],qe);const Ke=qe;let Ue=class extends Pe{constructor(e){super(e)}};Ue=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphUpdateNamedTypesResult")],Ue);const Le=Ue;let Ve=class extends Pe{constructor(e){super(e)}};Ve=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphUpdatePropertyResult")],Ve);const ze=Ve;let Je=class extends Pe{constructor(e){super(e)}};Je=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphUpdateSearchIndexResult")],Je);const Qe=Je;function Be(e,t){const r=[];for(let n=0;n<t;n++){const t=e.get_result_at(n);r.push({name:t.get_name(),error:ie(t.get_error())})}return r}function He(e){const t=e.get_results_count(),r=e.get_entity_type_add_results_count(),n=e.get_relationship_type_add_results_count(),a=new Re({resultsCount:t,results:Be(e,t),decoderError:ie(e.error),entityAddResultsCount:r,relationshipAddResultsCount:n});for(let t=0;t<r;t++){const r=e.get_entity_type_add_results_at(t),n=r.get_name(),o=r.get_error();a.entityAddResults.push({name:n,error:ie(o)})}for(let t=0;t<n;t++){const r=e.get_relationship_type_add_results_at(t),n=r.get_name(),o=r.get_error();a.relationshipAddResults.push({name:n,error:ie(o)})}return a}function We(e){const t=e.get_results_count();return new Le({resultsCount:t,results:Be(e,t),decoderError:ie(e.error)})}function Ye(e){const t=e.get_results_count();return new Oe({resultsCount:t,results:Be(e,t),decoderError:ie(e.error)})}function Xe(e){const t=e.get_results_count();return new Ie({resultsCount:t,results:Be(e,t),decoderError:ie(e.error)})}function et(e){const t=e.get_results_count();return new Ke({resultsCount:t,results:Be(e,t),decoderError:ie(e.error)})}function tt(e){const t=e.get_results_count();return new ze({resultsCount:t,results:Be(e,t),decoderError:ie(e.error)})}function rt(e){const t=e.get_results_count();return new Qe({resultsCount:t,results:Be(e,t),decoderError:ie(e.error)})}function nt(e){const t=e.get_results_count();return new ke({resultsCount:t,results:Be(e,t),decoderError:ie(e.error)})}function at(e){const t=e.get_results_count();return new Ne({resultsCount:t,results:Be(e,t),decoderError:ie(e.error)})}function ot(e){return new Ee({decoderError:ie(e.error)})}var it=r(93637),st=r(64108),dt=r(39357),lt=r(53177),ut=r(76357),pt=r(41628);let ct=class extends c.A{constructor(e){super(e),this.name=null,this.supportedCategory="esriTypeUNSPECIFIED",this.analyzers=[],this.searchProperties=new Map}};(0,p.Cg)([(0,y.MZ)()],ct.prototype,"name",void 0),(0,p.Cg)([(0,y.MZ)()],ct.prototype,"supportedCategory",void 0),(0,p.Cg)([(0,y.MZ)()],ct.prototype,"analyzers",void 0),(0,p.Cg)([(0,y.MZ)()],ct.prototype,"searchProperties",void 0),ct=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.SearchIndex")],ct);let yt=!1;function ht(e){return e.deleteLater(),new X(ft(e))}function gt(e){return e.deleteLater(),new H({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:At(e.fields)})}function ft(e){return{name:e.name,alias:e.alias,role:(0,it.i7)(_e.Eq,e.role.value),strict:e.strict,properties:Gt(e.properties),fieldIndexes:Mt(e.field_indexes)}}function wt(e){return e.deleteLater(),new W({alias:e.alias,name:e.name,fieldType:(0,it.i7)(_e.r5,e.field_type.value)??void 0,geometryType:(0,it.i7)(_e.bV,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:(0,it.i7)(_e.ti,e.role.value),defaultValue:e.default_value,domain:e.domain})}let mt=class extends ut.A{};function _t(e){return 2===e.get_domain_type().value?new pt.A({name:e.name,minValue:e.range_domain.value_at(0),maxValue:e.range_domain.value_at(1)}):1===e.get_domain_type().value?new lt.A({name:e.name,codedValues:kt(e)}):new mt({name:e.name})}function vt(e){e.deleteLater();const t=ft(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 ee(Object.assign({endPoints:r},t))}function bt(e){return new te({behavior:e.behavior,value:e.value})}function Ct(e){const t=[];for(let r=0;r<e.size();r++)t.push(ht(e.get(r)));return e.delete(),t}function At(e){const t=[];for(let r=0;r<e.size();r++)t.push(e.get(r));return e.delete(),t}function Gt(e){const t=[];for(let r=0;r<e.size();r++){const n=wt(e.get(r));"esriFieldTypeBigInteger"===n.fieldType&&(yt=!0),t.push(n)}return e.delete(),t}function Mt(e){const t=[];for(let r=0;r<e.size();r++)t.push(gt(e.get(r)));return e.delete(),t}function Tt(e){const t=[];for(let r=0;r<e.size();r++)t.push(vt(e.get(r)));return e.delete(),t}function xt(e){const t=[];for(let r=0;r<e.size();r++){const n=e.get(r);n.deleteLater(),t.push(bt(n))}return e.delete(),t}function Pt(e){const t=[];for(let r=0;r<e.size();r++){const n=new ct,a=e.get(r);n.name=a.name,n.supportedCategory=(0,it.i7)(_e.nP,a.supported_category.value);const o=a.analyzers.size();for(let e=0;e<o;e++)n.analyzers.push({name:a.analyzers.get(e).name});a.analyzers.delete();for(let e=0;e<a.search_properties.keys().size();e++){const t=a.search_properties.keys().get(e),r=a.search_properties.get(t),o=[];for(let e=0;e<r.property_names.size();e++)o.push(r.property_names.get(e));n.searchProperties.set(t,{propertyNames:o})}t.push(n)}return e.delete(),t}function St(e){const t=[];for(let r=0;r<e.domains_count();r++){const n=e.domain_at(r);n.deleteLater(),t.push(_t(n))}return t}function kt(e){const t=[];for(let r=0;r<e.coded_value_domain.coded_values_count();r++){const n=e.coded_value_domain.coded_value_at(r);n.deleteLater(),t.push(new dt.A({name:n.name,code:n.get_code()}))}return t}mt=(0,p.Cg)([(0,st.$)("esri.rest.knowledgeGraph.wasmInterface.wasmToDataModelFactories")],mt);var Dt=r(25927),Rt=(r(77901),r(40662)),jt=r(42095),It=r(23150);function Zt(e,t){const r={paths:[],hasM:!1,hasZ:!1},n=Et(e,r),{coords:a,geometry_type:o,lengths:s}=e;if(o.value!==t)throw new i.A("KnowledgeGraph:illegal-geometry-type","Illegal Geometry type for multipath conversion");let d=0;return s.forEach(e=>{const t=[];for(let r=0;r<e;r++){const e=[];for(let t=0;t<n;t++)e[t]=a[d],d++;t.push(e)}r.paths.push(t)}),r}function Et(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}const Ft=()=>s.A.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors");function Nt(e,t,r){return((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 1:return function(e,t){const r={spatialReference:t};let n=2;Et(e,r);const a=e.coords;return r.x=a[0],r.y=a[1],e.has_z&&(r.z=a[n],n++),e.has_m&&(r.m=a[n]),new pe.A(r)}(e,r);case 2:return function(e,t){const r={spatialReference:t},n=Et(e,r),a=e.lengths,o=e.coords,i=a[0];r.points=[];let s=0;for(let e=0;e<i;e++){const e=[];for(let t=0;t<n;t++)e[t]=o[s],s++;r.points.push(e)}return new ue.A(r)}(e,r);case 3:return function(e,t){const{paths:r,hasM:n,hasZ:a}=Zt(e,3);return new ye.A({paths:r,hasM:n,hasZ:a,spatialReference:t})}(e,r);case 4:return function(e,t){const{paths:r,hasM:n,hasZ:a}=Zt(e,4);return new ce.A({rings:r,hasM:n,hasZ:a,spatialReference:t})}(e,r);case 5:case 7:return Ft().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;default:return Ft().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return Ft().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 0:return function(e,t,r){return new Rt.A(Ot(e,t,r))}(e,t,r);case 1:return $t(e,t,r);case 2:return qt(e,t,r);case 3:return function(e,t,r){const n=e.entity_count(),a=e.relationship_count(),o=[];for(let i=0;i<n;i++)o.push($t(e.get_entity_at(i),t,r)),i<a&&o.push(qt(e.get_relationship_at(i),t,r));return new jt.A({path:o})}(e,t,r);case 4:return function(e,t,r){const n=[],a=e.count();for(let o=0;o<a;o++){const a=e.get_value_at(o);n.push(Nt(a,t,r))}return n}(e,t,r);default:return Ft().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}})(e,t,r)}function $t(e,t,r){const n=e.type_name,a=Ot(e,t,r),o=e.get_id();return new Dt.A(Object.assign({typeName:n,id:o},a))}function Ot(e,t,r){const n={},a=e.key_count();for(let o=0;o<a;o++)n[e.get_key_at(o)]=Nt(e.get_value_at(o),t,r);return{properties:n}}function qt(e,t,r){const n=e.type_name,a=Ot(e,t,r);return new It.A(Object.assign({typeName:n,id:e.get_id(),originId:e.get_origin_entity_id(),destinationId:e.get_destination_entity_id()},a))}function Kt(e){const t=[];for(let r=0;r<e.get_header_keys().size();r++)t.push(e.get_header_keys().get(r));const r=new u.A(e.get_out_sr());return new z({headerKeys:t,outSpatialReference:r,exceededTransferLimit:e.exceeded_transfer_limit(),dataModelTimestamp:e.data_model_timestamp?new Date(e.data_model_timestamp):null})}let Ut=class extends c.A{constructor(e){super(e),this.hasError=!1,this.error=null,this.editResults=[],this.cascadeRelationshipDeleteResults=[],this.cascadeProvenanceDeleteResults=[]}};(0,p.Cg)([(0,y.MZ)()],Ut.prototype,"hasError",void 0),(0,p.Cg)([(0,y.MZ)()],Ut.prototype,"error",void 0),(0,p.Cg)([(0,y.MZ)()],Ut.prototype,"editResults",void 0),(0,p.Cg)([(0,y.MZ)()],Ut.prototype,"cascadeRelationshipDeleteResults",void 0),(0,p.Cg)([(0,y.MZ)()],Ut.prototype,"cascadeProvenanceDeleteResults",void 0),Ut=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphApplyEditsResult")],Ut);const Lt=Ut;function Vt(e){const t=e.has_error(),r=new Lt({hasError:t,error:t?ie(e.error):null}),n=e.get_edit_results_count();for(let t=0;t<n;t++){const n=e.get_edit_results_at(t);n.deleteLater();const a=e.get_edit_results_type_name_at(t),o=[],i=[],s=[],d=n.get_add_results_count(),l=n.get_update_results_count(),u=n.get_delete_results_count();for(let e=0;e<d;e++){const t=n.get_add_result_at(e);t.deleteLater(),o.push({id:t.id,error:ie(t.error)})}for(let e=0;e<l;e++){const t=n.get_update_result_at(e);t.deleteLater(),i.push({id:t.id,error:ie(t.error)})}for(let e=0;e<u;e++){const t=n.get_delete_result_at(e);t.deleteLater(),s.push({id:t.id,error:ie(t.error)})}r.editResults.push({typeName:a,adds:o,updates:i,deletes:s})}const a=e.get_cascaded_rel_deletes_count();for(let t=0;t<a;t++){const n=e.get_cascaded_rel_deletes_at(t);n.deleteLater();const a=e.get_cascaded_rel_deletes_type_name_at(t),o=[];for(let e=0;e<n.get_count();e++){const t=n.get_result_at(e);t.deleteLater(),o.push({id:t.id,originId:t.origin_id,destinationId:t.dest_id,error:ie(t.error)})}r.cascadeRelationshipDeleteResults.push({typeName:a,cascadeRelationshipDeletes:o})}if(e.has_cascading_provenance_deletes()){const t=e.get_cascading_provenance_deletes();t.deleteLater();const n=t.get_count();for(let e=0;e<n;e++){const n=t.get_result_at(e);n.deleteLater(),r.cascadeProvenanceDeleteResults.push({id:n.id,error:ie(n.error)})}}return r}const zt=new Map,Jt=()=>new Map(zt.entries()),Qt={fetchKnowledgeGraph:async e=>{const t=new ae({url:e}),r=[];return r.push(cr(t)),r.push(yr(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await Rr(e)},refreshServiceDefinition:async e=>{const t=(await(0,o.A)(e.url,{query:{f:"json"}})).data;return t.capabilities=t?.capabilities?.split(","),t.supportedQueryFormats=t?.supportedQueryFormats?.split(","),e.serviceDefinition=new ne(t),e.serviceDefinition},executeFindPathsAsynchronous:async(e,t)=>{const r=e.inKnowledgeGraphUrl.split("/rest/services");if(r.length<2)throw new i.A("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=r[0],a=(await Ar(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,o=`/rest/services/${a&&a<12?"System":"Utilities"}/KnowledgeGraphServerToolsAsync/GPServer/ServerFilteredFindPaths`;return await Cr(`${n}${o}`,{in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:e.config.toJSON(),result_type:"STRING"},{},t)},executeFindPaths:async(e,t)=>{const r=e.inKnowledgeGraphUrl.split("/rest/services");if(r.length<2)throw new i.A("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=r[0],a=(await Ar(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,o=`/rest/services/${a&&a<12?"System":"Utilities"}/KnowledgeGraphServerTools/GPServer/ServerFilteredFindPaths/execute`,s=await Ar(`${n}${o}`,{method:"post",query:{f:"pjson",in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:JSON.stringify(e.config),result_type:"STRING"},...t});if(s.data.results.length<1)throw new i.A("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results returned",s);let d;for(const e of s.data.results)if("out_results_string"===e.paramName){d=e.value;break}if(!d)throw new i.A("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results were returned on the expected paramater out_results_string",s);return d},fetchAsynchronousFindPathsResultData:async(e,t)=>(await e.fetchResultData("out_results_string",null,t)).value,executeQueryStreaming:async(e,t,r)=>{const n=`${e.url}/graph/query`;await Gr(e);const a=await Tr(n,r);if(!e.serviceDefinition?.supportsProvenance&&"include"===t.provenanceBehavior)throw new i.A("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");a.data.body=await async function(e,t){const r=await(0,le.I)(),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,a]of Object.entries(e.bindParameters))Mr(t,a,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 cr(t),4326!==t.dataModel?.spatialReference?.wkid)throw new i.A("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.A("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.A("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new i.A("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),e.provenanceBehavior&&function(e,t){t.provenance_behavior={value:he[e]}}(e.provenanceBehavior,n);try{n.encode()}catch(e){throw new i.A("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:e})}const a=n.get_encoding_result();if(0!==a.error.error_code)throw new i.A("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:a.error.error_code,errorMessage:a.error.error_message});return structuredClone(a.get_byte_buffer())}(t,e);const o=await br(a.data.url,a.data);if(e.dataModel){const t=await Dr(o,e.dataModel);return new Q({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,r)=>{if(e.serviceDefinition?.dataEditingNotSupported||null!=e.dataModel.arcgisManaged&&!e.dataModel.arcgisManaged)throw new i.A("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 Gr(e);const a=await Tr(n,r);return a.data.body=await async function(e,t){if(t.dataModel||await cr(t),!t.dataModel)throw new i.A("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,le.I)(),n=!!e.options?.cascadeDelete,a=!!e.options?.cascadeProvenanceDelete,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,o.cascade_delete_provenance=a;try{let t;e.entityAdds?.forEach(e=>{t=o.add_entity(ve(e,r)),oe(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.A("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(ve(e,r)),oe(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.A("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(ve(e,r)),oe(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.A("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(ve(e,r)),oe(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.A("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.A("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.A("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:e})}const s=o.get_encoding_result();return oe(s.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(s.get_byte_buffer())}(t,e),async function(e){return xr(e,(await(0,le.I)()).GraphApplyEditsDecoder,Vt)}(await br(a.data.url,a.data))},executeAddNamedTypes:async(e,t,r)=>{if(!t.newEntityTypes?.length&&!t.newRelationshipTypes?.length)throw new i.A("knowledge-graph:no-arguments","The operation to add types to the data model contained no values");const n=`${e.url}/dataModel/edit/namedTypes/add`;await Gr(e);const a=await Tr(n,r);a.data.body=await async function(e){const t=await(0,le.I)(),r=new t.GraphNamedObjectTypeAddsRequestEncoder;r.deleteLater(),e.newEntityTypes?.forEach(e=>{r.add_entity_type(function(e,t){const r=new t.EntityType;return r.deleteLater(),Ge(e,t,r)}(e,t))}),e.newRelationshipTypes?.forEach(e=>{r.add_relationship_type(function(e,t){const r=new t.RelationshipType;r.deleteLater();for(const n of e.endPoints){const e=new t.EndPoint;e.deleteLater(),e.origin_entity_type=n.originEntityType,e.dest_entity_type=n.destinationEntityType,r.add_end_point(e)}return Ge(e,t,r)}(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed",{error:e})}const n=r.get_encoding_result();return oe(n.error,"knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed"),structuredClone(n.get_byte_buffer())}(t);const o=await br(a.data.url,a.data),s=await async function(e){return xr(e,(await(0,le.I)()).GraphNamedObjectTypeAddsResponseDecoder,He)}(o);return s.updatedKnowledgeGraph=await pr(e.url),s},executeDeleteNamedType:async(e,t,r)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to delete a named type from the data model contained no value");const n=`${e.url}/dataModel/edit/namedTypes/${t}/delete`;await Gr(e);const a=await Tr(n,r);a.data.body="";const o=await br(a.data.url,a.data),s=await async function(e){return xr(e,(await(0,le.I)()).GraphNamedObjectTypeDeleteResponseDecoder,Ye)}(o);return s.updatedKnowledgeGraph=await pr(e.url),s},executeUpdateNamedType:async(e,t,r,n)=>{if(!t&&!Object.keys(r).length)throw new i.A("knowledge-graph:no-arguments","The operation to update types in the data model contained missing or empty values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/update`;await Gr(e);const o=await Tr(a,n);o.data.body=await async function(e,t,r){const n=await(0,le.I)(),a=new n.GraphNamedObjectTypeUpdateRequestEncoder;if(a.deleteLater(),r.entityTypes.some(e=>e.name===t))a.update_entity_type(function(e,t){const r=new t.EntityType;return r.deleteLater(),Me(e,r)}(e,n));else{if(!r.relationshipTypes.some(e=>e.name===t))throw new i.A("knowledge-graph:updateNamedType-encoding-failed","The named type you are trying to update does not exist in the data model");a.update_relationship_type(function(e,t){const r=new t.RelationshipType;return r.deleteLater(),Me(e,r)}(e,n))}a.update_alias=e.hasOwnProperty("alias");try{a.encode()}catch(e){throw new i.A("knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed",{error:e})}const o=a.get_encoding_result();return oe(o.error,"knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed"),structuredClone(o.get_byte_buffer())}(r,t,e.dataModel);const s=await br(o.data.url,o.data),d=await async function(e){return xr(e,(await(0,le.I)()).GraphNamedObjectTypeUpdateResponseDecoder,We)}(s);return d.updatedKnowledgeGraph=await pr(e.url),d},executeAddGraphProperties:async(e,t,r,n)=>{if(!t&&!r.length)throw new i.A("knowledge-graph:no-arguments","The operation to add properties to the data model contained missing or empty values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/fields/add`;await Gr(e);const o=await Tr(a,n);o.data.body=await async function(e){const t=await(0,le.I)(),r=new t.GraphPropertyAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_graph_property(be(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed",{error:e})}const n=r.get_encoding_result();return oe(n.error,"knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed"),structuredClone(n.get_byte_buffer())}(r);const s=await br(o.data.url,o.data),d=await async function(e){return xr(e,(await(0,le.I)()).GraphPropertyAddsResponseDecoder,Xe)}(s);return d.updatedKnowledgeGraph=await pr(e.url),d},executeDeleteGraphProperty:async(e,t,r,n)=>{if(!t&&!r)throw new i.A("knowledge-graph:no-arguments","The operation to delete property contained missing or empty values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/fields/delete`;await Gr(e);const o=await Tr(a,n);o.data.body=await async function(e){const t=new((await(0,le.I)()).GraphPropertyDeleteRequestEncoder);t.deleteLater(),t.field_name=e;try{t.encode()}catch(e){throw new i.A("knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed",{error:e})}const r=t.get_encoding_result();return oe(r.error,"knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed"),structuredClone(r.get_byte_buffer())}(r);const s=await br(o.data.url,o.data),d=await async function(e){return xr(e,(await(0,le.I)()).GraphPropertyDeleteResponseDecoder,et)}(s);return d.updatedKnowledgeGraph=await pr(e.url),d},executeUpdateGraphProperty:async(e,t,r,n,a)=>{if(!t&&!r&&!Object.keys(n).length)throw new i.A("knowledge-graph:no-arguments","The operation to update properties in the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/update`;await Gr(e);const s=await Tr(o,a);s.data.body=await async function(e,t){const r=await(0,le.I)(),n=new r.GraphPropertyUpdateRequestEncoder;n.deleteLater(),n.update_graph_property(function(e,t){const r=new t.GraphProperty;return r.deleteLater(),e.hasOwnProperty("alias")&&(r.alias=e.alias),e.hasOwnProperty("editable")&&(r.editable=e.editable),e.hasOwnProperty("required")&&(r.required=e.required),e.hasOwnProperty("defaultVisibility")&&(r.default_visibility=e.defaultVisibility),e.hasOwnProperty("defaultValue")&&(r.default_value=Te(e.defaultValue,t)),e.hasOwnProperty("domain")&&(r.domain=e.domain),r}(t,r)),n.set_property_name(e),n.update_alias=t.hasOwnProperty("alias"),n.update_editable=t.hasOwnProperty("editable"),n.update_required=t.hasOwnProperty("required"),n.update_visible=t.hasOwnProperty("defaultVisibility"),n.update_default_value=t.hasOwnProperty("defaultValue"),n.update_domain=t.hasOwnProperty("domain");try{n.encode()}catch(e){throw new i.A("knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed",{error:e})}const a=n.get_encoding_result();return oe(a.error,"knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed"),structuredClone(a.get_byte_buffer())}(r,n);const d=await br(s.data.url,s.data),l=await async function(e){return xr(e,(await(0,le.I)()).GraphPropertyUpdateResponseDecoder,tt)}(d);return l.updatedKnowledgeGraph=await pr(e.url),l},executeAddGraphFieldIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!r?.length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/add`;await Gr(e);const o=await Tr(a,n);o.data.body=await async function(e){const t=await(0,le.I)(),r=new t.GraphIndexAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_field_index(function(e,t){const r=new t.FieldIndex;r.deleteLater(),r.name=e.name,r.unique=e.unique,r.ascending=e.ascending,r.description=e.description??"";for(const t of e.fieldNames)r.add_field(t);return r}(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed",{error:e})}const n=r.get_encoding_result();return oe(n.error,"knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed"),structuredClone(n.get_byte_buffer())}(r);const s=await br(o.data.url,o.data),d=await async function(e){return xr(e,(await(0,le.I)()).GraphIndexAddsResponseDecoder,nt)}(s);return d.updatedKnowledgeGraph=await pr(e.url),d},executeDeleteGraphFieldIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!r?.length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/delete`;await Gr(e);const o=await Tr(a,n);o.data.body=await async function(e){const t=new((await(0,le.I)()).GraphIndexDeleteRequestEncoder);t.deleteLater(),e.forEach(e=>{t.add_index_name(e)});try{t.encode()}catch(e){throw new i.A("knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed",{error:e})}const r=t.get_encoding_result();return oe(r.error,"knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed"),structuredClone(r.get_byte_buffer())}(r);const s=await br(o.data.url,o.data),d=await async function(e){return xr(e,(await(0,le.I)()).GraphIndexDeleteResponseDecoder,at)}(s);return d.updatedKnowledgeGraph=await pr(e.url),d},executeUpdateSearchIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!Object.keys(r.addSearchProperties??{}).length&&!Object.keys(r.removeSearchProperties??{}).length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty properties values");const a=`${e.url}/dataModel/searchIndex/update`;await Gr(e);const o=await Tr(a,n);o.data.body=await async function(e,t){const r=await(0,le.I)(),n=new r.GraphUpdateSearchIndexRequestEncoder;n.deleteLater(),t.hasOwnProperty("addSearchProperties")&&n.insert_add_search_property(e,Ce(t.addSearchProperties,r)),t.hasOwnProperty("removeSearchProperties")&&n.insert_delete_search_property(e,Ce(t.removeSearchProperties,r));try{n.encode()}catch(e){throw new i.A("knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed",{error:e})}const a=n.get_encoding_result();return oe(a.error,"knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed"),structuredClone(a.get_byte_buffer())}(t,r);const s=await br(o.data.url,o.data),d=await async function(e){return xr(e,(await(0,le.I)()).GraphUpdateSearchIndexResponseDecoder,rt)}(s);return d.updatedKnowledgeGraph=await pr(e.url),d},executeAddDomain:async(e,t,r,{mergePolicy:n="esriMergePolicyTypeDefaultValue",splitPolicy:a="esriSplitPolicyTypeDefaultValue"},o)=>{const s=`${e.url}/dataModel/domains/add`;await Gr(e);const d=await Tr(s,o);d.data.body=await async function(e,t,r){const n=await(0,le.I)(),a=new n.GraphDomainAddRequestEncoder;a.deleteLater(),a.set_domain(Ae(e,n,t,r));try{a.encode()}catch(e){throw new i.A("knowledge-graph:addDomain-encoding-failed","Attempting to encode the domain failed",{error:e})}const o=a.get_encoding_result();return oe(o.error,"knowledge-graph:addDomain-encoding-failed","Attempting to encode the domain failed"),structuredClone(o.get_byte_buffer())}(t,r,{mergePolicy:n,splitPolicy:a});const l=await br(d.data.url,d.data),u=await async function(e){return xr(e,(await(0,le.I)()).GraphDomainAddResponseDecoder,ot)}(l);return u.updatedKnowledgeGraph=await pr(e.url),u},executeUpdateDomain:async(e,t,r,n,a)=>{const o=`${e.url}/dataModel/domains/${t.name}/update`;await Gr(e);const s=await Tr(o,a);s.data.body=await async function(e,t,r){const n=await(0,le.I)(),a=new n.GraphDomainUpdateRequestEncoder;a.deleteLater(),a.set_domain(Ae(e,n,t,r)),a.update_domain=!0,r?.mergePolicy&&(a.update_merge_policy=!0),r?.splitPolicy&&(a.update_split_policy=!0);try{a.encode()}catch(e){throw new i.A("knowledge-graph:updateDomain-encoding-failed","Attempting to encode the domain failed",{error:e})}const o=a.get_encoding_result();return oe(o.error,"knowledge-graph:updateDomain-encoding-failed","Attempting to encode the domain failed"),structuredClone(o.get_byte_buffer())}(t,r,n);const d=await br(s.data.url,s.data),l=await async function(e){return xr(e,(await(0,le.I)()).GraphDomainUpdateResponseDecoder,ot)}(d);return l.updatedKnowledgeGraph=await pr(e.url),l},executeDeleteDomain:async(e,t,r)=>{const n=`${e.url}/dataModel/domains/${t}/delete`;if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to delete a domain from the data model contained missing or empty domain name");await Gr(e);const a=await Tr(n,r);a.data.body="";const o=await br(a.data.url,a.data),s=await async function(e){return xr(e,(await(0,le.I)()).GraphDomainDeleteResponseDecoder,ot)}(o);return s.updatedKnowledgeGraph=await pr(e.url),s},executeQuery:async(e,t,r)=>{const n=`${e.url}/graph/query`,a=await(0,o.A)(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:t.openCypherQuery,...r?.query},signal:r?.signal,timeout:r?.timeout}),s=a.getHeader?.("content-type"),d=a.data;if(s?.includes("application/x-protobuf")){const t=new((await(0,le.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=kr({wasmQueryDecoder:t,newArrayBufferToParse:d,dataModel:e.dataModel});return new J({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:a.data})},executeSearch:async(e,t,r)=>{const n="provenance"===t.typeCategoryFilter?"metaEntityProvenance":t.typeCategoryFilter,a=`${e.url}/graph/search`,s=await(0,o.A)(a,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${t.searchQuery}"`,typeCategoryFilter:n,...r?.query},signal:r?.signal,timeout:r?.timeout}),d=s.getHeader?.("content-type"),l=s.data;if(d?.includes("application/x-protobuf")){const t=new((await(0,le.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=kr({wasmQueryDecoder:t,newArrayBufferToParse:l,dataModel:e.dataModel});return new J({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:d,data:s.data})},executeSearchStreaming:async(e,t,r)=>{const n=`${e.url}/graph/search`;await Gr(e);const a=await Tr(n,r);a.data.body=await async function(e){const t=await(0,le.I)(),r=new t.GraphSearchRequestEncoder;r.deleteLater(),r.search_query=e.searchQuery;const n="provenance"===e.typeCategoryFilter?"meta_entity_provenance":e.typeCategoryFilter;if(r.type_category_filter=t.esriNamedTypeCategory[n],!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(ge(e.idsFilter,t))}catch(e){throw new i.A("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.A("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:e})}const a=r.get_encoding_result();if(0!==a.error.error_code)throw new i.A("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:a.error.error_code,errorMessage:a.error.error_message});return structuredClone(a.get_byte_buffer())}(t);const o=await br(a.data.url,a.data);if(e.dataModel){const t=await Dr(o,e.dataModel);return new Q({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,t,r={ignoreCache:!1})=>{if(!t.length)return new Map;let n=zt.get(e.url||"");n||(n=new Map,zt.set(e.url||"",n));const a=new Map(n.entries()),o=`${e.url}/clientData/fetch`;t=Array.from(new Set(t));const s=await(0,le.I)(),d=se(t,n,s,r.ignoreCache),l=await Tr(o,r.requestOptions);l.data.body=d;const u=await br(l.data.url,l.data),p=u.headers.get("content-type");if(p?.includes("application/x-protobuf")){const e=new s.ClientDataFetchResponseDecoder;e.deleteLater();const t=await u.arrayBuffer();return e.decode(new Uint8Array(t)),e.has_error()&&oe(e.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),function(e,t,r,n=!1){const a=new Map;for(let o=0;o<e.get_results_count();o++){const i=e.get_result_at(o);if(2!==i.get_fetch_result_case().value||0!==i.error().error_code){const e=i.get_key().key_string;r.has(e)&&t.delete(e);continue}const s=i.get_value(),d=i.get_key().key_string,l=r.get(d);let u;if(2===s.get_data_case().value&&l)u=l.value;else{if(1!==s.get_data_case().value)continue;{u=s.get_data().client_data_string;const e=i.get_value().get_v_tag().v_tag;n||t.set(d,{key:d,version:e,value:u})}}a.set(d,u)}return a}(e,n,a,r.ignoreCache)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:p,data:u})},fetchAllClientDataKeys:async(e,t)=>{const r=`${e.url}/clientData`,n=await(0,o.A)(r,{responseType:"array-buffer",query:{f:"pbf"},signal:t?.signal,timeout:t?.timeout}),a=n.getHeader?.("content-type"),s=n.data;if(a?.includes("application/x-protobuf")){const e=new((await(0,le.I)()).ClientDataKeysResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(s)),e.has_error()&&oe(e.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),function(e){const t=e.get_keys(),r=new Array;for(let e=0;e<t.get_keys_count();e++){const n=t.get_key_at(e);1===n.get_client_data_key_type().value&&r.push(n.key_string)}return r}(e)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:a,data:n.data})},clearClientDataCache:()=>zt.clear(),_fetchWrapper:async(e,t)=>fetch(e,t),_submitJobWrapper:async(e,t,r,n)=>async function(e,t,r,n){return r=f.from(r||{}),async function(e,t,r,n,a){const i={},s={},d=[];return function(e,t,r){for(const n in e){const a=e[n];if(a&&"object"==typeof a&&a instanceof T.A){const{features:e}=a;r[n]=[t.length,t.length+e.length],e.forEach(e=>{t.push(e.geometry)})}}}(n,d,i),(0,w.el)(d).then(d=>{const{outSpatialReference:l,processExtent:u,processSpatialReference:p,returnColumnName:c,returnFeatureCollection:y,returnM:h,returnZ:g}=r,{path:f}=(0,b.Dl)(e);for(const e in i){const[t,r]=i[e];s[e]=d.slice(t,r)}const w=l?l.wkid||l:null,m=p?p.wkid||p:null,_="execute"===t?{returnColumnName:c||void 0,returnFeatureCollection:y||void 0,returnM:h||void 0,returnZ:g||void 0}:null,v=O({...u?{context:{extent:u,outSR:w,processSR:m}}:{"env:outSR":w,"env:processSR":m},...n,..._,f:"json"},null,s),C={...a,query:v};return(0,o.A)(`${f}/${t}`,C)})}(e,"submitJob",r,t??{},n).then(({data:t})=>{const r=V.fromJSON(t);return r.sourceUrl=e,r})}(e,t,r,n),_esriRequestWrapper:async(e,t)=>(0,o.A)(e,t)};async function Bt(e,t,r){return Qt.executeApplyEdits(e,t,r)}async function Ht(e,t,r){return Qt.executeAddNamedTypes(e,t,r)}async function Wt(e,t,r){return Qt.executeDeleteNamedType(e,t,r)}async function Yt(e,t,r,n){return Qt.executeUpdateNamedType(e,t,r,n)}async function Xt(e,t,r,n){return Qt.executeAddGraphProperties(e,t,r,n)}async function er(e,t,r,n){return Qt.executeDeleteGraphProperty(e,t,r,n)}async function tr(e,t,r,n,a){return Qt.executeUpdateGraphProperty(e,t,r,n,a)}async function rr(e,t,r,n){return Qt.executeAddGraphFieldIndex(e,t,r,n)}async function nr(e,t,r,n){return Qt.executeDeleteGraphFieldIndex(e,t,r,n)}async function ar(e,t,r,n){return Qt.executeUpdateSearchIndex(e,t,r,n)}async function or(e,t,r){return Qt.executeQuery(e,t,r)}async function ir(e,t,r){return Qt.executeQueryStreaming(e,t,r)}async function sr(e,t,r){return Qt.executeSearch(e,t,r)}async function dr(e,t,r){return Qt.executeSearchStreaming(e,t,r)}function lr(e,t){return Qt.fetchAllClientDataKeys(e,t)}function ur(e,t,r){return Qt.fetchClientDataAtKeys(e,t,r)}async function pr(e){return Qt.fetchKnowledgeGraph(e)}async function cr(e){return Qt.refreshDataModel(e)}async function yr(e){return Qt.refreshServiceDefinition(e)}async function hr(e,t){return Qt.executeFindPathsAsynchronous(e,t)}async function gr(e,t){return Qt.executeFindPaths(e,t)}async function fr(e,t){return Qt.fetchAsynchronousFindPathsResultData(e,t)}async function wr(e,t,r,n={mergePolicy:"esriMergePolicyTypeDefaultValue",splitPolicy:"esriSplitPolicyTypeDefaultValue"},a){return Qt.executeAddDomain(e,t,r,n,a)}async function mr(e,t,r,n,a){return Qt.executeUpdateDomain(e,t,r,n,a)}async function _r(e,t,r){return Qt.executeDeleteDomain(e,t,r)}function vr(){return Qt.clearClientDataCache()}async function br(e,t){return Qt._fetchWrapper(e,t)}async function Cr(e,t,r,n){return Qt._submitJobWrapper(e,t,r,n)}async function Ar(e,t){return Qt._esriRequestWrapper(e,t)}async function Gr(e){const t=a.id?.findCredential(e.url);t||(e.dataModel?await Rr(e):await cr(e))}function Mr(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 l.A?r.set_param_key_value(e,we(t,n)):Array.isArray(t)?r.set_param_key_value(e,ge(t,n)):r.set_param_key_value(e,fe(t,n))}async function Tr(e,t){return(0,o.A)(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})}async function xr(e,t,r){const n=e.headers.get("content-type");if(n?.includes("application/x-protobuf")){const n=await e.arrayBuffer(),a=new t;try{return a.decode(new Uint8Array(n)),r(a)}finally{a.deleteLater()}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:await e.text()})}let Pr=50;function Sr(e){Pr=e}function kr({wasmQueryDecoder:e,newArrayBufferToParse:t,dataModel:r,decodedHeader:n,limitMaxProcessingTime:a=!1}){t&&e.push_buffer(new Uint8Array(t));const o=[];let s,d,l=0;const p=Date.now();let c=!0;for(;e.next_row();){s&&d||(s=n??Kt(e),d=s.outSpatialReference??new u.A({wkid:4326})),l||(l=e.get_header_keys().size());const t=new Array(l);for(let n=0;n<l;n++){const a=e.get_value(n);t[n]=Nt(a,r,d)}if(o.push(t),a&&Date.now()-p>Pr){c=!1;break}}if(e.has_error())throw new i.A("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - inner row decoding",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return{resultHeader:s,resultRows:o,parsedAllResultsFromBuffer:c}}async function Dr(e,t){const r=e.headers.get("content-type");if(e.headers.get("content-length")&&s.A.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."),r?.includes("application/x-protobuf")){const r=e.body?.getReader(),n=new((await(0,le.I)()).GraphQueryDecoder);let a,o,l;n.deleteLater();const u=new Promise((e,t)=>{o=e,l=t});let p=!1,c=null;const y=new ReadableStream({pull:async function e(u){if(!r){const e=new i.A("knowledge-graph:stream-decoding-error","Error reading from stream - reader is undefined");throw l(e),e}const{done:y,value:h}=c?{done:!1,value:null}:await r.read().catch(e=>{throw l(e),r.releaseLock(),e});h&&(c=h);try{if(y){let e;if(n.has_error()?e=new i.A("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:n.error.error_code,errorMessage:n.error.error_message}):p||o(new z),r.releaseLock(),e)throw u.error(e),l(e),e;return void u.close()}const{resultHeader:s,resultRows:d,parsedAllResultsFromBuffer:g}=kr({wasmQueryDecoder:n,newArrayBufferToParse:h,dataModel:t,decodedHeader:a,limitMaxProcessingTime:!0});return g&&(c=null),!a&&s&&(a=s,o(s),p=!0),d.length>0?void u.enqueue(d):await e(u)}catch(e){throw s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(e),l(e),r.releaseLock(),(0,d.zf)(e)?e:new i.A("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:e})}}});return{readableStream:y,resultHeader:await u}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}async function Rr(e){const t=`${e.url}/dataModel/queryDataModel`,r=await(0,o.A)(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,le.I)()).decode_data_model_from_protocol_buffer(new Uint8Array(a));if(!e)throw new i.A("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){e.deleteLater(),yt=!1;const t=new re({timestamp:e.timestamp,spatialReference:new u.A(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:(0,it.i7)(_e.vy,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:(0,it.i7)(_e.wr,e.identifier_info?.identifier_generation_info?.uuid_method_hint?.value)}},searchIndexes:Pt(e.search_indexes),entityTypes:Ct(e.entity_types),relationshipTypes:Tt(e.relationship_types),metaEntityTypes:Ct(e.meta_entity_types),provenanceSourceTypeValues:xt(e.provenance_source_type_values.value_behavior_array),domains:St(e)});return yt&&s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("A big integer field was detected in the retrieved data model. The `big-integer` field type is not fully supported in web clients. Please see https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type"),t}(e)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:r.data})}}}]);