@arcgis/core 4.29.8 → 4.29.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{a8ac511280f873960d46.js → 1dc474a28d5ddac1a4b7.js} +1 -1
- package/assets/esri/core/workers/chunks/{fc5ac713872766571e07.js → 31c065746e53f7518c17.js} +1 -1
- package/assets/esri/core/workers/chunks/{c556644bb0cf88770939.js → 413978b96c88d5ff01ee.js} +1 -1
- package/assets/esri/core/workers/chunks/{8225febaf0a412f4cee4.js → 5e4465448b2728cafab0.js} +1 -1
- package/assets/esri/core/workers/chunks/{df6fbabbc74a408575fc.js → 6301990e489d31596bc8.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a8ab968ebb18480481d.js → 8699eaadd3fb6709fd94.js} +1 -1
- package/assets/esri/core/workers/chunks/{b139cf91bc148aa84419.js → 96cb79adabfbbcc3e707.js} +1 -1
- package/assets/esri/core/workers/chunks/{2433b39624a7e274cb98.js → b4c41a8244b7371e864e.js} +1 -1
- package/assets/esri/core/workers/chunks/{b42a83db83851cb57d44.js → bed684a8d38fa7ac5eb7.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe74ee642bc72fe18210.js → d576aa444ad7c9289617.js} +1 -1
- package/assets/esri/core/workers/chunks/{f60e5dd0e712cf32f782.js → f2e8b75ad3b574894ade.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9c55ff1f21db198ce03.js → ff96940be6a4c8489ebb.js} +1 -1
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5672,8528],{8528:(e,t,s)=>{s.d(t,{c:()=>i,g:()=>n});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},11004:(e,t,s)=>{s.d(t,{o:()=>n});var i=s(74452);class n{constructor(e,t){this._storage=new i.kB,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,s=1){this._storage.put(this,e,t,s,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},74452:(e,t,s)=>{s.d(t,{ML:()=>o,kB:()=>a});var i,n,r=s(24680);(n=i||(i={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=h+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,s,i=0){this._storage.put(this,e,t,s,i)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new r.c,this._users=new r.c}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const s=this._db.get(e.id+t);return s?.size??0}put(e,t,s,n,r){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==s&&this._notifyRemove(t,o.entry,o.size,i.ALL)),n>this._maxSize)return void this._notifyRemove(t,s,n,i.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,s,0,i.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(t,new u(s,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,s,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===s){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,s,n,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},s=new Array;this._db.forEach(((e,i)=>{const n=e.lifetime;s[n]=(s[n]||0)+e.size,this._users.forAll((s=>{const{id:n,name:r}=s;if(i.startsWith(n)){const s=t[r]||0;t[r]=s+e.size}}))}));const i={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[s]||0;t[s]=n,i[s]=Math.round(100*e.hitRate)+"%"}else i[s]="0%"}));const n=Object.keys(t);n.sort(((e,s)=>t[s]-t[e])),n.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+i[s]));for(let t=s.length-1;t>=0;--t){const i=s[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,s,i){let n;return this._removeFuncs.some((r=>{if(e.startsWith(r[0])){const e=r[1](t,i,s);return"number"==typeof e&&(n=e),!0}return!1})),n}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const s=e?.id;let i=!0;for(;i;){i=!1;for(const[n,r]of this._db)if(0===r.lifetime&&(!s||n.startsWith(s))){if(this._purgeItem(n,r,e),t.size<=.9*t.maxSize)return;i||=this._db.has(n)}}for(const[i,n]of this._db)if((!s||i.startsWith(s))&&(this._purgeItem(i,n,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=n&&n>0&&(this._size+=n,s&&(s.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let h=0;class u{constructor(e,t,s){this.entry=e,this.size=t,this.lifetime=s,this.lives=s}}},3024:(e,t,s)=>{s.d(t,{U:()=>o});var i=s(92400),n=s(24680),r=s(85304);class o{constructor(e=9,t){this._compareMinX=l,this._compareMinY=c,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),w.prune(),S.prune(),v.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(p(e,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(e,o)&&(s.leaf?t(r):g(e,o)?this._all(r,t):x.push(r))}s=x.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!p(e,t))return!1;for(x.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(p(e,r)){if(t.leaf||g(e,r))return!0;x.push(n)}}t=x.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 R([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(S.clear(),v.clear();s||S.length>0;){if(s||(s=S.pop(),n=S.data[S.length-1],r=v.pop()??0,o=!0),s.leaf&&(t=(0,i.IP)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),S.push(s),this._condense(S),this;o||s.leaf||!g(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(S.push(s),v.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(w.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else w.pushArray(s.children);s=w.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new R(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 B([]);o.height=i;const h=Math.ceil(n/r),u=h*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,h,this._compareMinY);for(let s=n;s<=t;s+=h){const n=Math.min(s+h-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=d(o),h=m(e,o)-a;h<n?(n=h,i=a<i?a:i,s=o):h===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);S.clear();const r=this._chooseSubtree(n,this._data,t,S);for(r.children.push(e),u(r,n);t>=0&&S.data[t].children.length>this._maxEntries;)this._split(S,t),t--;this._adjustParentBBoxes(n,S,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),h=s.leaf?new R(o):new B(o);h.height=s.height,a(s,this._toBBox),a(h,this._toBBox),t?e.data[t-1].children.push(h):this._splitRoot(s,h)}_splitRoot(e,t){this._data=new B([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=h(e,0,o,this._toBBox),a=h(e,o,s,this._toBBox),u=_(t,a),l=d(t)+d(a);u<i?(i=u,r=o,n=l<n?l:n):u===i&&l<n&&(n=l,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:l,n=e.leaf?this._compareMinY:c;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=h(e,0,t,n),o=h(e,s-t,s,n);let a=f(r)+f(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=f(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=f(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.IP)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){h(e,0,e.children.length,t,e)}function h(e,t,s,i,n){n||(n=new R([])),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 l(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function m(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 p(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 x=new n.c,w=new n.c,S=new n.c,v=new n.c({deallocator:void 0});class I{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class b extends I{constructor(){super(...arguments),this.height=1,this.indexHint=new i.is}}class R extends b{constructor(e){super(),this.children=e,this.leaf=!0}}class B extends b{constructor(e){super(),this.children=e,this.leaf=!1}}},57896:(e,t,s)=>{s.d(t,{Eq:()=>d,KG:()=>p,_8:()=>g,_I:()=>u,aE:()=>h,du:()=>_,on:()=>c}),s(40196),s(2952);var i=s(60976),n=s(38912),r=s(70680),o=s(10860),a=s(37176);function h(e,t,s={}){return l(e,t,s,f)}function u(e,t,s={}){return l(e,t,s,m)}function l(e,t,s={},i){let n=null;const o=s.once?(e,s)=>{i(e)&&((0,r.oR)(n),t(e,s))}:(e,s)=>{i(e)&&t(e,s)};if(n=(0,a.M9)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return n}function c(e,t,s,o={}){let a=null,u=null,l=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.oR)(l),s(e)}const f=h(e,((e,s)=>{c(),(0,i.sh)(e)&&(a=e,u=(0,i.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return l=(0,n.uU)((()=>{f.remove(),c()})),l}function d(e,t){return function(e,t,s){if((0,o.wv)(s))return Promise.reject((0,o.Uh)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function h(){a=(0,r.oR)(a)}return new Promise(((i,r)=>{a=(0,n.Ip)([(0,o.wD)(s,(()=>{h(),r((0,o.Uh)())})),l(e,(e=>{h(),i(e)}),{sync:!1,once:!0},t??f)])}))}(e,m,t)}function f(e){return!0}function m(e){return!!e}s(41168);const _={sync:!0},g={initial:!0},p={sync:!0,initial:!0}},20480:(e,t,s)=>{s.d(t,{WW:()=>v});var i=s(6220),n=s(20744),r=s(66360),o=s(7488),a=s(48516),h=s(44048),u=s(60544),l=s(29120),c=(s(60708),s(2600)),d=s(6704),f=s(21980),m=s(28176),_=s(81976);const g=()=>r.c.getLogger("esri.geometry.support.normalizeUtils");function p(e){return"polygon"===e[0].type}function y(e){return"polyline"===e[0].type}function x(e,t,s){if(t){const t=function(e,t){if(!(e instanceof a.c||e instanceof o.c)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw g().error(e),new n.c(e)}const s=(0,h.iM)(e),i=[];for(const e of s){const s=[];i.push(s),s.push([e[0][0],e[0][1]]);for(let i=0;i<e.length-1;i++){const n=e[i][0],r=e[i][1],o=e[i+1][0],a=e[i+1][1],h=Math.sqrt((o-n)*(o-n)+(a-r)*(a-r)),u=(a-r)/h,l=(o-n)/h,c=h/t;if(c>1){for(let e=1;e<=c-1;e++){const i=e*t,o=l*i+n,a=u*i+r;s.push([o,a])}const e=(h+Math.floor(c-1)*t)/2,i=l*e+n,o=u*e+r;s.push([i,o])}s.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new o.c({rings:i,spatialReference:e.spatialReference}):new a.c({paths:i,spatialReference:e.spatialReference})}(e,1e6);e=(0,l.aq)(t,!0)}return s&&(e=(0,h.wb)(e,s)),e}function w(e,t,s){if(Array.isArray(e)){const i=e[0];if(i>t){const s=(0,h.yK)(i,t);e[0]=i+s*(-2*t)}else if(i<s){const t=(0,h.yK)(i,s);e[0]=i+t*(-2*s)}}else{const i=e.x;if(i>t){const s=(0,h.yK)(i,t);e=e.clone().offset(s*(-2*t),0)}else if(i<s){const t=(0,h.yK)(i,s);e=e.clone().offset(t*(-2*s),0)}}return e}function S(e,t){let s=-1;for(let i=0;i<t.cutIndexes.length;i++){const n=t.cutIndexes[i],r=t.geometries[i],o=(0,h.iM)(r);for(let e=0;e<o.length;e++){const t=o[e];t.some((s=>{if(s[0]<180)return!0;{let s=0;for(let e=0;e<t.length;e++){const i=t[e][0];s=i>s?i:s}s=Number(s.toFixed(9));const i=-360*(0,h.yK)(s,180);for(let s=0;s<t.length;s++){const t=r.getPoint(e,s);r.setPoint(e,s,t.clone().offset(i,0))}return!0}}))}if(n===s){if(p(e))for(const t of(0,h.iM)(r))e[n]=e[n].addRing(t);else if(y(e))for(const t of(0,h.iM)(r))e[n]=e[n].addPath(t)}else s=n,e[n]=r}return e}async function v(e,t,s){if(!Array.isArray(e))return v([e],t);t&&"string"!=typeof t&&g().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??i.default.geometryServiceUrl;let r,p,y,I,b,R,B,M,z=0;const C=[],F=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,p=(0,u.Nq)(r),y=r.isWebMercator,R=y?102100:4326,I=h.Hh[R].maxX,b=h.Hh[R].minX,B=h.Hh[R].plus180Line,M=h.Hh[R].minus180Line),p)if("mesh"===t.type)F.push(t);else if("point"===t.type)F.push(w(t.clone(),I,b));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>w(e,I,b))),F.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,p);F.push(e.rings?new o.c(e):e)}else if(t.extent){const e=t.extent,s=(0,h.yK)(e.xmin,b)*(2*I);let i=0===s?t.clone():(0,h.wb)(t.clone(),s);e.offset(s,0),e.intersects(B)&&e.xmax!==I?(z=e.xmax>z?e.xmax:z,i=x(i,y),C.push(i),F.push("cut")):e.intersects(M)&&e.xmin!==b?(z=e.xmax*(2*I)>z?e.xmax*(2*I):z,i=x(i,y,360),C.push(i),F.push("cut")):F.push(i)}else F.push(t.clone());else F.push(t);else F.push(t);let E=(0,h.yK)(z,I),T=-90;const X=E,L=new a.c;for(;E>0;){const e=360*E-180;L.addPath([[e,T],[e,-1*T]]),T*=-1,E--}if(C.length>0&&X>0){const t=S(C,await async function(e,t,s,i){const n=(0,f.UX)(e),r=t[0].spatialReference,o={...i,responseType:"json",query:{...n.query,f:"json",sr:(0,u.um)(r),target:JSON.stringify({geometryType:(0,d.Ce)(t[0]),geometries:t}),cutter:JSON.stringify(s)}},a=await(0,c.c)(n.path+"/cut",o),{cutIndexes:h,geometries:l=[]}=a.data;return{cutIndexes:h,geometries:l.map((e=>{const t=(0,d.h4)(e);return t.spatialReference=r,t}))}}(n,C,L,s)),i=[],r=[];for(let s=0;s<F.length;s++){const n=F[s];if("cut"!==n)r.push(n);else{const n=t.shift(),o=e[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(y?(0,l.w7)(n):n)}}if(!i.length)return r;const o=await async function(e,t,s){const i="string"==typeof e?(0,m.as)(e):e,n=t[0].spatialReference,r=(0,d.Ce)(t[0]),o={...s,query:{...i.query,f:"json",sr:(0,u.um)(n),geometries:JSON.stringify((0,_.y)(t))}},{data:a}=await(0,c.c)(i.path+"/simplify",o);return(0,_.Q)(a.geometries,r,n)}(n,i,s),a=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?a.push(t):a.push(y?(0,l.w7)(o.shift()):o.shift())}return a}const Y=[];for(let e=0;e<F.length;e++){const t=F[e];if("cut"!==t)Y.push(t);else{const e=C.shift();Y.push(!0===y?(0,l.w7)(e):e)}}return Y}},44048:(e,t,s)=>{s.d(t,{Hh:()=>o,iM:()=>u,wb:()=>h,yK:()=>a});var i=s(48516),n=s(56156),r=s(6704);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.c({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator}),minus180Line:new i.c({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.c({paths:[[[180,-180],[180,180]]],spatialReference:n.c.WGS84}),minus180Line:new i.c({paths:[[[-180,-180],[-180,180]]],spatialReference:n.c.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function h(e,t){const s=u(e);for(const e of s)for(const s of e)s[0]+=t;return e}function u(e){return(0,r.Cs)(e)?e.rings:e.paths}},6904:(e,t,s)=>{s.d(t,{c:()=>a});var i=s(9456),n=s(3024),r=s(83372);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.U(9,(0,i.c)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.FZ)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9107:(e,t,s)=>{s.d(t,{c:()=>m});var i=s(92400),n=s(20744),r=s(77860),o=s(66360),a=s(77048),h=s(83372),u=s(97088),l=s(6904),c=s(83624),d=s(51752);const f=(0,a.Su)();class m{constructor(e){this.geometryInfo=e,this._boundsStore=new l.c,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.c,this.featureAdapter=d.u}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,c.C6)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.G6)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.Qv)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.C_)(null!=i?i:(0,h.Su)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.C_)((0,h.Su)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},45160:(e,t,s)=>{s.r(t),s.d(t,{default:()=>x});var i=s(40196),n=s(20744),r=s(66360),o=s(10860),a=s(69504),h=s(60544),u=s(97088),l=s(9107),c=s(7684),d=s(47302),f=s(35756),m=s(49372),_=s(44808),g=s(16424),p=s(28484);const y="esri.layers.WFSLayer";class x{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:s,getFeatureOutputFormat:i,fields:r,geometryType:a,featureType:h,maxRecordCount:u,maxTotalRecordCount:f,maxPageCount:m,objectIdField:y,customParameters:x}=e,{spatialReference:S,getFeatureSpatialReference:v}=(0,_.i4)(s,h,e.spatialReference);try{await(0,c.Qv)(v,S)}catch{throw new n.c("unsupported-projection","Projection not supported",{inSpatialReference:v,outSpatialReference:S})}(0,o.wp)(t),this._customParameters=x,this._featureType=h,this._fieldsIndex=g.c.fromLayerJSON({fields:r,dateFieldsTimeReference:r.some((e=>"esriFieldTypeDate"===e.type))?{timeZoneIANA:p.Gw}:null}),this._geometryType=a,this._getFeatureUrl=s,this._getFeatureOutputFormat=i,this._getFeatureSpatialReference=v,this._maxRecordCount=u,this._maxTotalRecordCount=f,this._maxPageCount=m,this._objectIdField=y,this._spatialReference=S;let I=await this._snapshotFeatures(t);if(I.errors.length>0&&(this._supportsPagination=!1,I=await this._snapshotFeatures(t),I.errors.length>0))throw I.errors[0];return this._queryEngine=new d.U({fieldsIndex:this._fieldsIndex,geometryType:a,hasM:!1,hasZ:!1,objectIdField:y,spatialReference:S,timeInfo:null,featureStore:new l.c({geometryType:a,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(I.features),{warnings:w(I),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new n.c("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}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){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=(0,i.kn)((e=>this._snapshotFeatures({signal:e}))),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(e.features);for(const t of w(e))r.c.getLogger(y).warn(new a.c("wfs-layer:refresh-warning",t.message,t.details));e.errors?.length&&r.c.getLogger(y).warn(new a.c("wfs-layer:refresh-error","Refresh completed with errors",{errors:e.errors}))}),(()=>{this._queryEngine.featureStore.clear()})),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,s=this._maxTotalRecordCount,i=this._maxPageCount,n=this._supportsPagination?await(0,_.gp)(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let r=[];const a=[];if(null==n)try{r=await this._singleQuery(t)}catch(e){(0,o.mA)(e)||a.push(e)}else{const e=Math.min(n,s),h=function*(e,t,s){for(let i=0;i<t;i++)yield e._pageQuery(i,s)}(this,Math.max(1,Math.min(Math.ceil(e/this._maxRecordCount),i)),t);await Promise.allSettled(Array.from({length:10}).map((()=>async function(e,t,s){let i=e.next();for(;!i.done;){try{const e=await i.value;t.push(...e)}catch(e){(0,o.mA)(e)||s.push(e)}i=e.next()}}(h,r,a))))}return(0,o.wp)(t),{features:r,totalRecordCount:n,maxTotalRecordCount:s,maxPageCount:i,errors:a}}async _singleQuery(e){const t=await(0,_.Az)(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const s=e*this._maxRecordCount,i=await(0,_.Az)(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:s,count:this._maxRecordCount,signal:t});return this._processGeoJSON(i,{startIndex:s,signal:t})}_processGeoJSON(e,t){(0,f.ii)(e,this._getFeatureSpatialReference.wkid);const{startIndex:s,signal:i}=t;(0,o.wp)(i);const n=(0,f.MN)(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!(0,h.yK)(this._spatialReference,this._getFeatureSpatialReference))for(const e of n)null!=e.geometry&&(e.geometry=(0,u.C)((0,c.yU)((0,u.qw)(e.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let r=s??1;for(const e of n){const t={};(0,m.uo)(this._fieldsIndex,t,e.attributes,!0),e.attributes=t,null==t[this._objectIdField]&&(e.objectId=t[this._objectIdField]=r++)}return n}}function w(e){const t=[];return null!=e.totalRecordCount&&(e.features.length<e.totalRecordCount&&t.push({name:"wfs-layer:maxRecordCount-too-low",message:`Could only fetch ${e.features.length} of ${e.totalRecordCount} in ${e.maxPageCount} queries. Try increasing the value of WFSLayer.maxRecordCount.`,details:{recordCount:e.features.length,totalRecordCount:e.totalRecordCount}}),e.totalRecordCount>e.maxTotalRecordCount&&t.push({name:"wfs-layer:large-dataset",message:`The number of ${e.totalRecordCount} features exceeds the maximum allowed of ${e.maxTotalRecordCount}.`,details:{recordCount:e.features.length,totalRecordCount:e.totalRecordCount,maxTotalRecordCount:e.maxTotalRecordCount}})),t}},49372:(e,t,s)=>{s.d(t,{GI:()=>l,OM:()=>_,Oo:()=>g,or:()=>h,uo:()=>d});var i=s(39180),n=s(60544),r=s(564);class o{constructor(){this.code=null,this.description=null}}class a{constructor(e){this.error=new o,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}}function h(e){return new a(e)}class u{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function l(e){return new u(e)}const c=new Set;function d(e,t,s,i=!1){c.clear();for(const n in s){const o=e.get(n);if(!o)continue;const a=f(o,s[n]);if(c.add(o.name),o&&(i||o.editable)){const e=(0,r.YT)(o,a);if(e)return h((0,r.Ke)(e,o,a));t[o.name]=a}}for(const t of e?.requiredFields??[])if(!c.has(t.name))return h(`missing required field "${t.name}"`);return null}function f(e,t){let s=t;return(0,r.iW)(e)&&"string"==typeof t?s=parseFloat(t):(0,r.AZ)(e)&&null!=t&&"string"!=typeof t?s=String(t):(0,r.gp)(e)&&"string"==typeof t&&(s=(0,i.sn)(t)),(0,r.OJ)(s)}let m;function _(e,t){if(!e||!(0,n.U3)(t))return e;if("rings"in e||"paths"in e){if(null==m)throw new TypeError("geometry engine not loaded");return m.simplify(t,e)}return e}async function g(e,t){!(0,n.U3)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==m&&(m=await Promise.all([s.e(984),s.e(2704)]).then(s.bind(s,82704))),m}()}},48212:(e,t,s)=>{s.d(t,{Ab:()=>x,Ej:()=>d,K0:()=>c,M9:()=>f,Wq:()=>_,YB:()=>l,_2:()=>p,oR:()=>g,q_:()=>m,wn:()=>y});var i=s(28176),n=s(91952);const r={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer"},o=Object.values(r),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),h=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function l(e){return!!a.test(e)}function c(e){if(null==e)return null;const t=(0,i.as)(e),s=t?.path.match(a)||t?.path.match(h);if(!s)return null;const[,n,o,u,l]=s,c=o.indexOf("/");return{title:f(-1!==c?o.slice(c+1):o),serverType:r[u.toLowerCase()],sublayer:null!=l&&""!==l?parseInt(l,10):null,url:{path:n}}}function d(e){const t=(0,i.as)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function f(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function m(e,t){const s=[];if(e){const t=c(e);null!=t&&t.title&&s.push(t.title)}if(t){const e=f(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.ai)((0,i.kN)(e,t)):e}function p(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.kN)(t,e.logger);const s=(0,i.as)(t),n=c(s.path);let r;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(r=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=d(s.path);null!=e&&(t=e.serviceUrl,r=e.sublayerId)}return{url:(0,i.ai)(t),layerId:r}}function y(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.kn)(r.url,s,e.layerId.toString()))}function x(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)}},81976:(e,t,s)=>{s.d(t,{Q:()=>r,y:()=>n});var i=s(6704);function n(e){return{geometryType:(0,i.Ce)(e[0]),geometries:e.map((e=>e.toJSON()))}}function r(e,t,s){const n=(0,i.uG)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=s,t}))}},21980:(e,t,s)=>{s.d(t,{OW:()=>a,UX:()=>o,sR:()=>r}),s(6220),s(47620);var i=s(62088),n=s(28176);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function o(e){return"string"==typeof e?(0,n.as)(e):(0,i.ct)(e)}function a(e,t,s){const i={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))i[n]=r.map((e=>a({item:e},t,s).item));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(s?.[n]);i[n]=t?e:JSON.stringify(e)}else i[n]=t?r:JSON.stringify(r);else i[n]=r}return i}s(20572)}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5672,8528],{8528:(e,t,s)=>{s.d(t,{c:()=>i,g:()=>n});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},11004:(e,t,s)=>{s.d(t,{o:()=>n});var i=s(74452);class n{constructor(e,t){this._storage=new i.kB,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,s=1){this._storage.put(this,e,t,s,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},74452:(e,t,s)=>{s.d(t,{ML:()=>o,kB:()=>a});var i,n,r=s(24680);(n=i||(i={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=h+++":",this.size=0,this.maxSize=-1,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get storageSize(){return this._storage.size}getSize(e){return this._storage.getSize(this,e)}resetHitRate(){this._hit=this._miss=0}put(e,t,s,i=0){this._storage.put(this,e,t,s,i)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}updateSize(e,t,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new r.c,this._users=new r.c}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const s=this._db.get(e.id+t);return s?.size??0}put(e,t,s,n,r){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==s&&this._notifyRemove(t,o.entry,o.size,i.ALL)),n>this._maxSize)return void this._notifyRemove(t,s,n,i.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,s,0,i.ALL);const a=1+Math.max(r,-4)- -3;this._db.set(t,new u(s,n,a)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t,s,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===s){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,s,n,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSize()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},s=new Array;this._db.forEach(((e,i)=>{const n=e.lifetime;s[n]=(s[n]||0)+e.size,this._users.forAll((s=>{const{id:n,name:r}=s;if(i.startsWith(n)){const s=t[r]||0;t[r]=s+e.size}}))}));const i={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[s]||0;t[s]=n,i[s]=Math.round(100*e.hitRate)+"%"}else i[s]="0%"}));const n=Object.keys(t);n.sort(((e,s)=>t[s]-t[e])),n.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+i[s]));for(let t=s.length-1;t>=0;--t){const i=s[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,e.entry,e.size,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,e.size,i.ALL))),this._users.forAll((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,s,i){let n;return this._removeFuncs.some((r=>{if(e.startsWith(r[0])){const e=r[1](t,i,s);return"number"==typeof e&&(n=e),!0}return!1})),n}_checkSize(){this._users.forAll((e=>this._checkSizeLimits(e))),this._checkSizeLimits()}_checkSizeLimits(e){const t=e??this;if(t.maxSize<0||t.size<=t.maxSize)return;const s=e?.id;let i=!0;for(;i;){i=!1;for(const[n,r]of this._db)if(0===r.lifetime&&(!s||n.startsWith(s))){if(this._purgeItem(n,r,e),t.size<=.9*t.maxSize)return;i||=this._db.has(n)}}for(const[i,n]of this._db)if((!s||i.startsWith(s))&&(this._purgeItem(i,n,e),t.size<=.9*t.maxSize))return}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const n=this._notifyRemove(e,t.entry,t.size,i.SOME);null!=n&&n>0&&(this._size+=n,s&&(s.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let h=0;class u{constructor(e,t,s){this.entry=e,this.size=t,this.lifetime=s,this.lives=s}}},3024:(e,t,s)=>{s.d(t,{U:()=>o});var i=s(92400),n=s(24680),r=s(85304);class o{constructor(e=9,t){this._compareMinX=l,this._compareMinY=c,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),x.prune(),w.prune(),S.prune(),v.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(p(e,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(e,o)&&(s.leaf?t(r):g(e,o)?this._all(r,t):x.push(r))}s=x.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!p(e,t))return!1;for(x.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(p(e,r)){if(t.leaf||g(e,r))return!0;x.push(n)}}t=x.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 R([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(S.clear(),v.clear();s||S.length>0;){if(s||(s=S.pop(),n=S.data[S.length-1],r=v.pop()??0,o=!0),s.leaf&&(t=(0,i.IP)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),S.push(s),this._condense(S),this;o||s.leaf||!g(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(S.push(s),v.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(w.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else w.pushArray(s.children);s=w.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new R(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 B([]);o.height=i;const h=Math.ceil(n/r),u=h*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,h,this._compareMinY);for(let s=n;s<=t;s+=h){const n=Math.min(s+h-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=d(o),h=m(e,o)-a;h<n?(n=h,i=a<i?a:i,s=o):h===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);S.clear();const r=this._chooseSubtree(n,this._data,t,S);for(r.children.push(e),u(r,n);t>=0&&S.data[t].children.length>this._maxEntries;)this._split(S,t),t--;this._adjustParentBBoxes(n,S,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),h=s.leaf?new R(o):new B(o);h.height=s.height,a(s,this._toBBox),a(h,this._toBBox),t?e.data[t-1].children.push(h):this._splitRoot(s,h)}_splitRoot(e,t){this._data=new B([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=h(e,0,o,this._toBBox),a=h(e,o,s,this._toBBox),u=_(t,a),l=d(t)+d(a);u<i?(i=u,r=o,n=l<n?l:n):u===i&&l<n&&(n=l,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:l,n=e.leaf?this._compareMinY:c;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=h(e,0,t,n),o=h(e,s-t,s,n);let a=f(r)+f(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=f(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=f(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.IP)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){h(e,0,e.children.length,t,e)}function h(e,t,s,i,n){n||(n=new R([])),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 l(e,t){return e.minX-t.minX}function c(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function m(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 p(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 x=new n.c,w=new n.c,S=new n.c,v=new n.c({deallocator:void 0});class I{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class b extends I{constructor(){super(...arguments),this.height=1,this.indexHint=new i.is}}class R extends b{constructor(e){super(),this.children=e,this.leaf=!0}}class B extends b{constructor(e){super(),this.children=e,this.leaf=!1}}},57896:(e,t,s)=>{s.d(t,{Eq:()=>d,KG:()=>p,_8:()=>g,_I:()=>u,aE:()=>h,du:()=>_,on:()=>c}),s(40196),s(2952);var i=s(60976),n=s(38912),r=s(70680),o=s(10860),a=s(37176);function h(e,t,s={}){return l(e,t,s,f)}function u(e,t,s={}){return l(e,t,s,m)}function l(e,t,s={},i){let n=null;const o=s.once?(e,s)=>{i(e)&&((0,r.oR)(n),t(e,s))}:(e,s)=>{i(e)&&t(e,s)};if(n=(0,a.M9)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return n}function c(e,t,s,o={}){let a=null,u=null,l=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function d(e){o.once&&o.once&&(0,r.oR)(l),s(e)}const f=h(e,((e,s)=>{c(),(0,i.sh)(e)&&(a=e,u=(0,i.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return l=(0,n.uU)((()=>{f.remove(),c()})),l}function d(e,t){return function(e,t,s){if((0,o.wv)(s))return Promise.reject((0,o.Uh)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function h(){a=(0,r.oR)(a)}return new Promise(((i,r)=>{a=(0,n.Ip)([(0,o.wD)(s,(()=>{h(),r((0,o.Uh)())})),l(e,(e=>{h(),i(e)}),{sync:!1,once:!0},t??f)])}))}(e,m,t)}function f(e){return!0}function m(e){return!!e}s(41168);const _={sync:!0},g={initial:!0},p={sync:!0,initial:!0}},20480:(e,t,s)=>{s.d(t,{WW:()=>v});var i=s(6220),n=s(20744),r=s(66360),o=s(7488),a=s(48516),h=s(44048),u=s(60544),l=s(29120),c=(s(60708),s(2600)),d=s(6704),f=s(21980),m=s(28176),_=s(81976);const g=()=>r.c.getLogger("esri.geometry.support.normalizeUtils");function p(e){return"polygon"===e[0].type}function y(e){return"polyline"===e[0].type}function x(e,t,s){if(t){const t=function(e,t){if(!(e instanceof a.c||e instanceof o.c)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw g().error(e),new n.c(e)}const s=(0,h.iM)(e),i=[];for(const e of s){const s=[];i.push(s),s.push([e[0][0],e[0][1]]);for(let i=0;i<e.length-1;i++){const n=e[i][0],r=e[i][1],o=e[i+1][0],a=e[i+1][1],h=Math.sqrt((o-n)*(o-n)+(a-r)*(a-r)),u=(a-r)/h,l=(o-n)/h,c=h/t;if(c>1){for(let e=1;e<=c-1;e++){const i=e*t,o=l*i+n,a=u*i+r;s.push([o,a])}const e=(h+Math.floor(c-1)*t)/2,i=l*e+n,o=u*e+r;s.push([i,o])}s.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new o.c({rings:i,spatialReference:e.spatialReference}):new a.c({paths:i,spatialReference:e.spatialReference})}(e,1e6);e=(0,l.aq)(t,!0)}return s&&(e=(0,h.wb)(e,s)),e}function w(e,t,s){if(Array.isArray(e)){const i=e[0];if(i>t){const s=(0,h.yK)(i,t);e[0]=i+s*(-2*t)}else if(i<s){const t=(0,h.yK)(i,s);e[0]=i+t*(-2*s)}}else{const i=e.x;if(i>t){const s=(0,h.yK)(i,t);e=e.clone().offset(s*(-2*t),0)}else if(i<s){const t=(0,h.yK)(i,s);e=e.clone().offset(t*(-2*s),0)}}return e}function S(e,t){let s=-1;for(let i=0;i<t.cutIndexes.length;i++){const n=t.cutIndexes[i],r=t.geometries[i],o=(0,h.iM)(r);for(let e=0;e<o.length;e++){const t=o[e];t.some((s=>{if(s[0]<180)return!0;{let s=0;for(let e=0;e<t.length;e++){const i=t[e][0];s=i>s?i:s}s=Number(s.toFixed(9));const i=-360*(0,h.yK)(s,180);for(let s=0;s<t.length;s++){const t=r.getPoint(e,s);r.setPoint(e,s,t.clone().offset(i,0))}return!0}}))}if(n===s){if(p(e))for(const t of(0,h.iM)(r))e[n]=e[n].addRing(t);else if(y(e))for(const t of(0,h.iM)(r))e[n]=e[n].addPath(t)}else s=n,e[n]=r}return e}async function v(e,t,s){if(!Array.isArray(e))return v([e],t);t&&"string"!=typeof t&&g().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??i.default.geometryServiceUrl;let r,p,y,I,b,R,B,M,z=0;const C=[],F=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,p=(0,u.Nq)(r),y=r.isWebMercator,R=y?102100:4326,I=h.Hh[R].maxX,b=h.Hh[R].minX,B=h.Hh[R].plus180Line,M=h.Hh[R].minus180Line),p)if("mesh"===t.type)F.push(t);else if("point"===t.type)F.push(w(t.clone(),I,b));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>w(e,I,b))),F.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,p);F.push(e.rings?new o.c(e):e)}else if(t.extent){const e=t.extent,s=(0,h.yK)(e.xmin,b)*(2*I);let i=0===s?t.clone():(0,h.wb)(t.clone(),s);e.offset(s,0),e.intersects(B)&&e.xmax!==I?(z=e.xmax>z?e.xmax:z,i=x(i,y),C.push(i),F.push("cut")):e.intersects(M)&&e.xmin!==b?(z=e.xmax*(2*I)>z?e.xmax*(2*I):z,i=x(i,y,360),C.push(i),F.push("cut")):F.push(i)}else F.push(t.clone());else F.push(t);else F.push(t);let E=(0,h.yK)(z,I),T=-90;const X=E,L=new a.c;for(;E>0;){const e=360*E-180;L.addPath([[e,T],[e,-1*T]]),T*=-1,E--}if(C.length>0&&X>0){const t=S(C,await async function(e,t,s,i){const n=(0,f.UX)(e),r=t[0].spatialReference,o={...i,responseType:"json",query:{...n.query,f:"json",sr:(0,u.um)(r),target:JSON.stringify({geometryType:(0,d.Ce)(t[0]),geometries:t}),cutter:JSON.stringify(s)}},a=await(0,c.c)(n.path+"/cut",o),{cutIndexes:h,geometries:l=[]}=a.data;return{cutIndexes:h,geometries:l.map((e=>{const t=(0,d.h4)(e);return t.spatialReference=r,t}))}}(n,C,L,s)),i=[],r=[];for(let s=0;s<F.length;s++){const n=F[s];if("cut"!==n)r.push(n);else{const n=t.shift(),o=e[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(y?(0,l.w7)(n):n)}}if(!i.length)return r;const o=await async function(e,t,s){const i="string"==typeof e?(0,m.as)(e):e,n=t[0].spatialReference,r=(0,d.Ce)(t[0]),o={...s,query:{...i.query,f:"json",sr:(0,u.um)(n),geometries:JSON.stringify((0,_.y)(t))}},{data:a}=await(0,c.c)(i.path+"/simplify",o);return(0,_.Q)(a.geometries,r,n)}(n,i,s),a=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?a.push(t):a.push(y?(0,l.w7)(o.shift()):o.shift())}return a}const Y=[];for(let e=0;e<F.length;e++){const t=F[e];if("cut"!==t)Y.push(t);else{const e=C.shift();Y.push(!0===y?(0,l.w7)(e):e)}}return Y}},44048:(e,t,s)=>{s.d(t,{Hh:()=>o,iM:()=>u,wb:()=>h,yK:()=>a});var i=s(48516),n=s(56156),r=s(6704);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.c({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator}),minus180Line:new i.c({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.c.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.c({paths:[[[180,-180],[180,180]]],spatialReference:n.c.WGS84}),minus180Line:new i.c({paths:[[[-180,-180],[-180,180]]],spatialReference:n.c.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function h(e,t){const s=u(e);for(const e of s)for(const s of e)s[0]+=t;return e}function u(e){return(0,r.Cs)(e)?e.rings:e.paths}},6904:(e,t,s)=>{s.d(t,{c:()=>a});var i=s(9456),n=s(3024),r=s(83372);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.U(9,(0,i.c)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.FZ)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},9107:(e,t,s)=>{s.d(t,{c:()=>m});var i=s(92400),n=s(20744),r=s(77860),o=s(66360),a=s(77048),h=s(83372),u=s(97088),l=s(6904),c=s(83624),d=s(16736);const f=(0,a.Su)();class m{constructor(e){this.geometryInfo=e,this._boundsStore=new l.c,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.c,this.featureAdapter=d.u}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,c.C6)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.G6)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.Qv)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.C_)(null!=i?i:(0,h.Su)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.c.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.c("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.C_)((0,h.Su)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},45160:(e,t,s)=>{s.r(t),s.d(t,{default:()=>x});var i=s(40196),n=s(20744),r=s(66360),o=s(10860),a=s(69504),h=s(60544),u=s(97088),l=s(9107),c=s(7684),d=s(47302),f=s(35756),m=s(49372),_=s(44808),g=s(16424),p=s(28484);const y="esri.layers.WFSLayer";class x{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:s,getFeatureOutputFormat:i,fields:r,geometryType:a,featureType:h,maxRecordCount:u,maxTotalRecordCount:f,maxPageCount:m,objectIdField:y,customParameters:x}=e,{spatialReference:S,getFeatureSpatialReference:v}=(0,_.i4)(s,h,e.spatialReference);try{await(0,c.Qv)(v,S)}catch{throw new n.c("unsupported-projection","Projection not supported",{inSpatialReference:v,outSpatialReference:S})}(0,o.wp)(t),this._customParameters=x,this._featureType=h,this._fieldsIndex=g.c.fromLayerJSON({fields:r,dateFieldsTimeReference:r.some((e=>"esriFieldTypeDate"===e.type))?{timeZoneIANA:p.Gw}:null}),this._geometryType=a,this._getFeatureUrl=s,this._getFeatureOutputFormat=i,this._getFeatureSpatialReference=v,this._maxRecordCount=u,this._maxTotalRecordCount=f,this._maxPageCount=m,this._objectIdField=y,this._spatialReference=S;let I=await this._snapshotFeatures(t);if(I.errors.length>0&&(this._supportsPagination=!1,I=await this._snapshotFeatures(t),I.errors.length>0))throw I.errors[0];return this._queryEngine=new d.U({fieldsIndex:this._fieldsIndex,geometryType:a,hasM:!1,hasZ:!1,objectIdField:y,spatialReference:S,timeInfo:null,featureStore:new l.c({geometryType:a,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(I.features),{warnings:w(I),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new n.c("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}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){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=(0,i.kn)((e=>this._snapshotFeatures({signal:e}))),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(e.features);for(const t of w(e))r.c.getLogger(y).warn(new a.c("wfs-layer:refresh-warning",t.message,t.details));e.errors?.length&&r.c.getLogger(y).warn(new a.c("wfs-layer:refresh-error","Refresh completed with errors",{errors:e.errors}))}),(()=>{this._queryEngine.featureStore.clear()})),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,s=this._maxTotalRecordCount,i=this._maxPageCount,n=this._supportsPagination?await(0,_.gp)(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let r=[];const a=[];if(null==n)try{r=await this._singleQuery(t)}catch(e){(0,o.mA)(e)||a.push(e)}else{const e=Math.min(n,s),h=function*(e,t,s){for(let i=0;i<t;i++)yield e._pageQuery(i,s)}(this,Math.max(1,Math.min(Math.ceil(e/this._maxRecordCount),i)),t);await Promise.allSettled(Array.from({length:10}).map((()=>async function(e,t,s){let i=e.next();for(;!i.done;){try{const e=await i.value;t.push(...e)}catch(e){(0,o.mA)(e)||s.push(e)}i=e.next()}}(h,r,a))))}return(0,o.wp)(t),{features:r,totalRecordCount:n,maxTotalRecordCount:s,maxPageCount:i,errors:a}}async _singleQuery(e){const t=await(0,_.Az)(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const s=e*this._maxRecordCount,i=await(0,_.Az)(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:s,count:this._maxRecordCount,signal:t});return this._processGeoJSON(i,{startIndex:s,signal:t})}_processGeoJSON(e,t){(0,f.ii)(e,this._getFeatureSpatialReference.wkid);const{startIndex:s,signal:i}=t;(0,o.wp)(i);const n=(0,f.MN)(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!(0,h.yK)(this._spatialReference,this._getFeatureSpatialReference))for(const e of n)null!=e.geometry&&(e.geometry=(0,u.C)((0,c.yU)((0,u.qw)(e.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let r=s??1;for(const e of n){const t={};(0,m.uo)(this._fieldsIndex,t,e.attributes,!0),e.attributes=t,null==t[this._objectIdField]&&(e.objectId=t[this._objectIdField]=r++)}return n}}function w(e){const t=[];return null!=e.totalRecordCount&&(e.features.length<e.totalRecordCount&&t.push({name:"wfs-layer:maxRecordCount-too-low",message:`Could only fetch ${e.features.length} of ${e.totalRecordCount} in ${e.maxPageCount} queries. Try increasing the value of WFSLayer.maxRecordCount.`,details:{recordCount:e.features.length,totalRecordCount:e.totalRecordCount}}),e.totalRecordCount>e.maxTotalRecordCount&&t.push({name:"wfs-layer:large-dataset",message:`The number of ${e.totalRecordCount} features exceeds the maximum allowed of ${e.maxTotalRecordCount}.`,details:{recordCount:e.features.length,totalRecordCount:e.totalRecordCount,maxTotalRecordCount:e.maxTotalRecordCount}})),t}},49372:(e,t,s)=>{s.d(t,{GI:()=>l,OM:()=>_,Oo:()=>g,or:()=>h,uo:()=>d});var i=s(39180),n=s(60544),r=s(564);class o{constructor(){this.code=null,this.description=null}}class a{constructor(e){this.error=new o,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}}function h(e){return new a(e)}class u{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function l(e){return new u(e)}const c=new Set;function d(e,t,s,i=!1){c.clear();for(const n in s){const o=e.get(n);if(!o)continue;const a=f(o,s[n]);if(c.add(o.name),o&&(i||o.editable)){const e=(0,r.YT)(o,a);if(e)return h((0,r.Ke)(e,o,a));t[o.name]=a}}for(const t of e?.requiredFields??[])if(!c.has(t.name))return h(`missing required field "${t.name}"`);return null}function f(e,t){let s=t;return(0,r.iW)(e)&&"string"==typeof t?s=parseFloat(t):(0,r.AZ)(e)&&null!=t&&"string"!=typeof t?s=String(t):(0,r.gp)(e)&&"string"==typeof t&&(s=(0,i.sn)(t)),(0,r.OJ)(s)}let m;function _(e,t){if(!e||!(0,n.U3)(t))return e;if("rings"in e||"paths"in e){if(null==m)throw new TypeError("geometry engine not loaded");return m.simplify(t,e)}return e}async function g(e,t){!(0,n.U3)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==m&&(m=await Promise.all([s.e(984),s.e(2704)]).then(s.bind(s,82704))),m}()}},48212:(e,t,s)=>{s.d(t,{Ab:()=>x,Ej:()=>d,K0:()=>c,M9:()=>f,Wq:()=>_,YB:()=>l,_2:()=>p,oR:()=>g,q_:()=>m,wn:()=>y});var i=s(28176),n=s(91952);const r={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer"},o=Object.values(r),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),h=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function l(e){return!!a.test(e)}function c(e){if(null==e)return null;const t=(0,i.as)(e),s=t?.path.match(a)||t?.path.match(h);if(!s)return null;const[,n,o,u,l]=s,c=o.indexOf("/");return{title:f(-1!==c?o.slice(c+1):o),serverType:r[u.toLowerCase()],sublayer:null!=l&&""!==l?parseInt(l,10):null,url:{path:n}}}function d(e){const t=(0,i.as)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function f(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function m(e,t){const s=[];if(e){const t=c(e);null!=t&&t.title&&s.push(t.title)}if(t){const e=f(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.ai)((0,i.kN)(e,t)):e}function p(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.kN)(t,e.logger);const s=(0,i.as)(t),n=c(s.path);let r;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(r=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=d(s.path);null!=e&&(t=e.serviceUrl,r=e.sublayerId)}return{url:(0,i.ai)(t),layerId:r}}function y(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.kn)(r.url,s,e.layerId.toString()))}function x(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)}},81976:(e,t,s)=>{s.d(t,{Q:()=>r,y:()=>n});var i=s(6704);function n(e){return{geometryType:(0,i.Ce)(e[0]),geometries:e.map((e=>e.toJSON()))}}function r(e,t,s){const n=(0,i.uG)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=s,t}))}},21980:(e,t,s)=>{s.d(t,{OW:()=>a,UX:()=>o,sR:()=>r}),s(6220),s(47620);var i=s(62088),n=s(28176);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function o(e){return"string"==typeof e?(0,n.as)(e):(0,i.ct)(e)}function a(e,t,s){const i={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))i[n]=r.map((e=>a({item:e},t,s).item));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(s?.[n]);i[n]=t?e:JSON.stringify(e)}else i[n]=t?r:JSON.stringify(r);else i[n]=r}return i}s(20572)}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8828,2259],{3615:(e,a,r)=>{r.d(a,{q:()=>n});var t=r(66668);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const r=this._serviceMetadatas.get(e);if(r)return r;const n=await(0,t.S)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const t=await e.fetchData();return r.set(a,t),t}async fetchCustomParameters(e,a){const r=await this.fetchItemData(e);return r&&"object"==typeof r&&(a?a(r):r.customParameters)||null}}},50420:(e,a,r)=>{r.d(a,{S:()=>o});var t=r(47620),n=r(2600),i=r(20744),s=r(10860),l=r(48212),c=r(54872),y=r(9764);async function o(e,a){const r=(0,l.K0)(e);if(!r)throw new i.c("invalid-url","Invalid scene service url");const o={...a,sceneServerUrl:r.url.path,layerId:r.sublayer??void 0};if(o.sceneLayerItem??=await async function(e){const a=(await u(e)).serviceItemId;if(!a)return null;const r=new y.default({id:a,apiKey:e.apiKey}),i=await async function(e){const a=t.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const r=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.c)(r,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,s.CE)(e)}return null}(e);null!=i&&(r.portal=new c.c({url:i}));try{return r.load({signal:e.signal})}catch(e){return(0,s.CE)(e),null}}(o),null==o.sceneLayerItem)return d(o.sceneServerUrl.replace("/SceneServer","/FeatureServer"),o);const L=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const r=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!r)return null;const t=new y.default({portal:r.portal,id:r.id});return await t.load(),t}catch(e){return(0,s.CE)(e),null}}(o);if(!L?.url)throw new i.c("related-service-not-found","Could not find feature service through portal item relationship");o.featureServiceItem=L;const m=await d(L.url,o);return m.portalItem=L,m}async function u(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const r=await(0,n.c)(e.sceneServerUrl,a);e.rootDocument=r.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const r=(0,l.K0)(e);if(!r)throw new i.c("invalid-feature-service-url","Invalid feature service url");const t=r.url.path,s=a.layerId;if(null==s)return{serverUrl:t};const c=u(a),y=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,o=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=e=>{const r={query:{f:"json",...o},responseType:"json",authMode:e,signal:a.signal};return(0,n.c)(t,r)},L=d("anonymous").catch((()=>d("no-prompt"))),[m,f]=await Promise.all([L,c]),p=f?.layers,S=m.data&&m.data.layers;if(!Array.isArray(S))throw new Error("expected layers array");if(Array.isArray(p)){for(let e=0;e<Math.min(p.length,S.length);e++)if(p[e].id===s)return{serverUrl:t,layerId:S[e].id}}else if(null!=s&&s<S.length)return{serverUrl:t,layerId:S[s].id};throw new Error("could not find matching associated sublayer")}},58828:(e,a,r)=>{r.d(a,{e:()=>T,populateOperationalLayers:()=>o});var t=r(2952),n=(r(9456),r(3615)),i=r(83928),s=r(9764);function l(e,a){return!(!e.layerType||"ArcGISFeatureLayer"!==e.layerType)&&e.featureCollectionType===a}var c=r(12259),y=r(97824);async function o(e,a,r){if(!a)return;const t=a.map((e=>async function(e,a){return async function(e,a,r){const t=new e;return t.read(a,r.context),"group"===t.type&&("GroupLayer"===a.layerType?await T(t,a,r):v(a)?function(e,a,r){a.itemId&&(e.portalItem=new s.default({id:a.itemId,portal:r?.portal}),e.when((()=>{const t=t=>{const n=t.layerId;G(t,e,a,n,r);const i=a.featureCollection?.layers?.[n];i&&t.read(i,r)};e.layers?.forEach(t),e.tables?.forEach(t)})))}(t,a,r.context):b(a)&&await async function(e,a,r){const t=i.q.FeatureLayer,n=await t(),s=a.featureCollection,l=s?.showLegend,c=s?.layers?.map(((t,i)=>{const s=new n;s.read(t,r);const c={...r,ignoreDefaults:!0};return G(s,e,a,i,c),null!=l&&s.read({showLegend:l},c),s}));e.layers.addMany(c??[])}(t,a,r.context)),await(0,y.M)(t,r.context),t}(await g(e,a),e,a)}(e,r))),n=await Promise.allSettled(t);for(const a of n)"rejected"===a.status||a.value&&e.add(a.value)}const u={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},d={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},L={ArcGISFeatureLayer:"FeatureLayer"},m={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},f={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"UnsupportedLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},p={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},S={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},w={...f,LinkChartLayer:"LinkChartLayer"},h={...p},I={...S};async function g(e,a){const r=a.context,t=M(r);let y=e.layerType||e.type;!y&&a?.defaultLayerType&&(y=a.defaultLayerType);const o=t[y];let u=o?i.q[o]:i.q.UnknownLayer;if(v(e)){const a=r?.portal;if(e.itemId){const r=new s.default({id:e.itemId,portal:a});await r.load();const t=(await(0,c.q)(r,new n.q)).className||"UnknownLayer";u=i.q[t]}}else"ArcGISFeatureLayer"===y?function(e){return l(e,"notes")}(e)||function(e){return l(e,"markup")}(e)?u=i.q.MapNotesLayer:function(e){return l(e,"route")}(e)?u=i.q.RouteLayer:b(e)&&(u=i.q.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?u=i.q.WMTSLayer:"WFS"===y&&"2.0.0"!==e.wfsInfo?.version&&(u=i.q.UnsupportedLayer);return u()}function b(e){return"ArcGISFeatureLayer"===e.layerType&&!v(e)&&(e.featureCollection?.layers?.length??0)>1}function v(e){return"Feature Collection"===e.type}function M(e){let a;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":a=m;break;case"ground":a=d;break;case"tables":a=L;break;default:a=u}break;case"link-chart":switch(e.layerContainerType){case"basemap":a=I;break;case"tables":a=h;break;default:a=w}break;default:switch(e.layerContainerType){case"basemap":a=S;break;case"tables":a=p;break;default:a=f}}return a}async function T(e,a,r){const n=new t.c,i=o(n,Array.isArray(a.layers)?a.layers:[],r);try{try{if(await i,"group"===e.type)return e.layers.addMany(n),e}catch(a){e.destroy();for(const e of n)e.destroy();throw a}}catch(e){throw e}}function G(e,a,r,t,n){e.read({id:`${a.id}-sublayer-${t}`,visibility:r.visibleLayers?.includes(t)??!0},n)}},83928:(e,a,r)=>{r.d(a,{q:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3912)]).then(r.bind(r,48388))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(3180),r.e(9644),r.e(8344),r.e(9420),r.e(8644),r.e(5928)]).then(r.bind(r,10948))).default,CatalogLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2664),r.e(2848),r.e(5468),r.e(572),r.e(2907)]).then(r.bind(r,20324))).default,CSVLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(1744)]).then(r.bind(r,79468))).default,DimensionLayer:async()=>(await Promise.all([r.e(5612),r.e(7832)]).then(r.bind(r,28320))).default,ElevationLayer:async()=>(await Promise.all([r.e(5612),r.e(2968),r.e(8380)]).then(r.bind(r,47104))).default,FeatureLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(8348)]).then(r.bind(r,672))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(6528)]).then(r.bind(r,92768))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(7988),r.e(7148),r.e(2672)]).then(r.bind(r,43984))).default,GroupLayer:async()=>(await Promise.all([r.e(5612),r.e(7456)]).then(r.bind(r,44080))).default,ImageryLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(2848),r.e(6128),r.e(9056),r.e(3291)]).then(r.bind(r,7896))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(6128),r.e(7048),r.e(9056),r.e(5496)]).then(r.bind(r,82744))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(5612),r.e(9644),r.e(7024)]).then(r.bind(r,96584))).default,KMLLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(236),r.e(9032)]).then(r.bind(r,53688))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(5612),r.e(3536)]).then(r.bind(r,91884))).default,LinkChartLayer:async()=>(await Promise.all([r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(9512),r.e(3220),r.e(1512),r.e(6680),r.e(8080)]).then(r.bind(r,54192))).default,MapImageLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2848),r.e(5468),r.e(1248),r.e(3089)]).then(r.bind(r,3089))).default,MapNotesLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(9516)]).then(r.bind(r,37784))).default,MediaLayer:async()=>(await Promise.all([r.e(5612),r.e(2364)]).then(r.bind(r,66664))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(3160),r.e(8224)]).then(r.bind(r,56288))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632),r.e(1244)]).then(r.bind(r,1244))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(1740)]).then(r.bind(r,75432))).default,PointCloudLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(9644),r.e(2296)]).then(r.bind(r,21680))).default,RouteLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(236),r.e(6352)]).then(r.bind(r,40900))).default,SceneLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(8624),r.e(3180),r.e(9644),r.e(8344),r.e(9420),r.e(7424),r.e(9780),r.e(8644),r.e(712)]).then(r.bind(r,3688))).default,StreamLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(3460)]).then(r.bind(r,18e3))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2664),r.e(6556),r.e(5368),r.e(2608)]).then(r.bind(r,8444))).default,TileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2848),r.e(5468),r.e(2968),r.e(1248),r.e(0)]).then(r.bind(r,5e4))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([r.e(5612),r.e(7752)]).then(r.bind(r,71316))).default,UnknownLayer:async()=>(await r.e(6584).then(r.bind(r,56584))).default,UnsupportedLayer:async()=>(await r.e(2456).then(r.bind(r,12456))).default,VectorTileLayer:async()=>(await Promise.all([r.e(5612),r.e(2968),r.e(3780),r.e(6055),r.e(7936)]).then(r.bind(r,65632))).default,VoxelLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(9644),r.e(8256)]).then(r.bind(r,59496))).default,WFSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(4808),r.e(3688)]).then(r.bind(r,53440))).default,WMSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(280)]).then(r.bind(r,85024))).default,WMTSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632),r.e(4832)]).then(r.bind(r,54832))).default,WebTileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632)]).then(r.bind(r,32896))).default}},67632:(e,a,r)=>{r.d(a,{AX:()=>l,Ur:()=>u,cr:()=>s,eW:()=>i,k1:()=>y,mg:()=>c,oD:()=>d,qi:()=>n,wp:()=>o});var t=r(50420);function n(e){const a={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(a.layerType="OrientedImageryLayer"),a}async function i(e,a,r){if(null==e?.layers||null==e?.tables){const t=await r.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||t?.layers?.map(n),e.tables=e.tables||t?.tables?.map(n)}return e}function s(e){const{layers:a,tables:r}=e;return a?.length?a[0].id:r?.length?r[0].id:null}function l(e){if(!e)return null;const{layers:a,tables:r}=e;return a?.length?a[0]:r?.length?r[0]:null}function c(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function y(e){const a=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&a.push(e.id)})),a}function o(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}function u(e){return e?.layers?.filter((({layerType:e})=>"CatalogLayer"===e)).map((({id:e})=>e))}async function d(e,a,r){if(!e?.url)return a??{};if(a??={},!a.layers){const t=await r.fetchServiceMetadata(e.url);a.layers=t.layers?.map(n)}const{serverUrl:i,portalItem:s}=await(0,t.S)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==i)return a.tables=[],a;if(!a.tables&&s){const e=await s.fetchData();if(e?.tables)a.tables=e.tables.map(n);else{const t=await r.fetchServiceMetadata(i,{customParameters:l(e)?.customParameters});a.tables=t?.tables?.map(n)}}if(a.tables)for(const e of a.tables)e.url=`${i}/${e.id}`;return a}},12259:(e,a,r)=>{r.d(a,{fromItem:()=>u,q:()=>d});var t=r(20744),n=r(50420),i=r(3615),s=r(71068),l=r(83928),c=r(9764),y=r(67632),o=r(46940);async function u(e){!e.portalItem||e.portalItem instanceof c.default||(e={...e,portalItem:new c.default(e.portalItem)});const a=await async function(e){await e.load();const a=new i.q;return async function(e){const a=e.className,r=l.q[a];return{constructor:await r(),properties:e.properties}}(await d(e,a))}(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function d(e,a){switch(e.type){case"3DTiles Service":return{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,o._S)(e,"Map Notes"),r=(0,o._S)(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if((0,o._S)(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===(0,y.mg)(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const r=await L(e,a);if("object"==typeof r){const{sourceJSON:e,className:a}=r,t={sourceJSON:e};return null!=r.id&&(t.layerId=r.id),{className:a||"FeatureLayer",properties:t}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await a.fetchItemData(e),n=t?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const i=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),s=i.cacheType?.toLowerCase(),l=i.capabilities?.toLowerCase().includes("tilesonly");return"map"===s||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:r}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return r}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const r=await L(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:r}=await(0,n.S)(e.url,{sceneLayerItem:e}),t=await a.fetchServiceMetadata(r);return t?.tables??[]}catch{return[]}}));if("object"==typeof r){const t={};let n;if(null!=r.id?(t.layerId=r.id,n=`${e.url}/layers/${r.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(s.Wr))if(e.typeKeywords.includes(a))return{className:s.Wr[a]};const i=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,y.AX)(e)?.customParameters))});return{className:s.Wr[i?.layerType]||"SceneLayer",properties:t}}if(!1===r){const r=await a.fetchServiceMetadata(e.url);if("Voxel"===r?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new t.c("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function L(e,a,r){const{url:t,type:n}=e,i="Feature Service"===n;if(!t)return{};if(/\/\d+$/.test(t)){if(i){const r=await a.fetchServiceMetadata(t,{customParameters:await a.fetchCustomParameters(e,(e=>(0,y.AX)(e)?.customParameters))});if("Oriented Imagery Layer"===r.type)return{id:r.id,className:"OrientedImageryLayer",sourceJSON:r}}return{}}await e.load();let s=await a.fetchItemData(e);if(i){const e=await(0,y.eW)(s,t,a),r=m(e);if("object"==typeof r){const a=(0,y.k1)(e),t=(0,y.wp)(e),n=(0,y.Ur)(e);r.className=null!=r.id&&a.includes(r.id)?"SubtypeGroupLayer":null!=r.id&&t?.includes(r.id)?"OrientedImageryLayer":null!=r.id&&n?.includes(r.id)?"CatalogLayer":"FeatureLayer"}return r}if("Scene Service"===n&&(s=await(0,y.oD)(e,s,a)),(0,y.mg)(s)>0)return m(s);const l=await a.fetchServiceMetadata(t);return r&&(l.tables=await r()),m(l)}function m(e){return 1===(0,y.mg)(e)&&{id:(0,y.cr)(e)}}},97824:(e,a,r)=>{r.d(a,{M:()=>s});var t=r(40196),n=r(10860),i=r(69504);async function s(e,a,r){const s=e&&e.getAtOrigin&&e.getAtOrigin("renderer",a.origin);if(s&&"unique-value"===s.type&&s.styleOrigin){const l=await(0,t.aG)(s.populateFromStyle());if((0,n.wp)(r),!1===l.ok){const r=l.error;a?.messages&&a.messages.push(new i.c("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:a})),e.clear("renderer",a?.origin)}}}},66668:(e,a,r)=>{r.d(a,{S:()=>n});var t=r(2600);async function n(e,a){const{data:r}=await(0,t.c)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return r}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8828,2259],{3615:(e,a,r)=>{r.d(a,{q:()=>n});var t=r(66668);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const r=this._serviceMetadatas.get(e);if(r)return r;const n=await(0,t.S)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const t=await e.fetchData();return r.set(a,t),t}async fetchCustomParameters(e,a){const r=await this.fetchItemData(e);return r&&"object"==typeof r&&(a?a(r):r.customParameters)||null}}},50420:(e,a,r)=>{r.d(a,{S:()=>o});var t=r(47620),n=r(2600),i=r(20744),s=r(10860),l=r(48212),c=r(54872),y=r(9764);async function o(e,a){const r=(0,l.K0)(e);if(!r)throw new i.c("invalid-url","Invalid scene service url");const o={...a,sceneServerUrl:r.url.path,layerId:r.sublayer??void 0};if(o.sceneLayerItem??=await async function(e){const a=(await u(e)).serviceItemId;if(!a)return null;const r=new y.default({id:a,apiKey:e.apiKey}),i=await async function(e){const a=t.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const r=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.c)(r,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,s.CE)(e)}return null}(e);null!=i&&(r.portal=new c.c({url:i}));try{return r.load({signal:e.signal})}catch(e){return(0,s.CE)(e),null}}(o),null==o.sceneLayerItem)return d(o.sceneServerUrl.replace("/SceneServer","/FeatureServer"),o);const L=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const r=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!r)return null;const t=new y.default({portal:r.portal,id:r.id});return await t.load(),t}catch(e){return(0,s.CE)(e),null}}(o);if(!L?.url)throw new i.c("related-service-not-found","Could not find feature service through portal item relationship");o.featureServiceItem=L;const m=await d(L.url,o);return m.portalItem=L,m}async function u(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const r=await(0,n.c)(e.sceneServerUrl,a);e.rootDocument=r.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const r=(0,l.K0)(e);if(!r)throw new i.c("invalid-feature-service-url","Invalid feature service url");const t=r.url.path,s=a.layerId;if(null==s)return{serverUrl:t};const c=u(a),y=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,o=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=e=>{const r={query:{f:"json",...o},responseType:"json",authMode:e,signal:a.signal};return(0,n.c)(t,r)},L=d("anonymous").catch((()=>d("no-prompt"))),[m,f]=await Promise.all([L,c]),p=f?.layers,S=m.data&&m.data.layers;if(!Array.isArray(S))throw new Error("expected layers array");if(Array.isArray(p)){for(let e=0;e<Math.min(p.length,S.length);e++)if(p[e].id===s)return{serverUrl:t,layerId:S[e].id}}else if(null!=s&&s<S.length)return{serverUrl:t,layerId:S[s].id};throw new Error("could not find matching associated sublayer")}},58828:(e,a,r)=>{r.d(a,{e:()=>T,populateOperationalLayers:()=>o});var t=r(2952),n=(r(9456),r(3615)),i=r(83928),s=r(9764);function l(e,a){return!(!e.layerType||"ArcGISFeatureLayer"!==e.layerType)&&e.featureCollectionType===a}var c=r(12259),y=r(97824);async function o(e,a,r){if(!a)return;const t=a.map((e=>async function(e,a){return async function(e,a,r){const t=new e;return t.read(a,r.context),"group"===t.type&&("GroupLayer"===a.layerType?await T(t,a,r):v(a)?function(e,a,r){a.itemId&&(e.portalItem=new s.default({id:a.itemId,portal:r?.portal}),e.when((()=>{const t=t=>{const n=t.layerId;G(t,e,a,n,r);const i=a.featureCollection?.layers?.[n];i&&t.read(i,r)};e.layers?.forEach(t),e.tables?.forEach(t)})))}(t,a,r.context):b(a)&&await async function(e,a,r){const t=i.q.FeatureLayer,n=await t(),s=a.featureCollection,l=s?.showLegend,c=s?.layers?.map(((t,i)=>{const s=new n;s.read(t,r);const c={...r,ignoreDefaults:!0};return G(s,e,a,i,c),null!=l&&s.read({showLegend:l},c),s}));e.layers.addMany(c??[])}(t,a,r.context)),await(0,y.M)(t,r.context),t}(await g(e,a),e,a)}(e,r))),n=await Promise.allSettled(t);for(const a of n)"rejected"===a.status||a.value&&e.add(a.value)}const u={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},d={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},L={ArcGISFeatureLayer:"FeatureLayer"},m={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},f={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"UnsupportedLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},p={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},S={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},w={...f,LinkChartLayer:"LinkChartLayer"},h={...p},I={...S};async function g(e,a){const r=a.context,t=M(r);let y=e.layerType||e.type;!y&&a?.defaultLayerType&&(y=a.defaultLayerType);const o=t[y];let u=o?i.q[o]:i.q.UnknownLayer;if(v(e)){const a=r?.portal;if(e.itemId){const r=new s.default({id:e.itemId,portal:a});await r.load();const t=(await(0,c.q)(r,new n.q)).className||"UnknownLayer";u=i.q[t]}}else"ArcGISFeatureLayer"===y?function(e){return l(e,"notes")}(e)||function(e){return l(e,"markup")}(e)?u=i.q.MapNotesLayer:function(e){return l(e,"route")}(e)?u=i.q.RouteLayer:b(e)&&(u=i.q.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?u=i.q.WMTSLayer:"WFS"===y&&"2.0.0"!==e.wfsInfo?.version&&(u=i.q.UnsupportedLayer);return u()}function b(e){return"ArcGISFeatureLayer"===e.layerType&&!v(e)&&(e.featureCollection?.layers?.length??0)>1}function v(e){return"Feature Collection"===e.type}function M(e){let a;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":a=m;break;case"ground":a=d;break;case"tables":a=L;break;default:a=u}break;case"link-chart":switch(e.layerContainerType){case"basemap":a=I;break;case"tables":a=h;break;default:a=w}break;default:switch(e.layerContainerType){case"basemap":a=S;break;case"tables":a=p;break;default:a=f}}return a}async function T(e,a,r){const n=new t.c,i=o(n,Array.isArray(a.layers)?a.layers:[],r);try{try{if(await i,"group"===e.type)return e.layers.addMany(n),e}catch(a){e.destroy();for(const e of n)e.destroy();throw a}}catch(e){throw e}}function G(e,a,r,t,n){e.read({id:`${a.id}-sublayer-${t}`,visibility:r.visibleLayers?.includes(t)??!0},n)}},83928:(e,a,r)=>{r.d(a,{q:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3912)]).then(r.bind(r,48388))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(3180),r.e(9644),r.e(8344),r.e(9420),r.e(8644),r.e(5928)]).then(r.bind(r,10948))).default,CatalogLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2664),r.e(2848),r.e(5468),r.e(572),r.e(2907)]).then(r.bind(r,20324))).default,CSVLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(1744)]).then(r.bind(r,79468))).default,DimensionLayer:async()=>(await Promise.all([r.e(5612),r.e(7832)]).then(r.bind(r,28320))).default,ElevationLayer:async()=>(await Promise.all([r.e(5612),r.e(2968),r.e(8380)]).then(r.bind(r,47104))).default,FeatureLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(8348)]).then(r.bind(r,672))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(6528)]).then(r.bind(r,92768))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(7988),r.e(7148),r.e(2672)]).then(r.bind(r,43984))).default,GroupLayer:async()=>(await Promise.all([r.e(5612),r.e(7456)]).then(r.bind(r,44080))).default,ImageryLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(2848),r.e(6128),r.e(9056),r.e(3291)]).then(r.bind(r,7896))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(6128),r.e(7048),r.e(9056),r.e(5496)]).then(r.bind(r,82744))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(5612),r.e(9644),r.e(7024)]).then(r.bind(r,96584))).default,KMLLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(236),r.e(9032)]).then(r.bind(r,53688))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(5612),r.e(3536)]).then(r.bind(r,91884))).default,LinkChartLayer:async()=>(await Promise.all([r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(9512),r.e(3220),r.e(4608),r.e(6680),r.e(8080)]).then(r.bind(r,54192))).default,MapImageLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2848),r.e(5468),r.e(1248),r.e(3089)]).then(r.bind(r,3089))).default,MapNotesLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(9516)]).then(r.bind(r,37784))).default,MediaLayer:async()=>(await Promise.all([r.e(5612),r.e(2364)]).then(r.bind(r,66664))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(3160),r.e(8224)]).then(r.bind(r,56288))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632),r.e(1244)]).then(r.bind(r,1244))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(2664),r.e(6556),r.e(672),r.e(1740)]).then(r.bind(r,75432))).default,PointCloudLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(9644),r.e(2296)]).then(r.bind(r,21680))).default,RouteLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(236),r.e(6352)]).then(r.bind(r,40900))).default,SceneLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(8624),r.e(3180),r.e(9644),r.e(8344),r.e(9420),r.e(7424),r.e(9780),r.e(8644),r.e(712)]).then(r.bind(r,3688))).default,StreamLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(3460)]).then(r.bind(r,18e3))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2664),r.e(6556),r.e(5368),r.e(2608)]).then(r.bind(r,8444))).default,TileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(2848),r.e(5468),r.e(2968),r.e(1248),r.e(0)]).then(r.bind(r,5e4))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([r.e(5612),r.e(7752)]).then(r.bind(r,71316))).default,UnknownLayer:async()=>(await r.e(6584).then(r.bind(r,56584))).default,UnsupportedLayer:async()=>(await r.e(2456).then(r.bind(r,12456))).default,VectorTileLayer:async()=>(await Promise.all([r.e(5612),r.e(2968),r.e(3780),r.e(6055),r.e(7936)]).then(r.bind(r,65632))).default,VoxelLayer:async()=>(await Promise.all([r.e(5612),r.e(2692),r.e(9644),r.e(8256)]).then(r.bind(r,59496))).default,WFSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(9364),r.e(4984),r.e(5776),r.e(236),r.e(8976),r.e(9512),r.e(4808),r.e(3688)]).then(r.bind(r,53440))).default,WMSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(2692),r.e(7988),r.e(7148),r.e(280)]).then(r.bind(r,85024))).default,WMTSLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632),r.e(4832)]).then(r.bind(r,54832))).default,WebTileLayer:async()=>(await Promise.all([r.e(5612),r.e(5156),r.e(3632)]).then(r.bind(r,32896))).default}},67632:(e,a,r)=>{r.d(a,{AX:()=>l,Ur:()=>u,cr:()=>s,eW:()=>i,k1:()=>y,mg:()=>c,oD:()=>d,qi:()=>n,wp:()=>o});var t=r(50420);function n(e){const a={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(a.layerType="OrientedImageryLayer"),a}async function i(e,a,r){if(null==e?.layers||null==e?.tables){const t=await r.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||t?.layers?.map(n),e.tables=e.tables||t?.tables?.map(n)}return e}function s(e){const{layers:a,tables:r}=e;return a?.length?a[0].id:r?.length?r[0].id:null}function l(e){if(!e)return null;const{layers:a,tables:r}=e;return a?.length?a[0]:r?.length?r[0]:null}function c(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function y(e){const a=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&a.push(e.id)})),a}function o(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}function u(e){return e?.layers?.filter((({layerType:e})=>"CatalogLayer"===e)).map((({id:e})=>e))}async function d(e,a,r){if(!e?.url)return a??{};if(a??={},!a.layers){const t=await r.fetchServiceMetadata(e.url);a.layers=t.layers?.map(n)}const{serverUrl:i,portalItem:s}=await(0,t.S)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==i)return a.tables=[],a;if(!a.tables&&s){const e=await s.fetchData();if(e?.tables)a.tables=e.tables.map(n);else{const t=await r.fetchServiceMetadata(i,{customParameters:l(e)?.customParameters});a.tables=t?.tables?.map(n)}}if(a.tables)for(const e of a.tables)e.url=`${i}/${e.id}`;return a}},12259:(e,a,r)=>{r.d(a,{fromItem:()=>u,q:()=>d});var t=r(20744),n=r(50420),i=r(3615),s=r(71068),l=r(83928),c=r(9764),y=r(67632),o=r(46940);async function u(e){!e.portalItem||e.portalItem instanceof c.default||(e={...e,portalItem:new c.default(e.portalItem)});const a=await async function(e){await e.load();const a=new i.q;return async function(e){const a=e.className,r=l.q[a];return{constructor:await r(),properties:e.properties}}(await d(e,a))}(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function d(e,a){switch(e.type){case"3DTiles Service":return{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,o._S)(e,"Map Notes"),r=(0,o._S)(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if((0,o._S)(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===(0,y.mg)(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const r=await L(e,a);if("object"==typeof r){const{sourceJSON:e,className:a}=r,t={sourceJSON:e};return null!=r.id&&(t.layerId=r.id),{className:a||"FeatureLayer",properties:t}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await a.fetchItemData(e),n=t?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const i=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),s=i.cacheType?.toLowerCase(),l=i.capabilities?.toLowerCase().includes("tilesonly");return"map"===s||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:r}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return r}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const r=await L(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:r}=await(0,n.S)(e.url,{sceneLayerItem:e}),t=await a.fetchServiceMetadata(r);return t?.tables??[]}catch{return[]}}));if("object"==typeof r){const t={};let n;if(null!=r.id?(t.layerId=r.id,n=`${e.url}/layers/${r.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(s.Wr))if(e.typeKeywords.includes(a))return{className:s.Wr[a]};const i=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,y.AX)(e)?.customParameters))});return{className:s.Wr[i?.layerType]||"SceneLayer",properties:t}}if(!1===r){const r=await a.fetchServiceMetadata(e.url);if("Voxel"===r?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new t.c("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function L(e,a,r){const{url:t,type:n}=e,i="Feature Service"===n;if(!t)return{};if(/\/\d+$/.test(t)){if(i){const r=await a.fetchServiceMetadata(t,{customParameters:await a.fetchCustomParameters(e,(e=>(0,y.AX)(e)?.customParameters))});if("Oriented Imagery Layer"===r.type)return{id:r.id,className:"OrientedImageryLayer",sourceJSON:r}}return{}}await e.load();let s=await a.fetchItemData(e);if(i){const e=await(0,y.eW)(s,t,a),r=m(e);if("object"==typeof r){const a=(0,y.k1)(e),t=(0,y.wp)(e),n=(0,y.Ur)(e);r.className=null!=r.id&&a.includes(r.id)?"SubtypeGroupLayer":null!=r.id&&t?.includes(r.id)?"OrientedImageryLayer":null!=r.id&&n?.includes(r.id)?"CatalogLayer":"FeatureLayer"}return r}if("Scene Service"===n&&(s=await(0,y.oD)(e,s,a)),(0,y.mg)(s)>0)return m(s);const l=await a.fetchServiceMetadata(t);return r&&(l.tables=await r()),m(l)}function m(e){return 1===(0,y.mg)(e)&&{id:(0,y.cr)(e)}}},97824:(e,a,r)=>{r.d(a,{M:()=>s});var t=r(40196),n=r(10860),i=r(69504);async function s(e,a,r){const s=e&&e.getAtOrigin&&e.getAtOrigin("renderer",a.origin);if(s&&"unique-value"===s.type&&s.styleOrigin){const l=await(0,t.aG)(s.populateFromStyle());if((0,n.wp)(r),!1===l.ok){const r=l.error;a?.messages&&a.messages.push(new i.c("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:a})),e.clear("renderer",a?.origin)}}}},66668:(e,a,r)=>{r.d(a,{S:()=>n});var t=r(2600);async function n(e,a){const{data:r}=await(0,t.c)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return r}}}]);
|
package/interfaces.d.ts
CHANGED
|
@@ -15623,19 +15623,19 @@ declare namespace __esri {
|
|
|
15623
15623
|
*
|
|
15624
15624
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#addRecords)
|
|
15625
15625
|
*/
|
|
15626
|
-
|
|
15626
|
+
addRecords(records: IdTypePair[]): Promise<void>;
|
|
15627
15627
|
/**
|
|
15628
15628
|
* Assumes that data for all of the members defined in the inclusionModeDefinition is already loaded into local storage.
|
|
15629
15629
|
*
|
|
15630
15630
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#loadLayerAssumingLocalCache)
|
|
15631
15631
|
*/
|
|
15632
|
-
|
|
15632
|
+
loadLayerAssumingLocalCache(): void;
|
|
15633
15633
|
/**
|
|
15634
15634
|
* Removes entities or relationships from the knowledge graph layer.
|
|
15635
15635
|
*
|
|
15636
15636
|
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#removeRecords)
|
|
15637
15637
|
*/
|
|
15638
|
-
|
|
15638
|
+
removeRecords(records: IdTypePair[]): Promise<IdTypePair[]>;
|
|
15639
15639
|
}
|
|
15640
15640
|
|
|
15641
15641
|
interface KnowledgeGraphLayerProperties extends LayerProperties {
|
package/kernel.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.29";let t,i=r;i="4.29.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.29";let t,i=r;i="4.29.9";function n(o){t=o}function m(s){const e=t?.findCredential(s);return e?.token?o(s,"token",e.token):s}has("host-webworker");export{m as addTokenParameter,s as buildDate,i as fullVersion,t as id,e as revision,n as setId,r as version};
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const c="20240320",a="c72966ca3c6dfcf112e49506485a47a1b3562602";export{c as buildDate,a as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/CollectionFlattener.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../rest/support/DirectionLine.js";import l from"../../../rest/support/DirectionPoint.js";import c from"../../../rest/support/PointBarrier.js";import g from"../../../rest/support/PolygonBarrier.js";import d from"../../../rest/support/PolylineBarrier.js";import u from"../../../rest/support/RouteInfo.js";import _ from"../../../rest/support/Stop.js";import{getHighlightBits as m}from"../engine/highlightReasons.js";import{LayerView2DMixin as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{isSome as e}from"../../../core/arrayUtils.js";import r from"../../../core/Collection.js";import i from"../../../core/CollectionFlattener.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../rest/support/DirectionLine.js";import l from"../../../rest/support/DirectionPoint.js";import c from"../../../rest/support/PointBarrier.js";import g from"../../../rest/support/PolygonBarrier.js";import d from"../../../rest/support/PolylineBarrier.js";import u from"../../../rest/support/RouteInfo.js";import _ from"../../../rest/support/Stop.js";import{getHighlightBits as m}from"../engine/highlightReasons.js";import{LayerView2DMixin as f}from"./LayerView2D.js";import w from"./graphics/GraphicContainer.js";import y from"./graphics/GraphicsView2D.js";import k from"../../layers/LayerView.js";const j=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],M={graphic:null,property:null,oldValue:null,newValue:null};function V(t){return t instanceof p||t instanceof l||t instanceof c||t instanceof g||t instanceof d||t instanceof u||t instanceof _}function v(t){return r.isCollection(t)&&t.length&&V(t.at(0))}function G(t){return Array.isArray(t)&&t.length>0&&V(t[0])}let I=class extends(f(k)){constructor(){super(...arguments),this._graphics=new r,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new i({getCollections:()=>null==this.layer||this.destroyed?[]:[null!=this.layer.routeInfo?new r([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange((()=>this._routeItems),(t=>this._routeItemsChanged(t)),o)}destroy(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(t,e){return this._graphicsView.hitTest(t).filter((({popupTemplate:t})=>!!t))}highlight(t){let r;r=V(t)?[this._getNetworkFeatureUid(t)]:G(t)?t.map((t=>this._getNetworkFeatureUid(t))):v(t)?t.map((t=>this._getNetworkFeatureUid(t))).toArray():[t.uid];const i=r.filter(e);return i.length?(this._addHighlight(i),s((()=>this._removeHighlight(i)))):s()}async hitTest(t,r){if(this.suspended)return null;const i=this._graphicsView.hitTest(t).filter(e).map((t=>this._networkGraphicMap.get(t)));if(!i.length)return null;const{layer:s}=this;return i.reverse().map((e=>({type:"route",layer:s,mapPoint:t,networkFeature:e})))}isUpdating(){return this._graphicsView.updating}moveStart(){}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const t=this._highlightIds.get(e);this._highlightIds.set(e,t+1)}else this._highlightIds.set(e,1);this._updateHighlight()}_createGraphic(t){const e=t.toGraphic();return e.layer=this.layer,e.sourceLayer=this.layer,e}_createGraphicsView(){const t=this.view,e=()=>this.requestUpdate(),r=new w(t.featuresTilingScheme);this._graphicsView=new y({container:r,graphics:this._graphics,requestUpdateCallback:e,view:t}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const e=this._networkGraphicMap.get(t);return j.indexOf(e.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const t=this._highlightIds.get(e)-1;0===t?this._highlightIds.delete(e):this._highlightIds.set(e,t)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map((t=>{const e=this._networkFeatureMap.get(t);return this._networkFeatureMap.delete(t),this._networkGraphicMap.delete(e),e})));for(const e of t.removed)this.removeHandles(e)}if(t.added.length){this._graphics.addMany(t.added.map((t=>{const e=this._createGraphic(t);return null==e.symbol?null:(this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),e)})).filter(e));for(const e of t.added)this.addHandles([a((()=>e.geometry),((t,r)=>{this._updateGraphic(e,"geometry",t,r)})),a((()=>e.symbol),((t,r)=>{this._updateGraphic(e,"symbol",t,r)}))],e);this._graphics.sort(((t,e)=>this._getDrawOrder(t)-this._getDrawOrder(e)))}}_updateGraphic(t,e,r,i){if(!this._networkFeatureMap.has(t)){const e=this._createGraphic(t);return this._networkFeatureMap.set(t,e),this._networkGraphicMap.set(e,t),void this._graphics.add(e)}const s=this._networkFeatureMap.get(t);s[e]=r,M.graphic=s,M.property=e,M.oldValue=i,M.newValue=r,this._graphicsView.graphicUpdateHandler(M)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),e=m("highlight");this._graphicsView.setHighlight(t.map((t=>({objectId:t,highlightFlags:e}))))}};t([h()],I.prototype,"_graphics",void 0),t([h()],I.prototype,"_routeItems",null),I=t([n("esri.views.2d.layers.RouteLayerView2D")],I);const F=I;export{F as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../TimeExtent.js";import has from"../../../../../core/has.js";import t from"../../../../../geometry/SpatialReference.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../rest/support/Query.js";const a=4;function o(i,a){const{service:o}=i,s=o.orderByFields??a.objectIdField+" ASC",n=o.source,u={returnCentroid:!(null!==n&&"object"==typeof n&&"path"in n&&r(n.path))&&"esriGeometryPolygon"===a.geometryType,returnGeometry:!0,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(i.mutable.dataFilter.outSpatialReference),orderByFields:[s],where:i.mutable.dataFilter.definitionExpression??"1=1",outFields:i.mutable.availableFields};if("feature"===i.type){const{gdbVersion:t,historicMoment:r,timeExtent:a}=i.mutable.dataFilter;return{...u,gdbVersion:t,historicMoment:r?new Date(r):null,timeExtent:a?e.fromJSON(a):null,outFields:i.mutable.availableFields}}return u}class s{static fromSchema(e,t){return new s(o(e,t),e.mutable.dataFilter.customParameters,t.geometryType,e.service.queryMetadata.capabilities)}constructor(e,t,r,i){this._queryParams=e,this._customParameters=t,this._geometryType=r,this._capabilities=i}get pageSize(){if(null==this._capabilities)throw new Error("InternalError: Service does not support paged queries");const{query:e}=this._capabilities,t=e.supportsMaxRecordCountFactor?a:null,r=(e.maxRecordCount??8e3)*(t??1);return Math.min(8e3,r)}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){const r=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(r.outFields??[])[0])return null;r.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),i=[];for(const r of e)t.
|
|
5
|
+
import e from"../../../../../TimeExtent.js";import has from"../../../../../core/has.js";import t from"../../../../../geometry/SpatialReference.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import i from"../../../../../rest/support/Query.js";const a=4;function o(i,a){const{service:o}=i,s=o.orderByFields??a.objectIdField+" ASC",n=o.source,u={returnCentroid:!(null!==n&&"object"==typeof n&&"path"in n&&r(n.path))&&"esriGeometryPolygon"===a.geometryType,returnGeometry:!0,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(i.mutable.dataFilter.outSpatialReference),orderByFields:[s],where:i.mutable.dataFilter.definitionExpression??"1=1",outFields:i.mutable.availableFields};if("feature"===i.type){const{gdbVersion:t,historicMoment:r,timeExtent:a}=i.mutable.dataFilter;return{...u,gdbVersion:t,historicMoment:r?new Date(r):null,timeExtent:a?e.fromJSON(a):null,outFields:i.mutable.availableFields}}return u}class s{static fromSchema(e,t){return new s(o(e,t),e.mutable.dataFilter.customParameters,t.geometryType,e.service.queryMetadata.capabilities)}constructor(e,t,r,i){this._queryParams=e,this._customParameters=t,this._geometryType=r,this._capabilities=i}get pageSize(){if(null==this._capabilities)throw new Error("InternalError: Service does not support paged queries");const{query:e}=this._capabilities,t=e.supportsMaxRecordCountFactor?a:null,r=(e.maxRecordCount??8e3)*(t??1);return Math.min(8e3,r)}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){const r=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(r.outFields??[])[0])return null;r.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),i=[];for(const r of e)t.hasField(r)||i.push(r);if(0===i.length)return null;r.outFields=i}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new i({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(null==this._capabilities)throw new Error("InternalError: Service does not support tile queries");const r=this.createQuery(t),i=r.inner;return i.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.extent,this._capabilities.query.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(i.maxAllowableOffset=e.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(i.maxAllowableOffset=e.resolution,"esriGeometryPolyline"===this._geometryType&&(i.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),i.defaultSpatialReferenceEnabled=this._capabilities.query.supportsDefaultSpatialReference,i.compactGeometryEnabled=this._capabilities.query.supportsCompactGeometry,this._capabilities.query.supportsMaxRecordCountFactor&&(i.maxRecordCountFactor=a),r}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:a})}}export{s as FeatureSourceQueryInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../../core/Error.js";import t from"../../../../../../rest/support/Query.js";import{ALoadStrategy as r}from"./ALoadStrategy.js";import{createQueryAdapter as s}from"./support/queryAdapters.js";import{FeatureSetReaderJSON as o}from"../../support/FeatureSetReaderJSON.js";import{QueueProcessor as n}from"../../../../../support/QueueProcessor.js";class a extends r{constructor(e,t,r,o,a){super(r),this._serviceInfo=e,this._queryInfo=t,this._metadata=o,this._eventLog=a,this._queue=new n({concurrency:16,process:async e=>{const t={signal:e.options?.signal,query:e.query.customParameters};return this._adapter.executeQuery(e.query.inner,t)}}),this._adapter=s(e,o)}async updateFields(r){this._queryInfo.updateFields(r);const s=Array.from(this._store.chunks()).map((async e=>{const r=t.fromJSON(e.queryInfo.queryJSON);if(r)try{return await this._tryUpdateFields(e.reader,r),null}catch(s){return s}})),o=(await Promise.all(s)).filter((e=>e));if(o.length)throw new e("featurelayer-query","Encountered errors when downloading fields",{errors:o})}async queryOverride({edits:e}){const t=[],r=[];for(const o of e.removed)null!=o.objectId&&-1!==o.objectId?t.push(o.objectId):r.push(o.globalId);r.length&&t.push(...this._mapGlobalIdsToObjectIds(r));const s=e.addOrModified.map((({objectId:e})=>e));let n;if(s.length){const e=this._queryInfo.createQuery({objectIds:s});n=await this._fetch(e)}else n=o.empty(this._metadata);return{reader:n,removed:t}}_mapGlobalIdsToObjectIds(e){const t=new Set(e),r=this._metadata.globalIdField;if(null==r)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=[];return this._store.forEachUnsafe((e=>{const o=e.readAttribute(r);t.has(o)&&s.push(e.getObjectId())})),s}async _fetch(e,t){const r=await this._enqueue(e,t);return await this._tryUpdateFields(r,e.inner),r}async _tryUpdateFields(e,t){const r=this._queryInfo.createPatchFieldsQuery(t,e
|
|
5
|
+
import e from"../../../../../../core/Error.js";import t from"../../../../../../rest/support/Query.js";import{ALoadStrategy as r}from"./ALoadStrategy.js";import{createQueryAdapter as s}from"./support/queryAdapters.js";import{FeatureSetReaderJSON as o}from"../../support/FeatureSetReaderJSON.js";import{QueueProcessor as n}from"../../../../../support/QueueProcessor.js";class a extends r{constructor(e,t,r,o,a){super(r),this._serviceInfo=e,this._queryInfo=t,this._metadata=o,this._eventLog=a,this._queue=new n({concurrency:16,process:async e=>{const t={signal:e.options?.signal,query:e.query.customParameters};return this._adapter.executeQuery(e.query.inner,t)}}),this._adapter=s(e,o)}async updateFields(r){this._queryInfo.updateFields(r);const s=Array.from(this._store.chunks()).map((async e=>{const r=t.fromJSON(e.queryInfo.queryJSON);if(r)try{return await this._tryUpdateFields(e.reader,r),null}catch(s){return s}})),o=(await Promise.all(s)).filter((e=>e));if(o.length)throw new e("featurelayer-query","Encountered errors when downloading fields",{errors:o})}async queryOverride({edits:e}){const t=[],r=[];for(const o of e.removed)null!=o.objectId&&-1!==o.objectId?t.push(o.objectId):r.push(o.globalId);r.length&&t.push(...this._mapGlobalIdsToObjectIds(r));const s=e.addOrModified.map((({objectId:e})=>e));let n;if(s.length){const e=this._queryInfo.createQuery({objectIds:s});n=await this._fetch(e)}else n=o.empty(this._metadata);return{reader:n,removed:t}}_mapGlobalIdsToObjectIds(e){const t=new Set(e),r=this._metadata.globalIdField;if(null==r)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=[];return this._store.forEachUnsafe((e=>{const o=e.readAttribute(r);t.has(o)&&s.push(e.getObjectId())})),s}async _fetch(e,t){const r=await this._enqueue(e,t);return await this._tryUpdateFields(r,e.inner),r}async _tryUpdateFields(e,t){const r=this._queryInfo.createPatchFieldsQuery(t,e);if(!r)return;const s=await this._enqueue(r,this._options);e.joinAttributes(s)}async _enqueue(e,t){return this._eventLog.onEvent({type:"fetchStart"}),this._queue.push({query:e,options:t}).finally((()=>{this._eventLog.onEvent({type:"fetchEnd",done:0===this._queue.length})}))}}export{a as AFetchLoadStrategy};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../../geometry.js";import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{getLabelPoint as a}from"../../../../../geometry/support/labelPoint.js";import{convertToGeometry as
|
|
5
|
+
import"../../../../../geometry.js";import{ArcadeDate as e}from"../../../../../arcade/ArcadeDate.js";import has from"../../../../../core/has.js";import{assertIsSome as t}from"../../../../../core/maybe.js";import{DateOnly as r}from"../../../../../core/sql/DateOnly.js";import{TimeOnly as s}from"../../../../../core/sql/TimeOnly.js";import{GeometryCursor as i}from"../../../../../geometry/GeometryCursor.js";import{fromRectValues as o}from"../../../../../geometry/support/aaBoundingBox.js";import{getLabelPoint as a}from"../../../../../geometry/support/labelPoint.js";import{getCentroidOptimizedGeometry as n}from"../../../../../layers/graphics/centroid.js";import{convertToGeometry as d,unquantizeOptimizedGeometry as u}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as h}from"../../../../../layers/graphics/OptimizedFeature.js";import c from"../../../../../layers/graphics/OptimizedGeometry.js";import{system as l,unknown as m}from"../../../../../time/timeZoneUtils.js";import{FeatureSetCache as f}from"./FeatureSetCache.js";import{StaticBitSet as y}from"./StaticBitSet.js";import{fromJSON as p}from"../../../../../geometry/support/jsonUtils.js";const g=has("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],_=g[0],x=g[1],b=g[2],T=g[3],I=has("featurelayer-simplify-payload-size-factors")??[1,2,4],A=I[0],D=I[1],F=I[2],S=has("featurelayer-simplify-mobile-factor")??2,j=has("esri-mobile"),B=4294967295;function C(e,t,r){if(!(e.length>t))for(;e.length<=t;)e.push(r)}class M{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}get isEmpty(){return null!=this._deleted&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=j?S:1;t>4e6?r=F*s:t>1e6?r=D*s:t>5e5?r=A*s:t>1e5&&(r=s);let i=0;return e>4e3?i=T*r:e>2e3?i=b*r:e>100?i=x:e>15&&(i=_),i}parseTimestampOffset(e){return e}getBounds(e){if(C(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===B)return!1;if(0===this.getBoundsXMin()){const t=this.readGeometryWorldSpace();if(!t)return this.setBoundsXMin(B),!1;let r=1/0,s=1/0,i=-1/0,a=-1/0;return t.forEachVertex(((e,t)=>{r=Math.min(r,e),s=Math.min(s,t),i=Math.max(i,e),a=Math.max(a,t)})),this.setBoundsXMin(r),this.setBoundsYMin(s),this.setBoundsXMax(i),this.setBoundsYMax(a),o(e,r,s,i,a),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),i=this.getBoundsYMax();return o(e,t,r,s,i),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return"string"==typeof t?new Date(t).getTime():"number"==typeof t||null==t?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(void 0!==r)return r;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const t of Object.keys(r))e[t]=r[t]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(null==this._objectIdToIndex){const e=new Map,r=this.getCursor();for(;r.next();){const s=r.getObjectId();t(s),e.set(s,r.getIndex())}this._objectIdToIndex=e}const r=this._objectIdToIndex;for(const t of e.values())r.has(t)&&this._removeAtIndex(r.get(t))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new h(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return d(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return null==t?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return null==t?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const e=this._createGeometryFromServerCentroid();return e?e.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return null!=r&&u(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return null!=s&&u(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);null==t&&(t=new f(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return"esriGeometryPoint"!==this.geometryType&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some((t=>t.hasField(e)))}geometry(){const e=this.readGeometryWorldSpace(),t=d(e,this.geometryType,this.hasZ,this.hasM),r=p(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(t,r){return r&&r instanceof Date?this.isUnknownDateTimeField(t)?e.unknownDateJSToArcadeDate(r):e.dateJSAndZoneToArcadeDate(r,this.contextTimeZone??l):r}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===m}field(t){let i=this.fields.get(t);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(this.readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(this.readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(this.readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,this.readAttribute(t,!0));default:return this.readAttribute(t,!1)}for(const o of this._joined)if(o.setIndex(this.getIndex()),i=o.fields.get(t),i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return r.fromReader(o._readAttribute(t,!1));case"time-only":case"esriFieldTypeTimeOnly":return s.fromReader(o._readAttribute(t,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return e.fromReaderAsTimeStampOffset(o._readAttribute(t,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(t,o._readAttribute(t,!0));default:return this.readAttribute(t,!1)}throw new Error(`Field ${t} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map((e=>e.name))}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const e=r.attributes[s];e instanceof Date&&(r.attributes[s]=e.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return null==this._deleted||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(null==this.getInTransform())return n(new c,e,this.hasM,this.hasZ);const t=i.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=a(t);return r?(r[1]*=-1,new c([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return d(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return"esriGeometryPolyline"===this.geometryType?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new c([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new c([2],[e-1,t+1,1,-1])}_removeAtIndex(e){null==this._deleted&&(this._deleted=y.create(this.getSize())),this._deleted.set(e)}}export{M as FeatureSetReader};
|