@arcgis/core 4.27.0-rc.0 → 4.27.0-rc.1

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 (137) hide show
  1. package/arcade/featureSetUtils.js +1 -1
  2. package/arcade/featureset/actions/GroupBy.js +1 -1
  3. package/arcade/featureset/actions/OrderBy.js +1 -1
  4. package/arcade/functions/featuresetbase.js +1 -1
  5. package/arcade/functions/featuresetstring.js +1 -1
  6. package/arcade/languageUtils.js +1 -1
  7. package/arcade/treeAnalysis.js +1 -1
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/0407bf97ad621c89a734.js +1 -0
  10. package/assets/esri/core/workers/chunks/0610691a0c0d9fbbd6d2.js +1 -0
  11. package/assets/esri/core/workers/chunks/{7ec6be2bc0f354011e46.js → 07651ef8348f702d59ac.js} +1 -1
  12. package/assets/esri/core/workers/chunks/0a02ac5628d1739372c6.js +1 -0
  13. package/assets/esri/core/workers/chunks/0a86c458916e83d6c523.js +1 -0
  14. package/assets/esri/core/workers/chunks/14145959a3dab1437818.js +1 -0
  15. package/assets/esri/core/workers/chunks/16db0bc87d87a7313dc4.js +1 -0
  16. package/assets/esri/core/workers/chunks/183e2e0cb86c1c640d94.js +1 -0
  17. package/assets/esri/core/workers/chunks/19d329b9d4ec2eff1d13.js +1 -0
  18. package/assets/esri/core/workers/chunks/1b8074269800b384ecf6.js +1 -0
  19. package/assets/esri/core/workers/chunks/2154d395f405be3cd3ba.js +1 -0
  20. package/assets/esri/core/workers/chunks/{33dbba3b7fc648437e50.js → 21e1f3b11e7d363b727a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{31a158c73994603c169d.js → 2446e336b1f7256d4fde.js} +1 -1
  22. package/assets/esri/core/workers/chunks/29290a44fd3b183c24e3.js +1 -0
  23. package/assets/esri/core/workers/chunks/{f498c4d4831141125781.js → 2f5639886f577baedbca.js} +1 -1
  24. package/assets/esri/core/workers/chunks/33901eb1574e46abd9af.js +1 -0
  25. package/assets/esri/core/workers/chunks/{9c78ad5ab57e0d47ac43.js → 3ba2fcb9110230f8790c.js} +1 -1
  26. package/assets/esri/core/workers/chunks/3e239bfad611985e50fb.js +1 -0
  27. package/assets/esri/core/workers/chunks/42f3421740a5479559dc.js +1 -0
  28. package/assets/esri/core/workers/chunks/474d9b334812533bab36.js +1 -0
  29. package/assets/esri/core/workers/chunks/53ad34bf32f5f3d4fe18.js +1 -0
  30. package/assets/esri/core/workers/chunks/{97cdbec7532cfcdf9ad2.js → 595a2baa04d92de59558.js} +1 -1
  31. package/assets/esri/core/workers/chunks/624521961fe1f2c4f2c5.js +1 -0
  32. package/assets/esri/core/workers/chunks/{212d59764c275c763941.js → 659b7bad7281c0e2aed3.js} +1 -1
  33. package/assets/esri/core/workers/chunks/6a3d611e8842afbb50ab.js.LICENSE.txt +1 -1
  34. package/assets/esri/core/workers/chunks/6e562fa57c0347091154.js +1 -0
  35. package/assets/esri/core/workers/chunks/7479dc0c790337af7597.js +1 -0
  36. package/assets/esri/core/workers/chunks/{e88cff2537be52da6531.js → 74fd2059ddda9083cbcc.js} +1 -1
  37. package/assets/esri/core/workers/chunks/7dc6774c77c822b68c99.js +1 -0
  38. package/assets/esri/core/workers/chunks/82a103a8b5382300889d.js +1 -0
  39. package/assets/esri/core/workers/chunks/{3fe357df92afa1bee70a.js → 90da1ed112b82712d0ef.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{9849f64793f2ad39366b.js → 9290b0d330f02233d803.js} +1 -1
  41. package/assets/esri/core/workers/chunks/92e7f224a80195e606d6.js +1 -0
  42. package/assets/esri/core/workers/chunks/{36df72362b38759b895b.js → 9648a8f2b24f1ca3d637.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{ad18fb7bb54a0c4bdb38.js → a20361b4d3bdd7d196ca.js} +1 -1
  44. package/assets/esri/core/workers/chunks/a7fd2a95fde197c06828.js +1 -0
  45. package/assets/esri/core/workers/chunks/b0cda39b53ecd6c44cd0.js +1 -0
  46. package/assets/esri/core/workers/chunks/b2a423d9ce8bb784267c.js +1 -0
  47. package/assets/esri/core/workers/chunks/b5fc6f2044ed047c5afd.js +1 -0
  48. package/assets/esri/core/workers/chunks/{df0453cdfe685d6436cc.js → b6dc41fce601b9d3480e.js} +1 -1
  49. package/assets/esri/core/workers/chunks/b8e6c64792a512df4c4d.js +1 -0
  50. package/assets/esri/core/workers/chunks/c6617a937440701c0180.js +1 -0
  51. package/assets/esri/core/workers/chunks/c6efe2e04ea6a55bb6e3.js +1 -0
  52. package/assets/esri/core/workers/chunks/d8607326a199dd994844.js +1 -0
  53. package/assets/esri/core/workers/chunks/d8bd3f498b3fa8153404.js +1 -0
  54. package/assets/esri/core/workers/chunks/{39e473586579d11d6732.js → e2432871f1329f47465d.js} +1 -1
  55. package/assets/esri/core/workers/chunks/ee5ee03dd2c7dc940272.js +1 -0
  56. package/assets/esri/core/workers/chunks/{c83669cf08391a62fb72.js → f1da7b29eecad0e9efae.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{2e627c94e57c924e5917.js → f339db2b599fa9585283.js} +1 -1
  58. package/assets/esri/core/workers/chunks/f505ebd4bd3bfb6c790d.js +1 -0
  59. package/assets/esri/core/workers/chunks/{3c6c082157c916f8ddba.js → ffe61d5a6a9b34bee9d4.js} +1 -1
  60. package/assets/esri/themes/base/widgets/_Bookmarks.scss +5 -0
  61. package/assets/esri/themes/base/widgets/_Features.scss +5 -7
  62. package/assets/esri/themes/base/widgets/_Popup.scss +3 -3
  63. package/assets/esri/themes/base/widgets/_Swipe.scss +11 -0
  64. package/assets/esri/themes/dark/main.css +1 -1
  65. package/assets/esri/themes/light/main.css +1 -1
  66. package/assets/esri/themes/light/view.css +1 -1
  67. package/chunks/SSAO.glsl.js +1 -1
  68. package/chunks/languageUtils.js +1 -1
  69. package/geometry/Mesh.js +1 -1
  70. package/geometry/support/DoubleArray.js +1 -1
  71. package/geometry/support/meshUtils/bounds.js +5 -0
  72. package/geometry/support/meshUtils/georeference.js +1 -1
  73. package/interfaces.d.ts +2 -2
  74. package/kernel.js +1 -1
  75. package/layers/FeatureLayer.js +1 -1
  76. package/layers/StreamLayer.js +1 -1
  77. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  78. package/layers/graphics/data/QueryEngine.js +1 -1
  79. package/layers/graphics/data/attributeSupport.js +1 -1
  80. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  81. package/layers/support/FeatureReductionBinning.js +1 -1
  82. package/layers/support/FeatureReductionCluster.js +1 -1
  83. package/layers/support/featureLayerUtils.js +1 -1
  84. package/layers/support/rasterFunctions/colormaps.js +1 -1
  85. package/package.json +2 -2
  86. package/renderers/support/utils.js +1 -1
  87. package/support/arcadeUtils.js +1 -1
  88. package/support/revision.js +1 -1
  89. package/symbols/cim/CIMSymbolHelper.js +1 -1
  90. package/symbols/cim/effects/EffectBuffer.js +1 -1
  91. package/symbols/cim/effects/EffectDonut.js +1 -1
  92. package/symbols/cim/effects/EffectOffset.js +1 -1
  93. package/views/2d/layers/features/Store2D.js +1 -1
  94. package/views/2d/layers/features/sources/StreamSource.js +1 -1
  95. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  96. package/views/3d/layers/graphics/webStyleUtils.js +1 -1
  97. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  98. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  99. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  100. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  101. package/views/3d/webgl-engine/materials/pbrUtils.js +5 -0
  102. package/webdoc/support/writeUtils.js +1 -1
  103. package/widgets/Bookmarks/css.js +1 -1
  104. package/widgets/Bookmarks.js +1 -1
  105. package/widgets/Features.js +1 -1
  106. package/assets/esri/core/workers/chunks/0b03165dbf289797cefa.js +0 -1
  107. package/assets/esri/core/workers/chunks/0c1c0024879f944f44c4.js +0 -1
  108. package/assets/esri/core/workers/chunks/13a48796905613bc1679.js +0 -1
  109. package/assets/esri/core/workers/chunks/1ea1104651ab15f9a13c.js +0 -1
  110. package/assets/esri/core/workers/chunks/2108cfc7921430f0b805.js +0 -1
  111. package/assets/esri/core/workers/chunks/2eacca322737aafd8f0c.js +0 -1
  112. package/assets/esri/core/workers/chunks/39577683e334eb4d904c.js +0 -1
  113. package/assets/esri/core/workers/chunks/4d3deeb0ebd0ce8c1215.js +0 -1
  114. package/assets/esri/core/workers/chunks/576bddc3fa7d91a7e5bd.js +0 -1
  115. package/assets/esri/core/workers/chunks/623d6710a4f800c622ce.js +0 -1
  116. package/assets/esri/core/workers/chunks/6782cc3feb713676d544.js +0 -1
  117. package/assets/esri/core/workers/chunks/6e7178de0b2c3d2f7e6b.js +0 -1
  118. package/assets/esri/core/workers/chunks/78ce0b1af62435d8ebf4.js +0 -1
  119. package/assets/esri/core/workers/chunks/79d2baf392589588ef9b.js +0 -1
  120. package/assets/esri/core/workers/chunks/7bbdba52157da13a01fc.js +0 -1
  121. package/assets/esri/core/workers/chunks/84860b535a70ec448cfe.js +0 -1
  122. package/assets/esri/core/workers/chunks/9035d9e09a4e7cb94d37.js +0 -1
  123. package/assets/esri/core/workers/chunks/956b0fef7bc849415354.js +0 -1
  124. package/assets/esri/core/workers/chunks/9ab98321a4a7eaeeb018.js +0 -1
  125. package/assets/esri/core/workers/chunks/9cb7a68ff46e5c43e1d2.js +0 -1
  126. package/assets/esri/core/workers/chunks/a0f7f7f578521970c714.js +0 -1
  127. package/assets/esri/core/workers/chunks/a60eac45d3c65bd0216f.js +0 -1
  128. package/assets/esri/core/workers/chunks/aca5260f6984952a6e3d.js +0 -1
  129. package/assets/esri/core/workers/chunks/b05be356743fa5d24573.js +0 -1
  130. package/assets/esri/core/workers/chunks/ba6024465308c248170b.js +0 -1
  131. package/assets/esri/core/workers/chunks/d0983f808008920514f2.js +0 -1
  132. package/assets/esri/core/workers/chunks/dab832799bc06b0fec34.js +0 -1
  133. package/assets/esri/core/workers/chunks/e45d36aef2bc69ee9132.js +0 -1
  134. package/assets/esri/core/workers/chunks/e5bbd4cc5edbf7ab3624.js +0 -1
  135. package/assets/esri/core/workers/chunks/e700cf4d1f99291a4396.js +0 -1
  136. package/assets/esri/core/workers/chunks/f398a5cf33c3fd2522a5.js +0 -1
  137. package/assets/esri/core/workers/chunks/f4ee94a6cde4ea8837f1.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5481],{92835:(e,t,r)=>{r.d(t,{Z:()=>m});var s,i=r(43697),l=r(96674),o=r(70586),n=r(35463),a=r(5600),u=(r(75215),r(67676),r(80442),r(71715)),h=r(52011),c=r(30556);let p=s=class extends l.wq{static get allTime(){return d}static get empty(){return y}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?e.getTime():null}get isAllTime(){return this.equals(s.allTime)}get isEmpty(){return this.equals(s.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?e.getTime():null}clone(){return new s({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=null!=this.start?this.start.getTime():this.start,r=null!=this.end?this.end.getTime():this.end,s=null!=e.start?e.start.getTime():e.start,i=null!=e.end?e.end.getTime():e.end;return t===s&&r===i}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();const t=(0,o.yw)(this.start,(t=>(0,n.JE)(t,e))),r=(0,o.yw)(this.end,(t=>{const r=(0,n.JE)(t,e);return t.getTime()===r.getTime()?r:(0,n.Nm)(r,1,e)}));return new s({start:t,end:r})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return s.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,l=e.end?.getTime()??1/0;let o,n;if(i>=t&&i<=r?o=i:t>=i&&t<=l&&(o=t),r>=i&&r<=l?n=r:l>=t&&l<=r&&(n=l),null!=o&&null!=n&&!isNaN(o)&&!isNaN(n)){const e=new s;return e.start=o===-1/0?null:new Date(o),e.end=n===1/0?null:new Date(n),e}return s.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const r=new s,{start:i,end:l}=this;return null!=i&&(r.start=(0,n.Nm)(i,e,t)),null!=l&&(r.end=(0,n.Nm)(l,e,t)),r}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,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new s({start:t,end:r})}};(0,i._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,i._)([(0,u.r)("end")],p.prototype,"readEnd",null),(0,i._)([(0,c.c)("end")],p.prototype,"writeEnd",null),(0,i._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,i._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,i._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,i._)([(0,u.r)("start")],p.prototype,"readStart",null),(0,i._)([(0,c.c)("start")],p.prototype,"writeStart",null),p=s=(0,i._)([(0,h.j)("esri.TimeExtent")],p);const d=new p,y=new p({start:void 0,end:void 0}),m=p},13867:(e,t,r)=>{r.d(t,{z:()=>i});var s=r(69801);class i{constructor(e,t){this._storage=new s.WJ,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,r=1){this._storage.put(this,e,t,r,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(){}}},69801:(e,t,r)=>{r.d(t,{WJ:()=>n,Xq:()=>o});var s,i,l=r(44553);(i=s||(s={}))[i.ALL=0]="ALL",i[i.SOME=1]="SOME";class o{constructor(e,t,r){this.name=e,this._storage=t,this.id=a+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),r&&(this._storage.registerRemoveFunc(this.id,r),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}resetHitRate(){this._hit=this._miss=0}put(e,t,r,s=0){this._storage.put(this,e,t,r,s)}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}updateSize(e,t,r){this._storage.updateSize(this,e,t,r)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class n{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new l.Z,this._users=new l.Z}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimits()}put(e,t,r,i,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!==r&&this._notifyRemove(t,o.entry,s.ALL)),i>this._maxSize)return void this._notifyRemove(t,r,s.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!i||i<0)return void console.warn("Refusing to cache entry with invalid size "+i);const n=1+Math.max(l,-3)- -3;this._db.set(t,{entry:r,size:i,lifetime:n,lives:n}),this._size+=i,e.size+=i,this._checkSizeLimits()}updateSize(e,t,r,i){t=e.id+t;const l=this._db.get(t);if(l&&l.entry===r){for(this._size-=l.size,e.size-=l.size;i>this._maxSize;){const e=this._notifyRemove(t,r,s.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);i=e}l.size=i,this._size+=i,e.size+=i,this._checkSizeLimits()}}pop(e,t){t=e.id+t;const r=this._db.get(t);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(t),++this._hit,r.entry;++this._miss}get(e,t){t=e.id+t;const r=this._db.get(t);if(void 0!==r)return this._db.delete(t),r.lives=r.lifetime,this._db.set(t,r),++this._hit,r.entry;++this._miss}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={},r=new Array;this._db.forEach(((e,s)=>{const i=e.lifetime;r[i]=(r[i]||0)+e.size,this._users.forAll((r=>{const{id:i,name:l}=r;if(s.startsWith(i)){const r=t[l]||0;t[l]=r+e.size}}))}));const s={};this._users.forAll((e=>{const r=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const i=t[r]||0;t[r]=i,s[r]=Math.round(100*e.hitRate)+"%"}else s[r]="0%"}));const i=Object.keys(t);i.sort(((e,r)=>t[r]-t[e])),i.forEach((r=>e[r]=Math.round(t[r]/2**20)+"MB / "+s[r]));for(let t=r.length-1;t>=0;--t){const s=r[t];s&&(e["Priority "+(t+-3-1)]=Math.round(s/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,s.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,s.ALL))),this._users.forEach((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,r){let s;return this._removeFuncs.some((i=>{if(e.startsWith(i[0])){const e=i[1](t,r);return"number"==typeof e&&(s=e),!0}return!1})),s}_checkSizeLimits(){if(this._size>this._maxSize)for(const[e,t]of this._db)if(this._purgeItem(e,t),this._size<=.9*this.maxSize)return;this._users.forEach((e=>{if(e.maxSize>0&&e.size>e.maxSize)for(const[t,r]of this._db)if(t.startsWith(e.id)&&(this._purgeItem(t,r,e),e.size<=.9*e.maxSize))return}))}_purgeItem(e,t,r=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,r&&(r.size-=t.size);const i=this._notifyRemove(e,t.entry,s.SOME);null!=i&&i>0&&(this._size+=i,r&&(r.size+=i),t.lives=t.lifetime,t.size=i,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let a=0},17445:(e,t,r)=>{r.d(t,{N1:()=>p,YP:()=>a,Z_:()=>m,gx:()=>u,nn:()=>f,on:()=>c,tX:()=>g});var s=r(91460),i=r(50758),l=r(70586),o=r(95330),n=r(26258);function a(e,t,r={}){return h(e,t,r,d)}function u(e,t,r={}){return h(e,t,r,y)}function h(e,t,r={},s){let i=null;const o=r.once?(e,r)=>{s(e)&&((0,l.hw)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,n.aQ)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return i}function c(e,t,r,o={}){let n=null,u=null,h=null;function c(){n&&u&&(u.remove(),o.onListenerRemove?.(n),n=null,u=null)}function p(e){o.once&&o.once&&(0,l.hw)(h),r(e)}const d=a(e,((e,r)=>{c(),(0,s.vT)(e)&&(n=e,u=(0,s.on)(e,t,p),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,i.kB)((()=>{d.remove(),c()})),h}function p(e,t){return function(e,t,r){if((0,o.Hc)(r))return Promise.reject((0,o.zE)());const s=e();if(t?.(s))return Promise.resolve(s);let n=null;function a(){n=(0,l.hw)(n)}return new Promise(((s,l)=>{n=(0,i.AL)([(0,o.fu)(r,(()=>{a(),l((0,o.zE)())})),h(e,(e=>{a(),s(e)}),{sync:!1,once:!0},t??d)])}))}(e,y,t)}function d(e){return!0}function y(e){return!!e}r(87538);const m={sync:!0},f={initial:!0},g={sync:!0,initial:!0}},35463:(e,t,r)=>{r.d(t,{JE:()=>o,Nm:()=>l,rJ:()=>n}),r(80442);const s={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},i={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function l(e,t,r){const s=new Date(e.getTime());if(t&&r){const e=i[r],{getter:l,setter:o,multiplier:n}=e;if("months"===r){const e=function(e,t){const r=new Date(e,t+1,1);return r.setDate(0),r.getDate()}(s.getFullYear(),s.getMonth()+t);s.getDate()>e&&s.setDate(e)}s[o](s[l]()+t*n)}return s}function o(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function n(e,t,r){return 0===e?0:e*s[t]/s[r]}},94756:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ce});var s=r(43697),i=r(3172),l=r(66643),o=r(20102),n=r(22974),a=r(16453),u=r(95330),h=r(81271),c=r(5600),p=(r(75215),r(71715)),d=r(52011),y=r(30556),m=r(6570),f=r(82971),g=r(87085),_=r(54295),w=r(46486),v=r(17287),S=r(71612),A=r(17017),b=r(38009),x=r(16859),I=r(72965);let E=null;var T=r(92604),R=r(1533);class z{constructor(e,t){this._spriteSource=e,this._maxTextureSize=t,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded","url"===e.type&&e.spriteFormat&&(this._spriteImageFormat=e.spriteFormat),e.pixelRatio&&(this.devicePixelRatio=e.pixelRatio),this.baseURL=e.spriteUrl}get spriteNames(){const e=[];for(const t in this._spritesData)e.push(t);return e.sort(),e}getSpriteInfo(e){return this._spritesData?this._spritesData[e]:null}async load(e){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(e),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(e){this._isRetina=this.devicePixelRatio>1.15;const{width:t,height:r,data:s,json:i}=await this._getSpriteData(this._spriteSource,e),l=Object.keys(i);if(!l||0===l.length||!s)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=i,this.width=t,this.height=r;const n=Math.max(this._maxTextureSize,4096);if(t>n||r>n){const e=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${n} pixels}`;throw T.Z.getLogger("esri.layers.support.SpriteSource").error(e),new o.Z("SpriteSource",e)}let a;for(let e=0;e<s.length;e+=4)a=s[e+3]/255,s[e]=s[e]*a,s[e+1]=s[e+1]*a,s[e+2]=s[e+2]*a;this.image=s}async _getSpriteData(e,t){if("image"===e.type){let t,r;if(this.devicePixelRatio<1.15){if(!e.spriteSource1x)throw new o.Z("SpriteSource","no image data provided for low resolution sprites!");t=e.spriteSource1x.image,r=e.spriteSource1x.json}else{if(!e.spriteSource2x)throw new o.Z("SpriteSource","no image data provided for high resolution sprites!");t=e.spriteSource2x.image,r=e.spriteSource2x.json}return"width"in t&&"height"in t&&"data"in t&&((0,R.eP)(t.data)||(0,R.KZ)(t.data))?{width:t.width,height:t.height,data:new Uint8Array(t.data),json:r}:{...P(t),json:r}}const r=(0,h.mN)(this.baseURL),s=r.query?"?"+(0,h.B7)(r.query):"",l=this._isRetina?"@2x":"",n=`${r.path}${l}.${this._spriteImageFormat}${s}`,a=`${r.path}${l}.json${s}`,[u,c]=await Promise.all([(0,i.default)(a,t),(0,i.default)(n,{responseType:"image",...t})]);return{...P(c.data),json:u.data}}}function P(e){const t=document.createElement("canvas"),r=t.getContext("2d");t.width=e.width,t.height=e.height,r.drawImage(e,0,0,e.width,e.height);const s=r.getImageData(0,0,e.width,e.height);return{width:e.width,height:e.height,data:new Uint8Array(s.data)}}var U=r(11145),L=r(28589),C=r(55415);class F{constructor(e){this.url=e}destroy(){this._tileIndexPromise=null}async fetchTileIndex(){return this._tileIndexPromise||(this._tileIndexPromise=(0,i.default)(this.url).then((e=>e.data.index))),this._tileIndexPromise}async dataKey(e,t){const r=await this.fetchTileIndex();return(0,u.k_)(t),this._getIndexedDataKey(r,e)}_getIndexedDataKey(e,t){const r=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let s=t;for(;0!==s.level;)s=new C.Z(s.level-1,s.row>>1,s.col>>1,s.world),r.push(s);let i,l,o=e,n=r.pop();if(1===o)return n;for(;r.length;)if(i=r.pop(),l=(1&i.col)+((1&i.row)<<1),o){if(0===o[l]){n=null;break}if(1===o[l]){n=i;break}n=i,o=o[l]}return n}}var D=r(70586);class M{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=(0,D.SC)(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||(this._tileIndexPromise=(0,i.default)(this._tileIndexUrl,{query:{...e?.query}}).then((e=>e.data.index))),this._tileIndexPromise}dataKey(e,t){const{level:r,row:s,col:i}=e,l=new C.Z(e);return this._tilemap.fetchAvailabilityUpsample(r,s,i,l,t).then((()=>(l.world=e.world,l))).catch((e=>{if((0,u.D_)(e))throw e;return null}))}}var O=r(30175);class B{constructor(e){this._tileUrl=e,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(e){null===this._promise&&(this._abortController=new AbortController,this._promise=this._makeRequest(this._tileUrl,this._abortController.signal));const t=this._abortOptions;return t.push(e),(0,u.fu)(e,(()=>{t.every((e=>(0,u.Hc)(e)))&&this._abortController.abort()})),this._promise.then((e=>(0,n.d9)(e)))}async _makeRequest(e,t){const{data:r}=await(0,i.default)(e,{responseType:"array-buffer",signal:t});return r}}const N=new Map;function k(e,t){return(0,O.s1)(N,e,(()=>new B(e))).getData(t).then((t=>(N.delete(e),t))).catch((t=>{throw N.delete(e),t}))}class j{constructor(e,t,r){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.name=e,this.sourceUrl=t;const s=(0,h.mN)(this.sourceUrl),i=(0,n.d9)(r),l=i.tiles;if(s)for(let e=0;e<l.length;e++){const t=(0,h.mN)(l[e]);t&&((0,h.YP)(t.path)||(t.path=(0,h.v_)(s.path,t.path)),l[e]=(0,h.fl)(t.path,{...s.query,...t.query}))}this.tileServers=l;const o=r.capabilities&&r.capabilities.split(",").map((e=>e.toLowerCase().trim())),a=!0===r?.exportTilesAllowed,u=!0===o?.includes("tilemap"),c=a&&r.hasOwnProperty("maxExportTilesCount")?r.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:a,supportsTileMap:u},exportTiles:a?{maxExportTilesCount:+c}:null},this.tileInfo=U.Z.fromJSON(i.tileInfo);const p=r.tileMap?(0,h.fl)((0,h.v_)(s.path,r.tileMap),s.query??{}):null;u?(this.type="vector-tile",this.tilemap=new M(new L.y({layer:{parsedUrl:s,tileInfo:this.tileInfo},minLOD:i.minLOD??this.tileInfo.lods[0].level,maxLOD:i.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),p)):p&&(this.tilemap=new F(p)),this.fullExtent=m.Z.fromJSON(r.fullExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(e,t){return await(this.tilemap?.dataKey(e,t))??e}requestTile(e,t,r,s){return function(e,t,r,s,i){const l=(0,h.mN)(e),o=l.query;if(o)for(const[e,i]of Object.entries(o))switch(i){case"{x}":o[e]=s.toString();break;case"{y}":o[e]=r.toString();break;case"{z}":o[e]=t.toString()}const n=l.path;return k((0,h.fl)(n.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,s.toString()),{...l.query}),i)}(this.tileServers[t%this.tileServers.length],e,t,r,s)}isCompatibleWith(e){const t=this.tileInfo,r=e.tileInfo;if(!t.spatialReference.equals(r.spatialReference))return!1;if(!t.origin.equals(r.origin))return!1;if(Math.round(t.dpi)!==Math.round(r.dpi))return!1;const s=t.lods,i=r.lods,l=Math.min(s.length,i.length);for(let e=0;e<l;e++){const t=s[e],r=i[e];if(t.level!==r.level||Math.round(t.scale)!==Math.round(r.scale))return!1}return!0}}function W(...e){let t;for(const r of e)if(null!=r)if((0,h.oC)(r)){if(t){const e=t.split("://")[0];t=e+":"+r.trim()}}else t=(0,h.YP)(r)?r:(0,h.v_)(t,r);return t?(0,h.Qj)(t):void 0}async function G(e,t,r,s,l){let o,n,a;if((0,u.k_)(l),"string"==typeof r){const e=(0,h.Fv)(r);a=await(0,i.default)(e,{...l,responseType:"json",query:{f:"json",...l?.query}}),a.ssl&&(o&&(o=o.replace(/^http:/i,"https:")),n&&(n=n.replace(/^http:/i,"https:"))),o=e,n=e}else null!=r&&(a={data:r},o=r.jsonUrl||null,n=s);const c=a?.data;if(H(c))return e.styleUrl=o||null,async function(e,t,r,s){const i=r?(0,h.Yd)(r):(0,h.L)();e.styleBase=i,e.style=t,t["sprite-format"]&&"webp"===t["sprite-format"].toLowerCase()&&(e.spriteFormat="webp");const l=[];if(t.sources&&t.sources.esri){const r=t.sources.esri;r.url?await G(e,"esri",W(i,r.url),void 0,s):l.push(G(e,"esri",r,i,s))}for(const r of Object.keys(t.sources))"esri"!==r&&"vector"===t.sources[r].type&&(t.sources[r].url?l.push(G(e,r,W(i,t.sources[r].url),void 0,s)):t.sources[r].tiles&&l.push(G(e,r,t.sources[r],i,s)));await Promise.all(l)}(e,c,n,l);if(!H(c))return e.sourceUrl?Z(e,c,n,!1,t,l):(e.sourceUrl=o||null,Z(e,c,n,!0,t,l));throw new Error("You must specify the URL or the JSON for a service or for a style.")}function H(e){return!!e&&"sources"in e&&!!e.sources}async function Z(e,t,r,s,i,l){const o=r?(0,h.Qj)(r)+"/":(0,h.L)(),n=function(e){if(e.hasOwnProperty("tileInfo"))return e;const t={xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:{wkid:102100}};let r=78271.51696400007,s=295828763.7957775;const i=[],l=e.hasOwnProperty("minzoom")?+e.minzoom:0,o=e.hasOwnProperty("maxzoom")?+e.maxzoom:22;for(let e=0;e<=o;e++)e>=l&&i.push({level:e,scale:s,resolution:r}),r/=2,s/=2;return{capabilities:"TilesOnly",initialExtent:t,fullExtent:t,minScale:0,maxScale:0,tiles:e.tiles,tileInfo:{rows:512,cols:512,dpi:96,format:"pbf",origin:{x:-20037508.342787,y:20037508.342787},lods:i,spatialReference:{wkid:102100}}}}(t),a=new j(i,(0,h.fl)(o,l?.query??{}),n);if(!s&&e.primarySourceName in e.sourceNameToSource){const t=e.sourceNameToSource[e.primarySourceName];if(!t.isCompatibleWith(a))return;null!=a.fullExtent&&(null!=t.fullExtent?t.fullExtent.union(a.fullExtent):t.fullExtent=a.fullExtent.clone()),t.tileInfo&&a.tileInfo&&t.tileInfo.lods.length<a.tileInfo.lods.length&&(t.tileInfo=a.tileInfo)}if(s&&(e.sourceBase=o,e.source=t,e.validatedSource=n,e.primarySourceName=i),e.sourceNameToSource[i]=a,!e.style){if(null==t.defaultStyles)throw new Error;return"string"==typeof t.defaultStyles?G(e,"",W(o,t.defaultStyles,"root.json"),void 0,l):G(e,"",t.defaultStyles,W(o,"root.json"),l)}}var $=r(33516),q=r(19745),Y=r(25929),K=r(94139),V=r(39450);const Q=1e-6;function J(e,t){if(e===t)return!0;if(null==e&&null!=t)return!1;if(null!=e&&null==t)return!1;if(null==e||null==t)return!1;if(!e.spatialReference.equals(t.spatialReference)||e.dpi!==t.dpi)return!1;const r=e.origin,s=t.origin;if(Math.abs(r.x-s.x)>=Q||Math.abs(r.y-s.y)>=Q)return!1;let i,l;e.lods[0].scale>t.lods[0].scale?(i=e,l=t):(l=e,i=t);for(let e=i.lods[0].scale;e>=l.lods[l.lods.length-1].scale-Q;e/=2)if(Math.abs(e-l.lods[0].scale)<Q)return!0;return!1}function X(e,t){if(e===t)return e;if(null==e&&null!=t)return t;if(null!=e&&null==t)return e;if(null==e||null==t)return null;const r=e.size[0],s=e.format,i=e.dpi,l=new K.Z({x:e.origin.x,y:e.origin.y}),o=e.spatialReference,n=e.lods[0].scale>t.lods[0].scale?e.lods[0]:t.lods[0],a=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],u=n.scale,h=n.resolution,c=a.scale,p=[];let d=u,y=h,m=0;for(;d>c;)p.push(new V.Z({level:m,resolution:y,scale:d})),m++,d/=2,y/=2;return new U.Z({size:[r,r],dpi:i,format:s||"pbf",origin:l,lods:p,spatialReference:o})}var ee=r(51785),te=r(7575);let re,se;function ie(e){const t=(0,te.Sh)(e);for(;t.length>1;){const e=le(t.shift());if(e.available)return e}return le(t.shift())}function le(e){switch(e){case te.zO.WEBGL1:return re||(re=function(){const e=new ne,t=ue(te.zO.WEBGL1,e);return null==t||(e.supportsElementIndexUint=null!==t.getExtension("OES_element_index_uint"),e.supportsStandardDerivatives=null!==t.getExtension("OES_standard_derivatives"),e.supportsInstancedArrays=null!==t.getExtension("ANGLE_instanced_arrays"),e.supportsTextureFloat=null!==t.getExtension("OES_texture_float"),e.supportsTextureHalfFloat=null!==t.getExtension("OES_texture_half_float"),e.supportsColorBufferFloat=null!==t.getExtension("WEBGL_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==t.getExtension("EXT_float_blend"),e.supportsColorBufferHalfFloat=null!==t.getExtension("EXT_color_buffer_half_float")),e}()),re;case te.zO.WEBGL2:return se||(se=function(){const e=new ae,t=ue(te.zO.WEBGL2,e);return null==t||(e.supportsColorBufferFloat=null!==t.getExtension("EXT_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==t.getExtension("EXT_float_blend"),e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||null!==t.getExtension("EXT_color_buffer_half_float")),e}()),se}}class oe{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureHalfFloat=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}}class ne extends oe{constructor(){super(...arguments),this.type=te.zO.WEBGL1}}class ae extends oe{constructor(){super(...arguments),this.type=te.zO.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0}}function ue(e,t){if(e===te.zO.WEBGL1&&"undefined"==typeof WebGLRenderingContext||e===te.zO.WEBGL2&&"undefined"==typeof WebGL2RenderingContext)return null;const r=document.createElement("canvas");if(!r)return null;let s=(0,te.kr)(r,e,{failIfMajorPerformanceCaveat:!0});if(null==s&&(s=(0,te.kr)(r,e),null!=s&&(t.majorPerformanceCaveat=!0)),null==s)return s;if(e===te.zO.WEBGL1){const e=s.getParameter(s.VERSION),r=e?.match(/^WebGL\s+([\d.]*)/);if(r){const e=parseFloat(r[1]);t.available=e>=.94}}else t.available=!0;t.maxTextureSize=s.getParameter(s.MAX_TEXTURE_SIZE),t.supportsVertexShaderSamplers=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const i=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);return i&&(t.supportsHighPrecisionFragment=i.precision>0),s}let he=class extends((0,S.h)((0,I.M)((0,w.Z)((0,v.Y)((0,b.q)((0,x.I)((0,A.N)((0,_.V)((0,a.R)(g.Z)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.style=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.tilemapCache=null,this.type="vector-tile",this.url=null,this.showCollisionBoxes="none",this.path=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(u.r9).then((async()=>{if(!this.portalItem||!this.portalItem.id)return;const t=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await(0,i.default)(t,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:t},(0,$.h)(this.portalItem))})).catch(u.r9).then((()=>this._loadStyle(e)));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e&&e.serviceUrl&&(0,h.mN)(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?(0,h.fl)(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get parsedUrl(){return this.serviceUrl?(0,h.mN)(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo&&this.currentStyleInfo.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo&&this.currentStyleInfo.styleUrl||null}writeStyleUrl(e,t){e&&(0,h.oC)(e)&&(e=`https:${e}`);const r=(0,q.a)(e);t.styleUrl=(0,Y.e)(e,r)}get tileInfo(){const e=[];for(const t in this.sourceNameToSource)e.push(this.sourceNameToSource[t]);let t=this.primarySource?.tileInfo||new U.Z;if(e.length>1)for(let r=0;r<e.length;r++)J(t,e[r].tileInfo)&&(t=X(t,e[r].tileInfo));return t}readTilemapCache(e,t){const r=t.capabilities?.includes("Tilemap");return r?new L.y({layer:this}):null}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){const r=ie("2d").maxTextureSize,s=this.currentStyleInfo?.spriteUrl?(0,h.fl)(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,i=new z({type:"url",spriteUrl:s,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await i.load(t),this._spriteSourceMap.set(e,i)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;const r=ie("2d").maxTextureSize,s=e.spriteUrl,i=s?(0,h.fl)(s,{...this.customParameters,token:this.apiKey}):null;if(!i&&"url"===e.type)return null;const l=new z(e,r);try{await l.load(t);const r=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,l),i&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=i),this.emit("spriteSource-change",{spriteSource:l}),l}catch(e){(0,u.r9)(e)}return null}async loadStyle(e,t){const r=e||this.style||this.url;return this._loadingTask&&"string"==typeof r&&this.url===r||(this._loadingTask?.abort(),this._loadingTask=(0,l.vr)((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return(0,n.d9)(this.styleRepository.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const s=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||s})}getStyleLayer(e){return(0,n.d9)(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return(0,n.d9)(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new o.Z("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await async function(e,t){const r={source:null,sourceBase:null,sourceUrl:null,validatedSource:null,style:null,styleBase:null,styleUrl:null,sourceNameToSource:{},primarySourceName:"",spriteFormat:"png"},[s,i]="string"==typeof e?[e,null]:[null,e.jsonUrl];return await G(r,"esri",e,i,t),{layerDefinition:r.validatedSource,url:s,serviceUrl:r.sourceUrl,style:r.style,styleUrl:r.styleUrl,spriteUrl:r.style.sprite&&W(r.styleBase,r.style.sprite),spriteFormat:r.spriteFormat,glyphsUrl:r.style.glyphs&&W(r.styleBase,r.style.glyphs),sourceNameToSource:r.sourceNameToSource,primarySourceName:r.primarySourceName}}(e,{...t,query:{...this.customParameters,token:this.apiKey}});"webp"===r.spriteFormat&&(await function(e){if(E)return E;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return E=new Promise((e=>{const r=new Image;r.onload=()=>{r.onload=r.onerror=null,e(r.width>0&&r.height>0)},r.onerror=()=>{r.onload=r.onerror=null,e(!1)},r.src="data:image/webp;base64,"+t.lossy})),E}()||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new ee.Z(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!t)return;const s=t[2]&&t[2].toLowerCase();if(!s)return;const i=t[1]||"";for(const e of r)if(e.toLowerCase().includes(s))return(0,h.Fv)(`//static.arcgis.com/attribution/Vector${i}/${e}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"attributionDataUrl",null),(0,s._)([(0,c.Cb)({type:["show","hide"]})],he.prototype,"listMode",void 0),(0,s._)([(0,c.Cb)({json:{read:!0,write:!0}})],he.prototype,"blendMode",void 0),(0,s._)([(0,c.Cb)({readOnly:!0,json:{read:!1}})],he.prototype,"capabilities",null),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"currentStyleInfo",void 0),(0,s._)([(0,c.Cb)({json:{read:!1},readOnly:!0,type:m.Z})],he.prototype,"fullExtent",null),(0,s._)([(0,c.Cb)()],he.prototype,"style",void 0),(0,s._)([(0,c.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],he.prototype,"isReference",void 0),(0,s._)([(0,c.Cb)({type:["VectorTileLayer"]})],he.prototype,"operationalLayerType",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"parsedUrl",null),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"serviceUrl",null),(0,s._)([(0,c.Cb)({type:f.Z,readOnly:!0})],he.prototype,"spatialReference",null),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"styleRepository",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"sourceNameToSource",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"primarySource",void 0),(0,s._)([(0,c.Cb)({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],he.prototype,"styleUrl",null),(0,s._)([(0,y.c)(["portal-item","web-document"],"styleUrl")],he.prototype,"writeStyleUrl",null),(0,s._)([(0,c.Cb)({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:U.Z})],he.prototype,"tileInfo",null),(0,s._)([(0,c.Cb)()],he.prototype,"tilemapCache",void 0),(0,s._)([(0,p.r)("service","tilemapCache",["capabilities","tileInfo"])],he.prototype,"readTilemapCache",null),(0,s._)([(0,c.Cb)({json:{read:!1},readOnly:!0,value:"vector-tile"})],he.prototype,"type",void 0),(0,s._)([(0,c.Cb)({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],he.prototype,"url",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"version",void 0),(0,s._)([(0,p.r)("version",["version","currentVersion"])],he.prototype,"readVersion",null),(0,s._)([(0,c.Cb)({type:String})],he.prototype,"showCollisionBoxes",void 0),(0,s._)([(0,c.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],he.prototype,"path",void 0),he=(0,s._)([(0,d.j)("esri.layers.VectorTileLayer")],he);const ce=he},54295:(e,t,r)=>{r.d(t,{V:()=>o});var s=r(43697),i=r(5600),l=(r(75215),r(67676),r(80442),r(52011));const o=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,s._)([(0,i.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,s._)([(0,l.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17017:(e,t,r)=>{r.d(t,{N:()=>o});var s=r(43697),i=r(5600),l=(r(75215),r(67676),r(80442),r(52011));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,s._)([(0,i.Cb)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,s._)([(0,l.j)("esri.layers.mixins.CustomParametersMixin")],t),t}},16859:(e,t,r)=>{r.d(t,{I:()=>A});var s=r(43697),i=r(68773),l=r(40330),o=r(3172),n=r(66643),a=r(20102),u=r(92604),h=r(70586),c=r(95330),p=r(81271),d=r(5600),y=(r(75215),r(67676),r(80442),r(71715)),m=r(52011),f=r(30556),g=r(84230),_=r(48522),w=r(15235),v=r(86082),S=r(14661);const A=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,h.SC)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new w.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const{load:s}=await r.e(8062).then(r.bind(r,18062));return(0,c.k_)(t),await s({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,c.D_)(e)||u.Z.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,c.r9)(e),!0))))}async _setUserPrivileges(e,t){if(!i.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:s},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,c.r9)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const s=e===r.id;if(s&&r.portal.user)return(0,S.Ss)(r);let i,o;if(s)i=r.portal.url;else try{i=await(0,g.oP)(this.url,t)}catch(e){(0,c.r9)(e)}if(!i||!(0,p.Zo)(i,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(l.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.r9)(e)}if(!o)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(s?await r.reload():(r=new w.default({id:e,portal:{url:i}}),await r.load(t)),r.portal.user)return(0,S.Ss)(r)}catch(e){(0,c.r9)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.r9)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?l.id?.findCredential(this.url):null;if(!t)return!0;const r=b.credential===t?b.user:await this._fetchEditingUser(e);return b.credential=t,b.user=r,null==r||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=l.id.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const s=`${r.owningSystemUrl}/sharing/rest`,i=_.Z.getDefault();if(i&&i.loaded&&(0,p.Fv)(i.restUrl)===(0,p.Fv)(s))return i.user;const a=`${s}/community/self`,u=null!=e?e.signal:null,h=await(0,n.q6)((0,o.default)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return h.ok?v.default.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||_.Z.getDefault());return r&&s&&!(0,p.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.Z("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,s._)([(0,d.Cb)({type:w.default})],t.prototype,"portalItem",null),(0,s._)([(0,y.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,f.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,s._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,s._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,s._)([(0,m.j)("esri.layers.mixins.PortalLayer")],t),t},b={credential:null,user:null}},33516:(e,t,r)=>{r.d(t,{Y:()=>o,h:()=>l});var s=r(81271),i=r(48522);function l(e){return{origin:"portal-item",url:(0,s.mN)(e.itemUrl),portal:e.portal||i.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function o(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?(0,s.mN)(e.itemUrl):null,portal:e.portal||i.Z.getDefault(),portalItem:e}}},55415:(e,t,r)=>{r.d(t,{Z:()=>i});var s=r(71143);class i{static getId(e,t,r,s){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${r}/${s}`}constructor(e,t,r,s){this.set(e,t,r,s)}get key(){return this}get id(){return this.toString()}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,r=63&this.level;return(3&this.world)<<30|t<<22|e<<8|r}acquire(e,t,r,s){this.set(e,t,r,s)}contains(e){const t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new i(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,r,s){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,r,s,i]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(r),this.col=parseFloat(s),this.world=parseFloat(i)}else this.level=+e,this.row=+t,this.col=+r,this.world=+s||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new i(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const e=this.level+1,t=this.row<<1,r=this.col<<1,s=this.world;return[new i(e,t,r,s),new i(e,t,r+1,s),new i(e,t+1,r,s),new i(e,t+1,r+1,s)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}i.pool=new s.Z(i,null,null,25,50)},7575:(e,t,r)=>{r.d(t,{Sh:()=>o,kr:()=>l,zO:()=>s});var s,i=r(80442);function l(e,t,r={}){const i=t===s.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];for(const t of i){const s=e.getContext(t,r);if(s)return s}return null}function o(e){if("3d"===e)return[s.WEBGL2];const t=(0,i.Z)("esri-force-webgl");return t===s.WEBGL1||t===s.WEBGL2?[t]:(0,i.Z)("mac")&&(0,i.Z)("chrome")?[s.WEBGL1,s.WEBGL2]:[s.WEBGL2,s.WEBGL1]}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(s||(s={}))}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5481],{92835:(e,t,r)=>{r.d(t,{Z:()=>m});var s,i=r(43697),l=r(96674),o=r(70586),n=r(35463),a=r(5600),u=(r(75215),r(67676),r(80442),r(71715)),h=r(52011),c=r(30556);let p=s=class extends l.wq{static get allTime(){return d}static get empty(){return y}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?e.getTime():null}get isAllTime(){return this.equals(s.allTime)}get isEmpty(){return this.equals(s.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?e.getTime():null}clone(){return new s({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=null!=this.start?this.start.getTime():this.start,r=null!=this.end?this.end.getTime():this.end,s=null!=e.start?e.start.getTime():e.start,i=null!=e.end?e.end.getTime():e.end;return t===s&&r===i}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();const t=(0,o.yw)(this.start,(t=>(0,n.JE)(t,e))),r=(0,o.yw)(this.end,(t=>{const r=(0,n.JE)(t,e);return t.getTime()===r.getTime()?r:(0,n.Nm)(r,1,e)}));return new s({start:t,end:r})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return s.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,l=e.end?.getTime()??1/0;let o,n;if(i>=t&&i<=r?o=i:t>=i&&t<=l&&(o=t),r>=i&&r<=l?n=r:l>=t&&l<=r&&(n=l),null!=o&&null!=n&&!isNaN(o)&&!isNaN(n)){const e=new s;return e.start=o===-1/0?null:new Date(o),e.end=n===1/0?null:new Date(n),e}return s.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const r=new s,{start:i,end:l}=this;return null!=i&&(r.start=(0,n.Nm)(i,e,t)),null!=l&&(r.end=(0,n.Nm)(l,e,t)),r}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,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new s({start:t,end:r})}};(0,i._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,i._)([(0,u.r)("end")],p.prototype,"readEnd",null),(0,i._)([(0,c.c)("end")],p.prototype,"writeEnd",null),(0,i._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,i._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,i._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,i._)([(0,u.r)("start")],p.prototype,"readStart",null),(0,i._)([(0,c.c)("start")],p.prototype,"writeStart",null),p=s=(0,i._)([(0,h.j)("esri.TimeExtent")],p);const d=new p,y=new p({start:void 0,end:void 0}),m=p},13867:(e,t,r)=>{r.d(t,{z:()=>i});var s=r(69801);class i{constructor(e,t){this._storage=new s.WJ,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,r=1){this._storage.put(this,e,t,r,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(){}}},69801:(e,t,r)=>{r.d(t,{WJ:()=>n,Xq:()=>o});var s,i,l=r(44553);(i=s||(s={}))[i.ALL=0]="ALL",i[i.SOME=1]="SOME";class o{constructor(e,t,r){this.name=e,this._storage=t,this.id=a+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),r&&(this._storage.registerRemoveFunc(this.id,r),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}resetHitRate(){this._hit=this._miss=0}put(e,t,r,s=0){this._storage.put(this,e,t,r,s)}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}updateSize(e,t,r){this._storage.updateSize(this,e,t,r)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class n{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new l.Z,this._users=new l.Z}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimits()}put(e,t,r,i,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!==r&&this._notifyRemove(t,o.entry,s.ALL)),i>this._maxSize)return void this._notifyRemove(t,r,s.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!i||i<0)return void console.warn("Refusing to cache entry with invalid size "+i);const n=1+Math.max(l,-3)- -3;this._db.set(t,{entry:r,size:i,lifetime:n,lives:n}),this._size+=i,e.size+=i,this._checkSizeLimits()}updateSize(e,t,r,i){t=e.id+t;const l=this._db.get(t);if(l&&l.entry===r){for(this._size-=l.size,e.size-=l.size;i>this._maxSize;){const e=this._notifyRemove(t,r,s.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);i=e}l.size=i,this._size+=i,e.size+=i,this._checkSizeLimits()}}pop(e,t){t=e.id+t;const r=this._db.get(t);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(t),++this._hit,r.entry;++this._miss}get(e,t){t=e.id+t;const r=this._db.get(t);if(void 0!==r)return this._db.delete(t),r.lives=r.lifetime,this._db.set(t,r),++this._hit,r.entry;++this._miss}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={},r=new Array;this._db.forEach(((e,s)=>{const i=e.lifetime;r[i]=(r[i]||0)+e.size,this._users.forAll((r=>{const{id:i,name:l}=r;if(s.startsWith(i)){const r=t[l]||0;t[l]=r+e.size}}))}));const s={};this._users.forAll((e=>{const r=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const i=t[r]||0;t[r]=i,s[r]=Math.round(100*e.hitRate)+"%"}else s[r]="0%"}));const i=Object.keys(t);i.sort(((e,r)=>t[r]-t[e])),i.forEach((r=>e[r]=Math.round(t[r]/2**20)+"MB / "+s[r]));for(let t=r.length-1;t>=0;--t){const s=r[t];s&&(e["Priority "+(t+-3-1)]=Math.round(s/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,s.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,s.ALL))),this._users.forEach((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,r){let s;return this._removeFuncs.some((i=>{if(e.startsWith(i[0])){const e=i[1](t,r);return"number"==typeof e&&(s=e),!0}return!1})),s}_checkSizeLimits(){if(this._size>this._maxSize)for(const[e,t]of this._db)if(this._purgeItem(e,t),this._size<=.9*this.maxSize)return;this._users.forEach((e=>{if(e.maxSize>0&&e.size>e.maxSize)for(const[t,r]of this._db)if(t.startsWith(e.id)&&(this._purgeItem(t,r,e),e.size<=.9*e.maxSize))return}))}_purgeItem(e,t,r=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,r&&(r.size-=t.size);const i=this._notifyRemove(e,t.entry,s.SOME);null!=i&&i>0&&(this._size+=i,r&&(r.size+=i),t.lives=t.lifetime,t.size=i,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let a=0},17445:(e,t,r)=>{r.d(t,{N1:()=>p,YP:()=>a,Z_:()=>m,gx:()=>u,nn:()=>f,on:()=>c,tX:()=>g});var s=r(91460),i=r(50758),l=r(70586),o=r(95330),n=r(26258);function a(e,t,r={}){return h(e,t,r,d)}function u(e,t,r={}){return h(e,t,r,y)}function h(e,t,r={},s){let i=null;const o=r.once?(e,r)=>{s(e)&&((0,l.hw)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,n.aQ)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return i}function c(e,t,r,o={}){let n=null,u=null,h=null;function c(){n&&u&&(u.remove(),o.onListenerRemove?.(n),n=null,u=null)}function p(e){o.once&&o.once&&(0,l.hw)(h),r(e)}const d=a(e,((e,r)=>{c(),(0,s.vT)(e)&&(n=e,u=(0,s.on)(e,t,p),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return h=(0,i.kB)((()=>{d.remove(),c()})),h}function p(e,t){return function(e,t,r){if((0,o.Hc)(r))return Promise.reject((0,o.zE)());const s=e();if(t?.(s))return Promise.resolve(s);let n=null;function a(){n=(0,l.hw)(n)}return new Promise(((s,l)=>{n=(0,i.AL)([(0,o.fu)(r,(()=>{a(),l((0,o.zE)())})),h(e,(e=>{a(),s(e)}),{sync:!1,once:!0},t??d)])}))}(e,y,t)}function d(e){return!0}function y(e){return!!e}r(87538);const m={sync:!0},f={initial:!0},g={sync:!0,initial:!0}},35463:(e,t,r)=>{r.d(t,{JE:()=>o,Nm:()=>l,rJ:()=>n}),r(80442);const s={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},i={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function l(e,t,r){const s=new Date(e.getTime());if(t&&r){const e=i[r],{getter:l,setter:o,multiplier:n}=e;if("months"===r){const e=function(e,t){const r=new Date(e,t+1,1);return r.setDate(0),r.getDate()}(s.getFullYear(),s.getMonth()+t);s.getDate()>e&&s.setDate(e)}s[o](s[l]()+t*n)}return s}function o(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function n(e,t,r){return 0===e?0:e*s[t]/s[r]}},94756:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ce});var s=r(43697),i=r(3172),l=r(66643),o=r(20102),n=r(22974),a=r(16453),u=r(95330),h=r(81271),c=r(5600),p=(r(75215),r(71715)),d=r(52011),y=r(30556),m=r(6570),f=r(82971),g=r(87085),_=r(54295),w=r(46486),v=r(17287),S=r(71612),A=r(17017),b=r(38009),x=r(16859),I=r(72965);let E=null;var T=r(92604),R=r(1533);class z{constructor(e,t){this._spriteSource=e,this._maxTextureSize=t,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded","url"===e.type&&e.spriteFormat&&(this._spriteImageFormat=e.spriteFormat),e.pixelRatio&&(this.devicePixelRatio=e.pixelRatio),this.baseURL=e.spriteUrl}get spriteNames(){const e=[];for(const t in this._spritesData)e.push(t);return e.sort(),e}getSpriteInfo(e){return this._spritesData?this._spritesData[e]:null}async load(e){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(e),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(e){this._isRetina=this.devicePixelRatio>1.15;const{width:t,height:r,data:s,json:i}=await this._getSpriteData(this._spriteSource,e),l=Object.keys(i);if(!l||0===l.length||!s)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=i,this.width=t,this.height=r;const n=Math.max(this._maxTextureSize,4096);if(t>n||r>n){const e=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${n} pixels}`;throw T.Z.getLogger("esri.layers.support.SpriteSource").error(e),new o.Z("SpriteSource",e)}let a;for(let e=0;e<s.length;e+=4)a=s[e+3]/255,s[e]=s[e]*a,s[e+1]=s[e+1]*a,s[e+2]=s[e+2]*a;this.image=s}async _getSpriteData(e,t){if("image"===e.type){let t,r;if(this.devicePixelRatio<1.15){if(!e.spriteSource1x)throw new o.Z("SpriteSource","no image data provided for low resolution sprites!");t=e.spriteSource1x.image,r=e.spriteSource1x.json}else{if(!e.spriteSource2x)throw new o.Z("SpriteSource","no image data provided for high resolution sprites!");t=e.spriteSource2x.image,r=e.spriteSource2x.json}return"width"in t&&"height"in t&&"data"in t&&((0,R.eP)(t.data)||(0,R.KZ)(t.data))?{width:t.width,height:t.height,data:new Uint8Array(t.data),json:r}:{...P(t),json:r}}const r=(0,h.mN)(this.baseURL),s=r.query?"?"+(0,h.B7)(r.query):"",l=this._isRetina?"@2x":"",n=`${r.path}${l}.${this._spriteImageFormat}${s}`,a=`${r.path}${l}.json${s}`,[u,c]=await Promise.all([(0,i.default)(a,t),(0,i.default)(n,{responseType:"image",...t})]);return{...P(c.data),json:u.data}}}function P(e){const t=document.createElement("canvas"),r=t.getContext("2d");t.width=e.width,t.height=e.height,r.drawImage(e,0,0,e.width,e.height);const s=r.getImageData(0,0,e.width,e.height);return{width:e.width,height:e.height,data:new Uint8Array(s.data)}}var U=r(11145),C=r(28589),L=r(55415);class F{constructor(e){this.url=e}destroy(){this._tileIndexPromise=null}async fetchTileIndex(){return this._tileIndexPromise||(this._tileIndexPromise=(0,i.default)(this.url).then((e=>e.data.index))),this._tileIndexPromise}async dataKey(e,t){const r=await this.fetchTileIndex();return(0,u.k_)(t),this._getIndexedDataKey(r,e)}_getIndexedDataKey(e,t){const r=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let s=t;for(;0!==s.level;)s=new L.Z(s.level-1,s.row>>1,s.col>>1,s.world),r.push(s);let i,l,o=e,n=r.pop();if(1===o)return n;for(;r.length;)if(i=r.pop(),l=(1&i.col)+((1&i.row)<<1),o){if(0===o[l]){n=null;break}if(1===o[l]){n=i;break}n=i,o=o[l]}return n}}var D=r(70586);class M{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=(0,D.SC)(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||(this._tileIndexPromise=(0,i.default)(this._tileIndexUrl,{query:{...e?.query}}).then((e=>e.data.index))),this._tileIndexPromise}dataKey(e,t){const{level:r,row:s,col:i}=e,l=new L.Z(e);return this._tilemap.fetchAvailabilityUpsample(r,s,i,l,t).then((()=>(l.world=e.world,l))).catch((e=>{if((0,u.D_)(e))throw e;return null}))}}var O=r(30175);class B{constructor(e){this._tileUrl=e,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(e){null===this._promise&&(this._abortController=new AbortController,this._promise=this._makeRequest(this._tileUrl,this._abortController.signal));const t=this._abortOptions;return t.push(e),(0,u.fu)(e,(()=>{t.every((e=>(0,u.Hc)(e)))&&this._abortController.abort()})),this._promise.then((e=>(0,n.d9)(e)))}async _makeRequest(e,t){const{data:r}=await(0,i.default)(e,{responseType:"array-buffer",signal:t});return r}}const N=new Map;function j(e,t){return(0,O.s1)(N,e,(()=>new B(e))).getData(t).then((t=>(N.delete(e),t))).catch((t=>{throw N.delete(e),t}))}class k{constructor(e,t,r){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.name=e,this.sourceUrl=t;const s=(0,h.mN)(this.sourceUrl),i=(0,n.d9)(r),l=i.tiles;if(s)for(let e=0;e<l.length;e++){const t=(0,h.mN)(l[e]);t&&((0,h.YP)(t.path)||(t.path=(0,h.v_)(s.path,t.path)),l[e]=(0,h.fl)(t.path,{...s.query,...t.query}))}this.tileServers=l;const o=r.capabilities&&r.capabilities.split(",").map((e=>e.toLowerCase().trim())),a=!0===r?.exportTilesAllowed,u=!0===o?.includes("tilemap"),c=a&&r.hasOwnProperty("maxExportTilesCount")?r.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:a,supportsTileMap:u},exportTiles:a?{maxExportTilesCount:+c}:null},this.tileInfo=U.Z.fromJSON(i.tileInfo);const p=r.tileMap?(0,h.fl)((0,h.v_)(s.path,r.tileMap),s.query??{}):null;u?(this.type="vector-tile",this.tilemap=new M(new C.y({layer:{parsedUrl:s,tileInfo:this.tileInfo},minLOD:i.minLOD??this.tileInfo.lods[0].level,maxLOD:i.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),p)):p&&(this.tilemap=new F(p)),this.fullExtent=m.Z.fromJSON(r.fullExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(e,t){return await(this.tilemap?.dataKey(e,t))??e}requestTile(e,t,r,s){return function(e,t,r,s,i){const l=(0,h.mN)(e),o=l.query;if(o)for(const[e,i]of Object.entries(o))switch(i){case"{x}":o[e]=s.toString();break;case"{y}":o[e]=r.toString();break;case"{z}":o[e]=t.toString()}const n=l.path;return j((0,h.fl)(n.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,s.toString()),{...l.query}),i)}(this.tileServers[t%this.tileServers.length],e,t,r,s)}isCompatibleWith(e){const t=this.tileInfo,r=e.tileInfo;if(!t.spatialReference.equals(r.spatialReference))return!1;if(!t.origin.equals(r.origin))return!1;if(Math.round(t.dpi)!==Math.round(r.dpi))return!1;const s=t.lods,i=r.lods,l=Math.min(s.length,i.length);for(let e=0;e<l;e++){const t=s[e],r=i[e];if(t.level!==r.level||Math.round(t.scale)!==Math.round(r.scale))return!1}return!0}}function W(...e){let t;for(const r of e)if(null!=r)if((0,h.oC)(r)){if(t){const e=t.split("://")[0];t=e+":"+r.trim()}}else t=(0,h.YP)(r)?r:(0,h.v_)(t,r);return t?(0,h.Qj)(t):void 0}async function G(e,t,r,s,l){let o,n,a;if((0,u.k_)(l),"string"==typeof r){const e=(0,h.Fv)(r);a=await(0,i.default)(e,{...l,responseType:"json",query:{f:"json",...l?.query}}),a.ssl&&(o&&(o=o.replace(/^http:/i,"https:")),n&&(n=n.replace(/^http:/i,"https:"))),o=e,n=e}else null!=r&&(a={data:r},o=r.jsonUrl||null,n=s);const c=a?.data;if(H(c))return e.styleUrl=o||null,async function(e,t,r,s){const i=r?(0,h.Yd)(r):(0,h.L)();e.styleBase=i,e.style=t,t["sprite-format"]&&"webp"===t["sprite-format"].toLowerCase()&&(e.spriteFormat="webp");const l=[];if(t.sources&&t.sources.esri){const r=t.sources.esri;r.url?await G(e,"esri",W(i,r.url),void 0,s):l.push(G(e,"esri",r,i,s))}for(const r of Object.keys(t.sources))"esri"!==r&&"vector"===t.sources[r].type&&(t.sources[r].url?l.push(G(e,r,W(i,t.sources[r].url),void 0,s)):t.sources[r].tiles&&l.push(G(e,r,t.sources[r],i,s)));await Promise.all(l)}(e,c,n,l);if(!H(c))return e.sourceUrl?Z(e,c,n,!1,t,l):(e.sourceUrl=o||null,Z(e,c,n,!0,t,l));throw new Error("You must specify the URL or the JSON for a service or for a style.")}function H(e){return!!e&&"sources"in e&&!!e.sources}async function Z(e,t,r,s,i,l){const o=r?(0,h.Qj)(r)+"/":(0,h.L)(),n=function(e){if(e.hasOwnProperty("tileInfo"))return e;const t={xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:{wkid:102100}};let r=78271.51696400007,s=295828763.7957775;const i=[],l=e.hasOwnProperty("minzoom")?+e.minzoom:0,o=e.hasOwnProperty("maxzoom")?+e.maxzoom:22;for(let e=0;e<=o;e++)e>=l&&i.push({level:e,scale:s,resolution:r}),r/=2,s/=2;return{capabilities:"TilesOnly",initialExtent:t,fullExtent:t,minScale:0,maxScale:0,tiles:e.tiles,tileInfo:{rows:512,cols:512,dpi:96,format:"pbf",origin:{x:-20037508.342787,y:20037508.342787},lods:i,spatialReference:{wkid:102100}}}}(t),a=new k(i,(0,h.fl)(o,l?.query??{}),n);if(!s&&e.primarySourceName in e.sourceNameToSource){const t=e.sourceNameToSource[e.primarySourceName];if(!t.isCompatibleWith(a))return;null!=a.fullExtent&&(null!=t.fullExtent?t.fullExtent.union(a.fullExtent):t.fullExtent=a.fullExtent.clone()),t.tileInfo&&a.tileInfo&&t.tileInfo.lods.length<a.tileInfo.lods.length&&(t.tileInfo=a.tileInfo)}if(s&&(e.sourceBase=o,e.source=t,e.validatedSource=n,e.primarySourceName=i),e.sourceNameToSource[i]=a,!e.style){if(null==t.defaultStyles)throw new Error;return"string"==typeof t.defaultStyles?G(e,"",W(o,t.defaultStyles,"root.json"),void 0,l):G(e,"",t.defaultStyles,W(o,"root.json"),l)}}var $=r(33516),q=r(19745),Y=r(25929),K=r(94139),V=r(39450);const Q=1e-6;function J(e,t){if(e===t)return!0;if(null==e&&null!=t)return!1;if(null!=e&&null==t)return!1;if(null==e||null==t)return!1;if(!e.spatialReference.equals(t.spatialReference)||e.dpi!==t.dpi)return!1;const r=e.origin,s=t.origin;if(Math.abs(r.x-s.x)>=Q||Math.abs(r.y-s.y)>=Q)return!1;let i,l;e.lods[0].scale>t.lods[0].scale?(i=e,l=t):(l=e,i=t);for(let e=i.lods[0].scale;e>=l.lods[l.lods.length-1].scale-Q;e/=2)if(Math.abs(e-l.lods[0].scale)<Q)return!0;return!1}function X(e,t){if(e===t)return e;if(null==e&&null!=t)return t;if(null!=e&&null==t)return e;if(null==e||null==t)return null;const r=e.size[0],s=e.format,i=e.dpi,l=new K.Z({x:e.origin.x,y:e.origin.y}),o=e.spatialReference,n=e.lods[0].scale>t.lods[0].scale?e.lods[0]:t.lods[0],a=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],u=n.scale,h=n.resolution,c=a.scale,p=[];let d=u,y=h,m=0;for(;d>c;)p.push(new V.Z({level:m,resolution:y,scale:d})),m++,d/=2,y/=2;return new U.Z({size:[r,r],dpi:i,format:s||"pbf",origin:l,lods:p,spatialReference:o})}var ee=r(51785),te=r(7575);let re,se;function ie(e){const t=(0,te.Sh)(e);for(;t.length>1;){const e=le(t.shift());if(e.available)return e}return le(t.shift())}function le(e){switch(e){case te.zO.WEBGL1:return re||(re=function(){const e=new ne,t=ue(te.zO.WEBGL1,e);return null==t||(e.supportsElementIndexUint=null!==t.getExtension("OES_element_index_uint"),e.supportsStandardDerivatives=null!==t.getExtension("OES_standard_derivatives"),e.supportsInstancedArrays=null!==t.getExtension("ANGLE_instanced_arrays"),e.supportsTextureFloat=null!==t.getExtension("OES_texture_float"),e.supportsTextureHalfFloat=null!==t.getExtension("OES_texture_half_float"),e.supportsColorBufferFloat=null!==t.getExtension("WEBGL_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==t.getExtension("EXT_float_blend"),e.supportsColorBufferHalfFloat=null!==t.getExtension("EXT_color_buffer_half_float")),e}()),re;case te.zO.WEBGL2:return se||(se=function(){const e=new ae,t=ue(te.zO.WEBGL2,e);return null==t||(e.supportsColorBufferFloat=null!==t.getExtension("EXT_color_buffer_float"),e.supportsColorBufferFloatBlend=null!==t.getExtension("EXT_float_blend"),e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||null!==t.getExtension("EXT_color_buffer_half_float")),e}()),se}}class oe{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureHalfFloat=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}}class ne extends oe{constructor(){super(...arguments),this.type=te.zO.WEBGL1}}class ae extends oe{constructor(){super(...arguments),this.type=te.zO.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0}}function ue(e,t){if(e===te.zO.WEBGL1&&"undefined"==typeof WebGLRenderingContext||e===te.zO.WEBGL2&&"undefined"==typeof WebGL2RenderingContext)return null;const r=document.createElement("canvas");if(!r)return null;let s=(0,te.kr)(r,e,{failIfMajorPerformanceCaveat:!0});if(null==s&&(s=(0,te.kr)(r,e),null!=s&&(t.majorPerformanceCaveat=!0)),null==s)return s;if(e===te.zO.WEBGL1){const e=s.getParameter(s.VERSION),r=e?.match(/^WebGL\s+([\d.]*)/);if(r){const e=parseFloat(r[1]);t.available=e>=.94}}else t.available=!0;t.maxTextureSize=s.getParameter(s.MAX_TEXTURE_SIZE),t.supportsVertexShaderSamplers=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const i=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);return i&&(t.supportsHighPrecisionFragment=i.precision>0),s}let he=class extends((0,S.h)((0,I.M)((0,w.Z)((0,v.Y)((0,b.q)((0,x.I)((0,A.N)((0,_.V)((0,a.R)(g.Z)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.style=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.tilemapCache=null,this.type="vector-tile",this.url=null,this.showCollisionBoxes="none",this.path=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(u.r9).then((async()=>{if(!this.portalItem||!this.portalItem.id)return;const t=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await(0,i.default)(t,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:t},(0,$.h)(this.portalItem))})).catch(u.r9).then((()=>this._loadStyle(e)));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e&&e.serviceUrl&&(0,h.mN)(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?(0,h.fl)(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get parsedUrl(){return this.serviceUrl?(0,h.mN)(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo&&this.currentStyleInfo.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo&&this.currentStyleInfo.styleUrl||null}writeStyleUrl(e,t){e&&(0,h.oC)(e)&&(e=`https:${e}`);const r=(0,q.a)(e);t.styleUrl=(0,Y.e)(e,r)}get tileInfo(){const e=[];for(const t in this.sourceNameToSource)e.push(this.sourceNameToSource[t]);let t=this.primarySource?.tileInfo||new U.Z;if(e.length>1)for(let r=0;r<e.length;r++)J(t,e[r].tileInfo)&&(t=X(t,e[r].tileInfo));return t}readTilemapCache(e,t){const r=t.capabilities?.includes("Tilemap");return r?new C.y({layer:this}):null}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){const r=ie("2d").maxTextureSize,s=this.currentStyleInfo?.spriteUrl?(0,h.fl)(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,i=new z({type:"url",spriteUrl:s,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await i.load(t),this._spriteSourceMap.set(e,i)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;const r=ie("2d").maxTextureSize,s=e.spriteUrl,i=s?(0,h.fl)(s,{...this.customParameters,token:this.apiKey}):null;if(!i&&"url"===e.type)return null;const l=new z(e,r);try{await l.load(t);const r=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,l),i&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=i),this.emit("spriteSource-change",{spriteSource:l}),l}catch(e){(0,u.r9)(e)}return null}async loadStyle(e,t){const r=e||this.style||this.url;return this._loadingTask&&"string"==typeof r&&this.url===r||(this._loadingTask?.abort(),this._loadingTask=(0,l.vr)((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return(0,n.d9)(this.styleRepository.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const s=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||s})}getStyleLayer(e){return(0,n.d9)(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return(0,n.d9)(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new o.Z("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await async function(e,t){const r={source:null,sourceBase:null,sourceUrl:null,validatedSource:null,style:null,styleBase:null,styleUrl:null,sourceNameToSource:{},primarySourceName:"",spriteFormat:"png"},[s,i]="string"==typeof e?[e,null]:[null,e.jsonUrl];return await G(r,"esri",e,i,t),{layerDefinition:r.validatedSource,url:s,serviceUrl:r.sourceUrl,style:r.style,styleUrl:r.styleUrl,spriteUrl:r.style.sprite&&W(r.styleBase,r.style.sprite),spriteFormat:r.spriteFormat,glyphsUrl:r.style.glyphs&&W(r.styleBase,r.style.glyphs),sourceNameToSource:r.sourceNameToSource,primarySourceName:r.primarySourceName}}(e,{...t,query:{...this.customParameters,token:this.apiKey}});"webp"===r.spriteFormat&&(await function(e){if(E)return E;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return E=new Promise((e=>{const r=new Image;r.onload=()=>{r.onload=r.onerror=null,e(r.width>0&&r.height>0)},r.onerror=()=>{r.onload=r.onerror=null,e(!1)},r.src="data:image/webp;base64,"+t.lossy})),E}()||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new ee.Z(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!t)return;const s=t[2]&&t[2].toLowerCase();if(!s)return;const i=t[1]||"";for(const e of r)if(e.toLowerCase().includes(s))return(0,h.Fv)(`//static.arcgis.com/attribution/Vector${i}/${e}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"attributionDataUrl",null),(0,s._)([(0,c.Cb)({type:["show","hide"]})],he.prototype,"listMode",void 0),(0,s._)([(0,c.Cb)({json:{read:!0,write:!0}})],he.prototype,"blendMode",void 0),(0,s._)([(0,c.Cb)({readOnly:!0,json:{read:!1}})],he.prototype,"capabilities",null),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"currentStyleInfo",void 0),(0,s._)([(0,c.Cb)({json:{read:!1},readOnly:!0,type:m.Z})],he.prototype,"fullExtent",null),(0,s._)([(0,c.Cb)()],he.prototype,"style",void 0),(0,s._)([(0,c.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],he.prototype,"isReference",void 0),(0,s._)([(0,c.Cb)({type:["VectorTileLayer"]})],he.prototype,"operationalLayerType",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"parsedUrl",null),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"serviceUrl",null),(0,s._)([(0,c.Cb)({type:f.Z,readOnly:!0})],he.prototype,"spatialReference",null),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"styleRepository",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"sourceNameToSource",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"primarySource",void 0),(0,s._)([(0,c.Cb)({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],he.prototype,"styleUrl",null),(0,s._)([(0,y.c)(["portal-item","web-document"],"styleUrl")],he.prototype,"writeStyleUrl",null),(0,s._)([(0,c.Cb)({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:U.Z})],he.prototype,"tileInfo",null),(0,s._)([(0,c.Cb)()],he.prototype,"tilemapCache",void 0),(0,s._)([(0,p.r)("service","tilemapCache",["capabilities","tileInfo"])],he.prototype,"readTilemapCache",null),(0,s._)([(0,c.Cb)({json:{read:!1},readOnly:!0,value:"vector-tile"})],he.prototype,"type",void 0),(0,s._)([(0,c.Cb)({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],he.prototype,"url",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],he.prototype,"version",void 0),(0,s._)([(0,p.r)("version",["version","currentVersion"])],he.prototype,"readVersion",null),(0,s._)([(0,c.Cb)({type:String})],he.prototype,"showCollisionBoxes",void 0),(0,s._)([(0,c.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],he.prototype,"path",void 0),he=(0,s._)([(0,d.j)("esri.layers.VectorTileLayer")],he);const ce=he},54295:(e,t,r)=>{r.d(t,{V:()=>o});var s=r(43697),i=r(5600),l=(r(75215),r(67676),r(80442),r(52011));const o=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,s._)([(0,i.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,s._)([(0,l.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,r)=>{r.d(t,{Y:()=>a});var s=r(43697),i=r(92604),l=r(5600),o=(r(75215),r(67676),r(80442),r(52011)),n=r(66677);const a=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,n.Qc)(this.url);if(null!=e&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,n.Nm)(e,i.Z.getLogger(this)))}};return(0,s._)([(0,l.Cb)()],t.prototype,"title",null),(0,s._)([(0,l.Cb)({type:String})],t.prototype,"url",null),t=(0,s._)([(0,o.j)("esri.layers.mixins.ArcGISService")],t),t}},17017:(e,t,r)=>{r.d(t,{N:()=>o});var s=r(43697),i=r(5600),l=(r(75215),r(67676),r(80442),r(52011));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,s._)([(0,i.Cb)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,s._)([(0,l.j)("esri.layers.mixins.CustomParametersMixin")],t),t}},16859:(e,t,r)=>{r.d(t,{I:()=>A});var s=r(43697),i=r(68773),l=r(40330),o=r(3172),n=r(66643),a=r(20102),u=r(92604),h=r(70586),c=r(95330),p=r(81271),d=r(5600),y=(r(75215),r(67676),r(80442),r(71715)),m=r(52011),f=r(30556),g=r(84230),_=r(48522),w=r(15235),v=r(86082),S=r(14661);const A=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,h.SC)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new w.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const{load:s}=await r.e(8062).then(r.bind(r,18062));return(0,c.k_)(t),await s({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,c.D_)(e)||u.Z.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,c.r9)(e),!0))))}async _setUserPrivileges(e,t){if(!i.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:s},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,c.r9)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const s=e===r.id;if(s&&r.portal.user)return(0,S.Ss)(r);let i,o;if(s)i=r.portal.url;else try{i=await(0,g.oP)(this.url,t)}catch(e){(0,c.r9)(e)}if(!i||!(0,p.Zo)(i,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(l.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.r9)(e)}if(!o)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(s?await r.reload():(r=new w.default({id:e,portal:{url:i}}),await r.load(t)),r.portal.user)return(0,S.Ss)(r)}catch(e){(0,c.r9)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.r9)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?l.id?.findCredential(this.url):null;if(!t)return!0;const r=b.credential===t?b.user:await this._fetchEditingUser(e);return b.credential=t,b.user=r,null==r||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=l.id.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const s=`${r.owningSystemUrl}/sharing/rest`,i=_.Z.getDefault();if(i&&i.loaded&&(0,p.Fv)(i.restUrl)===(0,p.Fv)(s))return i.user;const a=`${s}/community/self`,u=null!=e?e.signal:null,h=await(0,n.q6)((0,o.default)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return h.ok?v.default.fromJSON(h.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||_.Z.getDefault());return r&&s&&!(0,p.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.Z("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,s._)([(0,d.Cb)({type:w.default})],t.prototype,"portalItem",null),(0,s._)([(0,y.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,f.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,s._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,s._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,s._)([(0,m.j)("esri.layers.mixins.PortalLayer")],t),t},b={credential:null,user:null}},33516:(e,t,r)=>{r.d(t,{Y:()=>o,h:()=>l});var s=r(81271),i=r(48522);function l(e){return{origin:"portal-item",url:(0,s.mN)(e.itemUrl),portal:e.portal||i.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function o(e){return{origin:"portal-item",messages:[],writtenProperties:[],url:e.itemUrl?(0,s.mN)(e.itemUrl):null,portal:e.portal||i.Z.getDefault(),portalItem:e}}},55415:(e,t,r)=>{r.d(t,{Z:()=>i});var s=r(71143);class i{static getId(e,t,r,s){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${r}/${s}`}constructor(e,t,r,s){this.set(e,t,r,s)}get key(){return this}get id(){return this.toString()}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,r=63&this.level;return(3&this.world)<<30|t<<22|e<<8|r}acquire(e,t,r,s){this.set(e,t,r,s)}contains(e){const t=e.level-this.level;return t>=0&&this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new i(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,r,s){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,r,s,i]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(r),this.col=parseFloat(s),this.world=parseFloat(i)}else this.level=+e,this.row=+t,this.col=+r,this.world=+s||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new i(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const e=this.level+1,t=this.row<<1,r=this.col<<1,s=this.world;return[new i(e,t,r,s),new i(e,t,r+1,s),new i(e,t+1,r,s),new i(e,t+1,r+1,s)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}i.pool=new s.Z(i,null,null,25,50)},7575:(e,t,r)=>{r.d(t,{Sh:()=>o,kr:()=>l,zO:()=>s});var s,i=r(80442);function l(e,t,r={}){const i=t===s.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];for(const t of i){const s=e.getContext(t,r);if(s)return s}return null}function o(e){if("3d"===e)return[s.WEBGL2];const t=(0,i.Z)("esri-force-webgl");return t===s.WEBGL1||t===s.WEBGL2?[t]:(0,i.Z)("mac")&&(0,i.Z)("chrome")?[s.WEBGL1,s.WEBGL2]:[s.WEBGL2,s.WEBGL1]}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(s||(s={}))}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5261],{88764:(e,t,s)=>{s.d(t,{q:()=>l});var i,r,n,a=s(5732),o={exports:{}};i=o,r=function(){function e(s,i,r,n,a){for(;n>r;){if(n-r>600){var o=n-r+1,l=i-r+1,u=Math.log(o),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(o-c)/o)*(l-o/2<0?-1:1);e(s,i,Math.max(r,Math.floor(i-l*c/o+h)),Math.min(n,Math.floor(i+(o-l)*c/o+h)),a)}var d=s[i],f=r,p=n;for(t(s,r,i),a(s[n],d)>0&&t(s,r,n);f<p;){for(t(s,f,p),f++,p--;a(s[f],d)<0;)f++;for(;a(s[p],d)>0;)p--}0===a(s[r],d)?t(s,r,p):t(s,++p,n),p<=i&&(r=p+1),i<=p&&(n=p-1)}}function t(e,t,s){var i=e[t];e[t]=e[s],e[s]=i}function s(e,t){return e<t?-1:e>t?1:0}return function(t,i,r,n,a){e(t,i,r||0,n||t.length-1,a||s)}},void 0!==(n=r())&&(i.exports=n);const l=(0,a.g)(o.exports)},37455:(e,t,s)=>{s.d(t,{N:()=>i});const i={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,s){const i=new r(e.getPointX(t),e.getPointY(t),s),n=e.hasZ(t),a=e.hasM(t);return n&&(i.z=e.getPointZ(t)),a&&(i.m=e.getPointM(t)),i},exportPolygon:function(e,t,s){return new n(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,s){return new a(e.exportPaths(t),s,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,s){return new o(e.exportPoints(t),s,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,s){const i=e.hasZ(t),r=e.hasM(t),n=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),s);if(i){const s=e.getZExtent(t);n.zmin=s.vmin,n.zmax=s.vmax}if(r){const s=e.getMExtent(t);n.mmin=s.vmin,n.mmax=s.vmax}return n}};class r{constructor(e,t,s){this.x=e,this.y=t,this.spatialReference=s,this.z=void 0,this.m=void 0}}class n{constructor(e,t,s,i){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class a{constructor(e,t,s,i){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class o{constructor(e,t,s,i){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,s&&(this.hasZ=s),i&&(this.hasM=i)}}class l{constructor(e,t,s,i,r){this.xmin=e,this.ymin=t,this.xmax=s,this.ymax=i,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},29730:(e,t,s)=>{function i(e,t){return e?t?4:3:t?3:2}function r(e,t,s,r,o){if(null==t||!t.lengths.length)return null;const l="upperLeft"===o?.originPosition?-1:1;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const u=e.coords,c=[],h=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:d,coords:f}=t,p=i(s,r);let m=0;for(const e of d){const t=n(h,f,m,e,s,r,l);t&&c.push(t),m+=e*p}if(c.sort(((e,t)=>{let i=l*e[2]-l*t[2];return 0===i&&s&&(i=e[4]-t[4]),i})),c.length){let e=6*c[0][2];u[0]=c[0][0]/e,u[1]=c[0][1]/e,s&&(e=6*c[0][4],u[2]=0!==e?c[0][3]/e:0),(u[0]<h[0]||u[0]>h[1]||u[1]<h[2]||u[1]>h[3]||s&&(u[2]<h[4]||u[2]>h[5]))&&(u.length=0)}if(!u.length){const e=t.lengths[0]?a(f,0,d[0],s,r):null;if(!e)return null;u[0]=e[0],u[1]=e[1],s&&e.length>2&&(u[2]=e[2])}return e}function n(e,t,s,r,n,a,o=1){const l=i(n,a);let u=s,c=s+l,h=0,d=0,f=0,p=0,m=0;for(let s=0,i=r-1;s<i;s++,u+=l,c+=l){const s=t[u],i=t[u+1],r=t[u+2],a=t[c],o=t[c+1],l=t[c+2];let g=s*o-a*i;p+=g,h+=(s+a)*g,d+=(i+o)*g,n&&(g=s*l-a*r,f+=(r+l)*g,m+=g),s<e[0]&&(e[0]=s),s>e[1]&&(e[1]=s),i<e[2]&&(e[2]=i),i>e[3]&&(e[3]=i),n&&(r<e[4]&&(e[4]=r),r>e[5]&&(e[5]=r))}if(p*o>0&&(p*=-1),m*o>0&&(m*=-1),!p)return null;const g=[h,d,.5*p];return n&&(g[3]=f,g[4]=.5*m),g}function a(e,t,s,r,n){const a=i(r,n);let h=t,d=t+a,f=0,p=0,m=0,g=0;for(let t=0,i=s-1;t<i;t++,h+=a,d+=a){const t=e[h],s=e[h+1],i=e[h+2],n=e[d],a=e[d+1],_=e[d+2],y=r?l(t,s,i,n,a,_):o(t,s,n,a);if(y)if(f+=y,r){const e=c(t,s,i,n,a,_);p+=y*e[0],m+=y*e[1],g+=y*e[2]}else{const e=u(t,s,n,a);p+=y*e[0],m+=y*e[1]}}return f>0?r?[p/f,m/f,g/f]:[p/f,m/f]:s>0?r?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function o(e,t,s,i){const r=s-e,n=i-t;return Math.sqrt(r*r+n*n)}function l(e,t,s,i,r,n){const a=i-e,o=r-t,l=n-s;return Math.sqrt(a*a+o*o+l*l)}function u(e,t,s,i){return[e+.5*(s-e),t+.5*(i-t)]}function c(e,t,s,i,r,n){return[e+.5*(i-e),t+.5*(r-t),s+.5*(n-s)]}s.d(t,{Y:()=>r})},66202:(e,t,s)=>{s.d(t,{q:()=>De});var i=s(67676),r=s(20102),n=s(22974),a=s(70586),o=s(69801),l=s(95330),u=s(67900),c=s(60437),h=s(24470),d=s(20322),f=s(33955),p=s(16306),m=s(8744),g=s(98732),_=s(35454),y=s(13867),I=s(41534);const S=new class{constructor(e,t){this._cache=new y.z(e),this._invalidCache=new y.z(t)}get(e,t){const s=`${t.uid}:${e}`,i=this._cache.get(s);if(i)return i;if(void 0!==this._invalidCache.get(s))return null;try{const i=I.WhereClause.create(e,t);return this._cache.put(s,i),i}catch{return this._invalidCache.put(s,null),null}}}(50,500),x="feature-store:unsupported-query",E=" as ",R=new _.X({esriFieldTypeString:"string"}),T=new _.X({esriFieldTypeOID:"oid",esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long"}),F=new _.X({esriFieldTypeDate:"date"}),w=new _.X({esriFieldTypeGUID:"guid",esriFieldTypeGlobalId:"global-id"}),b=new Set([...T.jsonValues,...F.jsonValues,...R.jsonValues,...w.jsonValues]),A=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...T.apiValues,...F.apiValues,...R.apiValues,...w.apiValues]);function v(e,t,s={}){const i=C(e,t);if(!i)throw new r.Z(x,"invalid SQL expression",{expression:e});const n=s.expressionName||"expression";if(s.validateStandardized&&!i.isStandardized)throw new r.Z(x,`${n} is not standard`,{expression:e});if(s.validateAggregate&&!i.isAggregate)throw new r.Z(x,`${n} does not contain a valid aggregate function`,{expression:e});return i.fieldNames}function N(e,t,s,i){if(!t)return!0;const n="having",a=v(t,e,{validateAggregate:!0,expressionName:n});P(e,a,{expressionName:n,query:i}),O(e,a,{expressionName:n,query:i});const o=S.get(t,e),l=o?.getExpressions().every((t=>{const{aggregateType:i,field:r}=t,n=e.get(r)?.name;return s.some((t=>{const{onStatisticField:s,statisticType:r}=t,a=e.get(s)?.name;return a===n&&r.toLowerCase().trim()===i}))}));if(!l)throw new r.Z(x,"expressions in having should also exist in outStatistics",{having:t});return!0}function C(e,t){return e?S.get(e,t):null}function P(e,t,s={}){s.errorMessage||(s.errorMessage=s.expressionName?`${s.expressionName} contains invalid fields`:"Fields are invalid"),M(e,t,((e,t)=>t.has(e)),s)}function O(e,t,s={}){s.errorMessage||(s.errorMessage=s.expressionName?`${s.expressionName} only supports ${A} field types`:`Only ${A} field types are supported`),M(e,t,((e,t)=>!G(e,t)),s)}function M(e,t,s,i={}){const n=i.verifyExpression??!0,a=[];for(const r of t){const t=s(r,e);if("*"!==r&&!t)if(n){const t=k(r);try{M(e,v(t,e,{validateStandardized:!0}),s,i)}catch(e){const t=e?.details;if(t?.expression)throw e;t?.invalidFields?a.push(...t.invalidFields):a.push(r)}}else a.push(r)}if(a.length)throw new r.Z(x,i.errorMessage,{invalidFields:a,query:i.query})}function k(e){return e.split(E)[0]}function G(e,t,s=b){const i=t.get(e);return!!i&&!s.has(i.type)}var V=s(37427),D=s(61159),L=s(35308),Q=s(49600),U=s(82397),q=s(11490),z=s(24452),Z=s(59266);class j{constructor(e,t,s){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=s,this.featureAdapter=t;const i=e.outFields;if(i&&!i.includes("*")){this.outFields=i;let e=0;for(const t of i){const i=k(t),r=this.fieldsIndex.get(i),n=r?null:C(i,s),a=r?r.name:t.split(E)[1]||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:n})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach((e=>this.getAttributes(e))),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,s){const i=s?s.name:t;let r=null;return this._fieldDataCache.has(i)?r=this._fieldDataCache.get(i)?.clause:s||(r=C(t,this.fieldsIndex),this._fieldDataCache.set(i,{alias:i,clause:r})),s?this.featureAdapter.getAttribute(e,i):r?.calculateValue(e,this.featureAdapter)}getDataValues(e,t){const s=t.normalizationType,i=t.normalizationTotal;return e.map((e=>{let r=t.field&&this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2&&(r=`${(0,z.wk)(r)}${t.fieldDelimiter}${(0,z.wk)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(r=`${r}${t.fieldDelimiter}${(0,z.wk)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)),s&&Number.isFinite(r)){const n="field"===s&&t.normalizationField?this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;r=(0,z.fk)(r,s,n,i)}return r}))}async getExpressionValues(e,t,s,i){const{arcadeUtils:r}=await(0,Z.LC)(),n=r.hasGeometryOperations(t);n&&await r.enableGeometryOperations();const a=r.createFunction(t),o=s&&r.getViewInfo(s),l={fields:this.fieldsIndex.fields};return e.map((e=>{const t={attributes:this.featureAdapter.getAttributes(e),layer:l,geometry:n?{...(0,q.Op)(i.geometryType,i.hasZ,i.hasM,this.featureAdapter.getGeometry(e)),spatialReference:s?.spatialReference}:null},u=r.createExecContext(t,o);return r.executeFunction(a,u)}))}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:C(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:C(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t||!t.length)return this.featureAdapter.getAttributes(e);const s={};for(const i of t){const{alias:t,clause:r}=this._fieldDataCache.get(i);s[t]=r?r.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return s}_processAttributesForDistinctValues(e){if(null==e||!this.returnDistinctValues)return e;const t=this.outFields,s=[];if(t)for(const i of t){const{alias:t}=this._fieldDataCache.get(i);s.push(e[t])}else for(const t in e)s.push(e[t]);const i=`${(t||["*"]).join(",")}=${s.join(",")}`;let r=this._returnDistinctMap.get(i)||0;return this._returnDistinctMap.set(i,++r),r>1?null:e}}function B(e,t,s){return{objectId:e,target:t,distance:s,type:"vertex"}}function Y(e,t,s,i,r,n=!1){return{objectId:e,target:t,distance:s,type:"edge",start:i,end:r,draped:n}}var H=s(35671);class W{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new j(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,r=t?.length;if(!r)return 1;const n=new Map,a=new Map,o=new Set;for(const r of i){const{statisticType:i}=r,l="exceedslimit"!==i?r.onStatisticField:void 0;if(!a.has(l)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,n);s.push(t)}a.set(l,this._calculateUniqueValues(s,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:i,items:r}=u[t],n=i.join(",");s&&!e.validateItems(r,s)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(e=this.query.outStatistics?this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;(0,m.JY)(this.query.outSR)&&!(0,m.fS)(t.spatialReference,this.query.outSR)?e.queryGeometry=(0,q.S2)({spatialReference:this.query.outSR,...(0,V.iV)(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=(0,q.S2)({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=$(this.hasZ,this.hasM),{point:r,mode:n}=e,a="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c=this._getPointCreator(n,this.spatialReference,t),h=new J(null,0),d=new J(null,0),f={x:0,y:0,z:0};for(const t of this.items){const n=s.getGeometry(t);if(null==n)continue;const{coords:p,lengths:m}=n;if(h.coords=p,d.coords=p,e.returnEdge){let e=0;for(let n=0;n<m.length;n++){const u=m[n];for(let n=0;n<u;n++,e+=i){const p=h;if(p.coordsIndex=e,n!==u-1){const n=d;n.coordsIndex=e+i;const u=f;X(f,r,p,n);const h=(r.x-u.x)/a,m=(r.y-u.y)/o,g=h*h+m*m;g<=1&&l.candidates.push(Y(s.getObjectId(t),c(u),Math.sqrt(g),c(p),c(n)))}}}}if(e.returnVertex){const e=u?p.length-i:p.length;for(let n=0;n<e;n+=i){const e=h;e.coordsIndex=n;const i=(r.x-e.x)/a,u=(r.y-e.y)/o,d=i*i+u*u;d<=1&&l.candidates.push(B(s.getObjectId(t),c(e),Math.sqrt(d)))}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,s){const i=null==s||(0,m.fS)(t,s)?e=>e:e=>(0,V.iV)(e,t,s),{hasZ:r}=this;return"3d"===e?r?({x:e,y:t,z:s})=>i({x:e,y:t,z:s}):({x:e,y:t})=>i({x:e,y:t,z:0}):({x:e,y:t})=>i({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,minValue:a,maxValue:o,scale:l}=e,u=this.fieldsIndex.isDateField(t),c=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:l}),h=(0,z.S5)({normalizationType:r,normalizationField:i,minValue:a,maxValue:o}),d=this.fieldsIndex.get(t),f={value:.5,fieldType:d?.type},p=(0,H.qN)(d)?(0,z.H0)({values:c,supportsNullCount:h,percentileParams:f}):(0,z.i5)({values:c,minValue:a,maxValue:o,useSampleStdDev:!r,supportsNullCount:h,percentileParams:f});return(0,z.F_)(p,u)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:r,scale:n}=e,a=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:n}),o=(0,z.eT)(a);return(0,z.Qm)(o,i,r,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:h}=e,d=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:h}),f=(0,z.G2)(d,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return(0,z.DL)(f,a)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:h}=e,d=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:r,normalizationTotal:n,scale:h});return(0,z.oF)(d,{field:t,normalizationField:i,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,s){if(e.length>1&&t&&t.length)for(const i of t.reverse()){const t=i.split(" "),r=t[0],n=this.fieldsIndex.get(r),a=!!t[1]&&"desc"===t[1].toLowerCase(),o=(0,z.Lq)(n?.type,a);e.sort(((e,t)=>{const i=s(e,r,n),a=s(t,r,n);return o(i,a)}))}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:r,objectIdField:n,spatialReference:a}=this,{outFields:o,outSR:l,quantizationParameters:u,resultRecordCount:c,resultOffset:h,returnZ:d,returnM:f}=e,p=null!=c&&t.length>(h||0)+c,m=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:p,features:this._createFeatures(e,t),fields:m,geometryType:s,hasM:i&&f,hasZ:r&&d,objectIdFieldName:n,spatialReference:(0,q.S2)(l||a),transform:u&&(0,U.vY)(u)||null}}_createFeatures(e,t){const s=new j(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:r}=this,{orderByFields:n,quantizationParameters:a,returnGeometry:o,returnCentroid:l,maxAllowableOffset:u,resultOffset:c,resultRecordCount:h,returnZ:d=!1,returnM:f=!1}=e,p=r&&d,m=i&&f;let g=[],_=0;const y=[...t];if(this._sortFeatures(y,n,((e,t,i)=>s.getFieldValue(e,t,i))),o||l){const e=(0,U.vY)(a)??void 0;if(o&&!l)for(const t of y)g[_++]={attributes:s.getAttributes(t),geometry:(0,q.Op)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),u,e,p,m)};else if(!o&&l)for(const t of y)g[_++]={attributes:s.getAttributes(t),centroid:(0,q.EG)(this,this.featureAdapter.getCentroid(t,this),e)};else for(const t of y)g[_++]={attributes:s.getAttributes(t),centroid:(0,q.EG)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,q.Op)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),u,e,p,m)}}else for(const e of y){const t=s.getAttributes(e);t&&(g[_++]={attributes:t})}const I=c||0;if(null!=h){const e=I+h;g=g.slice(I,Math.min(g.length,e))}return g}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;for(const t of e.outStatistics??[])if("exceedslimit"===t.statisticType){s=null!=t.maxPointCount?t.maxPointCount:Number.POSITIVE_INFINITY,i=null!=t.maxRecordCount?t.maxRecordCount:Number.POSITIVE_INFINITY,r=null!=t.maxVertexCount?t.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)t=this.items.length>s;else if(this.items.length>i)t=!0;else{const e=$(this.hasZ,this.hasM),s=this.featureAdapter;t=this.items.reduce(((e,t)=>{const i=s.getGeometry(t);return e+(null!=i&&i.coords.length||0)}),0)/e>r}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,r=new Map,n=new Map,a=new Map,o=new j(e,this.featureAdapter,this.fieldsIndex),l=e.outStatistics,{groupByFieldsForStatistics:u,having:c,orderByFields:h}=e,d=u&&u.length,f=!!d,p=f?u[0]:null,m=f&&!this.fieldsIndex.get(p);for(const e of l??[]){const{outStatisticFieldName:l,statisticType:h}=e,g=e,_="exceedslimit"!==h?e.onStatisticField:void 0,y="percentile_disc"===h||"percentile_cont"===h,I="EnvelopeAggregate"===h||"CentroidAggregate"===h||"ConvexHullAggregate"===h,S=f&&1===d&&(_===p||m)&&"count"===h;if(f){if(!n.has(_)){const e=[];for(const t of u){const s=this._getAttributeValues(o,t,i);e.push(s)}n.set(_,this._calculateUniqueValues(e,!I&&o.returnDistinctValues))}const e=n.get(_);for(const t in e){const{count:s,data:r,items:n,itemPositions:h}=e[t],d=r.join(",");if(!c||o.validateItems(n,c)){const e=a.get(d)||{attributes:{}};if(I){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:s}=await this._getAggregateGeometry(g,n);e.aggregateGeometries[s]=t}else{let t=null;if(S)t=s;else{const e=this._getAttributeValues(o,_,i),s=h.map((t=>e[t]));t=y&&"statisticParameters"in g?this._getPercentileValue(g,s):this._getStatisticValue(g,s,null,o.returnDistinctValues)}e.attributes[l]=t}let t=0;u.forEach(((s,i)=>e.attributes[this.fieldsIndex.get(s)?s:"EXPR_"+ ++t]=r[i])),a.set(d,e)}}}else if(I){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(g,this.items);t.aggregateGeometries[s]=e}else{const e=this._getAttributeValues(o,_,i);t.attributes[l]=y&&"statisticParameters"in g?this._getPercentileValue(g,e):this._getStatisticValue(g,e,r,o.returnDistinctValues)}s.push({name:l,alias:l,type:"esriFieldTypeDouble"})}const g=f?Array.from(a.values()):[t];return this._sortFeatures(g,h,((e,t)=>e.attributes[t])),{fields:s,features:g}}async _getAggregateGeometry(e,t){const{convexHull:i,union:r}=await Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247)),{statisticType:n,outStatisticFieldName:a}=e,{featureAdapter:o,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,d=t.map((e=>(0,q.Op)(u,c,h,o.getGeometry(e)))),f=i(l,d,!0)[0],p={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===n){const e=f?(0,Q._w)(f):(0,Q.aO)(r(l,d));p.aggregateGeometries={...e,spatialReference:l},p.outStatisticFieldName=a||"extent"}else if("CentroidAggregate"===n){const e=f?(0,L.tO)(f):(0,L.$G)((0,Q.aO)(r(l,d)));p.aggregateGeometries={x:e[0],y:e[1],spatialReference:l},p.outStatisticFieldName=a||"centroid"}else"ConvexHullAggregate"===n&&(p.aggregateGeometries=f,p.outStatisticFieldName=a||"convexHull");return p}_getStatisticValue(e,t,s,i){const{onStatisticField:r,statisticType:n}=e;let a=null;return a=s?.has(r)?s.get(r):(0,H.qN)(this.fieldsIndex.get(r))?(0,z.H0)({values:t,returnDistinct:i}):(0,z.i5)({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(r,a),a["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:r}=e,{value:n,orderBy:a}=i,o=this.fieldsIndex.get(s);return(0,z.XL)(t,{value:n,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===r})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),r=this.items.map((s=>e.getFieldValue(s,t,i)));return s.set(t,r),r}_calculateUniqueValues(e,t){const s={},i=this.items,r=i.length;for(let n=0;n<r;n++){const r=i[n],a=[];for(const t of e)a.push(t[n]);const o=a.join(",");null==s[o]?s[o]={count:1,data:a,items:[r],itemPositions:[n]}:(t||s[o].count++,s[o].items.push(r),s[o].itemPositions.push(n))}return s}async _getDataValues(e){const t=new j(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:s,scale:i}=e,r=s?{viewingMode:"map",scale:i,spatialReference:this.query.outSR||this.spatialReference}:null;return s?t.getExpressionValues(this.items,s,r,{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM}):t.getDataValues(this.items,{field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal})}}function X(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,a=r*r+n*n,o=(t.x-s.x)*r+(t.y-s.y)*n,l=Math.min(1,Math.max(0,o/a));e.x=s.x+r*l,e.y=s.y+n*l}function $(e,t){return e?t?4:3:t?3:2}class J{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}var K=s(10402),ee=s(17590),te=s(99514),se=s(61247),ie=(s(80442),s(92604)),re=s(54790),ne=s(44553),ae=s(17445),oe=s(58971),le=s(10661);class ue{constructor(e,t){this._observable=new le.s,this._value=e,this._equalityFunction=t}get value(){return(0,oe.it)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function ce(e,t=n.y7){return new ue(e,t)}var he=s(76882);class de{constructor(){this._tasks=new Array,this._running=ce(!1)}get length(){return this._tasks.length}get running(){return this._running.value}destroy(){this.cancelAll()}runTask(e){for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,s){return this._running.value=!0,new Promise(((i,r)=>this._tasks.push(new fe(i,r,e,t,s))))}unshift(e,t,s){return this._running.value=!0,new Promise(((i,r)=>this._tasks.unshift(new fe(i,r,e,t,s))))}_process(e){if(0===this._tasks.length)return!1;const t=this._tasks.shift();try{const s=(0,l.Hc)(t.signal);if(s&&!t.abortCallback)t.reject((0,l.zE)());else{const i=s?t.abortCallback?.((0,l.zE)()):t.callback(e);(0,l.y8)(i)?i.then(t.resolve,t.reject):t.resolve(i)}}catch(e){t.reject(e)}return this._running.value=this._tasks.length>0,!0}cancelAll(){const e=(0,l.zE)();for(const t of this._tasks)if(t.abortCallback){const s=t.abortCallback(e);t.resolve(s)}else t.reject(e);this._tasks.length=0,this._running.value=!1}}class fe{constructor(e,t,s,i=void 0,r=void 0){this.resolve=e,this.reject=t,this.callback=s,this.signal=i,this.abortCallback=r}}var pe=s(43697),me=s(92036),ge=s(5600),_e=(s(75215),s(52011));let ye=class extends me.Z{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,pe._)([(0,ge.Cb)()],ye.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,pe._)([(0,ge.Cb)()],ye.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),ye=(0,pe._)([(0,_e.j)("esri.views.support.DebugFlags")],ye);const Ie=new ye;var Se,xe,Ee,Re;!function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(Se||(Se={})),(Re=xe||(xe={}))[Re.YIELD=1]="YIELD",function(e){e.RESOURCE_CONTROLLER_IMMEDIATE="immediate",e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.LOD_RENDERER="LoD renderer",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="clouds generator",e[e.NONE=0]="NONE",e[e.TEST_PRIO=1]="TEST_PRIO"}(Ee||(Ee={}));const Te=new Map([[Ee.RESOURCE_CONTROLLER_IMMEDIATE,0],[Ee.RESOURCE_CONTROLLER,4],[Ee.SLIDE,0],[Ee.STREAM_DATA_LOADER,0],[Ee.ELEVATION_QUERY,0],[Ee.TERRAIN_SURFACE,1],[Ee.SURFACE_GEOMETRY_UPDATES,1],[Ee.LOD_RENDERER,2],[Ee.GRAPHICS_CORE,2],[Ee.I3S_CONTROLLER,2],[Ee.POINT_CLOUD_LAYER,2],[Ee.FEATURE_TILE_FETCHER,2],[Ee.OVERLAY,4],[Ee.STAGE,4],[Ee.GRAPHICS_DECONFLICTOR,4],[Ee.FILTER_VISIBILITY,4],[Ee.SCALE_VISIBILITY,4],[Ee.FRUSTUM_VISIBILITY,4],[Ee.CLOUDS_GENERATOR,4],[Ee.POINT_OF_INTEREST_FREQUENT,6],[Ee.POINT_OF_INTEREST_INFREQUENT,30],[Ee.LABELER,8],[Ee.FEATURE_QUERY_ENGINE,8],[Ee.FEATURE_TILE_TREE,16],[Ee.FEATURE_TILE_TREE_ACTIVE,0],[Ee.ELEVATION_ALIGNMENT,12],[Ee.TEXT_TEXTURE_ATLAS,12],[Ee.TEXTURE_UNLOAD,12],[Ee.LINE_OF_SIGHT_TOOL,16],[Ee.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[Ee.SNAPPING,0],[Ee.SHADOW_ACCUMULATOR,30]]);function Fe(e){return Te.has(e)?Te.get(e):"number"==typeof e?e:1}const we=(0,he.HA)(6.5),be=(0,he.HA)(1),Ae=(0,he.HA)(30),ve=(0,he.HA)(1e3/30),Ne=(0,he.HA)(100);var Ce,Pe;!function(e){e.Scheduler=class{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some((e=>e.needsUpdate))}constructor(){this._updating=ce(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new re.Z("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new s,this._state=Se.INTERACTING,this._tasks=new ne.Z,this._runQueue=new ne.Z,this._load=0,this._idleStateCallbacks=new ne.Z,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=(0,ae.YP)((()=>Ie.SCHEDULER_LOG_SLOW_TASKS),(e=>this._debug=e),ae.nn);for(const e of Object.keys(Ee))this.performanceInfo.tasks.set(Ee[e],new re.Z(Ee[e]));const e=this;this._test={FRAME_SAFETY_BUDGET:we,INTERACTING_BUDGET:ve,IDLE_BUDGET:Ne,get availableBudget(){return e._budget.budget},usedBudget:0,getBudget:()=>e._budget,setBudget:t=>e._budget=t,updateTask:e=>this._updateTask(e),getState:e=>this._getState(e),getRuntime:e=>this._getRuntime(e),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach((e=>e.remove())),this._tasks.clear(),(0,a.hw)(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask((()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())})))}registerTask(e,s){const i=Fe(e),r=new t(this,e,s,i);return this._tasks.push(r),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new re.Z(e)),r}registerIdleStateCallbacks(e,t){const s={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(s),this.state===Se.IDLE&&this._idleUpdatesStartFired&&s.idleBegin();const i=this;return{remove:()=>this._removeIdleStateCallbacks(s),set idleBegin(e){i._idleUpdatesStartFired&&(s.idleEnd(),i._state===Se.IDLE&&e()),s.idleBegin=e},set idleEnd(e){s.idleEnd=e}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==Se.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((e=>e.idleEnd()))))}get state(){return this._state}updateBudget(e){this._test.usedBudget=0,++this._frameNumber;let t=we,s=e.frameDuration,i=be;switch(this.state){case Se.IDLE:t=(0,he.HA)(0),s=(0,he.HA)(Math.max(Ne,e.frameDuration)),i=Ae;break;case Se.INTERACTING:s=(0,he.HA)(Math.max(ve,e.frameDuration));case Se.ANIMATING:}return s=(0,he.HA)(s-e.elapsedFrameTime-t),this.state!==Se.IDLE&&s<be&&!this._forceTask?(this._forceTask=!0,!1):(s=(0,he.HA)(Math.max(s,i)),this._budget.reset(s,this.state),this._updateLoad(),this._schedule())}frame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case Se.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((e=>e.idleBegin()))),this._runIdle();break;case Se.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset((0,he.HA)(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll((t=>{t.name===e&&t.setPriority(e)}))}_getState(e){if(this._runQueue.some((t=>t.name===e)))return Pe.SCHEDULED;let t=Pe.IDLE;return this._tasks.forAll((s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t=Pe.READY:t!==Pe.READY&&(t=Pe.WAITING))})),t}_getRuntime(e){let t=0;return this._tasks.forAll((s=>{s.name===e&&(t+=s.runtime)})),t}_resetRuntimes(){this._tasks.forAll((e=>e.runtime=0))}_getRunning(){const e=new Map;if(this._tasks.forAll((t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)})),0===e.size)return null;let t="";return e.forEach(((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`})),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce(((e,t)=>t.needsUpdate?++e:e),0);this._load=.9*this._load+e*(1-.9)}_schedule(){for(this._runQueue.filterInPlace((e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1))),this._tasks.forAll((e=>{0===e.basePriority&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)}));0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll((s=>{s.needsUpdate&&0!==s.schedulePriority&&0!==s.basePriority&&s.blockFrame!==this._frameNumber&&(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority?(s.schedulePriority=0,this._runQueue.push(s)):--s.schedulePriority)})),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do{for(;this._runQueue.length>0;){const t=this._budget.now(),s=this._runQueue.pop();this._budget.resetProgress();try{s.task.runTask(this._budget)===xe.YIELD&&(s.blockFrame=this._frameNumber)}catch(e){ie.Z.getLogger("esri.views.support.Scheduler").error(`Exception in task "${s.name}"`,e)}!this._budget.hasProgressed&&s.blockFrame!==this._frameNumber&&s.needsUpdate&&(s.name,Ee.I3S_CONTROLLER,s.blockFrame=this._frameNumber),s.schedulePriority=s.basePriority;const i=this._budget.now()-t;if(s.runtime+=i,this._frameTaskTimes.set(s.priority,this._frameTaskTimes.get(s.priority)+i),this._debug&&i>2*this._budget.budget&&console.log("Task",s.name,"used",i,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-e)}}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(Ee))this._frameTaskTimes.set(Ee[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach(((e,t)=>this.performanceInfo.tasks.get(t).record(e))),this.performanceInfo.total.record(e)}get test(){return this._test}};class t{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,t,s,i){this._scheduler=e,this.name=t,this._basePriority=i,this.blockFrame=0,this.runtime=0,this._queue=new de,this._handles=new se.Z,this.schedulePriority=this._basePriority,this._task=ce(null!=s?s:this._queue),this._handles.add((0,ae.gx)((()=>this.task.running),(t=>e.taskRunningChanged(t))))}remove(){this.processQueue(Oe),this._scheduler.removeTask(this),this.schedule=Me.schedule,this.reschedule=Me.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){this.name=e;const t=Fe(e);0!==this._basePriority&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}processQueue(e){this._queue.runTask(e)}}class s{constructor(){this._begin="undefined"!=typeof performance?performance.now():0,this._budget=0,this._state=Se.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,t){this._begin=this.now(),this._budget=e,this._state=t,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}e.Budget=s}(Ce||(Ce={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(Pe||(Pe={}));const Oe=(()=>{const e=new Ce.Budget;return e.enabled=!1,e})(),Me=new class{remove(){}processQueue(){}schedule(e,t,s){try{if((0,l.Hc)(t)){const e=(0,l.zE)();return s?Promise.resolve(s(e)):Promise.reject(e)}return(0,l.gx)(e(Oe))}catch(e){return Promise.reject(e)}}reschedule(e,t,s){return this.schedule(e,t,s)}},ke="feature-store:unsupported-query",Ge=new o.WJ(2e6);let Ve=0;class De{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:D.g},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",(()=>this.clearCache())),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new o.Xq(Ve+++"$$",Ge)),this.fieldsIndex=new te.Z(e.fields),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=(0,a.hw)(this._frameTask),this.clearCache(),(0,a.SC)(this._geometryQueryCache),this._changeHandle=(0,a.hw)(this._changeHandle),(0,a.SC)(this.fieldsIndex)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._geometryQueryCache?.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null}async executeQuery(e,t){try{return(await this._executeQuery(e,{},t)).createQueryResponse()}catch(t){if(t!==q.vF)throw t;return new W([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},t)).createQueryResponseForCount()}catch(e){if(e!==q.vF)throw e;return 0}}async executeQueryForExtent(e,t){const s=e.outSR;try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),r=i.size;return r?{count:r,extent:await this._getBounds(i.items,i.spatialReference,s||this.spatialReference)}:{count:0,extent:null}}catch(e){if(e===q.vF)return{count:0,extent:null};throw e}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e,t){try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),i=s.items,r=new Set;return await this._reschedule((()=>{for(const e of i)r.add(s.featureAdapter.getObjectId(e))}),t),r}catch(e){if(e===q.vF)return new Set;throw e}}async executeQueryForSnapping(e,t){const{point:s,distance:i,returnEdge:r,returnVertex:n}=e;if(!r&&!n)return{candidates:[]};const a=await this._reschedule((()=>this._checkQuerySupport(e.query)),t),o=!(0,m.fS)(s.spatialReference,this.spatialReference);o&&await(0,V._W)(s.spatialReference,this.spatialReference);const l="number"==typeof i?i:i.x,u="number"==typeof i?i:i.y,c={xmin:s.x-l,xmax:s.x+l,ymin:s.y-u,ymax:s.y+u,spatialReference:s.spatialReference},h=o?(0,V.iV)(c,this.spatialReference):c;if(!h)return{candidates:[]};const d=(await(0,p.aX)((0,f.im)(s),null,{signal:t}))[0],g=(await(0,p.aX)((0,f.im)(h),null,{signal:t}))[0];if(null==d||null==g)return{candidates:[]};const _=new W(await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(g.toJSON()))),t),a,this);await this._reschedule((()=>this._executeObjectIdsQuery(_)),t),await this._reschedule((()=>this._executeTimeQuery(_)),t),await this._reschedule((()=>this._executeAttributesQuery(_)),t);const y=d.toJSON(),I=o?(0,V.iV)(y,this.spatialReference):y,S=o?Math.max(h.xmax-h.xmin,h.ymax-h.ymin)/2:i;return _.createSnappingResponse({...e,point:I,distance:S},s.spatialReference)}async executeQueryForLatestObservations(e,t){if(!this.timeInfo||!this.timeInfo.trackIdField)throw new r.Z(ke,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const s=await this._executeQuery(e,{},t);return await this._reschedule((()=>this._filterLatest(s)),t),s.createQueryResponse()}catch(t){if(t!==q.vF)throw t;return new W([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const{field:i,field2:r,field3:n,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:i,field2:r,field3:n,valueExpression:a},s)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const[t,s]=await Promise.all(["getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getBounds(await this._getAllFeatures(),this.spatialReference,this.spatialReference),null!=this._timeExtentPromise?this._timeExtentPromise:this._timeExtentPromise=(0,ee.R)(this.timeInfo,this.featureStore)]);return(0,l.k_)(e),{fullExtent:t,timeExtent:s}}async _getBounds(e,t,s){const i=(0,c.t8)((0,c.Ue)(),c.Gv);await this.featureStore.forEachBounds(e,(e=>(0,c.TC)(i,e)));const r={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:(0,q.S2)(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(r.zmin=i[2],r.zmax=i[5]);const n=(0,V.iV)(r,t,s);if(n.spatialReference=(0,q.S2)(s),n.xmax-n.xmin==0){const e=(0,u.c9)(n.spatialReference);n.xmin-=e,n.xmax+=e}if(n.ymax-n.ymin==0){const e=(0,u.c9)(n.spatialReference);n.ymin-=e,n.ymax+=e}if(this.hasZ&&null!=n.zmin&&null!=n.zmax&&n.zmax-n.zmin==0){const e=(0,u.c9)(n.spatialReference);n.zmin-=e,n.zmax+=e}return n}async _schedule(e,t){return null!=this._frameTask?this._frameTask.schedule(e,t):e(Oe)}async _reschedule(e,t){return null!=this._frameTask?this._frameTask.reschedule(e,t):e(Oe)}async _getAllFeaturesQueryEngineResult(e){return new W(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach((t=>e.push(t)))})().then((()=>e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=(0,n.d9)(e),e=await this._schedule((()=>(0,q.Up)(e,this.definitionExpression,this.spatialReference)),s),e=await this._reschedule((()=>this._checkQuerySupport(e)),s),e={...e,...t};const i=await this._reschedule((()=>this._executeSceneFilterQuery(e,s)),s),r=await this._reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this._reschedule((()=>this._executeAggregateIdsQuery(r)),s),await this._reschedule((()=>this._executeObjectIdsQuery(r)),s),await this._reschedule((()=>this._executeTimeQuery(r)),s),await this._reschedule((()=>this._executeAttributesQuery(r)),s),r}async _executeSceneFilterQuery(e,t){if(null==e.sceneFilter)return null;const{outSR:s,returnGeometry:i,returnCentroid:r}=e,n=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,o=null==n||(0,m.fS)(n,a.spatialReference)?a:(0,V.iV)(a,n);if(!o)return null;const l=i||r,u=(0,m.JY)(s)&&!(0,m.fS)(this.spatialReference,s)&&l?async e=>this._project(e,s):e=>e,c=this.featureAdapter,h=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(o))),t);if("disjoint"===e.sceneFilter.spatialRelationship){if(!h.length)return null;const s=new Set;for(const e of h)s.add(c.getObjectId(e));const i=await this._reschedule((()=>this._getAllFeatures()),t),r=await this._reschedule((async()=>{const r=await(0,K.cW)("esriSpatialRelDisjoint",o,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(i,(e=>!s.has(c.getObjectId(e))||r(c.getGeometry(e))),t);return new W(n,e,this)}),t);return u(r)}if(!h.length)return new W([],e,this);if(this._canExecuteSinglePass(o,e))return u(new W(h,e,this));const d=await(0,K.cW)("esriSpatialRelContains",o,this.geometryType,this.hasZ,this.hasM),f=await this._runSpatialFilter(h,(e=>d(c.getGeometry(e))),t);return u(new W(f,e,this))}async _executeGeometryQuery(e,t,s){if(null!=t&&0===t.items.length)return t;e=null!=t?t.query:e;const{geometry:r,outSR:n,spatialRel:a,returnGeometry:o,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!r||null==u||(0,m.fS)(u,r.spatialReference)?r:(0,V.iV)(r,u),h=o||l,d=(0,m.JY)(n)&&!(0,m.fS)(this.spatialReference,n),f=this._geometryQueryCache&&null==t?d&&h?JSON.stringify({originalFilterGeometry:r,spatialRelationship:a,outSpatialReference:n}):JSON.stringify({originalFilterGeometry:r,spatialRelationship:a}):null,p=f?this._geometryQueryCache.get(f):null;if(null!=p)return new W(p,e,this);const g=async e=>(d&&h&&await this._project(e,n),f&&this._geometryQueryCache.put(f,e.items,e.items.length+1),e);if(!c)return g(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const _=this.featureAdapter;let y=await this._reschedule((()=>this._searchFeatures(this._getQueryBBoxes(r))),s);if("esriSpatialRelDisjoint"===a){if(!y.length)return g(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const i=new Set;for(const e of y)i.add(_.getObjectId(e));const r=null!=t?t.items:await this._reschedule((()=>this._getAllFeatures()),s),n=await this._reschedule((async()=>{const t=await(0,K.cW)(a,c,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(r,(e=>!i.has(_.getObjectId(e))||t(_.getGeometry(e))),s);return new W(n,e,this)}),s);return g(n)}if(null!=t){const e=new i.SO;y=y.filter((s=>(0,i.cq)(t.items,s,t.items.length,e)>=0))}if(!y.length){const t=new W([],e,this);return f&&this._geometryQueryCache.put(f,t.items,1),t}if(this._canExecuteSinglePass(c,e))return g(new W(y,e,this));const I=await(0,K.cW)(a,c,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(y,(e=>I(_.getGeometry(e))),s);return g(new W(S,e,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds||!e.query.aggregateIds.length||null==this.aggregateAdapter)return;const t=new Set;for(const s of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(s).forEach((e=>t.add(e)));const s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}_executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds||!e.query.objectIds.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(s(e))))}_executeTimeQuery(e){if(0===e.items.length)return;const t=(0,ee.y)(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(0===e.items.length)return;const t=C(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter((e=>t.testFeature(e,this.featureAdapter)))}}async _runSpatialFilter(e,t,s){if(!t)return e;if(null==this._frameTask)return e.filter((e=>t(e)));let i=0;const r=new Array,n=async a=>{for(;i<e.length;){const o=e[i++];t(o)&&(r.push(o),a.madeProgress()),a.done&&await this._reschedule((e=>n(e)),s)}};return this._reschedule((e=>n(e)),s).then((()=>r))}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,r=i||s,n=new Map,a=this.featureAdapter.getAttribute;for(const s of e.items){const e=a(s,t),i=a(s,r),o=n.get(e);(!o||i>a(o,r))&&n.set(e,s)}e.items=Array.from(n.values())}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return(0,K.hN)(e)&&("esriSpatialRelEnvelopeIntersects"===s||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===s||"esriSpatialRelContains"===s||"esriSpatialRelWithin"===s))}async _project(e,t){if(!t||(0,m.fS)(this.spatialReference,t))return e;const s=this.featureAdapter,i=await(0,V.oj)(e.items.map((e=>(0,q.Op)(this.geometryType,this.hasZ,this.hasM,s.getGeometry(e)))),this.spatialReference,t);return e.items=i.map(((t,i)=>s.cloneWithGeometry(e.items[i],(0,g.GH)(t,this.hasZ,this.hasM)))),e}_getQueryBBoxes(e){if((0,K.hN)(e)){if((0,f.YX)(e))return[(0,h.al)(e.xmin,e.ymin,e.xmax,e.ymax)];if((0,f.oU)(e))return e.rings.map((e=>(0,h.al)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[(0,d.$P)((0,h.Ue)(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map((e=>this.featureStore.forEachInBounds(e,(e=>t.add(e))))));const s=Array.from(t.values());return t.clear(),s}async _checkStatisticsSupport(e,t){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new r.Z(ke,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),Promise.all([this._checkStatisticsParamsSupport(t,e),(0,K.P0)(e,this.geometryType,this.spatialReference),(0,V._W)(this.spatialReference,e.outSR)]).then((()=>e))}async _checkStatisticsParamsSupport(e,t){let s=[];if(e.valueExpression){const{arcadeUtils:t}=await(0,Z.LC)();s=t.extractFieldNames(e.valueExpression)}if(e.field&&s.push(e.field),e.field2&&s.push(e.field2),e.field3&&s.push(e.field3),e.normalizationField&&s.push(e.normalizationField),!s.length&&!e.valueExpression)throw new r.Z(ke,"field or valueExpression is required",{params:e});P(this.fieldsIndex,s,{errorMessage:"Cannot calculate statistics for missing fields",query:t}),O(this.fieldsIndex,s,{expressionName:"statistics",query:t})}async _checkQuerySupport(e){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new r.Z(ke,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),this._checkStatisticsQuerySupport(e),Promise.all([(0,K.P0)(e,this.geometryType,this.spatialReference),(0,V._W)(this.spatialReference,e.outSR)]).then((()=>e))}_checkAttributesQuerySupport(e){const{outFields:t,orderByFields:s,returnDistinctValues:i,outStatistics:n}=e,a=n?n.map((e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase())).filter(Boolean):[];if(s&&s.length>0){const t=" asc",i=" desc",r=s.map((e=>{const s=e.toLowerCase();return s.includes(t)?s.split(t)[0]:s.includes(i)?s.split(i)[0]:e})).filter((e=>!a.includes(e)));P(this.fieldsIndex,r,{expressionName:"orderByFields",query:e})}if(t&&t.length>0)P(this.fieldsIndex,t,{expressionName:"outFields",query:e});else if(i)throw new r.Z(ke,"outFields should be specified for returnDistinctValues",{query:e});!function(e,t,s){if(!t)return!0;const i="where clause",r=v(t,e,{validateStandardized:!0,expressionName:i});P(e,r,{expressionName:i,query:s}),O(e,r,{expressionName:i,query:s})}(this.fieldsIndex,e.where,e)}_checkStatisticsQuerySupport(e){const{outStatistics:t,groupByFieldsForStatistics:s,having:i}=e,n=s&&s.length,a=t&&t.length;if(i){if(!n||!a)throw new r.Z(ke,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:e});N(this.fieldsIndex,i,t,e)}if(a){if(!function(e){return null!=e&&e.every((e=>"exceedslimit"!==e.statisticType))}(t))return;const i=t.map((e=>e.onStatisticField)).filter(Boolean);P(this.fieldsIndex,i,{expressionName:"onStatisticFields",query:e}),n&&P(this.fieldsIndex,s,{expressionName:"groupByFieldsForStatistics",query:e});const a=new Set([...T.jsonValues,...F.jsonValues]),o=new Intl.ListFormat("en-US",{type:"conjunction"}).format([...T.apiValues,...F.apiValues]);for(const s of t){const{onStatisticField:t,statisticType:i}=s;if("percentile_disc"!==i&&"percentile_cont"!==i||!("statisticParameters"in s)){if("count"!==i&&t&&G(t,this.fieldsIndex,a))throw new r.Z(ke,`outStatistics only supports ${o} field types`,{definition:s,query:e})}else{const{statisticParameters:t}=s;if(!t)throw new r.Z(ke,"statisticParamters should be set for percentile type",{definition:s,query:e})}}}}async _getQueryEngineResultForStats(e,t,s){e=(0,n.d9)(e);try{e=await this._schedule((()=>(0,q.Up)(e,this.definitionExpression,this.spatialReference)),s),e=await this._reschedule((()=>this._checkStatisticsSupport(e,t)),s);const i=await this._reschedule((()=>this._executeSceneFilterQuery(e,s)),s),r=await this._reschedule((()=>this._executeGeometryQuery(e,i,s)),s);return await this._reschedule((()=>this._executeAggregateIdsQuery(r)),s),await this._reschedule((()=>this._executeObjectIdsQuery(r)),s),await this._reschedule((()=>this._executeTimeQuery(r)),s),await this._reschedule((()=>this._executeAttributesQuery(r)),s),r}catch(t){if(t!==q.vF)throw t;return new W([],e,this)}}}},61159:(e,t,s)=>{s.d(t,{g:()=>i});const i={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},37427:(e,t,s)=>{s.d(t,{_W:()=>d,iV:()=>m,oj:()=>_});var i=s(67676),r=s(44547),n=s(37455),a=s(8744),o=s(40488);const l=[0,0];function u(e,t){if(!t)return null;if("x"in t){const s={x:0,y:0};return[s.x,s.y]=e(t.x,t.y,l),null!=t.z&&(s.z=t.z),null!=t.m&&(s.m=t.m),s}if("xmin"in t){const s={xmin:0,ymin:0,xmax:0,ymax:0};return[s.xmin,s.ymin]=e(t.xmin,t.ymin,l),[s.xmax,s.ymax]=e(t.xmax,t.ymax,l),t.hasZ&&(s.zmin=t.zmin,s.zmax=t.zmax,s.hasZ=!0),t.hasM&&(s.mmin=t.mmin,s.mmax=t.mmax,s.hasM=!0),s}return"rings"in t?{rings:c(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:c(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:h(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function c(e,t){const s=[];for(const i of e)s.push(h(i,t));return s}function h(e,t){const s=[];for(const i of e){const e=t(i[0],i[1],[0,0]);s.push(e),i.length>2&&e.push(i[2]),i.length>3&&e.push(i[3])}return s}async function d(e,t){if(!e||!t)return;const s=Array.isArray(e)?e.map((e=>null!=e.geometry?e.geometry.spatialReference:null)).filter(i.pC):[e];await(0,r.iQ)(s.map((e=>({source:e,dest:t}))))}const f=u.bind(null,o.hG),p=u.bind(null,o.R6);function m(e,t,s,i){if(!e)return e;if(s||(s=t,t=e.spatialReference),!(0,a.JY)(t)||!(0,a.JY)(s)||(0,a.fS)(t,s))return e;if((0,o.Q8)(t,s)){const t=(0,a.sS)(s)?f(e):p(e);return t.spatialReference=s,t}return(0,r.oj)(n.N,[e],t,s,null,i)[0]}const g=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,s){if(!e||!e.length||!t||!s||(0,a.fS)(t,s))return e;const i={geometries:e,inSpatialReference:t,outSpatialReference:s,resolve:null};return this._jobs.push(i),new Promise((e=>{i.resolve=e,null===this._timer&&(this._timer=setTimeout(this._process,10))}))}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:s,outSpatialReference:i,resolve:l}=e;(0,o.Q8)(s,i)?(0,a.sS)(i)?l(t.map(f)):l(t.map(p)):l((0,r.oj)(n.N,t,s,i,null,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function _(e,t,s){return g.push(e,t,s)}},10402:(e,t,s)=>{s.d(t,{hN:()=>x,P0:()=>S,cW:()=>I});var i=s(20102),r=s(54102),n=s(87416),a=s(33955),o=s(8744);function l(e,t){return e?t?4:3:t?3:2}function u(e,t,s,i,r,n){const a=l(r,n),{coords:o,lengths:u}=i;if(!u)return!1;for(let i=0,r=0;i<u.length;i++,r+=a)if(!c(e,t,s,o[r],o[r+1]))return!1;return!0}function c(e,t,s,i,r){if(!e)return!1;const n=l(t,s),{coords:a,lengths:o}=e;let u=!1,c=0;for(const e of o)u=h(u,a,n,c,e,i,r),c+=e*n;return u}function h(e,t,s,i,r,n,a){let o=e,l=i;for(let e=i,u=i+r*s;e<u;e+=s){l=e+s,l===u&&(l=i);const r=t[e],c=t[e+1],h=t[l],d=t[l+1];(c<a&&d>=a||d<a&&c>=a)&&r+(a-c)/(d-c)*(h-r)<n&&(o=!o)}return o}var d=s(98732),f=s(5428),p=s(37427),m=s(11490);const g="feature-store:unsupported-query",_={esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"intersects",esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:null},y={spatialRelationship:{esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},queryGeometry:{esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},layerGeometry:{esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1}};function I(e,t,i,o,l){if((0,a.oU)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,d.Uy)(new f.Z,t,!1,!1);return Promise.resolve((t=>function(e,t,s,i){return c(e,!1,!1,i.coords[0],i.coords[1])}(e,0,0,t)))}if((0,a.oU)(t)&&"esriGeometryMultipoint"===i){const s=(0,d.Uy)(new f.Z,t,!1,!1);if("esriSpatialRelContains"===e)return Promise.resolve((e=>u(s,!1,!1,e,o,l)))}if((0,a.YX)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return Promise.resolve((e=>(0,r.aV)(t,(0,m.Op)(i,o,l,e))));if((0,a.YX)(t)&&"esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return Promise.resolve((e=>(0,r.lQ)(t,(0,m.Op)(i,o,l,e))));if((0,a.YX)(t)&&"esriSpatialRelIntersects"===e){const e="mesh"===(h=i)?n.h_:(0,n.IY)(h);return Promise.resolve((s=>e(t,(0,m.Op)(i,o,l,s))))}var h;return Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247)).then((s=>{const r=s[_[e]].bind(null,t.spatialReference,t);return e=>r((0,m.Op)(i,o,l,e))}))}async function S(e,t,s){const{spatialRel:r,geometry:n}=e;if(n){if(!function(e){return null!=e&&!0===y.spatialRelationship[e]}(r))throw new i.Z(g,"Unsupported query spatial relationship",{query:e});if((0,o.JY)(n.spatialReference)&&(0,o.JY)(s)){if(!function(e){return null!=e&&!0===y.queryGeometry[(0,a.Ji)(e)]}(n))throw new i.Z(g,"Unsupported query geometry type",{query:e});if(!function(e){return null!=e&&!0===y.layerGeometry[e]}(t))throw new i.Z(g,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,p._W)(e.geometry&&e.geometry.spatialReference,e.outSR)}}}function x(e){if((0,a.YX)(e))return!0;if((0,a.oU)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},17590:(e,t,s)=>{async function i(e,t){if(!e)return null;const s=t.featureAdapter,{startTimeField:i,endTimeField:r}=e;let n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;if(i&&r)await t.forEach((e=>{const t=s.getAttribute(e,i),o=s.getAttribute(e,r);null==t||isNaN(t)||(n=Math.min(n,t)),null==o||isNaN(o)||(a=Math.max(a,o))}));else{const e=i||r;await t.forEach((t=>{const i=s.getAttribute(t,e);null==i||isNaN(i)||(n=Math.min(n,i),a=Math.max(a,i))}))}return{start:n,end:a}}function r(e,t,s){if(!t||!e)return null;const{startTimeField:i,endTimeField:r}=e;if(!i&&!r)return null;const{start:n,end:a}=t;return null===n&&null===a?null:void 0===n&&void 0===a?()=>!1:i&&r?function(e,t,s,i,r){return null!=i&&null!=r?n=>{const a=e.getAttribute(n,t),o=e.getAttribute(n,s);return(null==a||a<=r)&&(null==o||o>=i)}:null!=i?t=>{const r=e.getAttribute(t,s);return null==r||r>=i}:null!=r?s=>{const i=e.getAttribute(s,t);return null==i||i<=r}:void 0}(s,i,r,n,a):function(e,t,s,i){return null!=s&&null!=i&&s===i?i=>e.getAttribute(i,t)===s:null!=s&&null!=i?r=>{const n=e.getAttribute(r,t);return n>=s&&n<=i}:null!=s?i=>e.getAttribute(i,t)>=s:null!=i?s=>e.getAttribute(s,t)<=i:void 0}(s,i||r,n,a)}s.d(t,{R:()=>i,y:()=>r})},11490:(e,t,s)=>{s.d(t,{EG:()=>I,Op:()=>S,S2:()=>T,Up:()=>x,j6:()=>E,vF:()=>p});var i=s(35454),r=s(67900),n=s(44547),a=s(49600),o=s(33955),l=s(16306),u=s(8744),c=s(98732),h=s(5428),d=s(37427);const f=new i.X({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),p=Object.freeze({}),m=new h.Z,g=new h.Z,_=new h.Z,y={esriGeometryPoint:c.fQ,esriGeometryPolyline:c.J6,esriGeometryPolygon:c.eG,esriGeometryMultipoint:c.Iv};function I(e,t,s,i=e.hasZ,r=e.hasM){if(null==t)return null;const n=e.hasZ&&i,a=e.hasM&&r;if(s){const o=(0,c.Nh)(_,t,e.hasZ,e.hasM,"esriGeometryPoint",s,i,r);return(0,c.fQ)(o,n,a)}return(0,c.fQ)(t,n,a)}function S(e,t,s,i,r,n,a=t,o=s){const l=t&&a,u=s&&o,h=null!=i?"coords"in i?i:i.geometry:null;if(null==h)return null;if(r){let i=(0,c.zj)(g,h,t,s,e,r,a,o);return n&&(i=(0,c.Nh)(_,i,l,u,e,n)),y[e]?.(i,l,u)??null}if(n){const i=(0,c.Nh)(_,h,t,s,e,n,a,o);return y[e]?.(i,l,u)??null}return(0,c.hY)(m,h,t,s,a,o),y[e]?.(m,l,u)??null}async function x(e,t,s){const{outFields:i,orderByFields:r,groupByFieldsForStatistics:n,outStatistics:a}=e;if(i)for(let e=0;e<i.length;e++)i[e]=i[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),E(e,t,s)}async function E(e,t,i){if(!e)return null;let{where:n}=e;if(e.where=n=n&&n.trim(),(!n||/^1 *= *1$/.test(n)||t&&t===n)&&(e.where=null),!e.geometry)return e;let c=await async function(e){const{distance:t,units:i}=e,n=e.geometry;if(null==t||"vertexAttributes"in n)return n;const a=n.spatialReference,o=i?f.fromJSON(i):(0,r.qE)(a),l=a&&((0,u.sT)(a)||(0,u.sS)(a))?n:await(0,d._W)(a,u.Zn).then((()=>(0,d.iV)(n,u.Zn)));return(await async function(){return(await Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247))).geodesicBuffer}())(l.spatialReference,l,t,o)}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;c=(0,a.aO)(c),c.spatialReference=t}if(c){await(0,d._W)(c.spatialReference,i),c=function(e,t){const s=e.spatialReference;return R(e,t)&&(0,o.YX)(e)?{spatialReference:s,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(c,i);const t=(await(0,l.aX)((0,o.im)(c)))[0];if(null==t)throw p;const s="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,r=s&&R(c,i)?{densificationStep:8*s}:void 0,n=t.toJSON(),a=await(0,d.iV)(n,n.spatialReference,i,r);if(!a)throw p;a.spatialReference=i,e.geometry=a}return e}function R(e,t){if(!e)return!1;const s=e.spatialReference;return((0,o.YX)(e)||(0,o.oU)(e)||(0,o.l9)(e))&&!(0,u.fS)(s,t)&&!(0,n.Up)(s,t)}function T(e){return e&&F in e?JSON.parse(JSON.stringify(e,w)):e}const F="_geVersion",w=(e,t)=>e!==F?t:void 0}}]);