@arcgis/core 4.28.3 → 4.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{15852a47129b9e0d04c6.js → 023fc8504d032762ad82.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{4363f2cc3909c9258064.js → 076ac767b5148357f1b5.js} +1 -1
  4. package/assets/esri/core/workers/chunks/1c855f091d1305b82594.js +1 -0
  5. package/assets/esri/core/workers/chunks/4a5d0b49a641d182b5ea.js +1 -0
  6. package/assets/esri/core/workers/chunks/af13150c711ba7b7f3ac.js +1 -0
  7. package/assets/esri/core/workers/chunks/bab0aa000c65d5c256b7.js +1 -0
  8. package/assets/esri/core/workers/chunks/cfa6d1b63b794febe70a.js +1 -0
  9. package/assets/esri/core/workers/chunks/e076c5523dfb6c53a825.js +1 -0
  10. package/core/date.js +1 -1
  11. package/kernel.js +1 -1
  12. package/layers/graphics/data/QueryEngineResult.js +1 -1
  13. package/layers/graphics/sources/geojson/geojson.js +1 -1
  14. package/package.json +1 -1
  15. package/support/revision.js +1 -1
  16. package/views/2d/engine/webgl/Painter.js +1 -1
  17. package/views/3d/layers/graphics/elevationAlignPointsInFeatures.js +1 -1
  18. package/views/PopupView.js +1 -1
  19. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  20. package/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js +1 -1
  21. package/widgets/FeatureForm/FieldInput.js +1 -1
  22. package/widgets/FeatureForm.js +1 -1
  23. package/widgets/Features.js +1 -1
  24. package/widgets/Legend/LegendViewModel.js +1 -1
  25. package/widgets/Popup.js +1 -1
  26. package/assets/esri/core/workers/chunks/423672fe765083e1a0ec.js +0 -1
  27. package/assets/esri/core/workers/chunks/49d958631bcd93f6333a.js +0 -1
  28. package/assets/esri/core/workers/chunks/7beae29abdfae23b15cc.js +0 -1
  29. package/assets/esri/core/workers/chunks/97fd7b82eec26449977e.js +0 -1
  30. package/assets/esri/core/workers/chunks/f037e4f9877ea08ced9d.js +0 -1
  31. package/assets/esri/core/workers/chunks/f7ccc6c681fc9218555c.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[664],{25929:(e,t,s)=>{s.d(t,{M:()=>f,a:()=>g,e:()=>c,f:()=>n,i:()=>h,p:()=>d,r:()=>o,t:()=>r,w:()=>a});var i=s(17452);function n(e,t){const s=t?.url?.path;if(e&&s&&(e=(0,i.hF)(e,s,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const s=(0,i.PF)(e,t.portalItem.itemUrl);null!=s&&u.test(s)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(s).path)}return p(e,t?.portal)}function r(e,t,s=f.YES){if(null==e)return e;!(0,i.YP)(e)&&t?.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let n=(0,i.hF)(e);if(t){const s=t.verifyItemRelativeUrls?.rootPath||t.url?.path;if(s){const r=p(s,t.portal),o=p(n,t.portal);n=(0,i.PF)(o,r,r),null!=n&&n!==o&&n!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(n)}}return n=c(n,t?.portal),(0,i.YP)(n)&&(n=(0,i.Fv)(n)),t?.resources&&t?.portalItem&&!(0,i.YP)(n)&&!(0,i.HK)(n)&&s===f.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(n),compress:!1}),n}function o(e,t,s){return n(e,s)}function a(e,t,s,i){const n=r(e,i);void 0!==n&&(t[s]=n)}const l=/\/items\/([^\/]+)\/resources\/(.*)/,u=/^\.\/resources\//;function h(e){const t=e?.match(l)??null;return t?.[1]??null}function d(e){const t=e?.match(l)??null;if(null==t)return null;const s=t[2],n=s.lastIndexOf("/");if(-1===n){const{path:e,extension:t}=(0,i.fZ)(s);return{prefix:null,filename:e,extension:t}}const{path:r,extension:o}=(0,i.fZ)(s.slice(n+1));return{prefix:s.slice(0,n),filename:r,extension:o}}function c(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?(0,i.Ie)(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function p(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const s=`${t.urlKey}.${t.customBaseUrl}`,n=(0,i.TI)();return(0,i.D6)(n,`${n.scheme}://${s}`)?(0,i.Ie)(e,t.portalHostname,s):(0,i.Ie)(e,s,t.portalHostname)}var f,_;(_=f||(f={}))[_.YES=0]="YES",_[_.NO=1]="NO";const g=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return f},ensureMainOnlineDomain:c,fromJSON:n,itemIdFromResourceUrl:h,prefixAndFilenameFromResourceUrl:d,read:o,toJSON:r,write:a},Symbol.toStringTag,{value:"Module"}))},91303:(e,t,s)=>{var i;s.d(t,{Y:()=>i}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(i||(i={}))},24133:(e,t,s)=>{s.d(t,{Q:()=>o});var i=s(67676),n=s(44553),r=s(88764);class o{constructor(e=9,t){this._compareMinX=h,this._compareMinY=d,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),v.prune(),b.prune(),I.prune(),C.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(m(e,s))for(v.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;m(e,o)&&(s.leaf?t(r):g(e,o)?this._all(r,t):v.push(r))}s=v.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!m(e,t))return!1;for(v.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(m(e,r)){if(t.leaf||g(e,r))return!0;v.push(n)}}t=v.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new w([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(I.clear(),C.clear();s||I.length>0;){if(s||(s=I.pop(),n=I.data[I.length-1],r=C.pop()??0,o=!0),s.leaf&&(t=(0,i.cq)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),I.push(s),this._condense(I),this;o||s.leaf||!g(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(I.push(s),C.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(b.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else b.pushArray(s.children);s=b.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new w(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new F([]);o.height=i;const l=Math.ceil(n/r),u=l*Math.ceil(Math.sqrt(r));y(e,t,s,u,this._compareMinX);for(let n=t;n<=s;n+=u){const t=Math.min(n+u-1,s);y(e,n,t,l,this._compareMinY);for(let s=n;s<=t;s+=l){const n=Math.min(s+l-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=c(o),l=f(e,o)-a;l<n?(n=l,i=a<i?a:i,s=o):l===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);I.clear();const r=this._chooseSubtree(n,this._data,t,I);for(r.children.push(e),u(r,n);t>=0&&I.data[t].children.length>this._maxEntries;)this._split(I,t),t--;this._adjustParentBBoxes(n,I,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),l=s.leaf?new w(o):new F(o);l.height=s.height,a(s,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(s,l)}_splitRoot(e,t){this._data=new F([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,s,this._toBBox),u=_(t,a),h=c(t)+c(a);u<i?(i=u,r=o,n=h<n?h:n):u===i&&h<n&&(n=h,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:h,n=e.leaf?this._compareMinY:d;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=l(e,0,t,n),o=l(e,s-t,s,n);let a=p(r)+p(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=p(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=p(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.cq)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,s,i,n){n||(n=new w([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],u(n,e.leaf?i(r):r);return n}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function d(e,t){return e.minY-t.minY}function c(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(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 _(e,t){const s=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function m(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const v=new n.Z,b=new n.Z,I=new n.Z,C=new n.Z({deallocator:void 0});class E{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class x extends E{constructor(){super(...arguments),this.height=1,this.indexHint=new i.SO}}class w extends x{constructor(e){super(),this.children=e,this.leaf=!0}}class F extends x{constructor(e){super(),this.children=e,this.leaf=!1}}},19402:(e,t,s)=>{s.d(t,{R:()=>h});var i=s(43697),n=s(92036),r=s(50758),o=s(17445),a=s(1654),l=s(5600),u=s(52011);let h=class extends n.Z{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o.YP)}addWhen(e,t,s={}){return this._installWatch(e,t,s,o.gx)}addOnCollectionChange(e,t,{initial:s=!1,final:i=!1}={}){const n=++this._handleId;return this.addHandles([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.Z_),(0,o.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:i?e=>t({added:[],removed:e.toArray()}):void 0})],n),(0,r.kB)((()=>this.removeHandles(n)))}addPromise(e){if(null==e)return e;const t=++this._handleId;this.addHandles((0,r.kB)((()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this.hasHandles(d)||this._set("updating",!1))})),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},i){const n=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,n);const o=i(e,t,s);return this.addHandles(o,n),(0,r.kB)((()=>this.removeHandles(n)))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),i=(0,o.YP)(e,s,{sync:!0,equals:()=>!1});return this.addHandles(i,t),i}_createSyncUpdatingCallback(){return()=>{this.removeHandles(d),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,a.Os)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(d))})),d)}}};(0,i._)([(0,l.Cb)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,i._)([(0,u.j)("esri.core.support.UpdatingHandles")],h);const d=-42},37549:(e,t,s)=>{s.d(t,{H:()=>a});var i=s(80442),n=s(24133),r=s(24470);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.Q(9,(0,i.Z)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.cS)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},28972:(e,t,s)=>{s.d(t,{Z:()=>x});var i=s(67676),n=s(20102),r=s(32448),o=s(92604),a=s(60437),l=s(24470),u=s(98732),h=s(37549),d=s(42712);function c(e,t){return e?t?4:3:t?3:2}function p(e,t,s,i,n){if(!t?.lengths.length)return null;const r="upperLeft"===n?.originPosition?-1:1;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const o=e.coords,a=[],l=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:u,coords:h}=t,d=c(s,i);let p=0;for(const e of u){const t=f(l,h,p,e,s,i,r);t&&a.push(t),p+=e*d}if(a.sort(((e,t)=>{let i=r*e[2]-r*t[2];return 0===i&&s&&(i=e[4]-t[4]),i})),a.length){let e=6*a[0][2];o[0]=a[0][0]/e,o[1]=a[0][1]/e,s&&(e=6*a[0][4],o[2]=0!==e?a[0][3]/e:0),(o[0]<l[0]||o[0]>l[1]||o[1]<l[2]||o[1]>l[3]||s&&(o[2]<l[4]||o[2]>l[5]))&&(o.length=0)}if(!o.length){const e=t.lengths[0]?_(h,0,u[0],s,i):null;if(!e)return null;o[0]=e[0],o[1]=e[1],s&&e.length>2&&(o[2]=e[2])}return e}function f(e,t,s,i,n,r,o=1){const a=c(n,r);let l=s,u=s+a,h=0,d=0,p=0,f=0,_=0;for(let s=0,r=i-1;s<r;s++,l+=a,u+=a){const s=t[l],i=t[l+1],r=t[l+2],o=t[u],a=t[u+1],c=t[u+2];let g=s*a-o*i;f+=g,h+=(s+o)*g,d+=(i+a)*g,n&&(g=s*c-o*r,p+=(r+c)*g,_+=g),s<e[0]&&(e[0]=s),s>e[1]&&(e[1]=s),i<e[2]&&(e[2]=i),i>e[3]&&(e[3]=i),n&&(r<e[4]&&(e[4]=r),r>e[5]&&(e[5]=r))}if(f*o>0&&(f*=-1),_*o>0&&(_*=-1),!f)return null;const g=[h,d,.5*f];return n&&(g[3]=p,g[4]=.5*_),g}function _(e,t,s,i,n){const r=c(i,n);let o=t,a=t+r,l=0,u=0,h=0,d=0;for(let t=0,n=s-1;t<n;t++,o+=r,a+=r){const t=e[o],s=e[o+1],n=e[o+2],r=e[a],c=e[a+1],p=e[a+2],f=i?m(t,s,n,r,c,p):g(t,s,r,c);if(f)if(l+=f,i){const e=v(t,s,n,r,c,p);u+=f*e[0],h+=f*e[1],d+=f*e[2]}else{const e=y(t,s,r,c);u+=f*e[0],h+=f*e[1]}}return l>0?i?[u/l,h/l,d/l]:[u/l,h/l]:s>0?i?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function g(e,t,s,i){const n=s-e,r=i-t;return Math.sqrt(n*n+r*r)}function m(e,t,s,i,n,r){const o=i-e,a=n-t,l=r-s;return Math.sqrt(o*o+a*a+l*l)}function y(e,t,s,i){return[e+.5*(s-e),t+.5*(i-t)]}function v(e,t,s,i,n,r){return[e+.5*(i-e),t+.5*(n-t),s+.5*(r-s)]}var b=s(70272),I=s(5428);const C={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new b.u_(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>(null==e.centroid&&(e.centroid=p(new I.Z,e.geometry,t.hasZ,t.hasM)),e.centroid)},E=(0,a.Ue)();class x{constructor(e){this.geometryInfo=e,this._boundsStore=new h.H,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.Z,this.featureAdapter=C}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,d.S2)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.pC)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.JR)(E,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.Z("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.$)(null!=i?i:(0,l.Ue)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.Z("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.$)((0,l.Ue)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},1231:(e,t,s)=>{s.d(t,{Z:()=>g});var i,n=s(43697),r=s(35454),o=s(96674),a=s(5600),l=s(75215),u=(s(67676),s(80442),s(36030)),h=s(71715),d=s(52011),c=s(72729),p=s(86719);const f=new r.X({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let _=i=class extends o.wq{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?.value??null}readValueType(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?f.fromJSON(s.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,n._)([(0,a.Cb)({type:String,json:{write:!0}})],_.prototype,"alias",void 0),(0,n._)([(0,a.Cb)({type:[String,Number],json:{write:{allowNull:!0}}})],_.prototype,"defaultValue",void 0),(0,n._)([(0,a.Cb)()],_.prototype,"description",void 0),(0,n._)([(0,h.r)("description")],_.prototype,"readDescription",null),(0,n._)([(0,a.Cb)({types:c.V5,json:{read:{reader:c.im},write:!0}})],_.prototype,"domain",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),(0,n._)([(0,a.Cb)({type:l.z8,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],_.prototype,"length",void 0),(0,n._)([(0,a.Cb)({type:String,json:{write:!0}})],_.prototype,"name",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),(0,n._)([(0,u.J)(p.v)],_.prototype,"type",void 0),(0,n._)([(0,a.Cb)()],_.prototype,"valueType",void 0),(0,n._)([(0,h.r)("valueType",["description"])],_.prototype,"readValueType",null),(0,n._)([(0,a.Cb)({type:Boolean,json:{read:!1}})],_.prototype,"visible",void 0),_=i=(0,n._)([(0,d.j)("esri.layers.support.Field")],_);const g=_},39450:(e,t,s)=>{s.d(t,{Z:()=>h});var i,n=s(43697),r=s(96674),o=s(5600),a=s(75215),l=(s(67676),s(80442),s(52011));let u=i=class extends r.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new i({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"cols",void 0),(0,n._)([(0,o.Cb)({type:a.z8,json:{write:!0}})],u.prototype,"level",void 0),(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],u.prototype,"levelValue",void 0),(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"origin",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{write:!0}})],u.prototype,"resolution",void 0),(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"rows",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{write:!0}})],u.prototype,"scale",void 0),u=i=(0,n._)([(0,l.j)("esri.layers.support.LOD")],u);const h=u},11145:(e,t,s)=>{s.d(t,{Z:()=>x});var i,n=s(43697),r=s(35454),o=s(96674),a=s(67900),l=s(5600),u=s(75215),h=(s(67676),s(80442),s(71715)),d=s(52011),c=s(30556),p=s(94139),f=s(82971),_=s(24470),g=s(8744),m=s(40488),y=s(39450),v=s(43077);const b=new r.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let I=i=class extends o.wq{static create(e={}){const{resolutionFactor:t=1,scales:s,size:n=256,spatialReference:r=f.Z.WebMercator,numLODs:o=24}=e;if(!(0,g.JY)(r)){const e=[];if(s)for(let t=0;t<s.length;t++){const i=s[t];e.push(new y.Z({level:t,scale:i,resolution:i}))}else{let t=5e-4;for(let s=o-1;s>=0;s--)e.unshift(new y.Z({level:s,scale:t,resolution:t})),t*=2}return new i({dpi:96,lods:e,origin:new p.Z(0,0,r),size:[n,n],spatialReference:r})}const l=(0,g.C5)(r),u=e.origin?new p.Z({x:e.origin.x,y:e.origin.y,spatialReference:r}):new p.Z(l?{x:l.origin[0],y:l.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),h=1/(39.37*(0,a.c9)(r)*96),d=[];if(s)for(let e=0;e<s.length;e++){const t=s[e],i=t*h;d.push(new y.Z({level:e,scale:t,resolution:i}))}else{let e=(0,g.sT)(r)?512/n*591657527.5917094:256/n*591657527.591555;const s=Math.ceil(o/t);d.push(new y.Z({level:0,scale:e,resolution:e*h}));for(let i=1;i<s;i++){const s=e/2**t,n=s*h;d.push(new y.Z({level:i,scale:s,resolution:n})),e=s}}return new i({dpi:96,lods:d,origin:u,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const s=(0,g.C5)(e);return e.isWrappable&&!!s&&Math.abs(s.origin[0]-t.x)<=s.dx}return!1}readOrigin(e,t){return p.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,s=0;const i=[],n=this._levelToLOD={};e&&(t=-1/0,s=1/0,e.forEach((e=>{i.push(e.scale),t=e.scale>t?e.scale:t,s=e.scale<s?e.scale:s,n[e.level]=e}))),this._set("scales",i),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;i<s;i++){const s=t[i],n=t[i+1];if(s<=e)return i;if(n===e)return i+1;if(s>e&&n<e)return i+Math.log(s/e)/Math.log(s/n)}return i}snapScale(e,t=.95){const s=this.scaleToZoom(e);return s%Math.floor(s)>=t?this.zoomToScale(Math.ceil(s)):this.zoomToScale(Math.floor(s))}tileAt(e,t,s,i){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=s;else if((0,g.fS)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,i=s;else{const e=(0,m.iV)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,i=s}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return i||(i=new v.f(null,0,0,0,(0,_.Ue)())),i.level=e,i.row=Math.floor((this.origin.y-o)/l+.001),i.col=Math.floor((r-this.origin.x)/a+.001),this.updateTileInfo(i),i}updateTileInfo(e,t=i.ExtrapolateOptions.NONE){let s=this.lodAt(e.level);if(!s&&t===i.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(s=t)}if(!s)return;const n=e.level-s.level,r=s.resolution*this.size[0]/2**n,o=s.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,_.Ue)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const s=this.lodAt(t.level);if(null==s)return null;const{resolution:i}=s,n=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return i.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const s=[],n=this.lods.length;for(let e=0;e<n;e++){const i=this.lods[e],n=i.resolution*t;s.push(new y.Z({level:i.level,scale:i.scale,resolution:n}))}return new i({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;s<e.length;s++){const i=e[s];this._upsampleLevels[i.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/i.resolution:0},t=i}}};var C,E;(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],I.prototype,"compressionQuality",void 0),(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],I.prototype,"dpi",void 0),(0,n._)([(0,l.Cb)({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],I.prototype,"format",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],I.prototype,"isWrappable",null),(0,n._)([(0,l.Cb)({type:p.Z,json:{write:!0}})],I.prototype,"origin",void 0),(0,n._)([(0,h.r)("origin")],I.prototype,"readOrigin",null),(0,n._)([(0,l.Cb)({type:[y.Z],value:null,json:{write:!0}})],I.prototype,"lods",null),(0,n._)([(0,l.Cb)({readOnly:!0})],I.prototype,"scales",void 0),(0,n._)([(0,l.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],I.prototype,"size",void 0),(0,n._)([(0,h.r)("size",["rows","cols"])],I.prototype,"readSize",null),(0,n._)([(0,c.c)("size",{cols:{type:u.z8},rows:{type:u.z8}})],I.prototype,"writeSize",null),(0,n._)([(0,l.Cb)({type:f.Z,json:{write:!0}})],I.prototype,"spatialReference",void 0),I=i=(0,n._)([(0,d.j)("esri.layers.support.TileInfo")],I),C=I||(I={}),(E=C.ExtrapolateOptions||(C.ExtrapolateOptions={}))[E.NONE=0]="NONE",E[E.POWER_OF_TWO=1]="POWER_OF_TWO";const x=I},43077:(e,t,s)=>{s.d(t,{f:()=>i});class i{constructor(e,t,s,i,n=void 0){this.id=e,this.level=t,this.row=s,this.col=i,this.extent=n}}},66677:(e,t,s)=>{s.d(t,{B5:()=>h,DR:()=>c,G:()=>v,M8:()=>_,Nm:()=>g,Qc:()=>d,XG:()=>m,a7:()=>f,ld:()=>p,wH:()=>y});var i=s(17452),n=s(25929);const r={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},o=Object.values(r),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function h(e){return!!a.test(e)}function d(e){if(null==e)return null;const t=(0,i.mN)(e),s=t?.path.match(a)||t?.path.match(l);if(!s)return null;const[,n,o,u,h]=s,d=o.indexOf("/");return{title:p(-1!==d?o.slice(d+1):o),serverType:r[u.toLowerCase()],sublayer:null!=h&&""!==h?parseInt(h,10):null,url:{path:n}}}function c(e){const t=(0,i.mN)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function p(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function f(e,t){const s=[];if(e){const t=d(e);null!=t&&t.title&&s.push(t.title)}if(t){const e=p(t);s.push(e)}if(2===s.length){if(s[0].toLowerCase().includes(s[1].toLowerCase()))return s[0];if(s[1].toLowerCase().includes(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function _(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),s=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&s}function g(e,t){return e?(0,i.Qj)((0,i.Hu)(e,t)):e}function m(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 r;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(r=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=c(s.path);null!=e&&(t=e.serviceUrl,r=e.sublayerId)}return{url:(0,i.Qj)(t),layerId:r}}function y(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.v_)(r.url,s,e.layerId.toString()))}function v(e){if(!e)return!1;const t=e.toLowerCase(),s=t.includes("/services/"),i=t.includes("/mapserver/wmsserver"),n=t.includes("/imageserver/wmsserver"),r=t.includes("/wmsserver");return s&&(i||n||r)}},72729:(e,t,s)=>{s.d(t,{im:()=>x,V5:()=>E}),s(80442);var i,n=s(43697),r=s(22974),o=s(5600),a=(s(75215),s(36030)),l=s(52011),u=s(96674);s(67676);let h=i=class extends u.wq{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],h.prototype,"name",void 0),(0,n._)([(0,o.Cb)({type:[String,Number],json:{write:!0}})],h.prototype,"code",void 0),h=i=(0,n._)([(0,l.j)("esri.layers.support.CodedValue")],h);const d=new(s(35454).X)({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends u.wq{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,n._)([(0,a.J)(d)],c.prototype,"type",void 0),c=(0,n._)([(0,l.j)("esri.layers.support.Domain")],c);const p=c;var f;let _=f=class extends p{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const s=String(e);this.codedValues.some((e=>(String(e.code)===s&&(t=e.name),!!t)))}return t}clone(){return new f({codedValues:(0,r.d9)(this.codedValues),name:this.name})}};(0,n._)([(0,o.Cb)({type:[h],json:{write:!0}})],_.prototype,"codedValues",void 0),(0,n._)([(0,a.J)({codedValue:"coded-value"})],_.prototype,"type",void 0),_=f=(0,n._)([(0,l.j)("esri.layers.support.CodedValueDomain")],_);const g=_;var m;s(92604),s(20102);let y=m=class extends p{constructor(e){super(e),this.type="inherited"}clone(){return new m}};(0,n._)([(0,a.J)({inherited:"inherited"})],y.prototype,"type",void 0),y=m=(0,n._)([(0,l.j)("esri.layers.support.InheritedDomain")],y);const v=y;var b;let I=b=class extends p{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new b({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,n._)([(0,o.Cb)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,s){t[s]=[this.minValue||0,e]}}}})],I.prototype,"maxValue",void 0),(0,n._)([(0,o.Cb)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,s){t[s]=[e,this.maxValue||0]}}}})],I.prototype,"minValue",void 0),(0,n._)([(0,a.J)({range:"range"})],I.prototype,"type",void 0),I=b=(0,n._)([(0,l.j)("esri.layers.support.RangeDomain")],I);const C=I,E={key:"type",base:p,typeMap:{range:I,"coded-value":g,inherited:v}};function x(e){if(!e?.type)return null;switch(e.type){case"range":return C.fromJSON(e);case"codedValue":return g.fromJSON(e);case"inherited":return v.fromJSON(e)}return null}},99282:(e,t,s)=>{s.d(t,{a:()=>r});var i=s(67900),n=s(68441);const r={unknown:1,inches:(0,i.En)(1,"meters","inches"),feet:(0,i.En)(1,"meters","feet"),"us-feet":(0,i.En)(1,"meters","us-feet"),yards:(0,i.En)(1,"meters","yards"),miles:(0,i.En)(1,"meters","miles"),"nautical-miles":(0,i.En)(1,"meters","nautical-miles"),millimeters:(0,i.En)(1,"meters","millimeters"),centimeters:(0,i.En)(1,"meters","centimeters"),decimeters:(0,i.En)(1,"meters","decimeters"),meters:(0,i.En)(1,"meters","meters"),kilometers:(0,i.En)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.ty)(1,"meters",n.sv.radius)}},28694:(e,t,s)=>{s.d(t,{p:()=>n});var i=s(69285);function n(e,t,s){if(!s?.features||!s.hasZ)return;const n=(0,i.k)(s.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of s.features)n(e.geometry)}},86787:(e,t,s)=>{s.d(t,{Z:()=>b});var i,n=s(43697),r=s(35454),o=s(96674),a=s(70586),l=s(5600),u=(s(75215),s(67676),s(80442),s(71715)),h=s(52011),d=s(30556),c=s(69165);let p=i=class extends o.wq{constructor(e){super(e)}async collectRequiredFields(e,t){return(0,c.io)(e,t,this.expression)}clone(){return new i({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,n._)([(0,l.Cb)({type:String,json:{write:!0}})],p.prototype,"expression",void 0),(0,n._)([(0,l.Cb)({type:String,json:{write:!0}})],p.prototype,"title",void 0),p=i=(0,n._)([(0,h.j)("esri.layers.support.FeatureExpressionInfo")],p);const f=p;var _,g=s(12541);const m=(0,r.w)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new r.X({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let v=_=class extends o.wq{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,s,i){t[s]=e.write({},i),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new _({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,a._W)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,n._)([(0,l.Cb)({type:f,json:{write:!0}})],v.prototype,"featureExpressionInfo",void 0),(0,n._)([(0,u.r)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],v.prototype,"readFeatureExpressionInfo",null),(0,n._)([(0,d.c)("featureExpressionInfo",{featureExpressionInfo:{type:f},"featureExpression.value":{type:[0]}})],v.prototype,"writeFeatureExpressionInfo",null),(0,n._)([(0,l.Cb)({type:m.apiValues,nonNullable:!0,json:{type:m.jsonValues,read:m.read,write:{writer:m.write,isRequired:!0}}})],v.prototype,"mode",null),(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],v.prototype,"offset",void 0),(0,n._)([(0,l.Cb)({type:g.f9,json:{type:String,read:y.read,write:y.write}})],v.prototype,"unit",null),v=_=(0,n._)([(0,h.j)("esri.layers.support.ElevationInfo")],v);const b=v},12541:(e,t,s)=>{s.d(t,{Z7:()=>n,f9:()=>r});var i=s(99282);function n(e){return 1/(i.a[e]||1)}const r=function(){const e=Object.keys(i.a);return e.sort(),e}()},65967:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ie});var i=s(43697),n=(s(66577),s(32448)),r=s(95330),o=s(17445),a=s(5600),l=(s(75215),s(67676)),u=(s(80442),s(52011)),h=s(19402),d=s(82971),c=s(28972),p=s(3489),f=s(11145),_=s(14165),g=s(86787),m=s(13867),y=s(30175),v=s(67900),b=s(12541);function I(e=!1,t){if(e){const{elevationInfo:e,alignPointsInFeatures:s}=t;return new E(e,s)}return new C}class C{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}}class E{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new m.z(1024),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return null==i||"absolute-height"!==i.mode||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(this._alignAbsoluteElevationCandidates(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,t,s){const{offset:i,unit:n}=s;if(null==i)return;const r=(0,v._R)(t),o=i*((0,b.Z7)(n??"meters")/r);for(const t of e)switch(t.type){case"edge":t.start.z+=o,t.end.z+=o;continue;case"vertex":t.target.z+=o;continue}}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const t of e)(0,y.s1)(i,t.objectId,F).push(t);const[n,o,a]=this._prepareQuery(i,t),l=await this._alignPointsInFeatures(n,s);if((0,r.k_)(s),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(n,l,o);const{drapedObjectIds:u,failedObjectIds:h}=l,d=[];for(const t of e){const{objectId:e}=t;u.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||d.push(t)}return d}_prepareQuery(e,t){const s=[],i=[];for(const[t,n]of e){const e=[];for(const s of n)this._addToQueriesOrCachedResult(t,s.target,e,i),"edge"===s.type&&(this._addToQueriesOrCachedResult(t,s.start,e,i),this._addToQueriesOrCachedResult(t,s.end,e,i));0!==e.length&&s.push({objectId:t,points:e})}return[{spatialReference:t,pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const n=w(e,t),r=this._alignmentsCache.get(n);null==r?s.push(t):i.push(new x(t,r))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},n){for(const e of n)e.apply();let r=0;const o=this._alignmentsCache;for(const{objectId:n,points:a}of e.pointsInFeatures){if(i.has(n)){r+=a.length;continue}const e=!s.has(n);for(const s of a){const i=w(n,s),a=t[r++];s.z=a,e&&o.put(i,a,1)}}}}class x{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function w(e,{x:t,y:s,z:i,spatialReference:n}){return`${e}-${t}-${s}-${i??0}}-wkid:${n?.wkid}`}function F(){return[]}class S{filter(e,t){return t}notifyElevationSourceChange(){}}class T{filter(e,t){const{point:s,distance:i}=e,{z:n}=s;if(null==n)return t;if(0===t.length)return t;const r=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(i),o=this._updateCandidatesTo3D(t,s,r).filter(O);return o.sort(N),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":R(i,t,s);continue;case"vertex":M(i,t,s);continue}return e}}function O(e){return e.distance<=1}function B(e=!1){return e?new T:new S}function R(e,t,{x:s,y:i,z:n}){const{start:r,end:o,target:a}=e;e.draped||function(e,t,s,i){const n=i.x-s.x,r=i.y-s.y,o=i.z-s.z,a=n*n+r*r+o*o,l=(t.x-s.x)*n+(t.y-s.y)*r+o*(t.z-s.z),u=Math.min(1,Math.max(0,l/a)),h=s.x+n*u,d=s.y+r*u,c=s.z+o*u;e.x=h,e.y=d,e.z=c}(a,t,r,o);const l=(t.x-a.x)/s,u=(t.y-a.y)/i,h=(t.z-a.z)/n;e.distance=Math.sqrt(l*l+u*u+h*h)}function M(e,t,{x:s,y:i,z:n}){const{target:r}=e,o=(t.x-r.x)/s,a=(t.y-r.y)/i,l=(t.z-r.z)/n,u=Math.sqrt(o*o+a*a+l*l);e.distance=u}function N(e,t){return e.distance-t.distance}var A=s(22974),P=s(19153);function j(e=!1,t){return e?new z(t):new H}class H{async fetch(){return[]}notifySymbologyChange(){}}class z{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new m.z(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];const s=[],i=[],n=this._candidatesCache;for(const t of e){const e=k(t),r=n.get(e);if(r)for(const e of r)i.push((0,A.d9)(e));else s.push(t),n.put(e,[],1)}if(0===s.length)return i;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(s,t);if((0,r.k_)(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:h}=a;for(let e=0;e<h;++e){const t=a[e],i=k(s[l[e]]),r=n.get(i);r.push(t),n.put(i,r,r.length),u.push((0,A.d9)(t))}return i.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function k(e){switch(e.type){case"vertex":{const{objectId:t,target:s}=e,i=`${t}-vertex-${s.x}-${s.y}-${s.z??0}`;return(0,P.hP)(i).toString()}case"edge":{const{objectId:t,start:s,end:i}=e,n=`${t}-edge-${s.x}-${s.y}-${s.z??0}-to-${i.x}-${i.y}-${i.z??0}`;return(0,P.hP)(n).toString()}default:return""}}var D=s(92036);let V=class extends D.Z{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(e,t){this._pending.push({promise:e,callback:t}),1===this._pending.length&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const e=this._pending[0];e.promise.then((t=>e.callback(t))).catch((()=>{})).then((()=>{this._pending.shift(),this._process()}))}};(0,i._)([(0,a.Cb)()],V.prototype,"updating",void 0),V=(0,i._)([(0,u.j)("esri.core.AsyncSequence")],V);var U,Z=s(66643),Y=s(50758),q=s(92604),X=s(75517),L=s(6570),G=s(24470),J=s(98732),$=s(66677),W=s(78760),Q=s(34599);class K{constructor(e,t){this.data=e,this.resolution=t,this.state={type:U.CREATED},this.alive=!0}process(e){switch(this.state.type){case U.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case U.FETCH_COUNT:break;case U.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case U.FETCH_FEATURES:break;case U.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case U.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case U.CREATED:case U.FETCH_COUNT:return 0;case U.FETCHED_COUNT:return this.state.featureCount;case U.FETCH_FEATURES:return this.state.previous.featureCount;case U.FETCHED_FEATURES:return this.state.features.length;case U.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case U.CREATED:return"created";case U.FETCH_COUNT:return"fetch-count";case U.FETCHED_COUNT:return"fetched-count";case U.FETCH_FEATURES:return"fetch-features";case U.FETCHED_FEATURES:return"fetched-features";case U.DONE:return"done"}}_gotoFetchCount(e,t){return{type:U.FETCH_COUNT,previous:e,task:(0,Z.vr)((async e=>{const s=await(0,Z.mt)(t.fetchCount(this,e));this.state.type===U.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,s.ok?s.value:1/0))}))}}_gotoFetchedCount(e,t){return{type:U.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:U.FETCH_FEATURES,previous:e,task:(0,Z.vr)((async s=>{const i=await(0,Z.mt)(t.fetchFeatures(this,e.featureCount,s));this.state.type===U.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,i.ok?i.value:[]))}))}}_gotoFetchedFeatures(e,t){return{type:U.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:U.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:U.CREATED},e.type){case U.CREATED:case U.FETCHED_COUNT:case U.FETCHED_FEATURES:case U.DONE:break;case U.FETCH_COUNT:case U.FETCH_FEATURES:e.task.abort()}}intersects(e){return null==e||!this.data.extent||((0,G.oJ)(e,ee),(0,G.kK)(this.data.extent,ee))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(U||(U={}));const ee=(0,G.Ue)();let te=class extends D.Z{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=(0,X.G0)(e,this._mandatoryOutFields);(0,X.fS)(s,t)||(this._set("outFields",s),(0,X.ik)(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new h.R,this._pendingEdits=new V,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this._updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{(0,l.fS)(e,t,(({id:e},{id:t})=>e===t))||this._process()}),o.Z_),this.addHandles((0,o.gx)((()=>!this.suspended),(()=>this._process())))}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this._pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,e]of this._pendingTiles)e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this._updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this._pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,$.M8)(this.url))return;const e=(0,Z.vr)((async e=>{try{const t=await(0,Q.Vr)(this.url,new _.Z({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=L.Z.fromJSON(t.data?.extent)}catch(e){(0,r.r9)(e),q.Z.getLogger(this).warn("Failed to fetch data extent",e)}}));this._updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.addHandles((0,Y.kB)((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:s}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=s,e.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,((e,t)=>this._verifyTileComplexity(e,t)),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,s)=>this._fetchFeatures(e,t,s),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<ne}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const s=this.tileSize*t;return e*(re/(s*s))<oe}_ensureFetchAllCounts(e){let t=!0;for(const[,s]of this._pendingTiles)s.state.type<U.FETCHED_COUNT&&this._updatingHandles.addPromise(s.process(e)),s.state.type<=U.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const s=new K(e,t);return this._pendingTiles.set(e.id,s),s}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:ie,signal:t})}async _fetchFeatures(e,t,s){let i=0;const n=[];let r=0,o=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,i,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,s);l&&(i+=a.num),r+=u.length;for(const e of u)n.push(e);if(o=t-r,!l||!h||o<=0)return n}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,s=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let i=null;if(this.store.featureStore.forEach((n=>{e===n.attributes[t]&&(i=n.objectId??n.attributes[s])})),null==i)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Q.qp)(this.url,e,new W.J({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,J.lM)(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Q.JT)(this.url,e,s,{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,J.h_)(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,i=(0,X.G0)((0,X.e5)(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new _.Z({returnZ:this.hasZ,returnM:!1,geometry:null!=this.tileInfo&&null!=e?(0,G.HH)(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return null!=s&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:n,tileMaxRecordCount:r,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?_.Z.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||n)&&r?r:o||se);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/u)),e.num=Math.min(s,e.maxRecordCountFactor*u)):e.num=Math.min(s,u),!0}};(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"url",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"objectIdField",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"globalIdField",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"capabilities",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"spatialReference",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"store",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"_minimumVerticesPerFeature",null),(0,i._)([(0,a.Cb)()],te.prototype,"_mandatoryOutFields",null),(0,i._)([(0,a.Cb)()],te.prototype,"outFields",null),(0,i._)([(0,a.Cb)()],te.prototype,"suspended",void 0),(0,i._)([(0,a.Cb)()],te.prototype,"filter",null),(0,i._)([(0,a.Cb)()],te.prototype,"customParameters",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"_configuration",null),(0,i._)([(0,a.Cb)()],te.prototype,"tileInfo",null),(0,i._)([(0,a.Cb)()],te.prototype,"tileSize",null),(0,i._)([(0,a.Cb)()],te.prototype,"tilesOfInterest",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"updating",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"availability",void 0),(0,i._)([(0,a.Cb)()],te.prototype,"hasZ",null),te=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],te);const se=2e3,ie=6e5,ne=1e6,re=25,oe=1;var ae=s(43090),le=s(91303),ue=s(37549),he=s(43077);class de{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(null!=t&&(this._byteSize-=t.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[s,i]of this._store){if(this._byteSize<=e)break;this.delete(s),t(i)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}}let ce=class extends D.Z{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*le.Y.MEGABYTES,this._tileBounds=new ue.H,this._tiles=new de,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,G.Ue)()}add(e,t){for(const e of t)this._referenceFeature(e.objectId);const s=this.featureStore.upsertMany(t),i=s.map((e=>new Set(Object.keys(e.attributes)))).reduce(((e,t)=>(0,X.jV)(e,t)),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map((e=>e.objectId))),function(e){return e.reduce(((e,t)=>e+function(e){return 32+function(e){if(null==e)return 0;const t=(0,ae.do)(e.lengths,4);return 32+(0,ae.do)(e.coords,8)+t}(e.geometry)+(0,ae.f2)(e.attributes)}(t)),0)}(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,(e=>this._removeTileStorage(e)))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const n=e.id;this._tiles.set(n,new pe(e,t,s,i)),this._tileBounds.set(n,e.extent),this._tileFeatureCounts.set(n,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const s of e.objectIds)this._unreferenceFeature(s)===ye.REMOVED&&t.push(s);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){const i=(await t(e,s)).features,{hasZ:n,hasM:r}=this.featureStore;for(const e of i){const t=(0,J.$)(this._tmpBoundingRect,e.geometry,n,r);null!=t&&this._tileBounds.forEachInBounds(t,(t=>{const s=this._tiles.get(t);this.featureStore.add(e);const i=e.objectId;s.objectIds.has(i)||(s.objectIds.add(i),this._referenceFeature(i),this._tileFeatureCounts.set(s.data.id,s.objectIds.size))}))}}process(e,t=(()=>!0),s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,G.kK)((0,G.oJ)(this.extent,this._tmpBoundingRect),e.extent))return new _e(e);const i=this.getAttributesForTile(e.id);if((0,X.ik)(s,i))return new _e(e);const n=this._createTileTree(e,this.tileInfo);return this._simplify(n,t,null,0,1),this._collectMissingTiles(e,n,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map((({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const n=this._tileFeatureCounts.get(e.id);if(null!=n)return n;const r=await(0,Q.hH)(t,s,i);return this._tileFeatureCounts.set(e.id,r.data.count),r.data.count}_createTileTree(e,t){const s=new fe(e.level,e.row,e.col);return t.updateTileInfo(s,f.Z.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,(i=>{const n=this._tiles.get(i)?.data;n&&this._tilesAreRelated(e,n)&&this._populateChildren(s,n,t,this._tileFeatureCounts.get(n.id)||0)})),s}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,n=s?t:e,r=1<<n.level-i.level;return Math.floor(n.row/r)===i.row&&Math.floor(n.col/r)===i.col}_populateChildren(e,t,s,i){const n=t.level-e.level-1;if(n<0)return void(e.isLeaf=!0);const r=t.row>>n,o=t.col>>n,a=e.row<<1,l=o-(e.col<<1)+(r-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,s,i);else{const n=new fe(e.level+1,r,o);s.updateTileInfo(n,f.Z.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=n,this._populateChildren(n,t,s,i)}}_simplify(e,t,s,i,n){const r=n*n;if(e.isLeaf)return t(this.getFeatureCount(e),n)?0:(this._remove(e),null!=s&&(s.children[i]=null),r);const o=n/2,a=o*o;let l=0;for(let s=0;s<e.children.length;s++){const i=e.children[s];l+=null!=i?this._simplify(i,t,e,s,o):a}return 0===l?this._mergeChildren(e):1-l/r<me&&(this._purge(e),null!=s&&(s.children[i]=null),l=r),l}_mergeChildren(e){const t=new Set;let s,i=0;this._forEachLeaf(e,(e=>{const n=this._tiles.get(e.id);if(n){s=s?(0,X.jV)(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const e of n.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const n=new ge(s,e,this.extent);return this._collectMissingTilesRecurse(t,n,1,i),n.info}_collectMissingTilesRecurse(e,t,s,i){const n=this.getAttributesForTile(e.id),r=n&&!(0,X.ik)(i,n);if(r&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(r||t.addMissing(e.level,e.row,e.col,s));const o=s/2;for(let s=0;s<e.children.length;s++){const n=e.children[s];null==n?t.addMissing(e.level+1,(e.row<<1)+((2&s)>>1),(e.col<<1)+(1&s),o):this._collectMissingTilesRecurse(n,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?ye.ADDED:ye.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),ye.REMOVED):(t>0&&this._refCounts.set(e,t),ye.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map((e=>`${e.data.id}:[${Array.from(e.objectIds)}]`)),featureReferences:Array.from(this._refCounts.keys()).map((e=>`${e}:${this._refCounts.get(e)}`))}}};(0,i._)([(0,a.Cb)({constructOnly:!0})],ce.prototype,"featureStore",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"tileInfo",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"extent",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"maximumByteSize",void 0),ce=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],ce);class pe{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}}class fe{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class _e{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,G.SO)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class ge{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new _e(t),null!=s&&(this._extent=(0,G.oJ)(s))}addMissing(e,t,s,i){const n=new he.f(null,e,t,s);this._tileInfo.updateTileInfo(n,f.Z.ExtrapolateOptions.POWER_OF_TWO),null==n.extent||null!=this._extent&&!(0,G.kK)(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:i}),this.info.coveredArea-=(0,G.SO)(n.extent))}}const me=.18751;var ye;!function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"}(ye||(ye={}));var ve=s(33955);let be=class extends n.Z.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=(0,r.hh)(),this._elevationAligner=I(),this._elevationFilter=B(),this._symbologyCandidatesFetcher=j(),this._updatingHandles=new h.R,this._editsUpdatingHandles=new h.R,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return(0,r.k_)(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return(0,r.k_)(t),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:n}=e.serviceInfo,{hasZ:r}=e,a=d.Z.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new c.Z({...e.serviceInfo,hasZ:r,hasM:!1}),this._queryEngine=new p.q({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:r,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new te({store:new ce({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:d.Z.fromJSON(e.serviceInfo.spatialReference)});const l="3d"===e.configuration.viewType;return this._elevationAligner=I(l,{elevationInfo:null!=e.elevationInfo?g.Z.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=B(l),this.addHandles([(0,o.YP)((()=>this._featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),o.Z_),(0,o.YP)((()=>this.updating),(()=>this._notifyUpdating()))]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),Ce}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.suspended=e,Ce}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.outFields=new Set(e??[]),Ce}async fetchCandidates(e,t){await this._whenSetup.promise,(0,r.k_)(t);const s=function(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:n,timeExtent:r,objectIds:o}=e.filter,a={geometry:e.filter.geometry?(0,ve.im)(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:r,objectIds:o,where:n??"1=1"};return{...e,query:a}}(e),i=t?.signal,n=await this._queryEngine.executeQueryForSnapping(s,i);(0,r.k_)(i);const o=await this._elevationAligner.alignCandidates(n.candidates,e.point.spatialReference??d.Z.WGS84,i);(0,r.k_)(i);const a=await this._symbologyCandidatesFetcher.fetch(o,i);(0,r.k_)(i);const l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(s,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?f.Z.fromJSON(e.tileInfo):null,Ce}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.refresh(),Ce}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),await(0,o.N1)((()=>!this.updatingExcludingEdits),t),(0,r.k_)(t),Ce}async getDebugInfo(e,t){return(0,r.k_)(t),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,t){this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t);const s=(0,r.hh)();return this._pendingApplyEdits.set(e.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),Ce}async endApplyEdits(e,t){const s=this._pendingApplyEdits.get(e.id);return s&&s.resolve(e.edits),(0,r.k_)(t),Ce}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),Ce}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),Ce}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=j(e,this._getSymbologyCandidates),Ce}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?_.Z.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,i._)([(0,a.Cb)({readOnly:!0})],be.prototype,"updating",null),(0,i._)([(0,a.Cb)({readOnly:!0})],be.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.Cb)()],be.prototype,"_isInitializing",void 0),be=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],be);const Ie=be,Ce={result:{}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[664],{25929:(e,t,s)=>{s.d(t,{M:()=>f,a:()=>g,e:()=>c,f:()=>n,i:()=>h,p:()=>d,r:()=>o,t:()=>r,w:()=>a});var i=s(17452);function n(e,t){const s=t?.url?.path;if(e&&s&&(e=(0,i.hF)(e,s,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const s=(0,i.PF)(e,t.portalItem.itemUrl);null!=s&&u.test(s)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(s).path)}return p(e,t?.portal)}function r(e,t,s=f.YES){if(null==e)return e;!(0,i.YP)(e)&&t?.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let n=(0,i.hF)(e);if(t){const s=t.verifyItemRelativeUrls?.rootPath||t.url?.path;if(s){const r=p(s,t.portal),o=p(n,t.portal);n=(0,i.PF)(o,r,r),null!=n&&n!==o&&n!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(n)}}return n=c(n,t?.portal),(0,i.YP)(n)&&(n=(0,i.Fv)(n)),t?.resources&&t?.portalItem&&!(0,i.YP)(n)&&!(0,i.HK)(n)&&s===f.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(n),compress:!1}),n}function o(e,t,s){return n(e,s)}function a(e,t,s,i){const n=r(e,i);void 0!==n&&(t[s]=n)}const l=/\/items\/([^\/]+)\/resources\/(.*)/,u=/^\.\/resources\//;function h(e){const t=e?.match(l)??null;return t?.[1]??null}function d(e){const t=e?.match(l)??null;if(null==t)return null;const s=t[2],n=s.lastIndexOf("/");if(-1===n){const{path:e,extension:t}=(0,i.fZ)(s);return{prefix:null,filename:e,extension:t}}const{path:r,extension:o}=(0,i.fZ)(s.slice(n+1));return{prefix:s.slice(0,n),filename:r,extension:o}}function c(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?(0,i.Ie)(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function p(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const s=`${t.urlKey}.${t.customBaseUrl}`,n=(0,i.TI)();return(0,i.D6)(n,`${n.scheme}://${s}`)?(0,i.Ie)(e,t.portalHostname,s):(0,i.Ie)(e,s,t.portalHostname)}var f,_;(_=f||(f={}))[_.YES=0]="YES",_[_.NO=1]="NO";const g=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return f},ensureMainOnlineDomain:c,fromJSON:n,itemIdFromResourceUrl:h,prefixAndFilenameFromResourceUrl:d,read:o,toJSON:r,write:a},Symbol.toStringTag,{value:"Module"}))},91303:(e,t,s)=>{var i;s.d(t,{Y:()=>i}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(i||(i={}))},24133:(e,t,s)=>{s.d(t,{Q:()=>o});var i=s(67676),n=s(44553),r=s(88764);class o{constructor(e=9,t){this._compareMinX=h,this._compareMinY=d,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),v.prune(),b.prune(),I.prune(),C.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(m(e,s))for(v.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;m(e,o)&&(s.leaf?t(r):g(e,o)?this._all(r,t):v.push(r))}s=v.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!m(e,t))return!1;for(v.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(m(e,r)){if(t.leaf||g(e,r))return!0;v.push(n)}}t=v.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new w([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(I.clear(),C.clear();s||I.length>0;){if(s||(s=I.pop(),n=I.data[I.length-1],r=C.pop()??0,o=!0),s.leaf&&(t=(0,i.cq)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),I.push(s),this._condense(I),this;o||s.leaf||!g(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(I.push(s),C.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(b.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else b.pushArray(s.children);s=b.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new w(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new F([]);o.height=i;const l=Math.ceil(n/r),u=l*Math.ceil(Math.sqrt(r));y(e,t,s,u,this._compareMinX);for(let n=t;n<=s;n+=u){const t=Math.min(n+u-1,s);y(e,n,t,l,this._compareMinY);for(let s=n;s<=t;s+=l){const n=Math.min(s+l-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=c(o),l=f(e,o)-a;l<n?(n=l,i=a<i?a:i,s=o):l===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);I.clear();const r=this._chooseSubtree(n,this._data,t,I);for(r.children.push(e),u(r,n);t>=0&&I.data[t].children.length>this._maxEntries;)this._split(I,t),t--;this._adjustParentBBoxes(n,I,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),l=s.leaf?new w(o):new F(o);l.height=s.height,a(s,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(s,l)}_splitRoot(e,t){this._data=new F([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,s,this._toBBox),u=_(t,a),h=c(t)+c(a);u<i?(i=u,r=o,n=h<n?h:n):u===i&&h<n&&(n=h,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:h,n=e.leaf?this._compareMinY:d;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=l(e,0,t,n),o=l(e,s-t,s,n);let a=p(r)+p(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=p(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=p(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.cq)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,s,i,n){n||(n=new w([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],u(n,e.leaf?i(r):r);return n}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function d(e,t){return e.minY-t.minY}function c(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(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 _(e,t){const s=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function m(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const v=new n.Z,b=new n.Z,I=new n.Z,C=new n.Z({deallocator:void 0});class E{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class x extends E{constructor(){super(...arguments),this.height=1,this.indexHint=new i.SO}}class w extends x{constructor(e){super(),this.children=e,this.leaf=!0}}class F extends x{constructor(e){super(),this.children=e,this.leaf=!1}}},19402:(e,t,s)=>{s.d(t,{R:()=>h});var i=s(43697),n=s(92036),r=s(50758),o=s(17445),a=s(1654),l=s(5600),u=s(52011);let h=class extends n.Z{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o.YP)}addWhen(e,t,s={}){return this._installWatch(e,t,s,o.gx)}addOnCollectionChange(e,t,{initial:s=!1,final:i=!1}={}){const n=++this._handleId;return this.addHandles([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.Z_),(0,o.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:i?e=>t({added:[],removed:e.toArray()}):void 0})],n),(0,r.kB)((()=>this.removeHandles(n)))}addPromise(e){if(null==e)return e;const t=++this._handleId;this.addHandles((0,r.kB)((()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this.hasHandles(d)||this._set("updating",!1))})),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},i){const n=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,n);const o=i(e,t,s);return this.addHandles(o,n),(0,r.kB)((()=>this.removeHandles(n)))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),i=(0,o.YP)(e,s,{sync:!0,equals:()=>!1});return this.addHandles(i,t),i}_createSyncUpdatingCallback(){return()=>{this.removeHandles(d),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,a.Os)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(d))})),d)}}};(0,i._)([(0,l.Cb)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,i._)([(0,u.j)("esri.core.support.UpdatingHandles")],h);const d=-42},37549:(e,t,s)=>{s.d(t,{H:()=>a});var i=s(80442),n=s(24133),r=s(24470);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.Q(9,(0,i.Z)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.cS)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},28972:(e,t,s)=>{s.d(t,{Z:()=>x});var i=s(67676),n=s(20102),r=s(32448),o=s(92604),a=s(60437),l=s(24470),u=s(98732),h=s(37549),d=s(42712);function c(e,t){return e?t?4:3:t?3:2}function p(e,t,s,i,n){if(!t?.lengths.length)return null;const r="upperLeft"===n?.originPosition?-1:1;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const o=e.coords,a=[],l=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:u,coords:h}=t,d=c(s,i);let p=0;for(const e of u){const t=f(l,h,p,e,s,i,r);t&&a.push(t),p+=e*d}if(a.sort(((e,t)=>{let i=r*e[2]-r*t[2];return 0===i&&s&&(i=e[4]-t[4]),i})),a.length){let e=6*a[0][2];o[0]=a[0][0]/e,o[1]=a[0][1]/e,s&&(e=6*a[0][4],o[2]=0!==e?a[0][3]/e:0),(o[0]<l[0]||o[0]>l[1]||o[1]<l[2]||o[1]>l[3]||s&&(o[2]<l[4]||o[2]>l[5]))&&(o.length=0)}if(!o.length){const e=t.lengths[0]?_(h,0,u[0],s,i):null;if(!e)return null;o[0]=e[0],o[1]=e[1],s&&e.length>2&&(o[2]=e[2])}return e}function f(e,t,s,i,n,r,o=1){const a=c(n,r);let l=s,u=s+a,h=0,d=0,p=0,f=0,_=0;for(let s=0,r=i-1;s<r;s++,l+=a,u+=a){const s=t[l],i=t[l+1],r=t[l+2],o=t[u],a=t[u+1],c=t[u+2];let g=s*a-o*i;f+=g,h+=(s+o)*g,d+=(i+a)*g,n&&(g=s*c-o*r,p+=(r+c)*g,_+=g),s<e[0]&&(e[0]=s),s>e[1]&&(e[1]=s),i<e[2]&&(e[2]=i),i>e[3]&&(e[3]=i),n&&(r<e[4]&&(e[4]=r),r>e[5]&&(e[5]=r))}if(f*o>0&&(f*=-1),_*o>0&&(_*=-1),!f)return null;const g=[h,d,.5*f];return n&&(g[3]=p,g[4]=.5*_),g}function _(e,t,s,i,n){const r=c(i,n);let o=t,a=t+r,l=0,u=0,h=0,d=0;for(let t=0,n=s-1;t<n;t++,o+=r,a+=r){const t=e[o],s=e[o+1],n=e[o+2],r=e[a],c=e[a+1],p=e[a+2],f=i?m(t,s,n,r,c,p):g(t,s,r,c);if(f)if(l+=f,i){const e=v(t,s,n,r,c,p);u+=f*e[0],h+=f*e[1],d+=f*e[2]}else{const e=y(t,s,r,c);u+=f*e[0],h+=f*e[1]}}return l>0?i?[u/l,h/l,d/l]:[u/l,h/l]:s>0?i?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function g(e,t,s,i){const n=s-e,r=i-t;return Math.sqrt(n*n+r*r)}function m(e,t,s,i,n,r){const o=i-e,a=n-t,l=r-s;return Math.sqrt(o*o+a*a+l*l)}function y(e,t,s,i){return[e+.5*(s-e),t+.5*(i-t)]}function v(e,t,s,i,n,r){return[e+.5*(i-e),t+.5*(n-t),s+.5*(r-s)]}var b=s(70272),I=s(5428);const C={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new b.u_(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>(null==e.centroid&&(e.centroid=p(new I.Z,e.geometry,t.hasZ,t.hasM)),e.centroid)},E=(0,a.Ue)();class x{constructor(e){this.geometryInfo=e,this._boundsStore=new h.H,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.Z,this.featureAdapter=C}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,d.S2)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.pC)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.JR)(E,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.Z("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.$)(null!=i?i:(0,l.Ue)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.Z("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.$)((0,l.Ue)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},1231:(e,t,s)=>{s.d(t,{Z:()=>g});var i,n=s(43697),r=s(35454),o=s(96674),a=s(5600),l=s(75215),u=(s(67676),s(80442),s(36030)),h=s(71715),d=s(52011),c=s(72729),p=s(86719);const f=new r.X({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let _=i=class extends o.wq{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?.value??null}readValueType(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?f.fromJSON(s.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,n._)([(0,a.Cb)({type:String,json:{write:!0}})],_.prototype,"alias",void 0),(0,n._)([(0,a.Cb)({type:[String,Number],json:{write:{allowNull:!0}}})],_.prototype,"defaultValue",void 0),(0,n._)([(0,a.Cb)()],_.prototype,"description",void 0),(0,n._)([(0,h.r)("description")],_.prototype,"readDescription",null),(0,n._)([(0,a.Cb)({types:c.V5,json:{read:{reader:c.im},write:!0}})],_.prototype,"domain",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),(0,n._)([(0,a.Cb)({type:l.z8,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],_.prototype,"length",void 0),(0,n._)([(0,a.Cb)({type:String,json:{write:!0}})],_.prototype,"name",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),(0,n._)([(0,u.J)(p.v)],_.prototype,"type",void 0),(0,n._)([(0,a.Cb)()],_.prototype,"valueType",void 0),(0,n._)([(0,h.r)("valueType",["description"])],_.prototype,"readValueType",null),(0,n._)([(0,a.Cb)({type:Boolean,json:{read:!1}})],_.prototype,"visible",void 0),_=i=(0,n._)([(0,d.j)("esri.layers.support.Field")],_);const g=_},39450:(e,t,s)=>{s.d(t,{Z:()=>h});var i,n=s(43697),r=s(96674),o=s(5600),a=s(75215),l=(s(67676),s(80442),s(52011));let u=i=class extends r.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new i({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"cols",void 0),(0,n._)([(0,o.Cb)({type:a.z8,json:{write:!0}})],u.prototype,"level",void 0),(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],u.prototype,"levelValue",void 0),(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"origin",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{write:!0}})],u.prototype,"resolution",void 0),(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"rows",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{write:!0}})],u.prototype,"scale",void 0),u=i=(0,n._)([(0,l.j)("esri.layers.support.LOD")],u);const h=u},11145:(e,t,s)=>{s.d(t,{Z:()=>x});var i,n=s(43697),r=s(35454),o=s(96674),a=s(67900),l=s(5600),u=s(75215),h=(s(67676),s(80442),s(71715)),d=s(52011),c=s(30556),p=s(94139),f=s(82971),_=s(24470),g=s(8744),m=s(40488),y=s(39450),v=s(43077);const b=new r.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let I=i=class extends o.wq{static create(e={}){const{resolutionFactor:t=1,scales:s,size:n=256,spatialReference:r=f.Z.WebMercator,numLODs:o=24}=e;if(!(0,g.JY)(r)){const e=[];if(s)for(let t=0;t<s.length;t++){const i=s[t];e.push(new y.Z({level:t,scale:i,resolution:i}))}else{let t=5e-4;for(let s=o-1;s>=0;s--)e.unshift(new y.Z({level:s,scale:t,resolution:t})),t*=2}return new i({dpi:96,lods:e,origin:new p.Z(0,0,r),size:[n,n],spatialReference:r})}const l=(0,g.C5)(r),u=e.origin?new p.Z({x:e.origin.x,y:e.origin.y,spatialReference:r}):new p.Z(l?{x:l.origin[0],y:l.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),h=1/(39.37*(0,a.c9)(r)*96),d=[];if(s)for(let e=0;e<s.length;e++){const t=s[e],i=t*h;d.push(new y.Z({level:e,scale:t,resolution:i}))}else{let e=(0,g.sT)(r)?512/n*591657527.5917094:256/n*591657527.591555;const s=Math.ceil(o/t);d.push(new y.Z({level:0,scale:e,resolution:e*h}));for(let i=1;i<s;i++){const s=e/2**t,n=s*h;d.push(new y.Z({level:i,scale:s,resolution:n})),e=s}}return new i({dpi:96,lods:d,origin:u,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const s=(0,g.C5)(e);return e.isWrappable&&!!s&&Math.abs(s.origin[0]-t.x)<=s.dx}return!1}readOrigin(e,t){return p.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,s=0;const i=[],n=this._levelToLOD={};e&&(t=-1/0,s=1/0,e.forEach((e=>{i.push(e.scale),t=e.scale>t?e.scale:t,s=e.scale<s?e.scale:s,n[e.level]=e}))),this._set("scales",i),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;i<s;i++){const s=t[i],n=t[i+1];if(s<=e)return i;if(n===e)return i+1;if(s>e&&n<e)return i+Math.log(s/e)/Math.log(s/n)}return i}snapScale(e,t=.95){const s=this.scaleToZoom(e);return s%Math.floor(s)>=t?this.zoomToScale(Math.ceil(s)):this.zoomToScale(Math.floor(s))}tileAt(e,t,s,i){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=s;else if((0,g.fS)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,i=s;else{const e=(0,m.iV)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,i=s}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return i||(i=new v.f(null,0,0,0,(0,_.Ue)())),i.level=e,i.row=Math.floor((this.origin.y-o)/l+.001),i.col=Math.floor((r-this.origin.x)/a+.001),this.updateTileInfo(i),i}updateTileInfo(e,t=i.ExtrapolateOptions.NONE){let s=this.lodAt(e.level);if(!s&&t===i.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(s=t)}if(!s)return;const n=e.level-s.level,r=s.resolution*this.size[0]/2**n,o=s.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,_.Ue)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const s=this.lodAt(t.level);if(null==s)return null;const{resolution:i}=s,n=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return i.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const s=[],n=this.lods.length;for(let e=0;e<n;e++){const i=this.lods[e],n=i.resolution*t;s.push(new y.Z({level:i.level,scale:i.scale,resolution:n}))}return new i({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;s<e.length;s++){const i=e[s];this._upsampleLevels[i.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/i.resolution:0},t=i}}};var C,E;(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],I.prototype,"compressionQuality",void 0),(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],I.prototype,"dpi",void 0),(0,n._)([(0,l.Cb)({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],I.prototype,"format",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],I.prototype,"isWrappable",null),(0,n._)([(0,l.Cb)({type:p.Z,json:{write:!0}})],I.prototype,"origin",void 0),(0,n._)([(0,h.r)("origin")],I.prototype,"readOrigin",null),(0,n._)([(0,l.Cb)({type:[y.Z],value:null,json:{write:!0}})],I.prototype,"lods",null),(0,n._)([(0,l.Cb)({readOnly:!0})],I.prototype,"scales",void 0),(0,n._)([(0,l.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],I.prototype,"size",void 0),(0,n._)([(0,h.r)("size",["rows","cols"])],I.prototype,"readSize",null),(0,n._)([(0,c.c)("size",{cols:{type:u.z8},rows:{type:u.z8}})],I.prototype,"writeSize",null),(0,n._)([(0,l.Cb)({type:f.Z,json:{write:!0}})],I.prototype,"spatialReference",void 0),I=i=(0,n._)([(0,d.j)("esri.layers.support.TileInfo")],I),C=I||(I={}),(E=C.ExtrapolateOptions||(C.ExtrapolateOptions={}))[E.NONE=0]="NONE",E[E.POWER_OF_TWO=1]="POWER_OF_TWO";const x=I},43077:(e,t,s)=>{s.d(t,{f:()=>i});class i{constructor(e,t,s,i,n=void 0){this.id=e,this.level=t,this.row=s,this.col=i,this.extent=n}}},66677:(e,t,s)=>{s.d(t,{B5:()=>h,DR:()=>c,G:()=>v,M8:()=>_,Nm:()=>g,Qc:()=>d,XG:()=>m,a7:()=>f,ld:()=>p,wH:()=>y});var i=s(17452),n=s(25929);const r={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},o=Object.values(r),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function h(e){return!!a.test(e)}function d(e){if(null==e)return null;const t=(0,i.mN)(e),s=t?.path.match(a)||t?.path.match(l);if(!s)return null;const[,n,o,u,h]=s,d=o.indexOf("/");return{title:p(-1!==d?o.slice(d+1):o),serverType:r[u.toLowerCase()],sublayer:null!=h&&""!==h?parseInt(h,10):null,url:{path:n}}}function c(e){const t=(0,i.mN)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function p(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function f(e,t){const s=[];if(e){const t=d(e);null!=t&&t.title&&s.push(t.title)}if(t){const e=p(t);s.push(e)}if(2===s.length){if(s[0].toLowerCase().includes(s[1].toLowerCase()))return s[0];if(s[1].toLowerCase().includes(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function _(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),s=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&s}function g(e,t){return e?(0,i.Qj)((0,i.Hu)(e,t)):e}function m(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 r;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(r=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=c(s.path);null!=e&&(t=e.serviceUrl,r=e.sublayerId)}return{url:(0,i.Qj)(t),layerId:r}}function y(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.v_)(r.url,s,e.layerId.toString()))}function v(e){if(!e)return!1;const t=e.toLowerCase(),s=t.includes("/services/"),i=t.includes("/mapserver/wmsserver"),n=t.includes("/imageserver/wmsserver"),r=t.includes("/wmsserver");return s&&(i||n||r)}},72729:(e,t,s)=>{s.d(t,{im:()=>x,V5:()=>E}),s(80442);var i,n=s(43697),r=s(22974),o=s(5600),a=(s(75215),s(36030)),l=s(52011),u=s(96674);s(67676);let h=i=class extends u.wq{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],h.prototype,"name",void 0),(0,n._)([(0,o.Cb)({type:[String,Number],json:{write:!0}})],h.prototype,"code",void 0),h=i=(0,n._)([(0,l.j)("esri.layers.support.CodedValue")],h);const d=new(s(35454).X)({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends u.wq{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,n._)([(0,a.J)(d)],c.prototype,"type",void 0),c=(0,n._)([(0,l.j)("esri.layers.support.Domain")],c);const p=c;var f;let _=f=class extends p{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const s=String(e);this.codedValues.some((e=>(String(e.code)===s&&(t=e.name),!!t)))}return t}clone(){return new f({codedValues:(0,r.d9)(this.codedValues),name:this.name})}};(0,n._)([(0,o.Cb)({type:[h],json:{write:!0}})],_.prototype,"codedValues",void 0),(0,n._)([(0,a.J)({codedValue:"coded-value"})],_.prototype,"type",void 0),_=f=(0,n._)([(0,l.j)("esri.layers.support.CodedValueDomain")],_);const g=_;var m;s(92604),s(20102);let y=m=class extends p{constructor(e){super(e),this.type="inherited"}clone(){return new m}};(0,n._)([(0,a.J)({inherited:"inherited"})],y.prototype,"type",void 0),y=m=(0,n._)([(0,l.j)("esri.layers.support.InheritedDomain")],y);const v=y;var b;let I=b=class extends p{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new b({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,n._)([(0,o.Cb)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,s){t[s]=[this.minValue||0,e]}}}})],I.prototype,"maxValue",void 0),(0,n._)([(0,o.Cb)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,s){t[s]=[e,this.maxValue||0]}}}})],I.prototype,"minValue",void 0),(0,n._)([(0,a.J)({range:"range"})],I.prototype,"type",void 0),I=b=(0,n._)([(0,l.j)("esri.layers.support.RangeDomain")],I);const C=I,E={key:"type",base:p,typeMap:{range:I,"coded-value":g,inherited:v}};function x(e){if(!e?.type)return null;switch(e.type){case"range":return C.fromJSON(e);case"codedValue":return g.fromJSON(e);case"inherited":return v.fromJSON(e)}return null}},99282:(e,t,s)=>{s.d(t,{a:()=>r});var i=s(67900),n=s(68441);const r={unknown:1,inches:(0,i.En)(1,"meters","inches"),feet:(0,i.En)(1,"meters","feet"),"us-feet":(0,i.En)(1,"meters","us-feet"),yards:(0,i.En)(1,"meters","yards"),miles:(0,i.En)(1,"meters","miles"),"nautical-miles":(0,i.En)(1,"meters","nautical-miles"),millimeters:(0,i.En)(1,"meters","millimeters"),centimeters:(0,i.En)(1,"meters","centimeters"),decimeters:(0,i.En)(1,"meters","decimeters"),meters:(0,i.En)(1,"meters","meters"),kilometers:(0,i.En)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.ty)(1,"meters",n.sv.radius)}},28694:(e,t,s)=>{s.d(t,{p:()=>n});var i=s(69285);function n(e,t,s){if(!s?.features||!s.hasZ)return;const n=(0,i.k)(s.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of s.features)n(e.geometry)}},86787:(e,t,s)=>{s.d(t,{Z:()=>b});var i,n=s(43697),r=s(35454),o=s(96674),a=s(70586),l=s(5600),u=(s(75215),s(67676),s(80442),s(71715)),h=s(52011),d=s(30556),c=s(69165);let p=i=class extends o.wq{constructor(e){super(e)}async collectRequiredFields(e,t){return(0,c.io)(e,t,this.expression)}clone(){return new i({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,n._)([(0,l.Cb)({type:String,json:{write:!0}})],p.prototype,"expression",void 0),(0,n._)([(0,l.Cb)({type:String,json:{write:!0}})],p.prototype,"title",void 0),p=i=(0,n._)([(0,h.j)("esri.layers.support.FeatureExpressionInfo")],p);const f=p;var _,g=s(12541);const m=(0,r.w)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new r.X({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let v=_=class extends o.wq{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,s,i){t[s]=e.write({},i),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new _({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,a._W)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,n._)([(0,l.Cb)({type:f,json:{write:!0}})],v.prototype,"featureExpressionInfo",void 0),(0,n._)([(0,u.r)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],v.prototype,"readFeatureExpressionInfo",null),(0,n._)([(0,d.c)("featureExpressionInfo",{featureExpressionInfo:{type:f},"featureExpression.value":{type:[0]}})],v.prototype,"writeFeatureExpressionInfo",null),(0,n._)([(0,l.Cb)({type:m.apiValues,nonNullable:!0,json:{type:m.jsonValues,read:m.read,write:{writer:m.write,isRequired:!0}}})],v.prototype,"mode",null),(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],v.prototype,"offset",void 0),(0,n._)([(0,l.Cb)({type:g.f9,json:{type:String,read:y.read,write:y.write}})],v.prototype,"unit",null),v=_=(0,n._)([(0,h.j)("esri.layers.support.ElevationInfo")],v);const b=v},12541:(e,t,s)=>{s.d(t,{Z7:()=>n,f9:()=>r});var i=s(99282);function n(e){return 1/(i.a[e]||1)}const r=function(){const e=Object.keys(i.a);return e.sort(),e}()},65967:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ie});var i=s(43697),n=(s(66577),s(32448)),r=s(95330),o=s(17445),a=s(5600),l=(s(75215),s(67676)),u=(s(80442),s(52011)),h=s(19402),d=s(82971),c=s(28972),p=s(3489),f=s(11145),_=s(14165),g=s(86787),m=s(13867),y=s(30175),v=s(67900),b=s(12541);function I(e=!1,t){if(e){const{elevationInfo:e,alignPointsInFeatures:s}=t;return new E(e,s)}return new C}class C{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}}class E{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new m.z(1024),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return null==i||"absolute-height"!==i.mode||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(this._alignAbsoluteElevationCandidates(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,t,s){const{offset:i,unit:n}=s;if(null==i)return;const r=(0,v._R)(t),o=i*((0,b.Z7)(n??"meters")/r);for(const t of e)switch(t.type){case"edge":t.start.z+=o,t.end.z+=o;continue;case"vertex":t.target.z+=o;continue}}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const t of e)(0,y.s1)(i,t.objectId,F).push(t);const[n,o,a]=this._prepareQuery(i,t),l=await this._alignPointsInFeatures(n,s);if((0,r.k_)(s),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(n,l,o);const{drapedObjectIds:u,failedObjectIds:h}=l,d=[];for(const t of e){const{objectId:e}=t;u.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||d.push(t)}return d}_prepareQuery(e,t){const s=[],i=[];for(const[t,n]of e){const e=[];for(const s of n)this._addToQueriesOrCachedResult(t,s.target,e,i),"edge"===s.type&&(this._addToQueriesOrCachedResult(t,s.start,e,i),this._addToQueriesOrCachedResult(t,s.end,e,i));0!==e.length&&s.push({objectId:t,points:e})}return[{spatialReference:t.toJSON(),pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const n=w(e,t),r=this._alignmentsCache.get(n);null==r?s.push(t):i.push(new x(t,r))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},n){for(const e of n)e.apply();let r=0;const o=this._alignmentsCache;for(const{objectId:n,points:a}of e.pointsInFeatures){if(i.has(n)){r+=a.length;continue}const e=!s.has(n);for(const s of a){const i=w(n,s),a=t[r++];s.z=a,e&&o.put(i,a,1)}}}}class x{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function w(e,{x:t,y:s,z:i,spatialReference:n}){return`${e}-${t}-${s}-${i??0}}-wkid:${n?.wkid}`}function F(){return[]}class S{filter(e,t){return t}notifyElevationSourceChange(){}}class T{filter(e,t){const{point:s,distance:i}=e,{z:n}=s;if(null==n)return t;if(0===t.length)return t;const r=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(i),o=this._updateCandidatesTo3D(t,s,r).filter(O);return o.sort(M),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":R(i,t,s);continue;case"vertex":N(i,t,s);continue}return e}}function O(e){return e.distance<=1}function B(e=!1){return e?new T:new S}function R(e,t,{x:s,y:i,z:n}){const{start:r,end:o,target:a}=e;e.draped||function(e,t,s,i){const n=i.x-s.x,r=i.y-s.y,o=i.z-s.z,a=n*n+r*r+o*o,l=(t.x-s.x)*n+(t.y-s.y)*r+o*(t.z-s.z),u=Math.min(1,Math.max(0,l/a)),h=s.x+n*u,d=s.y+r*u,c=s.z+o*u;e.x=h,e.y=d,e.z=c}(a,t,r,o);const l=(t.x-a.x)/s,u=(t.y-a.y)/i,h=(t.z-a.z)/n;e.distance=Math.sqrt(l*l+u*u+h*h)}function N(e,t,{x:s,y:i,z:n}){const{target:r}=e,o=(t.x-r.x)/s,a=(t.y-r.y)/i,l=(t.z-r.z)/n,u=Math.sqrt(o*o+a*a+l*l);e.distance=u}function M(e,t){return e.distance-t.distance}var A=s(22974),P=s(19153);function j(e=!1,t){return e?new z(t):new H}class H{async fetch(){return[]}notifySymbologyChange(){}}class z{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new m.z(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];const s=[],i=[],n=this._candidatesCache;for(const t of e){const e=k(t),r=n.get(e);if(r)for(const e of r)i.push((0,A.d9)(e));else s.push(t),n.put(e,[],1)}if(0===s.length)return i;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(s,t);if((0,r.k_)(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:h}=a;for(let e=0;e<h;++e){const t=a[e],i=k(s[l[e]]),r=n.get(i);r.push(t),n.put(i,r,r.length),u.push((0,A.d9)(t))}return i.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function k(e){switch(e.type){case"vertex":{const{objectId:t,target:s}=e,i=`${t}-vertex-${s.x}-${s.y}-${s.z??0}`;return(0,P.hP)(i).toString()}case"edge":{const{objectId:t,start:s,end:i}=e,n=`${t}-edge-${s.x}-${s.y}-${s.z??0}-to-${i.x}-${i.y}-${i.z??0}`;return(0,P.hP)(n).toString()}default:return""}}var D=s(92036);let V=class extends D.Z{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(e,t){this._pending.push({promise:e,callback:t}),1===this._pending.length&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const e=this._pending[0];e.promise.then((t=>e.callback(t))).catch((()=>{})).then((()=>{this._pending.shift(),this._process()}))}};(0,i._)([(0,a.Cb)()],V.prototype,"updating",void 0),V=(0,i._)([(0,u.j)("esri.core.AsyncSequence")],V);var Z,U=s(66643),Y=s(50758),q=s(92604),X=s(75517),L=s(6570),J=s(24470),G=s(98732),$=s(66677),W=s(78760),Q=s(34599);class K{constructor(e,t){this.data=e,this.resolution=t,this.state={type:Z.CREATED},this.alive=!0}process(e){switch(this.state.type){case Z.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case Z.FETCH_COUNT:break;case Z.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case Z.FETCH_FEATURES:break;case Z.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case Z.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case Z.CREATED:case Z.FETCH_COUNT:return 0;case Z.FETCHED_COUNT:return this.state.featureCount;case Z.FETCH_FEATURES:return this.state.previous.featureCount;case Z.FETCHED_FEATURES:return this.state.features.length;case Z.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case Z.CREATED:return"created";case Z.FETCH_COUNT:return"fetch-count";case Z.FETCHED_COUNT:return"fetched-count";case Z.FETCH_FEATURES:return"fetch-features";case Z.FETCHED_FEATURES:return"fetched-features";case Z.DONE:return"done"}}_gotoFetchCount(e,t){return{type:Z.FETCH_COUNT,previous:e,task:(0,U.vr)((async e=>{const s=await(0,U.mt)(t.fetchCount(this,e));this.state.type===Z.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,s.ok?s.value:1/0))}))}}_gotoFetchedCount(e,t){return{type:Z.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:Z.FETCH_FEATURES,previous:e,task:(0,U.vr)((async s=>{const i=await(0,U.mt)(t.fetchFeatures(this,e.featureCount,s));this.state.type===Z.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,i.ok?i.value:[]))}))}}_gotoFetchedFeatures(e,t){return{type:Z.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:Z.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:Z.CREATED},e.type){case Z.CREATED:case Z.FETCHED_COUNT:case Z.FETCHED_FEATURES:case Z.DONE:break;case Z.FETCH_COUNT:case Z.FETCH_FEATURES:e.task.abort()}}intersects(e){return null==e||!this.data.extent||((0,J.oJ)(e,ee),(0,J.kK)(this.data.extent,ee))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(Z||(Z={}));const ee=(0,J.Ue)();let te=class extends D.Z{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=(0,X.G0)(e,this._mandatoryOutFields);(0,X.fS)(s,t)||(this._set("outFields",s),(0,X.ik)(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new h.R,this._pendingEdits=new V,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this._updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{(0,l.fS)(e,t,(({id:e},{id:t})=>e===t))||this._process()}),o.Z_),this.addHandles((0,o.gx)((()=>!this.suspended),(()=>this._process())))}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this._pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,e]of this._pendingTiles)e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this._updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this._pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,$.M8)(this.url))return;const e=(0,U.vr)((async e=>{try{const t=await(0,Q.Vr)(this.url,new _.Z({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=L.Z.fromJSON(t.data?.extent)}catch(e){(0,r.r9)(e),q.Z.getLogger(this).warn("Failed to fetch data extent",e)}}));this._updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.addHandles((0,Y.kB)((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:s}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=s,e.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,((e,t)=>this._verifyTileComplexity(e,t)),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,s)=>this._fetchFeatures(e,t,s),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<ne}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const s=this.tileSize*t;return e*(re/(s*s))<oe}_ensureFetchAllCounts(e){let t=!0;for(const[,s]of this._pendingTiles)s.state.type<Z.FETCHED_COUNT&&this._updatingHandles.addPromise(s.process(e)),s.state.type<=Z.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const s=new K(e,t);return this._pendingTiles.set(e.id,s),s}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:ie,signal:t})}async _fetchFeatures(e,t,s){let i=0;const n=[];let r=0,o=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,i,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,s);l&&(i+=a.num),r+=u.length;for(const e of u)n.push(e);if(o=t-r,!l||!h||o<=0)return n}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,s=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let i=null;if(this.store.featureStore.forEach((n=>{e===n.attributes[t]&&(i=n.objectId??n.attributes[s])})),null==i)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Q.qp)(this.url,e,new W.J({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,G.lM)(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Q.JT)(this.url,e,s,{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,G.h_)(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,i=(0,X.G0)((0,X.e5)(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new _.Z({returnZ:this.hasZ,returnM:!1,geometry:null!=this.tileInfo&&null!=e?(0,J.HH)(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return null!=s&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:n,tileMaxRecordCount:r,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?_.Z.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||n)&&r?r:o||se);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/u)),e.num=Math.min(s,e.maxRecordCountFactor*u)):e.num=Math.min(s,u),!0}};(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"url",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"objectIdField",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"globalIdField",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"capabilities",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"spatialReference",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"store",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"_minimumVerticesPerFeature",null),(0,i._)([(0,a.Cb)()],te.prototype,"_mandatoryOutFields",null),(0,i._)([(0,a.Cb)()],te.prototype,"outFields",null),(0,i._)([(0,a.Cb)()],te.prototype,"suspended",void 0),(0,i._)([(0,a.Cb)()],te.prototype,"filter",null),(0,i._)([(0,a.Cb)()],te.prototype,"customParameters",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"_configuration",null),(0,i._)([(0,a.Cb)()],te.prototype,"tileInfo",null),(0,i._)([(0,a.Cb)()],te.prototype,"tileSize",null),(0,i._)([(0,a.Cb)()],te.prototype,"tilesOfInterest",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"updating",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"availability",void 0),(0,i._)([(0,a.Cb)()],te.prototype,"hasZ",null),te=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],te);const se=2e3,ie=6e5,ne=1e6,re=25,oe=1;var ae=s(43090),le=s(91303),ue=s(37549),he=s(43077);class de{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(null!=t&&(this._byteSize-=t.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[s,i]of this._store){if(this._byteSize<=e)break;this.delete(s),t(i)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}}let ce=class extends D.Z{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*le.Y.MEGABYTES,this._tileBounds=new ue.H,this._tiles=new de,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,J.Ue)()}add(e,t){for(const e of t)this._referenceFeature(e.objectId);const s=this.featureStore.upsertMany(t),i=s.map((e=>new Set(Object.keys(e.attributes)))).reduce(((e,t)=>(0,X.jV)(e,t)),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map((e=>e.objectId))),function(e){return e.reduce(((e,t)=>e+function(e){return 32+function(e){if(null==e)return 0;const t=(0,ae.do)(e.lengths,4);return 32+(0,ae.do)(e.coords,8)+t}(e.geometry)+(0,ae.f2)(e.attributes)}(t)),0)}(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,(e=>this._removeTileStorage(e)))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const n=e.id;this._tiles.set(n,new pe(e,t,s,i)),this._tileBounds.set(n,e.extent),this._tileFeatureCounts.set(n,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const s of e.objectIds)this._unreferenceFeature(s)===ye.REMOVED&&t.push(s);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){const i=(await t(e,s)).features,{hasZ:n,hasM:r}=this.featureStore;for(const e of i){const t=(0,G.$)(this._tmpBoundingRect,e.geometry,n,r);null!=t&&this._tileBounds.forEachInBounds(t,(t=>{const s=this._tiles.get(t);this.featureStore.add(e);const i=e.objectId;s.objectIds.has(i)||(s.objectIds.add(i),this._referenceFeature(i),this._tileFeatureCounts.set(s.data.id,s.objectIds.size))}))}}process(e,t=(()=>!0),s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,J.kK)((0,J.oJ)(this.extent,this._tmpBoundingRect),e.extent))return new _e(e);const i=this.getAttributesForTile(e.id);if((0,X.ik)(s,i))return new _e(e);const n=this._createTileTree(e,this.tileInfo);return this._simplify(n,t,null,0,1),this._collectMissingTiles(e,n,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map((({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const n=this._tileFeatureCounts.get(e.id);if(null!=n)return n;const r=await(0,Q.hH)(t,s,i);return this._tileFeatureCounts.set(e.id,r.data.count),r.data.count}_createTileTree(e,t){const s=new fe(e.level,e.row,e.col);return t.updateTileInfo(s,f.Z.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,(i=>{const n=this._tiles.get(i)?.data;n&&this._tilesAreRelated(e,n)&&this._populateChildren(s,n,t,this._tileFeatureCounts.get(n.id)||0)})),s}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,n=s?t:e,r=1<<n.level-i.level;return Math.floor(n.row/r)===i.row&&Math.floor(n.col/r)===i.col}_populateChildren(e,t,s,i){const n=t.level-e.level-1;if(n<0)return void(e.isLeaf=!0);const r=t.row>>n,o=t.col>>n,a=e.row<<1,l=o-(e.col<<1)+(r-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,s,i);else{const n=new fe(e.level+1,r,o);s.updateTileInfo(n,f.Z.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=n,this._populateChildren(n,t,s,i)}}_simplify(e,t,s,i,n){const r=n*n;if(e.isLeaf)return t(this.getFeatureCount(e),n)?0:(this._remove(e),null!=s&&(s.children[i]=null),r);const o=n/2,a=o*o;let l=0;for(let s=0;s<e.children.length;s++){const i=e.children[s];l+=null!=i?this._simplify(i,t,e,s,o):a}return 0===l?this._mergeChildren(e):1-l/r<me&&(this._purge(e),null!=s&&(s.children[i]=null),l=r),l}_mergeChildren(e){const t=new Set;let s,i=0;this._forEachLeaf(e,(e=>{const n=this._tiles.get(e.id);if(n){s=s?(0,X.jV)(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const e of n.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const n=new ge(s,e,this.extent);return this._collectMissingTilesRecurse(t,n,1,i),n.info}_collectMissingTilesRecurse(e,t,s,i){const n=this.getAttributesForTile(e.id),r=n&&!(0,X.ik)(i,n);if(r&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(r||t.addMissing(e.level,e.row,e.col,s));const o=s/2;for(let s=0;s<e.children.length;s++){const n=e.children[s];null==n?t.addMissing(e.level+1,(e.row<<1)+((2&s)>>1),(e.col<<1)+(1&s),o):this._collectMissingTilesRecurse(n,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?ye.ADDED:ye.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),ye.REMOVED):(t>0&&this._refCounts.set(e,t),ye.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map((e=>`${e.data.id}:[${Array.from(e.objectIds)}]`)),featureReferences:Array.from(this._refCounts.keys()).map((e=>`${e}:${this._refCounts.get(e)}`))}}};(0,i._)([(0,a.Cb)({constructOnly:!0})],ce.prototype,"featureStore",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"tileInfo",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"extent",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"maximumByteSize",void 0),ce=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],ce);class pe{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}}class fe{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class _e{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,J.SO)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class ge{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new _e(t),null!=s&&(this._extent=(0,J.oJ)(s))}addMissing(e,t,s,i){const n=new he.f(null,e,t,s);this._tileInfo.updateTileInfo(n,f.Z.ExtrapolateOptions.POWER_OF_TWO),null==n.extent||null!=this._extent&&!(0,J.kK)(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:i}),this.info.coveredArea-=(0,J.SO)(n.extent))}}const me=.18751;var ye;!function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"}(ye||(ye={}));var ve=s(33955);let be=class extends n.Z.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=(0,r.hh)(),this._elevationAligner=I(),this._elevationFilter=B(),this._symbologyCandidatesFetcher=j(),this._updatingHandles=new h.R,this._editsUpdatingHandles=new h.R,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return(0,r.k_)(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return(0,r.k_)(t),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:n}=e.serviceInfo,{hasZ:r}=e,a=d.Z.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new c.Z({...e.serviceInfo,hasZ:r,hasM:!1}),this._queryEngine=new p.q({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:r,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new te({store:new ce({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:d.Z.fromJSON(e.serviceInfo.spatialReference)});const l="3d"===e.configuration.viewType;return this._elevationAligner=I(l,{elevationInfo:null!=e.elevationInfo?g.Z.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=B(l),this.addHandles([(0,o.YP)((()=>this._featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),o.Z_),(0,o.YP)((()=>this.updating),(()=>this._notifyUpdating()))]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),Ce}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.suspended=e,Ce}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.outFields=new Set(e??[]),Ce}async fetchCandidates(e,t){await this._whenSetup.promise,(0,r.k_)(t);const s=function(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:n,timeExtent:r,objectIds:o}=e.filter,a={geometry:e.filter.geometry?(0,ve.im)(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:r,objectIds:o,where:n??"1=1"};return{...e,query:a}}(e),i=t?.signal,n=await this._queryEngine.executeQueryForSnapping(s,i);(0,r.k_)(i);const o=await this._elevationAligner.alignCandidates(n.candidates,d.Z.fromJSON(e.point.spatialReference)??d.Z.WGS84,i);(0,r.k_)(i);const a=await this._symbologyCandidatesFetcher.fetch(o,i);(0,r.k_)(i);const l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(s,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?f.Z.fromJSON(e.tileInfo):null,Ce}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.refresh(),Ce}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),await(0,o.N1)((()=>!this.updatingExcludingEdits),t),(0,r.k_)(t),Ce}async getDebugInfo(e,t){return(0,r.k_)(t),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,t){this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t);const s=(0,r.hh)();return this._pendingApplyEdits.set(e.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),Ce}async endApplyEdits(e,t){const s=this._pendingApplyEdits.get(e.id);return s&&s.resolve(e.edits),(0,r.k_)(t),Ce}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),Ce}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),Ce}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=j(e,this._getSymbologyCandidates),Ce}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?_.Z.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,i._)([(0,a.Cb)({readOnly:!0})],be.prototype,"updating",null),(0,i._)([(0,a.Cb)({readOnly:!0})],be.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.Cb)()],be.prototype,"_isInitializing",void 0),be=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],be);const Ie=be,Ce={result:{}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7845],{97845:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var s=n(3172),i=n(66643),r=n(20102),o=n(92604),a=n(95330),l=n(33955),u=n(8744),c=n(98732),p=n(28972),d=n(37427),y=n(3489),f=n(92722),h=n(25278),m=n(23095),g=n(99514),S=n(86719),_=n(69165),F=n(25031);const b={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class w{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const n=[],[s]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),i=(0,f.my)(s,{geometryType:e.geometryType}),o=e.fields||i.fields||[],a=null!=e.hasZ?e.hasZ:i.hasZ,l=i.geometryType;let c=e.objectIdField||i.objectIdFieldName||"__OBJECTID";const d=e.spatialReference||u.Zn;let m=e.timeInfo;o===i.fields&&i.unknownFields.length>0&&n.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:i.unknownFields}});const w=new g.Z(o);let I=w.get(c);I?("esriFieldTypeString"!==I.type&&(I.type="esriFieldTypeOID"),I.editable=!1,I.nullable=!1,c=I.name):(I={alias:c,name:c,type:"string"===i.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(I));const E={};for(const e of o){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),!e.name)throw new r.Z("geojson-layer:invalid-field-name","field name is missing",{field:e});if(!S.v.jsonValues.includes(e.type))throw new r.Z("geojson-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e});if(e.name!==I.name){const t=(0,_.os)(e);void 0!==t&&(E[e.name]=t)}null==e.length&&(e.length=(0,_.ZR)(e))}if(m){if(m.startTimeField){const e=w.get(m.startTimeField);e?(m.startTimeField=e.name,e.type="esriFieldTypeDate"):m.startTimeField=null}if(m.endTimeField){const e=w.get(m.endTimeField);e?(m.endTimeField=e.name,e.type="esriFieldTypeDate"):m.endTimeField=null}if(m.trackIdField){const e=w.get(m.trackIdField);e?m.trackIdField=e.name:(m.trackIdField=null,n.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:m}}))}m.startTimeField||m.endTimeField||(n.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:m}}),m=null)}const T=l?(0,h.bU)(l):void 0,j=w.dateFields.length?{timeZoneIANA:F.pt}:null,q={warnings:n,featureErrors:[],layerDefinition:{...b,drawingInfo:T??void 0,templates:(0,h.Hq)(E),extent:void 0,geometryType:l,objectIdField:c,fields:o,hasZ:!!a,timeInfo:m,dateFieldsTimeReference:j}};this._queryEngine=new y.q({fieldsIndex:g.Z.fromLayerJSON({fields:o,timeInfo:m,dateFieldsTimeReference:j}),geometryType:l,hasM:!1,hasZ:a,objectIdField:c,spatialReference:d,timeInfo:m,featureStore:new p.Z({geometryType:l,hasM:!1,hasZ:a}),cacheSpatialQueries:!0});const x=this._queryEngine.fieldsIndex.requiredFields.indexOf(I);x>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(x,1),this._createDefaultAttributes=(0,h.Dm)(E,c);const R=await this._createFeatures(s);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,R);const Z=this._normalizeFeatures(R,q.featureErrors);this._queryEngine.featureStore.addMany(Z);const{fullExtent:k,timeExtent:P}=await this._queryEngine.fetchRecomputedExtents();if(q.layerDefinition.extent=k,P){const{start:e,end:t}=P;q.layerDefinition.timeInfo.timeExtent=[e,t]}return q}async applyEdits(e){const{spatialReference:t,geometryType:n}=this._queryEngine;return await Promise.all([(0,m.b)(t,n),(0,d._W)(e.adds,t),(0,d._W)(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=(0,i.vr)(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)}),(e=>{this._queryEngine.featureStore.clear(),(0,a.D_)(e)||o.Z.getLogger("esri.layers.GeoJSONLayer").error(new r.Z("geojson-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:n}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:n}}async _createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:n,objectIdField:s}=this._queryEngine,i=(0,f.lG)(e,{geometryType:t,hasZ:n,objectIdField:s});if(!(0,u.fS)(this._queryEngine.spatialReference,u.Zn))for(const e of i)null!=e.geometry&&(e.geometry=(0,c.GH)((0,d.iV)((0,c.di)(e.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),u.Zn,this._queryEngine.spatialReference)));return i}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:n}=this._loadOptions,i=(await(0,s.Z)(t,{responseType:"json",query:{...n},signal:e})).data;return(0,f.O3)(i),i}_normalizeFeatures(e,t){const{objectIdField:n,fieldsIndex:s}=this._queryEngine,i=[];for(const r of e){const e=this._createDefaultAttributes(),o=(0,m.O0)(s,e,r.attributes,!0);o?t?.push(o):(this._assignObjectId(e,r.attributes,!0),r.attributes=e,r.objectId=e[n],i.push(r))}return i}async _applyEdits(e){const{adds:t,updates:n,deletes:s}=e,i={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(i,t),n?.length&&this._applyUpdateEdits(i,n),s?.length){for(const e of s)i.deleteResults.push((0,m.d1)(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:r,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();return{extent:r,timeExtent:o,featureEditResults:i}}_applyAddEdits(e,t){const{addResults:n}=e,{geometryType:s,hasM:i,hasZ:r,objectIdField:o,spatialReference:a,featureStore:u,fieldsIndex:p}=this._queryEngine,y=[];for(const i of t){if(i.geometry&&s!==(0,l.Ji)(i.geometry)){n.push((0,m.av)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=(0,m.O0)(p,t,i.attributes);if(r)n.push(r);else{if(this._assignObjectId(t,i.attributes),i.attributes=t,null!=i.uid){const t=i.attributes[o];e.uidToObjectId[i.uid]=t}if(null!=i.geometry){const e=i.geometry.spatialReference??a;i.geometry=(0,d.iV)((0,m.og)(i.geometry,e),e,a)}y.push(i),n.push((0,m.d1)(i.attributes[o]))}}u.addMany((0,c.Yn)([],y,s,r,i,o))}_applyUpdateEdits({updateResults:e},t){const{geometryType:n,hasM:s,hasZ:i,objectIdField:r,spatialReference:o,featureStore:a,fieldsIndex:u}=this._queryEngine;for(const p of t){const{attributes:t,geometry:y}=p,f=t?.[r];if(null==f){e.push((0,m.av)(`Identifier field ${r} missing`));continue}if(!a.has(f)){e.push((0,m.av)(`Feature with object id ${f} missing`));continue}const h=(0,c.EI)(a.getFeature(f),n,i,s);if(null!=y){if(n!==(0,l.Ji)(y)){e.push((0,m.av)("Incorrect geometry type."));continue}const t=y.spatialReference??o;h.geometry=(0,d.iV)((0,m.og)(y,t),t,o)}if(t){const n=(0,m.O0)(u,h.attributes,t);if(n){e.push(n);continue}}a.add((0,c.XA)(h,n,i,s,r)),e.push((0,m.d1)(f))}}_createObjectIdGenerator(e,t){const n=e.fieldsIndex.get(e.objectIdField);if("esriFieldTypeString"===n.type)return()=>n.name+"-"+Date.now().toString(16);let s=Number.NEGATIVE_INFINITY;for(const e of t)e.objectId&&(s=Math.max(s,e.objectId));return s=Math.max(0,s)+1,()=>s++}_assignObjectId(e,t,n=!1){const s=this._queryEngine.objectIdField;e[s]=n&&s in t?t[s]:this._objectIdGenerator()}async _checkProjection(e){try{await(0,d._W)(u.Zn,e)}catch{throw new r.Z("geojson-layer","Projection not supported")}}}},92722:(e,t,n)=>{n.d(t,{O3:()=>I,lG:()=>T,my:()=>E,q9:()=>c});var s=n(20188),i=n(20102),r=n(8744),o=n(70272),a=n(5428),l=n(69165);const u={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function c(e){return u[e]}function*p(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*d(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function y(e){for(const t of e)if(t.length>2)return!0;return!1}function f(e){let t=0;for(let n=0;n<e.length;n++){const s=e[n],i=e[(n+1)%e.length];t+=s[0]*i[1]-i[0]*s[1]}return t<=0}function h(e){const t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]||e.push(t),e}function m(e,t,n){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,n){return _(e,t.coordinates,n),e}(e,t,n);case"MultiLineString":return function(e,t,n){for(const s of t.coordinates)_(e,s,n);return e}(e,t,n);case"MultiPolygon":return function(e,t,n){for(const s of t.coordinates){g(e,s[0],n);for(let t=1;t<s.length;t++)S(e,s[t],n)}return e}(e,t,n);case"Point":return function(e,t,n){return b(e,t.coordinates,n),e}(e,t,n);case"Polygon":return function(e,t,n){const s=t.coordinates;g(e,s[0],n);for(let t=1;t<s.length;t++)S(e,s[t],n);return e}(e,t,n)}}function g(e,t,n){const s=h(t);!function(e){return!f(e)}(s)?_(e,s,n):F(e,s,n)}function S(e,t,n){const s=h(t);!function(e){return f(e)}(s)?_(e,s,n):F(e,s,n)}function _(e,t,n){for(const s of t)b(e,s,n);e.lengths.push(t.length)}function F(e,t,n){for(let s=t.length-1;s>=0;s--)b(e,t[s],n);e.lengths.push(t.length)}function b(e,t,n){const[s,i,r]=t;e.coords.push(s,i),n.hasZ&&e.coords.push(r||0)}function w(e){switch(typeof e){case"string":return(0,s.o)(e)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function I(e,t=4326){if(!e)throw new i.Z("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new i.Z("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:n}=e;if(!n)return;const s="string"==typeof n?n:"name"===n.type?n.properties.name:"EPSG"===n.type?n.properties.code:null,o=(0,r.oR)({wkid:t})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${t})$`,"i");if(!s||!o.test(s))throw new i.Z("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:n})}function E(e,t={}){const n=[],s=new Set,i=new Set;let r,o=!1,a=null,u=!1,{geometryType:f=null}=t,h=!1;for(const t of p(e)){const{geometry:e,properties:p,id:m}=t;if((!e||(f||(f=c(e.type)),c(e.type)===f))&&(o||(o=y(d(e))),u||(u=null!=m,u&&(r=typeof m,p&&(a=Object.keys(p).filter((e=>p[e]===m))))),p&&a&&u&&null!=m&&(a.length>1?a=a.filter((e=>p[e]===m)):1===a.length&&(a=p[a[0]]===m?a:[])),!h&&p)){let e=!0;for(const t in p){if(s.has(t))continue;const r=p[t];if(null==r){e=!1,i.add(t);continue}const o=w(r);if("unknown"===o){i.add(t);continue}i.delete(t),s.add(t);const a=(0,l.q6)(t);a&&n.push({name:a,alias:t,type:o})}h=e}}const m=(0,l.q6)(1===a?.length&&a[0]||null)??void 0;if(m)for(const e of n)if(e.name===m&&(0,l.H7)(e)){e.type="esriFieldTypeOID";break}return{fields:n,geometryType:f,hasZ:o,objectIdFieldName:m,objectIdFieldType:r,unknownFields:Array.from(i)}}function T(e,t){return Array.from(function*(e,t={}){const{geometryType:n,objectIdField:s}=t;for(const i of e){const{geometry:e,properties:r,id:l}=i;if(e&&c(e.type)!==n)continue;const u=r||{};let p;s&&(p=u[s],null==l||p||(u[s]=p=l));const d=new o.u_(e?m(new a.Z,e,t):null,u,null,p??void 0);yield d}}(p(e),t))}},25278:(e,t,n)=>{n.d(t,{Dm:()=>c,Hq:()=>p,MS:()=>d,bU:()=>a});var s=n(80442),i=n(22974),r=n(61159),o=n(58333);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.I4:"esriGeometryPolyline"===e?o.ET:o.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function c(e,t){if((0,s.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let n=`this.${t} = null;`;for(const t in e)n+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${n};\n }\n }\n `)();return()=>new s}catch(n){return()=>({[t]:null,...e})}}function p(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,i.d9)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},58333:(e,t,n)=>{n.d(t,{ET:()=>r,I4:()=>i,eG:()=>l,lF:()=>o,lj:()=>c,qP:()=>a,wW:()=>u});const s=[252,146,31,255],i={type:"esriSMS",style:"esriSMSCircle",size:6,color:s,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},r={type:"esriSLS",style:"esriSLSSolid",width:.75,color:s},o={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},c={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7845],{97845:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var s=n(3172),i=n(66643),r=n(20102),o=n(92604),a=n(95330),l=n(33955),u=n(8744),c=n(98732),p=n(28972),d=n(37427),y=n(3489),f=n(92722),h=n(25278),m=n(23095),g=n(99514),S=n(86719),_=n(69165),F=n(25031);const b={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class w{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const n=[],[s]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),i=(0,f.my)(s,{geometryType:e.geometryType}),o=e.fields||i.fields||[],a=null!=e.hasZ?e.hasZ:i.hasZ,l=i.geometryType;let c=e.objectIdField||i.objectIdFieldName||"__OBJECTID";const d=e.spatialReference||u.Zn;let m=e.timeInfo;o===i.fields&&i.unknownFields.length>0&&n.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:i.unknownFields}});const w=new g.Z(o);let I=w.get(c);I?("esriFieldTypeString"!==I.type&&(I.type="esriFieldTypeOID"),I.editable=!1,I.nullable=!1,c=I.name):(I={alias:c,name:c,type:"string"===i.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(I));const E={};for(const e of o){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),!e.name)throw new r.Z("geojson-layer:invalid-field-name","field name is missing",{field:e});if(!S.v.jsonValues.includes(e.type))throw new r.Z("geojson-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e});if(e.name!==I.name){const t=(0,_.os)(e);void 0!==t&&(E[e.name]=t)}null==e.length&&(e.length=(0,_.ZR)(e))}if(m){if(m.startTimeField){const e=w.get(m.startTimeField);e?(m.startTimeField=e.name,e.type="esriFieldTypeDate"):m.startTimeField=null}if(m.endTimeField){const e=w.get(m.endTimeField);e?(m.endTimeField=e.name,e.type="esriFieldTypeDate"):m.endTimeField=null}if(m.trackIdField){const e=w.get(m.trackIdField);e?m.trackIdField=e.name:(m.trackIdField=null,n.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:m}}))}m.startTimeField||m.endTimeField||(n.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:m}}),m=null)}const T=l?(0,h.bU)(l):void 0,j=w.dateFields.length?{timeZoneIANA:F.pt}:null,q={warnings:n,featureErrors:[],layerDefinition:{...b,drawingInfo:T??void 0,templates:(0,h.Hq)(E),extent:void 0,geometryType:l,objectIdField:c,fields:o,hasZ:!!a,timeInfo:m,dateFieldsTimeReference:j}};this._queryEngine=new y.q({fieldsIndex:g.Z.fromLayerJSON({fields:o,timeInfo:m,dateFieldsTimeReference:j}),geometryType:l,hasM:!1,hasZ:a,objectIdField:c,spatialReference:d,timeInfo:m,featureStore:new p.Z({geometryType:l,hasM:!1,hasZ:a}),cacheSpatialQueries:!0});const x=this._queryEngine.fieldsIndex.requiredFields.indexOf(I);x>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(x,1),this._createDefaultAttributes=(0,h.Dm)(E,c);const R=await this._createFeatures(s);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,R);const Z=this._normalizeFeatures(R,q.featureErrors);this._queryEngine.featureStore.addMany(Z);const{fullExtent:k,timeExtent:P}=await this._queryEngine.fetchRecomputedExtents();if(q.layerDefinition.extent=k,P){const{start:e,end:t}=P;q.layerDefinition.timeInfo.timeExtent=[e,t]}return q}async applyEdits(e){const{spatialReference:t,geometryType:n}=this._queryEngine;return await Promise.all([(0,m.b)(t,n),(0,d._W)(e.adds,t),(0,d._W)(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=(0,i.vr)(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)}),(e=>{this._queryEngine.featureStore.clear(),(0,a.D_)(e)||o.Z.getLogger("esri.layers.GeoJSONLayer").error(new r.Z("geojson-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:n}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:n}}async _createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:n,objectIdField:s}=this._queryEngine,i=(0,f.lG)(e,{geometryType:t,hasZ:n,objectIdField:s});if(!(0,u.fS)(this._queryEngine.spatialReference,u.Zn))for(const e of i)null!=e.geometry&&(e.geometry=(0,c.GH)((0,d.iV)((0,c.di)(e.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),u.Zn,this._queryEngine.spatialReference)));return i}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:n}=this._loadOptions,i=(await(0,s.Z)(t,{responseType:"json",query:{...n},signal:e})).data;return(0,f.O3)(i),i}_normalizeFeatures(e,t){const{objectIdField:n,fieldsIndex:s}=this._queryEngine,i=[];for(const r of e){const e=this._createDefaultAttributes(),o=(0,m.O0)(s,e,r.attributes,!0);o?t?.push(o):(this._assignObjectId(e,r.attributes,!0),r.attributes=e,r.objectId=e[n],i.push(r))}return i}async _applyEdits(e){const{adds:t,updates:n,deletes:s}=e,i={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(i,t),n?.length&&this._applyUpdateEdits(i,n),s?.length){for(const e of s)i.deleteResults.push((0,m.d1)(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:r,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();return{extent:r,timeExtent:o,featureEditResults:i}}_applyAddEdits(e,t){const{addResults:n}=e,{geometryType:s,hasM:i,hasZ:r,objectIdField:o,spatialReference:a,featureStore:u,fieldsIndex:p}=this._queryEngine,y=[];for(const i of t){if(i.geometry&&s!==(0,l.Ji)(i.geometry)){n.push((0,m.av)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=(0,m.O0)(p,t,i.attributes);if(r)n.push(r);else{if(this._assignObjectId(t,i.attributes),i.attributes=t,null!=i.uid){const t=i.attributes[o];e.uidToObjectId[i.uid]=t}if(null!=i.geometry){const e=i.geometry.spatialReference??a;i.geometry=(0,d.iV)((0,m.og)(i.geometry,e),e,a)}y.push(i),n.push((0,m.d1)(i.attributes[o]))}}u.addMany((0,c.Yn)([],y,s,r,i,o))}_applyUpdateEdits({updateResults:e},t){const{geometryType:n,hasM:s,hasZ:i,objectIdField:r,spatialReference:o,featureStore:a,fieldsIndex:u}=this._queryEngine;for(const p of t){const{attributes:t,geometry:y}=p,f=t?.[r];if(null==f){e.push((0,m.av)(`Identifier field ${r} missing`));continue}if(!a.has(f)){e.push((0,m.av)(`Feature with object id ${f} missing`));continue}const h=(0,c.EI)(a.getFeature(f),n,i,s);if(null!=y){if(n!==(0,l.Ji)(y)){e.push((0,m.av)("Incorrect geometry type."));continue}const t=y.spatialReference??o;h.geometry=(0,d.iV)((0,m.og)(y,t),t,o)}if(t){const n=(0,m.O0)(u,h.attributes,t);if(n){e.push(n);continue}}a.add((0,c.XA)(h,n,i,s,r)),e.push((0,m.d1)(f))}}_createObjectIdGenerator(e,t){const n=e.fieldsIndex.get(e.objectIdField);if("esriFieldTypeString"===n.type)return()=>n.name+"-"+Date.now().toString(16);let s=Number.NEGATIVE_INFINITY;for(const e of t)e.objectId&&(s=Math.max(s,e.objectId));return s=Math.max(0,s)+1,()=>s++}_assignObjectId(e,t,n=!1){const s=this._queryEngine.objectIdField;e[s]=n&&s in t?t[s]:this._objectIdGenerator()}async _checkProjection(e){try{await(0,d._W)(u.Zn,e)}catch{throw new r.Z("geojson-layer","Projection not supported")}}}},92722:(e,t,n)=>{n.d(t,{O3:()=>I,lG:()=>T,my:()=>E,q9:()=>c});var s=n(20188),i=n(20102),r=n(8744),o=n(70272),a=n(5428),l=n(69165);const u={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function c(e){return u[e]}function*p(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*d(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function y(e){for(const t of e)if(t.length>2)return!0;return!1}function f(e){let t=0;for(let n=0;n<e.length;n++){const s=e[n],i=e[(n+1)%e.length];t+=s[0]*i[1]-i[0]*s[1]}return t<=0}function h(e){const t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]||e.push(t),e}function m(e,t,n){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,n){return _(e,t.coordinates,n),e}(e,t,n);case"MultiLineString":return function(e,t,n){for(const s of t.coordinates)_(e,s,n);return e}(e,t,n);case"MultiPolygon":return function(e,t,n){for(const s of t.coordinates){g(e,s[0],n);for(let t=1;t<s.length;t++)S(e,s[t],n)}return e}(e,t,n);case"Point":return function(e,t,n){return b(e,t.coordinates,n),e}(e,t,n);case"Polygon":return function(e,t,n){const s=t.coordinates;g(e,s[0],n);for(let t=1;t<s.length;t++)S(e,s[t],n);return e}(e,t,n)}}function g(e,t,n){const s=h(t);!function(e){return!f(e)}(s)?_(e,s,n):F(e,s,n)}function S(e,t,n){const s=h(t);!function(e){return f(e)}(s)?_(e,s,n):F(e,s,n)}function _(e,t,n){for(const s of t)b(e,s,n);e.lengths.push(t.length)}function F(e,t,n){for(let s=t.length-1;s>=0;s--)b(e,t[s],n);e.lengths.push(t.length)}function b(e,t,n){const[s,i,r]=t;e.coords.push(s,i),n.hasZ&&e.coords.push(r||0)}function w(e){switch(typeof e){case"string":return(0,s.mu)(e)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function I(e,t=4326){if(!e)throw new i.Z("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new i.Z("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:n}=e;if(!n)return;const s="string"==typeof n?n:"name"===n.type?n.properties.name:"EPSG"===n.type?n.properties.code:null,o=(0,r.oR)({wkid:t})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${t})$`,"i");if(!s||!o.test(s))throw new i.Z("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:n})}function E(e,t={}){const n=[],s=new Set,i=new Set;let r,o=!1,a=null,u=!1,{geometryType:f=null}=t,h=!1;for(const t of p(e)){const{geometry:e,properties:p,id:m}=t;if((!e||(f||(f=c(e.type)),c(e.type)===f))&&(o||(o=y(d(e))),u||(u=null!=m,u&&(r=typeof m,p&&(a=Object.keys(p).filter((e=>p[e]===m))))),p&&a&&u&&null!=m&&(a.length>1?a=a.filter((e=>p[e]===m)):1===a.length&&(a=p[a[0]]===m?a:[])),!h&&p)){let e=!0;for(const t in p){if(s.has(t))continue;const r=p[t];if(null==r){e=!1,i.add(t);continue}const o=w(r);if("unknown"===o){i.add(t);continue}i.delete(t),s.add(t);const a=(0,l.q6)(t);a&&n.push({name:a,alias:t,type:o})}h=e}}const m=(0,l.q6)(1===a?.length&&a[0]||null)??void 0;if(m)for(const e of n)if(e.name===m&&(0,l.H7)(e)){e.type="esriFieldTypeOID";break}return{fields:n,geometryType:f,hasZ:o,objectIdFieldName:m,objectIdFieldType:r,unknownFields:Array.from(i)}}function T(e,t){return Array.from(function*(e,t={}){const{geometryType:n,objectIdField:s}=t;for(const i of e){const{geometry:e,properties:r,id:l}=i;if(e&&c(e.type)!==n)continue;const u=r||{};let p;s&&(p=u[s],null==l||p||(u[s]=p=l));const d=new o.u_(e?m(new a.Z,e,t):null,u,null,p??void 0);yield d}}(p(e),t))}},25278:(e,t,n)=>{n.d(t,{Dm:()=>c,Hq:()=>p,MS:()=>d,bU:()=>a});var s=n(80442),i=n(22974),r=n(61159),o=n(58333);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.I4:"esriGeometryPolyline"===e?o.ET:o.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function c(e,t){if((0,s.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let n=`this.${t} = null;`;for(const t in e)n+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${n};\n }\n }\n `)();return()=>new s}catch(n){return()=>({[t]:null,...e})}}function p(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,i.d9)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},58333:(e,t,n)=>{n.d(t,{ET:()=>r,I4:()=>i,eG:()=>l,lF:()=>o,lj:()=>c,qP:()=>a,wW:()=>u});const s=[252,146,31,255],i={type:"esriSMS",style:"esriSMSCircle",size:6,color:s,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},r={type:"esriSLS",style:"esriSLSSolid",width:.75,color:s},o={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},c={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6188],{13867:(t,e,s)=>{s.d(e,{z:()=>n});var i=s(69801);class n{constructor(t,e){this._storage=new i.WJ,this.id="",this.name="",this.size=0,this._storage.maxSize=t,this._storage.register(this),e&&this._storage.registerRemoveFunc("",e)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(t,e,s=1){this._storage.put(this,t,e,s,1)}pop(t){return this._storage.pop(this,t)}get(t){return this._storage.get(this,t)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(t){this._storage.maxSize=t}resetHitRate(){}}},69801:(t,e,s)=>{s.d(e,{WJ:()=>h,Xq:()=>o});var i,n,r=s(44553);(n=i||(i={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(t,e,s){this.name=t,this._storage=e,this.id=a+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}resetHitRate(){this._hit=this._miss=0}put(t,e,s,i=0){this._storage.put(this,t,e,s,i)}get(t){const e=this._storage.get(this,t);return void 0===e?++this._miss:++this._hit,e}peek(t){return this._storage.peek(this,t)}pop(t){const e=this._storage.pop(this,t);return void 0===e?++this._miss:++this._hit,e}updateSize(t,e,s){this._storage.updateSize(this,t,e,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class h{get size(){return this._size}constructor(t=10485760){this._maxSize=t,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new r.Z,this._users=new r.Z}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(t){this._users.push(t)}deregister(t){this._users.removeUnordered(t)}registerRemoveFunc(t,e){this._removeFuncs.push([t,e])}deregisterRemoveFunc(t){this._removeFuncs.filterInPlace((e=>e[0]!==t))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize=Math.max(t,0),this._checkSizeLimits()}put(t,e,s,n,r){e=t.id+e;const o=this._db.get(e);if(o&&(this._size-=o.size,t.size-=o.size,this._db.delete(e),o.entry!==s&&this._notifyRemove(e,o.entry,i.ALL)),n>this._maxSize)return void this._notifyRemove(e,s,i.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${e}`),void this._notifyRemove(e,s,i.ALL);const h=1+Math.max(r,-3)- -3;this._db.set(e,{entry:s,size:n,lifetime:h,lives:h}),this._size+=n,t.size+=n,this._checkSizeLimits()}updateSize(t,e,s,n){e=t.id+e;const r=this._db.get(e);if(r&&r.entry===s){for(this._size-=r.size,t.size-=r.size;n>this._maxSize;){const t=this._notifyRemove(e,s,i.SOME);if(!(null!=t&&t>0))return void this._db.delete(e);n=t}r.size=n,this._size+=n,t.size+=n,this._checkSizeLimits()}}pop(t,e){e=t.id+e;const s=this._db.get(e);if(s)return this._size-=s.size,t.size-=s.size,this._db.delete(e),++this._hit,s.entry;++this._miss}get(t,e){e=t.id+e;const s=this._db.get(e);if(void 0!==s)return this._db.delete(e),s.lives=s.lifetime,this._db.set(e,s),++this._hit,s.entry;++this._miss}peek(t,e){const s=this._db.get(t.id+e);return s?++this._hit:++this._miss,s?.entry}get performanceInfo(){const t={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},e={},s=new Array;this._db.forEach(((t,i)=>{const n=t.lifetime;s[n]=(s[n]||0)+t.size,this._users.forAll((s=>{const{id:n,name:r}=s;if(i.startsWith(n)){const s=e[r]||0;e[r]=s+t.size}}))}));const i={};this._users.forAll((t=>{const s=t.name;if("hitRate"in t&&"number"==typeof t.hitRate&&!isNaN(t.hitRate)&&t.hitRate>0){const n=e[s]||0;e[s]=n,i[s]=Math.round(100*t.hitRate)+"%"}else i[s]="0%"}));const n=Object.keys(e);n.sort(((t,s)=>e[s]-e[t])),n.forEach((s=>t[s]=Math.round(e[s]/2**20)+"MB / "+i[s]));for(let e=s.length-1;e>=0;--e){const i=s[e];i&&(t["Priority "+(e+-3-1)]=Math.round(i/this._size*100)+"%")}return t}resetStats(){this._hit=this._miss=0,this._users.forAll((t=>t.resetHitRate()))}clear(t){const e=t.id;this._db.forEach(((t,s)=>{s.startsWith(e)&&(this._size-=t.size,this._db.delete(s),this._notifyRemove(s,t.entry,i.ALL))})),t.size=0}clearAll(){this._db.forEach(((t,e)=>this._notifyRemove(e,t.entry,i.ALL))),this._users.forEach((t=>t.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(t,e,s){let i;return this._removeFuncs.some((n=>{if(t.startsWith(n[0])){const t=n[1](e,s);return"number"==typeof t&&(i=t),!0}return!1})),i}_checkSizeLimits(){if(this._size>this._maxSize)for(const[t,e]of this._db)if(this._purgeItem(t,e),this._size<=.9*this.maxSize)return;this._users.forEach((t=>{if(t.maxSize>0&&t.size>t.maxSize)for(const[e,s]of this._db)if(e.startsWith(t.id)&&(this._purgeItem(e,s,t),t.size<=.9*t.maxSize))return}))}_purgeItem(t,e,s=this._users.find((e=>t.startsWith(e.id)))){if(this._db.delete(t),e.lives<=1){this._size-=e.size,s&&(s.size-=e.size);const n=this._notifyRemove(t,e.entry,i.SOME);null!=n&&n>0&&(this._size+=n,s&&(s.size+=n),e.lives=e.lifetime,e.size=n,this._db.set(t,e))}else--e.lives,this._db.set(t,e)}}let a=0},20188:(t,e,s)=>{function i(t){return null!=h(t)||null!=o(t)}function n(t){return a.test(t)}function r(t){return h(t)??o(t)}function o(t){const e=new Date(t);return function(t,e){if(Number.isNaN(t.getTime()))return!1;let s=!0;if(l&&/\d+\W*$/.test(e)){const t=e.match(/[a-zA-Z]{2,}/);if(t){let e=!1,i=0;for(;!e&&i<=t.length;)e=!u.test(t[i]),i++;s=!e}}return s}(e,t)?Number.isNaN(e.getTime())?null:e.getTime()-6e4*e.getTimezoneOffset():null}function h(t){const e=a.exec(t);if(!e?.groups)return null;const s=e.groups,i=+s.year,n=+s.month-1,r=+s.day,o=+(s.hours??"0"),h=+(s.minutes??"0"),u=+(s.seconds??"0");if(o>23)return null;if(h>59)return null;if(u>59)return null;const l=s.ms??"0",c=l?+l.padEnd(3,"0").substring(0,3):0;let d;if(s.isUTC||!s.offsetSign)d=Date.UTC(i,n,r,o,h,u,c);else{const t=+s.offsetHours,e=+s.offsetMinutes;d=6e4*("+"===s.offsetSign?-1:1)*(60*t+e)+Date.UTC(i,n,r,o,h,u,c)}return Number.isNaN(d)?null:d}s.d(e,{mu:()=>n,of:()=>i,sG:()=>r});const a=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,u=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,l=!Number.isNaN(new Date("technology 10").getTime())},24133:(t,e,s)=>{s.d(e,{Q:()=>o});var i=s(67676),n=s(44553),r=s(88764);class o{constructor(t=9,e){this._compareMinX=l,this._compareMinY=c,this._toBBox=t=>t,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&("function"==typeof e?this._toBBox=e:this._initFormat(e)),this.clear()}destroy(){this.clear(),x.prune(),I.prune(),b.prune(),B.prune()}all(t){this._all(this._data,t)}search(t,e){let s=this._data;const i=this._toBBox;if(p(t,s))for(x.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;p(t,o)&&(s.leaf?e(r):g(t,o)?this._all(r,e):x.push(r))}s=x.pop()}}collides(t){let e=this._data;const s=this._toBBox;if(!p(t,e))return!1;for(x.clear();e;){for(let i=0,n=e.children.length;i<n;i++){const n=e.children[i],r=e.leaf?s(n):n;if(p(t,r)){if(e.leaf||g(t,r))return!0;x.push(n)}}e=x.pop()}return!1}load(t){if(!t.length)return this;if(t.length<this._minEntries){for(let e=0,s=t.length;e<s;e++)this.insert(t[e]);return this}let e=this._build(t.slice(0,t.length),0,t.length-1,0);if(this._data.children.length)if(this._data.height===e.height)this._splitRoot(this._data,e);else{if(this._data.height<e.height){const t=this._data;this._data=e,e=t}this._insert(e,this._data.height-e.height-1,!0)}else this._data=e;return this}insert(t){return t&&this._insert(t,this._data.height-1),this}clear(){return this._data=new z([]),this}remove(t){if(!t)return this;let e,s=this._data,n=null,r=0,o=!1;const h=this._toBBox(t);for(b.clear(),B.clear();s||b.length>0;){if(s||(s=b.pop(),n=b.data[b.length-1],r=B.pop()??0,o=!0),s.leaf&&(e=(0,i.cq)(s.children,t,s.children.length,s.indexHint),-1!==e))return s.children.splice(e,1),b.push(s),this._condense(b),this;o||s.leaf||!g(s,h)?n?(r++,s=n.children[r],o=!1):s=null:(b.push(s),B.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_all(t,e){let s=t;for(I.clear();s;){if(!0===s.leaf)for(const t of s.children)e(t);else I.pushArray(s.children);s=I.pop()??null}}_build(t,e,s,i){const n=s-e+1;let r=this._maxEntries;if(n<=r){const i=new z(t.slice(e,s+1));return h(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new M([]);o.height=i;const a=Math.ceil(n/r),u=a*Math.ceil(Math.sqrt(r));y(t,e,s,u,this._compareMinX);for(let n=e;n<=s;n+=u){const e=Math.min(n+u-1,s);y(t,n,e,a,this._compareMinY);for(let s=n;s<=e;s+=a){const n=Math.min(s+a-1,e);o.children.push(this._build(t,s,n,i-1))}}return h(o,this._toBBox),o}_chooseSubtree(t,e,s,i){for(;i.push(e),!0!==e.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=e.children.length;r<o;r++){const o=e.children[r],h=d(o),a=m(t,o)-h;a<n?(n=a,i=h<i?h:i,s=o):a===n&&h<i&&(i=h,s=o)}e=s||e.children[0]}return e}_insert(t,e,s){const i=this._toBBox,n=s?t:i(t);b.clear();const r=this._chooseSubtree(n,this._data,e,b);for(r.children.push(t),u(r,n);e>=0&&b.data[e].children.length>this._maxEntries;)this._split(b,e),e--;this._adjustParentBBoxes(n,b,e)}_split(t,e){const s=t.data[e],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),a=s.leaf?new z(o):new M(o);a.height=s.height,h(s,this._toBBox),h(a,this._toBBox),e?t.data[e-1].children.push(a):this._splitRoot(s,a)}_splitRoot(t,e){this._data=new M([t,e]),this._data.height=t.height+1,h(this._data,this._toBBox)}_chooseSplitIndex(t,e,s){let i,n,r;i=n=1/0;for(let o=e;o<=s-e;o++){const e=a(t,0,o,this._toBBox),h=a(t,o,s,this._toBBox),u=_(e,h),l=d(e)+d(h);u<i?(i=u,r=o,n=l<n?l:n):u===i&&l<n&&(n=l,r=o)}return r}_chooseSplitAxis(t,e,s){const i=t.leaf?this._compareMinX:l,n=t.leaf?this._compareMinY:c;this._allDistMargin(t,e,s,i)<this._allDistMargin(t,e,s,n)&&t.children.sort(i)}_allDistMargin(t,e,s,i){t.children.sort(i);const n=this._toBBox,r=a(t,0,e,n),o=a(t,s-e,s,n);let h=f(r)+f(o);for(let i=e;i<s-e;i++){const e=t.children[i];u(r,t.leaf?n(e):e),h+=f(r)}for(let i=s-e-1;i>=e;i--){const e=t.children[i];u(o,t.leaf?n(e):e),h+=f(o)}return h}_adjustParentBBoxes(t,e,s){for(let i=s;i>=0;i--)u(e.data[i],t)}_condense(t){for(let e=t.length-1;e>=0;e--){const s=t.data[e];if(0===s.children.length)if(e>0){const n=t.data[e-1],r=n.children;r.splice((0,i.cq)(r,s,r.length,n.indexHint),1)}else this.clear();else h(s,this._toBBox)}}_initFormat(t){const e=["return a"," - b",";"];this._compareMinX=new Function("a","b",e.join(t[0])),this._compareMinY=new Function("a","b",e.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function h(t,e){a(t,0,t.children.length,e,t)}function a(t,e,s,i,n){n||(n=new z([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=e;o<s;o++)r=t.children[o],u(n,t.leaf?i(r):r);return n}function u(t,e){t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY)}function l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function d(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function m(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function _(t,e){const s=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),r=Math.min(t.maxY,e.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function p(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function y(t,e,s,i,n){const o=[e,s];for(;o.length;){const e=o.pop(),s=o.pop();if(e-s<=i)continue;const h=s+Math.ceil((e-s)/i/2)*i;(0,r.q)(t,h,s,e,n),o.push(s,h,h,e)}}const x=new n.Z,I=new n.Z,b=new n.Z,B=new n.Z({deallocator:void 0});class v{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class S extends v{constructor(){super(...arguments),this.height=1,this.indexHint=new i.SO}}class z extends S{constructor(t){super(),this.children=t,this.leaf=!0}}class M extends S{constructor(t){super(),this.children=t,this.leaf=!1}}},17445:(t,e,s)=>{s.d(e,{N1:()=>d,YP:()=>a,Z_:()=>_,gx:()=>u,nn:()=>g,on:()=>c,tX:()=>p}),s(66643),s(46791);var i=s(91460),n=s(50758),r=s(70586),o=s(95330),h=s(26258);function a(t,e,s={}){return l(t,e,s,f)}function u(t,e,s={}){return l(t,e,s,m)}function l(t,e,s={},i){let n=null;const o=s.once?(t,s)=>{i(t)&&((0,r.hw)(n),e(t,s))}:(t,s)=>{i(t)&&e(t,s)};if(n=(0,h.aQ)(t,o,s.sync,s.equals),s.initial){const e=t();o(e,e)}return n}function c(t,e,s,o={}){let h=null,u=null,l=null;function c(){h&&u&&(u.remove(),o.onListenerRemove?.(h),h=null,u=null)}function d(t){o.once&&o.once&&(0,r.hw)(l),s(t)}const f=a(t,((t,s)=>{c(),(0,i.vT)(t)&&(h=t,u=(0,i.on)(t,e,d),o.onListenerAdd?.(t))}),{sync:o.sync,initial:!0});return l=(0,n.kB)((()=>{f.remove(),c()})),l}function d(t,e){return function(t,e,s){if((0,o.Hc)(s))return Promise.reject((0,o.zE)());const i=t();if(e?.(i))return Promise.resolve(i);let h=null;function a(){h=(0,r.hw)(h)}return new Promise(((i,r)=>{h=(0,n.AL)([(0,o.fu)(s,(()=>{a(),r((0,o.zE)())})),l(t,(t=>{a(),i(t)}),{sync:!1,once:!0},e??f)])}))}(t,m,e)}function f(t){return!0}function m(t){return!!t}s(87538);const _={sync:!0},g={initial:!0},p={sync:!0,initial:!0}},16306:(t,e,s)=>{s.d(e,{aX:()=>B});var i=s(68773),n=s(20102),r=s(92604),o=s(38913),h=s(58901),a=s(73913),u=s(8744),l=s(40488),c=(s(66577),s(3172)),d=s(33955),f=s(11282),m=s(17452);async function _(t,e,s){const i="string"==typeof t?(0,m.mN)(t):t,n=e[0].spatialReference,r=(0,d.Ji)(e[0]),o={...s,query:{...i.query,f:"json",sr:(0,u.B9)(n),geometries:JSON.stringify((a=e,{geometryType:(0,d.Ji)(a[0]),geometries:a.map((t=>t.toJSON()))}))}},{data:h}=await(0,c.Z)(i.path+"/simplify",o);var a;return function(t,e,s){const i=(0,d.q9)(e);return t.map((t=>{const e=i.fromJSON(t);return e.spatialReference=s,e}))}(h.geometries,r,n)}const g=r.Z.getLogger("esri.geometry.support.normalizeUtils");function p(t){return"polygon"===t[0].type}function y(t){return"polyline"===t[0].type}function x(t,e,s){if(e){const e=function(t,e){if(!(t instanceof h.Z||t instanceof o.Z)){const t="straightLineDensify: the input geometry is neither polyline nor polygon";throw g.error(t),new n.Z(t)}const s=(0,a.x3)(t),i=[];for(const t of s){const s=[];i.push(s),s.push([t[0][0],t[0][1]]);for(let i=0;i<t.length-1;i++){const n=t[i][0],r=t[i][1],o=t[i+1][0],h=t[i+1][1],a=Math.sqrt((o-n)*(o-n)+(h-r)*(h-r)),u=(h-r)/a,l=(o-n)/a,c=a/e;if(c>1){for(let t=1;t<=c-1;t++){const i=t*e,o=l*i+n,h=u*i+r;s.push([o,h])}const t=(a+Math.floor(c-1)*e)/2,i=l*t+n,o=u*t+r;s.push([i,o])}s.push([o,h])}}return function(t){return"polygon"===t.type}(t)?new o.Z({rings:i,spatialReference:t.spatialReference}):new h.Z({paths:i,spatialReference:t.spatialReference})}(t,1e6);t=(0,l.Sx)(e,!0)}return s&&(t=(0,a.Sy)(t,s)),t}function I(t,e,s){if(Array.isArray(t)){const i=t[0];if(i>e){const s=(0,a.XZ)(i,e);t[0]=i+s*(-2*e)}else if(i<s){const e=(0,a.XZ)(i,s);t[0]=i+e*(-2*s)}}else{const i=t.x;if(i>e){const s=(0,a.XZ)(i,e);t=t.clone().offset(s*(-2*e),0)}else if(i<s){const e=(0,a.XZ)(i,s);t=t.clone().offset(e*(-2*s),0)}}return t}function b(t,e){let s=-1;for(let i=0;i<e.cutIndexes.length;i++){const n=e.cutIndexes[i],r=e.geometries[i],o=(0,a.x3)(r);for(let t=0;t<o.length;t++){const e=o[t];e.some((s=>{if(s[0]<180)return!0;{let s=0;for(let t=0;t<e.length;t++){const i=e[t][0];s=i>s?i:s}s=Number(s.toFixed(9));const i=-360*(0,a.XZ)(s,180);for(let s=0;s<e.length;s++){const e=r.getPoint(t,s);r.setPoint(t,s,e.clone().offset(i,0))}return!0}}))}if(n===s){if(p(t))for(const e of(0,a.x3)(r))t[n]=t[n].addRing(e);else if(y(t))for(const e of(0,a.x3)(r))t[n]=t[n].addPath(e)}else s=n,t[n]=r}return t}async function B(t,e,s){if(!Array.isArray(t))return B([t],e);e&&"string"!=typeof e&&g.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof e?e:e?.url??i.default.geometryServiceUrl;let r,m,p,y,v,S,z,M,w=0;const N=[],X=[];for(const e of t)if(null!=e)if(r||(r=e.spatialReference,m=(0,u.C5)(r),p=r.isWebMercator,S=p?102100:4326,y=a.UZ[S].maxX,v=a.UZ[S].minX,z=a.UZ[S].plus180Line,M=a.UZ[S].minus180Line),m)if("mesh"===e.type)X.push(e);else if("point"===e.type)X.push(I(e.clone(),y,v));else if("multipoint"===e.type){const t=e.clone();t.points=t.points.map((t=>I(t,y,v))),X.push(t)}else if("extent"===e.type){const t=e.clone()._normalize(!1,!1,m);X.push(t.rings?new o.Z(t):t)}else if(e.extent){const t=e.extent,s=(0,a.XZ)(t.xmin,v)*(2*y);let i=0===s?e.clone():(0,a.Sy)(e.clone(),s);t.offset(s,0),t.intersects(z)&&t.xmax!==y?(w=t.xmax>w?t.xmax:w,i=x(i,p),N.push(i),X.push("cut")):t.intersects(M)&&t.xmin!==v?(w=t.xmax*(2*y)>w?t.xmax*(2*y):w,i=x(i,p,360),N.push(i),X.push("cut")):X.push(i)}else X.push(e.clone());else X.push(e);else X.push(e);let Y=(0,a.XZ)(w,y),Z=-90;const R=Y,E=new h.Z;for(;Y>0;){const t=360*Y-180;E.addPath([[t,Z],[t,-1*Z]]),Z*=-1,Y--}if(N.length>0&&R>0){const e=b(N,await async function(t,e,s,i){const n=(0,f.en)(t),r=e[0].spatialReference,o={...i,responseType:"json",query:{...n.query,f:"json",sr:(0,u.B9)(r),target:JSON.stringify({geometryType:(0,d.Ji)(e[0]),geometries:e}),cutter:JSON.stringify(s)}},h=await(0,c.Z)(n.path+"/cut",o),{cutIndexes:a,geometries:l=[]}=h.data;return{cutIndexes:a,geometries:l.map((t=>{const e=(0,d.im)(t);return e.spatialReference=r,e}))}}(n,N,E,s)),i=[],r=[];for(let s=0;s<X.length;s++){const n=X[s];if("cut"!==n)r.push(n);else{const n=e.shift(),o=t[s];null!=o&&"polygon"===o.type&&o.rings&&o.rings.length>1&&n.rings.length>=o.rings.length?(i.push(n),r.push("simplify")):r.push(p?(0,l.$)(n):n)}}if(!i.length)return r;const o=await _(n,i,s),h=[];for(let t=0;t<r.length;t++){const e=r[t];"simplify"!==e?h.push(e):h.push(p?(0,l.$)(o.shift()):o.shift())}return h}const T=[];for(let t=0;t<X.length;t++){const e=X[t];if("cut"!==e)T.push(e);else{const t=N.shift();T.push(!0===p?(0,l.$)(t):t)}}return T}},73913:(t,e,s)=>{s.d(e,{Sy:()=>a,UZ:()=>o,XZ:()=>h,x3:()=>u});var i=s(58901),n=s(82971),r=s(33955);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.Z.WebMercator}),minus180Line:new i.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.Z({paths:[[[180,-180],[180,180]]],spatialReference:n.Z.WGS84}),minus180Line:new i.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:n.Z.WGS84})}};function h(t,e){return Math.ceil((t-e)/(2*e))}function a(t,e){const s=u(t);for(const t of s)for(const s of t)s[0]+=e;return t}function u(t){return(0,r.oU)(t)?t.rings:t.paths}},37549:(t,e,s)=>{s.d(e,{H:()=>h});var i=s(80442),n=s(24133),r=s(24470);const o={minX:0,minY:0,maxX:0,maxY:0};class h{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.Q(9,(0,i.Z)("esri-csp-restrictions")?t=>({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const t=new Array(this._idByBounds.size);let e=0;this._idByBounds.forEach(((s,i)=>{t[e++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(t)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((t=>this._idByBounds.has(t)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const t=(0,r.cS)();for(const e of this._boundsById.values())e&&(t[0]=Math.min(e[0],t[0]),t[1]=Math.min(e[1],t[1]),t[2]=Math.max(e[2],t[2]),t[3]=Math.max(e[3],t[3]));return t}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(t){const e=this._boundsById.get(t);this._boundsById.delete(t),e&&(this._idByBounds.delete(e),this._indexInvalid||this._index.remove(e))}forEachInBounds(t,e){this._loadIndex(),function(t,e,s){(function(t){o.minX=t[0],o.minY=t[1],o.maxX=t[2],o.maxY=t[3]})(e),t.search(o,s)}(this._index,t,(t=>e(this._idByBounds.get(t))))}get(t){return this._boundsById.get(t)}has(t){return this._boundsById.has(t)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(t,e){if(!this._indexInvalid){const e=this._boundsById.get(t);e&&(this._index.remove(e),this._idByBounds.delete(e))}this._boundsById.set(t,e),e&&(this._idByBounds.set(e,t),this._indexInvalid||(this._boundsToLoad.push(e),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},28972:(t,e,s)=>{s.d(e,{Z:()=>S});var i=s(67676),n=s(20102),r=s(32448),o=s(92604),h=s(60437),a=s(24470),u=s(98732),l=s(37549),c=s(42712);function d(t,e){return t?e?4:3:e?3:2}function f(t,e,s,i,n){if(!e?.lengths.length)return null;const r="upperLeft"===n?.originPosition?-1:1;t.lengths.length&&(t.lengths.length=0),t.coords.length&&(t.coords.length=0);const o=t.coords,h=[],a=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:u,coords:l}=e,c=d(s,i);let f=0;for(const t of u){const e=m(a,l,f,t,s,i,r);e&&h.push(e),f+=t*c}if(h.sort(((t,e)=>{let i=r*t[2]-r*e[2];return 0===i&&s&&(i=t[4]-e[4]),i})),h.length){let t=6*h[0][2];o[0]=h[0][0]/t,o[1]=h[0][1]/t,s&&(t=6*h[0][4],o[2]=0!==t?h[0][3]/t:0),(o[0]<a[0]||o[0]>a[1]||o[1]<a[2]||o[1]>a[3]||s&&(o[2]<a[4]||o[2]>a[5]))&&(o.length=0)}if(!o.length){const t=e.lengths[0]?_(l,0,u[0],s,i):null;if(!t)return null;o[0]=t[0],o[1]=t[1],s&&t.length>2&&(o[2]=t[2])}return t}function m(t,e,s,i,n,r,o=1){const h=d(n,r);let a=s,u=s+h,l=0,c=0,f=0,m=0,_=0;for(let s=0,r=i-1;s<r;s++,a+=h,u+=h){const s=e[a],i=e[a+1],r=e[a+2],o=e[u],h=e[u+1],d=e[u+2];let g=s*h-o*i;m+=g,l+=(s+o)*g,c+=(i+h)*g,n&&(g=s*d-o*r,f+=(r+d)*g,_+=g),s<t[0]&&(t[0]=s),s>t[1]&&(t[1]=s),i<t[2]&&(t[2]=i),i>t[3]&&(t[3]=i),n&&(r<t[4]&&(t[4]=r),r>t[5]&&(t[5]=r))}if(m*o>0&&(m*=-1),_*o>0&&(_*=-1),!m)return null;const g=[l,c,.5*m];return n&&(g[3]=f,g[4]=.5*_),g}function _(t,e,s,i,n){const r=d(i,n);let o=e,h=e+r,a=0,u=0,l=0,c=0;for(let e=0,n=s-1;e<n;e++,o+=r,h+=r){const e=t[o],s=t[o+1],n=t[o+2],r=t[h],d=t[h+1],f=t[h+2],m=i?p(e,s,n,r,d,f):g(e,s,r,d);if(m)if(a+=m,i){const t=x(e,s,n,r,d,f);u+=m*t[0],l+=m*t[1],c+=m*t[2]}else{const t=y(e,s,r,d);u+=m*t[0],l+=m*t[1]}}return a>0?i?[u/a,l/a,c/a]:[u/a,l/a]:s>0?i?[t[e],t[e+1],t[e+2]]:[t[e],t[e+1]]:null}function g(t,e,s,i){const n=s-t,r=i-e;return Math.sqrt(n*n+r*r)}function p(t,e,s,i,n,r){const o=i-t,h=n-e,a=r-s;return Math.sqrt(o*o+h*h+a*a)}function y(t,e,s,i){return[t+.5*(s-t),e+.5*(i-e)]}function x(t,e,s,i,n,r){return[t+.5*(i-t),e+.5*(n-e),s+.5*(r-s)]}var I=s(70272),b=s(5428);const B={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new I.u_(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>(null==t.centroid&&(t.centroid=f(new b.Z,t.geometry,e.hasZ,e.hasM)),t.centroid)},v=(0,h.Ue)();class S{constructor(t){this.geometryInfo=t,this._boundsStore=new l.H,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.Z,this.featureAdapter=B}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let t=0;return this._featuresById.forEach((e=>{null!=e.geometry&&e.geometry.coords&&(t+=e.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:t/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(t){if(null==this.fullBounds)return null;const[e,s,i,n]=this.fullBounds;return{xmin:e,ymin:s,xmax:i,ymax:n,spatialReference:(0,c.S2)(t)}}add(t){this._add(t),this._emitChanged()}addMany(t){for(const e of t)this._add(e);this._emitChanged()}upsertMany(t){const e=t.map((t=>this._upsert(t)));return this._emitChanged(),e.filter(i.pC)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(t){const e=this._featuresById.get(t);return e?(this._remove(e),this._emitChanged(),e):null}removeManyById(t){this._boundsStore.invalidateIndex();for(const e of t){const t=this._featuresById.get(e);t&&this._remove(t)}this._emitChanged()}forEachBounds(t,e){for(const s of t){const t=this._boundsStore.get(s.objectId);t&&e((0,h.JR)(v,t))}}getFeature(t){return this._featuresById.get(t)}has(t){return this._featuresById.has(t)}forEach(t){this._featuresById.forEach((e=>t(e)))}forEachInBounds(t,e){this._boundsStore.forEachInBounds(t,(t=>{e(this._featuresById.get(t))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let t=!1;this._featuresById.forEach(((e,s)=>{this._markedIds.has(s)||(t=!0,this._remove(e))})),this._markedIds.clear(),t&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(t){if(!t)return;const e=t.objectId;if(null==e)return void o.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.Z("featurestore:invalid-feature","feature id is missing",{feature:t}));const s=this._featuresById.get(e);let i;if(this._markedIds.add(e),s?(t.displayId=s.displayId,i=this._boundsStore.get(e),this._boundsStore.delete(e)):null!=this.onFeatureAdd&&this.onFeatureAdd(t),!t.geometry?.coords?.length)return this._boundsStore.set(e,null),void this._featuresById.set(e,t);i=(0,u.$)(null!=i?i:(0,a.Ue)(),t.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(e,i),this._featuresById.set(e,t)}_upsert(t){const e=t?.objectId;if(null==e)return o.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.Z("featurestore:invalid-feature","feature id is missing",{feature:t})),null;const s=this._featuresById.get(e);if(!s)return this._add(t),t;this._markedIds.add(e);const{geometry:i,attributes:r}=t;for(const t in r)s.attributes[t]=r[t];return i&&(s.geometry=i,this._boundsStore.set(e,(0,u.$)((0,a.Ue)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(t){null!=this.onFeatureRemove&&this.onFeatureRemove(t);const e=t.objectId;return this._markedIds.delete(e),this._boundsStore.delete(e),this._featuresById.delete(e),t}}},23095:(t,e,s)=>{s.d(e,{O0:()=>d,av:()=>a,b:()=>g,d1:()=>l,og:()=>_});var i=s(20188),n=s(8744),r=s(69165);class o{constructor(){this.code=null,this.description=null}}class h{constructor(t){this.error=new o,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=t}}function a(t){return new h(t)}class u{constructor(t){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=t}}function l(t){return new u(t)}const c=new Set;function d(t,e,s,i=!1){c.clear();for(const n in s){const o=t.get(n);if(!o)continue;const h=f(o,s[n]);if(c.add(o.name),o&&(i||o.editable)){const t=(0,r.Qc)(o,h);if(t)return a((0,r.vP)(t,o,h));e[o.name]=h}}for(const e of t?.requiredFields??[])if(!c.has(e.name))return a(`missing required field "${e.name}"`);return null}function f(t,e){let s=e;return(0,r.H7)(t)&&"string"==typeof e?s=parseFloat(e):(0,r.qN)(t)&&null!=e&&"string"!=typeof e?s=String(e):(0,r.y2)(t)&&"string"==typeof e&&(s=(0,i.sG)(e)),(0,r.Pz)(s)}let m;function _(t,e){if(!t||!(0,n.JY)(e))return t;if("rings"in t||"paths"in t){if(null==m)throw new TypeError("geometry engine not loaded");return m.simplify(e,t)}return t}async function g(t,e){!(0,n.JY)(t)||"esriGeometryPolygon"!==e&&"esriGeometryPolyline"!==e||await async function(){return null==m&&(m=await Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247))),m}()}},11282:(t,e,s)=>{s.d(e,{cv:()=>h,en:()=>o,lA:()=>r}),s(68773),s(40330);var i=s(22974),n=s(17452);function r(t,e){return e?{...e,query:{...t??{},...e.query}}:{query:t}}function o(t){return"string"==typeof t?(0,n.mN)(t):(0,i.d9)(t)}function h(t,e,s){const i={};for(const n in t){if("declaredClass"===n)continue;const r=t[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r)){i[n]=[];for(let t=0;t<r.length;t++)i[n][t]=h(r[t])}else if("object"==typeof r)if(r.toJSON){const t=r.toJSON(s?.[n]);i[n]=e?t:JSON.stringify(t)}else i[n]=e?r:JSON.stringify(r);else i[n]=r}return i}s(71058)}}]);