@arcgis/core 4.22.0-next.20211206 → 4.22.2
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.
- package/PopupTemplate.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0146455a237a1d237525.js +1 -0
- package/assets/esri/core/workers/chunks/{44ccee36f8c74f4f134e.js → 025df54bafc05c183182.js} +1 -1
- package/assets/esri/core/workers/chunks/0677ed519c51710d7629.js +1 -0
- package/assets/esri/core/workers/chunks/{6a1ce00bcb689ea95bcb.js → 26111da2277612ba0e38.js} +1 -1
- package/assets/esri/core/workers/chunks/28f9b48b59bf1347facd.js +1 -0
- package/assets/esri/core/workers/chunks/360bb187a91c8cadcb8b.js +1 -0
- package/assets/esri/core/workers/chunks/{96a62dc1e07f3ef20a30.js → 3981c2e5b88c93d63793.js} +1 -1
- package/assets/esri/core/workers/chunks/{44145763617ea985cce4.js → 3ccb827134eb2ad54ff2.js} +1 -1
- package/assets/esri/core/workers/chunks/{4417dfcb2ba50ac9f199.js → 487713de9462be6b5202.js} +1 -1
- package/assets/esri/core/workers/chunks/53c05fb7fed21c815ee9.js +1 -0
- package/assets/esri/core/workers/chunks/{6e736a6717e09bf6c1fc.js → 5f87aea9f42c40c51b6f.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7f77fe32bb2d69b5714.js → 606b99f366517ca9d577.js} +1 -1
- package/assets/esri/core/workers/chunks/{f3da8b797c8e1fcb1c21.js → 63161320a58a0b1702a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{8bc4ea821be16a752226.js → 88fd591d45e8b4542f82.js} +1 -1
- package/assets/esri/core/workers/chunks/8cdaa07b09d5c2b1ccc5.js +1 -0
- package/assets/esri/core/workers/chunks/{fd874267d81bc0b2be50.js → a4c58e301ded79fe827d.js} +1 -1
- package/assets/esri/core/workers/chunks/{23af0b02208e20d5c07e.js → ab067b1b6a2af26decc5.js} +1 -1
- package/assets/esri/core/workers/chunks/{6210b23872c362f51b12.js → ac9f18daa7236446c9c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc0b85bc1e5116836ba4.js → b6e150686198dec02a27.js} +1 -1
- package/assets/esri/core/workers/chunks/d06d4b76625afc309a55.js +1 -0
- package/assets/esri/core/workers/chunks/{5f2718cd77cbd5ba7920.js → da62f8159ec2fdbdeb58.js} +1 -1
- package/assets/esri/core/workers/chunks/{52aa3b44bddb10caa343.js → e07f78db820375e105c0.js} +1 -1
- package/assets/esri/core/workers/chunks/f1b3f84ddf34a13c9d8e.js +1 -0
- package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ar.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bg.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_bs.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ca.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_da.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_de.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_es.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_et.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fi.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_he.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_hu.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_id.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_it.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ja.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ko.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lt.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nb.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_nl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-BR.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_pt-PT.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ro.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_ru.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sk.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sl.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_sv.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_th.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_tr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_uk.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_vi.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-CN.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-HK.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_zh-TW.json +1 -1
- package/assets/esri/widgets/support/t9n/timezone_bg.json +1 -1
- package/chunks/Clouds.glsl.js +4 -4
- package/config.js +1 -1
- package/interfaces.d.ts +138 -41
- package/layers/CSVLayer.js +1 -1
- package/layers/GeoJSONLayer.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/package.json +1 -1
- package/renderers/VectorFieldRenderer.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/smartMapping/raster/renderers/classBreaks.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/MapViewConstraints.js +1 -1
- package/views/2d/constraints/ZoomConstraint.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
- package/views/2d/engine/webgl/collisions/CollisionGrid.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicMeshTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicTextTemplate.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/3d/environment/Clouds.glsl.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/NoiseTextureAtlas.js +1 -1
- package/views/MapView.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/widgets/Histogram.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/assets/esri/core/workers/chunks/22d1bead2fe51ab81bea.js +0 -1
- package/assets/esri/core/workers/chunks/49bb222ee07a768e998d.js +0 -1
- package/assets/esri/core/workers/chunks/650f04de72c173beaebc.js +0 -1
- package/assets/esri/core/workers/chunks/aa57f2c380132c746730.js +0 -1
- package/assets/esri/core/workers/chunks/af6251cc7973b43a1523.js +0 -1
- package/assets/esri/core/workers/chunks/deba37055be7c2d7da26.js +0 -1
- package/assets/esri/core/workers/chunks/e02a3d456525e76ddb60.js +0 -1
- package/assets/esri/core/workers/chunks/e3d43cdc72fa4c58e183.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4599],{45091:(e,t,s)=>{s.d(t,{Z:()=>u});var r=s(80442),n=s(71143);const i=4294967296,o=(0,r.Z)("esri-text-decoder")?new TextDecoder("utf-8"):null,a=(0,r.Z)("safari")||(0,r.Z)("ios")?6:(0,r.Z)("ff")?12:32;class u{constructor(e,t,s=0,r=(e?e.byteLength:0)){this._tag=0,this._dataType=99,this.init(e,t,s,r)}init(e,t,s,r){this._data=e,this._dataView=t,this._pos=s,this._end=r}clone(){return new u(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;return e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?e:(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?e:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)|0}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getUint32(t+4,!0)*i;return this._skip(8),s}getSFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getInt32(t+4,!0)*i;return this._skip(8),s}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,s=this._toString(this._data,t,t+e);return this._skip(e),s}getBytes(){const e=this._getLength(),t=this._pos,s=this._toBytes(this._data,t,t+e);return this._skip(e),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,s,r){const n=this.getMessage(),i=e(n,t,s,r);return n.release(),i}processMessage(e){const t=this.getMessage(),s=e(t);return t.release(),s}getMessage(){const e=this._getLength(),t=u.pool.acquire();return t.init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){u.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case 0:this._decodeVarint();break;case 1:this._skip(8);break;case 2:this._skip(this._getLength());break;case 5:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t,s=this._pos,r=0;if(this._end-s>=10)do{if(t=e[s++],r|=127&t,0==(128&t))break;if(t=e[s++],r|=(127&t)<<7,0==(128&t))break;if(t=e[s++],r|=(127&t)<<14,0==(128&t))break;if(t=e[s++],r|=(127&t)<<21,0==(128&t))break;if(t=e[s++],r+=268435456*(127&t),0==(128&t))break;if(t=e[s++],r+=34359738368*(127&t),0==(128&t))break;if(t=e[s++],r+=4398046511104*(127&t),0==(128&t))break;if(t=e[s++],r+=562949953421312*(127&t),0==(128&t))break;if(t=e[s++],r+=72057594037927940*(127&t),0==(128&t))break;if(t=e[s++],r+=0x8000000000000000*(127&t),0==(128&t))break;throw new Error("Varint too long!")}while(0);else{let n=1;for(;s!==this._end&&(t=e[s],0!=(128&t));)++s,r+=(127&t)*n,n*=128;if(s===this._end)throw new Error("Varint overrun!");++s,r+=t*n}return this._pos=s,r}_decodeSVarint(){const e=this._decodeVarint();return e%2?-(e+1)/2:e/2}_getLength(){if(2!==this._dataType)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,s){if((s=Math.min(this._end,s))-t>a&&o){const r=e.subarray(t,s);return o.decode(r)}let r="",n="";for(let i=t;i<s;++i){const t=e[i];128&t?n+="%"+t.toString(16):(r+=decodeURIComponent(n)+String.fromCharCode(t),n="")}return n.length&&(r+=decodeURIComponent(n)),r}_toBytes(e,t,s){return s=Math.min(this._end,s),new Uint8Array(e.buffer,t,s-t)}}u.pool=new n.Z(u,null,(e=>{e._data=null,e._dataView=null}))},38581:(e,t,s)=>{s.d(t,{aX:()=>x});var r=s(68773),n=s(20102),i=s(92604),o=s(70586),a=s(17332),u=s(58901),l=s(73913),c=s(8744),h=s(40488),p=(s(66577),s(3172)),f=s(17452),d=s(33955);const g=i.Z.getLogger("esri.geometry.support.normalizeUtils");function y(e){return"polygon"===e[0].type}function m(e){return"polyline"===e[0].type}function _(e,t,s){if(t){const t=function(e,t){if(!(e instanceof u.Z||e instanceof a.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw g.error(e),new n.Z(e)}const s=(0,l.x3)(e),r=[];for(const e of s){const s=[];r.push(s),s.push([e[0][0],e[0][1]]);for(let r=0;r<e.length-1;r++){const n=e[r][0],i=e[r][1],o=e[r+1][0],a=e[r+1][1],u=Math.sqrt((o-n)*(o-n)+(a-i)*(a-i)),l=(a-i)/u,c=(o-n)/u,h=u/t;if(h>1){for(let e=1;e<=h-1;e++){const r=e*t,o=c*r+n,a=l*r+i;s.push([o,a])}const e=(u+Math.floor(h-1)*t)/2,r=c*e+n,o=l*e+i;s.push([r,o])}s.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new a.Z({rings:r,spatialReference:e.spatialReference}):new u.Z({paths:r,spatialReference:e.spatialReference})}(e,1e6);e=(0,h.Sx)(t,!0)}return s&&(e=(0,l.Sy)(e,s)),e}function k(e,t,s){if(Array.isArray(e)){const r=e[0];if(r>t){const s=(0,l.XZ)(r,t);e[0]=r+s*(-2*t)}else if(r<s){const t=(0,l.XZ)(r,s);e[0]=r+t*(-2*s)}}else{const r=e.x;if(r>t){const s=(0,l.XZ)(r,t);e=e.clone().offset(s*(-2*t),0)}else if(r<s){const t=(0,l.XZ)(r,s);e=e.clone().offset(t*(-2*s),0)}}return e}function b(e,t){let s=-1;for(let r=0;r<t.cutIndexes.length;r++){const n=t.cutIndexes[r],i=t.geometries[r],o=(0,l.x3)(i);for(let e=0;e<o.length;e++){const t=o[e];t.some((s=>{if(s[0]<180)return!0;{let s=0;for(let e=0;e<t.length;e++){const r=t[e][0];s=r>s?r:s}s=Number(s.toFixed(9));const r=-360*(0,l.XZ)(s,180);for(let s=0;s<t.length;s++){const t=i.getPoint(e,s);i.setPoint(e,s,t.clone().offset(r,0))}return!0}}))}if(n===s){if(y(e))for(const t of(0,l.x3)(i))e[n]=e[n].addRing(t);else if(m(e))for(const t of(0,l.x3)(i))e[n]=e[n].addPath(t)}else s=n,e[n]=i}return e}async function x(e,t,s){var n;if(!Array.isArray(e))return x([e],t);const i=null!=(n=null==t?void 0:t.url)?n:r.Z.geometryServiceUrl;let g,y,m,S,w,T,F,I,q=0;const R=[],Z=[];for(const t of e)if((0,o.Wi)(t))Z.push(t);else if(g||(g=t.spatialReference,y=(0,c.C5)(g),m=g.isWebMercator,T=m?102100:4326,S=l.UZ[T].maxX,w=l.UZ[T].minX,F=l.UZ[T].plus180Line,I=l.UZ[T].minus180Line),y)if("mesh"===t.type)Z.push(t);else if("point"===t.type)Z.push(k(t.clone(),S,w));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>k(e,S,w))),Z.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,y);Z.push(e.rings?new a.Z(e):e)}else if(t.extent){const e=t.extent,s=(0,l.XZ)(e.xmin,w)*(2*S);let r=0===s?t.clone():(0,l.Sy)(t.clone(),s);e.offset(s,0),e.intersects(F)&&e.xmax!==S?(q=e.xmax>q?e.xmax:q,r=_(r,m),R.push(r),Z.push("cut")):e.intersects(I)&&e.xmin!==w?(q=e.xmax*(2*S)>q?e.xmax*(2*S):q,r=_(r,m,360),R.push(r),Z.push("cut")):Z.push(r)}else Z.push(t.clone());else Z.push(t);let P=(0,l.XZ)(q,S),N=-90;const G=P,V=new u.Z;for(;P>0;){const e=360*P-180;V.addPath([[e,N],[e,-1*N]]),N*=-1,P--}if(R.length>0&&G>0){const t=b(R,await async function(e,t,s,r){const n="string"==typeof e?(0,f.mN)(e):e,i=t[0].spatialReference,o={...r,query:{...n.query,f:"json",sr:JSON.stringify(i),target:JSON.stringify({geometryType:(0,d.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(s)}},a=await(0,p.default)(n.path+"/cut",o),{cutIndexes:u,geometries:l=[]}=a.data;return{cutIndexes:u,geometries:l.map((e=>{const t=(0,d.im)(e);return t.spatialReference=i,t}))}}(i,R,V,s)),r=[],n=[];for(let s=0;s<Z.length;s++){const i=Z[s];if("cut"!==i)n.push(i);else{const i=t.shift(),a=e[s];(0,o.pC)(a)&&"polygon"===a.type&&a.rings&&a.rings.length>1&&i.rings.length>=a.rings.length?(r.push(i),n.push("simplify")):n.push(m?(0,h.$)(i):i)}}if(!r.length)return n;const a=await async function(e,t,s){const r="string"==typeof e?(0,f.mN)(e):e,n=t[0].spatialReference,i=(0,d.Ji)(t[0]),o={...s,query:{...r.query,f:"json",sr:n.wkid?n.wkid:JSON.stringify(n),geometries:JSON.stringify((a=t,{geometryType:(0,d.Ji)(a[0]),geometries:a.map((e=>e.toJSON()))}))}};var a;return function(e,t,s){const r=(0,d.q9)(t);return e.map((e=>{const t=r.fromJSON(e);return t.spatialReference=s,t}))}((await(0,p.default)(r.path+"/simplify",o)).data,i,n)}(i,r,s),u=[];for(let e=0;e<n.length;e++){const t=n[e];"simplify"!==t?u.push(t):u.push(m?(0,h.$)(a.shift()):a.shift())}return u}const C=[];for(let e=0;e<Z.length;e++){const t=Z[e];if("cut"!==t)C.push(t);else{const e=R.shift();C.push(!0===m?(0,h.$)(e):e)}}return Promise.resolve(C)}},73913:(e,t,s)=>{s.d(t,{UZ:()=>o,x3:()=>l,XZ:()=>a,Sy:()=>u});var r=s(58901),n=s(82971),i=s(33955);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.Z.WebMercator}),minus180Line:new r.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.Z({paths:[[[180,-180],[180,180]]],spatialReference:n.Z.WGS84}),minus180Line:new r.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:n.Z.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function u(e,t){const s=l(e);for(const e of s)for(const s of e)s[0]+=t;return e}function l(e){return(0,i.oU)(e)?e.rings:e.paths}},69285:(e,t,s)=>{s.d(t,{k:()=>o});var r=s(70586),n=s(67900),i=s(8744);function o(e,t,s){if((0,r.Wi)(t)||(0,r.Wi)(s)||s.vcsWkid||(0,i.fS)(t,s))return null;const o=(0,n._R)(t)/(0,n._R)(s);if(1===o)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){e&&null!=e.z&&(e.z*=t)}(e,o);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const s of e.paths)for(const e of s)e.length>2&&(e[2]*=t)}(e,o);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const s of e.rings)for(const e of s)e.length>2&&(e[2]*=t)}(e,o);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const s of e.points)s.length>2&&(s[2]*=t)}(e,o);case"extent":case"esriGeometryExtent":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,o);default:return null}}},70272:(e,t,s)=>{s.d(t,{nd:()=>o,ZP:()=>n,S6:()=>i});var r=s(70586);class n{constructor(e=null,t={},s,r){this.geometry=e,this.attributes=t,this.centroid=s,this.objectId=r,this.displayId=0,this.geohashX=0,this.geohashY=0}weakClone(){const e=new n(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}}function i(e){return!((0,r.Wi)(e.geometry)||!e.geometry.coords||!e.geometry.coords.length)}class o extends n{}},44876:(e,t,s)=>{s.d(t,{Z:()=>r});class r{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new r;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}},5428:(e,t,s)=>{s.d(t,{Z:()=>r});class r{constructor(e=[],t=[],s=!1){this.lengths=null!=e?e:[],this.coords=null!=t?t:[],this.hasIndeterminateRingOrder=s}get isPoint(){return 0===this.lengths.length}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((e,t)=>e+t))}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let s=0;s<this.lengths.length;s++){const r=this.lengths[s];for(let s=0;s<r;s++)e(this.coords[2*(s+t)],this.coords[2*(s+t)+1]);t+=r}}clone(e){return e?(e.set(this.coords),new r(this.lengths.slice(),e,this.hasIndeterminateRingOrder)):new r(this.lengths.slice(),this.coords.slice(),this.hasIndeterminateRingOrder)}}},77863:(e,t,s)=>{s.d(t,{K9:()=>Z,O7:()=>h,G$:()=>T});var r=s(20102),n=s(70586),i=s(45091),o=s(5428),a=s(78760);const u=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],l=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],c=["upperLeft","lowerLeft"];function h(e){return e>=u.length?null:u[e]}function p(e){return e>=l.length?null:l[e]}function f(e){return e>=c.length?null:c[e]}function d(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function g(e,t,s){const r=t.createPointGeometry(s);for(;e.next();)switch(e.tag()){case 3:{const s=e.getUInt32(),n=e.pos()+s;let i=0;for(;e.pos()<n;)t.addCoordinatePoint(r,e.getSInt64(),i++);break}default:e.skip()}return r}function y(e,t,s){const r=t.createGeometry(s),n=2+(s.hasZ?1:0)+(s.hasM?1:0);for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),n=e.pos()+s;let i=0;for(;e.pos()<n;)t.addLength(r,e.getUInt32(),i++);break}case 3:{const s=e.getUInt32(),i=e.pos()+s;let o=0;for(t.allocateCoordinates(r);e.pos()<i;)t.addCoordinate(r,e.getSInt64(),o),o++,o===n&&(o=0);break}default:e.skip()}return r}function m(e){const t=new o.Z;let s="esriGeometryPoint";for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.lengths.push(e.getUInt32());break}case 3:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.coords.push(e.getSInt64());break}case 1:s=a.A[e.getEnum()];break;default:e.skip()}return{queryGeometry:t,queryGeometryType:s}}function _(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}function k(e){const t={type:h(0)};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.type=h(e.getEnum());break;case 3:t.alias=e.getString();break;case 4:t.sqlType=p(e.getEnum());break;case 5:default:e.skip();break;case 6:t.defaultValue=e.getString()}return t}function b(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.isSystemMaintained=e.getBool();break;default:e.skip()}return t}function x(e,t,s,r){const n=t.createFeature(s);let i=0;for(;e.next();)switch(e.tag()){case 1:{const t=r[i++].name;n.attributes[t]=e.processMessage(_);break}case 2:n.geometry=e.processMessageWithArgs(y,t,s);break;case 4:n.centroid=e.processMessageWithArgs(g,t,s);break;default:e.skip()}return n}function S(e){const t=[1,1,1,1];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function w(e){const t=[0,0,0,0];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function T(e){const t={originPosition:f(0)};for(;e.next();)switch(e.tag()){case 1:t.originPosition=f(e.getEnum());break;case 2:t.scale=e.processMessage(S);break;case 3:t.translate=e.processMessage(w);break;default:e.skip()}return t}function F(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.shapeAreaFieldName=e.getString();break;case 2:t.shapeLengthFieldName=e.getString();break;case 3:t.units=e.getString();break;default:e.skip()}return t}function I(e,t){const s=t.createSpatialReference();for(;e.next();)switch(e.tag()){case 1:s.wkid=e.getUInt32();break;case 5:s.wkt=e.getString();break;case 2:s.latestWkid=e.getUInt32();break;case 3:s.vcsWkid=e.getUInt32();break;case 4:s.latestVcsWkid=e.getUInt32();break;default:e.skip()}return s}function q(e,t){const s=t.createFeatureResult();s.geometryType=d(t,0);let r=!1;for(;e.next();)switch(e.tag()){case 1:s.objectIdFieldName=e.getString();break;case 3:s.globalIdFieldName=e.getString();break;case 4:s.geohashFieldName=e.getString();break;case 5:s.geometryProperties=e.processMessage(F);break;case 7:s.geometryType=d(t,e.getEnum());break;case 8:s.spatialReference=e.processMessageWithArgs(I,t);break;case 10:s.hasZ=e.getBool();break;case 11:s.hasM=e.getBool();break;case 12:s.transform=e.processMessage(T);break;case 9:{const t=e.getBool();s.exceededTransferLimit=t;break}case 13:t.addField(s,e.processMessage(k));break;case 15:r||(t.prepareFeatures(s),r=!0),t.addFeature(s,e.processMessageWithArgs(x,t,s,s.fields));break;case 2:s.uniqueIdField=e.processMessage(b);break;default:e.skip()}return t.finishFeatureResult(s),s}function R(e,t){const s={};let r=null;for(;e.next();)switch(e.tag()){case 4:r=e.processMessageWithArgs(m);break;case 1:s.featureResult=e.processMessageWithArgs(q,t);break;default:e.skip()}return(0,n.pC)(r)&&s.featureResult&&t.addQueryGeometry(s,r),s}function Z(e,t){try{const s=2,r=new i.Z(new Uint8Array(e),new DataView(e)),n={};for(;r.next();)r.tag()===s?n.queryResult=r.processMessageWithArgs(R,t):r.skip();return n}catch(e){throw new r.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}}},78760:(e,t,s)=>{s.d(t,{A:()=>u,J:()=>l});var r=s(67900),n=s(8744),i=s(70272),o=s(44876),a=s(5428);const u=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class l{constructor(e){this.options=e,this.geometryTypes=u,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new o.Z}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e||!e.features||!e.hasZ||!this.options.sourceSpatialReference||!e.spatialReference||(0,n.fS)(e.spatialReference,this.options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,r._R)(this.options.sourceSpatialReference)/(0,r._R)(e.spatialReference);if(1!==t)for(const s of e.features){if(!(0,i.S6)(s))continue;const e=s.geometry.coords;for(let s=2;s<e.length;s+=3)e[s]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new i.ZP}createSpatialReference(){return{wkid:0}}createGeometry(){return new a.Z}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new a.Z}}},45178:(e,t,s)=>{s.d(t,{C:()=>n});var r=s(77863);function n(e,t){const s=(0,r.K9)(e,t),n=s.queryResult.featureResult,i=s.queryResult.queryGeometry,o=s.queryResult.queryGeometryType;if(n&&n.features&&n.features.length&&n.objectIdFieldName){const e=n.objectIdFieldName;for(const t of n.features)t.attributes&&(t.objectId=t.attributes[e])}return n&&(n.queryGeometry=i,n.queryGeometryType=o),n}},34599:(e,t,s)=>{s.r(t),s.d(t,{executeQuery:()=>f,executeQueryForCount:()=>m,executeQueryForExtent:()=>_,executeQueryForIds:()=>y,executeQueryPBF:()=>d,executeQueryPBFBuffer:()=>g,queryToQueryStringParameters:()=>p,runQuery:()=>k});var r=s(3172),n=s(70586),i=s(17452),o=s(33955),a=s(38581),u=s(45178),l=s(28694),c=s(99306);const h="Layer does not support extent calculation.";function p(e,t){const s=e.geometry,r=e.toJSON(),i=r,a=e.outSpatialReference;let u,l;if((0,n.pC)(s)){if(u=s.spatialReference,l=s.spatialReference.wkid||JSON.stringify(s.spatialReference),i.geometryType=(0,o.Ji)(s),"extent"===s.type)i.geometry=`${s.xmin},${s.ymin},${s.xmax},${s.ymax}`;else if("point"===s.type)i.geometry=`${s.x},${s.y}`;else{const e=s.toJSON();delete e.spatialReference,i.geometry=JSON.stringify(e)}i.inSR=l}if(u||(u=a),r.groupByFieldsForStatistics&&(i.groupByFieldsForStatistics=r.groupByFieldsForStatistics.join(",")),r.objectIds&&(i.objectIds=r.objectIds.join(",")),r.orderByFields&&(i.orderByFields=r.orderByFields.join(",")),!r.outFields||!r.returnDistinctValues&&(null!=t&&t.returnCountOnly||null!=t&&t.returnExtentOnly||null!=t&&t.returnIdsOnly)?delete i.outFields:-1!==r.outFields.indexOf("*")?i.outFields="*":i.outFields=r.outFields.join(","),r.outSR?i.outSR=r.outSR.wkid||JSON.stringify(r.outSR):s&&(r.returnGeometry||r.returnCentroid)&&(i.outSR=i.inSR),r.returnGeometry&&delete r.returnGeometry,r.outStatistics&&(i.outStatistics=JSON.stringify(r.outStatistics)),r.pixelSize&&(i.pixelSize=JSON.stringify(r.pixelSize)),r.quantizationParameters&&((0,n.pC)(u)&&(0,n.pC)(e.quantizationParameters)&&(0,n.pC)(e.quantizationParameters.extent)&&u.equals(e.quantizationParameters.extent.spatialReference)&&delete r.quantizationParameters.extent.spatialReference,i.quantizationParameters=JSON.stringify(r.quantizationParameters)),r.parameterValues&&(i.parameterValues=JSON.stringify(r.parameterValues)),r.rangeValues&&(i.rangeValues=JSON.stringify(r.rangeValues)),r.dynamicDataSource&&(i.layer=JSON.stringify({source:r.dynamicDataSource}),delete r.dynamicDataSource),r.timeExtent){const e=r.timeExtent,{start:t,end:s}=e;null==t&&null==s||(i.time=t===s?t:`${null==t?"null":t},${null==s?"null":s}`),delete r.timeExtent}return i}async function f(e,t,s,r){const i=(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?{data:{features:[]}}:await k(e,t,"json",r);return(0,l.p)(t,s,i.data),i}async function d(e,t,s,r){if((0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty)return Promise.resolve({data:s.createFeatureResult()});const i=await g(e,t,r),o=i;return o.data=(0,u.C)(i.data,s),o}function g(e,t,s){return k(e,t,"pbf",s)}function y(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):k(e,t,"json",s,{returnIdsOnly:!0})}function m(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):k(e,t,"json",s,{returnIdsOnly:!0,returnCountOnly:!0})}function _(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):k(e,t,"json",s,{returnExtentOnly:!0,returnCountOnly:!0}).then((e=>{const t=e.data;if(t.hasOwnProperty("extent"))return e;if(t.features)throw new Error(h);if(t.hasOwnProperty("count"))throw new Error(h);return e}))}function k(e,t,s,o={},u={}){const l="string"==typeof e?(0,i.mN)(e):e,h=t.geometry?[t.geometry]:[];return o.responseType="pbf"===s?"array-buffer":"json",(0,a.aX)(h,null,o).then((e=>{const a=e&&e[0];(0,n.pC)(a)&&((t=t.clone()).geometry=a);const h=(0,c.A)({...l.query,f:s,...u,...p(t,u)});return(0,r.default)((0,i.v_)(l.path,"query"),{...o,query:{...h,...o.query}})}))}},28694:(e,t,s)=>{s.d(t,{p:()=>i});var r=s(70586),n=s(69285);function i(e,t,s){if(!s||!s.features||!s.hasZ)return;const i=(0,n.k)(s.geometryType,t,e.outSpatialReference);if(!(0,r.Wi)(i))for(const e of s.features)i(e.geometry)}},99306:(e,t,s)=>{function r(e){const t={};for(const s in e){if("declaredClass"===s)continue;const n=e[s];if(null!=n&&"function"!=typeof n)if(Array.isArray(n)){t[s]=[];for(let e=0;e<n.length;e++)t[s][e]=r(n[e])}else"object"==typeof n?n.toJSON&&(t[s]=JSON.stringify(n)):t[s]=n}return t}s.d(t,{A:()=>r})}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7783],{96794:(e,t,s)=>{s.d(t,{r:()=>i});var r=s(88764);function i(e,t){if(!(this instanceof i))return new i(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this.toBBox=t:this._initFormat(t)),this.clear()}function n(e,t,s){if(!s)return t.indexOf(e);for(var r=0;r<t.length;r++)if(s(e,t[r]))return r;return-1}function a(e,t){o(e,0,e.children.length,t,e)}function o(e,t,s,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var n,a=t;a<s;a++)n=e.children[a],h(i,e.leaf?r(n):n);return i}function h(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function c(e,t){return e.minX-t.minX}function u(e,t){return e.minY-t.minY}function l(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function d(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){var s=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),n=Math.min(e.maxY,t.maxY);return Math.max(0,i-s)*Math.max(0,n-r)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function f(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function m(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,t,s,i,n){for(var a,o=[t,s];o.length;)(s=o.pop())-(t=o.pop())<=i||(a=t+Math.ceil((s-t)/i/2)*i,(0,r.q)(e,a,t,s,n),o.push(t,a,a,s))}i.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,s=[],r=this.toBBox;if(!f(e,t))return s;for(var i,n,a,o,h=[];t;){for(i=0,n=t.children.length;i<n;i++)a=t.children[i],f(e,o=t.leaf?r(a):a)&&(t.leaf?s.push(a):_(e,o)?this._all(a,s):h.push(a));t=h.pop()}return s},collides:function(e){var t=this.data,s=this.toBBox;if(!f(e,t))return!1;for(var r,i,n,a,o=[];t;){for(r=0,i=t.children.length;r<i;r++)if(n=t.children[r],f(e,a=t.leaf?s(n):n)){if(t.leaf||_(e,a))return!0;o.push(n)}t=o.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(e,t){if(!e)return this;for(var s,r,i,a,o=this.data,h=this.toBBox(e),c=[],u=[];o||c.length;){if(o||(o=c.pop(),r=c[c.length-1],s=u.pop(),a=!0),o.leaf&&-1!==(i=n(e,o.children,t)))return o.children.splice(i,1),c.push(o),this._condense(c),this;a||o.leaf||!_(o,h)?r?(s++,o=r.children[s],a=!1):o=null:(c.push(o),u.push(s),s=0,r=o,o=o.children[0])}return this},toBBox:function(e){return e},compareMinX:c,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var s=[];e;)e.leaf?t.push.apply(t,e.children):s.push.apply(s,e.children),e=s.pop();return t},_build:function(e,t,s,r){var i,n=s-t+1,o=this._maxEntries;if(n<=o)return a(i=m(e.slice(t,s+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(n)/Math.log(o)),o=Math.ceil(n/Math.pow(o,r-1))),(i=m([])).leaf=!1,i.height=r;var h,c,u,l,d=Math.ceil(n/o),p=d*Math.ceil(Math.sqrt(o));for(y(e,t,s,p,this.compareMinX),h=t;h<=s;h+=p)for(y(e,h,u=Math.min(h+p-1,s),d,this.compareMinY),c=h;c<=u;c+=d)l=Math.min(c+d-1,u),i.children.push(this._build(e,c,l,r-1));return a(i,this.toBBox),i},_chooseSubtree:function(e,t,s,r){for(var i,n,a,o,h,c,u,d;r.push(t),!t.leaf&&r.length-1!==s;){for(u=d=1/0,i=0,n=t.children.length;i<n;i++)h=l(a=t.children[i]),(c=p(e,a)-h)<d?(d=c,u=h<u?h:u,o=a):c===d&&h<u&&(u=h,o=a);t=o||t.children[0]}return t},_insert:function(e,t,s){var r=this.toBBox,i=s?e:r(e),n=[],a=this._chooseSubtree(i,this.data,t,n);for(a.children.push(e),h(a,i);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(i,n,t)},_split:function(e,t){var s=e[t],r=s.children.length,i=this._minEntries;this._chooseSplitAxis(s,i,r);var n=this._chooseSplitIndex(s,i,r),o=m(s.children.splice(n,s.children.length-n));o.height=s.height,o.leaf=s.leaf,a(s,this.toBBox),a(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(s,o)},_splitRoot:function(e,t){this.data=m([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,s){var r,i,n,a,h,c,u,d;for(c=u=1/0,r=t;r<=s-t;r++)a=g(i=o(e,0,r,this.toBBox),n=o(e,r,s,this.toBBox)),h=l(i)+l(n),a<c?(c=a,d=r,u=h<u?h:u):a===c&&h<u&&(u=h,d=r);return d},_chooseSplitAxis:function(e,t,s){var r=e.leaf?this.compareMinX:c,i=e.leaf?this.compareMinY:u;this._allDistMargin(e,t,s,r)<this._allDistMargin(e,t,s,i)&&e.children.sort(r)},_allDistMargin:function(e,t,s,r){e.children.sort(r);var i,n,a=this.toBBox,c=o(e,0,t,a),u=o(e,s-t,s,a),l=d(c)+d(u);for(i=t;i<s-t;i++)n=e.children[i],h(c,e.leaf?a(n):n),l+=d(c);for(i=s-t-1;i>=t;i--)n=e.children[i],h(u,e.leaf?a(n):n),l+=d(u);return l},_adjustParentBBoxes:function(e,t,s){for(var r=s;r>=0;r--)h(t[r],e)},_condense:function(e){for(var t,s=e.length-1;s>=0;s--)0===e[s].children.length?s>0?(t=e[s-1].children).splice(t.indexOf(e[s]),1):this.clear():a(e[s],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},8557:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(70586);class i{constructor(e){this.size=0,this._start=0,this.maxSize=e,this._buffer=new Array(e)}get entries(){return this._buffer}enqueue(e){if(this.size===this.maxSize){const t=this._buffer[this._start];return this._buffer[this._start]=e,this._start=(this._start+1)%this.maxSize,t}return this._buffer[(this._start+this.size++)%this.maxSize]=e,null}dequeue(){if(0===this.size)return null;const e=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,e}peek(){return 0===this.size?null:this._buffer[this._start]}find(e){if(0===this.size)return null;for(const t of this._buffer)if((0,r.pC)(t)&&e(t))return t;return null}clear(e){let t=this.dequeue();for(;(0,r.pC)(t);)e&&e(t),t=this.dequeue()}}},3920:(e,t,s)=>{s.d(t,{r:()=>u,p:()=>c});var r=s(43697),i=s(15923),n=s(61247),a=s(5600),o=s(52011),h=s(89749);const c=e=>{let t=class extends e{destroy(){var e,t;this.destroyed||(null==(e=this._get("handles"))||e.destroy(),null==(t=this._get("updatingHandles"))||t.destroy())}get handles(){return this._get("handles")||new n.Z}get updatingHandles(){return this._get("updatingHandles")||new h.t}};return(0,r._)([(0,a.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,r._)([(0,a.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,r._)([(0,o.j)("esri.core.HandleOwner")],t),t};let u=class extends(c(i.Z)){};u=(0,r._)([(0,o.j)("esri.core.HandleOwner")],u)},45091:(e,t,s)=>{s.d(t,{Z:()=>h});var r=s(80442),i=s(71143);const n=4294967296,a=(0,r.Z)("esri-text-decoder")?new TextDecoder("utf-8"):null,o=(0,r.Z)("safari")||(0,r.Z)("ios")?6:(0,r.Z)("ff")?12:32;class h{constructor(e,t,s=0,r=(e?e.byteLength:0)){this._tag=0,this._dataType=99,this.init(e,t,s,r)}init(e,t,s,r){this._data=e,this._dataView=t,this._pos=s,this._end=r}clone(){return new h(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;return e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?e:(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?e:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)|0}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getUint32(t+4,!0)*n;return this._skip(8),s}getSFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getInt32(t+4,!0)*n;return this._skip(8),s}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,s=this._toString(this._data,t,t+e);return this._skip(e),s}getBytes(){const e=this._getLength(),t=this._pos,s=this._toBytes(this._data,t,t+e);return this._skip(e),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,s,r){const i=this.getMessage(),n=e(i,t,s,r);return i.release(),n}processMessage(e){const t=this.getMessage(),s=e(t);return t.release(),s}getMessage(){const e=this._getLength(),t=h.pool.acquire();return t.init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){h.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case 0:this._decodeVarint();break;case 1:this._skip(8);break;case 2:this._skip(this._getLength());break;case 5:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t,s=this._pos,r=0;if(this._end-s>=10)do{if(t=e[s++],r|=127&t,0==(128&t))break;if(t=e[s++],r|=(127&t)<<7,0==(128&t))break;if(t=e[s++],r|=(127&t)<<14,0==(128&t))break;if(t=e[s++],r|=(127&t)<<21,0==(128&t))break;if(t=e[s++],r+=268435456*(127&t),0==(128&t))break;if(t=e[s++],r+=34359738368*(127&t),0==(128&t))break;if(t=e[s++],r+=4398046511104*(127&t),0==(128&t))break;if(t=e[s++],r+=562949953421312*(127&t),0==(128&t))break;if(t=e[s++],r+=72057594037927940*(127&t),0==(128&t))break;if(t=e[s++],r+=0x8000000000000000*(127&t),0==(128&t))break;throw new Error("Varint too long!")}while(0);else{let i=1;for(;s!==this._end&&(t=e[s],0!=(128&t));)++s,r+=(127&t)*i,i*=128;if(s===this._end)throw new Error("Varint overrun!");++s,r+=t*i}return this._pos=s,r}_decodeSVarint(){const e=this._decodeVarint();return e%2?-(e+1)/2:e/2}_getLength(){if(2!==this._dataType)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,s){if((s=Math.min(this._end,s))-t>o&&a){const r=e.subarray(t,s);return a.decode(r)}let r="",i="";for(let n=t;n<s;++n){const t=e[n];128&t?i+="%"+t.toString(16):(r+=decodeURIComponent(i)+String.fromCharCode(t),i="")}return i.length&&(r+=decodeURIComponent(i)),r}_toBytes(e,t,s){return s=Math.min(this._end,s),new Uint8Array(e.buffer,t,s-t)}}h.pool=new i.Z(h,null,(e=>{e._data=null,e._dataView=null}))},80903:(e,t,s)=>{s.d(t,{Z:()=>h});var r=s(50758),i=s(92604),n=s(95330),a=s(25045);const o=i.Z.getLogger("esri.core.workers.Connection");class h{constructor(){this._clients=new Array,this._clientPromises=new Array,this._clientIdx=0}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,t){return new Promise(((s,r)=>{let i=!0;const o=e=>{(0,n.k_)(t.signal),i&&(i=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length;for(let i=0;i<e.length;++i){const h=e[i];(0,n.y8)(h)?this._clientPromises[i]=h.then((e=>(this._clients[i]=new a.default(e,t),o(s),this._clients[i])),(()=>(o(r),null))):(this._clients[i]=new a.default(h,t),this._clientPromises[i]=Promise.resolve(this._clients[i]),o(s))}}))}broadcast(e,t,s){const r=new Array(this._clientPromises.length);for(let i=0;i<this._clientPromises.length;++i){const n=this._clientPromises[i];r[i]=n.then((r=>r.invoke(e,t,s)))}return r}close(){for(const e of this._clientPromises)e.then((e=>e.close()));this._clients.length=0,this._clientPromises.length=0}getAvailableClient(){let e;for(let t=0;t<this._clients.length;++t){const s=this._clients[t];if(s){if(!s.isBusy())return Promise.resolve(s)}else e=e||[],e.push(this._clientPromises[t])}return e?Promise.race(e):(this._clientIdx=(this._clientIdx+1)%this._clients.length,Promise.resolve(this._clients[this._clientIdx]))}invoke(e,t,s){let r=null;return Array.isArray(s)?(o.warn("invoke()","The transferList parameter is deprecated, use the options object instead"),r={transferList:s}):r=s,this.closed?Promise.reject(new Error("Connection closed")):this.getAvailableClient().then((s=>s.invoke(e,t,r)))}on(e,t){return Promise.all(this._clientPromises).then((()=>(0,r.AL)(this._clients.map((s=>s.on(e,t))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let s=t.length;for(let r=0;r<this._clientPromises.length;++r)this._clientPromises[r].then((i=>{t[r]=i.openPort(),0==--s&&e(t)}))}))}get test(){return{numClients:this._clients.length}}}},66677:(e,t,s)=>{s.d(t,{ld:()=>g,B5:()=>l,M8:()=>f,G:()=>x,Qc:()=>d,DR:()=>p,Nm:()=>m,XG:()=>y,a7:()=>_,wH:()=>I});var r=s(70586),i=s(17452),n=s(25929);const a={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},o=Object.values(a),h=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),c=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function l(e){return!!h.test(e)}function d(e){const t=(0,i.mN)(e),s=t.path.match(h)||t.path.match(c);if(!s)return null;const[,r,n,o,u]=s,l=n.indexOf("/");return{title:g(-1!==l?n.slice(l+1):n),serverType:a[o.toLowerCase()],sublayer:null!=u&&""!==u?parseInt(u,10):null,url:{path:r}}}function p(e){const t=(0,i.mN)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function g(e){return(e=e.replace(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function _(e,t){const s=[];if(e){const t=d(e);(0,r.pC)(t)&&t.title&&s.push(t.title)}if(t){const e=g(t);s.push(e)}if(2===s.length){if(-1!==s[0].toLowerCase().indexOf(s[1].toLowerCase()))return s[0];if(-1!==s[1].toLowerCase().indexOf(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function f(e){if(!e)return!1;const t=-1!==(e=e.toLowerCase()).indexOf(".arcgis.com/"),s=-1!==e.indexOf("//services")||-1!==e.indexOf("//tiles")||-1!==e.indexOf("//features");return t&&s}function m(e,t){return e?(0,i.Qj)((0,i.Hu)(e,t)):e}function y(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.Hu)(t,e.logger);const s=(0,i.mN)(t),n=d(s.path);let a;if((0,r.pC)(n))null!=n.sublayer&&null==e.layer.layerId&&(a=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=p(s.path);(0,r.pC)(e)&&(t=e.serviceUrl,a=e.sublayerId)}return{url:(0,i.Qj)(t),layerId:a}}function I(e,t,s,r,a){(0,n.w)(t,r,"url",a),r.url&&null!=e.layerId&&(r.url=(0,i.v_)(r.url,s,e.layerId.toString()))}function x(e){if(!e)return!1;const t=e.toLowerCase(),s=-1!==t.indexOf("/services/"),r=-1!==t.indexOf("/mapserver/wmsserver"),i=-1!==t.indexOf("/imageserver/wmsserver"),n=-1!==t.indexOf("/wmsserver");return s&&(r||i||n)}},77863:(e,t,s)=>{s.d(t,{K9:()=>k,O7:()=>l,G$:()=>S});var r=s(20102),i=s(70586),n=s(45091),a=s(5428),o=s(78760);const h=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],c=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],u=["upperLeft","lowerLeft"];function l(e){return e>=h.length?null:h[e]}function d(e){return e>=c.length?null:c[e]}function p(e){return e>=u.length?null:u[e]}function g(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function _(e,t,s){const r=t.createPointGeometry(s);for(;e.next();)switch(e.tag()){case 3:{const s=e.getUInt32(),i=e.pos()+s;let n=0;for(;e.pos()<i;)t.addCoordinatePoint(r,e.getSInt64(),n++);break}default:e.skip()}return r}function f(e,t,s){const r=t.createGeometry(s),i=2+(s.hasZ?1:0)+(s.hasM?1:0);for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),i=e.pos()+s;let n=0;for(;e.pos()<i;)t.addLength(r,e.getUInt32(),n++);break}case 3:{const s=e.getUInt32(),n=e.pos()+s;let a=0;for(t.allocateCoordinates(r);e.pos()<n;)t.addCoordinate(r,e.getSInt64(),a),a++,a===i&&(a=0);break}default:e.skip()}return r}function m(e){const t=new a.Z;let s="esriGeometryPoint";for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.lengths.push(e.getUInt32());break}case 3:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.coords.push(e.getSInt64());break}case 1:s=o.A[e.getEnum()];break;default:e.skip()}return{queryGeometry:t,queryGeometryType:s}}function y(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}function I(e){const t={type:l(0)};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.type=l(e.getEnum());break;case 3:t.alias=e.getString();break;case 4:t.sqlType=d(e.getEnum());break;case 5:default:e.skip();break;case 6:t.defaultValue=e.getString()}return t}function x(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.isSystemMaintained=e.getBool();break;default:e.skip()}return t}function b(e,t,s,r){const i=t.createFeature(s);let n=0;for(;e.next();)switch(e.tag()){case 1:{const t=r[n++].name;i.attributes[t]=e.processMessage(y);break}case 2:i.geometry=e.processMessageWithArgs(f,t,s);break;case 4:i.centroid=e.processMessageWithArgs(_,t,s);break;default:e.skip()}return i}function w(e){const t=[1,1,1,1];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function v(e){const t=[0,0,0,0];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function S(e){const t={originPosition:p(0)};for(;e.next();)switch(e.tag()){case 1:t.originPosition=p(e.getEnum());break;case 2:t.scale=e.processMessage(w);break;case 3:t.translate=e.processMessage(v);break;default:e.skip()}return t}function C(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.shapeAreaFieldName=e.getString();break;case 2:t.shapeLengthFieldName=e.getString();break;case 3:t.units=e.getString();break;default:e.skip()}return t}function T(e,t){const s=t.createSpatialReference();for(;e.next();)switch(e.tag()){case 1:s.wkid=e.getUInt32();break;case 5:s.wkt=e.getString();break;case 2:s.latestWkid=e.getUInt32();break;case 3:s.vcsWkid=e.getUInt32();break;case 4:s.latestVcsWkid=e.getUInt32();break;default:e.skip()}return s}function F(e,t){const s=t.createFeatureResult();s.geometryType=g(t,0);let r=!1;for(;e.next();)switch(e.tag()){case 1:s.objectIdFieldName=e.getString();break;case 3:s.globalIdFieldName=e.getString();break;case 4:s.geohashFieldName=e.getString();break;case 5:s.geometryProperties=e.processMessage(C);break;case 7:s.geometryType=g(t,e.getEnum());break;case 8:s.spatialReference=e.processMessageWithArgs(T,t);break;case 10:s.hasZ=e.getBool();break;case 11:s.hasM=e.getBool();break;case 12:s.transform=e.processMessage(S);break;case 9:{const t=e.getBool();s.exceededTransferLimit=t;break}case 13:t.addField(s,e.processMessage(I));break;case 15:r||(t.prepareFeatures(s),r=!0),t.addFeature(s,e.processMessageWithArgs(b,t,s,s.fields));break;case 2:s.uniqueIdField=e.processMessage(x);break;default:e.skip()}return t.finishFeatureResult(s),s}function M(e,t){const s={};let r=null;for(;e.next();)switch(e.tag()){case 4:r=e.processMessageWithArgs(m);break;case 1:s.featureResult=e.processMessageWithArgs(F,t);break;default:e.skip()}return(0,i.pC)(r)&&s.featureResult&&t.addQueryGeometry(s,r),s}function k(e,t){try{const s=2,r=new n.Z(new Uint8Array(e),new DataView(e)),i={};for(;r.next();)r.tag()===s?i.queryResult=r.processMessageWithArgs(M,t):r.skip();return i}catch(e){throw new r.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}}},78760:(e,t,s)=>{s.d(t,{A:()=>h,J:()=>c});var r=s(67900),i=s(8744),n=s(70272),a=s(44876),o=s(5428);const h=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class c{constructor(e){this.options=e,this.geometryTypes=h,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new a.Z}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e||!e.features||!e.hasZ||!this.options.sourceSpatialReference||!e.spatialReference||(0,i.fS)(e.spatialReference,this.options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,r._R)(this.options.sourceSpatialReference)/(0,r._R)(e.spatialReference);if(1!==t)for(const s of e.features){if(!(0,n.S6)(s))continue;const e=s.geometry.coords;for(let s=2;s<e.length;s+=3)e[s]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new n.ZP}createSpatialReference(){return{wkid:0}}createGeometry(){return new o.Z}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new o.Z}}},45178:(e,t,s)=>{s.d(t,{C:()=>i});var r=s(77863);function i(e,t){const s=(0,r.K9)(e,t),i=s.queryResult.featureResult,n=s.queryResult.queryGeometry,a=s.queryResult.queryGeometryType;if(i&&i.features&&i.features.length&&i.objectIdFieldName){const e=i.objectIdFieldName;for(const t of i.features)t.attributes&&(t.objectId=t.attributes[e])}return i&&(i.queryGeometry=n,i.queryGeometryType=a),i}},34599:(e,t,s)=>{s.r(t),s.d(t,{executeQuery:()=>p,executeQueryForCount:()=>m,executeQueryForExtent:()=>y,executeQueryForIds:()=>f,executeQueryPBF:()=>g,executeQueryPBFBuffer:()=>_,queryToQueryStringParameters:()=>d,runQuery:()=>I});var r=s(3172),i=s(70586),n=s(17452),a=s(33955),o=s(38581),h=s(45178),c=s(28694),u=s(99306);const l="Layer does not support extent calculation.";function d(e,t){const s=e.geometry,r=e.toJSON(),n=r,o=e.outSpatialReference;let h,c;if((0,i.pC)(s)){if(h=s.spatialReference,c=s.spatialReference.wkid||JSON.stringify(s.spatialReference),n.geometryType=(0,a.Ji)(s),"extent"===s.type)n.geometry=`${s.xmin},${s.ymin},${s.xmax},${s.ymax}`;else if("point"===s.type)n.geometry=`${s.x},${s.y}`;else{const e=s.toJSON();delete e.spatialReference,n.geometry=JSON.stringify(e)}n.inSR=c}if(h||(h=o),r.groupByFieldsForStatistics&&(n.groupByFieldsForStatistics=r.groupByFieldsForStatistics.join(",")),r.objectIds&&(n.objectIds=r.objectIds.join(",")),r.orderByFields&&(n.orderByFields=r.orderByFields.join(",")),!r.outFields||!r.returnDistinctValues&&(null!=t&&t.returnCountOnly||null!=t&&t.returnExtentOnly||null!=t&&t.returnIdsOnly)?delete n.outFields:-1!==r.outFields.indexOf("*")?n.outFields="*":n.outFields=r.outFields.join(","),r.outSR?n.outSR=r.outSR.wkid||JSON.stringify(r.outSR):s&&(r.returnGeometry||r.returnCentroid)&&(n.outSR=n.inSR),r.returnGeometry&&delete r.returnGeometry,r.outStatistics&&(n.outStatistics=JSON.stringify(r.outStatistics)),r.pixelSize&&(n.pixelSize=JSON.stringify(r.pixelSize)),r.quantizationParameters&&((0,i.pC)(h)&&(0,i.pC)(e.quantizationParameters)&&(0,i.pC)(e.quantizationParameters.extent)&&h.equals(e.quantizationParameters.extent.spatialReference)&&delete r.quantizationParameters.extent.spatialReference,n.quantizationParameters=JSON.stringify(r.quantizationParameters)),r.parameterValues&&(n.parameterValues=JSON.stringify(r.parameterValues)),r.rangeValues&&(n.rangeValues=JSON.stringify(r.rangeValues)),r.dynamicDataSource&&(n.layer=JSON.stringify({source:r.dynamicDataSource}),delete r.dynamicDataSource),r.timeExtent){const e=r.timeExtent,{start:t,end:s}=e;null==t&&null==s||(n.time=t===s?t:`${null==t?"null":t},${null==s?"null":s}`),delete r.timeExtent}return n}async function p(e,t,s,r){const n=(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?{data:{features:[]}}:await I(e,t,"json",r);return(0,c.p)(t,s,n.data),n}async function g(e,t,s,r){if((0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty)return Promise.resolve({data:s.createFeatureResult()});const n=await _(e,t,r),a=n;return a.data=(0,h.C)(n.data,s),a}function _(e,t,s){return I(e,t,"pbf",s)}function f(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):I(e,t,"json",s,{returnIdsOnly:!0})}function m(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):I(e,t,"json",s,{returnIdsOnly:!0,returnCountOnly:!0})}function y(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):I(e,t,"json",s,{returnExtentOnly:!0,returnCountOnly:!0}).then((e=>{const t=e.data;if(t.hasOwnProperty("extent"))return e;if(t.features)throw new Error(l);if(t.hasOwnProperty("count"))throw new Error(l);return e}))}function I(e,t,s,a={},h={}){const c="string"==typeof e?(0,n.mN)(e):e,l=t.geometry?[t.geometry]:[];return a.responseType="pbf"===s?"array-buffer":"json",(0,o.aX)(l,null,a).then((e=>{const o=e&&e[0];(0,i.pC)(o)&&((t=t.clone()).geometry=o);const l=(0,u.A)({...c.query,f:s,...h,...d(t,h)});return(0,r.default)((0,n.v_)(c.path,"query"),{...a,query:{...l,...a.query}})}))}},28694:(e,t,s)=>{s.d(t,{p:()=>n});var r=s(70586),i=s(69285);function n(e,t,s){if(!s||!s.features||!s.hasZ)return;const n=(0,i.k)(s.geometryType,t,e.outSpatialReference);if(!(0,r.Wi)(n))for(const e of s.features)n(e.geometry)}},99306:(e,t,s)=>{function r(e){const t={};for(const s in e){if("declaredClass"===s)continue;const i=e[s];if(null!=i&&"function"!=typeof i)if(Array.isArray(i)){t[s]=[];for(let e=0;e<i.length;e++)t[s][e]=r(i[e])}else"object"==typeof i?i.toJSON&&(t[s]=JSON.stringify(i)):t[s]=i}return t}s.d(t,{A:()=>r})},61027:(e,t,s)=>{s.d(t,{_I:()=>r,xp:()=>a,PX:()=>n,QS:()=>l,KS:()=>c,jL:()=>h,vs:()=>o,nE:()=>u});const r=8388607,i=8388608,n=0,a=1,o=e=>(e&i)>>>23,h=e=>e&r,c=e=>o(e)===a?254:255;function u(e){return o(e)===a}function l(e,t){return((t?i:0)|e)>>>0}},29996:(e,t,s)=>{s.d(t,{ws:()=>T,xV:()=>F,UK:()=>k,$_:()=>S,nU:()=>M,hj:()=>C});var r=s(20102),i=s(92604),n=(s(22021),s(37720),s(66039)),a=s(71143);class o{constructor(){this.color=[0,0,0,0],this.haloColor=[0,0,0,0],this.haloSize=0,this.size=12,this.angle=0,this.offsetX=0,this.offsetY=0,this.hAnchor=0,this.vAnchor=0}acquire(e,t,s,r,i,n,a,o,h){this.color=e,this.haloColor=t,this.haloSize=s,this.size=r,this.angle=i,this.offsetX=n,this.offsetY=a,this.hAnchor=o,this.vAnchor=h}release(){this.color[0]=this.color[1]=this.color[2]=this.color[3]=0,this.haloColor[0]=this.haloColor[1]=this.haloColor[2]=this.haloColor[3]=0,this.haloSize=0,this.size=0,this.angle=0,this.offsetX=0,this.offsetY=0,this.hAnchor=0,this.vAnchor=0}}o.pool=new a.Z(o),s(75656);const h=i.Z.getLogger("esri.views.2d.engine.webgl.Utils"),c="geometry",u=[{name:c,strideInBytes:32,divisor:0}],l=[{name:c,strideInBytes:20,divisor:0}],d=[{name:c,strideInBytes:12,divisor:0}],p=[{name:c,strideInBytes:40,divisor:0}],g=[{name:c,strideInBytes:36,divisor:0}],_=[{name:c,strideInBytes:36,divisor:0}];function f(e){const t={};for(const s of e)t[s.name]=s.strideInBytes;return t}const m=f([{name:c,strideInBytes:36,divisor:0}]),y=f(u),I=f(l),x=f(d),b=f(p),w=f(g),v=f(_);function S(e,{fill:t}){switch(e){case n.LW.MARKER:return m;case n.LW.FILL:return"dot-density"===t?x:"simple"===t?I:y;case n.LW.LINE:return b;case n.LW.TEXT:return w;case n.LW.LABEL:return v}}function C(e){return"number"==typeof e}function T(e){switch(e){case"butt":return 0;case"round":return 1;case"square":return 2;default:return h.error(new r.Z("mapview-invalid-type",`Cap type ${e} is not a valid option. Defaulting to round`)),1}}function F(e){switch(e){case"miter":return 2;case"bevel":return 0;case"round":return 1;default:return h.error(new r.Z("mapview-invalid-type",`Join type ${e} is not a valid option. Defaulting to round`)),1}}function M(e){switch(e){case"opacity":return n.pc.OPACITY;case"color":return n.pc.COLOR;case"rotation":return n.pc.ROTATION;case"size":return n.pc.SIZE;default:return h.error(`Cannot interpret unknown vv: ${e}`),null}}function k(e){switch(e){case 5121:return Uint8Array;case 32819:return Uint16Array;case 5126:return Float32Array;default:return void h.error(new r.Z("webgl-utils",`Unable to handle type ${e}`))}}new Map},37720:(e,t,s)=>{s.d(t,{t2:()=>i,aH:()=>n});var r=s(12142);function i(e){if(!e)return 0;const{r:t,g:s,b:i,a:n}=e;return(0,r.Jz)(t*n,s*n,i*n,255*n)}function n(e){if(!e)return 0;const[t,s,i,n]=e;return(0,r.Jz)(t*(n/255),s*(n/255),i*(n/255),n)}},16534:(e,t,s)=>{s.d(t,{xl:()=>u,aK:()=>l,eF:()=>c,Uh:()=>I,_6:()=>S,Tz:()=>b,CQ:()=>x,oK:()=>w,e0:()=>v,SD:()=>C,XJ:()=>f,Ex:()=>o,uG:()=>p,xm:()=>a,m4:()=>d,MI:()=>y,AI:()=>r,Ip:()=>m,ru:()=>i,fL:()=>_,Iw:()=>h,tQ:()=>g,I_:()=>n});const r=1e-30,i=4294967295,n=512,a=29,o=24,h=8,c={metrics:{width:15,height:17,left:0,top:-7,advance:14}},u=1,l=2,d=2,p=1,g=1.05,_=2,f=8,m=500,y=10,I=2,x=0,b=1,w=4,v=8,S=4,C=1},66039:(e,t,s)=>{var r,i,n,a,o,h,c;s.d(t,{pc:()=>a,LW:()=>r,X:()=>o,mf:()=>h}),function(e){e[e.FILL=0]="FILL",e[e.LINE=1]="LINE",e[e.MARKER=2]="MARKER",e[e.TEXT=3]="TEXT",e[e.LABEL=4]="LABEL"}(r||(r={})),function(e){e[e.SUCCEEDED=0]="SUCCEEDED",e[e.FAILED_OUT_OF_MEMORY=1]="FAILED_OUT_OF_MEMORY"}(i||(i={})),function(e){e[e.NONE=0]="NONE",e[e.MAP=1]="MAP",e[e.LABEL=2]="LABEL",e[e.LABEL_ALPHA=4]="LABEL_ALPHA",e[e.HITTEST=8]="HITTEST",e[e.HIGHLIGHT=16]="HIGHLIGHT",e[e.CLIP=32]="CLIP",e[e.DEBUG=64]="DEBUG",e[e.NUM_DRAW_PHASES=9]="NUM_DRAW_PHASES"}(n||(n={})),function(e){e[e.SIZE=0]="SIZE",e[e.COLOR=1]="COLOR",e[e.OPACITY=2]="OPACITY",e[e.ROTATION=3]="ROTATION"}(a||(a={})),function(e){e[e.NONE=0]="NONE",e[e.OPACITY=1]="OPACITY",e[e.COLOR=2]="COLOR",e[e.ROTATION=4]="ROTATION",e[e.SIZE_MINMAX_VALUE=8]="SIZE_MINMAX_VALUE",e[e.SIZE_SCALE_STOPS=16]="SIZE_SCALE_STOPS",e[e.SIZE_FIELD_STOPS=32]="SIZE_FIELD_STOPS",e[e.SIZE_UNIT_VALUE=64]="SIZE_UNIT_VALUE"}(o||(o={})),function(e){e[e.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE",e[e.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE",e[e.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE",e[e.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"}(h||(h={})),function(e){e[e.SPRITE=0]="SPRITE",e[e.GLYPH=1]="GLYPH"}(c||(c={}))},12142:(e,t,s)=>{s.d(t,{UJ:()=>i,Jz:()=>n});const r=new Float32Array(1);function i(e,t){return 65535&e|t<<16}function n(e,t,s,r){return 255&e|(255&t)<<8|(255&s)<<16|r<<24}new Uint32Array(r.buffer)},40660:(e,t,s)=>{s.d(t,{a:()=>h});var r=s(20102),i=s(92604),n=s(66039),a=s(29996);const o=i.Z.getLogger("esri.views.2d.engine.webgl");function h(e){return(0,a.hj)(e.minDataValue)&&(0,a.hj)(e.maxDataValue)&&null!=e.minSize&&null!=e.maxSize?n.X.SIZE_MINMAX_VALUE:(e.expression&&"view.scale"===e.expression||e.valueExpression&&"$view.scale"===e.valueExpression)&&Array.isArray(e.stops)?n.X.SIZE_SCALE_STOPS:(null!=e.field||e.expression&&"view.scale"!==e.expression||e.valueExpression&&"$view.scale"!==e.valueExpression)&&(Array.isArray(e.stops)||"levels"in e&&e.levels)?n.X.SIZE_FIELD_STOPS:(null!=e.field||e.expression&&"view.scale"!==e.expression||e.valueExpression&&"$view.scale"!==e.valueExpression)&&null!=e.valueUnit?n.X.SIZE_UNIT_VALUE:(o.error(new r.Z("mapview-bad-type","Found invalid size VisualVariable",e)),n.X.NONE)}},74259:(e,t,s)=>{s.d(t,{p:()=>g,k:()=>p});var r=s(8557),i=s(32448),n=(s(80442),s(70586)),a=s(96794),o=s(60437),h=s(59999),c=s(61800);function u(e,t){return e<<16|t}function l(e){return(4294901760&e)>>>16}function d(e){return 65535&e}const p={getObjectId:e=>e.getObjectId(),getAttributes:e=>e.readAttributes(),getAttribute:(e,t)=>e.readAttribute(t),cloneWithGeometry:(e,t)=>e,getGeometry:e=>e.readHydratedGeometry(),getCentroid:(e,t)=>e.readCentroid()};class g extends h.J{constructor(e,t,s){super(e,t),this.featureAdapter=p,this.events=new i.Z,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new r.Z(50),this._index=(0,a.r)(9,(e=>({minX:this._storage.getXMin(e),minY:this._storage.getYMin(e),maxX:this._storage.getXMax(e),maxY:this._storage.getYMax(e)}))),this._storage=t,this.mode=s}get storage(){return this._storage}get storeStatistics(){let e=0,t=0,s=0;return this.forEach((r=>{const i=r.readGeometry();i&&(t+=i.isPoint?1:i.lengths.reduce(((e,t)=>e+t),0),s+=i.isPoint?1:i.lengths.length,e+=1)})),{featureCount:e,vertexCount:t,ringCount:s}}hasInstance(e){return this._featureSetsByInstance.has(e)}onTileData(e,t){if((0,n.Wi)(t.addOrUpdate))return t;if(t.addOrUpdate.attachStorage(this._storage),"snapshot"===this.mode){const s=t.addOrUpdate.getCursor();for(;s.next();){const t=s.getDisplayId();this.setComputedAttributes(this._storage,s,t,e.scale)}return t}this._featureSetsByInstance.set(t.addOrUpdate.instance,t.addOrUpdate);const s=t.addOrUpdate.getCursor();for(;s.next();)this._insertFeature(s,e.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),t}search(e){this._rebuildIndex();const t=e.id,s=this._indexSearchCache.find((e=>e.tileId===t));if((0,n.pC)(s))return s.readers;const r=new Map,i=this._searchIndex(e.bounds),a=[];for(const e of i){const t=this._storage.getInstanceId(e),s=l(t),i=d(t);r.has(s)||r.set(s,[]),r.get(s).push(i)}return r.forEach(((e,t)=>{const s=this._featureSetsByInstance.get(t);a.push(c.t.from(s,e))})),this._indexSearchCache.enqueue({tileId:t,readers:a}),a}insert(e){const t=e.getCursor(),s=this._storage;for(;t.next();){var r;const e=u(t.instance,t.getIndex()),i=t.getObjectId(),n=null!=(r=this._objectIdToDisplayId.get(i))?r:this._storage.createDisplayId();t.setDisplayId(n),s.setInstanceId(n,e),this._objectIdToDisplayId.set(i,n)}this._featureSetsByInstance.set(e.instance,e),this._spatialIndexInvalid=!0}remove(e){const t=this._objectIdToDisplayId.get(e);if(!t)return;const s=this._storage.getInstanceId(t),r=d(s),i=l(s),n=this._featureSetsByInstance.get(i);this._objectIdToDisplayId.delete(e),this._storage.releaseDisplayId(t),n.removeAtIndex(r),n.isEmpty&&this._featureSetsByInstance.delete(i),this._spatialIndexInvalid=!0}forEach(e){this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t),r=this._lookupFeature(s);e(r)}))}forEachUnsafe(e){this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t),r=l(s),i=d(s),n=this._getFeatureSet(r);n.setIndex(i),e(n)}))}forEachInBounds(e,t){const s=this._searchIndex(e);for(const e of s){const s=this.lookupFeatureByDisplayId(e,this._storage);t((0,n.Wg)(s))}}forEachBounds(e,t,s){this._rebuildIndex();const r=[0,0,0,0];for(const i of e){if(!i.readGeometry())continue;const e=i.getDisplayId();r[0]=this._storage.getXMin(e),r[1]=this._storage.getYMin(e),r[2]=this._storage.getXMax(e),r[3]=this._storage.getYMax(e),t((0,o.JR)(s,r))}}sweepFeatures(e,t,s){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach(((r,i)=>{e.has(r)||(t.releaseDisplayId(r),s&&s.unsetAttributeData(r),this._objectIdToDisplayId.delete(i))})),this.events.emit("changed")}sweepFeatureSets(e){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach(((t,s)=>{e.has(s)||this._featureSetsByInstance.delete(s)}))}lookupObjectId(e,t){const s=this.lookupFeatureByDisplayId(e,t);return(0,n.Wi)(s)?null:s.getObjectId()}lookupDisplayId(e){return this._objectIdToDisplayId.get(e)}lookupFeatureByDisplayId(e,t){const s=t.getInstanceId(e);return this._lookupFeature(s)}lookupByDisplayIdUnsafe(e){const t=this._storage.getInstanceId(e),s=l(t),r=d(t),i=this._getFeatureSet(s);return i?(i.setIndex(r),i):null}_insertFeature(e,t){const s=this._storage,r=e.getObjectId(),i=u(e.instance,e.getIndex());s.getInstanceId(e.getDisplayId());let n=this._objectIdToDisplayId.get(r);n||(n=s.createDisplayId(),this._objectIdToDisplayId.set(r,n),this._spatialIndexInvalid=!0),e.setDisplayId(n),s.setInstanceId(n,i),this.setComputedAttributes(s,e,n,t)}_searchIndex(e){this._rebuildIndex();const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}_rebuildIndex(){if(!this._spatialIndexInvalid)return;const e=[];"snapshot"===this.mode?this._featureSetsByInstance.forEach((t=>{const s=t.getCursor();for(;s.next();){const t=s.getDisplayId();this._storage.setBounds(t,s)&&e.push(t)}})):this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t);this._storage.setBounds(t,this._lookupFeature(s))&&e.push(t)})),this._index.clear(),this._index.load(e),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(e){const t=l(e),s=d(e),r=this._getFeatureSet(t);if(!r)return null;const i=r.getCursor();return i.setIndex(s),i}_getFeatureSet(e){return this._featureSetsByInstance.get(e)}}},97783:(e,t,s)=>{s.r(t),s.d(t,{default:()=>wt,getInstances:()=>xt});var r=s(43697),i=s(3920),n=s(80442),a=s(5600),o=(s(67676),s(75215),s(52011)),h=s(11145),c=s(70586),u=s(95330),l=s(43050),d=s(98732),p=s(7673),g=s(99514),_=s(61027),f=s(74259),m=s(66677),y=s(3172),I=s(20102),x=s(92604),b=s(80903),w=s(82397),v=s(16467),S=s(34599),C=s(70272),T=s(87554);class F extends T.s{constructor(e,t,s){super(e),this._featureIndex=-1,this._dateFields=new Set,this._geometryType=s,this._features=t}static fromFeatures(e,t,s){const r=(0,d.Yn)([],e,t,!1,!1,s);for(let t=0;t<r.length;t++)r[t].displayId=e[t].displayId;return F.fromOptimizedFeatures(r,t)}static fromFeatureSet(e,t){const s=(0,d.h_)(e,t);return F.fromOptimizedFeatureSet(s)}static fromOptimizedFeatureSet(e){const{features:t,geometryType:s}=e,r=F.fromOptimizedFeatures(t,s);r._exceededTransferLimit=e.exceededTransferLimit,r._transform=e.transform;for(const t of e.fields)"esriFieldTypeDate"===t.type&&r._dateFields.add(t.name);return r}static fromOptimizedFeatures(e,t,s){const r=T.s.createInstance(),i=new F(r,e,t);return i._transform=s,i}get _current(){return this._features[this._featureIndex]}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}removeIds(e){const t=new Set(e);this._features=this._features.filter((e=>!t.has(e.objectId)))}append(e){for(const t of e)this._features.push(t)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}getGroupId(){return this._current.groupId}setGroupId(e){this._current.groupId=e}copy(){const e=new F(this.instance,this._features,this.geometryType);return this.copyInto(e),e}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readLegacyFeature(){return(0,d.EI)(this._current,this.geometryType,this.hasZ,this.hasM)}readOptimizedFeature(){return this._current}readLegacyPointGeometry(){return this.readGeometry()?{x:this.getX(),y:this.getY()}:null}readLegacyGeometry(){const e=this.readGeometry();return(0,d.di)(e,this.geometryType,this.hasZ,this.hasM)}readLegacyCentroid(){const e=this.readCentroid();return(0,c.Wi)(e)?null:{x:e.coords[0]*this._sx+this._tx,y:e.coords[1]*this._sy+this._ty}}readGeometryArea(){return(0,C.S6)(this._current)?(0,d.lz)(this._current.geometry,2):0}readUnquantizedGeometry(){const e=this.readGeometry();if("esriGeometryPoint"===this.geometryType||!e)return e;const t=e.clone();return function({coords:e,lengths:t}){let s=0;for(const r of t){for(let t=1;t<r;t++)e[2*(s+t)]+=e[2*(s+t)-2],e[2*(s+t)+1]+=e[2*(s+t)-1];s+=r}}(t),t}readHydratedGeometry(){const e=this._current.geometry;if((0,c.Wi)(e))return null;const t=e.clone();return(0,c.pC)(this._transform)&&(0,d.$g)(t,t,this.hasZ,this.hasM,this._transform),t}getXHydrated(){if(!(0,C.S6)(this._current))return 0;const e=this._current.geometry.coords[0],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:e*t.scale[0]+t.translate[0]}getYHydrated(){if(!(0,C.S6)(this._current))return 0;const e=this._current.geometry.coords[1],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:t.translate[1]-e*t.scale[1]}getX(){return(0,C.S6)(this._current)?this._current.geometry.coords[0]*this._sx+this._tx:0}getY(){return(0,C.S6)(this._current)?this._current.geometry.coords[1]*this._sy+this._ty:0}readGeometry(){if(!(0,C.S6)(this._current))return null;const e=this._current.geometry.clone();if(e.isPoint)return e.coords[0]=e.coords[0]*this._sx+this._tx,e.coords[1]=e.coords[1]*this._sy+this._ty,e;let t=0;for(const s of e.lengths)e.coords[2*t]=e.coords[2*t]*this._sx+this._tx,e.coords[2*t+1]=e.coords[2*t+1]*this._sy+this._ty,t+=s;return e}readCentroid(){if(!(0,C.S6)(this._current))return null;if(!this._current.centroid){const e=this._computeCentroid();if(!e)return null;e.coords[0]=(e.coords[0]-this._tx)/this._sx,e.coords[1]=(e.coords[1]-this._ty)/this._sy,this._current.centroid=e}const e=this._current.centroid.clone();return e.coords[0]=e.coords[0]*this._sx+this._tx,e.coords[1]=e.coords[1]*this._sx+this._ty,e}_readAttribute(e,t){const s=this._current.attributes[e];if(void 0!==s)return null!=s&&t&&this._dateFields.has(e)?new Date(s):s;const r=this.readAttributes(),i=e.toLocaleLowerCase().trim();for(const e in r)if(e.toLocaleLowerCase().trim()===i){const s=this._current.attributes[e];return null!=s&&t&&this._dateFields.has(e)?new Date(s):s}}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}}var M=s(45091),k=s(5428),A=s(77863);const E=268435455;class R{constructor(){this.fieldMap=new Map,this.fields=[],this.hasFeatures=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}hasField(e){return this.fieldMap.has(e)}isDateField(e){var t;return null==(t=this.fieldMap.get(e))?void 0:t.isDate}getFieldIndex(e){var t;return null==(t=this.fieldMap.get(e))?void 0:t.index}}function O(e){const t=e.getLength(),s=e.pos()+t,r={name:"",isDate:!1};for(;e.pos()<s&&e.next();)switch(e.tag()){case 1:r.name=e.getString();break;case 2:"esriFieldTypeDate"===(0,A.O7)(e.getEnum())&&(r.isDate=!0);break;default:e.skip()}return r}function L(e){return e.toLowerCase().trim()}function P(e,t,s=!1){const r=e.pos(),i=new R;let n=0,a=0,o=null,h=null,c=null,u=!1;for(;e.next();)switch(e.tag()){case 1:o=e.getString();break;case 3:h=e.getString();break;case 12:c=e.processMessage(A.G$);break;case 9:if(i.exceededTransferLimit=e.getBool(),i.exceededTransferLimit){i.offsets.geometry=s?new Float64Array(8e3):new Int32Array(8e3),i.centroid=s?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<i.centroid.length;e++)i.centroid[e]=E}break;case 13:{const t=O(e),s=t.name,r=L(t.name),a={fieldName:s,index:n++,isDate:t.isDate};i.fields.push(a),i.fieldMap.set(t.name,a),i.fieldMap.set(r,a);break}case 15:{const r=e.getLength(),o=e.pos()+r;if(!i.exceededTransferLimit){const e=i.offsets.geometry,t=i.centroid;e.push(0),t.push(E),t.push(E)}!u&&i.exceededTransferLimit&&(u=!0,i.offsets.attributes=s?new Float64Array(8e3*n):new Uint32Array(8e3*n));let h=a*n;for(;e.pos()<o&&e.next();)switch(e.tag()){case 1:{u?i.offsets.attributes[h++]=e.pos():i.offsets.attributes.push(e.pos());const t=e.getLength();e.skipLen(t);break}case 2:if(t){const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&e.next();)switch(e.tag()){case 3:{e.getUInt32();const t=e.getSInt64(),s=e.getSInt64();i.centroid[2*a]=t,i.centroid[2*a+1]=s;break}default:e.skip()}}else{i.offsets.geometry[a]=e.pos();const t=e.getLength();i.vertexCount+=t,e.skipLen(t)}break;case 4:{const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&e.next();)switch(e.tag()){case 3:{e.getUInt32();const t=e.getSInt64(),s=e.getSInt64();i.centroid[2*a]=t,i.centroid[2*a+1]=s;break}default:e.skip()}break}default:e.skip()}a++,i.hasFeatures=!0;break}default:e.skip()}const l=o||h;if(!l)throw new I.Z("FeatureSet has no objectId or globalId field name");return i.featureCount=a,i.fieldCount=n,i.objectIdFieldIndex=i.getFieldIndex(l),i.transform=c,i.displayIds=new Uint32Array(i.featureCount),i.groupIds=new Uint16Array(i.featureCount),e.move(r),i}const q=x.Z.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF"),D=268435455,U=128e3,N={small:{delta:new Int32Array(128),decoded:new Int32Array(128)},large:{delta:new Int32Array(U),decoded:new Int32Array(U)}};function z(e){return e<=N.small.delta.length?N.small:(e<=N.large.delta.length||(N.large.delta=new Int32Array(Math.round(1.25*e)),N.large.decoded=new Int32Array(Math.round(1.25*e))),N.large)}function B(e){for(;e.next();){if(1===e.tag())return e.getMessage();e.skip()}return null}function G(e,t,s,r,i,n){return.5*Math.abs(e*r+s*n+i*t-e*n-s*t-i*r)}function Z(e,t,s,r){return 0==e*r-s*t&&e*s+t*r>0}class j extends T.s{constructor(e,t,s,r){super(e),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._geometryType=r,this._reader=t,this._header=s,this._hasNext=s.hasFeatures,this._isPoints="esriGeometryPoint"===r}static fromBuffer(e,t,s=!1){const r=function(e){try{const t=2,s=new M.Z(new Uint8Array(e),new DataView(e));for(;s.next();){if(s.tag()===t)return B(s.getMessage());s.skip()}}catch(e){const t=new I.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e});q.error(t)}return null}(e),i=P(r,"esriGeometryPoint"===t,s),n=T.s.createInstance();return new j(n,r,i,t)}get geometryType(){return this._geometryType}get size(){return this._header.featureCount}get hasZ(){return!1}get hasM(){return!1}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this.size}getQuantizationTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";return this._header.fields.forEach((({index:t})=>{e+=this._readAttributeAtIndex(t)+"."})),e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}getGroupId(){return this._header.groupIds[this._featureIndex]}setGroupId(e){this._header.groupIds[this._featureIndex]=e}readLegacyFeature(){if(void 0===this._cache.legacyFeature){var e;const t=this.readCentroid(),s={attributes:this.readAttributes(),geometry:this._isPoints?this.readLegacyPointGeometry():this.readLegacyGeometry(),centroid:null!=(e=t&&{x:t.coords[0],y:t.coords[1]})?e:null};return this._cache.legacyFeature=s,s}return this._cache.legacyFeature}readOptimizedFeature(){if(void 0===this._cache.optFeature){const e=new C.ZP(this.readGeometry(),this.readAttributes(),this.readCentroid());return e.objectId=this.getObjectId(),e.displayId=this.getDisplayId(),this._cache.optFeature=e,e}return this._cache.optFeature}getXHydrated(){const e=this._header.centroid[2*this._featureIndex],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:e*t.scale[0]+t.translate[0]}getYHydrated(){const e=this._header.centroid[2*this._featureIndex+1],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:t.translate[1]-e*t.scale[1]}getX(){return this._header.centroid[2*this._featureIndex]*this._sx+this._tx}getY(){return this._header.centroid[2*this._featureIndex+1]*this._sy+this._ty}readLegacyPointGeometry(){return{x:this.getX(),y:this.getY()}}readLegacyGeometry(e){const t=this.readGeometry(e);return(0,d.di)(t,this.geometryType,!1,!1)}readLegacyCentroid(){const e=this.readCentroid();if(!e)return null;const[t,s]=e.coords;return{x:t,y:s}}readGeometryArea(){return this._cache.area||this.readGeometry(!0),this._cache.area}readUnquantizedGeometry(e=!1){if(void 0===this._cache.unquantGeometry){const t=this.readGeometry(e);if(!t)return this._cache.unquantGeometry=null,null;const s=z(t.coords.length).decoded,r=t.clone(s),i=r.coords;let n=0;for(const e of r.lengths){for(let t=1;t<e;t++){const e=2*(n+t),s=2*(n+t-1);i[e]+=i[s],i[e+1]+=i[s+1]}n+=e}return this._cache.unquantGeometry=r,r}return this._cache.unquantGeometry}readHydratedGeometry(){if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===D)return null;const e=this.getXHydrated(),t=this.getYHydrated();return new k.Z([],[e,t])}const e=this.readGeometry();if(!e)return null;const t=e.clone(),s=this.getQuantizationTransform();return(0,c.pC)(s)&&(0,d.$g)(t,t,this.hasZ,this.hasM,s),t}readGeometry(e=!1){if(void 0===this._cache.geometry){let t=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===D)return null;const e=this.getX(),s=this.getY();t=new k.Z([],[e,s])}else{const s=this._header.offsets.geometry[this._featureIndex],r=this._reader;if(0===s)return null;r.move(s);try{t=e?this._parseGeometryForDisplay(r):this._parseGeometry(r)}catch(e){return console.error("Failed to parse geometry!",e),null}}return this._cache.geometry=t,t}return this._cache.geometry}readCentroid(){if(void 0===this._cache.centroid){let e=null;const t=this._header.centroid[2*this._featureIndex]+this._tx,s=this._header.centroid[2*this._featureIndex+1]+this._ty;return t===D?(e=this._computeCentroid(),e&&(this._header.centroid[2*this._featureIndex]=e.coords[0]-this._tx,this._header.centroid[2*this._featureIndex+1]=e.coords[1]-this._ty)):e=new k.Z([],[t,s]),this._cache.centroid=e,e}return this._cache.centroid}copy(){const e=this._reader.clone(),t=new j(this.instance,e,this._header,this.geometryType);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndex<this.size&&!this._getExists(););return this._featureIndex<this.size}_readAttribute(e,t){const s=this._header.hasField(e)?e:function(e){return e.toLowerCase().trim()}(e),r=this._header.getFieldIndex(s);if(null==r)return;const i=this._readAttributeAtIndex(r);return t?null==i?i:this._header.isDateField(s)?new Date(i):i:i}_readAttributes(){const e={};return this._header.fields.forEach((({fieldName:t,index:s})=>{e[t]=this._readAttributeAtIndex(s)})),e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext}_readAttributeAtIndex(e){const t=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;return s.move(t),function(e){const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}(s)}_parseGeometry(e){const t=e.getLength(),s=e.pos()+t,r=[],i=[];for(;e.pos()<s&&e.next();)switch(e.tag()){case 2:{const t=e.getUInt32(),s=e.pos()+t;for(;e.pos()<s;)i.push(e.getUInt32());break}case 3:{const t=e.getUInt32(),s=e.pos()+t;for(r.push(e.getSInt32()+this._tx),r.push(e.getSInt32()+this._ty),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();e.pos()<s;)r.push(e.getSInt32()),r.push(e.getSInt32()),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();break}default:e.skip()}return new k.Z(i,r)}_parseGeometryForDisplay(e){const t=e.getLength(),s=e.pos()+t,r=[],i=[];let n=0,a=0,o=null,h=0;const c="esriGeometryPolygon"===this.geometryType;for(;e.pos()<s&&e.next();)switch(e.tag()){case 2:{const t=e.getUInt32(),s=e.pos()+t;for(;e.pos()<s;){const t=e.getUInt32();r.push(t),n+=t}o=z(2*n).delta;break}case 3:{e.getUInt32();const t=2+(this.hasZ?1:0)+(this.hasM?1:0);for(const s of r)if(a+t*s>o.length)for(let t=0;t<s;t++)e.getSInt32(),e.getSInt32(),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();else if(c){const t=this.getAreaSimplificationThreshold(s,this._header.vertexCount);let r=2,n=1;const c=!1;let u=e.getSInt32(),l=e.getSInt32();o[a++]=u,o[a++]=l,this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();let d=e.getSInt32(),p=e.getSInt32();for(this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();r<s;){let s=e.getSInt32(),i=e.getSInt32();this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();const c=u+d,g=l+p;G(u,l,c,g,c+s,g+i)>=t?(h+=-.5*(c-u)*(g+l),n>1&&Z(o[a-2],o[a-1],d,p)?(o[a-2]+=d,o[a-1]+=p):(o[a++]=d,o[a++]=p,n++),u=c,l=g):(s+=d,i+=p),d=s,p=i,r++}n<3||c?a-=2*n:(h+=-.5*(u+d-u)*(l+p+l),Z(o[a-2],o[a-1],d,p)?(o[a-2]+=d,o[a-1]+=p,i.push(n)):(o[a++]=d,o[a++]=p,i.push(++n)))}else{let t=0,r=e.getSInt32(),n=e.getSInt32();this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32(),o[a++]=r,o[a++]=n,t+=1;for(let i=1;i<s;i++){const s=e.getSInt32(),c=e.getSInt32(),u=r+s,l=n+c;h+=-.5*(u-r)*(l+n),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32(),i>2&&Z(o[a-2],o[a-1],s,c)?(o[a-2]+=s,o[a-1]+=c):(o[a++]=s,o[a++]=c,t+=1),r=u,n=l}i.push(t)}break}default:e.skip()}if(this._cache.area=h,!i.length)return null;if(this._tx||this._ty){let e=0;for(const t of i)o[2*e]+=this._tx,o[2*e+1]+=this._ty,e+=t}return new k.Z(i,o)}}class X{constructor(e){this.service=e}destroy(){}}class W extends X{constructor(e){super(e),this._portsOpen=async function(e){const t=new b.Z;return await t.open(e,{}),t}(e.source).then((e=>this.client=e))}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const s=await this.client.invoke("queryFeatures",e.toJSON(),t);return F.fromFeatureSet(s,this.service.objectIdField)}}class Y extends X{async executeQuery(e,t){const{data:s}=await(0,S.executeQueryPBFBuffer)(this.service.source,e,t),r=!e.quantizationParameters;return j.fromBuffer(s,this.service.geometryType,r)}}class V extends X{async executeQuery(e,t){const{source:s,capabilities:r,spatialReference:i,objectIdField:n,geometryType:a}=this.service;if((0,c.pC)(e.quantizationParameters)&&!r.query.supportsQuantization){const r=e.clone(),a=(0,w.vY)((0,c.Wg)(r.quantizationParameters));r.quantizationParameters=null;const{data:o}=await(0,S.executeQuery)(s,r,i,t),h=(0,d.h_)(o,n);return(0,d.RZ)(a,h),F.fromOptimizedFeatureSet(h)}const{data:o}=await(0,S.executeQuery)(s,e,this.service.spatialReference,t);var h;return"esriGeometryPoint"===a&&(o.features=null==(h=o.features)?void 0:h.filter((e=>{if((0,c.pC)(e.geometry)){const t=e.geometry;return Number.isFinite(t.x)&&Number.isFinite(t.y)}return!0}))),F.fromFeatureSet(o,this.service.objectIdField)}}class Q extends X{async executeQuery(e,t){const{capabilities:s}=this.service;if(e.quantizationParameters&&!s.query.supportsQuantization){const s=e.clone(),r=(0,w.vY)((0,c.Wg)(s.quantizationParameters));s.quantizationParameters=null;const i=await(0,v.WW)(this.service.source,e,t);return(0,d.RZ)(r,i),F.fromOptimizedFeatureSet(i)}const r=await(0,v.WW)(this.service.source,e,t);return F.fromOptimizedFeatureSet(r)}}var H=s(92835),$=s(32448),J=s(22862),K=s(57444),ee=s(8557);class te{constructor(){this.source=!1,this.targets={feature:!1,aggregate:!1},this.storage={filters:!1,data:!1},this.mesh=!1,this.queryFilter=!1,this.why={mesh:[],source:[]}}static create(e){const t=new te;for(const s in e){const r=e[s];if("object"==typeof r)for(const e in r){const i=r[e];t[s][e]=i}t[s]=r}return t}static empty(){return te.create({})}static all(){return te.create({source:!0,targets:{feature:!0,aggregate:!0},storage:{filters:!0,data:!0},mesh:!0})}unset(e){e.source&&(this.source=!1),e.targets.feature&&(this.targets.feature=!1),e.targets.aggregate&&(this.targets.aggregate=!1),e.storage.filters&&(this.storage.filters=!1),e.storage.data&&(this.storage.data=!1),e.mesh&&(this.mesh=!1),e.queryFilter&&(this.queryFilter=!1)}any(){return this.source||this.mesh||this.storage.filters||this.storage.data||this.targets.feature||this.targets.aggregate||this.queryFilter}describe(){let e=0,t="";if(this.mesh){e+=20,t+="-> (20) Mesh needs update\n";for(const e of this.why.mesh)t+=` + ${e}\n`}if(this.source){e+=10,t+="-> (10) The source needs update\n";for(const e of this.why.source)t+=` + ${e}\n`}this.targets.feature&&(e+=5,t+="-> (5) Feature target parameters changed\n"),this.storage.filters&&(e+=5,t+="-> (5) Feature filter parameters changed\n"),this.targets.aggregate&&(e+=4,t+="-> (4) Aggregate target parameters changed\n"),this.storage.data&&(e+=1,t+="-> (1) Texture storage parameters changed");const s=e<5?"Fastest":e<10?"Fast":e<15?"Moderate":e<20?"Slow":"Very Slow";console.debug(`Applying ${s} update of cost ${e}/45 `),console.debug(t)}toJSON(){return{queryFilter:this.queryFilter,source:this.source,targets:this.targets,storage:this.storage,mesh:this.mesh}}}class se{constructor(e){this.requests={done:new Array,stream:new ee.Z(10)},this._edits=null,this._abortController=new AbortController,this._done=!1,this.didSend=!1,this.tile=e}get signal(){return this._abortController.signal}get options(){return{signal:this._abortController.signal}}get empty(){return!this.requests.done.length}get edits(){return this._edits}get done(){return this._done}end(){this._done=!0}clear(){this.requests.done=[]}applyUpdate(e){this.requests.done.forEach((t=>t.message.status.unset(e))),(0,c.pC)(this._edits)&&this._edits.status.unset(e)}add(e){var t;e.message.status=null!=(t=e.message.status)?t:te.empty(),e.message.end&&this.requests.done.forEach((e=>{(0,c.pC)(e.message)&&e.message.end&&(e.message.end=!1)})),this.requests.done.push(e)}edit(e,t){const s=e.getQuantizationTransform(),r=e.geometryType,i=Array.from(e.features()),n=[...t,...i.map((e=>e.objectId))];this.removeIds(n),this._invalidate(),(0,c.Wi)(this._edits)?this._edits={type:"append",addOrUpdate:F.fromOptimizedFeatures(i,r,(0,c.Wg)(s)),id:this.tile.id,status:te.empty(),end:!0}:(this.requests.done.forEach((e=>e.message.end=!1)),(0,c.Wg)(this._edits.addOrUpdate).append(e.features()))}*readers(){for(const{message:e}of this.requests.done)(0,c.pC)(e.addOrUpdate)&&(yield e.addOrUpdate);(0,c.pC)(this._edits)&&(0,c.pC)(this._edits.addOrUpdate)&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=te.empty();(0,c.pC)(this._edits)&&(this._edits.status=te.empty())}removeIds(e){this._invalidate();for(const{message:t}of this.requests.done){const s=t.addOrUpdate;(0,c.pC)(s)&&(s.removeIds(e),s.isEmpty&&(t.addOrUpdate=null))}(0,c.pC)(this._edits)&&(0,c.pC)(this._edits.addOrUpdate)&&this._edits.addOrUpdate.removeIds(e),this.requests.done=this.requests.done.filter((e=>e.message.addOrUpdate||e.message.end))}abort(){this._abortController.abort()}}class re{constructor(e){this.events=new $.Z,this._resolver=(0,u.hh)(),this._didEdit=!1,this._subscriptions=new Map,this._outSR=e.outSR,this._serviceInfo=e.serviceInfo,this._onTileUpdateMessage=e.onMessage}destroy(){}async _onMessage(e){var t;const s=this._subscriptions.get(e.id);if(!s)return;const r={...e,remove:null!=(t=e.remove)?t:[],status:e.status};return this._onTileUpdateMessage(r,s.options)}update(e,t){var s;const r=t.fields.length;t.outFields=function(e,t){const s=new Set;return e&&e.forEach((e=>s.add(e))),t&&t.forEach((e=>s.add(e))),s.has("*")?["*"]:Array.from(s)}(null==(s=this._schema)?void 0:s.outFields,t.outFields),t.outFields=t.outFields.length>=.75*r?["*"]:t.outFields,t.outFields.sort();const i=(0,J.Hg)(this._schema,t);if(!i)return;(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - Source:",i);const a="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",o={returnCentroid:(0,n.Z)("esri-2d-query-centroid-enabled")&&"esriGeometryPolygon"===this._serviceInfo.geometryType,returnGeometry:!0,timeReferenceUnknownClient:"stream"!==this._serviceInfo.type&&this._serviceInfo.timeReferenceUnknownClient,outFields:t.outFields,outSpatialReference:this._outSR,orderByFields:[a],where:t.definitionExpression||"1=1",gdbVersion:t.gdbVersion,historicMoment:t.historicMoment,timeExtent:H.Z.fromJSON(t.timeExtent),customParameters:t.customParameters},h=this._schema&&(0,J.uD)(i,"outFields");this._schema&&(0,J.V7)(i,["timeExtent","definitionExpression","gdbVersion","historicMoment","customParameters"])&&(e.why.mesh.push("Layer filter and/or custom parameters changed"),e.why.source.push("Layer filter and/or custom parameters changed"),e.mesh=!0,e.source=!0,e.queryFilter=!0),h&&(e.why.source.push("Layer required fields changed"),e.source=!0),(0,J.Hg)(o,this._queryInfo)&&(this._queryInfo=o),this._schema=t,this._resolver.resolve()}whenInitialized(){return this._resolver.promise}async applyUpdate(e){if(e.queryFilter||e.source&&this._didEdit)return this.refresh(),void(this._didEdit=!1);this._subscriptions.forEach((t=>t.applyUpdate(e))),await this.resend()}refresh(){for(const e of this._tiles())this.unsubscribe(e),this.subscribe(e)}subscribe(e){const t=new se(e);this._subscriptions.set(e.id,t)}unsubscribe(e){const t=this.get(e.id);(0,c.pC)(t)&&t.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const t=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new K.Z({...this._queryInfo,historicMoment:t,...e})}get(e){return this._subscriptions.has(e)?this._subscriptions.get(e):null}async queryLastEditDate(){throw new Error("Service does not support query type")}async query(e){throw new Error("Service does not support query")}*_tiles(){const e=Array.from(this._subscriptions.values());for(const t of e)yield t.tile}async edit(e,t){const s=Array.from(this._subscriptions.values()),r=s.map((({tile:e})=>e));for(const e of s)e.removeIds(t);if(e.length){const s=r.map((t=>{const s=this.createTileQuery(t);return s.objectIds=e,{tile:t,query:s}})).map((async({tile:e,query:t})=>({tile:e,result:await this.query(t),query:t}))),i=(await(0,u.WW)(s)).map((async({tile:s,result:r})=>{if(!r.hasFeatures&&!t.length&&!e.length)return;const i=this._subscriptions.get(s.key.id);i&&i.edit(r,e)}));await(0,u.as)(i)}this._didEdit=!0}}var ie=s(34084);const ne=x.Z.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource");class ae extends re{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=function(e){const{capabilities:t}=e;return(s=e.source)&&s.capabilities&&s.collection&&s.layerDefinition?new Q(e):function(e){return Array.isArray(e.source)}(e)?new W(e):t.query.supportsFormatPBF&&(0,n.Z)("featurelayer-pbf")?new Y(e):new V(e);var s}(e.serviceInfo),this._queue=new ie.e({concurrency:8,process:async e=>{if((0,u.k_)(e),(0,c.pC)(e.tile)){const t=e.tile.key.id,{signal:s}=e,r=(0,n.Z)("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:s,query:{...r,...this._schema.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema.customParameters})}}),this._patchQueue=new ie.e({concurrency:8,process:async e=>{if((0,u.k_)(e),(0,c.pC)(e.tile)){const t=e.tile.key.id,{signal:s}=e,r=(0,n.Z)("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:s,query:{...r,...this._schema.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema.customParameters})}})}destroy(){super.destroy(),this._adapter.destroy(),this._queue.destroy(),this._patchQueue.destroy()}get updating(){return!!this._queue.length||Array.from(this._subscriptions.values()).some((e=>!e.done))}get maxRecordCountFactor(){const{query:e}=this._serviceInfo.capabilities;return e.supportsMaxRecordCountFactor?4:null}get maxPageSize(){var e;const{query:t}=this._serviceInfo.capabilities;return(null!=(e=t.maxRecordCount)?e:8e3)*(0,c.Pt)(this.maxRecordCountFactor,1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,t){}subscribe(e){super.subscribe(e);const t=this._subscriptions.get(e.id);this._fetchDataTile(e).catch((t=>{(0,u.D_)(t)||ne.error(new I.Z("mapview-query-error","Encountered error when fetching tile",{tile:e,error:t}))})).then((()=>t.end()))}unsubscribe(e){super.unsubscribe(e)}readers(e){return this._subscriptions.get(e).readers()}async query(e){return this._adapter.executeQuery(e,{query:this._schema.customParameters})}async queryLastEditDate(){const e=this._serviceInfo.source,t={...e.query,f:"json"};return(await(0,y.default)(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate}createTileQuery(e,t={}){var s;const r=this.createQuery(t);return r.quantizationParameters=null!=(s=t.quantizationParameters)?s:e.getQuantizationParameters(),r.resultType="tile",r.geometry=e.extent,r.quantizationParameters&&"esriGeometryPolyline"===this._serviceInfo.geometryType&&(r.maxAllowableOffset=e.resolution),r}async _executePatchQuery(e,t,s,r){const i=t.clone();i.outFields=[this._serviceInfo.objectIdField,...s],i.returnCentroid=!1,i.returnGeometry=!1;const n=(0,c.pC)(i.start)?i.start/8e3:0,a=r.signal;return this._patchQueue.push({tile:e,query:i,signal:a,depth:n})}async _resend(e,t){const{query:s,message:r}=e,i=(0,c.pC)(s.outFields)?s.outFields:[],n=this._queryInfo.outFields,a=n.filter((e=>-1===i.indexOf(e)));if((0,c.Wi)(r.addOrUpdate))this._onMessage({...r,type:"append"});else if(a.length)try{const e=this._subscriptions.get(r.id).tile,i=await this._executePatchQuery(e,s,a,t);(0,u.k_)(t),s.outFields=n,r.addOrUpdate.joinAttributes(i),this._onMessage({...r,end:r.end,type:"append"})}catch(e){}else this._onMessage({...r,type:"append"})}async _resendSubscription(e){if(e.empty)return this._onMessage({id:e.tile.id,addOrUpdate:null,end:!1,type:"append"});const t=e.signal;for(const s of e.requests.done)await this._resend(s,{signal:t});return(0,c.pC)(e.edits)?this._onMessage(e.edits):void 0}async resend(){const e=Array.from(this._subscriptions.values());await Promise.all(e.map((e=>this._resendSubscription(e))))}}const oe=(0,n.Z)("esri-mobile"),he={maxDrillLevel:oe?1:4,maxRecordCountFactor:oe?1:3};class ce extends ae{constructor(e){super(e)}async _fetchDataTile(e){const t=this._serviceInfo.capabilities.query.supportsMaxRecordCountFactor,s=this._subscriptions.get(e.key.id),r=s.signal,i=e.getQuantizationParameters();let n=0;const a=async(o,h)=>{const c=this._queryInfo,l=this.createTileQuery(o,{maxRecordCountFactor:t?he.maxRecordCountFactor:void 0,returnExceededLimitFeatures:!1,quantizationParameters:i});n++;try{const t=await this._queue.push({tile:e,query:l,signal:r,depth:h});if(n--,(0,u.k_)(r),!t)return;if(c!==this._queryInfo)return void a(o,h);if(t.exceededTransferLimit&&h<he.maxDrillLevel){for(const e of o.createChildTiles())a(e,h+1);return}const i={id:e.id,addOrUpdate:t,end:0===n,type:"append"};s.add({query:l,message:i}),this._onMessage(i)}catch(t){(0,u.D_)(t)||this._onMessage({id:e.id,addOrUpdate:null,end:!0,type:"append"})}};a(e,0)}}var ue=s(96794),le=s(22021);class de{constructor(e,t,s,r,i=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=s,this._purgeOptions=r,this.store=e,this.objectIdField=t,this.purgeInterval=i,this._useGeneratedIds="__esri_stream_id__"===this.objectIdField}add(e){if(this._useGeneratedIds){const t=this._nextId();e.attributes[this.objectIdField]=t,e.objectId=t}else e.objectId=e.attributes[this.objectIdField];if(this._addOrUpdated.set(e.objectId,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return(0,c.Wi)(this._trackIdLessObservations)&&(this._trackIdLessObservations=new ee.Z(1e5)),void this._trackIdLessObservations.enqueue(e.objectId);const t=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(t)){const e=(0,c.pC)(this._purgeOptions)&&null!=this._purgeOptions.maxObservations?this._purgeOptions.maxObservations:1e3,s=(0,le.uZ)(e,0,1e3);this._trackIdToObservations.set(t,new ee.Z(s))}const s=this._trackIdToObservations.get(t).enqueue(e.objectId);(0,c.pC)(s)&&(this._addOrUpdated.has(s)?this._addOrUpdated.delete(s):this._removed.push(s))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),s=performance.now();s-this._lastPurge>=this.purgeInterval&&(this._purge(s),this._lastPurge=s);const r=[];if((0,c.pC)(t))for(const e of t){const t=this.store.removeById(e);(0,c.pC)(t)&&r.push(t)}if((0,c.pC)(e))for(const t of e)t.attributes.__esri_timestamp__=s,this.store.add(t);(e||r)&&this.store.update(e,r)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach((s=>e[t++]=s)),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;(0,c.pC)(t)&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField)for(const s of this._trackIdToObservations.values())if(t>e.displayCount&&s.size){const e=(0,c.Wg)(s.dequeue());this._removed.push(e),t--}if((0,c.pC)(this._trackIdLessObservations)){let s=t-e.displayCount;for(;s-- >0;){const e=this._trackIdLessObservations.dequeue();(0,c.pC)(e)&&this._removed.push(e)}}}}_purgeByAge(e){var t;if(!e.age||null==(t=this._timeInfo)||!t.startTimeField)return;const s=60*e.age*1e3,r=this._maxAge-s;this.store.forEach((e=>{e.attributes[this._timeInfo.startTimeField]<r&&this._removed.push(e.objectId)}))}_purgeByAgeReceived(e,t){if(!t.ageReceived)return;const s=e-60*t.ageReceived*1e3;this.store.forEach((e=>{e.attributes.__esri_timestamp__<s&&this._removed.push(e.objectId)}))}_purgeTracks(){this._trackIdToObservations.forEach(((e,t)=>{0===e.size&&this._trackIdToObservations.delete(t)}))}}s(66577);var pe=s(17452),ge=(s(37697),s(69285));let _e=class extends($.Z.EventedMixin(i.r)){onFeature(e){this.emit("feature",e)}};_e=(0,r._)([(0,o.j)("esri.layers.graphics.sources.connections.StreamConnection")],_e);const fe=_e,me=x.Z.getLogger("esri.layers.graphics.sources.connections.WebSocketConnection");var ye,Ie;(Ie=ye||(ye={}))[Ie.CONNECTING=0]="CONNECTING",Ie[Ie.OPEN=1]="OPEN",Ie[Ie.CLOSING=2]="CLOSING",Ie[Ie.CLOSED=3]="CLOSED";let xe=class extends fe{constructor(e){super(),this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:r}=e;this._config=e,this._featureZScaler=(0,ge.k)(t,r,s),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){(0,c.pC)(this._websocket)&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if((0,c.Wi)(this._websocket))return"disconnected";switch(this._websocket.readyState){case ye.CONNECTING:case ye.OPEN:return"connected";case ye.CLOSING:case ye.CLOSED:return"disconnected"}}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,s=0){try{if(this.destroyed)return;const t=(0,pe.fl)(e,this._config.customParameters);this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(r){const i=t/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(me.error(new I.Z("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(me.error(new I.Z("websocket-connection",`Failed to connect. Attempting to reconnect in ${i}s`,r)),await(0,u.e4)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),s+1))}}_createWebSocket(e){return new Promise(((t,s)=>{const r=new WebSocket(e);r.onopen=()=>{if(r.onopen=null,this.destroyed)return r.onclose=null,void r.close();r.onclose=e=>this._onClose(e),r.onerror=e=>this._onError(e),r.onmessage=e=>this._onMessage(e),t(r)},r.onclose=e=>{r.onopen=r.onclose=null,s(e)}}))}async _handshake(e=1e4){const t=this._websocket;if((0,c.Wi)(t))return;const s=(0,u.hh)(),r=t.onmessage,{filter:i,outFields:n,spatialReference:a}=this._config;return s.timeout(e),t.onmessage=e=>{var o;let h=null;try{h=JSON.parse(e.data)}catch(e){}h&&"object"==typeof h||(me.error(new I.Z("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),s.reject(),this.destroy()),(null==(o=h.spatialReference)?void 0:o.wkid)!==(null==a?void 0:a.wkid)&&(me.error(new I.Z("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${a.wkid}`,e.data)),s.reject(),this.destroy()),"json"!==h.format&&(me.error(new I.Z("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),s.reject(),this.destroy()),i&&h.filter!==i&&me.error(new I.Z("websocket-connection","Tried to set filter, but server doesn't support it")),n&&h.outFields!==n&&me.error(new I.Z("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=r,s.resolve()},t.send(JSON.stringify({filter:i,outFields:n,format:"json",spatialReference:{wkid:a.wkid}})),s.promise}_onMessage(e){try{const t=JSON.parse(e.data);if("featureResult"!==t.type)throw new I.Z("websocket-connection","Protocol violation - Expected to find message of type 'featureResult'",t);for(const e of t.features)(0,c.pC)(this._featureZScaler)&&this._featureZScaler(e.geometry),this.onFeature(e)}catch(e){return me.error(new I.Z("websocket-connection","Failed to parse message",e)),void this.destroy()}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),me.error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&me.error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,r._)([(0,a.Cb)()],xe.prototype,"connectionStatus",null),(0,r._)([(0,a.Cb)()],xe.prototype,"errorString",void 0),xe=(0,r._)([(0,o.j)("esri.layers.graphics.sources.connections.WebSocketConnection")],xe);var be=s(33955),we=s(82971);const ve=x.Z.getLogger("esri.layers.graphics.sources.connections.GeoEventConnection"),Se={maxQueryDepth:5,maxRecordCountFactor:3};let Ce=class extends xe{constructor(e){super({...Se,...e})}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||ve.warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:s,outFields:r}=this._config;this.destroyed||this._setFilter(s,r)}_onMessage(e){let t;try{t=this._enrich(JSON.parse(e.data)),(0,c.pC)(this._featureZScaler)&&this._featureZScaler(t.geometry)}catch(e){return void ve.error(new I.Z("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},s=(0,y.default)(e.path,{query:t,responseType:"json"}),r=(await s).data;return this._serviceDefinition=r,r}_fetchWebSocketUrl(e,t){const s=e[0],{urls:r,token:i}=s,n=this._inferWebSocketBaseUrl(r);return(0,pe.fl)(`${n}/subscribe`,{outSR:""+t.wkid,token:i})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(-1!==t.indexOf("wss"))return t;return ve.error(new I.Z("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const s=this._websocket;if((0,c.Wi)(s)||(0,c.Wi)(e)&&(0,c.Wi)(t))return;const r=JSON.stringify({filter:this._serializeFilter(e,t)});let i=!1;const n=(0,u.hh)();return s.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(ve.error(new I.Z("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),n.reject(t.error)),s.onmessage=this._onMessage.bind(this),i=!0,n.resolve())},s.send(r),setTimeout((()=>{i||(this.destroyed||this._websocket!==s||ve.error(new I.Z("geoevent-connection","Server timed out when setting filter")),n.reject())}),1e4),n.promise}_serializeFilter(e,t){const s={};if((0,c.Wi)(e)&&(0,c.Wi)(t))return s;if((0,c.pC)(e)&&e.geometry)try{const t=(0,be.im)(e.geometry);if("extent"!==t.type)throw new I.Z(`Expected extent but found type ${t.type}`);s.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){ve.error(new I.Z("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return(0,c.pC)(e)&&e.where&&"1 = 1"!==e.where&&(s.where=e.where),(0,c.pC)(t)&&(s.outFields=t.join(",")),s}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,s=e.attributes[t];if(!this._relatedFeatures.has(s))return ve.warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:r,geometry:i}=this._relatedFeatures.get(s);for(const t in r)e.attributes[t]=r[t];return i&&(e.geometry=i),e.geometry||e.centroid||ve.error(new I.Z("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,s=this._queryRelatedFeatures(e),r=this._queryArchive(t);await s;const i=await r;if(!i)return;for(const e of i.features)this.onFeature(this._enrich(e))}catch(e){ve.error(new I.Z("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([s.e(6968),s.e(7319),s.e(1773),s.e(755),s.e(3471),s.e(511),s.e(635),s.e(9101),s.e(7284),s.e(8422),s.e(8121)]).then(s.bind(s,67284))).default)({url:e}),{capabilities:r}=await t.load(),i=r.query.supportsMaxRecordCountFactor,n=r.query.supportsPagination,a=r.query.supportsCentroid,o=this._config.maxRecordCountFactor,h=t.capabilities.query.maxRecordCount,u=i?h*o:h,l=new K.Z;if(l.outFields=(0,c.Pt)(this._config.outFields,["*"]),l.where=(0,c.Pt)((0,c.U2)(this._config.filter,"where"),"1=1"),l.returnGeometry=!0,l.returnExceededLimitFeatures=!0,l.outSpatialReference=we.Z.fromJSON(this._config.spatialReference),a&&(l.returnCentroid=!0),i&&(l.maxRecordCountFactor=o),n)return l.num=u,t.destroy(),this._queryPages(e,l);const d=await(0,S.executeQuery)(e,l,this._config.sourceSpatialReference);return t.destroy(),d.data}async _queryPages(e,t,s=[],r=0){t.start=(0,c.pC)(t.num)?r*t.num:null;const{data:i}=await(0,S.executeQuery)(e,t,this._config.sourceSpatialReference);return i.exceededTransferLimit&&r<this._config.maxQueryDepth?(i.features.forEach((e=>s.push(e))),this._queryPages(e,t,s,r+1)):(s.forEach((e=>i.features.push(e))),i)}_addRelatedFeatures(e){const t=new Map,s=e.features,r=this._serviceDefinition.relatedFeatures.joinField;for(const e of s){const s=e.attributes[r];t.set(s,e)}this._relatedFeatures=t}};Ce=(0,r._)([(0,o.j)("esri.layers.graphics.sources.connections.GeoEventConnection")],Ce);const Te=Ce;function Fe(e,t){const s=e.weakClone();if((0,c.pC)(e.geometry)){const r=(0,d.Jd)(t,e.geometry.coords[0]),i=(0,d.IN)(t,e.geometry.coords[1]);s.geometry=new k.Z([],[r,i])}return s}class Me{constructor(e,t){this.onUpdate=e,this._geometryType=t,this._objectIdToFeature=new Map}get _features(){const e=[];return this._objectIdToFeature.forEach((t=>e.push(t))),e}add(e){this._objectIdToFeature.set(e.objectId,e),this._index=null}get(e){return this._objectIdToFeature.has(e)?this._objectIdToFeature.get(e):null}forEach(e){this._objectIdToFeature.forEach(e)}search(e){return this._index||(this._index=function(e,t){const s=(0,ue.r)(9,"esriGeometryPoint"===t?e=>(0,c.pC)(e.geometry)?{minX:e.geometry.coords[0],minY:e.geometry.coords[1],maxX:e.geometry.coords[0],maxY:e.geometry.coords[1]}:{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}:e=>{let t=1/0,s=1/0,r=-1/0,i=-1/0;return(0,c.pC)(e.geometry)&&e.geometry.forEachVertex(((e,n)=>{t=Math.min(t,e),s=Math.min(s,n),r=Math.max(r,e),i=Math.max(i,n)})),{minX:t,minY:s,maxX:r,maxY:i}});return s.load(e),s}(this._features,this._geometryType)),function(e,t){return e.search({minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]})}(this._index,e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),this._index=null,t):null}update(e,t){this.onUpdate(e,t)}get size(){return this._objectIdToFeature.size}}class ke extends re{constructor(e){super(e),this.type="geoevent",this._dataReceiveEventEnabled=!1,this._level=0,this._updateInfo={websocket:0,client:0};const{outSR:t}=e,{geometryType:s,objectIdField:r,timeInfo:i,purgeOptions:n,source:a,spatialReference:o,serviceFilter:h,maxReconnectionAttempts:c,maxReconnectionInterval:u,updateInterval:l,enableDataReceived:p,customParameters:g}=e.serviceInfo,_=new Me(this._onUpdate.bind(this),s),f=new de(_,r,i,n),m=function(e,t,s,r,i,n,a,o){const h=0===e.path.indexOf("wss://")||0===e.path.indexOf("ws://"),c={source:e,sourceSpatialReference:t,spatialReference:s,geometryType:r,filter:i,maxReconnectionAttempts:n,maxReconnectionInterval:a,customParameters:o};return h?new xe(c):new Te(c)}(a,o,t,s,h,c,u,g);this._store=_,this._manager=f,this._connection=m,this._quantize=function(e){return"esriGeometryPoint"===e?Fe:(t,s)=>{const r=t.weakClone(),i=new k.Z,n=(0,d.Nh)(i,t.geometry,!1,!1,e,s,!1,!1);return r.geometry=n,r}}(s),this._dataReceiveEventEnabled=p,this._handles=[this._connection.on("feature",(e=>this._onFeature(e))),this._connection.watch("connectionStatus",(e=>this.events.emit("connectionStatus",e))),this._connection.watch("errorString",(e=>this.events.emit("errorString",e)))];let y=performance.now();this._updateIntervalId=setInterval((()=>{const t=performance.now(),s=t-y;if(s>2500){y=t;const e=Math.round(this._updateInfo.client/(s/1e3)),r=Math.round(this._updateInfo.websocket/(s/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.events.emit("updateRate",{client:e,websocket:r})}e.canAcceptRequest()&&this._manager.checkForUpdates()}),l)}destroy(){super.destroy(),clearInterval(this._updateIntervalId),this._handles.forEach((e=>e.remove())),this._connection.destroy()}_fetchDataTile(){}resume(){}enableEvent(e,t){"data-received"===e&&(this._dataReceiveEventEnabled=t)}get updating(){return!1}subscribe(e){super.subscribe(e);const t=this._subscriptions.get(e.id);this._level=e.level;const s=this._getTileFeatures(e);this._onMessage({type:"append",id:e.key.id,addOrUpdate:s,end:!0}),t.didSend=!0}unsubscribe(e){super.unsubscribe(e)}*readers(e){const t=this._subscriptions.get(e),{tile:s}=t;yield this._getTileFeatures(s);for(const e of t.requests.stream.entries)(0,c.pC)(e)&&(0,c.pC)(e.addOrUpdate)&&(yield e.addOrUpdate)}createTileQuery(e){throw new Error("Service does not support tile queries")}async resend(){this._subscriptions.forEach((e=>{const{tile:t}=e,s={type:"append",id:t.id,addOrUpdate:this._getTileFeatures(t),end:!0};this._onMessage(s)}))}_getTileFeatures(e){const t=this._store.search(e).map((t=>this._quantize(t,e.transform)));return F.fromOptimizedFeatures(t,this._serviceInfo.geometryType,e.transform)}_onFeature(e){this._updateInfo.websocket++;try{this._dataReceiveEventEnabled&&this.events.emit("feature",e);const t=(0,d.XA)(e,this._serviceInfo.geometryType,!1,!1,this._serviceInfo.objectIdField);this._manager.add(t)}catch(e){}}_onUpdate(e,t){(0,c.pC)(e)&&(this._updateInfo.client+=e.length),this._subscriptions.forEach(((e,t)=>{e.didSend&&e.tile.level===this._level&&this._onMessage({type:"append",id:t,addOrUpdate:null,clear:!0,end:!1})})),this._subscriptions.forEach(((e,t)=>{if(!e.didSend||e.tile.level!==this._level)return;const s=e.tile,r={type:"append",id:t,addOrUpdate:this._getTileFeatures(s),remove:[],end:!0,status:te.empty()};e.requests.stream.enqueue(r),this._onMessage(r)}))}}const Ae=x.Z.getLogger("esri.views.2d.layers.features.sources.FeatureSource");class Ee extends ae{constructor(e){super(e)}async _fetchDataTile(e){const t=this._subscriptions.get(e.key.id);let s=!1,r=0,i=0;const n=(r,n)=>{i--,(0,u.k_)(t);const a=e.id,o=r.reader,h=r.query;if(!o.exceededTransferLimit){if(s=!0,0!==n&&!o.hasFeatures){const e={id:a,addOrUpdate:o,end:0===i,type:"append"};return t.add({message:e,query:h}),void this._onMessage(e)}const e={id:a,addOrUpdate:o,end:0===i,type:"append"};return t.add({message:e,query:h}),void this._onMessage(e)}const c={id:a,addOrUpdate:o,end:s&&0===i,type:"append"};t.add({message:c,query:h}),this._onMessage(c)};let a=0,o=0;for(;!s&&o++<20;){let o;for(let h=0;h<a+1;h++){const a=r++;i++,o=this._fetchDataTilePage(e,a,t).then((e=>e&&n(e,a))).catch((t=>{s=!0,(0,u.D_)(t)||(Ae.error(new I.Z("mapview-query-error","Encountered error when fetching tile",{tile:e,error:t})),this._onMessage({id:e.id,addOrUpdate:null,end:s,type:"append"}))}))}await o,(0,u.k_)(t),a=Math.min(a+2,6)}}async _fetchDataTilePage(e,t,s){(0,u.k_)(s);const r=this._queryInfo,i={start:this.pageSize*t,num:this.pageSize,returnExceededLimitFeatures:!0,quantizationParameters:e.getQuantizationParameters()};(0,c.pC)(this.maxRecordCountFactor)&&(i.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createTileQuery(e,i);try{const i=s.signal,a=await this._queue.push({tile:e,query:n,signal:i,depth:t});return(0,u.k_)(s),a?r!==this._queryInfo?this._fetchDataTilePage(e,t,s):{reader:a,query:n}:null}catch(e){return(0,u.H9)(e),null}}}var Re=s(77734),Oe=s(61800);const Le=x.Z.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource");function Pe(e,t,s){const r=e.getXHydrated(),i=e.getYHydrated(),n=t.getColumnForX(r),a=Math.floor(t.normalizeCol(n));return`${s}/${Math.floor(t.getRowForY(i))}/${a}`}function qe(e,t){if((0,c.Wi)(e))return null;const s=t.transform,r=e.getQuantizationTransform();if((0,c.Wi)(r)){const[t,r]=s.scale,[i,n]=s.translate,a=-i/t,o=1/t,h=n/r,c=1/-r;return e.transform(a,h,o,c)}const[i,n]=r.scale,[a,o]=r.translate,[h,u]=s.scale,[l,d]=s.translate,p=i/h,g=(a-l)/h,_=n/u,f=(-o+d)/u;return e.transform(g,f,p,_)}class De extends ae{constructor(e){super(e),this.mode="snapshot",this._loading=!0,this._controller=new AbortController,this._downloadPromise=null,this._didSendEnd=!1,this._queries=new Array,this._invalidated=!1,this._hasAggregates=!1,this._random=new Re.Z(1e3),this._store=e.store,this._markedIdsBufId=this._store.storage.createBitset()}destroy(){super.destroy(),this._controller.abort()}get loading(){return this._loading}get _signal(){return this._controller.signal}update(e,t){super.update(e,t),this._hasAggregates=e.targets.aggregate}async resend(e=!1){if(await this._downloadPromise,this._invalidated||e){const e=(0,c.s3)(this._schema.featureCount,"Expected featureCount to be defined");return this._invalidated=!1,this._subscriptions.forEach((e=>e.clear())),this._downloadPromise=this._download(e),void await this._downloadPromise}const t=this._queries.map((({query:e,reader:t})=>this._sendPatchQuery(e,t)));await Promise.all(t),this._subscriptions.forEach((e=>{e.requests.done.forEach((e=>this._onMessage(e.message)))}))}async refresh(){await this.resend(!0)}async _sendPatchQuery(e,t){const s=(0,c.pC)(e.outFields)?e.outFields:[],r=this._queryInfo.outFields,i=r.filter((e=>-1===s.indexOf(e)));if(!i.length)return;const n=e.clone(),a=this._signal;n.returnGeometry=!1,n.returnCentroid=!1,n.outFields=i,e.outFields=r;const o=await this._queue.push({query:n,depth:0,signal:a});(0,u.k_)({signal:a}),t.joinAttributes(o)}async _fetchDataTile(e){if(!this._downloadPromise){const e=(0,c.s3)(this._schema.featureCount,"Expected featureCount to be defined");this._downloadPromise=this._download(e)}const t=this._store.search(e),s=this._subscriptions.get(e.key.id),r=t.length-1;for(let i=0;i<r;i++){const r=qe(t[i],e),n={type:"append",id:e.id,addOrUpdate:r,end:!1,status:te.empty()};s.add({query:null,message:n}),this._hasAggregates||await(0,u.e4)(1),this._onMessage(n)}const i=qe(r>=0?t[r]:null,e),n=this._didSendEnd,a={type:"append",id:e.id,addOrUpdate:i,end:n,status:te.empty()};s.add({query:null,message:a}),this._onMessage(a)}async _download(e){try{await this.whenInitialized();const t=this._store.storage.getBitset(this._markedIdsBufId),s=new Set;t.clear();const r=Math.ceil(e/this.pageSize),i=Array.from({length:r},((e,t)=>t)).sort(((e,t)=>this._random.getInt()-this._random.getInt())).map((e=>this._downloadPage(e,t,s)));await Promise.all(i),this._store.sweepFeatures(t,this._store.storage),this._store.sweepFeatureSets(s)}catch(e){Le.error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",e)}this._sendEnd(),this._loading=!1}async _downloadPage(e,t,s){const r=this.pageSize,i={start:e*r,num:r,cacheHint:!0};(0,c.pC)(this.maxRecordCountFactor)&&(i.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createQuery(i),a=this._signal,o=await this._queue.push({query:n,depth:e,signal:a});(0,u.k_)({signal:a}),this._queries.push({query:n,reader:o}),this._store.insert(o),s.add(o.instance);const h=o.getCursor();for(;h.next();)t.set(h.getDisplayId());this._send(o)}_send(e){if(!this._subscriptions.size)return;let t=null;const s=new Map,r=new Set,i=new Map;this._subscriptions.forEach((e=>{var n;const a=e.tile;s.set(a.key.id,null),t=a.tileInfoView,r.add(a.level);const{row:o,col:h}=a.key,c=`${a.level}/${o}/${h}`,u=null!=(n=i.get(c))?n:[];u.push(e),i.set(c,u)}));for(const n of r){const r=t.getLODInfoAt(n),a=e.getCursor();for(;a.next();){const e=Pe(a,r,n),t=a.getIndex();if(i.has(e))for(const r of i.get(e)){const e=r.tile.id;let i=s.get(e);(0,c.Wi)(i)&&(i=[],s.set(e,i)),i.push(t)}}}s.forEach(((t,s)=>{if((0,c.pC)(t)){const r=this._subscriptions.get(s),i={type:"append",id:s,addOrUpdate:qe(Oe.t.from(e,t),r.tile),end:!1,status:te.empty()};r.add({query:null,message:i}),this._onMessage(i)}}))}_sendEnd(){this._subscriptions.forEach((e=>{const t={type:"append",id:e.tile.id,addOrUpdate:null,end:!0,status:te.empty()};e.add({query:null,message:t}),this._onMessage(t)})),this._didSendEnd=!0}}var Ue=s(16534),Ne=s(29996);s(37720),s(66039),s(40660);const ze=x.Z.getLogger("esri.views.layers.2d.features.support.AttributeStore"),Be=()=>null,Ge={sharedArrayBuffer:(0,n.Z)("esri-shared-array-buffer"),atomics:(0,n.Z)("esri-atomics")};function Ze(e,t){return s=>t(e(s))}class je{constructor(e,t,s,r){this.size=0,this.texelSize=4;const{pixelType:i,layout:n,textureOnly:a}=r;this.textureOnly=a||!1,this.pixelType=i,this._ctype=t,this.layout=n,this._resetRange(),this._shared=e,this.size=s,a||(this.data=this._initData(i,s,e,t))}get buffer(){return(0,c.Po)(this.data,(e=>e.buffer))}unsetComponentAllTexels(e,t){const s=(0,c.Wg)(this.data);for(let r=0;r<this.size*this.size;r++)s[r*this.texelSize+e]&=~t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(e,t){const s=(0,c.Wg)(this.data);for(let r=0;r<this.size*this.size;r++)s[r*this.texelSize+e]|=255&t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(e,t,s){const r=(0,c.Wg)(this.data);for(const i of s)r[i*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}setComponentTexel(e,t,s){(0,c.Wg)(this.data)[s*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}unsetComponentTexel(e,t,s){(0,c.Wg)(this.data)[s*this.texelSize+e]&=~t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}getData(e,t){const s=(0,_.jL)(e);return(0,c.Wg)(this.data)[s*this.texelSize+t]}setData(e,t,s){const r=(0,_.jL)(e),i=1<<t;0!=(this.layout&i)?(this.data[r*this.texelSize+t]=s,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)):ze.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){5121===this.pixelType&&this._shared&&Ge.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){5121===this.pixelType&&this._shared&&Ge.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(e){if(this.size=e,!this.textureOnly){const t=this._initData(this.pixelType,e,this._shared,this._ctype),s=(0,c.Wg)(this.data);t.set(s),this.data=t}}toMessage(){const e=this.dirtyStart,t=this.dirtyEnd,s=this.texelSize;if(e>t)return null;this._resetRange();const r=!(this._shared||"local"===this._ctype),i=this.pixelType,n=this.layout,a=(0,c.Wg)(this.data);return{start:e,end:t,data:r&&a.slice(e*s,(t+1)*s)||null,pixelType:i,layout:n}}_initData(e,t,s,r){const i=s&&"local"!==r?SharedArrayBuffer:ArrayBuffer,n=(0,Ne.UK)(e),a=new n(new i(t*t*4*n.BYTES_PER_ELEMENT));for(let e=0;e<a.length;e+=4)a[e+1]=255;return a}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class Xe{constructor(e,t){this._client=e,this.config=t,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(Ue.m4),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const s=t.supportsTextureFloat?5126:5121;Be(`Creating AttributeStore ${Ge.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:5121,layout:1},{pixelType:5121,layout:15,textureOnly:!0},{pixelType:s,layout:15},{pixelType:s,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}update(e,t){this.config=t;const s=t.schema.processors[0].storage,r=(0,J.Hg)(this._schema,s);if((e.targets.feature||e.targets.aggregate)&&(e.storage.data=!0),r&&((0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",r),e.storage.data=!0,this._schema=s,this._attributeComputeMap.clear(),!(0,c.Wi)(s))){switch(s.target){case"feature":this._targetType=_.PX;break;case"aggregate":this._targetType=_.xp}if("subtype"===s.type)for(const e in s.mapping){const t=s.mapping[e];if((0,c.pC)(t))for(const e of t.mapping)this._bindAttribute(e)}else for(const e of s.mapping)this._bindAttribute(e)}}onTileData(e,t){if((0,c.Wi)(t.addOrUpdate))return;const s=t.addOrUpdate.getCursor();for(;s.next();){const e=s.getDisplayId();this.setAttributeData(e,s)}}invalidateResources(){this._createResourcesPromise=null,this._abortController.abort(),this._abortController=new AbortController}async setHighlight(e,t){const s=this._getBlock(0),r=t.map((e=>(0,_.jL)(e)));s.lock(),s.unsetComponentAllTexels(0,1),s.setComponent(0,1,r),s.unlock(),this._idsToHighlight.clear();for(const t of e)this._idsToHighlight.add(t);await this.sendUpdates()}async updateFilters(e,t){const{config:s,service:r,spatialReference:i}=t,{filters:a}=s,o=a.map(((e,t)=>this._updateFilter(e,t,r,i)));(await Promise.all(o)).some((e=>e))&&(e.storage.filters=!0,(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(e,t,s,r){const i=(0,_.jL)(e);this._ensureSizeForTexel(i),this._getBlock(t).setData(e,s,r)}getData(e,t,s){return this._getBlock(t).getData(e,s)}getHighlightFlag(e){return this._idsToHighlight.has(e)?Ue.uG:0}unsetAttributeData(e){const t=(0,_.jL)(e);this._getBlock(0).setData(t,0,0)}setAttributeData(e,t){const s=(0,_.jL)(e);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(t)),this._targetType!==(0,_.vs)(e))return;const r=this._attributeComputeMap,i=this.config.supportsTextureFloat?1:2;r.size&&r.forEach(((e,r)=>{const n=r*i%4,a=Math.floor(r*i/4),o=this._getBlock(a+Ue.aK),h=e(t);if(this.config.supportsTextureFloat)o.setData(s,n,h);else if(h===Ue.AI)o.setData(s,n,255),o.setData(s,n+1,255);else{const e=(0,le.uZ)(Math.round(h),-32767,32766)+32768,t=255&e,r=(65280&e)>>8;o.setData(s,n,t),o.setData(s,n+1,r)}}))}sendUpdates(){if(this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=(0,u.hh)(),this._nextUpdate.promise;const e={blocks:this._blocks.map((e=>(0,c.pC)(e)?e.toMessage():null))};return this._currUpdate=this._createResources().then((()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const e=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then((()=>e.resolve()))}},s=this._client.update(e,this._signal).then(t).catch(t);return this._client.render(this._signal),s})).catch((e=>(0,u.D_)(e)?(this._createResourcesPromise=null,this._createResources()):(ze.error(new I.Z("mapview-attribute-store","Encountered an error during client update",e)),Promise.resolve()))),this._currUpdate}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}_bindAttribute(e){let t;if(null!=e.fieldIndex)e.normalizationField&&ze.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),t=t=>t.getComputedNumericAtIndex(e.fieldIndex);else{if(!e.field)return;t=e.normalizationField?t=>{const s=t.readAttribute(e.normalizationField);return s?t.readAttribute(e.field)/s:null}:t=>t.readAttribute(e.field)}e.valueRepresentation&&(t=Ze(t,(t=>function(e,t){if(!e||!t)return e;switch(t){case"radius":case"distance":return 2*e;case"diameter":case"width":return e;case"area":return Math.sqrt(e)}return e}(t,e.valueRepresentation)))),this._attributeComputeMap.set(e.binding,Ze(t,(e=>null===e||isNaN(e)||e===1/0?Ue.AI:e)))}_createResources(){if((0,c.pC)(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(Ue.xl),Be("Initializing AttributeStore");const e={shared:Ge.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:(0,c.Fd)(this._blocks,(e=>({textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType})))},t=this._client.initialize(e,this._signal).catch((e=>{(0,u.D_)(e)?this._createResourcesPromise=null:ze.error(new I.Z("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=t,t.then((()=>(0,c.Wi)(this._createResourcesPromise)?this._createResources():void 0)),t}_getBlock(e){const t=this._blocks[e];if((0,c.pC)(t))return t;Be(`Initializing AttributeBlock at index ${e}`);const s=Ge.sharedArrayBuffer,r=this._client.type,i=new je(s,r,this._size,this._blockDescriptors[e]);return this._blocks[e]=i,this._createResourcesPromise=null,i}_expand(){if(this._size<this.config.maxTextureSize){const e=this._size<<=1;return Be("Expanding block size to",e,this._blocks),(0,c.JR)(this._blocks,(t=>t.expand(e))),this._createResourcesPromise=null,this._size=e,0}return ze.error(new I.Z("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(e,t,s,r){const i=this._filters[t],n=(0,c.pC)(i)&&i.hash;if(!i&&!e)return!1;if(n===JSON.stringify(e))return!1;if((0,c.Wi)(e)){if(!i)return!1;const e=1<<t+1,s=this._getBlock(0);return this._filters[t]=null,s.setComponentAllTexels(0,e),this.sendUpdates(),!0}const a=await this._getFilter(t,s);return await a.update(e,r),!0}async _getFilter(e,t){const r=this._filters[e];if((0,c.pC)(r))return r;const{default:i}=await s.e(9169).then(s.bind(s,29169)),n=new i({geometryType:t.geometryType,hasM:!1,hasZ:!1,timeInfo:t.timeInfo,fieldsIndex:new g.Z(t.fields)});return this._filters[e]=n,n}isVisible(e){return!!(2&this._getBlock(0).getData(e,0))}getFilterFlags(e){let t=0;const s=(0,_.KS)(e.getDisplayId());for(let r=0;r<this._filters.length;r++){const i=!!(s&1<<r),n=this._filters[r];t|=(!i||(0,c.Wi)(n)||n.check(e)?1:0)<<r}let r=0;if(this._idsToHighlight.size){const t=e.getObjectId();r=this.getHighlightFlag(t)}return t<<1|r}}function We(e,t,s,r){r%2&&(r+=1);let i=0,n=0,a=-90,o=90,h=-180,c=180;for(let e=0;e<r/2;e++){for(let t=0;t<5;t++){const r=(h+c)/2,n=s>r?1:0;i|=n<<29-(t+5*e),h=(1-n)*h+n*r,c=(1-n)*r+n*c}for(let s=0;s<5;s++){const r=(a+o)/2,i=t>r?1:0;n|=i<<29-(s+5*e),a=(1-i)*a+i*r,o=(1-i)*r+i*o}}e.geohashX=i,e.geohashY=n}function Ye(e,t,s,r,i){i%2&&(i+=1);let n=0,a=0,o=-90,h=90,c=-180,u=180;for(let e=0;e<i/2;e++){for(let t=0;t<5;t++){const s=(c+u)/2,i=r>s?1:0;n|=i<<29-(t+5*e),c=(1-i)*c+i*s,u=(1-i)*s+i*u}for(let t=0;t<5;t++){const r=(o+h)/2,i=s>r?1:0;a|=i<<29-(t+5*e),o=(1-i)*o+i*r,h=(1-i)*r+i*h}}e[2*t]=n,e[2*t+1]=a}new Float64Array(2),new Float64Array(2);class Ve{constructor(e=[],t=8096){this._nodes=0,this._root=new Qe(0,0,0),this._statisticFields=e,this._pool=t?new ee.Z(8096):null}_acquire(e,t,s){this._nodes++;let r=null;return(0,c.pC)(this._pool)&&(r=this._pool.dequeue()),(0,c.pC)(r)?r.realloc(e,t,s):new Qe(e,t,s)}_release(e){this._nodes--,(0,c.pC)(this._pool)&&this._pool.enqueue(e)}get count(){return this._root.count}get size(){return this._nodes}get poolSize(){return(0,c.R2)(this._pool,0,(e=>e.size))}get depth(){let e=0;return this._forEachNode((t=>e=Math.max(e,t.depth))),e}dropLevels(e){this._forEachNode((t=>{if(t.depth>=e)for(let e=0;e<t.children.length;e++){const s=t.children[e];t.children[e]=null,s&&this._release(s)}}))}clear(){this.dropLevels(0)}insert(e,t,s=0){const r=F.fromOptimizedFeatures([e],"esriGeometryPoint").getCursor();r.next();const i=r.readGeometry();if(!i)return;const[n,a]=i.coords,o=e.geohashX,h=e.geohashY;this.insertCursor(r,e.displayId,n,a,o,h,t,s)}insertCursor(e,t,s,r,i,n,a,o=0){let h=this._root,c=0,u=0,l=0;for(;null!==h;){if(h.depth>=o&&(h.count+=1,h.xTotal+=s,h.yTotal+=r,h.xGeohashTotal+=i,h.yGeohashTotal+=n,h.displayId=t,this._updateStatisticsCursor(e,h,1)),c>=a)return void h.add(t);const d=Math.ceil((c+1)/2),p=Math.floor((c+1)/2),g=1-c%2,_=30-(3*d+2*p),f=30-(2*d+3*p),m=(i&7*g+3*(1-g)<<_)>>_,y=(n&3*g+7*(1-g)<<f)>>f,I=m+y*(8*g+4*(1-g));u=u<<3*g+2*(1-g)|m,l=l<<2*g+3*(1-g)|y,null==h.children[I]&&(h.children[I]=this._acquire(u,l,c+1)),c+=1,h=h.children[I]}}remove(e,t){const s=F.fromOptimizedFeatures([e],"esriGeometryPoint").getCursor();s.next();const r=s.readGeometry();if(!r)return;const[i,n]=r.coords,a=e.geohashX,o=e.geohashY;this.removeCursor(s,i,n,a,o,t)}removeCursor(e,t,s,r,i,n){let a=this._root,o=0;for(;null!==a;){if(a.count-=1,a.xTotal-=t,a.yTotal-=s,a.xGeohashTotal-=r,a.yGeohashTotal-=i,this._updateStatisticsCursor(e,a,-1),o>=n)return void a.remove(e.getDisplayId());const h=Math.ceil((o+1)/2),c=Math.floor((o+1)/2),u=1-o%2,l=30-(3*h+2*c),d=30-(2*h+3*c),p=((r&7*u+3*(1-u)<<l)>>l)+((i&3*u+7*(1-u)<<d)>>d)*(8*u+4*(1-u)),g=a.children[p];1===g.count&&(this._release(g),a.children[p]=null),o+=1,a=g}}find(e,t,s){return this._root.find(e,t,s,0,0,0)}findSingleOccupancyNode(e,t,s,r,i){let n=this._root;for(;null!==n;){const a=n.depth,o=n.xNode,h=n.yNode,c=1-a%2,u=n.xGeohashTotal/n.count,l=n.yGeohashTotal/n.count;if(1===n.count&&e<u&&u<=s&&t<l&&l<=r)return n;if(a>=i){n=n.next;continue}const d=Math.ceil((a+1)/2),p=Math.floor((a+1)/2),g=30-(3*d+2*p),_=30-(2*d+3*p),f=~((1<<g)-1),m=~((1<<_)-1),y=(e&f)>>g,I=(t&m)>>_,x=(s&f)>>g,b=(r&m)>>_,w=o<<3*c+2*(1-c),v=h<<2*c+3*(1-c),S=w+8*c+4*(1-c),C=v+4*c+8*(1-c),T=Math.max(w,y),F=Math.max(v,I),M=Math.min(S,x),k=Math.min(C,b);let A=null,E=null;for(let e=F;e<=k;e++)for(let t=T;t<=M;t++){const s=t-w+(e-v)*(8*c+4*(1-c)),r=n.children[s];r&&(A||(A=r,A.next=n.next),E&&(E.next=r),E=r,r.next=n.next)}n=A||n.next}return null}getRegionDisplayIds(e,t,s,r,i){let n=this._root;const a=[];for(;null!==n;){const o=n.depth,h=n.xNode,c=n.yNode;if(o>=i){const i=n.xGeohashTotal/n.count,o=n.yGeohashTotal/n.count;e<=i&&i<=s&&t<=o&&o<=r&&n.displayIds.forEach((e=>a.push(e))),n=n.next;continue}const u=Math.ceil((o+1)/2),l=Math.floor((o+1)/2),d=1-o%2,p=30-(3*u+2*l),g=30-(2*u+3*l),_=~((1<<p)-1),f=~((1<<g)-1),m=(e&_)>>p,y=(t&f)>>g,I=(s&_)>>p,x=(r&f)>>g,b=h<<3*d+2*(1-d),w=c<<2*d+3*(1-d),v=b+8*d+4*(1-d),S=w+4*d+8*(1-d),C=Math.max(b,m),T=Math.max(w,y),F=Math.min(v,I),M=Math.min(S,x);let k=null,A=null;for(let e=T;e<=M;e++)for(let t=C;t<=F;t++){const s=t-b+(e-w)*(8*d+4*(1-d)),r=n.children[s];r&&(k||(k=r,k.next=n.next),A&&(A.next=r),A=r,r.next=n.next)}n=k||n.next}return a}getRegionStatistics(e,t,s,r,i){let n=this._root,a=0,o=0,h=0;const c={};let u=0;for(;null!==n;){const l=n.depth,d=n.xNode,p=n.yNode;if(l>=i){const i=n.xGeohashTotal/n.count,l=n.yGeohashTotal/n.count;e<i&&i<=s&&t<l&&l<=r&&(a+=n.count,o+=n.xTotal,h+=n.yTotal,1===n.count&&(u=n.displayId),this._aggregateStatistics(c,n.statistics)),n=n.next;continue}const g=Math.ceil((l+1)/2),_=Math.floor((l+1)/2),f=1-l%2,m=30-(3*g+2*_),y=30-(2*g+3*_),I=~((1<<m)-1),x=~((1<<y)-1),b=(e&I)>>m,w=(t&x)>>y,v=(s&I)>>m,S=(r&x)>>y,C=d<<3*f+2*(1-f),T=p<<2*f+3*(1-f),F=C+8*f+4*(1-f),M=T+4*f+8*(1-f),k=Math.max(C,b),A=Math.max(T,w),E=Math.min(F,v),R=Math.min(M,S);let O=null,L=null;for(let i=A;i<=R;i++)for(let l=k;l<=E;l++){const d=l-C+(i-T)*(8*f+4*(1-f)),p=n.children[d];if(p){if(i!==A&&i!==R&&l!==k&&l!==E){const i=p.xGeohashTotal/p.count,n=p.yGeohashTotal/p.count;e<i&&i<=s&&t<n&&n<=r&&(a+=p.count,o+=p.xTotal,h+=p.yTotal,1===p.count&&(u=p.displayId),this._aggregateStatistics(c,p.statistics));continue}O||(O=p,O.next=n.next),L&&(L.next=p),L=p,p.next=n.next}}n=O||n.next}return{count:a,attributes:this._normalizeStatistics(c,a),xTotal:o,yTotal:h,referenceId:u}}_forEachNode(e){let t=this._root;for(;null!==t;){const s=this._linkChildren(t)||t.next;e(t),t=s}}_linkChildren(e){let t=null,s=null;for(let r=0;r<=e.children.length;r++){const i=e.children[r];i&&(t||(t=i,t.next=e.next),s&&(s.next=i),s=i,i.next=e.next)}return t}_updateStatisticsCursor(e,t,s){for(const r of this._statisticFields){const i=r.name,n=r.inField?e.readAttribute(r.inField):e.getComputedNumericAtIndex(r.inFieldIndex);switch(r.statisticType){case"norm":{t.statistics[i]||(t.statistics[i]={});const a=r.inNormalizationField,o=e.readAttribute(a),h=t.statistics[i].onStatisticField||0,c=t.statistics[i].onStatisticNormalizationField||0;null==n||isNaN(n)||null==o||0===o||isNaN(o)||(t.statistics[i].onStatisticField=h+s*n,t.statistics[i].onStatisticNormalizationField=c+s*o);break}case"sum":case"avg":{t.statistics[i]||(t.statistics[i]={value:0,nanCount:0});const e=t.statistics[i].value,r=t.statistics[i].nanCount;null==n||isNaN(n)?t.statistics[i].nanCount=r+s:t.statistics[i].value=e+s*n;break}case"avg_angle":{t.statistics[i]||(t.statistics[i]={x:0,y:0,nanCount:0});const e=t.statistics[i].x,r=t.statistics[i].y,a=t.statistics[i].nanCount,o=Math.PI/180;null==n||isNaN(n)?t.statistics[i].nanCount=a+s:(t.statistics[i].x=e+s*Math.cos(n*o),t.statistics[i].y=r+s*Math.sin(n*o));break}case"mode":{t.statistics[i]||(t.statistics[i]={});const e=t.statistics[i][n]||0;t.statistics[i][n]=e+s;break}}}}_aggregateStatistics(e,t){for(const s of this._statisticFields){const r=s.name;switch(s.statisticType){case"sum":case"avg":case"avg_angle":case"mode":case"norm":e[r]||(e[r]={});for(const s in t[r]){const i=e[r][s]||0;e[r][s]=i+t[r][s]}}}}_normalizeStatistics(e,t){const s={};for(const r of this._statisticFields){const i=r.name;switch(r.statisticType){case"norm":{const r=e[i];if(t&&null==r.onStatisticNormalizationField)break;if(t&&r.onStatisticNormalizationField){s[i]=r.onStatisticField/r.onStatisticNormalizationField;break}s[i]=0;break}case"sum":{if(!t)break;const{value:r,nanCount:n}=e[i];if(!(t-n))break;s[i]=r;break}case"avg":{if(!t)break;const{value:r,nanCount:n}=e[i];if(!(t-n))break;s[i]=r/(t-n);break}case"avg_angle":{if(!t)break;const{x:r,y:n,nanCount:a}=e[i];if(!(t-a))break;const o=r/(t-a),h=n/(t-a),c=180/Math.PI,u=Math.atan2(h,o)*c;s[i]=u;break}case"mode":{const t=e[i];let r=0,n=null;for(const e in t){const s=t[e];s>r&&(r=s,n=e)}s[i]="null"===n?null:n;break}}}return s}}class Qe{constructor(e,t,s){this.count=0,this.xTotal=0,this.yTotal=0,this.statistics={},this.displayId=0,this.displayIds=new Set,this.next=null,this.depth=0,this.xNode=0,this.yNode=0,this.xGeohashTotal=0,this.yGeohashTotal=0,this.children=new Array(32);for(let e=0;e<this.children.length;e++)this.children[e]=null;this.xNode=e,this.yNode=t,this.depth=s}realloc(e,t,s){for(let e=0;e<this.children.length;e++)this.children[e]=null;return this.xNode=e,this.yNode=t,this.depth=s,this.next=null,this.xGeohashTotal=0,this.yGeohashTotal=0,this.xTotal=0,this.yTotal=0,this.count=0,this.statistics={},this.displayIds.clear(),this}add(e){this.displayIds.add(e)}remove(e){this.displayIds.delete(e)}getLngLatBounds(){const e=this.depth,t=Math.ceil(e/2),s=Math.floor(e/2),r=30-(3*t+2*s),i=30-(2*t+3*s);return function(e,t){let s=-90,r=90,i=-180,n=180;for(let a=0;a<t;a++){const t=Math.ceil((a+1)/2),o=Math.floor((a+1)/2),h=1-a%2,c=30-(3*t+2*o),u=30-(2*t+3*o),l=2*h+3*(1-h),d=(7*h+3*(1-h)<<c&e.geohashX)>>c,p=(3*h+7*(1-h)<<u&e.geohashY)>>u;for(let e=3*h+2*(1-h)-1;e>=0;e--){const t=(i+n)/2,s=d&1<<e?1:0;i=(1-s)*i+s*t,n=(1-s)*t+s*n}for(let e=l-1;e>=0;e--){const t=(s+r)/2,i=p&1<<e?1:0;s=(1-i)*s+i*t,r=(1-i)*t+i*r}}return[i,s,n,r]}({geohashX:this.xNode<<r,geohashY:this.yNode<<i},this.depth)}find(e,t,s,r,i,n){if(r>=s)return this;const a=1-r%2,o=3*a+2*(1-a),h=2*a+3*(1-a),c=30-i-o,u=30-n-h,l=((e&7*a+3*(1-a)<<c)>>c)+((t&3*a+7*(1-a)<<u)>>u)*(8*a+4*(1-a)),d=this.children[l];return null==d?null:d.find(e,t,s,r+1,i+o,n+h)}}var He=s(68441),$e=s(8744),Je=s(37427),Ke=s(59999);class et extends C.nd{constructor(e,t,s,r,i){super(new k.Z([],[t,s]),r,null,e),this.geohashBoundsInfo=i}get count(){return this.attributes.cluster_count}static create(e,t,s,r,i,n,a,o){const h=new et(t,s,r,n,a);return h.displayId=e.createDisplayId(!0),h.referenceId=o,h.tileLevel=i,h}update(e,t,s,r,i,n){return this.geometry.coords[0]=e,this.geometry.coords[1]=t,this.tileLevel=s,this.attributes=r,this.geohashBoundsInfo=i,this.referenceId=null,this.referenceId=n,this}toJSON(){return{objectId:this.objectId,referenceId:1===this.attributes.cluster_count?this.referenceId:null,attributes:{...this.attributes,clusterId:this.objectId},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}}function tt(e){return 57.29577951308232*e}class st extends Ke.J{constructor(e,t,s){super(e,s),this.events=new $.Z,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this.geometryInfo=e.geometryInfo,this._spatialReference=t,this._projectionSupportCheck=(0,Je._W)(t,we.Z.WGS84),this._bitsets.geohash=s.getBitset(s.createBitset()),this._bitsets.inserted=s.getBitset(s.createBitset())}async updateSchema(e,t){const s=this._schema;try{await super.updateSchema(e,t),await this._projectionSupportCheck}catch(e){}const r=(0,J.Hg)(s,t);t&&(!(0,c.Wi)(r)||e.source||e.storage.filters)?(((0,J.uD)(r,"params.fields")||!this._tree||e.source)&&(this._tree=new Ve(this._statisticFields),this._rebuildTree(),(0,n.Z)("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",r),e.targets[t.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):s&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepClusters(e,t,s){this._clusters.forEach(((r,i)=>{r&&r.tileLevel!==s&&(e.releaseDisplayId(r.displayId),t.unsetAttributeData(r.displayId),this._clusters.delete(i))}))}onTileData(e,t,s,r,i=!0){if(!this._schema||(0,c.Wi)(t.addOrUpdate))return t;const n=this._getTransforms(e,this._spatialReference);{const e=t.addOrUpdate.getCursor();for(;e.next();)this._update(e,r)}if(t.status.mesh||!i)return t;const a=new Array,o=this._schema.params.clusterRadius;this._getClustersForTile(a,e,o,s,n),t.addOrUpdate=F.fromOptimizedFeatures(a,"esriGeometryPoint"),t.addOrUpdate.attachStorage(s),t.end=!0;{const r=t.addOrUpdate.getCursor();for(;r.next();){const t=r.getDisplayId();this._bitsets.computed.unset(t),this.setComputedAttributes(s,r,t,e.scale)}}return this._aggregateValueRangesChanged&&t.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),t}onTileUpdate({added:e,removed:t}){if(e.length){const t=e[0].level;this._tileLevel=t,this._setGeohashLevel(t)}if(!this._schema)return;const s=this._schema.params.clusterRadius;t.forEach((e=>{this._tiles.delete(e.key.id),this._markTileClustersForDeletion(e,s)}))}getAggregate(e){for(const t of this._clusters.values())if((null==t?void 0:t.displayId)===e)return t.toJSON();return null}getAggregates(){const e=[];for(const t of this._clusters.values())(null==t?void 0:t.tileLevel)===this._tileLevel&&e.push(t.toJSON());return e}getDisplayId(e){const t=this._clusters.get(e);return t?t.displayId:null}getFeatureDisplayIdsForAggregate(e){const t=this._clusters.get(e);if(!t)return[];const s=t.geohashBoundsInfo;return this._tree.getRegionDisplayIds(s.xLL,s.yLL,s.xTR,s.yTR,s.level)}getDisplayIdForReferenceId(e){for(const t of this._clusters.values())if((null==t?void 0:t.referenceId)===e)return t.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){for(const[t,s]of this._clusters)s&&e(s,t)}size(){let e=0;return this.forEach((t=>e++)),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),i=this._geohashBuf[2*t],n=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,i,n,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,i=t.isVisible(s);if(i===r.has(s))return;if(!i)return void this._remove(e);const n=e.getXHydrated(),a=e.getYHydrated();if(!this._setGeohash(s,n,a))return;const o=this._geohashBuf[2*s],h=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,n,a,o,h,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const i=tt(t/He.sv.radius),n=i-360*Math.floor((i+180)/360);Ye(r,e,tt(Math.PI/2-2*Math.atan(Math.exp(-s/He.sv.radius))),n,12)}else{const i=(0,Je.iV)({x:t,y:s},this._spatialReference,we.Z.WGS84);if(!i)return!1;Ye(r,e,i.y,i.x,12)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,t,s,r,i,n=!0){const a=this._schema.params.clusterPixelBuffer,o=2*s,h=this._getGeohashLevel(t.key.level),u=Math.ceil(2**t.key.level*Ue.I_/o),l=Math.ceil(a/o)+0,p=Math.ceil(Ue.I_/o),{row:g,col:_}=t.key,f=_*Ue.I_,m=g*Ue.I_,y=Math.floor(f/o)-l,I=Math.floor(m/o)-l,x=y+p+2*l,b=I+p+2*l,w=t.tileInfoView.getLODInfoAt(t.key.level);for(let s=y;s<=x;s++)for(let a=I;a<=b;a++){let o=s;w.wrap&&(o=s<0?s+u:s%u);const l=w.wrap&&s<0,p=w.wrap&&s%u!==s,g=this._lookupCluster(r,w,t.key.level,o,a,h);if((0,c.pC)(g)){const t=(0,c.Po)(i,(e=>l?e.left:p?e.right:e.tile));if(n&&(0,c.Wi)(t))continue;if(!g.count)continue;if((0,c.pC)(t)&&n){const s=g.geometry.clone();let r=g.attributes;s.coords[0]=(0,d.Jd)(t,s.coords[0]),s.coords[1]=(0,d.IN)(t,s.coords[1]),1===g.count&&(0,c.pC)(g.referenceId)&&(r={...g.attributes,referenceId:g.referenceId});const i=new C.ZP(s,r);i.displayId=g.displayId,e.push(i)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),12)}_setGeohashLevel(e){const t=this._getGeohashLevel(e),s=1*(Math.floor(t/1)+1)-1;if(this._geohashLevel!==s)return this._geohashLevel=s,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=(0,$e.C5)(t);if(!r)return{tile:s,left:null,right:null};const[i,n]=r.valid;return{tile:s,left:{...s,translate:[n,e.bounds[3]]},right:{...s,translate:[i-n+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,t,s){return(15&e)<<28|(16383&t)<<14|16383&s}_markForDeletion(e,t,s){const r=this._getClusterId(e,t,s);this._clusters.delete(r)}_getClusterBounds(e,t,s){const r=this._schema.params.clusterRadius,i=2*r;let n=s%2?t*i:t*i-r;const a=s*i;let o=n+i;const h=a-i,c=2**e.level*Ue.I_;e.wrap&&n<0&&(n=0),e.wrap&&o>c&&(o=c);const u=n/Ue.I_,l=a/Ue.I_,d=o/Ue.I_,p=h/Ue.I_;return[e.getXForColumn(u),e.getYForRow(l),e.getXForColumn(d),e.getYForRow(p)]}_lookupCluster(e,t,s,r,i,n){const a=this._getClusterId(s,r,i),o=this._clusters.get(a),[h,u,l,d]=this._getClusterBounds(t,r,i),p={x:h,y:u},g={x:l,y:d};let _=0,f=0,m=0,y=0;if(this._spatialReference.isWebMercator){{const e=tt(p.x/He.sv.radius);_=e-360*Math.floor((e+180)/360),f=tt(Math.PI/2-2*Math.atan(Math.exp(-p.y/He.sv.radius)))}{const e=tt(g.x/He.sv.radius);m=e-360*Math.floor((e+180)/360),y=tt(Math.PI/2-2*Math.atan(Math.exp(-g.y/He.sv.radius)))}}else{const e=(0,Je.iV)(p,this._spatialReference,we.Z.WGS84),t=(0,Je.iV)(g,this._spatialReference,we.Z.WGS84);if(!e||!t)return null;_=e.x,f=e.y,m=t.x,y=t.y}const I={geohashX:0,geohashY:0},x={geohashX:0,geohashY:0};We(I,f,_,n),We(x,y,m,n);const b=I.geohashX,w=I.geohashY,v=x.geohashX,S=x.geohashY,C={xLL:b,yLL:w,xTR:v,yTR:S,level:n},T=this._tree.getRegionStatistics(b,w,v,S,n),{count:F,xTotal:M,yTotal:k,referenceId:A}=T,E=F?M/F:0,R=F?k/F:0;if(0===F)return this._clusters.set(a,null),null;const O={cluster_count:F,...T.attributes},L=(0,c.pC)(o)?o.update(E,R,s,O,C,A):et.create(e,a,E,R,s,O,C,A);return 0===F&&(L.geometry.coords[0]=(h+l)/2,L.geometry.coords[1]=(u+d)/2),this._clusters.set(a,L),this._updateAggregateValueRangeForCluster(L,L.tileLevel),L}_updateAggregateValueRangeForCluster(e,t){const s=this._aggregateValueRanges[t]||{minValue:1/0,maxValue:0},r=s.minValue,i=s.maxValue;s.minValue=Math.min(r,e.count),s.maxValue=Math.max(i,e.count),this._aggregateValueRanges[t]=s,r===s.minValue&&i===s.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,t){const s=2*t,r=Math.ceil(Ue.I_/s),{row:i,col:n}=e.key,a=n*Ue.I_,o=i*Ue.I_,h=Math.floor(a/s),c=Math.floor(o/s);for(let t=h;t<h+r;t++)for(let s=c;s<c+r;s++)this._markForDeletion(e.key.level,t,s)}}class rt{constructor(){this._freeIds=[],this._idCounter=1}createId(e=!1){return(0,_.QS)(this._getFreeId(),e)}releaseId(e){this._freeIds.push(e)}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}var it=s(93054);function nt(e,t,s){if(!(e.length>t))for(;e.length<=t;)e.push(s)}class at{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new rt,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const e=this._bitsets.length;return this._bitsets.push(it.p.create(this._allocatedSize,_._I)),e+1}getBitset(e){return this._bitsets[e-1]}_expand(){this._allocatedSize<<=1;for(const e of this._bitsets)e.resize(this._allocatedSize)}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),nt(this._numerics[e],t,0)}_ensureInstanceId(e){nt(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),nt(this._strings[e],t,null)}createDisplayId(e=!1){const t=this._idGenerator.createId();return t>this._allocatedSize&&this._expand(),(0,_.QS)(t,e)}releaseDisplayId(e){for(const t of this._bitsets)t.unset(e);return this._idGenerator.releaseId(e&_._I)}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&_._I,0)}setComputedNumeric(e,t,s){return this.setComputedNumericAtIndex(e&_._I,s,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&_._I,0)}setComputedString(e,t,s){return this.setComputedStringAtIndex(e&_._I,0,s)}getComputedNumericAtIndex(e,t){const s=e&_._I;return this._ensureNumeric(t,s),this._numerics[t][s]}setComputedNumericAtIndex(e,t,s){const r=e&_._I;this._ensureNumeric(t,r),this._numerics[t][r]=s}getInstanceId(e){const t=e&_._I;return this._ensureInstanceId(t),this._instanceIds[t]}setInstanceId(e,t){const s=e&_._I;this._ensureInstanceId(s),this._instanceIds[s]=t}getComputedStringAtIndex(e,t){const s=e&_._I;return this._ensureString(t,s),this._strings[t][s]}setComputedStringAtIndex(e,t,s){const r=e&_._I;this._ensureString(t,r),this._strings[t][r]=s}getXMin(e){return this._bounds[4*(e&_._I)]}getYMin(e){return this._bounds[4*(e&_._I)+1]}getXMax(e){return this._bounds[4*(e&_._I)+2]}getYMax(e){return this._bounds[4*(e&_._I)+3]}setBounds(e,t){const s=t.readHydratedGeometry();if(!s||!s.coords.length)return!1;let r=1/0,i=1/0,n=-1/0,a=-1/0;s.forEachVertex(((e,t)=>{r=Math.min(r,e),i=Math.min(i,t),n=Math.max(n,e),a=Math.max(a,t)}));const o=e&_._I;return nt(this._bounds,4*o+4,0),this._bounds[4*o]=r,this._bounds[4*o+1]=i,this._bounds[4*o+2]=n,this._bounds[4*o+3]=a,!0}}function ot(e){if(!(0,u.D_)(e)&&!function(e){return"worker:port-closed"===e.name}(e))throw e}function ht(e){return"feature"===e.type&&"snapshot"===e.mode}let ct=class extends i.r{constructor(){super(...arguments),this._storage=new at,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initAttributeStore(),this._initStores(),this._initQueryEngine(),this._initSource(),this._updateQueue=new ie.e({concurrency:"geoevent"===this._source.type?1:4,process:(e,t)=>this._onTileMessage(e,{signal:t})}),this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this)),this.watch("updating",(e=>!e&&this.onIdle()))]),this._checkUpdating=setInterval((()=>this.notifyChange("updating")),300)}async startup(){this._initAttributeStore()}_initSource(){const e=this.tileStore.tileScheme;this._source=function(e,t,s,r,i,n){const a=function(e,t,s,r,i,n){switch(e.type){case"snapshot":return{type:"feature",origin:"snapshot",featureCount:(0,c.Pt)(e.featureCount,0),serviceInfo:e,onMessage:r,outSR:t,tileInfoView:s,canAcceptRequest:i,store:n};case"stream":return{type:"geoevent",serviceInfo:e,onMessage:r,outSR:t,canAcceptRequest:i};case"memory":case"on-demand":return{type:"feature",serviceInfo:e,onMessage:r,outSR:t,origin:function(e){return Array.isArray(e)?"local":"path"in e&&(0,m.M8)(e.path)?"hosted":"unknown"}(e.source),tileInfoView:s,canAcceptRequest:i}}}(e,t,s,r,i,n);switch(a.type){case"feature":switch(a.origin){case"hosted":case"local":return new Ee(a);case"snapshot":return new De(a);case"unknown":return new ce(a)}case"geoevent":return new ke(a)}}(this.service,this.spatialReference,e,((e,t)=>(this._invalidated=!0,this._patchTile(e,t))),(()=>this._updateQueue.length<50),this.featureStore),this._proxyEvents()}_proxyEvents(){if("geoevent"===this._source.type){const e=this._source.events;this.handles.add([e.on("connectionStatus",(e=>this.remoteClient.invoke("setProperty",{propertyName:"connectionStatus",value:e}).catch(ot))),e.on("errorString",(e=>this.remoteClient.invoke("setProperty",{propertyName:"errorString",value:e}).catch(ot))),e.on("feature",(e=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}}).catch(ot))),e.on("updateRate",(e=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...e}}).catch(ot)))])}}_initAttributeStore(){this.attributeStore?this.attributeStore.invalidateResources():this.attributeStore=new Xe({type:"remote",initialize:(e,t)=>(0,u.R8)(this.remoteClient.invoke("tileRenderer.featuresView.attributeView.initialize",e,{signal:t}).catch(ot)),update:(e,t)=>(0,u.R8)(this.remoteClient.invoke("tileRenderer.featuresView.attributeView.requestUpdate",e,{signal:t}).catch(ot)),render:e=>(0,u.R8)(this.remoteClient.invoke("tileRenderer.featuresView.requestRender",void 0,{signal:e}).catch(ot))},this.config)}_initStores(){const e="snapshot"===this.service.type?"snapshot":"on-demand",t={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new f.p(t,this._storage,e),this.aggregateStore=new st(t,this.spatialReference,this._storage),this.handles.add(this.aggregateStore.events.on("valueRangesChanged",(e=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:e.valueRanges}}).catch(ot)})))}_initQueryEngine(){var e;const t=this;null==(e=this.queryEngine)||e.destroy(),this.queryEngine=new p.Z({definitionExpression:this.config.definitionExpression,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds:e=>t.aggregateStore.getFeatureDisplayIdsForAggregate(e).map((e=>t.getObjectId(e)))},timeInfo:this.service.timeInfo})}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.queryEngine.destroy(),this.attributeStore&&this.attributeStore.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating)}get fieldsIndex(){return new g.Z(this.service.fields)}get hasAggregates(){return!!this.config.schema.targets.aggregate}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){return this._source.updating||!!this._updateQueue.length}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}async update(e,t){this._set("config",t),this._schema=t.schema,this._initQueryEngine(),await Promise.all([this._source.update(e,t.schema.source),this.featureStore.updateSchema(e,t.schema.targets.feature),this.attributeStore.update(e,t),this.attributeStore.updateFilters(e,this)]),await this.aggregateStore.updateSchema(e,t.schema.targets.aggregate),(0,n.Z)("esri-2d-update-debug")&&e.describe()}async applyUpdate(e){e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),this.notifyChange("updating"),await(0,l.OY)(this,"updating",!0),this.hasAggregates&&(await(0,u.e4)(10),await(0,l.OY)(this,"updating",!0))}async onEdits({edits:e}){(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const t=e.removed.map((e=>e.objectId&&-1!==e.objectId?e.objectId:this._lookupObjectIdByGlobalId(e.globalId))),s=e.addOrModified.map((({objectId:e})=>e));this.featureStore.invalidate(),await this._source.edit(s,t),this.clearTiles(),this.notifyChange("updating"),this.aggregateStore.clear(),await this._source.resend(),await(0,l.OY)(this,"updating",!0)}catch(e){}}async refresh(e){if(!e){const e=te.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(),this._cleanupNeeded=!0,this.notifyChange("updating"),await(0,l.OY)(this,"updating",!0)}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e)}onTileUpdate(e){this.aggregateStore.onTileUpdate(e);for(const t of e.added)this._source.subscribe(t),this._level=t.level;for(const t of e.removed)this._source.unsubscribe(t),this._cleanupNeeded=!0,this._tileToResolver.has(t.id)&&(this._tileToResolver.get(t.id).resolve(),this._tileToResolver.delete(t.id));this.notifyChange("updating")}onIdle(){this._invalidated&&((this.hasAggregates||"heatmap"===this.processor.type)&&this._repushCurrentLevelTiles(),this._invalidated=!1),this._markAndSweep()}async querySummaryStatistics({query:e,params:t}){return this.queryEngine.executeQueryForSummaryStatistics(e,t)}async queryUniqueValues({query:e,params:t}){return this.queryEngine.executeQueryForUniqueValues(e,t)}async queryClassBreaks({query:e,params:t}){return this.queryEngine.executeQueryForClassBreaks(e,t)}async queryHistogram({query:e,params:t}){return this.queryEngine.executeQueryForHistogram(e,t)}queryExtent(e){return this.queryEngine.executeQueryForExtent(e)}queryFeatures(e){return this.queryEngine.executeQuery(e)}async queryVisibleFeatures(e){const t=await this.queryEngine.executeQuery(e),s=t.objectIdFieldName;return t.features=t.features.filter((e=>{const t=e.attributes[s],r=this.getDisplayId(t);return this.attributeStore.isVisible(r)})),t}queryFeatureCount(e){return this.queryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.queryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.queryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(this._schema.targets.aggregate){const t=this.aggregateStore.getDisplayId(e);if((0,c.Wi)(t)){const t=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(t)}return t}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const t=[],s=[];for(const r of e)if((0,_.nE)(r)){const e=this.getAggregate(r);if((0,c.pC)(e))if((0,c.pC)(e.referenceId)){const s=this.getFeature(e.referenceId);(0,c.pC)(s)&&t.push(s)}else s.push(e)}else{const e=this.getFeature(r);(0,c.pC)(e)&&t.push(e)}return{features:t,aggregates:s}}getFeature(e){const t=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if((0,c.Wi)(t))return null;const s=t.readHydratedGeometry(),r=(0,d.di)(s,t.geometryType,t.hasZ,t.hasM);return{attributes:t.readAttributes(),geometry:r}}getAggregate(e){return this.aggregateStore.getAggregate(e)}getAggregates(){return this.aggregateStore.getAggregates()}async setHighlight(e){const t=e.map((e=>this.getDisplayId(e)));return this.attributeStore.setHighlight(e,t)}_lookupObjectIdByGlobalId(e){const t=this.service.globalIdField;if((0,c.Wi)(t))throw new Error("Expected globalIdField to be defined");let s=null;if(this.featureStore.forEach((r=>{e===r.readAttribute(t)&&(s=r.getObjectId())})),(0,c.Wi)(s))throw new Error(`Expected to find a feature with globalId ${e}`);return s}_repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter((e=>e.level===this._level));for(const t of e)this._patchTile({type:"append",id:t.key.id,addOrUpdate:F.fromOptimizedFeatures([],this.service.geometryType),remove:[],end:!0,status:te.empty()})}_maybeForceCleanup(){performance.now()-this._lastCleanup>5e3&&this._markAndSweep()}_patchTile(e,t){const s=this._updateQueue.push(e,t).then((()=>{this.notifyChange("updating")})).catch((e=>{this.notifyChange("updating")}));return this.notifyChange("updating"),s}async _onTileMessage(e,t){(0,u.k_)(t);const s=this.tileStore.get(e.id);if(!s)return;if(e.clear)return this.processor.onTileClear(s);const r=e.status;this._cleanupNeeded=!0;const i=[];for(const t of e.remove){const e=this.featureStore.lookupDisplayId(t);e&&i.push(e)}e.remove=i;try{if((0,c.Wi)(e.addOrUpdate))return void this.processor.onTileMessage(s,{...e,addOrUpdate:null},this.hasAggregates,t).catch(u.H9);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&r.targets.feature||(r.targets.feature=!0,this.featureStore.onTileData(s,e)),r.storage.data&&r.storage.filters||(r.storage.data=!0,r.storage.filters=!0,this.attributeStore.onTileData(s,e),"geoevent"===this._source.type||this._didEdit?(await this.attributeStore.sendUpdates(),(0,u.k_)(t)):this.attributeStore.sendUpdates()),this.hasAggregates&&!r.targets.aggregate){r.targets.aggregate=!0;const t=ht(this._source)&&this._source.loading,i=!ht(this._source)||t||e.end;if(this.aggregateStore.onTileData(s,e,this._storage,this.attributeStore,i),!i)return;r.mesh||(this.attributeStore.onTileData(s,e),await this.attributeStore.sendUpdates(),this.processor.onTileClear(s))}r.mesh||(r.mesh=!0,await this.processor.onTileMessage(s,e,this.hasAggregates,t),(0,u.k_)(t)),this._maybeForceCleanup()}catch(e){(0,u.H9)(e)}}_mark(e,t,s){const r=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(t.add(r),s.set(e))}_markAndSweep(){if(this._lastCleanup=performance.now(),"feature"===this._source.type&&"snapshot"===this._source.mode||"geoevent"!==this._source.type&&!this._cleanupNeeded)return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),t=new Set;e.clear();for(const s of this.tileStore.tiles)for(const r of this._source.readers(s.id)){const s=r.getCursor();for(;s.next();){let r=s.getDisplayId();if(!r){const e=s.getObjectId();r=this.featureStore.lookupDisplayId(e)}this._mark(r,t,e)}}"symbol"===this.processor.type&&this.processor.forEachBufferId((s=>{this._mark(s,t,e)})),this._updateQueue.forEach((s=>{for(const r of s.remove){const s=this.featureStore.lookupDisplayId(r);this._mark(s,t,e)}})),this.config.schema.targets.aggregate&&(this.aggregateStore.sweepFeatures(e,this.featureStore),this.aggregateStore.sweepClusters(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(t)}};(0,r._)([(0,a.Cb)({constructOnly:!0})],ct.prototype,"tileStore",void 0),(0,r._)([(0,a.Cb)()],ct.prototype,"config",void 0),(0,r._)([(0,a.Cb)({readOnly:!0})],ct.prototype,"fieldsIndex",null),(0,r._)([(0,a.Cb)()],ct.prototype,"processor",void 0),(0,r._)([(0,a.Cb)({constructOnly:!0})],ct.prototype,"remoteClient",void 0),(0,r._)([(0,a.Cb)({constructOnly:!0})],ct.prototype,"service",void 0),(0,r._)([(0,a.Cb)()],ct.prototype,"spatialReference",null),(0,r._)([(0,a.Cb)()],ct.prototype,"updating",null),ct=(0,r._)([(0,o.j)("esri.views.2d.layers.features.controllers.FeatureController2D")],ct);const ut=ct;var lt=s(3651),dt=s(67524),pt=s(55415);const gt={added:[],removed:[]},_t=new Set,ft=new pt.Z(0,0,0,0);class mt extends $.Z{constructor(e){super(),this._tiles=new Map,this._index=(0,ue.r)(9,(0,n.Z)("esri-csp-restrictions")?e=>({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=e}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const t={added:[],removed:[]};for(const s of e.added)if(!this.has(s)){const e=new lt.n(this.tileScheme,s);this._tiles.set(s,e),this._index.insert(e),t.added.push(e)}for(const s of e.removed)if(this.has(s)){const e=this.get(s);this._tiles.delete(s),this._index.remove(e),t.removed.push(e)}this.tiles.length=0,this._tiles.forEach((e=>this.tiles.push(e))),(t.added.length||t.removed.length)&&this.emit("update",t)}setViewState(e){const t=this.tileScheme.getTileCoverage(e,0);if(!t)return;const{spans:s,lodInfo:r}=t,{level:i}=r;if(s.length>0)for(const{row:e,colFrom:t,colTo:n}of s)for(let s=t;s<=n;s++){const t=ft.set(i,e,r.normalizeCol(s),r.getWorldForColumn(s)).id;if(_t.add(t),!this.has(t)){const e=new lt.n(this.tileScheme,t);this._tiles.set(t,e),this._index.insert(e),this.tiles.push(e),gt.added.push(e)}}for(let e=this.tiles.length-1;e>=0;e--){const t=this.tiles[e];_t.has(t.id)||(this._tiles.delete(t.id),this.tiles.splice(e,1),this._index.remove(t),gt.removed.push(t))}(gt.added.length||gt.removed.length)&&this.emit("update",gt),dt.Z.pool.release(t),_t.clear(),gt.added.length=0,gt.removed.length=0}}var yt=s(83068);const It=new Set;function xt(){return It}let bt=class extends i.r{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.handles.add(this.watch("updating",(e=>{this.remoteClient.invoke("setUpdating",e).catch((e=>{}))})))}destroy(){var e,t,s;null==(e=this.controller)||e.destroy(),null==(t=this.processor)||t.destroy(),null==(s=this.tileStore)||s.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}async startup({service:e,config:t,tileInfo:s,tiles:r}){if(this._paused=!0,this.service=e,!this.tileStore){const e=new yt.Z(h.Z.fromJSON(s));this.tileStore=new mt(e)}for(await this._createProcessorAndController(t),await this.update({config:t},!0),this.tileStore.clear(),this.tileStore.updateTiles(r),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(e){this._paused?this._pendingTileUpdates.push(e):this.tileStore.updateTiles(e)}async update({config:e},t=!1){const s=te.empty();return t||this.controller.pause(),await Promise.all([this.processor.update(s,e),this.controller.update(s,e)]),s.toJSON()}async applyUpdate(e){return this.controller.applyUpdate(te.create(e))}async _createProcessorAndController(e){await Promise.all([this._handleControllerConfig(e),this._handleProcessorConfig(e)]),this.controller.processor=this.processor}async _handleControllerConfig(e){const t=await this._createController(this.service,e);return await t.startup(),t}async _handleProcessorConfig(e){return this._createProcessor(this.service,e)}async _createController(e,t){this.controller&&this.controller.destroy();const{tileStore:s,remoteClient:r}=this,i=new ut({service:e,config:t,tileStore:s,remoteClient:r});return this.controller=i,i}async _createProcessor(e,t){const r=t.schema.processors[0].type,i=(await function(e){return"heatmap"===e?s.e(2399).then(s.bind(s,12399)):Promise.all([s.e(8422),s.e(6810),s.e(3437)]).then(s.bind(s,61945))}(r)).default,{remoteClient:n,tileStore:a}=this,o=new i({service:e,config:t,tileStore:a,remoteClient:n});return this.processor&&this.processor.destroy(),this.processor=o,o}};(0,r._)([(0,a.Cb)()],bt.prototype,"controller",void 0),(0,r._)([(0,a.Cb)()],bt.prototype,"processor",void 0),(0,r._)([(0,a.Cb)()],bt.prototype,"updating",null),(0,r._)([(0,a.Cb)()],bt.prototype,"viewState",void 0),bt=(0,r._)([(0,o.j)("esri.views.2d.layers.features.Pipeline")],bt);const wt=bt},59999:(e,t,s)=>{s.d(t,{J:()=>c});var r=s(80442),i=s(70586),n=s(22862),a=s(59266),o=s(92604);const h=s.e(4695).then(s.bind(s,14695));class c{constructor(e,t){this._canCacheExpressionValue=!1,this._sourceInfo=e,this._bitsets={computed:t.getBitset(t.createBitset())}}invalidate(){this._bitsets.computed.clear()}async updateSchema(e,t){const s=(0,n.Hg)(this._schema,t);if(this._schema=t,!t||(0,i.Wi)(s)||!(0,n.uD)(s,"attributes"))return;(0,r.Z)("esri-2d-update-debug")&&console.debug("Applying Update - Store:",s),this._bitsets.computed.clear(),e.targets[t.name]=!0;const a=t.attributes,o=[],h=[];for(const e in a){const t=a[e];switch(t.type){case"field":break;case"expression":o.push(this._createArcadeComputedField(t));break;case"label-expression":o.push(this._createLabelArcadeComputedField(t));break;case"statistic":h.push(t)}}this._computedFields=await Promise.all(o),this._canCacheExpressionValue=!this._computedFields.some((e=>"expression"===e.type&&e.expression.referencesScale())),this._statisticFields=h}setComputedAttributes(e,t,s,r){const i=this._bitsets.computed;if(!this._canCacheExpressionValue||!i.has(s)){i.set(s);for(const i of this._computedFields){const n=this._evaluateField(t,i,r);switch(i.resultType){case"numeric":e.setComputedNumericAtIndex(s,i.fieldIndex,n);break;case"string":e.setComputedStringAtIndex(s,i.fieldIndex,n)}}}}async _createArcadeComputedField(e){const t=this._sourceInfo.spatialReference,s=this._sourceInfo.fieldsIndex;return{...e,expression:await(0,a.Yi)(e.valueExpression,t,s)}}async _createLabelArcadeComputedField(e){const t=this._sourceInfo.spatialReference,s=this._sourceInfo.fieldsIndex,{createLabelFunction:r}=await h,i=await r(e.label,s,t);return{...e,builder:i}}_evaluateField(e,t,s){switch(t.type){case"label-expression":{const s=e.readArcadeFeature();return t.builder.evaluate(s)||""}case"expression":{const{expression:r}=t;return function(e,t,s){e.referencesGeometry();const r=t.readArcadeFeature();try{return e.evaluate({...s,$feature:r})}catch(e){return o.Z.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",e),null}}(r,e,{$view:{scale:s}})}}}}},87554:(e,t,s)=>{s.d(t,{s:()=>C}),s(66577);var r,i,n,a=s(80442),o=s(70586),h=s(29730),c=s(98732),u=s(5428),l=s(93054),d=s(33955);let p=0;const g=null!=(r=(0,a.Z)("featurelayer-simplify-thresholds"))?r:[.5,.5,.5,.5],_=g[0],f=g[1],m=g[2],y=g[3],I=null!=(i=(0,a.Z)("featurelayer-simplify-payload-size-factors"))?i:[1,2,4],x=I[0],b=I[1],w=I[2],v=null!=(n=(0,a.Z)("featurelayer-simplify-mobile-factor"))?n:2,S=(0,a.Z)("esri-mobile");class C{constructor(e){this.type="FeatureSetReader",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._level=0,this.instance=e}static createInstance(){return p++,p=p>65535?0:p,p}get isEmpty(){return(0,o.pC)(this._deleted)&&this._deleted.countSet()===this.getSize()}set level(e){this._level=e}getAreaSimplificationThreshold(e,t){let s=1;const r=S?v:1;t>4e6?s=w*r:t>1e6?s=b*r:t>5e5?s=x*r:t>1e5&&(s=r);let i=0;e>4e3?i=y*s:e>2e3?i=m*s:e>100?i=f:e>15&&(i=_);let n=8;return this._level<4?n=1:this._level<5?n=2:this._level<6&&(n=4),i*n}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this.setComputedNumericAtIndex(t,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,t){return this.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,t){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,t)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,t){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,t)}transform(e,t,s,r){const i=this.copy();return i._tx+=e,i._ty+=t,i._sx*=s,i._sy*=r,i}readAttribute(e,t=!1){const s=this._readAttribute(e,t);if(void 0!==s)return s;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const s=t._readAttributes();for(const t of Object.keys(s))e[t]=s[t]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}geometry(){const e=this.readHydratedGeometry(),t=(0,c.di)(e,this.geometryType,this.hasZ,this.hasM),s=(0,d.im)(t);return s&&(s.spatialReference=this._arcadeSpatialReference),s}field(e){return this.readAttribute(e,!0)}hasField(e){return!0}setField(e,t){}keys(){return[]}castToText(){return""}removeIds(e){if((0,o.Wi)(this._objectIdToIndex)){const e=new Map,t=this.getCursor();for(;t.next();)e.set(t.getObjectId(),t.getIndex());this._objectIdToIndex=e}const t=this._objectIdToIndex;for(const s of e)t.has(s)&&this.removeAtIndex(t.get(s))}removeAtIndex(e){(0,o.Wi)(this._deleted)&&(this._deleted=l.p.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return(0,o.Wi)(this._deleted)||!this._deleted.has(this.getIndex())}_computeCentroid(){if("esriGeometryPolygon"!==this.geometryType)return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const t=(0,o.Pt)(this.getQuantizationTransform(),null);return(0,h.Y)(new u.Z,e,this.hasM,this.hasZ,t)}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex}}},61800:(e,t,s)=>{s.d(t,{t:()=>i});var r=s(87554);class i extends r.s{constructor(e,t){super(r.s.createInstance()),this._currentIndex=-1,this._reader=e,this._indices=t}static from(e,t){return new i(e.copy(),t)}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const e=new i(this._reader.copy(),this._indices);return e._currentIndex=this._currentIndex,e}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}setArcadeSpatialReference(e){this._reader.setArcadeSpatialReference(e)}attachStorage(e){this._reader.attachStorage(e)}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}getStorage(){return this._reader.getStorage()}getComputedNumeric(e){return this._reader.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this._reader.setComputedNumericAtIndex(t,0)}getComputedString(e){return this._reader.getComputedStringAtIndex(0)}setComputedString(e,t){return this._reader.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._reader.getComputedNumericAtIndex(e)}setComputedNumericAtIndex(e,t){this._reader.setComputedNumericAtIndex(e,t)}getComputedStringAtIndex(e){return this._reader.getComputedStringAtIndex(e)}setComputedStringAtIndex(e,t){return this._reader.setComputedStringAtIndex(e,t)}transform(e,t,s,r){const i=this.copy();return i._reader=this._reader.transform(e,t,s,r),i}readAttribute(e,t=!1){return this._reader.readAttribute(e,t)}readAttributes(){return this._reader.readAttributes()}joinAttributes(e){return this._reader.joinAttributes(e)}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(e){return this.readAttribute(e,!0)}hasField(e){return this._reader.hasField(e)}setField(e,t){return this._reader.setField(e,t)}keys(){return this._reader.keys()}castToText(){return this._reader.castToText()}getQuantizationTransform(){return this._reader.getQuantizationTransform()}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(e){return this._reader.setDisplayId(e)}getGroupId(){return this._reader.getGroupId()}setGroupId(e){return this._reader.setGroupId(e)}getXHydrated(){return this._reader.getXHydrated()}getYHydrated(){return this._reader.getYHydrated()}getX(){return this._reader.getX()}getY(){return this._reader.getY()}setIndex(e){return this._reader.setIndex(e)}getIndex(){return this._reader.getIndex()}readLegacyFeature(){return this._reader.readLegacyFeature()}readOptimizedFeature(){return this._reader.readOptimizedFeature()}readLegacyPointGeometry(){return this._reader.readLegacyPointGeometry()}readLegacyGeometry(){return this._reader.readLegacyGeometry()}readLegacyCentroid(){return this._reader.readLegacyCentroid()}readGeometryArea(){return this._reader.readGeometryArea()}readUnquantizedGeometry(){return this._reader.readUnquantizedGeometry()}readHydratedGeometry(){return this._reader.readHydratedGeometry()}readGeometry(){return this._reader.readGeometry()}readCentroid(){return this._reader.readCentroid()}_readAttribute(e,t){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}}},93054:(e,t,s)=>{s.d(t,{p:()=>r});class r{constructor(e,t){this._mask=0,this._buf=e,this._mask=t}static fromBuffer(e,t){return new r(e,t)}static create(e,t=4294967295){const s=new Uint32Array(Math.ceil(e/32));return new r(s,t)}_getIndex(e){return Math.floor(e/32)}has(e){const t=this._mask&e;return!!(this._buf[this._getIndex(t)]&1<<t%32)}hasRange(e,t){let s=e,r=t;for(;s%32&&s!==r;){if(this.has(s))return!0;s++}for(;r%32&&s!==r;){if(this.has(s))return!0;r--}if(s===r)return!1;for(let e=s/32;e!==r/32;e++)if(this._buf[e])return!0;return!1}set(e){const t=this._mask&e,s=this._getIndex(t),r=1<<t%32;this._buf[s]|=r}setRange(e,t){let s=e,r=t;for(;s%32&&s!==r;)this.set(s++);for(;r%32&&s!==r;)this.set(r--);if(s!==r)for(let e=s/32;e!==r/32;e++)this._buf[e]=4294967295}unset(e){const t=this._mask&e,s=this._getIndex(t),r=1<<t%32;this._buf[s]&=4294967295^r}resize(e){const t=this._buf,s=new Uint32Array(Math.ceil(e/32));s.set(t),this._buf=s}or(e){for(let t=0;t<this._buf.length;t++)this._buf[t]|=e._buf[t];return this}and(e){for(let t=0;t<this._buf.length;t++)this._buf[t]&=e._buf[t];return this}xor(e){for(let t=0;t<this._buf.length;t++)this._buf[t]^=e._buf[t];return this}ior(e){for(let t=0;t<this._buf.length;t++)this._buf[t]|=~e._buf[t];return this}iand(e){for(let t=0;t<this._buf.length;t++)this._buf[t]&=~e._buf[t];return this}ixor(e){for(let t=0;t<this._buf.length;t++)this._buf[t]^=~e._buf[t];return this}any(){for(let e=0;e<this._buf.length;e++)if(this._buf[e])return!0;return!1}copy(e){for(let t=0;t<this._buf.length;t++)this._buf[t]=e._buf[t];return this}clone(){return new r(this._buf.slice(),this._mask)}clear(){for(let e=0;e<this._buf.length;e++)this._buf[e]=0}forEachSet(e){for(let t=0;t<this._buf.length;t++){let s=this._buf[t],r=32*t;if(s)for(;s;)1&s&&e(r),s>>>=1,r++}}countSet(){let e=0;return this.forEachSet((t=>{e++})),e}}},3651:(e,t,s)=>{s.d(t,{n:()=>h});var r=s(3894),i=s(6570),n=s(24470),a=s(6388),o=s(55415);class h{constructor(e,t){this.key=new o.Z(0,0,0,0),this.bounds=(0,n.Ue)(),this.objectIds=new Set,this.key.set(t);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.scale=s.scale,this.level=s.level}get id(){return this.key.id}get extent(){return i.Z.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createChildTiles(){const e=this.key.getChildKeys(),t=r.Z.acquire();for(let s=0;s<e.length;s++)t[s]=new h(this.tileInfoView,e[s]);return t}getQuantizationParameters(){return a.Z.fromJSON({mode:"view",originPosition:"upperLeft",tolerance:this.resolution,extent:{xmin:this.bounds[0],ymin:this.bounds[1],xmax:this.bounds[2],ymax:this.bounds[3],spatialReference:this.tileInfoView.tileInfo.spatialReference}})}}},67524:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(71143);class i{constructor(){this.spans=[]}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}forEach(e,t){const{spans:s,lodInfo:r}=this,{level:i}=r;if(0!==s.length)for(const{row:n,colFrom:a,colTo:o}of s)for(let s=a;s<=o;s++)e.call(t,i,n,r.normalizeCol(s),r.getWorldForColumn(s))}}i.pool=new r.Z(i)},83068:(e,t,s)=>{s.d(t,{Z:()=>_});var r=s(8744),i=s(70586),n=s(55415);function a(e,t){return[e,t]}function o(e,t,s){return e[0]=t,e[1]=s,e}const h=new n.Z("0/0/0/0");class c{constructor(e,t,s,r,i,n,a,o,h,c,u,l){this.level=e,this.resolution=t,this.scale=s,this.origin=r,this.first=i,this.last=n,this.size=a,this.norm=o,this.worldStart=h,this.worldEnd=c,this.worldSize=u,this.wrap=l}static create(e,t,s=null){const n=(0,r.C5)(e.spatialReference),h=t.origin||a(e.origin.x,e.origin.y),u=a(e.size[0]*t.resolution,e.size[1]*t.resolution),l=a(-1/0,-1/0),d=a(1/0,1/0),p=a(1/0,1/0);(0,i.pC)(s)&&(o(l,Math.max(0,Math.floor((s.xmin-h[0])/u[0])),Math.max(0,Math.floor((h[1]-s.ymax)/u[1]))),o(d,Math.max(0,Math.floor((s.xmax-h[0])/u[0])),Math.max(0,Math.floor((h[1]-s.ymin)/u[1]))),o(p,d[0]-l[0]+1,d[1]-l[1]+1));const{cols:g,rows:_}=t;let f,m,y,I;return!s&&g&&_&&(o(l,g[0],_[0]),o(d,g[1],_[1]),o(p,g[1]-g[0]+1,_[1]-_[0]+1)),e.isWrappable?(f=a(Math.ceil(Math.round((n.valid[1]-n.valid[0])/t.resolution)/e.size[0]),p[1]),m=a(Math.floor((n.origin[0]-h[0])/u[0]),l[1]),y=a(f[0]+m[0]-1,d[1]),I=!0):(m=l,y=d,f=p,I=!1),new c(t.level,t.resolution,t.scale,h,l,d,p,u,m,y,f,I)}normalizeCol(e){if(!this.wrap)return e;const t=this.worldSize[0];return e<0?t-1-Math.abs((e+1)%t):e%t}denormalizeCol(e,t){return this.wrap?this.worldSize[0]*t+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){return this.origin[0]+e*this.norm[0]}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,t,s=!1){h.set(t);const r=s?h.col:this.denormalizeCol(h.col,h.world),i=h.row;return function(e,t,s,r,i){e[0]=t,e[1]=s,e[2]=r,e[3]=i}(e,this.getXForColumn(r),this.getYForRow(i+1),this.getXForColumn(r+1),this.getYForRow(i)),e}getTileCoords(e,t,s=!1){h.set(t);const r=s?h.col:this.denormalizeCol(h.col,h.world);return Array.isArray(e)?o(e,this.getXForColumn(r),this.getYForRow(h.row)):(e.x=this.getXForColumn(r),e.y=this.getYForRow(h.row)),e}}var u=s(67524);class l{constructor(e,t,s){this.row=e,this.colFrom=t,this.colTo=s}}const d=new n.Z("0/0/0/0");class p{constructor(e,t,s,r,i,n,a,o){this.x=e,this.ymin=t,this.ymax=s,this.invM=r,this.leftAdjust=i,this.rightAdjust=n,this.leftBound=a,this.rightBound=o}static create(e,t){e[1]>t[1]&&([e,t]=[t,e]);const[s,r]=e,[i,n]=t,a=i-s,o=n-r,h=0!==o?a/o:0,c=(Math.ceil(r)-r)*h,u=(Math.floor(r)-r)*h;return new p(s,Math.floor(r),Math.ceil(n),h,a<0?c:u,a<0?u:c,a<0?i:s,a<0?s:i)}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const g=[[0,0],[0,0],[0,0],[0,0]];class _{constructor(e,t=null){this.tileInfo=e,this.fullExtent=t,this.scales=[],this._lodInfos=null,this._infoByScale={},this._infoByLevel={};const s=e.lods.slice();s.sort((function(e,t){return t.scale-e.scale}));const r=this._lodInfos=s.map((s=>c.create(e,s,t)));s.forEach(((e,t)=>{this._infoByLevel[e.level]=r[t],this._infoByScale[e.scale]=r[t],this.scales[t]=e.scale}),this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(e){return this._infoByLevel["number"==typeof e?e:e.level]}getTileBounds(e,t,s=!1){d.set(t);const r=this._infoByLevel[d.level];return r?r.getTileBounds(e,d,s):e}getTileCoords(e,t,s=!1){d.set(t);const r=this._infoByLevel[d.level];return r?r.getTileCoords(e,d,s):e}getTileCoverage(e,t=192,s="closest"){const r="closest"===s?this.getClosestInfoForScale(e.scale):this.getSmallestInfoForScale(e.scale),i=u.Z.pool.acquire(r),n=this._wrap;let a,o,h,c=1/0,d=-1/0;const _=i.spans;g[0][0]=g[0][1]=g[1][1]=g[3][0]=-t,g[1][0]=g[2][0]=e.size[0]+t,g[2][1]=g[3][1]=e.size[1]+t;for(const t of g)e.toMap(t,t),t[0]=r.getColumnForX(t[0]),t[1]=r.getRowForY(t[1]);const f=[];let m=3;for(let e=0;e<4;e++){if(g[e][1]===g[m][1]){m=e;continue}const t=p.create(g[e],g[m]);c=Math.min(t.ymin,c),d=Math.max(t.ymax,d),void 0===f[t.ymin]&&(f[t.ymin]=[]),f[t.ymin].push(t),m=e}if(null==c||null==d||d-c>100)return null;let y=[];for(a=c;a<d;){null!=f[a]&&(y=y.concat(f[a])),o=1/0,h=-1/0;for(let e=y.length-1;e>=0;e--){const t=y[e];o=Math.min(o,t.getLeftCol()),h=Math.max(h,t.getRightCol())}if(o=Math.floor(o),h=Math.floor(h),a>=r.first[1]&&a<=r.last[1])if(n)if(r.size[0]<r.worldSize[0]){const e=Math.floor(h/r.worldSize[0]);for(let t=Math.floor(o/r.worldSize[0]);t<=e;t++)_.push(new l(a,Math.max(r.getFirstColumnForWorld(t),o),Math.min(r.getLastColumnForWorld(t),h)))}else _.push(new l(a,o,h));else o>r.last[0]||h<r.first[0]||(o=Math.max(o,r.first[0]),h=Math.min(h,r.last[0]),_.push(new l(a,o,h)));a+=1;for(let e=y.length-1;e>=0;e--){const t=y[e];t.ymax>=a?t.incrRow():y.splice(e,1)}}return i}getTileParentId(e){d.set(e);const t=this._infoByLevel[d.level],s=this._lodInfos.indexOf(t)-1;return s<0?null:(this._getTileIdAtLOD(d,this._lodInfos[s],d),d.id)}getTileResolution(e){const t=this._infoByLevel["object"==typeof e?e.level:e];return t?t.resolution:-1}getTileScale(e){const t=this._infoByLevel[e.level];return t?t.scale:-1}intersects(e,t){d.set(t);const s=this._infoByLevel[d.level],r=e.lodInfo;if(r.resolution>s.resolution){this._getTileIdAtLOD(d,r,d);const t=r.denormalizeCol(d.col,d.world);for(const s of e.spans)if(s.row===d.row&&s.colFrom<=t&&s.colTo>=t)return!0}if(r.resolution<s.resolution){const[t,i,n,a]=e.spans.reduce(((e,t)=>(e[0]=Math.min(e[0],t.row),e[1]=Math.max(e[1],t.row),e[2]=Math.min(e[2],t.colFrom),e[3]=Math.max(e[3],t.colTo),e)),[1/0,-1/0,1/0,-1/0]),o=s.denormalizeCol(d.col,d.world),h=r.getColumnForX(s.getXForColumn(o)),c=r.getRowForY(s.getYForRow(d.row)),u=r.getColumnForX(s.getXForColumn(o+1))-1,l=r.getRowForY(s.getYForRow(d.row+1))-1;return!(h>a||u<n||c>i||l<t)}const i=r.denormalizeCol(d.col,d.world);return e.spans.some((e=>e.row===d.row&&e.colFrom<=i&&e.colTo>=i))}normalizeBounds(e,t,s){if(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._wrap){const t=(0,r.C5)(this.tileInfo.spatialReference),i=-s*(t.valid[1]-t.valid[0]);e[0]+=i,e[2]+=i}return e}getSmallestInfoForScale(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>t[0])return this._infoByScale[t[0]];for(let s=1;s<t.length-1;s++)if(e>t[s]+1e-6)return this._infoByScale[t[s-1]];return this._infoByScale[t[t.length-1]]}getClosestInfoForScale(e){const t=this.scales;return this._infoByScale[e]||(e=t.reduce(((t,s)=>Math.abs(s-e)<Math.abs(t-e)?s:t),t[0])),this._infoByScale[e]}scaleToLevel(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e].level;for(let s=t.length-1;s>=0;s--)if(e<t[s])return s===t.length-1?this._infoByScale[t[t.length-1]].level:this._infoByScale[t[s]].level+(t[s]-e)/(t[s]-t[s+1]);return this._infoByScale[t[0]].level}scaleToZoom(e){return this.tileInfo.scaleToZoom(e)}_getTileIdAtLOD(e,t,s){const r=this._infoByLevel[s.level];return e.set(s),t.resolution<r.resolution?null:(t.resolution===r.resolution||(e.level=t.level,e.col=Math.floor(s.col*r.resolution/t.resolution+.01),e.row=Math.floor(s.row*r.resolution/t.resolution+.01)),e)}}},55415:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(71143);class i{constructor(e,t,s,r){this.set(e,t,s,r)}static getId(e,t,s,r){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${s}/${r}`}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,s=63&this.level;return(3&this.world)<<30|t<<22|e<<8|s}acquire(e,t,s,r){this.set(e,t,s,r)}contains(e){const t=e.level-this.level;return 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,s,r){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,s,r,i]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(s),this.col=parseFloat(r),this.world=parseFloat(i)}else this.level=+e,this.row=+t,this.col=+s,this.world=+r||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,s=this.col<<1,r=this.world;return[new i(e,t,s,r),new i(e,t,s+1,r),new i(e,t+1,s,r),new i(e,t+1,s+1,r)]}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 r.Z(i,null,null,25,50)},34084:(e,t,s)=>{s.d(t,{e:()=>h});var r=s(70586),i=s(95330);class n{constructor(e=(e=>e.values().next().value)){this._peeker=e,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(0===this._items.size)return;let e;for(e of this._items);return e}peek(){if(0!==this._items.size)return this._peeker(this._items)}push(e){this.contains(e)||this._items.add(e)}contains(e){return this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete((0,r.j0)(e)),e}popLast(){if(0===this.length)return;const e=this.last();return this._items.delete((0,r.j0)(e)),e}remove(e){this._items.delete(e)}filter(e){return this._items.forEach((t=>{e(t)||this._items.delete(t)})),this}}var a=s(1654);class o{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class h{constructor(e){this._deferreds=new Map,this._controllers=new Map,this._processingItems=new Map,this._isPaused=!1,this._schedule=null,this._task=null,this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new n(e.peeker),this.process=e.process;const t=e.scheduler;e.priority&&(0,r.pC)(t)&&(this._task=t.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule&&(this._schedule.remove(),this._schedule=null),this._task&&(this._task.remove(),this._task=null)}get length(){return this._processingItems.size+this._queue.length}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach((t=>e.push(t))),this._controllers.clear(),e.forEach((e=>e.abort())),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach(((t,s)=>e(s)))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._isPaused||(this._isPaused=!0,this._cancelNext())}push(e,t){const s=this.get(e);if(s)return s;const n=new AbortController;let a=null;t&&(a=(0,i.fu)(t,(()=>n.abort())));const o=()=>{h.remove(),(0,r.pC)(a)&&a.remove(),this._deferreds.delete(e),this._controllers.delete(e),this._queue.remove(e),this._processingItems.delete(e),this._scheduleNext()},h=(0,i.$F)(n.signal,(()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),o(),c.reject((0,i.zE)())})),c=(0,i.dD)();return this._deferreds.set(e,c),this._controllers.set(e,n),c.promise.then(o,o),this._queue.push(e),this._scheduleNext(),c.promise}last(){return this._queue.last()}peek(){return this._queue.peek()}popLast(){return this._queue.popLast()}reset(){const e=[];this._processingItems.forEach((t=>e.push(t))),this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._isPaused&&(this._isPaused=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._isPaused&&this._queue.length>0&&this._processingItems.size<this.concurrency}runTask(e){for(;!e.done&&this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop()),e.madeProgress()}_scheduleNext(){this._task||this._isPaused||this._schedule||(this._schedule=(0,a.Os)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if((0,r.Wi)(e))return;let t;const s=new AbortController,n=new o(e,s);this._processingItems.set(e,n);try{t=this.process(e,s.signal)}catch(e){this._processError(n,e)}(0,i.y8)(t)?(n.promise=t,t.then((e=>this._processResult(n,e)),(e=>this._processError(n,e)))):this._processResult(n,t)}get test(){return{update:e=>this.runTask(e)}}}},89749:(e,t,s)=>{s.d(t,{t:()=>p});var r=s(43697),i=s(15923),n=s(61247),a=s(70586),o=s(17445),h=s(1654),c=s(43050),u=s(67723),l=s(5600),d=s(52011);let p=class extends i.Z{constructor(){super(...arguments),this.updating=!1,this.handleId=0,this.handles=new n.Z,this.scheduleHandleId=0,this.pendingPromises=new Set}destroy(){this.removeAll(),this.handles.destroy()}add(e,t,s,r=0){const i=0!=(1&r),n=++this.handleId;i||this.installSyncUpdatingWatch(e,t,n);const a=0!=(2&r)?(0,c.S1)(e,t,s,i):e.watch(t,s,i);return this.handles.add(a,n),{remove:()=>this.handles.remove(n)}}addOnCollectionPropertyChange(e,t,s,r=0){const i=0!=(2&r),n=++this.handleId;return this.handles.add([(0,c.on)(e,t,"after-changes",this.createSyncUpdatingCallback()),(0,c.on)(e,t,"change",s,i?e=>{s({added:e.items,removed:[],moved:[],target:e})}:void 0)],n),{remove:()=>{this.handles.remove(n)}}}addOnCollectionChange(e,t,s=0){const r=0!=(2&s),i=++this.handleId;return this.handles.add([e.on("after-changes",this.createSyncUpdatingCallback()),e.on("change",t)],i),r&&t({added:e.items,removed:[],moved:[],target:e}),{remove:()=>{this.handles.remove(i)}}}addPromise(e){if((0,a.Wi)(e))return e;const t=++this.handleId;this.handles.add({remove:()=>{this.pendingPromises.delete(e)&&(0!==this.pendingPromises.size||this.handles.has(g)||this._set("updating",!1))}},t),this.pendingPromises.add(e),this._set("updating",!0);const s=()=>this.handles.remove(t);return e.then(s,s),e}removeAll(){this.pendingPromises.clear(),this.handles.removeAll(),this._set("updating",!1)}installSyncUpdatingWatch(e,t,s){const r=this.createSyncUpdatingCallback(),i=(0,o.Ym)((()=>(0,u.$z)(e,t)),r,{sync:!0,equals:()=>!1});return this.handles.add(i,s),i}createSyncUpdatingCallback(){return()=>{this.handles.remove(g),++this.scheduleHandleId;const e=this.scheduleHandleId;this._get("updating")||this._set("updating",!0),this.handles.add((0,h.Os)((()=>{e===this.scheduleHandleId&&(this._set("updating",this.pendingPromises.size>0),this.handles.remove(g))})),g)}}};(0,r._)([(0,l.Cb)({readOnly:!0})],p.prototype,"updating",void 0),p=(0,r._)([(0,d.j)("esri.views.support.WatchUpdatingTracking")],p);const g=-42},75656:(e,t,s)=>{s.d(t,{Z:()=>h});var r=s(22021),i=s(70586),n=s(49300),a=s(35371),o=s(46314);class h{constructor(e,t,s=null){this._context=e,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,e.instanceCounter.increment(a._g.Texture,this),this._descriptor={target:3553,samplingMode:9729,wrapMode:10497,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,...t},34067===this._descriptor.target?this.setDataCubeMap(s):this.setData(s)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTextureAllUnits(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(a._g.Texture,this))}release(){this.dispose()}resize(e,t){const s=this._descriptor;s.width===e&&s.height===t||(s.width=e,s.height=t,34067===this._descriptor.target?this.setDataCubeMap(null):this.setData(null))}setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this.setData(e,t)}setData(e,t=3553){if(!this._context||!this._context.gl)return;const s=this._context.gl;this._glName||(this._glName=s.createTexture()),void 0===e&&(e=null),null===e&&(this._descriptor.width=this._descriptor.width||4,this._descriptor.height=this._descriptor.height||4);const r=this._context.bindTexture(this,h.TEXTURE_UNIT_FOR_UPDATES),a=this._descriptor;h._validateTexture(this._context,a),s.pixelStorei(s.UNPACK_ALIGNMENT,a.unpackAlignment),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,a.flipped?1:0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.preMultiplyAlpha?1:0);const o=a.pixelFormat;let c=a.internalFormat?a.internalFormat:this._deriveInternalFormat(o,a.dataType);if(e instanceof ImageData||e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let r=e.width,i=e.height;e instanceof HTMLVideoElement&&(r=e.videoWidth,i=e.videoHeight),a.width&&a.height,s.texImage2D(t,0,c,o,a.dataType,e),(0,n.zu)(s),a.hasMipmap&&this.generateMipmap(),void 0===a.width&&(a.width=r),void 0===a.height&&(a.height=i)}else{null!=a.width&&null!=a.height||console.error("Width and height must be specified!"),s.DEPTH24_STENCIL8&&c===s.DEPTH_STENCIL&&(c=s.DEPTH24_STENCIL8);let r=a.width,h=a.height;if(function(e){return(0,i.pC)(e)&&"type"in e&&"compressed"===e.type}(e)){const i=Math.round(Math.log(Math.max(r,h))/Math.LN2)+1;a.hasMipmap=a.hasMipmap&&i===e.levels.length;for(let i=0;;++i){const n=e.levels[Math.min(i,e.levels.length-1)];if(s.compressedTexImage2D(t,i,c,r,h,0,n),1===r&&1===h||!a.hasMipmap)break;r=Math.max(1,r>>1),h=Math.max(1,h>>1)}}else if((0,i.pC)(e))s.texImage2D(t,0,c,r,h,0,o,a.dataType,e),(0,n.zu)(s),a.hasMipmap&&this.generateMipmap();else for(let e=0;s.texImage2D(t,e,c,r,h,0,o,a.dataType,null),(0,n.zu)(s),(1!==r||1!==h)&&a.hasMipmap;++e)r=Math.max(1,r>>1),h=Math.max(1,h>>1)}h._applySamplingMode(s,this._descriptor),h._applyWrapMode(s,this._descriptor),h._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,n.zu)(s),this._context.bindTexture(r,h.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,s,r,i,n,a=3553){n||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const o=this._context.gl,c=this._descriptor,u=this._context.bindTexture(this,h.TEXTURE_UNIT_FOR_UPDATES);(t<0||s<0||r>c.width||i>c.height||t+r>c.width||s+i>c.height)&&console.error("An attempt to update out of bounds of the texture!"),o.pixelStorei(o.UNPACK_ALIGNMENT,c.unpackAlignment),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,c.flipped?1:0),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c.preMultiplyAlpha?1:0),n instanceof ImageData||n instanceof HTMLImageElement||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement?o.texSubImage2D(a,e,t,s,c.pixelFormat,c.dataType,n):o.texSubImage2D(a,e,t,s,r,i,c.pixelFormat,c.dataType,n),this._context.bindTexture(u,h.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;e.hasMipmap||(e.hasMipmap=!0,this._samplingModeDirty=!0,h._validateTexture(this._context,e)),9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._context.bindTexture(this,h.TEXTURE_UNIT_FOR_UPDATES);this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,h.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,h._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(h._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(h._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if("webgl"===this._context.webglVersion)return e;if(5126===t)switch(e){case 6408:return 34836;case 6407:return 34837;default:throw new Error("Unable to derive format")}return e}static _validateTexture(e,t){(t.width<0||t.height<0)&&console.error("Negative dimension parameters are not allowed!");const s=(0,r.wt)(t.width)&&(0,r.wt)(t.height);(0,o.Z)(e.gl)||s||("number"==typeof t.wrapMode?33071!==t.wrapMode&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):33071===t.wrapMode.s&&33071===t.wrapMode.t||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let s=t.samplingMode,r=t.samplingMode;9985===s||9987===s?(s=9729,t.hasMipmap||(r=9729)):9984!==s&&9986!==s||(s=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,s),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){var s;const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,null!=(s=t.maxAnisotropy)?s:1)}}h.TEXTURE_UNIT_FOR_UPDATES=0},46314:(e,t,s)=>{function r(e){return window.WebGL2RenderingContext&&e instanceof window.WebGL2RenderingContext}s.d(t,{Z:()=>r})},49300:(e,t,s)=>{s.d(t,{zu:()=>c,hZ:()=>o,CG:()=>h});var r=s(20102),i=s(80442);const n=s(92604).Z.getLogger("esri/views/webgl"),a=!!(0,i.Z)("enable-feature:webgl-debug");function o(){return a}function h(){return a}function c(e){if(o()){const t=e.getError();if(t){const s=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),i=(new Error).stack;n.error(new r.Z("webgl-error","WebGL error occured",{message:s,stack:i}))}}}},35371:(e,t,s)=>{var r,i;s.d(t,{Lu:()=>n,_g:()=>r}),(i=r||(r={}))[i.Texture=0]="Texture",i[i.Buffer=1]="Buffer",i[i.VAO=2]="VAO",i[i.VertexShader=3]="VertexShader",i[i.FragmentShader=4]="FragmentShader",i[i.Program=5]="Program",i[i.Framebuffer=6]="Framebuffer",i[i.Renderbuffer=7]="Renderbuffer",i[i.COUNT=8]="COUNT";const n=33306}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1773],{51773:(t,e,o)=>{o.d(e,{Z:()=>$});var i=o(43697),r=o(81049),s=o(10736),n=o(22974),a=o(92604),l=o(95330),p=o(5600),d=o(90578),h=o(71715),c=o(52011),y=o(30556),u=o(75215),m=o(35671),f=o(84649),g=o(63801),v=o(48074),_=o(38745),b=o(9190),w=o(10214),x=o(44951);const C={base:null,key:"type",typeMap:{attachment:f.Z,media:w.Z,text:x.Z,expression:_.Z,field:b.Z}};var I,j=o(11223),T=o(422);o(67676),o(80442);let F=I=class extends s.wq{constructor(t){super(t),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new I({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};(0,i._)([(0,p.Cb)({type:Boolean,json:{write:!0}})],F.prototype,"returnTopmostRaster",void 0),(0,i._)([(0,p.Cb)({type:Boolean,json:{write:!0}})],F.prototype,"showNoDataRecords",void 0),F=I=(0,i._)([(0,c.j)("esri.popup.LayerOptions")],F);const S=F;var Z,O=o(44729);let M=Z=class extends s.wq{constructor(t){super(t),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new Z({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?(0,n.d9)(this.orderByFields):null})}};(0,i._)([(0,p.Cb)({type:Boolean,json:{write:!0}})],M.prototype,"showRelatedRecords",void 0),(0,i._)([(0,p.Cb)({type:[O.Z],json:{write:!0}})],M.prototype,"orderByFields",void 0),M=Z=(0,i._)([(0,c.j)("esri.popup.RelatedRecordsInfo")],M);const N=M;var A,L=o(79742),D=o(15923),E=o(10699);let R=A=class extends((0,E.I)(D.Z)){constructor(t){super(t),this.active=!1,this.className=null,this.disabled=!1,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new A({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};(0,i._)([(0,p.Cb)()],R.prototype,"active",void 0),(0,i._)([(0,p.Cb)()],R.prototype,"className",void 0),(0,i._)([(0,p.Cb)()],R.prototype,"disabled",void 0),(0,i._)([(0,p.Cb)()],R.prototype,"id",void 0),(0,i._)([(0,p.Cb)()],R.prototype,"indicator",void 0),(0,i._)([(0,p.Cb)()],R.prototype,"title",void 0),(0,i._)([(0,p.Cb)()],R.prototype,"type",void 0),(0,i._)([(0,p.Cb)()],R.prototype,"visible",void 0),R=A=(0,i._)([(0,c.j)("esri.support.actions.ActionBase")],R);const Y=R;var J;let B=J=class extends Y{constructor(t){super(t),this.image=null,this.type="button"}clone(){return new J({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};(0,i._)([(0,p.Cb)()],B.prototype,"image",void 0),B=J=(0,i._)([(0,c.j)("esri.support.Action.ActionButton")],B);const k=B;var q;let U=q=class extends Y{constructor(t){super(t),this.image=null,this.type="toggle",this.value=!1}clone(){return new q({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};(0,i._)([(0,p.Cb)()],U.prototype,"image",void 0),(0,i._)([(0,p.Cb)()],U.prototype,"value",void 0),U=q=(0,i._)([(0,c.j)("esri.support.Action.ActionToggle")],U);const V=U;var P;const z=r.Z.ofType({key:"type",defaultKeyValue:"button",base:Y,typeMap:{button:k,toggle:V}}),K={base:g.Z,key:"type",typeMap:{media:w.Z,custom:v.Z,text:x.Z,attachments:f.Z,fields:b.Z,expression:_.Z}},G="esri.PopupTemplate",W=a.Z.getLogger(G),H=["attachments","fields","media","text","expression"];let X=P=class extends s.wq{constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title="",this.relatedRecordsInfo=null}castContent(t){return Array.isArray(t)?t.map((t=>(0,u.N7)(K,t))):"string"==typeof t||"function"==typeof t||t instanceof HTMLElement||(0,l.y8)(t)?t:(W.error("content error","unsupported content value",{value:t}),null)}readContent(t,e){const{popupElements:o}=e;return Array.isArray(o)&&o.length>0?this._readPopupInfoElements(e):this._readPopupInfo(e)}writeContent(t,e,o,i){"string"!=typeof t?Array.isArray(t)&&(e.popupElements=t.filter((t=>-1!==H.indexOf(t.type))).map((t=>t&&t.toJSON(i))),e.popupElements.forEach((t=>{"attachments"===t.type?this._writeAttachmentContent(e):"media"===t.type?this._writeMediaContent(t,e):"text"===t.type&&this._writeTextContent(t,e)}))):e.description=t}writeFieldInfos(t,e,o,i){const{content:r}=this,s=Array.isArray(r)?r:null;if(t){const o=s?s.filter((t=>"fields"===t.type)):[],r=o.length&&o.every((t=>{var e;return null==(e=t.fieldInfos)?void 0:e.length}));e.fieldInfos=t.filter(Boolean).map((t=>{const e=t.toJSON(i);return r&&(e.visible=!1),e}))}if(s)for(const t of s)"fields"===t.type&&this._writeFieldsContent(t,e)}writeLayerOptions(t,e,o,i){e[o]=!t||null===t.showNoDataRecords&&null===t.returnTopmostRaster?null:t.toJSON(i)}writeTitle(t,e){e.title=t||""}clone(){const{actions:t}=this,e=t?(0,n.d9)(t.toArray()):[];return new P({actions:e,content:Array.isArray(this.content)?(0,n.d9)(this.content):this.content,expressionInfos:Array.isArray(this.expressionInfos)?(0,n.d9)(this.expressionInfos):null,fieldInfos:Array.isArray(this.fieldInfos)?(0,n.d9)(this.fieldInfos):null,layerOptions:this.layerOptions?(0,n.d9)(this.layerOptions):null,lastEditInfoEnabled:this.lastEditInfoEnabled,outFields:Array.isArray(this.outFields)?(0,n.d9)(this.outFields):null,overwriteActions:this.overwriteActions,returnGeometry:this.returnGeometry,title:this.title,relatedRecordsInfo:this.relatedRecordsInfo?(0,n.d9)(this.relatedRecordsInfo):null})}async collectRequiredFields(t,e){await this._collectExpressionInfoFields(t,e,this._getContentExpressionInfos(this.content,this.expressionInfos)),(0,m.gd)(t,e,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(t){const e=new Set;return await this.collectRequiredFields(e,t),[...e].sort()}_writeFieldsContent(t,e){if(!Array.isArray(t.fieldInfos)||!t.fieldInfos.length)return;const o=(0,n.d9)(t.fieldInfos);Array.isArray(e.fieldInfos)?o.forEach((t=>{const o=e.fieldInfos.find((e=>e.fieldName.toLowerCase()===t.fieldName.toLowerCase()));o?o.visible=!0:e.fieldInfos.push(t)})):e.fieldInfos=o}_writeAttachmentContent(t){t.showAttachments||(t.showAttachments=!0)}_writeTextContent(t,e){!e.description&&t.text&&(e.description=t.text)}_writeMediaContent(t,e){if(!Array.isArray(t.mediaInfos)||!t.mediaInfos.length)return;const o=(0,n.d9)(t.mediaInfos);Array.isArray(e.mediaInfos)?e.mediaInfos=[...e.mediaInfos,...o]:e.mediaInfos=o}_readPopupInfoElements({description:t,mediaInfos:e,popupElements:o}){const i={description:!1,mediaInfos:!1};return o.map((o=>"media"===o.type?(o.mediaInfos||!e||i.mediaInfos||(o.mediaInfos=e,i.mediaInfos=!0),w.Z.fromJSON(o)):"text"===o.type?(o.text||!t||i.description||(o.text=t,i.description=!0),x.Z.fromJSON(o)):"attachments"===o.type?f.Z.fromJSON(o):"fields"===o.type?b.Z.fromJSON(o):"expression"===o.type?_.Z.fromJSON(o):void 0)).filter(Boolean)}_readPopupInfo({description:t,mediaInfos:e,showAttachments:o}){const i=[];return t?i.push(new x.Z({text:t})):i.push(new b.Z),Array.isArray(e)&&e.length&&i.push(w.Z.fromJSON({mediaInfos:e})),o&&i.push(f.Z.fromJSON({displayType:"auto"})),i.length?i:t}_getContentElementFields(t){return t&&"attachments"!==t.type&&"expression"!==t.type?"custom"===t.type?t.outFields||[]:"fields"===t.type?this._getFieldInfoFields(t.fieldInfos||this.fieldInfos):"media"===t.type?(t.mediaInfos||[]).reduce(((t,e)=>[...t,...this._getMediaInfoFields(e)]),[]):"text"===t.type?this._extractFieldNames(t.text):void 0:[]}_getMediaInfoFields(t){const{caption:e,title:o,value:i}=t,r=i||{},{fields:s=[],normalizeField:n,tooltipField:a,sourceURL:l,linkURL:p}=r,d=[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(l),...this._extractFieldNames(p),...s];return n&&d.push(n),a&&d.push(a),d}_getContentExpressionInfos(t,e){return Array.isArray(t)?t.reduce(((t,e)=>[...t,..."expression"===e.type&&e.expressionInfo?[e.expressionInfo]:[]]),e||[]):[]}_getContentFields(t){return"string"==typeof t?this._extractFieldNames(t):Array.isArray(t)?t.reduce(((t,e)=>[...t,...this._getContentElementFields(e)]),[]):[]}async _collectExpressionInfoFields(t,e,o){o&&await Promise.all(o.map((o=>(0,m.io)(t,e,o.expression))))}_getFieldInfoFields(t){return t?t.filter((t=>void 0===t.visible||!!t.visible)).map((t=>t.fieldName)).filter((t=>-1===t.indexOf("relationships/")&&-1===t.indexOf("expression/"))):[]}_getActionsFields(t){return t?t.toArray().reduce(((t,e)=>[...t,...this._getActionFields(e)]),[]):[]}_getActionFields(t){const{className:e,title:o,type:i}=t,r="button"===i||"toggle"===i?t.image:"";return[...this._extractFieldNames(o),...this._extractFieldNames(e),...this._extractFieldNames(r)]}_getTitleFields(t){return"string"==typeof t?this._extractFieldNames(t):[]}_extractFieldNames(t){if(!t||"string"!=typeof t)return[];const e=t.match(/{[^}]*}/g);if(!e)return[];const o=/\{(\w+):.+\}/,i=e.filter((t=>!(0===t.indexOf("{relationships/")||0===t.indexOf("{expression/")))).map((t=>t.replace(o,"{$1}")));return i?i.map((t=>t.slice(1,-1))):[]}};(0,i._)([(0,p.Cb)({type:z})],X.prototype,"actions",void 0),(0,i._)([(0,p.Cb)()],X.prototype,"content",void 0),(0,i._)([(0,d.p)("content")],X.prototype,"castContent",null),(0,i._)([(0,h.r)("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments"])],X.prototype,"readContent",null),(0,i._)([(0,y.c)("content",{popupElements:{type:r.Z.ofType(C)},showAttachments:{type:Boolean},mediaInfos:{type:r.Z.ofType(L.V)},description:{type:String}})],X.prototype,"writeContent",null),(0,i._)([(0,p.Cb)({type:[j.Z],json:{write:!0}})],X.prototype,"expressionInfos",void 0),(0,i._)([(0,p.Cb)({type:[T.Z]})],X.prototype,"fieldInfos",void 0),(0,i._)([(0,y.c)("fieldInfos")],X.prototype,"writeFieldInfos",null),(0,i._)([(0,p.Cb)({type:S})],X.prototype,"layerOptions",void 0),(0,i._)([(0,y.c)("layerOptions")],X.prototype,"writeLayerOptions",null),(0,i._)([(0,p.Cb)({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],X.prototype,"lastEditInfoEnabled",void 0),(0,i._)([(0,p.Cb)()],X.prototype,"outFields",void 0),(0,i._)([(0,p.Cb)()],X.prototype,"overwriteActions",void 0),(0,i._)([(0,p.Cb)()],X.prototype,"returnGeometry",void 0),(0,i._)([(0,p.Cb)({json:{type:String}})],X.prototype,"title",void 0),(0,i._)([(0,y.c)("title")],X.prototype,"writeTitle",null),(0,i._)([(0,p.Cb)({type:N,json:{write:!0}})],X.prototype,"relatedRecordsInfo",void 0),X=P=(0,i._)([(0,c.j)(G)],X);const $=X},90344:(t,e,o)=>{o.d(e,{Ze:()=>f,p6:()=>g});var i=o(35454),r=o(70171);const s={year:"numeric",month:"numeric",day:"numeric"},n={year:"numeric",month:"long",day:"numeric"},a={year:"numeric",month:"short",day:"numeric"},l={year:"numeric",month:"long",weekday:"long",day:"numeric"},p={hour:"numeric",minute:"numeric"},d={...p,second:"numeric"},h={"short-date":s,"short-date-short-time":{...s,...p},"short-date-short-time-24":{...s,...p,hour12:!1},"short-date-long-time":{...s,...d},"short-date-long-time-24":{...s,...d,hour12:!1},"short-date-le":s,"short-date-le-short-time":{...s,...p},"short-date-le-short-time-24":{...s,...p,hour12:!1},"short-date-le-long-time":{...s,...d},"short-date-le-long-time-24":{...s,...d,hour12:!1},"long-month-day-year":n,"long-month-day-year-short-time":{...n,...p},"long-month-day-year-short-time-24":{...n,...p,hour12:!1},"long-month-day-year-long-time":{...n,...d},"long-month-day-year-long-time-24":{...n,...d,hour12:!1},"day-short-month-year":a,"day-short-month-year-short-time":{...a,...p},"day-short-month-year-short-time-24":{...a,...p,hour12:!1},"day-short-month-year-long-time":{...a,...d},"day-short-month-year-long-time-24":{...a,...d,hour12:!1},"long-date":l,"long-date-short-time":{...l,...p},"long-date-short-time-24":{...l,...p,hour12:!1},"long-date-long-time":{...l,...d},"long-date-long-time-24":{...l,...d,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":p,"long-time":d},c=(0,i.wY)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),y=(c.apiValues,c.toJSON.bind(c),c.fromJSON.bind(c),{ar:"ar-u-nu-latn-ca-gregory"});let u=new WeakMap,m=h["short-date-short-time"];function f(t){return h[t]||null}function g(t,e){return function(t){const e=t||m;if(!u.has(e)){const t=(0,r.Kd)(),o=y[(0,r.Kd)()]||t;u.set(e,new Intl.DateTimeFormat(o,e))}return u.get(e)}(e).format(t)}(0,r.Ze)((()=>{u=new WeakMap,m=h["short-date-short-time"]}))},18848:(t,e,o)=>{o.d(e,{sh:()=>l,uf:()=>p});var i=o(70586),r=o(70171);const s={ar:"ar-u-nu-latn"};let n=new WeakMap,a={};function l(t={}){const e={};return null!=t.digitSeparator&&(e.useGrouping=t.digitSeparator),null!=t.places&&(e.minimumFractionDigits=e.maximumFractionDigits=t.places),e}function p(t,e){return function(t){const e=t||a;if(!n.has(e)){const o=(0,r.Kd)(),i=s[(0,r.Kd)()]||o;n.set(e,new Intl.NumberFormat(i,t))}return(0,i.j0)(n.get(e))}(e).format(t)}(0,r.Ze)((()=>{n=new WeakMap,a={}}))},11223:(t,e,o)=>{o.d(e,{Z:()=>p});var i,r=o(43697),s=o(10736),n=o(5600),a=(o(67676),o(80442),o(75215),o(52011));let l=i=class extends s.wq{constructor(t){super(t),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new i({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};(0,r._)([(0,n.Cb)({type:String,json:{write:!0}})],l.prototype,"name",void 0),(0,r._)([(0,n.Cb)({type:String,json:{write:!0}})],l.prototype,"title",void 0),(0,r._)([(0,n.Cb)({type:String,json:{write:!0}})],l.prototype,"expression",void 0),(0,r._)([(0,n.Cb)({type:["string","number"],json:{write:!0}})],l.prototype,"returnType",void 0),l=i=(0,r._)([(0,a.j)("esri.popup.ExpressionInfo")],l);const p=l},422:(t,e,o)=>{o.d(e,{Z:()=>y});var i,r=o(43697),s=o(35454),n=o(10736),a=o(22974),l=o(5600),p=(o(75215),o(36030)),d=o(52011),h=o(63061);let c=i=class extends n.wq{constructor(t){super(t),this.fieldName=null,this.format=null,this.isEditable=!1,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new i({fieldName:this.fieldName,format:this.format?(0,a.d9)(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],c.prototype,"fieldName",void 0),(0,r._)([(0,l.Cb)({type:h.Z,json:{write:!0}})],c.prototype,"format",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0,default:!1}})],c.prototype,"isEditable",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],c.prototype,"label",void 0),(0,r._)([(0,p.J)(new s.Xn({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],c.prototype,"stringFieldOption",void 0),(0,r._)([(0,l.Cb)({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],c.prototype,"statisticType",void 0),(0,r._)([(0,l.Cb)({type:String,json:{write:!0}})],c.prototype,"tooltip",void 0),(0,r._)([(0,l.Cb)({type:Boolean,json:{write:!0}})],c.prototype,"visible",void 0),c=i=(0,r._)([(0,d.j)("esri.popup.FieldInfo")],c);const y=c},84649:(t,e,o)=>{o.d(e,{Z:()=>p});var i,r=o(43697),s=o(5600),n=(o(67676),o(80442),o(75215),o(52011)),a=o(63801);let l=i=class extends a.Z{constructor(t){super(t),this.description=null,this.displayType=null,this.title=null,this.type="attachments"}clone(){return new i({description:this.description,displayType:this.displayType,title:this.title})}};(0,r._)([(0,s.Cb)({type:String,json:{write:!0}})],l.prototype,"description",void 0),(0,r._)([(0,s.Cb)({type:["auto","preview","list"],json:{write:!0}})],l.prototype,"displayType",void 0),(0,r._)([(0,s.Cb)({type:String,json:{write:!0}})],l.prototype,"title",void 0),(0,r._)([(0,s.Cb)({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],l.prototype,"type",void 0),l=i=(0,r._)([(0,n.j)("esri.popup.content.AttachmentsContent")],l);const p=l},41463:(t,e,o)=>{o.d(e,{Z:()=>d});var i,r=o(43697),s=o(5600),n=(o(67676),o(80442),o(75215),o(52011)),a=o(50379),l=o(87102);let p=i=class extends a.Z{constructor(t){super(t),this.type="bar-chart"}clone(){return new i({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};(0,r._)([(0,s.Cb)({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:l.l.write}})],p.prototype,"type",void 0),p=i=(0,r._)([(0,n.j)("esri.popup.content.BarChartMediaInfo")],p);const d=p},87131:(t,e,o)=>{o.d(e,{Z:()=>d});var i,r=o(43697),s=o(5600),n=(o(67676),o(80442),o(75215),o(52011)),a=o(50379),l=o(87102);let p=i=class extends a.Z{constructor(t){super(t),this.type="column-chart"}clone(){return new i({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};(0,r._)([(0,s.Cb)({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:l.l.write}})],p.prototype,"type",void 0),p=i=(0,r._)([(0,n.j)("esri.popup.content.ColumnChartMediaInfo")],p);const d=p},63801:(t,e,o)=>{o.d(e,{Z:()=>l});var i=o(43697),r=o(10736),s=o(5600),n=(o(67676),o(80442),o(75215),o(52011));let a=class extends r.wq{constructor(t){super(t),this.type=null}};(0,i._)([(0,s.Cb)({type:["attachments","custom","fields","media","text","expression"],readOnly:!0,json:{read:!1,write:!0}})],a.prototype,"type",void 0),a=(0,i._)([(0,n.j)("esri.popup.content.Content")],a);const l=a},48074:(t,e,o)=>{o.d(e,{Z:()=>d});var i,r=o(43697),s=o(22974),n=o(5600),a=(o(75215),o(52011)),l=o(63801);let p=i=class extends l.Z{constructor(t){super(t),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new i({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?(0,s.d9)(this.outFields):null})}};(0,r._)([(0,n.Cb)()],p.prototype,"creator",void 0),(0,r._)([(0,n.Cb)()],p.prototype,"destroyer",void 0),(0,r._)([(0,n.Cb)()],p.prototype,"outFields",void 0),(0,r._)([(0,n.Cb)({type:["custom"],readOnly:!0})],p.prototype,"type",void 0),p=i=(0,r._)([(0,a.j)("esri.popup.content.CustomContent")],p);const d=p},38745:(t,e,o)=>{o.d(e,{Z:()=>y});var i,r=o(43697),s=o(5600),n=(o(67676),o(80442),o(75215),o(52011)),a=o(10736);let l=i=class extends a.wq{constructor(t){super(t),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new i({title:this.title,expression:this.expression})}};(0,r._)([(0,s.Cb)({type:String,json:{write:!0}})],l.prototype,"title",void 0),(0,r._)([(0,s.Cb)({type:String,json:{write:!0}})],l.prototype,"expression",void 0),(0,r._)([(0,s.Cb)({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],l.prototype,"returnType",void 0),l=i=(0,r._)([(0,n.j)("esri.popup.ElementExpressionInfo")],l);const p=l;var d,h=o(63801);let c=d=class extends h.Z{constructor(t){super(t),this.expressionInfo=null,this.type="expression"}clone(){var t;return new d({expressionInfo:null==(t=this.expressionInfo)?void 0:t.clone()})}};(0,r._)([(0,s.Cb)({type:p,json:{write:!0}})],c.prototype,"expressionInfo",void 0),(0,r._)([(0,s.Cb)({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],c.prototype,"type",void 0),c=d=(0,r._)([(0,n.j)("esri.popup.content.ExpressionContent")],c);const y=c},9190:(t,e,o)=>{o.d(e,{Z:()=>c});var i,r=o(43697),s=o(22974),n=o(5600),a=(o(75215),o(52011)),l=o(30556),p=o(422),d=o(63801);let h=i=class extends d.Z{constructor(t){super(t),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(t,e){e.fieldInfos=t&&t.map((t=>t.toJSON()))}clone(){return new i((0,s.d9)({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};(0,r._)([(0,n.Cb)({type:Object,json:{write:!0}})],h.prototype,"attributes",void 0),(0,r._)([(0,n.Cb)({type:String,json:{write:!0}})],h.prototype,"description",void 0),(0,r._)([(0,n.Cb)({type:[p.Z]})],h.prototype,"fieldInfos",void 0),(0,r._)([(0,l.c)("fieldInfos")],h.prototype,"writeFieldInfos",null),(0,r._)([(0,n.Cb)({type:String,json:{write:!0}})],h.prototype,"title",void 0),(0,r._)([(0,n.Cb)({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=i=(0,r._)([(0,a.j)("esri.popup.content.FieldsContent")],h);const c=h},13151:(t,e,o)=>{o.d(e,{Z:()=>y});var i,r=o(43697),s=o(5600),n=(o(67676),o(80442),o(75215),o(52011)),a=o(35320),l=o(10736);let p=i=class extends l.wq{constructor(t){super(t),this.linkURL=null,this.sourceURL=null}clone(){return new i({linkURL:this.linkURL,sourceURL:this.sourceURL})}};(0,r._)([(0,s.Cb)({type:String,json:{write:!0}})],p.prototype,"linkURL",void 0),(0,r._)([(0,s.Cb)({type:String,json:{write:!0}})],p.prototype,"sourceURL",void 0),p=i=(0,r._)([(0,n.j)("esri.popup.content.support.ImageMediaInfoValue")],p);const d=p;var h;let c=h=class extends a.Z{constructor(t){super(t),this.refreshInterval=null,this.type="image",this.value=null}clone(){return new h({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};(0,r._)([(0,s.Cb)({type:Number,json:{write:!0}})],c.prototype,"refreshInterval",void 0),(0,r._)([(0,s.Cb)({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],c.prototype,"type",void 0),(0,r._)([(0,s.Cb)({type:d,json:{write:!0}})],c.prototype,"value",void 0),c=h=(0,r._)([(0,n.j)("esri.popup.content.ImageMediaInfo")],c);const y=c},55869:(t,e,o)=>{o.d(e,{Z:()=>d});var i,r=o(43697),s=o(5600),n=(o(67676),o(80442),o(75215),o(52011)),a=o(50379),l=o(87102);let p=i=class extends a.Z{constructor(t){super(t),this.type="line-chart"}clone(){return new i({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};(0,r._)([(0,s.Cb)({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:l.l.write}})],p.prototype,"type",void 0),p=i=(0,r._)([(0,n.j)("esri.popup.content.LineChartMediaInfo")],p);const d=p},10214:(t,e,o)=>{o.d(e,{Z:()=>v});var i,r=o(43697),s=o(22974),n=o(5600),a=(o(75215),o(71715)),l=o(52011),p=o(30556),d=o(41463),h=o(87131),c=o(63801),y=o(13151),u=o(55869),m=o(13353),f=o(79742);let g=i=class extends c.Z{constructor(t){super(t),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(t){return t&&t.map((t=>"image"===t.type?y.Z.fromJSON(t):"barchart"===t.type?d.Z.fromJSON(t):"columnchart"===t.type?h.Z.fromJSON(t):"linechart"===t.type?u.Z.fromJSON(t):"piechart"===t.type?m.Z.fromJSON(t):void 0)).filter(Boolean)}writeMediaInfos(t,e){e.mediaInfos=t&&t.map((t=>t.toJSON()))}clone(){return new i((0,s.d9)({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};(0,r._)([(0,n.Cb)()],g.prototype,"activeMediaInfoIndex",void 0),(0,r._)([(0,n.Cb)({type:Object,json:{write:!0}})],g.prototype,"attributes",void 0),(0,r._)([(0,n.Cb)({type:String,json:{write:!0}})],g.prototype,"description",void 0),(0,r._)([(0,n.Cb)({types:[f.V]})],g.prototype,"mediaInfos",void 0),(0,r._)([(0,a.r)("mediaInfos")],g.prototype,"readMediaInfos",null),(0,r._)([(0,p.c)("mediaInfos")],g.prototype,"writeMediaInfos",null),(0,r._)([(0,n.Cb)({type:String,json:{write:!0}})],g.prototype,"title",void 0),(0,r._)([(0,n.Cb)({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],g.prototype,"type",void 0),g=i=(0,r._)([(0,l.j)("esri.popup.content.MediaContent")],g);const v=g},13353:(t,e,o)=>{o.d(e,{Z:()=>d});var i,r=o(43697),s=o(5600),n=(o(67676),o(80442),o(75215),o(52011)),a=o(50379),l=o(87102);let p=i=class extends a.Z{constructor(t){super(t),this.type="pie-chart"}clone(){return new i({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};(0,r._)([(0,s.Cb)({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:l.l.write}})],p.prototype,"type",void 0),p=i=(0,r._)([(0,n.j)("esri.popup.content.PieChartMediaInfo")],p);const d=p},44951:(t,e,o)=>{o.d(e,{Z:()=>p});var i,r=o(43697),s=o(5600),n=(o(67676),o(80442),o(75215),o(52011)),a=o(63801);let l=i=class extends a.Z{constructor(t){super(t),this.text=null,this.type="text"}clone(){return new i({text:this.text})}};(0,r._)([(0,s.Cb)({type:String,json:{write:!0}})],l.prototype,"text",void 0),(0,r._)([(0,s.Cb)({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],l.prototype,"type",void 0),l=i=(0,r._)([(0,n.j)("esri.popup.content.TextContent")],l);const p=l},50379:(t,e,o)=>{o.d(e,{Z:()=>g});var i,r=o(43697),s=o(5600),n=(o(67676),o(80442),o(75215),o(52011)),a=o(35320),l=o(10736),p=o(22974),d=o(15923);let h=i=class extends d.Z{constructor(t){super(t),this.tooltip=null,this.value=null}clone(){return new i({tooltip:this.tooltip,value:this.value})}};(0,r._)([(0,s.Cb)()],h.prototype,"tooltip",void 0),(0,r._)([(0,s.Cb)()],h.prototype,"value",void 0),h=i=(0,r._)([(0,n.j)("esri.popup.content.support.ChartMediaInfoValueSeries")],h);const c=h;var y;let u=y=class extends l.wq{constructor(t){super(t),this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new y({fields:(0,p.d9)(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};(0,r._)([(0,s.Cb)({type:[String],json:{write:!0}})],u.prototype,"fields",void 0),(0,r._)([(0,s.Cb)({type:String,json:{write:!0}})],u.prototype,"normalizeField",void 0),(0,r._)([(0,s.Cb)({type:[c],json:{read:!1}})],u.prototype,"series",void 0),(0,r._)([(0,s.Cb)({type:String,json:{write:!0}})],u.prototype,"tooltipField",void 0),u=y=(0,r._)([(0,n.j)("esri.popup.content.support.ChartMediaInfoValue")],u);const m=u;let f=class extends a.Z{constructor(t){super(t),this.type=null,this.value=null}};(0,r._)([(0,s.Cb)({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],f.prototype,"type",void 0),(0,r._)([(0,s.Cb)({type:m,json:{write:!0}})],f.prototype,"value",void 0),f=(0,r._)([(0,n.j)("esri.popup.content.mixins.ChartMediaInfo")],f);const g=f},35320:(t,e,o)=>{o.d(e,{Z:()=>l});var i=o(43697),r=o(10736),s=o(5600),n=(o(67676),o(80442),o(75215),o(52011));let a=class extends r.wq{constructor(t){super(t),this.altText=null,this.caption="",this.title="",this.type=null}};(0,i._)([(0,s.Cb)({type:String,json:{write:!0}})],a.prototype,"altText",void 0),(0,i._)([(0,s.Cb)({type:String,json:{write:!0}})],a.prototype,"caption",void 0),(0,i._)([(0,s.Cb)({type:String,json:{write:!0}})],a.prototype,"title",void 0),(0,i._)([(0,s.Cb)({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],a.prototype,"type",void 0),a=(0,i._)([(0,n.j)("esri.popup.content.mixins.MediaInfo")],a);const l=a},87102:(t,e,o)=>{o.d(e,{l:()=>i});const i=(0,o(35454).wY)()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"})},79742:(t,e,o)=>{o.d(e,{V:()=>l});var i=o(41463),r=o(87131),s=o(13151),n=o(55869),a=o(13353);const l={base:o(35320).Z,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":i.Z,"column-chart":r.Z,"line-chart":n.Z,"pie-chart":a.Z,image:s.Z}}},63061:(t,e,o)=>{o.d(e,{Z:()=>u});var i=o(43697);const r=(0,o(35454).wY)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"});r.toJSON.bind(r),r.fromJSON.bind(r);var s,n=o(10736),a=o(5600),l=(o(67676),o(80442),o(75215)),p=o(36030),d=o(52011),h=o(90344),c=o(18848);let y=s=class extends n.wq{constructor(t){super(t),this.dateFormat=null,this.dateTimeFormatOptions=null,this.digitSeparator=!1,this.places=null}clone(){return new s({dateFormat:this.dateFormat,digitSeparator:this.digitSeparator,places:this.places})}format(t){return this.dateFormat?(0,h.p6)(t,{...(0,h.Ze)(this.dateFormat),...this.dateTimeFormatOptions}):(0,c.uf)(t,(0,c.sh)(this))}};(0,i._)([(0,p.J)(r)],y.prototype,"dateFormat",void 0),(0,i._)([(0,a.Cb)({type:Object,json:{read:!1}})],y.prototype,"dateTimeFormatOptions",void 0),(0,i._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],y.prototype,"digitSeparator",void 0),(0,i._)([(0,a.Cb)({type:l.z8,json:{write:!0}})],y.prototype,"places",void 0),y=s=(0,i._)([(0,d.j)("esri.popup.support.FieldInfoFormat")],y);const u=y},44729:(t,e,o)=>{o.d(e,{Z:()=>p});var i,r=o(43697),s=o(10736),n=o(5600),a=(o(67676),o(80442),o(75215),o(52011));let l=i=class extends s.wq{constructor(t){super(t),this.field=null,this.order=null}clone(){return new i({field:this.field,order:this.order})}};(0,r._)([(0,n.Cb)({type:String,json:{write:!0}})],l.prototype,"field",void 0),(0,r._)([(0,n.Cb)({type:["asc","desc"],json:{write:!0}})],l.prototype,"order",void 0),l=i=(0,r._)([(0,a.j)("esri.popup.support.RelatedRecordsInfoFieldOrder")],l);const p=l}}]);
|