@arcgis/core 5.2.0-next.16 → 5.2.0-next.17
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/arcgisGlobal.d.ts +3 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00bcb04934972179b9ca.js +1 -0
- package/assets/esri/core/workers/chunks/073ee52705ea326fecfb.js +1 -0
- package/assets/esri/core/workers/chunks/{282930645ce525d5bc92.js → 0e81b6aa64d5491870b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{4162a2bb774e6ba2c0db.js → 0fb685f385e91d0f0601.js} +1 -1
- package/assets/esri/core/workers/chunks/11d1af758e2140095b10.js +1 -0
- package/assets/esri/core/workers/chunks/{a8ef7acb6d3d1f45e14c.js → 29e6f4b19c3da9129439.js} +1 -1
- package/assets/esri/core/workers/chunks/31c4128b23968575feca.js +1 -0
- package/assets/esri/core/workers/chunks/35a508a9311689d8df52.js +1 -0
- package/assets/esri/core/workers/chunks/3a35779cae6a11cde51b.js +1 -0
- package/assets/esri/core/workers/chunks/3a526e1d18490b99332f.js +1 -0
- package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +1 -0
- package/assets/esri/core/workers/chunks/{cf9a132c4c37e62de3d7.js → 50c88e2545380800381f.js} +1 -1
- package/assets/esri/core/workers/chunks/{a892b3be70f482bef0ba.js → 57a6572d440d2c62432b.js} +1 -1
- package/assets/esri/core/workers/chunks/6849282c4a5cd733779d.js +1 -0
- package/assets/esri/core/workers/chunks/{2b781de7b467c61849b2.js → 6a21a22b08f968fa8d60.js} +1 -1
- package/assets/esri/core/workers/chunks/8104ac2eee69d79ada86.js +1 -0
- package/assets/esri/core/workers/chunks/{1c689bb502657b1f173b.js → 9d59cc5c0a63a4e41d99.js} +1 -1
- package/assets/esri/core/workers/chunks/{91c0de3950991d81b7f2.js → 9de673a04c70bd47047e.js} +1 -1
- package/assets/esri/core/workers/chunks/a195f569eada3a8736be.js +1 -0
- package/assets/esri/core/workers/chunks/{9da1a514e042eb642d35.js → a32651777e4f07df5b6a.js} +1 -1
- package/assets/esri/core/workers/chunks/a3c5b754a6fa0f4250bf.js +1 -0
- package/assets/esri/core/workers/chunks/a59a1fdcd37a875f179b.js +1 -0
- package/assets/esri/core/workers/chunks/{ac7ecd90330090c90005.js → aeeee92b86554962711e.js} +1 -1
- package/assets/esri/core/workers/chunks/b0e4af49fc968b0a910f.js +1 -0
- package/assets/esri/core/workers/chunks/b466af9019f10420115e.js +1 -0
- package/assets/esri/core/workers/chunks/bb9232d9f63ec0c32447.js +1 -0
- package/assets/esri/core/workers/chunks/bf9eca7dd107bdb06614.js +1 -0
- package/assets/esri/core/workers/chunks/cbe8adc100582e746a8c.js +1 -0
- package/assets/esri/core/workers/chunks/{a1509e2e7809b6754b4f.js → d523af1db620b5381c99.js} +1 -1
- package/assets/esri/core/workers/chunks/d5a0e3a73df827dc7b06.js +1 -0
- package/assets/esri/core/workers/chunks/d670e134348954ce465d.js +1 -0
- package/assets/esri/core/workers/chunks/e3ea4b7217df16592def.js +1 -0
- package/assets/esri/core/workers/chunks/{c538435216d253f7702e.js → f23351a04643c464be84.js} +1 -1
- package/assets/esri/core/workers/chunks/f3d331da3c61af5c5a2f.js +1 -0
- package/assets/esri/core/workers/chunks/{68b77b36daae2b4b4237.js → f3fe865506fd7428eb6d.js} +1 -1
- package/assets/esri/core/workers/chunks/{a4d918b47cd4ee0e1666.js → f8cfd0045d06aa24beec.js} +1 -1
- package/config.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/networks/CircuitManager.d.ts +247 -1
- package/networks/UnitIdentifierManager.d.ts +40 -3
- package/networks/UtilityNetwork.d.ts +0 -11
- package/networks/support/Circuit.d.ts +0 -1
- package/networks/support/CircuitLocation.d.ts +0 -1
- package/networks/support/CircuitPath.d.ts +0 -1
- package/networks/support/CircuitPathConnectivityElement.d.ts +0 -1
- package/networks/support/CircuitSection.d.ts +0 -1
- package/networks/support/NamedTraceConfiguration.d.ts +1 -7
- package/networks/support/Subcircuit.d.ts +0 -1
- package/networks/support/UNTraceConfiguration.d.ts +0 -4
- package/networks/support/jsonTypes.d.ts +1 -1
- package/networks/support/typeUtils.d.ts +10 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +1 -1
- package/rest/networks/circuits/support/CircuitTraceResult.d.ts +0 -1
- package/rest/networks/circuits/support/CircuitVerifyResult.d.ts +0 -1
- package/rest/networks/support/TelecomNetworkElement.d.ts +0 -1
- package/rest/networks/support/TraceLocation.d.ts +1 -11
- package/rest/networks/support/TraceParameters.d.ts +1 -7
- package/rest/networks/support/TraceResult.d.ts +0 -2
- package/rest/networks/support/TraverseAssociationsParameters.d.ts +69 -0
- package/rest/networks/support/TraverseAssociationsParameters.js +2 -0
- package/rest/networks/support/TraverseAssociationsResult.d.ts +39 -0
- package/rest/networks/support/TraverseAssociationsResult.js +2 -0
- package/rest/networks/traverseAssociations.d.ts +21 -0
- package/rest/networks/traverseAssociations.js +2 -0
- package/rest/networks/unitIdentifiers/support/UnitQueryResult.d.ts +0 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/draw/DrawTool.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.d.ts +3 -2
- package/assets/esri/core/workers/chunks/01ba5319cac3e0f14205.js +0 -1
- package/assets/esri/core/workers/chunks/05e1f1628a3726eca03d.js +0 -1
- package/assets/esri/core/workers/chunks/1d38b2fcd85ac9ebd7c6.js +0 -1
- package/assets/esri/core/workers/chunks/1effde6a39ef0d4af525.js +0 -1
- package/assets/esri/core/workers/chunks/1ff57bf19f021f5fd246.js +0 -1
- package/assets/esri/core/workers/chunks/3dc6e9494af16f7b8009.js +0 -1
- package/assets/esri/core/workers/chunks/3ecb906322a6a5c8c93b.js +0 -1
- package/assets/esri/core/workers/chunks/3f67162456a1f02190fa.js +0 -1
- package/assets/esri/core/workers/chunks/4e4419282c4bf7ee4678.js +0 -1
- package/assets/esri/core/workers/chunks/609edb4da427ec37bcf7.js +0 -1
- package/assets/esri/core/workers/chunks/6f5a82388a5eb5fcf1b7.js +0 -1
- package/assets/esri/core/workers/chunks/7c61b18e43c789aaecc6.js +0 -1
- package/assets/esri/core/workers/chunks/8dcb3e77f76d8396706b.js +0 -1
- package/assets/esri/core/workers/chunks/a3195521a83565c7c2d3.js +0 -1
- package/assets/esri/core/workers/chunks/b0212df1fe8d9448f3d6.js +0 -1
- package/assets/esri/core/workers/chunks/b590402170ae289290d7.js +0 -1
- package/assets/esri/core/workers/chunks/bfa6f4c08e7571bb1f37.js +0 -1
- package/assets/esri/core/workers/chunks/c5e172d3baf5414868f0.js +0 -1
- package/assets/esri/core/workers/chunks/cf41a66fb97c1076fb34.js +0 -1
- package/assets/esri/core/workers/chunks/f23e995320674b32e142.js +0 -1
- package/assets/esri/core/workers/chunks/f3fd40df92e59f7c687c.js +0 -1
- package/assets/esri/core/workers/chunks/fa1336b60278017d2525.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4063],{79897(e,t,s){s.d(t,{U:()=>h});var r=s(5482),n=s(69622),i=s(36563),o=s(36708),l=s(76030),a=s(10107),u=s(64108);let h=class extends n.A{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o.wB)}addWhen(e,t,s={}){return this._installWatch(e,t,s,o.z7)}addOnCollectionChange(e,t,{initial:s=!1,final:r=!1}={}){const n=++this._handleId;return this.addHandles([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.OH),(0,o.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:r?e=>t({added:[],removed:e.toArray()}):void 0})],n),(0,i.hA)(()=>this.removeHandles(n))}consumePromise(e){this.addPromise(e)?.catch(()=>{})}addPromise(e){if(null==e)return e;const t=++this._handleId;this.addHandles((0,i.hA)(()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this.hasHandles(c)||this._set("updating",!1))}),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},r){const n=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,n);const o=r(e,t,s);return this.addHandles(o,n),(0,i.hA)(()=>this.removeHandles(n))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),r=(0,o.wB)(e,s,{sync:!0,equals:()=>!1});return this.addHandles(r,t),r}_createSyncUpdatingCallback(){return()=>{this.removeHandles(c),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,l._)(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(c))}),c)}}};(0,r.Cg)([(0,a.MZ)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,r.Cg)([(0,u.$)("esri.core.support.UpdatingHandles")],h);const c=-42},13069(e,t,s){s.d(t,{AG:()=>l,lk:()=>n,vD:()=>o,yS:()=>i});const r="randomUUID"in crypto;function n(){if(r)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function i(){return`{${n().toUpperCase()}}`}function o(){return`{${n()}}`}function l(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},87992(e,t,s){s.d(t,{JR:()=>E,ME:()=>M,MY:()=>T,NO:()=>C,Nh:()=>_,V2:()=>b,_s:()=>R,e6:()=>z,gh:()=>A,tr:()=>N,uX:()=>f});var r=s(5482),n=s(69397),i=s(16930),o=(s(70328),s(19419)),l=s(60408),a=s(21325),u=s(513),h=s(50954),c=s(79567),p=s(52006),g=s(49663),d=s(46068),m=s(92722);class f{constructor({type:e,spatialReference:t,vertexCount:s,vertexXY:r,vertexZ:n,vertexM:i,partCount:o,partOffsets:l,partFlags:a,segmentFlags:u,segmentIndices:h,segmentParams:c,segmentCountArc:p,segmentCountBezier:g}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=e,this.spatialReference=t,this.vertexCount=s,this.vertexXY=r,this.vertexZ=n,this.vertexM=i,this.partCount=o,this.partOffsets=l,this.partFlags=a,this.segmentFlags=u,this.segmentIndices=h,this.segmentParams=c,this.segmentCountArc=p,this.segmentCountBezier=g}get segmentParamCount(){return 10*this.segmentCountArc+4*this.segmentCountBezier}get segmentCountLine(){const{segmentCount:e,segmentCountArc:t,segmentCountBezier:s}=this;return e&&e-t-s}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}hasCurves(){return this.segmentCountArc+this.segmentCountBezier>0}isMultipart(){return"polyline"===this.type||"polygon"===this.type}get usedMemory(){function e(e){return e?n.Ul+e.byteLength:0}return e(this.vertexXY)+e(this.vertexZ)+e(this.vertexM)+e(this.partOffsets)+e(this.partFlags)+e(this.segmentFlags)+e(this.segmentIndices)+e(this.segmentParams)}clone(){const{type:e,vertexCount:t,partCount:s,hasZ:r,hasM:n,segmentCountArc:i,segmentCountBezier:o}=this,l=b(e,t,s,r,n,this.hasCurves(),i,o);l.spatialReference=this.spatialReference;const{vertexXY:a,vertexZ:u,vertexM:h}=this;if(l.vertexXY.set(a.subarray(0,2*t),0),l.vertexZ?.set(u.subarray(0,t),0),l.vertexM?.set(h.subarray(0,t),0),this.isMultipart()){const{partOffsets:e,partFlags:t}=this;l.partFlags.set(t.subarray(0,s+1)),l.partOffsets.set(e.subarray(0,s+1))}if(this.hasCurves()){const{segmentFlags:e,segmentIndices:s,segmentParams:r,segmentParamCount:n}=this;l.segmentFlags.set(e.subarray(0,t),0),l.segmentIndices.set(s.subarray(0,t),0),l.segmentParams.set(r.subarray(0,n),0)}return l}equals(e){return this.equalsWithinTolerance(e,0)}equalsWithinTolerance(e,t){if(null==e)return!1;if(this===e)return!0;if(!(0,a.aI)(this.spatialReference,e.spatialReference))return!1;if(this.vertexCount!==e.vertexCount||this.partCount!==e.partCount)return!1;if(this.hasZ!==e.hasZ||this.hasM!==e.hasM)return!1;if(this.hasCurves()!==e.hasCurves()||this.segmentCountArc!==e.segmentCountArc||this.segmentCountBezier!==e.segmentCountBezier)return!1;const s=0===t?(e,t)=>e!==t||isNaN(e)!==isNaN(t):(e,s)=>Math.abs(e-s)>t||isNaN(e)!==isNaN(s);for(let t=0;t<this.vertexCount;++t)if(s(this.vertexXY[2*t],e.vertexXY[2*t])||s(this.vertexXY[2*t+1],e.vertexXY[2*t+1]))return!1;if(this.hasZ)for(let t=0;t<this.vertexCount;++t)if(s(this.vertexZ[t],e.vertexZ[t]))return!1;if(this.hasM)for(let t=0;t<this.vertexCount;++t)if(s(this.vertexM[t],e.vertexM[t]))return!1;for(let t=0;t<this.partCount;++t)if(this.partFlags[t]!==e.partFlags[t]||this.partOffsets[t]!==e.partOffsets[t])return!1;if(this.hasCurves()){for(let t=0;t<this.vertexCount;++t)if(this.segmentFlags[t]!==e.segmentFlags[t]||this.segmentIndices[t]!==e.segmentIndices[t])return!1;for(let t=0;t<this.segmentParamCount;++t)if(s(this.segmentParams[t],e.segmentParams[t]))return!1}return!0}get parts(){return this.isMultipart()?new y(this):[][Symbol.iterator]()}}class y{constructor(e){this.geometry=e,this.value=new v(e)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class v{constructor(e){this.geometry=e,this.index=-1,this._readVertex=P(e),this._segments=new x(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){const e=this.geometry.partOffsets;return e[this.index+1]-e[this.index]}}class x{constructor(e){this._part=e,this._partStart=0,this._partEnd=0,this._isPolygon="polygon"===e.geometry.type,this.value=new w(e.geometry)}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;const e=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=e&&this._isPolygon?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){const{index:e}=this._part,t=this._part.geometry.partOffsets;this._partStart=t[e],this._partEnd=t[e+1]-(this._isPolygon?1:2),this.value.indexOfStartVertex=this._partStart-1}}class w{constructor(e){this.geometry=e,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=P(e)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){const e=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===e)return this.end;const t=this.geometry.segmentParams;let s=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===e){const e=t[s++],r=t[s++],n=t[s++],i=t[s++];return{b:[this.end,[e,r],[n,i]]}}const r=t[s++],n=t[s++],i=t[s++],o=t[s++],l=t[s++],a=t[s++];s++,s++;const u=t[s++],h=t[s++];if(!Boolean(4&r)&&1===i)return{c:[this.end,[u,h]]};const c=2&r?0:1,p=1&r?0:1;return{a:[this.end,[l,a],c,p,o,n,i]}}}function C(e,t){const s={stack:[],error:void 0,hasError:!1};try{return t??=(0,o.Ie)(),(0,r.mS)(s,new S(e,["vertexZ","vertexM","spatialReference"]),!1),(0,o.bx)(t,function(e){let t;const{vertexCount:s,vertexXY:n,vertexZ:i,vertexM:l}=e,a=O(e);if(e.hasCurves()){const s={stack:[],error:void 0,hasError:!1};try{(0,r.mS)(s,new S(e,["vertexZ","vertexM"]),!1);const n=(0,o.Ie)();for(const t of e.parts){let e=t.startVertex;for(const{curve:s}of t.segments)(0,c.e)(n,e,s),e=(0,p.yP)(s)}const[i,l,u,h]=n;t={xmin:i,ymin:l,xmax:u,ymax:h,spatialReference:a}}catch(e){s.error=e,s.hasError=!0}finally{(0,r.hk)(s)}}else{let e,r,i,o;e=r=1/0,i=o=-1/0;for(let t=0;t<s;++t){const s=n[2*t],l=n[2*t+1];e=Math.min(e,s),i=Math.max(i,s),r=Math.min(r,l),o=Math.max(o,l)}t={xmin:e,ymin:r,xmax:i,ymax:o,spatialReference:a}}if(i){let e=1/0,s=-1/0;for(const t of i)e=Math.min(e,t),s=Math.max(s,t);t.zmin=e,t.zmax=s}if(l){let e=1/0,s=-1/0;for(const t of l)e=Math.min(e,t),s=Math.max(s,t);t.mmin=e,t.mmax=s}return t}(e)),t}catch(e){s.error=e,s.hasError=!0}finally{(0,r.hk)(s)}}function M(e){let t,s,r;if((0,l.fT)(e)){r="point";const{x:n,y:i,z:o,m:l}=e,a=[n,i];null!=o&&a.push(o),null!=l&&a.push(l),s=[[a]],t=1}else(0,l.U9)(e)?(r="multipoint",s=[e.points],t=e.points.length):(0,l.Rg)(e)?(r="polyline",s=e.curvePaths??e.paths,t=s.reduce((e,t)=>e+t.length,0)):(r="polygon",s=e.curveRings??e.rings,t=s.reduce((e,t)=>(0===t.length||(e+=t.length,Z(t[0],(0,p.yP)(t.at(-1)))&&--e),e),0));const n=b(r,t,r.includes("point")?0:s.length,(0,l.Pv)(e),(0,l.W0)(e),(0,p.Ed)(e)),{hasZ:i,hasM:o,vertexXY:a,vertexZ:u,vertexM:h}=n;function c(e){a[2*d]=e[0],a[2*d+1]=e[1],i&&(u[d]=e[2]),o&&(h[d]=e[g]),++d}n.spatialReference=e.spatialReference??void 0;const g=n.hasZ?3:2;let d=0;if(!n.isMultipart()){if(!i&&!o){for(const[e,t]of s[0])a[2*d]=e,a[2*d+1]=t,++d;return n}for(const e of s[0])c(e);return n}const m="polygon"===r,{partOffsets:f}=n;let y=0;if(!(0,p.Ed)(e)){for(const e of s){if(f[y++]=d,0===e.length)continue;let t=e.length;if(m&&Z(e[0],e.at(-1))&&--t,i||o)for(let s=0;s<t;++s)c(e[s]);else for(let s=0;s<t;++s){const[t,r]=e[s];a[2*d]=t,a[2*d+1]=r,++d}}return f[y]=d,n}function v(e){const t=x+e;if(t<=(n.segmentParams?.length??0))return;let s=t*V;s=20*Math.ceil(s/20);const r=n.segmentParams;n.segmentParams=new Float64Array(s),null!=r&&n.segmentParams.set(r)}let x=0;for(const e of s){if(n.partOffsets[y++]=d,0===e.length)continue;const t=e[0];let s=t;for(let t=1;t<e.length;++t){const r=e[t];c(s);const i=d-1;(0,p.wY)(r)?(v(10),++n.segmentCountArc,x=R(s,r,n,i,x),s=r.a[0]):(0,p.DA)(r)?(v(10),++n.segmentCountArc,x=I(s,r,n,i,x),s=r.a[0]):(0,p.aO)(r)?(v(10),++n.segmentCountArc,x=z(s,r,n,i,x),s=r.c[0]):(0,p.n1)(r)?(v(4),++n.segmentCountBezier,x=N(0,r,n,i,x),s=r.b[0]):s=r}m&&Z(t,s)||c(s)}return n.partOffsets[y]=d,n}function A(e){const t=P(e),{vertexCount:s,partCount:r,hasZ:n,hasM:i}=e,o=O(e);if("point"===e.type){const[t,s]=e.vertexXY,r=e.vertexZ?.[0],n=e.vertexM?.[0];return{x:t,y:s,z:r,m:n,spatialReference:o}}let l=0;if("multipoint"===e.type){const e=[];for(;l<s;)e.push(t(l++));return{points:e,spatialReference:o,hasZ:n,hasM:i}}const a="polygon"===e.type;if(!e.hasCurves()){const s=new Array;for(let n=0;n<r;++n){const r=e.partOffsets[n+1],i=new Array;for(;l<r;)i.push(t(l++));a&&i.length>0&&i.push(i[0]),s.push(i)}return a?{rings:s,hasZ:n,hasM:i,spatialReference:o}:{paths:s,hasZ:n,hasM:i,spatialReference:o}}const u=new Array;for(const{segments:t,startVertex:s}of e.parts){const e=[s];for(const{curve:s}of t)e.push(s);u.push(e)}return a?{rings:[],curveRings:u,hasZ:n,hasM:i,spatialReference:o}:{paths:[],curvePaths:u,hasZ:n,hasM:i,spatialReference:o}}function _(e,{lengths:t,coords:s,hasZ:r,hasM:n},i){const o=e.includes("point")?0:t.length,l="polygon"===e,a="point"===e?1:t.reduce((e,t)=>e+t,0)-(l?o:0);r??=!1,n??=!1;const u=b(e,a,o,r,n,!1,0,0);if(u.spatialReference=i??void 0,!u.isMultipart()){for(let e=0,t=0;e<a;++e)u.vertexXY[2*e]=s[t++],u.vertexXY[2*e+1]=s[t++],r&&(u.vertexZ[e]=s[t++]),n&&(u.vertexM[e]=s[t++]);return u}const h=2+Number(r)+Number(n);let c=0,p=0;u.partOffsets[0]=0;for(const e of t){const t=u.partOffsets[p],i=t+e-Number(l);u.partOffsets[++p]=i;for(let e=t;e<i;++e)u.vertexXY[2*e]=s[c++],u.vertexXY[2*e+1]=s[c++],r&&(u.vertexZ[e]=s[c++]),n&&(u.vertexM[e]=s[c++]);l&&(c+=h)}return u}function E({type:e,vertexCount:t,vertexXY:s,vertexZ:r,vertexM:n,partCount:i,partOffsets:o,hasZ:l,hasM:a}){const u=new m.A([],[],l,a);i=Math.max(i,1);const h="polygon"===e;let c=0;for(let e=0;e<i;++e){const i=o?.[e+1]??t,p=u.coords.length;for(let e=c;e<i;++e)u.coords.push(s[2*e],s[2*e+1]),l&&u.coords.push(r[e]),a&&u.coords.push(n[e]);if(h){const e=c;u.coords.push(s[2*e],s[2*e+1]),l&&u.coords.push(r[e]),a&&u.coords.push(n[e])}u.lengths.push((u.coords.length-p)/u.stride),c=i}return"point"===e&&(u.lengths.length=0),u}function T(e,t){return"getSpatialReference"in e&&(t=function(e){if(null==e)return;const t=e.getText()||void 0,s=e.isCustomWkid()?0:e.getOldID();if(s<=0)return{wkt:t};let r=e.getLatestID();(r<=0||r===s)&&(r=void 0);const n=e.getVCS();if(null==n)return{wkid:s,latestWkid:r,wkt:t};const i=n.isCustomWkid()?0:n.getOldID();if(i<=0)return{wkt:t};let o=e.getLatestVerticalID();return(o<=0||o===i)&&(o=void 0),{wkid:s,wkt:t,latestWkid:r,vcsWkid:i,latestVcsWkid:o}}(e.getSpatialReference()),e=e.getGeometry()),new f({...e.toFlatGeometry(),spatialReference:t})}class S{constructor(e,t){this.target=e,this.keys=t,this.oldValues=t.map(t=>e[t]);for(const s of t)e[s]=void 0}[Symbol.dispose](){this.keys.map((e,t)=>{this.target[e]=this.oldValues[t]})}}function O({spatialReference:e}){return e instanceof i.A?e.toJSON():e}function P({vertexXY:e,vertexZ:t,vertexM:s}){return t?s?r=>[e[2*r],e[2*r+1],t[r],s[r]]:s=>[e[2*s],e[2*s+1],t[s]]:s?t=>[e[2*t],e[2*t+1],s[t]]:t=>[e[2*t],e[2*t+1]]}function Z(e,t){return e.every((e,s)=>e===t[s])}function b(e,t,s,r,n,i,o,l){o??=0,l??=0;const a=new f({type:e,vertexCount:t,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:s,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:o,segmentCountBezier:l});let u=2*Float64Array.BYTES_PER_ELEMENT*t;r&&(u+=Float64Array.BYTES_PER_ELEMENT*t),n&&(u+=Float64Array.BYTES_PER_ELEMENT*t),a.isMultipart()&&(u+=(s+1)*Int32Array.BYTES_PER_ELEMENT,u+=(s+1)*Int8Array.BYTES_PER_ELEMENT),i&&(u+=t*Int8Array.BYTES_PER_ELEMENT,u+=t*Int32Array.BYTES_PER_ELEMENT,u+=a.segmentParamCount*Float64Array.BYTES_PER_ELEMENT);const h=new ArrayBuffer(u);let c=0;return a.vertexXY=new Float64Array(h,c,2*t),c+=a.vertexXY.byteLength,r&&(a.vertexZ=new Float64Array(h,c,t),c+=a.vertexZ.byteLength),n&&(a.vertexM=new Float64Array(h,c,t),c+=a.vertexM.byteLength),i&&(a.segmentParams=new Float64Array(h,c,a.segmentParamCount),c+=a.segmentParams.byteLength,a.segmentIndices=new Int32Array(h,c,t),a.segmentIndices.fill(L),c+=a.segmentIndices.byteLength),a.isMultipart()&&(a.partOffsets=new Int32Array(h,c,s+1),c+=a.partOffsets.byteLength,a.partFlags=new Int8Array(h,c,s+1),c+=a.partFlags.byteLength,"polygon"===a.type&&a.partFlags.subarray(0,s).fill(1)),i&&(a.segmentFlags=new Int8Array(h,c,t),a.segmentFlags.fill(1),c+=a.segmentFlags.byteLength),a}function R(e,t,{segmentFlags:s,segmentIndices:r,segmentParams:n},i,o){s[i]=4,r[i]=o;const[l,[a,u],h,c,p,g,m]=t.a;let f=4;c||(f|=1),h||(f|=2);const y=(0,d.SW)(e,t),[v,x]=(0,d.Uk)(y,.5);return n[o++]=f,n[o++]=g,n[o++]=m,n[o++]=p,n[o++]=a,n[o++]=u,n[o++]=y.u2-y.u1,n[o++]=y.u1,n[o++]=v,n[o++]=x,o}function I(e,t,{segmentFlags:s,segmentIndices:r,segmentParams:n},i,o){s[i]=4,r[i]=o;const l=(0,g.io)(e,t);return F(l,4,...(0,u.mq)(l,.5),n,o)}function z(e,t,{segmentFlags:s,segmentIndices:r,segmentParams:n},i,o){return s[i]=4,r[i]=o,F((0,h.pM)(e,t),0,...t.c[1],n,o)}function F(e,t,s,r,n,i){const{cx:o,cy:l,thetaStart:a,thetaEnd:u,radius:h}=e;return a>u||(t|=1),Math.abs(u-a)<=Math.PI||(t|=2),n[i++]=t,n[i++]=h,n[i++]=1,n[i++]=0,n[i++]=o,n[i++]=l,n[i++]=u-a,n[i++]=a,n[i++]=s,n[i++]=r,i}function N(e,{b:[t,[s,r],[n,i]]},{segmentFlags:o,segmentIndices:l,segmentParams:a},u,h){return o[u]=2,l[u]=h,a[h++]=s,a[h++]=r,a[h++]=n,a[h++]=i,h}const V=1.61803,L=-1},50498(e,t,s){s.d(t,{Ye:()=>c,gy:()=>h,iI:()=>g,yR:()=>p});var r=s(66552),n=s(5443),i=s(91075),o=s(48526),l=s(86738),a=s(39829),u=s(82799);const h=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),c=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),p={base:i.A,key:"type",typeMap:{extent:n.A,multipoint:o.A,point:l.A,polyline:u.A,polygon:a.A}},g=new r.J({esriGeometryBezier3Curve:"cubic-bezier",esriGeometryCircularArc:"circular-arc",esriGeometryEllipticArc:"elliptic-arc"},{ignoreUnknown:!0})},91806(e,t,s){s.d(t,{A:()=>a});var r,n=s(5482),i=s(25482),o=s(91429),l=s(56507);let a=class extends i.o{static{r=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"cols",void 0),(0,n.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],a.prototype,"level",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],a.prototype,"levelValue",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"origin",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],a.prototype,"resolution",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"rows",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],a.prototype,"scale",void 0),a=r=(0,n.Cg)([(0,o.$K)("esri.layers.support.LOD")],a)},87045(e,t,s){s.d(t,{A:()=>x});var r,n=s(5482),i=s(66552),o=s(25482),l=s(86211),a=s(91429),u=s(56507),h=s(86738),c=s(16930),p=s(21325),g=s(28735),d=s(91806),m=s(72802),f=s(36005),y=s(43937);const v=new i.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let x=class extends o.o{static{r=this}static create(e={}){const{resolutionFactor:t=1,scales:s,size:n=256,spatialReference:i=c.A.WebMercator,numLODs:o=24}=e;if(!(0,p.fn)(i)){const e=[];if(s)for(let t=0;t<s.length;t++){const r=s[t];e.push(new d.A({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let s=o-1;s>=0;s--)e.unshift(new d.A({level:s,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new h.A(0,0,i),size:[n,n],spatialReference:i})}const a=(0,p.Vp)(i),u=e.origin?new h.A({x:e.origin.x,y:e.origin.y,spatialReference:i}):new h.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:i}:{x:0,y:0,spatialReference:i}),g=1/(39.37*(0,l.GA)(i)*96),m=[];if(s)for(let e=0;e<s.length;e++){const t=s[e],r=t*g;m.push(new d.A({level:e,scale:t,resolution:r}))}else{let e=(0,p.EA)(i)?512/n*591657527.5917094:256/n*591657527.591555;const s=Math.ceil(o/t);m.push(new d.A({level:0,scale:e,resolution:e*g}));for(let r=1;r<s;r++){const s=e/2**t,n=s*g;m.push(new d.A({level:r,scale:s,resolution:n})),e=s}}return new r({dpi:96,lods:m,origin:u,size:[n,n],spatialReference:i})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const s=(0,p.Vp)(e);return e.isWrappable&&!!s&&Math.abs(s.origin[0]-t.x)<=s.dx}return!1}readOrigin(e,t){return h.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,s=0;const r=[],n=this._levelToLOD={};e&&(t=-1/0,s=1/0,e.forEach(e=>{r.push(e.scale),t=e.scale>t?e.scale:t,s=e.scale<s?e.scale:s,n[e.level]=e})),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const s=Math.floor(e),r=s+1;return t[s]/(t[s]/t[r])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let r=0;for(;r<s;r++){const s=t[r],n=t[r+1];if(s<=e)return r;if(n===e)return r+1;if(s>e&&n<e)return r+Math.log(s/e)/Math.log(s/n)}return r}tileAt(e,t,s,r){const n=this.lodAt(e);if(!n)return null;let i,o;if("number"==typeof t)i=t,o=s;else if((0,p.aI)(t.spatialReference,this.spatialReference))i=t.x,o=t.y,r=s;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;i=e.x,o=e.y,r=s}const l=n.resolution*this.size[0],a=n.resolution*this.size[1];return r??=new m.U(0,0,0),r.level=e,r.row=Math.floor((this.origin.y-o)/a+.001),r.col=Math.floor((i-this.origin.x)/l+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let s=this.lodAt(e.level);if(!s&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(s=t)}if(!s)return!1;const r=e.level-s.level,n=s.resolution*this.size[0]/2**r,i=s.resolution*this.size[1]/2**r;return e.extent[0]=this.origin.x+e.col*n,e.extent[1]=this.origin.y-(e.row+1)*i,e.extent[2]=e.extent[0]+n,e.extent[3]=e.extent[1]+i,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const s=this.lodAt(t.level);if(null==s)return null;const{resolution:r}=s,n=r*this.size[0],i=r*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*i,e[2]=e[0]+n,e[3]=e[1]+i,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const s=[],n=this.lods.length-t;for(let e=0;e<n;e++){const r=e+t,{scale:n,resolution:i}=r>=0?this.lods[r]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};s.push(new d.A({level:e,scale:n,resolution:i}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;s<e.length;s++){const r=e[s];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};(0,n.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],x.prototype,"compressionQuality",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],x.prototype,"dpi",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{read:v.read,write:v.write,origins:{"web-scene":{read:!1,write:!1}}}})],x.prototype,"format",void 0),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],x.prototype,"isWrappable",null),(0,n.Cg)([(0,a.MZ)({type:h.A,json:{write:!0}})],x.prototype,"origin",void 0),(0,n.Cg)([(0,f.w)("origin")],x.prototype,"readOrigin",null),(0,n.Cg)([(0,a.MZ)({type:[d.A],value:null,json:{write:!0}})],x.prototype,"lods",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],x.prototype,"scales",void 0),(0,n.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],x.prototype,"size",void 0),(0,n.Cg)([(0,f.w)("size",["rows","cols"])],x.prototype,"readSize",null),(0,n.Cg)([(0,y.K)("size",{cols:{type:u.jz},rows:{type:u.jz}})],x.prototype,"writeSize",null),(0,n.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],x.prototype,"spatialReference",void 0),x=r=(0,n.Cg)([(0,a.$K)("esri.layers.support.TileInfo")],x)},72802(e,t,s){s.d(t,{U:()=>n});var r=s(19419);class n{constructor(e,t,s,n=(0,r.vt)()){this._level=e,this._row=t,this._col=s,this.extent=n}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new n(e.level,e.row,e.col,e.extent)}}},73133(e,t,s){s.d(t,{j:()=>r});const r=(0,s(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:"unknown"})},58501(e,t,s){s.d(t,{q:()=>n});var r=s(62815);function n(e,t,s){if(!s?.features||!s.hasZ)return;const n=(0,r.N)(s.geometryType,t,e.outSpatialReference);if(n)for(const e of s.features)n(e.geometry)}},79677(e,t,s){s.d(t,{A:()=>p});var r,n=s(5482),i=s(25482),o=s(88930),l=s(91429),a=s(98623),u=s(10184),h=s(36005),c=s(43937);let p=class extends i.o{static{r=this}static get allTime(){return g}static get empty(){return d}static fromArray(e){return new r({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,s=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===r&&s===n}expandTo(e,t=a.qU){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let s=this.start;s&&(s=(0,o.lL)(s,new u.A({value:1,unit:e}),t));let n=this.end;if(n){const s=(0,o.lL)(n,new u.A({value:1,unit:e}),t);n=n.getTime()===s.getTime()?s:(0,o.S1)(s,1,e,t)}return new r({start:s,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,s=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,i=e.end?.getTime()??1/0;let o,l;return n>=t&&n<=s?o=n:t>=n&&t<=i&&(o=t),s>=n&&s<=i?l=s:i>=t&&i<=s&&(l=i),null==o||null==l||isNaN(o)||isNaN(l)?r.empty:new r({start:o===-1/0?null:new Date(o),end:l===1/0?null:new Date(l)})}offset(e,t,s=a.qU){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();const n=new r,{start:i,end:l}=this;return null!=i&&(n.start=(0,o.S1)(i,e,t,s)),null!=l&&(n.end=(0,o.S1)(l,e,t,s)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return g.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:s})}};(0,n.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,n.Cg)([(0,h.w)("end")],p.prototype,"readEnd",null),(0,n.Cg)([(0,c.K)("end")],p.prototype,"writeEnd",null),(0,n.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,n.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,n.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,n.Cg)([(0,h.w)("start")],p.prototype,"readStart",null),(0,n.Cg)([(0,c.K)("start")],p.prototype,"writeStart",null),p=r=(0,n.Cg)([(0,l.$K)("esri.time.TimeExtent")],p);const g=new p,d=new p({start:void 0,end:void 0})},10184(e,t,s){s.d(t,{A:()=>h});var r=s(5482),n=s(69540),i=s(25482),o=s(88930),l=s(91429),a=s(73133),u=s(93223);let h=class extends((0,n.OU)(i.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,o.t)(this.value,this.unit,"milliseconds")}};(0,r.Cg)([(0,u.e)(a.j,{nonNullable:!0})],h.prototype,"unit",void 0),(0,r.Cg)([(0,l.MZ)({type:Number,json:{write:!0},nonNullable:!0})],h.prototype,"value",void 0),h=(0,r.Cg)([(0,l.$K)("esri.time.TimeInterval")],h)}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2515],{79897(e,t,s){s.d(t,{U:()=>h});var r=s(5482),n=s(69622),i=s(36563),o=s(36708),l=s(76030),a=s(10107),u=s(64108);let h=class extends n.A{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o.wB)}addWhen(e,t,s={}){return this._installWatch(e,t,s,o.z7)}addOnCollectionChange(e,t,{initial:s=!1,final:r=!1}={}){const n=++this._handleId;return this.addHandles([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.OH),(0,o.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:r?e=>t({added:[],removed:e.toArray()}):void 0})],n),(0,i.hA)(()=>this.removeHandles(n))}consumePromise(e){this.addPromise(e)?.catch(()=>{})}addPromise(e){if(null==e)return e;const t=++this._handleId;this.addHandles((0,i.hA)(()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this.hasHandles(c)||this._set("updating",!1))}),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},r){const n=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,n);const o=r(e,t,s);return this.addHandles(o,n),(0,i.hA)(()=>this.removeHandles(n))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),r=(0,o.wB)(e,s,{sync:!0,equals:()=>!1});return this.addHandles(r,t),r}_createSyncUpdatingCallback(){return()=>{this.removeHandles(c),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,l._)(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(c))}),c)}}};(0,r.Cg)([(0,a.MZ)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,r.Cg)([(0,u.$)("esri.core.support.UpdatingHandles")],h);const c=-42},13069(e,t,s){s.d(t,{AG:()=>l,lk:()=>n,vD:()=>o,yS:()=>i});const r="randomUUID"in crypto;function n(){if(r)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function i(){return`{${n().toUpperCase()}}`}function o(){return`{${n()}}`}function l(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},87992(e,t,s){s.d(t,{JR:()=>E,ME:()=>M,MY:()=>T,NO:()=>C,Nh:()=>_,V2:()=>Z,_s:()=>R,e6:()=>z,gh:()=>A,tr:()=>V,uX:()=>f});var r=s(5482),n=s(69397),i=s(16930),o=(s(70328),s(19419)),l=s(60408),a=s(21325),u=s(513),h=s(50954),c=s(79567),p=s(52006),g=s(49663),d=s(46068),m=s(92722);class f{constructor({type:e,spatialReference:t,vertexCount:s,vertexXY:r,vertexZ:n,vertexM:i,partCount:o,partOffsets:l,partFlags:a,segmentFlags:u,segmentIndices:h,segmentParams:c,segmentCountArc:p,segmentCountBezier:g}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=e,this.spatialReference=t,this.vertexCount=s,this.vertexXY=r,this.vertexZ=n,this.vertexM=i,this.partCount=o,this.partOffsets=l,this.partFlags=a,this.segmentFlags=u,this.segmentIndices=h,this.segmentParams=c,this.segmentCountArc=p,this.segmentCountBezier=g}get segmentParamCount(){return 10*this.segmentCountArc+4*this.segmentCountBezier}get segmentCountLine(){const{segmentCount:e,segmentCountArc:t,segmentCountBezier:s}=this;return e&&e-t-s}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}hasCurves(){return this.segmentCountArc+this.segmentCountBezier>0}isMultipart(){return"polyline"===this.type||"polygon"===this.type}get usedMemory(){function e(e){return e?n.Ul+e.byteLength:0}return e(this.vertexXY)+e(this.vertexZ)+e(this.vertexM)+e(this.partOffsets)+e(this.partFlags)+e(this.segmentFlags)+e(this.segmentIndices)+e(this.segmentParams)}clone(){const{type:e,vertexCount:t,partCount:s,hasZ:r,hasM:n,segmentCountArc:i,segmentCountBezier:o}=this,l=Z(e,t,s,r,n,this.hasCurves(),i,o);l.spatialReference=this.spatialReference;const{vertexXY:a,vertexZ:u,vertexM:h}=this;if(l.vertexXY.set(a.subarray(0,2*t),0),l.vertexZ?.set(u.subarray(0,t),0),l.vertexM?.set(h.subarray(0,t),0),this.isMultipart()){const{partOffsets:e,partFlags:t}=this;l.partFlags.set(t.subarray(0,s+1)),l.partOffsets.set(e.subarray(0,s+1))}if(this.hasCurves()){const{segmentFlags:e,segmentIndices:s,segmentParams:r,segmentParamCount:n}=this;l.segmentFlags.set(e.subarray(0,t),0),l.segmentIndices.set(s.subarray(0,t),0),l.segmentParams.set(r.subarray(0,n),0)}return l}equals(e){return this.equalsWithinTolerance(e,0)}equalsWithinTolerance(e,t){if(null==e)return!1;if(this===e)return!0;if(!(0,a.aI)(this.spatialReference,e.spatialReference))return!1;if(this.vertexCount!==e.vertexCount||this.partCount!==e.partCount)return!1;if(this.hasZ!==e.hasZ||this.hasM!==e.hasM)return!1;if(this.hasCurves()!==e.hasCurves()||this.segmentCountArc!==e.segmentCountArc||this.segmentCountBezier!==e.segmentCountBezier)return!1;const s=0===t?(e,t)=>e!==t||isNaN(e)!==isNaN(t):(e,s)=>Math.abs(e-s)>t||isNaN(e)!==isNaN(s);for(let t=0;t<this.vertexCount;++t)if(s(this.vertexXY[2*t],e.vertexXY[2*t])||s(this.vertexXY[2*t+1],e.vertexXY[2*t+1]))return!1;if(this.hasZ)for(let t=0;t<this.vertexCount;++t)if(s(this.vertexZ[t],e.vertexZ[t]))return!1;if(this.hasM)for(let t=0;t<this.vertexCount;++t)if(s(this.vertexM[t],e.vertexM[t]))return!1;for(let t=0;t<this.partCount;++t)if(this.partFlags[t]!==e.partFlags[t]||this.partOffsets[t]!==e.partOffsets[t])return!1;if(this.hasCurves()){for(let t=0;t<this.vertexCount;++t)if(this.segmentFlags[t]!==e.segmentFlags[t]||this.segmentIndices[t]!==e.segmentIndices[t])return!1;for(let t=0;t<this.segmentParamCount;++t)if(s(this.segmentParams[t],e.segmentParams[t]))return!1}return!0}get parts(){return this.isMultipart()?new y(this):[][Symbol.iterator]()}}class y{constructor(e){this.geometry=e,this.value=new v(e)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class v{constructor(e){this.geometry=e,this.index=-1,this._readVertex=P(e),this._segments=new x(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){const e=this.geometry.partOffsets;return e[this.index+1]-e[this.index]}}class x{constructor(e){this._part=e,this._partStart=0,this._partEnd=0,this._isPolygon="polygon"===e.geometry.type,this.value=new w(e.geometry)}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;const e=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=e&&this._isPolygon?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){const{index:e}=this._part,t=this._part.geometry.partOffsets;this._partStart=t[e],this._partEnd=t[e+1]-(this._isPolygon?1:2),this.value.indexOfStartVertex=this._partStart-1}}class w{constructor(e){this.geometry=e,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=P(e)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){const e=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===e)return this.end;const t=this.geometry.segmentParams;let s=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===e){const e=t[s++],r=t[s++],n=t[s++],i=t[s++];return{b:[this.end,[e,r],[n,i]]}}const r=t[s++],n=t[s++],i=t[s++],o=t[s++],l=t[s++],a=t[s++];s++,s++;const u=t[s++],h=t[s++];if(!Boolean(4&r)&&1===i)return{c:[this.end,[u,h]]};const c=2&r?0:1,p=1&r?0:1;return{a:[this.end,[l,a],c,p,o,n,i]}}}function C(e,t){const s={stack:[],error:void 0,hasError:!1};try{return t??=(0,o.Ie)(),(0,r.mS)(s,new S(e,["vertexZ","vertexM","spatialReference"]),!1),(0,o.bx)(t,function(e){let t;const{vertexCount:s,vertexXY:n,vertexZ:i,vertexM:l}=e,a=O(e);if(e.hasCurves()){const s={stack:[],error:void 0,hasError:!1};try{(0,r.mS)(s,new S(e,["vertexZ","vertexM"]),!1);const n=(0,o.Ie)();for(const t of e.parts){let e=t.startVertex;for(const{curve:s}of t.segments)(0,c.e)(n,e,s),e=(0,p.yP)(s)}const[i,l,u,h]=n;t={xmin:i,ymin:l,xmax:u,ymax:h,spatialReference:a}}catch(e){s.error=e,s.hasError=!0}finally{(0,r.hk)(s)}}else{let e,r,i,o;e=r=1/0,i=o=-1/0;for(let t=0;t<s;++t){const s=n[2*t],l=n[2*t+1];e=Math.min(e,s),i=Math.max(i,s),r=Math.min(r,l),o=Math.max(o,l)}t={xmin:e,ymin:r,xmax:i,ymax:o,spatialReference:a}}if(i){let e=1/0,s=-1/0;for(const t of i)e=Math.min(e,t),s=Math.max(s,t);t.zmin=e,t.zmax=s}if(l){let e=1/0,s=-1/0;for(const t of l)e=Math.min(e,t),s=Math.max(s,t);t.mmin=e,t.mmax=s}return t}(e)),t}catch(e){s.error=e,s.hasError=!0}finally{(0,r.hk)(s)}}function M(e){let t,s,r;if((0,l.fT)(e)){r="point";const{x:n,y:i,z:o,m:l}=e,a=[n,i];null!=o&&a.push(o),null!=l&&a.push(l),s=[[a]],t=1}else(0,l.U9)(e)?(r="multipoint",s=[e.points],t=e.points.length):(0,l.Rg)(e)?(r="polyline",s=e.curvePaths??e.paths,t=s.reduce((e,t)=>e+t.length,0)):(r="polygon",s=e.curveRings??e.rings,t=s.reduce((e,t)=>(0===t.length||(e+=t.length,b(t[0],(0,p.yP)(t.at(-1)))&&--e),e),0));const n=Z(r,t,r.includes("point")?0:s.length,(0,l.Pv)(e),(0,l.W0)(e),(0,p.Ed)(e)),{hasZ:i,hasM:o,vertexXY:a,vertexZ:u,vertexM:h}=n;function c(e){a[2*d]=e[0],a[2*d+1]=e[1],i&&(u[d]=e[2]),o&&(h[d]=e[g]),++d}n.spatialReference=e.spatialReference??void 0;const g=n.hasZ?3:2;let d=0;if(!n.isMultipart()){if(!i&&!o){for(const[e,t]of s[0])a[2*d]=e,a[2*d+1]=t,++d;return n}for(const e of s[0])c(e);return n}const m="polygon"===r,{partOffsets:f}=n;let y=0;if(!(0,p.Ed)(e)){for(const e of s){if(f[y++]=d,0===e.length)continue;let t=e.length;if(m&&b(e[0],e.at(-1))&&--t,i||o)for(let s=0;s<t;++s)c(e[s]);else for(let s=0;s<t;++s){const[t,r]=e[s];a[2*d]=t,a[2*d+1]=r,++d}}return f[y]=d,n}function v(e){const t=x+e;if(t<=(n.segmentParams?.length??0))return;let s=t*N;s=20*Math.ceil(s/20);const r=n.segmentParams;n.segmentParams=new Float64Array(s),null!=r&&n.segmentParams.set(r)}let x=0;for(const e of s){if(n.partOffsets[y++]=d,0===e.length)continue;const t=e[0];let s=t;for(let t=1;t<e.length;++t){const r=e[t];c(s);const i=d-1;(0,p.wY)(r)?(v(10),++n.segmentCountArc,x=R(s,r,n,i,x),s=r.a[0]):(0,p.DA)(r)?(v(10),++n.segmentCountArc,x=I(s,r,n,i,x),s=r.a[0]):(0,p.aO)(r)?(v(10),++n.segmentCountArc,x=z(s,r,n,i,x),s=r.c[0]):(0,p.n1)(r)?(v(4),++n.segmentCountBezier,x=V(0,r,n,i,x),s=r.b[0]):s=r}m&&b(t,s)||c(s)}return n.partOffsets[y]=d,n}function A(e){const t=P(e),{vertexCount:s,partCount:r,hasZ:n,hasM:i}=e,o=O(e);if("point"===e.type){const[t,s]=e.vertexXY,r=e.vertexZ?.[0],n=e.vertexM?.[0];return{x:t,y:s,z:r,m:n,spatialReference:o}}let l=0;if("multipoint"===e.type){const e=[];for(;l<s;)e.push(t(l++));return{points:e,spatialReference:o,hasZ:n,hasM:i}}const a="polygon"===e.type;if(!e.hasCurves()){const s=new Array;for(let n=0;n<r;++n){const r=e.partOffsets[n+1],i=new Array;for(;l<r;)i.push(t(l++));a&&i.length>0&&i.push(i[0]),s.push(i)}return a?{rings:s,hasZ:n,hasM:i,spatialReference:o}:{paths:s,hasZ:n,hasM:i,spatialReference:o}}const u=new Array;for(const{segments:t,startVertex:s}of e.parts){const e=[s];for(const{curve:s}of t)e.push(s);u.push(e)}return a?{rings:[],curveRings:u,hasZ:n,hasM:i,spatialReference:o}:{paths:[],curvePaths:u,hasZ:n,hasM:i,spatialReference:o}}function _(e,{lengths:t,coords:s,hasZ:r,hasM:n},i){const o=e.includes("point")?0:t.length,l="polygon"===e,a="point"===e?1:t.reduce((e,t)=>e+t,0)-(l?o:0);r??=!1,n??=!1;const u=Z(e,a,o,r,n,!1,0,0);if(u.spatialReference=i??void 0,!u.isMultipart()){for(let e=0,t=0;e<a;++e)u.vertexXY[2*e]=s[t++],u.vertexXY[2*e+1]=s[t++],r&&(u.vertexZ[e]=s[t++]),n&&(u.vertexM[e]=s[t++]);return u}const h=2+Number(r)+Number(n);let c=0,p=0;u.partOffsets[0]=0;for(const e of t){const t=u.partOffsets[p],i=t+e-Number(l);u.partOffsets[++p]=i;for(let e=t;e<i;++e)u.vertexXY[2*e]=s[c++],u.vertexXY[2*e+1]=s[c++],r&&(u.vertexZ[e]=s[c++]),n&&(u.vertexM[e]=s[c++]);l&&(c+=h)}return u}function E({type:e,vertexCount:t,vertexXY:s,vertexZ:r,vertexM:n,partCount:i,partOffsets:o,hasZ:l,hasM:a}){const u=new m.A([],[],l,a);i=Math.max(i,1);const h="polygon"===e;let c=0;for(let e=0;e<i;++e){const i=o?.[e+1]??t,p=u.coords.length;for(let e=c;e<i;++e)u.coords.push(s[2*e],s[2*e+1]),l&&u.coords.push(r[e]),a&&u.coords.push(n[e]);if(h){const e=c;u.coords.push(s[2*e],s[2*e+1]),l&&u.coords.push(r[e]),a&&u.coords.push(n[e])}u.lengths.push((u.coords.length-p)/u.stride),c=i}return"point"===e&&(u.lengths.length=0),u}function T(e,t){return"getSpatialReference"in e&&(t=function(e){if(null==e)return;const t=e.getText()||void 0,s=e.isCustomWkid()?0:e.getOldID();if(s<=0)return{wkt:t};let r=e.getLatestID();(r<=0||r===s)&&(r=void 0);const n=e.getVCS();if(null==n)return{wkid:s,latestWkid:r,wkt:t};const i=n.isCustomWkid()?0:n.getOldID();if(i<=0)return{wkt:t};let o=e.getLatestVerticalID();return(o<=0||o===i)&&(o=void 0),{wkid:s,wkt:t,latestWkid:r,vcsWkid:i,latestVcsWkid:o}}(e.getSpatialReference()),e=e.getGeometry()),new f({...e.toFlatGeometry(),spatialReference:t})}class S{constructor(e,t){this.target=e,this.keys=t,this.oldValues=t.map(t=>e[t]);for(const s of t)e[s]=void 0}[Symbol.dispose](){this.keys.map((e,t)=>{this.target[e]=this.oldValues[t]})}}function O({spatialReference:e}){return e instanceof i.A?e.toJSON():e}function P({vertexXY:e,vertexZ:t,vertexM:s}){return t?s?r=>[e[2*r],e[2*r+1],t[r],s[r]]:s=>[e[2*s],e[2*s+1],t[s]]:s?t=>[e[2*t],e[2*t+1],s[t]]:t=>[e[2*t],e[2*t+1]]}function b(e,t){return e.every((e,s)=>e===t[s])}function Z(e,t,s,r,n,i,o,l){o??=0,l??=0;const a=new f({type:e,vertexCount:t,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:s,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:o,segmentCountBezier:l});let u=2*Float64Array.BYTES_PER_ELEMENT*t;r&&(u+=Float64Array.BYTES_PER_ELEMENT*t),n&&(u+=Float64Array.BYTES_PER_ELEMENT*t),a.isMultipart()&&(u+=(s+1)*Int32Array.BYTES_PER_ELEMENT,u+=(s+1)*Int8Array.BYTES_PER_ELEMENT),i&&(u+=t*Int8Array.BYTES_PER_ELEMENT,u+=t*Int32Array.BYTES_PER_ELEMENT,u+=a.segmentParamCount*Float64Array.BYTES_PER_ELEMENT);const h=new ArrayBuffer(u);let c=0;return a.vertexXY=new Float64Array(h,c,2*t),c+=a.vertexXY.byteLength,r&&(a.vertexZ=new Float64Array(h,c,t),c+=a.vertexZ.byteLength),n&&(a.vertexM=new Float64Array(h,c,t),c+=a.vertexM.byteLength),i&&(a.segmentParams=new Float64Array(h,c,a.segmentParamCount),c+=a.segmentParams.byteLength,a.segmentIndices=new Int32Array(h,c,t),a.segmentIndices.fill(L),c+=a.segmentIndices.byteLength),a.isMultipart()&&(a.partOffsets=new Int32Array(h,c,s+1),c+=a.partOffsets.byteLength,a.partFlags=new Int8Array(h,c,s+1),c+=a.partFlags.byteLength,"polygon"===a.type&&a.partFlags.subarray(0,s).fill(1)),i&&(a.segmentFlags=new Int8Array(h,c,t),a.segmentFlags.fill(1),c+=a.segmentFlags.byteLength),a}function R(e,t,{segmentFlags:s,segmentIndices:r,segmentParams:n},i,o){s[i]=4,r[i]=o;const[l,[a,u],h,c,p,g,m]=t.a;let f=4;c||(f|=1),h||(f|=2);const y=(0,d.SW)(e,t),[v,x]=(0,d.Uk)(y,.5);return n[o++]=f,n[o++]=g,n[o++]=m,n[o++]=p,n[o++]=a,n[o++]=u,n[o++]=y.u2-y.u1,n[o++]=y.u1,n[o++]=v,n[o++]=x,o}function I(e,t,{segmentFlags:s,segmentIndices:r,segmentParams:n},i,o){s[i]=4,r[i]=o;const l=(0,g.io)(e,t);return F(l,4,...(0,u.mq)(l,.5),n,o)}function z(e,t,{segmentFlags:s,segmentIndices:r,segmentParams:n},i,o){return s[i]=4,r[i]=o,F((0,h.pM)(e,t),0,...t.c[1],n,o)}function F(e,t,s,r,n,i){const{cx:o,cy:l,thetaStart:a,thetaEnd:u,radius:h}=e;return a>u||(t|=1),Math.abs(u-a)<=Math.PI||(t|=2),n[i++]=t,n[i++]=h,n[i++]=1,n[i++]=0,n[i++]=o,n[i++]=l,n[i++]=u-a,n[i++]=a,n[i++]=s,n[i++]=r,i}function V(e,{b:[t,[s,r],[n,i]]},{segmentFlags:o,segmentIndices:l,segmentParams:a},u,h){return o[u]=2,l[u]=h,a[h++]=s,a[h++]=r,a[h++]=n,a[h++]=i,h}const N=1.61803,L=-1},50498(e,t,s){s.d(t,{Ye:()=>c,gy:()=>h,iI:()=>g,yR:()=>p});var r=s(66552),n=s(5443),i=s(91075),o=s(48526),l=s(86738),a=s(39829),u=s(82799);const h=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),c=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),p={base:i.A,key:"type",typeMap:{extent:n.A,multipoint:o.A,point:l.A,polyline:u.A,polygon:a.A}},g=new r.J({esriGeometryBezier3Curve:"cubic-bezier",esriGeometryCircularArc:"circular-arc",esriGeometryEllipticArc:"elliptic-arc"},{ignoreUnknown:!0})},91806(e,t,s){s.d(t,{A:()=>a});var r,n=s(5482),i=s(25482),o=s(91429),l=s(56507);let a=class extends i.o{static{r=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"cols",void 0),(0,n.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],a.prototype,"level",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],a.prototype,"levelValue",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"origin",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],a.prototype,"resolution",void 0),(0,n.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"rows",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],a.prototype,"scale",void 0),a=r=(0,n.Cg)([(0,o.$K)("esri.layers.support.LOD")],a)},87045(e,t,s){s.d(t,{A:()=>x});var r,n=s(5482),i=s(66552),o=s(25482),l=s(86211),a=s(91429),u=s(56507),h=s(86738),c=s(16930),p=s(21325),g=s(28735),d=s(91806),m=s(72802),f=s(36005),y=s(43937);const v=new i.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let x=class extends o.o{static{r=this}static create(e={}){const{resolutionFactor:t=1,scales:s,size:n=256,spatialReference:i=c.A.WebMercator,numLODs:o=24}=e;if(!(0,p.fn)(i)){const e=[];if(s)for(let t=0;t<s.length;t++){const r=s[t];e.push(new d.A({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let s=o-1;s>=0;s--)e.unshift(new d.A({level:s,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new h.A(0,0,i),size:[n,n],spatialReference:i})}const a=(0,p.Vp)(i),u=e.origin?new h.A({x:e.origin.x,y:e.origin.y,spatialReference:i}):new h.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:i}:{x:0,y:0,spatialReference:i}),g=1/(39.37*(0,l.GA)(i)*96),m=[];if(s)for(let e=0;e<s.length;e++){const t=s[e],r=t*g;m.push(new d.A({level:e,scale:t,resolution:r}))}else{let e=(0,p.EA)(i)?512/n*591657527.5917094:256/n*591657527.591555;const s=Math.ceil(o/t);m.push(new d.A({level:0,scale:e,resolution:e*g}));for(let r=1;r<s;r++){const s=e/2**t,n=s*g;m.push(new d.A({level:r,scale:s,resolution:n})),e=s}}return new r({dpi:96,lods:m,origin:u,size:[n,n],spatialReference:i})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const s=(0,p.Vp)(e);return e.isWrappable&&!!s&&Math.abs(s.origin[0]-t.x)<=s.dx}return!1}readOrigin(e,t){return h.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,s=0;const r=[],n=this._levelToLOD={};e&&(t=-1/0,s=1/0,e.forEach(e=>{r.push(e.scale),t=e.scale>t?e.scale:t,s=e.scale<s?e.scale:s,n[e.level]=e})),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const s=Math.floor(e),r=s+1;return t[s]/(t[s]/t[r])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let r=0;for(;r<s;r++){const s=t[r],n=t[r+1];if(s<=e)return r;if(n===e)return r+1;if(s>e&&n<e)return r+Math.log(s/e)/Math.log(s/n)}return r}tileAt(e,t,s,r){const n=this.lodAt(e);if(!n)return null;let i,o;if("number"==typeof t)i=t,o=s;else if((0,p.aI)(t.spatialReference,this.spatialReference))i=t.x,o=t.y,r=s;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;i=e.x,o=e.y,r=s}const l=n.resolution*this.size[0],a=n.resolution*this.size[1];return r??=new m.U(0,0,0),r.level=e,r.row=Math.floor((this.origin.y-o)/a+.001),r.col=Math.floor((i-this.origin.x)/l+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let s=this.lodAt(e.level);if(!s&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(s=t)}if(!s)return!1;const r=e.level-s.level,n=s.resolution*this.size[0]/2**r,i=s.resolution*this.size[1]/2**r;return e.extent[0]=this.origin.x+e.col*n,e.extent[1]=this.origin.y-(e.row+1)*i,e.extent[2]=e.extent[0]+n,e.extent[3]=e.extent[1]+i,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const s=this.lodAt(t.level);if(null==s)return null;const{resolution:r}=s,n=r*this.size[0],i=r*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*i,e[2]=e[0]+n,e[3]=e[1]+i,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const s=[],n=this.lods.length-t;for(let e=0;e<n;e++){const r=e+t,{scale:n,resolution:i}=r>=0?this.lods[r]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};s.push(new d.A({level:e,scale:n,resolution:i}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;s<e.length;s++){const r=e[s];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};(0,n.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],x.prototype,"compressionQuality",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],x.prototype,"dpi",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{read:v.read,write:v.write,origins:{"web-scene":{read:!1,write:!1}}}})],x.prototype,"format",void 0),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],x.prototype,"isWrappable",null),(0,n.Cg)([(0,a.MZ)({type:h.A,json:{write:!0}})],x.prototype,"origin",void 0),(0,n.Cg)([(0,f.w)("origin")],x.prototype,"readOrigin",null),(0,n.Cg)([(0,a.MZ)({type:[d.A],value:null,json:{write:!0}})],x.prototype,"lods",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0})],x.prototype,"scales",void 0),(0,n.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],x.prototype,"size",void 0),(0,n.Cg)([(0,f.w)("size",["rows","cols"])],x.prototype,"readSize",null),(0,n.Cg)([(0,y.K)("size",{cols:{type:u.jz},rows:{type:u.jz}})],x.prototype,"writeSize",null),(0,n.Cg)([(0,a.MZ)({type:c.A,json:{write:!0}})],x.prototype,"spatialReference",void 0),x=r=(0,n.Cg)([(0,a.$K)("esri.layers.support.TileInfo")],x)},72802(e,t,s){s.d(t,{U:()=>n});var r=s(19419);class n{constructor(e,t,s,n=(0,r.vt)()){this._level=e,this._row=t,this._col=s,this.extent=n}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new n(e.level,e.row,e.col,e.extent)}}},73133(e,t,s){s.d(t,{j:()=>r});const r=(0,s(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:"unknown"})},79677(e,t,s){s.d(t,{A:()=>p});var r,n=s(5482),i=s(25482),o=s(88930),l=s(91429),a=s(98623),u=s(10184),h=s(36005),c=s(43937);let p=class extends i.o{static{r=this}static get allTime(){return g}static get empty(){return d}static fromArray(e){return new r({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,s=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===r&&s===n}expandTo(e,t=a.qU){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let s=this.start;s&&(s=(0,o.lL)(s,new u.A({value:1,unit:e}),t));let n=this.end;if(n){const s=(0,o.lL)(n,new u.A({value:1,unit:e}),t);n=n.getTime()===s.getTime()?s:(0,o.S1)(s,1,e,t)}return new r({start:s,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,s=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,i=e.end?.getTime()??1/0;let o,l;return n>=t&&n<=s?o=n:t>=n&&t<=i&&(o=t),s>=n&&s<=i?l=s:i>=t&&i<=s&&(l=i),null==o||null==l||isNaN(o)||isNaN(l)?r.empty:new r({start:o===-1/0?null:new Date(o),end:l===1/0?null:new Date(l)})}offset(e,t,s=a.qU){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();const n=new r,{start:i,end:l}=this;return null!=i&&(n.start=(0,o.S1)(i,e,t,s)),null!=l&&(n.end=(0,o.S1)(l,e,t,s)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return g.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:s})}};(0,n.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,n.Cg)([(0,h.w)("end")],p.prototype,"readEnd",null),(0,n.Cg)([(0,c.K)("end")],p.prototype,"writeEnd",null),(0,n.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,n.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,n.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,n.Cg)([(0,h.w)("start")],p.prototype,"readStart",null),(0,n.Cg)([(0,c.K)("start")],p.prototype,"writeStart",null),p=r=(0,n.Cg)([(0,l.$K)("esri.time.TimeExtent")],p);const g=new p,d=new p({start:void 0,end:void 0})},10184(e,t,s){s.d(t,{A:()=>h});var r=s(5482),n=s(69540),i=s(25482),o=s(88930),l=s(91429),a=s(73133),u=s(93223);let h=class extends((0,n.OU)(i.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,o.t)(this.value,this.unit,"milliseconds")}};(0,r.Cg)([(0,u.e)(a.j,{nonNullable:!0})],h.prototype,"unit",void 0),(0,r.Cg)([(0,l.MZ)({type:Number,json:{write:!0},nonNullable:!0})],h.prototype,"value",void 0),h=(0,r.Cg)([(0,l.$K)("esri.time.TimeInterval")],h)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1521],{49403(e,t,r){r.d(t,{Eq:()=>p,G3:()=>i,GH:()=>a,bV:()=>l,nP:()=>o,r5:()=>c,ti:()=>d,vy:()=>s,wr:()=>n});const n={esriMethodHintUNSPECIFIED:0,esriUUIDESRI:1,esriUUIDRFC4122:2},a={esriSplitPolicyType_UNSPECIFIED:0,esriSplitPolicyTypeGeometryRatio:1,esriSplitPolicyTypeDuplicate:2,esriSplitPolicyTypeDefaultValue:3},o={esriTypeUNSPECIFIED:0,esriTypeEntity:1,esriTypeRelationship:2,esriTypeBoth:4,esriTypeMetaEntityProvenance:8},i={esriMergePolicyType_UNSPECIFIED:0,esriMergePolicyTypeSumValues:1,esriMergePolicyTypeAreaWeighted:2,esriMergePolicyTypeDefaultValue:3},s={esriIdentifierInfoTypeUNSPECIFIED:0,esriIdentifierInfoTypeDatabaseNative:1,esriIdentifierInfoTypeUniformProperty:2},d={esriGraphPropertyUNSPECIFIED:0,esriGraphPropertyRegular:1,esriGraphPropertyDocumentName:2,esriGraphPropertyDocumentTitle:3,esriGraphPropertyDocumentUrl:4,esriGraphPropertyDocumentText:5,esriGraphPropertyDocumentKeywords:6,esriGraphPropertyDocumentContentType:7,esriGraphPropertyDocumentMetadata:8,esriGraphPropertyDocumentFileExtension:9,esriGraphPropertyProvenanceInstanceId:10,esriGraphPropertyProvenanceSourceType:11,esriGraphPropertyProvenanceSourceName:12,esriGraphPropertyProvenanceSource:13,esriGraphPropertyProvenanceComment:14,esriGraphPropertyProvenanceTypeName:15,esriGraphPropertyProvenancePropertyName:16},l={esriGeometryNull:0,esriGeometryPoint:1,esriGeometryMultipoint:2,esriGeometryPolyline:3,esriGeometryPolygon:4,esriGeometryEnvelope:5,esriGeometryAny:7,esriGeometryMultiPatch:9},c={esriFieldTypeSmallInteger:0,esriFieldTypeInteger:1,esriFieldTypeSingle:2,esriFieldTypeDouble:3,esriFieldTypeString:4,esriFieldTypeDate:5,esriFieldTypeOID:6,esriFieldTypeGeometry:7,esriFieldTypeBlob:8,esriFieldTypeRaster:9,esriFieldTypeGUID:10,esriFieldTypeGlobalID:11,esriFieldTypeXML:12,esriFieldTypeBigInteger:13,esriFieldTypeDateOnly:14,esriFieldTypeTimeOnly:15,esriFieldTypeTimestampOffset:16},p={Regular:0,Provenance:1,Document:2}},45724(e,t,r){r.d(t,{I:()=>s});var n=r(2741),a=r(44208);const o="esri/rest/knowledgeGraph/wasmInterface/";let i;async function s(){if(i)return i;const e=!!(0,a.A)("wasm-simd");return i=d(e),i}async function d(e){if(e){const{default:e}=await r.e(5367).then(r.bind(r,15367));return e({locateFile:e=>(0,n.s)(o+e)})}const{default:t}=await r.e(9013).then(r.bind(r,29013));return t({locateFile:e=>(0,n.s)(o+e)})}},53902(e,t,r){r.r(t),r.d(t,{_checkAuthentication:()=>tn,_esriRequestWrapper:()=>en,_fetchWrapper:()=>Yr,_getClientDataCacheCopy:()=>vr,_setMaxQueryParsingDurationForTesting:()=>sn,_submitJobWrapper:()=>Xr,clearClientDataCache:()=>Wr,clientDataCache:()=>_r,executeAddDomain:()=>Kr,executeAddGraphFieldIndex:()=>Dr,executeAddGraphProperties:()=>xr,executeAddNamedTypes:()=>Ar,executeApplyEdits:()=>Cr,executeCreateReplica:()=>Jr,executeDeleteDomain:()=>zr,executeDeleteGraphFieldIndex:()=>Pr,executeDeleteGraphProperty:()=>Rr,executeDeleteNamedType:()=>Mr,executeFindPaths:()=>qr,executeFindPathsAsynchronous:()=>$r,executeQuery:()=>kr,executeQueryStreaming:()=>Ir,executeSearch:()=>jr,executeSearchStreaming:()=>Zr,executeUnregisterReplica:()=>Hr,executeUpdateDomain:()=>Vr,executeUpdateGraphProperty:()=>Tr,executeUpdateNamedType:()=>Gr,executeUpdateSearchIndex:()=>Sr,fetchAllClientDataKeys:()=>Er,fetchAsynchronousFindPathsResultData:()=>Ur,fetchClientDataAtKeys:()=>Fr,fetchKnowledgeGraph:()=>Nr,fetchReplicaDefinition:()=>Qr,fetchReplicasInformation:()=>Br,kgRestServices:()=>br,refreshDataModel:()=>Or,refreshServiceDefinition:()=>Lr});var n,a=r(70333),o=r(11254),i=r(49186),s=r(53966),d=r(17676),l=r(91075),c=r(16930),p=r(5482),u=r(69622),y=r(91429),g=r(56507),h=r(5443);let f=n=class extends u.A{constructor(e){super(e),this.outSpatialReference=null,this.processExtent=null,this.processSpatialReference=null,this.returnColumnName=!1,this.returnFeatureCollection=!1,this.returnM=!1,this.returnZ=!1}static from(e){return(0,g.PZ)(n,e)}};(0,p.Cg)([(0,y.MZ)({type:c.A})],f.prototype,"outSpatialReference",void 0),(0,p.Cg)([(0,y.MZ)({type:h.A})],f.prototype,"processExtent",void 0),(0,p.Cg)([(0,y.MZ)({type:c.A})],f.prototype,"processSpatialReference",void 0),(0,p.Cg)([(0,y.MZ)({nonNullable:!0})],f.prototype,"returnColumnName",void 0),(0,p.Cg)([(0,y.MZ)({nonNullable:!0})],f.prototype,"returnFeatureCollection",void 0),(0,p.Cg)([(0,y.MZ)({nonNullable:!0})],f.prototype,"returnM",void 0),(0,p.Cg)([(0,y.MZ)({nonNullable:!0})],f.prototype,"returnZ",void 0),f=n=(0,p.Cg)([(0,y.$K)("esri.rest.geoprocessor.GPOptions")],f);var w=r(17136),m=r(20437),_=r(25482);let v=class extends _.o{constructor(e){super(e),this.extent=null,this.height=null,this.href=null,this.opacity=1,this.rotation=0,this.scale=null,this.visible=!0,this.width=null}};(0,p.Cg)([(0,y.MZ)({type:h.A})],v.prototype,"extent",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"height",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"href",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"opacity",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"rotation",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"scale",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"visible",void 0),(0,p.Cg)([(0,y.MZ)()],v.prototype,"width",void 0),v=(0,p.Cg)([(0,y.$K)("esri.layers.support.MapImage")],v);var b=r(2272),C=r(2073),A=r(93223);let M=class extends _.o{constructor(e){super(e),this.area=0,this.units=null}};(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],M.prototype,"area",void 0),(0,p.Cg)([(0,A.e)(C.UO)],M.prototype,"units",void 0),M=(0,p.Cg)([(0,y.$K)("esri.rest.support.ArealUnit")],M);let G=class extends _.o{constructor(e){super(e),this.itemId=null,this.url=null}};(0,p.Cg)([(0,y.MZ)({type:String,json:{read:{source:"itemID"},write:{target:"itemID"}}})],G.prototype,"itemId",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],G.prototype,"url",void 0),G=(0,p.Cg)([(0,y.$K)("esri.rest.support.DataFile")],G);var x=r(22671);let R=class extends _.o{constructor(e){super(e),this.distance=0,this.units=null}};(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],R.prototype,"distance",void 0),(0,p.Cg)([(0,A.e)(C.Y8)],R.prototype,"units",void 0),R=(0,p.Cg)([(0,y.$K)("esri.rest.support.LinearUnit")],R);var T=r(66552);const D="multi-value-",P=new T.J({GPArealUnit:"areal-unit",GPBoolean:"boolean",GPComposite:"composite",GPDataFile:"data-file",GPDate:"date",GPDouble:"double",GPFeatureRecordSetLayer:"feature-record-set-layer",Field:"field",GPLinearUnit:"linear-unit",GPLong:"long",GPRasterData:"raster-data",GPRasterDataLayer:"raster-data-layer",GPRecordSet:"record-set",GPString:"string",GPTimeUnit:"time-unit",GPValueTable:"value-table","GPMultiValue:GPArealUnit":`${D}areal-unit`,"GPMultiValue:GPBoolean":`${D}boolean`,"GPMultiValue:GPComposite":`${D}composite`,"GPMultiValue:GPDataFile":`${D}data-file`,"GPMultiValue:GPDate":`${D}date`,"GPMultiValue:GPDouble":`${D}double`,"GPMultiValue:GPFeatureRecordSetLayer":`${D}feature-record-set-layer`,"GPMultiValue:Field":`${D}field`,"GPMultiValue:GPLinearUnit":`${D}linear-unit`,"GPMultiValue:GPLong":`${D}long`,"GPMultiValue:GPRasterData":`${D}raster-data`,"GPMultiValue:GPRasterDataLayer":`${D}raster-data-layer`,"GPMultiValue:GPRecordSet":`${D}record-set`,"GPMultiValue:GPString":`${D}string`,"GPMultiValue:GPTimeUnit":`${D}time-unit`});let S=class extends _.o{constructor(e){super(e),this.dataType=null,this.paramName=null,this.value=null}};(0,p.Cg)([(0,A.e)(P,{ignoreUnknown:!1})],S.prototype,"dataType",void 0),(0,p.Cg)([(0,y.MZ)()],S.prototype,"paramName",void 0),(0,p.Cg)([(0,y.MZ)()],S.prototype,"value",void 0),S=(0,p.Cg)([(0,y.$K)("esri.rest.support.ParameterValue")],S);var k=r(36005);let I=class extends _.o{constructor(e){super(e),this.format=null,this.itemId=null,this.type=null,this.url=null}readType(e){return"ImageService"===e?"image-service":null}};(0,p.Cg)([(0,y.MZ)()],I.prototype,"format",void 0),(0,p.Cg)([(0,y.MZ)({json:{name:"itemID",write:!0}})],I.prototype,"itemId",void 0),(0,p.Cg)([(0,y.MZ)()],I.prototype,"type",void 0),(0,p.Cg)([(0,k.w)("type")],I.prototype,"readType",null),(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],I.prototype,"url",void 0),I=(0,p.Cg)([(0,y.$K)("esri.rest.support.RasterData")],I);var j=r(73133);let Z=class extends _.o{constructor(e){super(e),this.time=0,this.units=null}};async function E(e,t){switch(e){case"time-unit":return Z.fromJSON(t);case"areal-unit":return M.fromJSON(t);case"boolean":case"double":case"long":case"string":case"value-table":return t;case"date":return new Date(t);case"data-file":return G.fromJSON(t);case"linear-unit":return R.fromJSON(t);case"feature-record-set-layer":if("url"in t)return G.fromJSON(t);if("layerDefinition"in t){const e=new(0,(await Promise.all([r.e(7632),r.e(8278),r.e(7865),r.e(6554),r.e(9953),r.e(564),r.e(7552),r.e(1214),r.e(2889),r.e(6614),r.e(1017),r.e(4674),r.e(993),r.e(4333),r.e(3781),r.e(7587)]).then(r.bind(r,53781))).default),{layerDefinition:n,featureSet:a}=t;return e.read({layerDefinition:n,featureSet:a},{origin:"portal-item"}),e.spatialReference=c.A.fromJSON(a.spatialReference??n.spatialReference??n.extent.spatialReference),e}return x.A.fromJSON(t);case"record-set":return"url"in t?G.fromJSON(t):x.A.fromJSON(t);case"raster-data":case"raster-data-layer":return"mapImage"in t?v.fromJSON(t.mapImage):I.fromJSON(t);case"field":return m.A.fromJSON(t)}}function F(e){return e.startsWith(D)}function N(e){return e.replace(D,"")}async function O(e){const t=P.fromJSON(e.dataType),{paramName:r}=e,n=F(t)?await async function(e,t){const r=N(e),n="composite"===r?t.map(e=>E(P.fromJSON(e.dataType),e.value)):t.map(e=>E(r,e));return Promise.all(n)}(t,e.value):await E(t,e.value);return new S({dataType:t,paramName:r,value:n})}function L(e,t,r){for(const t in e){const r=e[t];Array.isArray(r)?e[t]=JSON.stringify(r.map(e=>L({item:e},!0).item)):r instanceof Date&&(e[t]=r.getTime())}return(0,b.lF)(e,t,r)}(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],Z.prototype,"time",void 0),(0,p.Cg)([(0,A.e)(j.j)],Z.prototype,"units",void 0),Z=(0,p.Cg)([(0,y.$K)("esri.rest.support.TimeUnit")],Z);var $,q=r(37807);const U=(0,T.O)()({esriJobCancelled:"job-cancelled",esriJobCancelling:"job-cancelling",esriJobDeleted:"job-deleted",esriJobDeleting:"job-deleting",esriJobTimedOut:"job-timed-out",esriJobExecuting:"job-executing",esriJobFailed:"job-failed",esriJobNew:"job-new",esriJobSubmitted:"job-submitted",esriJobSucceeded:"job-succeeded",esriJobWaiting:"job-waiting"},{ignoreUnknown:!1}),K=1e3;let V=class extends _.o{static{$=this}constructor(e){super(e),this.jobId=null,this.jobStatus=null,this.messages=null,this.progress=null,this.requestOptions=null,this.sourceUrl=null,this._cancelJobTimer=void 0,this._jobCompletionTimer=void 0}async cancelJob(e){const{jobId:t,sourceUrl:r}=this,{path:n}=(0,b.Dl)(r),a={...this.requestOptions,...e,query:{f:"json"}},i=`${n}/jobs/${t}/cancel`,{data:s}=await(0,o.A)(i,a),{messages:l,jobStatus:c,progress:p}=$.fromJSON(s);return this.set({messages:l,jobStatus:c,progress:p}),"job-cancelled"===c?this:new Promise((t,r)=>{(0,d.u7)(a.signal,()=>{this.clearCancelJobTimer(),r((0,d.NK)())}),this.clearCancelJobTimer();const n=()=>{this._cancelJobTimer||r((0,d.NK)()),this.checkJobStatus(e).then(({jobStatus:e})=>{switch(e){case"job-cancelling":default:this._cancelJobTimer=setTimeout(n,K);break;case"job-deleted":case"job-deleting":case"job-executing":case"job-failed":case"job-new":case"job-submitted":case"job-succeeded":case"job-timed-out":case"job-waiting":r(this);break;case"job-cancelled":t(this)}}).catch(e=>{r(e)})};this._cancelJobTimer=setTimeout(n,K)})}destroy(){clearInterval(this._cancelJobTimer),clearInterval(this._jobCompletionTimer)}async checkJobStatus(e){const{path:t}=(0,b.Dl)(this.sourceUrl),r={...this.requestOptions,...e,query:{...e?.query,f:"json"}},n=`${t}/jobs/${this.jobId}`,{data:a}=await(0,o.A)(n,r),{messages:i,jobStatus:s,progress:d}=$.fromJSON(a);return this.set({messages:i,jobStatus:s,progress:d}),this}async fetchResultData(e,t,r){t=f.from(t||{});const{returnColumnName:n,returnFeatureCollection:a,returnM:i,returnZ:s,outSpatialReference:d}=t,{path:l}=(0,b.Dl)(this.sourceUrl),c=L({returnColumnName:n||null,returnFeatureCollection:a||null,returnM:i||null,returnZ:s||null,outSR:d,returnType:"data",f:"json",...r?.query},null),p={...this.requestOptions,...r,query:c},u=`${l}/jobs/${this.jobId}/results/${e}`,{data:y}=await(0,o.A)(u,p);return O(y)}async fetchResultImage(e,t,r){const{path:n}=(0,b.Dl)(this.sourceUrl),a=L({...t.toJSON(),f:"json"}),i={...this.requestOptions,...r,query:a},s=`${n}/jobs/${this.jobId}/results/${e}`,{data:d}=await(0,o.A)(s,i);return O(d)}async fetchResultMapImageLayer(){const{path:e}=(0,b.Dl)(this.sourceUrl),t=e.indexOf("/GPServer/"),n=`${e.slice(0,Math.max(0,t))}/MapServer/jobs/${this.jobId}`;return new(0,(await Promise.all([r.e(8278),r.e(7865),r.e(6554),r.e(564),r.e(7552),r.e(1214),r.e(2889),r.e(6614),r.e(4674),r.e(893),r.e(8468),r.e(2733)]).then(r.bind(r,7656))).default)({url:n})}async waitForJobCompletion(e={}){const{interval:t=K,signal:r,statusCallback:n,apiKey:a}=e;return new Promise((e,o)=>{(0,d.u7)(r,()=>{this.clearJobCompletionTimer(),o((0,d.NK)())}),this.clearJobCompletionTimer();const i=()=>{this._jobCompletionTimer||o((0,d.NK)()),this.checkJobStatus({query:{token:a}}).then(({jobStatus:r})=>{switch(r){case"job-succeeded":e(this);break;case"job-executing":case"job-new":case"job-submitted":case"job-waiting":n&&n(this),this._jobCompletionTimer=setTimeout(i,t);break;case"job-cancelled":case"job-cancelling":case"job-deleted":case"job-deleting":case"job-failed":case"job-timed-out":o(this);break;default:this._jobCompletionTimer=setTimeout(i,t)}}).catch(e=>{o(e)})};this._jobCompletionTimer=setTimeout(i,t)})}clearCancelJobTimer(){clearTimeout(this._cancelJobTimer),this._cancelJobTimer=void 0}clearJobCompletionTimer(){clearTimeout(this._jobCompletionTimer),this._jobCompletionTimer=void 0}};(0,p.Cg)([(0,y.MZ)()],V.prototype,"jobId",void 0),(0,p.Cg)([(0,A.e)(U,{ignoreUnknown:!1})],V.prototype,"jobStatus",void 0),(0,p.Cg)([(0,y.MZ)({type:[q.A]})],V.prototype,"messages",void 0),(0,p.Cg)([(0,y.MZ)()],V.prototype,"progress",void 0),(0,p.Cg)([(0,y.MZ)()],V.prototype,"requestOptions",void 0),(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],V.prototype,"sourceUrl",void 0),V=$=(0,p.Cg)([(0,y.$K)("esri.rest.support.JobInfo")],V);let z=class extends u.A{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1,this.dataModelTimestamp=null}};(0,p.Cg)([(0,y.MZ)()],z.prototype,"headerKeys",void 0),(0,p.Cg)([(0,y.MZ)()],z.prototype,"outSpatialReference",void 0),(0,p.Cg)([(0,y.MZ)()],z.prototype,"exceededTransferLimit",void 0),(0,p.Cg)([(0,y.MZ)()],z.prototype,"dataModelTimestamp",void 0),z=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphQueryResultHeader")],z);let J=class extends u.A{constructor(e){super(e),this.resultRows=[],this.resultHeader=new z}};(0,p.Cg)([(0,y.MZ)()],J.prototype,"resultRows",void 0),(0,p.Cg)([(0,y.MZ)()],J.prototype,"resultHeader",void 0),J=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphQueryResult")],J);let Q=class extends u.A{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new z}};(0,p.Cg)([(0,y.MZ)()],Q.prototype,"resultRowsStream",void 0),(0,p.Cg)([(0,y.MZ)()],Q.prototype,"resultHeader",void 0),Q=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],Q);var B=r(8631);let H=class extends _.o{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=!0,this.description="",this.fieldNames=[]}};(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],H.prototype,"name",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],H.prototype,"unique",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],H.prototype,"ascending",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],H.prototype,"description",void 0),(0,p.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],H.prototype,"fieldNames",void 0),H=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.FieldIndex")],H);let W=class extends _.o{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=!0,this.required=!1,this.defaultVisibility=!0,this.systemMaintained=null,this.role="esriGraphPropertyUNSPECIFIED",this.domain=null,this.defaultValue=null}};(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"name",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"alias",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"fieldType",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"geometryType",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"hasM",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"hasZ",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"nullable",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"editable",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"required",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"defaultVisibility",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],W.prototype,"systemMaintained",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"role",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],W.prototype,"domain",void 0),(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],W.prototype,"defaultValue",void 0),W=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphProperty")],W);let Y=class extends _.o{constructor(e){super(e),this.name=null,this.alias=null,this.role="Regular",this.strict=null,this.properties=[],this.fieldIndexes=[],this.type=null}};(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Y.prototype,"name",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Y.prototype,"alias",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Y.prototype,"role",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Y.prototype,"strict",void 0),(0,p.Cg)([(0,y.MZ)({type:[W],json:{write:!0}})],Y.prototype,"properties",void 0),(0,p.Cg)([(0,y.MZ)({type:[H],json:{write:!0}})],Y.prototype,"fieldIndexes",void 0),Y=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphObjectType")],Y);let X=class extends Y{constructor(e){super(e),this.type="entity"}};X=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.EntityType")],X);let ee=class extends Y{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};(0,p.Cg)([(0,y.MZ)({json:{write:!0}})],ee.prototype,"endPoints",void 0),ee=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.RelationshipType")],ee);let te=class extends _.o{constructor(e){super(e),this.value=null,this.behavior=null}};(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],te.prototype,"value",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],te.prototype,"behavior",void 0),te=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],te);let re=class extends _.o{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=[],this.entityTypes=[],this.relationshipTypes=[],this.metaEntityTypes=[],this.provenanceSourceTypeValues=[],this.domains=[]}};(0,p.Cg)([(0,y.MZ)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e?.getTime()}}}})],re.prototype,"timestamp",void 0),(0,p.Cg)([(0,y.MZ)({type:c.A,json:{write:!0}})],re.prototype,"spatialReference",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],re.prototype,"strict",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],re.prototype,"objectIdField",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],re.prototype,"globalIdField",void 0),(0,p.Cg)([(0,y.MZ)()],re.prototype,"arcgisManaged",void 0),(0,p.Cg)([(0,y.MZ)()],re.prototype,"identifierInfo",void 0),(0,p.Cg)([(0,y.MZ)()],re.prototype,"searchIndexes",void 0),(0,p.Cg)([(0,y.MZ)({type:[X],json:{write:!0}})],re.prototype,"entityTypes",void 0),(0,p.Cg)([(0,y.MZ)({type:[ee],json:{write:!0}})],re.prototype,"relationshipTypes",void 0),(0,p.Cg)([(0,y.MZ)({type:[X],json:{write:!0}})],re.prototype,"metaEntityTypes",void 0),(0,p.Cg)([(0,y.MZ)({type:[te],json:{write:!0}})],re.prototype,"provenanceSourceTypeValues",void 0),(0,p.Cg)([(0,y.MZ)({types:[B.g],json:{write:!0}})],re.prototype,"domains",void 0),re=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.DataModel")],re);let ne=class extends _.o{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1,this.supportsProvenance=!1}};(0,p.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],ne.prototype,"capabilities",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"supportsSearch",void 0),(0,p.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],ne.prototype,"supportedQueryFormats",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"allowGeometryUpdates",void 0),(0,p.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ne.prototype,"searchMaxRecordCount",void 0),(0,p.Cg)([(0,y.MZ)({type:Object,json:{write:!0}})],ne.prototype,"serviceCapabilities",void 0),(0,p.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ne.prototype,"maxRecordCount",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ne.prototype,"description",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ne.prototype,"copyrightText",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ne.prototype,"units",void 0),(0,p.Cg)([(0,y.MZ)({type:c.A,json:{write:!0}})],ne.prototype,"spatialReference",void 0),(0,p.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ne.prototype,"currentVersion",void 0),(0,p.Cg)([(0,y.MZ)({type:Object,json:{write:!0}})],ne.prototype,"dateFieldsTimeReference",void 0),(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ne.prototype,"serviceItemId",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"supportsDocuments",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"dataEditingNotSupported",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"schemaEditingNotSupported",void 0),(0,p.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ne.prototype,"supportsProvenance",void 0),ne=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.ServiceDefinition")],ne);let ae=class extends _.o{constructor(e){super(e),this.url=null,this.dataModel=null,this.serviceDefinition=null}};function oe(e,t,r){if(0!==e.error_code)throw new i.A(t,r,{errorCode:e.error_code,errorMessage:e.error_message})}function ie(e){return e?.error_code?new i.A("knowledgeGraphService:server-or-decoding-error",e.error_message,{errorCode:e.error_code}):void 0}function se(e,t,r,n=!1){const a=new r.ClientDataFetchRequestEncoder;a.deleteLater();for(const o of e){const e=de(o,t,r,n);a.add_client_data_fetch_request_parameter(e)}a.encode();const o=a.get_encoding_result();return oe(o.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(o.get_byte_buffer())}function de(e,t,r,n){const a=new r.ClientDataKey;a.deleteLater(),a.key_string=e;const o=new r.ClientDataFetchRequestParameter;o.deleteLater(),o.set_key(a);const i=t.get(e);return i&&!n&&(o.v_tag={v_tag:i.version}),o}(0,p.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ae.prototype,"url",void 0),(0,p.Cg)([(0,y.MZ)({type:re,json:{write:!0}})],ae.prototype,"dataModel",void 0),(0,p.Cg)([(0,y.MZ)({type:ne,json:{write:!0}})],ae.prototype,"serviceDefinition",void 0),ae=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.KnowledgeGraph")],ae);var le=r(45724),ce=r(48526),pe=r(86738),ue=r(39829),ye=r(82799);const ge={exclude:0,include:1};function he(e,t){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(me(e,t))}),r}function fe(e,t){const r=new t.ObjectValue;r.deleteLater();for(const[n,a]of Object.entries(e))r.set_key_value(n,me(a,t));return r}function we(e,t){if(e instanceof ce.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=r.geometry_type=t.esriGeometryType.esriGeometryMultipoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],a=[];a[0]=e.points.length;let o=0;return e.points.forEach(e=>{e.forEach(e=>{n[o]=e,o++})}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(a),r}(e,t);if(e instanceof pe.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=t.esriGeometryType.esriGeometryPoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],a=[];a[0]=1,n[0]=e.x,n[1]=e.y;let o=2;return e.hasZ&&(n[o]=e.z,o++),e.hasM&&(n[o]=e.m,o++),r.coords=new Float64Array(n),r.lengths=new Uint32Array(a),r}(e,t);if(e instanceof ye.A||e instanceof ue.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],a=[];let o=[];e instanceof ye.A?(r.geometry_type=t.esriGeometryType.esriGeometryPolyline,o=e.paths):e instanceof ue.A&&(r.geometry_type=t.esriGeometryType.esriGeometryPolygon,o=e.rings);let i=0,s=0;return o.forEach(e=>{let t=0;e.forEach(e=>{t++,e.forEach(e=>{n[s]=e,s++})}),a[i]=t,i++}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(a),r}(e,t);throw new i.A("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function me(e,t){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof l.A)return we(e,t);if(Array.isArray(e)){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(me(e,t))}),r}return fe(e,t)}var _e=r(49403);function ve(e,t){if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(!("originId"in e)){const r=new t.EntityValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,a]of Object.entries(e.properties))r.set_key_value(n,Re(a,t));return e.id&&r.set_id(e.id),r}if("originId"in e&&"destinationId"in e){const r=new t.RelationshipValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,a]of Object.entries(e.properties))r.set_key_value(n,Re(a,t));return e.id&&r.set_id(e.id),e.originId&&e.destinationId&&r.set_related_entity_ids(e.originId,e.destinationId),r}throw new i.A("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function be(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function Ce(e,t){const r=new t.GraphProperty;return r.deleteLater(),r.name=e.name,r.alias=e.alias??"",r.field_type={value:_e.r5[e.fieldType]},r.geometry_type={value:e.geometryType?_e.bV[e.geometryType]:_e.bV.esriGeometryNull},r.has_m=e.hasM??!1,r.has_z=e.hasZ??!1,r.nullable=e.nullable??!1,r.editable=e.editable,r.required=e.required,r.default_visibility=e.defaultVisibility,r.system_maintained=e.systemMaintained??!1,r.role={value:_e.ti[e.role]},r.default_value=Re(e.defaultValue,t),r.domain=e.domain??"",r}function Ae(e,t){const r=new t.SearchIndexProperties;r.deleteLater();for(const t of e.propertyNames)r.add_search_property_name(t);return r}function Me(e,t,r,n){const a=new t.Domain;a.deleteLater(),a.name=e.name;const o=_e.r5[r];a.field_type={value:o};let i=o;if(o!==_e.r5.esriFieldTypeTimeOnly&&o!==_e.r5.esriFieldTypeDateOnly&&o!==_e.r5.esriFieldTypeTimestampOffset||(i=_e.r5.esriFieldTypeString),n&&(a.merge_policy_type={value:_e.G3[n.mergePolicy]},a.split_policy_type={value:_e.GH[n.splitPolicy]}),"coded-value"===e.type){const r=e;a.type="codedValue";const n=new t.CodedValueDomain;n.deleteLater();for(const e of r.codedValues){const r=new t.CodedValue;r.deleteLater(),r.name=e.name,r.set_code(e.code,{value:i}),n.add_coded_value(r)}a.coded_value_domain=n}else if("range"===e.type){const r=e;a.type="range";const n=new t.RangeDomain;n.deleteLater(),n.add_value(r.minValue,{value:i}),n.add_value(r.maxValue,{value:i}),a.range_domain=n}else a.type=e.type??"unspecified";return a}function Ge(e,t,r){r.name=e.name,r.alias=e.alias??"",r.role={value:_e.Eq[e.role]},r.strict=e.strict;for(const n of e.properties){const e=Ce(n,t);r.add_property(e)}return r}function xe(e,t){return e.hasOwnProperty("alias")&&(t.alias=e.alias),t}function Re(e,t){return null==e?null:"object"!=typeof e||e instanceof Date?e:e instanceof l.A?we(e,t):null}function Te(e,t){const r=new t.EntityTypeReplicaDefinition;return r.deleteLater(),Pe(e,t,r),e.documentOptions&&(r.document_options=function(e,t){const r=e.includeConnectedDocuments?function(e,t){const r=Se(e.includeDocumentProvenance?{includeProvenance:!0,includeSourceDocuments:e.includeDocumentSourceDocuments}:{includeProvenance:!1},t),n=new t.IncludeConnectedDocuments(r);return n.deleteLater(),n}(e,t):void 0,n=new t.DocumentOptions(r);return n.deleteLater(),n}(e.documentOptions,t)),r}function De(e,t){const r=new t.RelationshipTypeReplicaDefinition;return r.deleteLater(),Pe(e,t,r),r}function Pe(e,t,r){if(r.type_name=e.typeName,r.open_cypher_where_clause=e.openCypherWhereClause??"",e.provenanceOptions&&(r.provenance_options=Se(e.provenanceOptions,t)),e.parameters)for(const[n,a]of Object.entries(e.parameters))void 0!==a&&r.add_parameter(n,me(a,t));return r}function Se(e,t){const r=function(e,t){const r=new t.IncludeProvenance("includeSourceDocuments"in e&&e.includeSourceDocuments);return r.deleteLater(),r}(e,t),n=new t.ProvenanceOptions(r);return n.deleteLater(),n}let ke=class extends u.A{constructor(e){super(e),this.decoderError=null,this.resultsCount=0,this.results=[],this.updatedKnowledgeGraph=null}};(0,p.Cg)([(0,y.MZ)()],ke.prototype,"decoderError",void 0),(0,p.Cg)([(0,y.MZ)()],ke.prototype,"resultsCount",void 0),(0,p.Cg)([(0,y.MZ)()],ke.prototype,"results",void 0),(0,p.Cg)([(0,y.MZ)()],ke.prototype,"updatedKnowledgeGraph",void 0),ke=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphDataModelOperationResult")],ke);const Ie=ke;let je=class extends Ie{constructor(e){super(e)}};je=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphAddFieldIndexResult")],je);const Ze=je;let Ee=class extends Ie{constructor(e){super(e),this.entityAddResultsCount=0,this.relationshipAddResultsCount=0,this.entityAddResults=[],this.relationshipAddResults=[]}};(0,p.Cg)([(0,y.MZ)()],Ee.prototype,"entityAddResultsCount",void 0),(0,p.Cg)([(0,y.MZ)()],Ee.prototype,"relationshipAddResultsCount",void 0),(0,p.Cg)([(0,y.MZ)()],Ee.prototype,"entityAddResults",void 0),(0,p.Cg)([(0,y.MZ)()],Ee.prototype,"relationshipAddResults",void 0),Ee=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphAddNamedTypesResult")],Ee);const Fe=Ee;let Ne=class extends Ie{constructor(e){super(e)}};Ne=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphAddPropertyResult")],Ne);const Oe=Ne;let Le=class extends u.A{constructor(e){super(e),this.decoderError=null,this.updatedKnowledgeGraph=null}};(0,p.Cg)([(0,y.MZ)()],Le.prototype,"decoderError",void 0),(0,p.Cg)([(0,y.MZ)()],Le.prototype,"updatedKnowledgeGraph",void 0),Le=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphDataModelSingletonOperationResult")],Le);const $e=Le;let qe=class extends Ie{constructor(e){super(e)}};qe=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphDeleteFieldIndexResult")],qe);const Ue=qe;let Ke=class extends Ie{constructor(e){super(e),this.warnings=[]}};(0,p.Cg)([(0,y.MZ)()],Ke.prototype,"warnings",void 0),Ke=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphDeleteNamedTypeResult")],Ke);const Ve=Ke;let ze=class extends Ie{constructor(e){super(e)}};ze=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphDeletePropertyResult")],ze);const Je=ze;let Qe=class extends Ie{constructor(e){super(e)}};Qe=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphUpdateNamedTypesResult")],Qe);const Be=Qe;let He=class extends Ie{constructor(e){super(e)}};He=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphUpdatePropertyResult")],He);const We=He;let Ye=class extends Ie{constructor(e){super(e)}};Ye=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphUpdateSearchIndexResult")],Ye);const Xe=Ye;function et(e,t){const r=[];for(let n=0;n<t;n++){const t=e.get_result_at(n);r.push({name:t.get_name(),error:ie(t.get_error())})}return r}function tt(e){const t=e.get_results_count(),r=e.get_entity_type_add_results_count(),n=e.get_relationship_type_add_results_count(),a=new Fe({resultsCount:t,results:et(e,t),decoderError:ie(e.error),entityAddResultsCount:r,relationshipAddResultsCount:n});for(let t=0;t<r;t++){const r=e.get_entity_type_add_results_at(t),n=r.get_name(),o=r.get_error();a.entityAddResults.push({name:n,error:ie(o)})}for(let t=0;t<n;t++){const r=e.get_relationship_type_add_results_at(t),n=r.get_name(),o=r.get_error();a.relationshipAddResults.push({name:n,error:ie(o)})}return a}function rt(e){const t=e.get_results_count();return new Be({resultsCount:t,results:et(e,t),decoderError:ie(e.error)})}function nt(e){const t=e.get_results_count(),r=[];for(let t=0;t<e.get_warnings_count();t++){const n=ie(e.get_warning_at(t));null!=n&&r.push(n)}const n=et(e,t);return new Ve({resultsCount:t,results:n,warnings:r,decoderError:ie(e.error)})}function at(e){const t=e.get_results_count();return new Oe({resultsCount:t,results:et(e,t),decoderError:ie(e.error)})}function ot(e){const t=e.get_results_count();return new Je({resultsCount:t,results:et(e,t),decoderError:ie(e.error)})}function it(e){const t=e.get_results_count();return new We({resultsCount:t,results:et(e,t),decoderError:ie(e.error)})}function st(e){const t=e.get_results_count();return new Xe({resultsCount:t,results:et(e,t),decoderError:ie(e.error)})}function dt(e){const t=e.get_results_count();return new Ze({resultsCount:t,results:et(e,t),decoderError:ie(e.error)})}function lt(e){const t=e.get_results_count();return new Ue({resultsCount:t,results:et(e,t),decoderError:ie(e.error)})}function ct(e){return new $e({decoderError:ie(e.error)})}var pt=r(93637),ut=r(64108),yt=r(39357),gt=r(53177),ht=r(76357),ft=r(41628);let wt=class extends u.A{constructor(e){super(e),this.name=null,this.supportedCategory="esriTypeUNSPECIFIED",this.analyzers=[],this.searchProperties=new Map}};(0,p.Cg)([(0,y.MZ)()],wt.prototype,"name",void 0),(0,p.Cg)([(0,y.MZ)()],wt.prototype,"supportedCategory",void 0),(0,p.Cg)([(0,y.MZ)()],wt.prototype,"analyzers",void 0),(0,p.Cg)([(0,y.MZ)()],wt.prototype,"searchProperties",void 0),wt=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.SearchIndex")],wt);var mt=r(25927),_t=(r(77901),r(40662)),vt=r(42095),bt=r(23150);function Ct(e,t){const r={paths:[],hasM:!1,hasZ:!1},n=At(e,r),{coords:a,geometry_type:o,lengths:s}=e;if(o.value!==t)throw new i.A("KnowledgeGraph:illegal-geometry-type","Illegal Geometry type for multipath conversion");let d=0;return s.forEach(e=>{const t=[];for(let r=0;r<e;r++){const e=[];for(let t=0;t<n;t++)e[t]=a[d],d++;t.push(e)}r.paths.push(t)}),r}function At(e,t){let r=2;return e.has_z?(t.hasZ=e.has_z,r++):t.hasZ=!1,e.has_m?(t.hasM=e.has_m,r++):t.hasM=!1,r}const Mt=()=>s.A.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors");function Gt(e,t){if(null==e)return null;if("object"!=typeof e)return e;if("getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case 1:return function(e,t){const r={spatialReference:t};let n=2;At(e,r);const a=e.coords;return r.x=a[0],r.y=a[1],e.has_z&&(r.z=a[n],n++),e.has_m&&(r.m=a[n]),new pe.A(r)}(e,t);case 2:return function(e,t){const r={spatialReference:t},n=At(e,r),a=e.lengths,o=e.coords,i=a[0];r.points=[];let s=0;for(let e=0;e<i;e++){const e=[];for(let t=0;t<n;t++)e[t]=o[s],s++;r.points.push(e)}return new ce.A(r)}(e,t);case 3:return function(e,t){const{paths:r,hasM:n,hasZ:a}=Ct(e,3);return new ye.A({paths:r,hasM:n,hasZ:a,spatialReference:t})}(e,t);case 4:return function(e,t){const{paths:r,hasM:n,hasZ:a}=Ct(e,4);return new ue.A({rings:r,hasM:n,hasZ:a,spatialReference:t})}(e,t);case 5:case 7:return Mt().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;default:return Mt().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}return Mt().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null}function xt(e,t,r){return((e,t,r)=>{if(!function(e){return null!=e&&"object"==typeof e&&"object_value_type"in e}(e))return Gt(e,r);if(t)switch(e.object_value_type.value){case 0:return function(e,t,r){return new _t.A(Tt(e,t,r))}(e,t,r);case 1:return Rt(e,t,r);case 2:return Dt(e,t,r);case 3:return function(e,t,r){const n=e.entity_count(),a=e.relationship_count(),o=[];for(let i=0;i<n;i++)o.push(Rt(e.get_entity_at(i),t,r)),i<a&&o.push(Dt(e.get_relationship_at(i),t,r));return new vt.A({path:o})}(e,t,r);case 4:return function(e,t,r){const n=[],a=e.count();for(let o=0;o<a;o++){const a=e.get_value_at(o);n.push(xt(a,t,r))}return n}(e,t,r);default:return Mt().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}return Mt().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null})(e,t,r)}function Rt(e,t,r){const n=e.type_name,a=Tt(e,t,r),o=e.get_id();return new mt.A(Object.assign({typeName:n,id:o},a))}function Tt(e,t,r){const n={},a=e.key_count();for(let o=0;o<a;o++)n[e.get_key_at(o)]=xt(e.get_value_at(o),t,r);return{properties:n}}function Dt(e,t,r){const n=e.type_name,a=Tt(e,t,r);return new bt.A(Object.assign({typeName:n,id:e.get_id(),originId:e.get_origin_entity_id(),destinationId:e.get_destination_entity_id()},a))}function Pt(e){const t=[];for(let r=0;r<e.get_header_keys().size();r++)t.push(e.get_header_keys().get(r));const r=new c.A(e.get_out_sr());return new z({headerKeys:t,outSpatialReference:r,exceededTransferLimit:e.exceeded_transfer_limit(),dataModelTimestamp:e.data_model_timestamp?new Date(e.data_model_timestamp):null})}let St=!1;function kt(e){return e.deleteLater(),new X(jt(e))}function It(e){return e.deleteLater(),new H({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:$t(e.fields)})}function jt(e){return{name:e.name,alias:e.alias,role:(0,pt.i7)(_e.Eq,e.role.value),strict:e.strict,properties:qt(e.properties),fieldIndexes:Ut(e.field_indexes)}}function Zt(e){return e.deleteLater(),new W({alias:e.alias,name:e.name,fieldType:(0,pt.i7)(_e.r5,e.field_type.value)??void 0,geometryType:(0,pt.i7)(_e.bV,e.geometry_type.value)??null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:(0,pt.i7)(_e.ti,e.role.value),defaultValue:Gt(e.default_value,new c.A({wkid:4326})),domain:e.domain})}let Et=class extends ht.A{};function Ft(e){return 2===e.get_domain_type().value?new ft.A({name:e.name,minValue:e.range_domain.value_at(0),maxValue:e.range_domain.value_at(1)}):1===e.get_domain_type().value?new gt.A({name:e.name,codedValues:Qt(e)}):new Et({name:e.name})}function Nt(e){e.deleteLater();const t=jt(e),r=[];for(let t=0;t<e.end_points.size();t++){const n=e.end_points.get(t);r.push({originEntityType:n.origin_entity_type,destinationEntityType:n.dest_entity_type})}return e.end_points.delete(),new ee(Object.assign({endPoints:r},t))}function Ot(e){return new te({behavior:e.behavior,value:e.value})}function Lt(e){const t=[];for(let r=0;r<e.size();r++)t.push(kt(e.get(r)));return e.delete(),t}function $t(e){const t=[];for(let r=0;r<e.size();r++)t.push(e.get(r));return e.delete(),t}function qt(e){const t=[];for(let r=0;r<e.size();r++){const n=Zt(e.get(r));"esriFieldTypeBigInteger"===n.fieldType&&(St=!0),t.push(n)}return e.delete(),t}function Ut(e){const t=[];for(let r=0;r<e.size();r++)t.push(It(e.get(r)));return e.delete(),t}function Kt(e){const t=[];for(let r=0;r<e.size();r++)t.push(Nt(e.get(r)));return e.delete(),t}function Vt(e){const t=[];for(let r=0;r<e.size();r++){const n=e.get(r);n.deleteLater(),t.push(Ot(n))}return e.delete(),t}function zt(e){const t=[];for(let r=0;r<e.size();r++){const n=new wt,a=e.get(r);n.name=a.name,n.supportedCategory=(0,pt.i7)(_e.nP,a.supported_category.value);const o=a.analyzers.size();for(let e=0;e<o;e++)n.analyzers.push({name:a.analyzers.get(e).name});a.analyzers.delete();for(let e=0;e<a.search_properties.keys().size();e++){const t=a.search_properties.keys().get(e),r=a.search_properties.get(t),o=[];for(let e=0;e<r.property_names.size();e++)o.push(r.property_names.get(e));n.searchProperties.set(t,{propertyNames:o})}t.push(n)}return e.delete(),t}function Jt(e){const t=[];for(let r=0;r<e.domains_count();r++){const n=e.domain_at(r);n.deleteLater(),t.push(Ft(n))}return t}function Qt(e){const t=[];for(let r=0;r<e.coded_value_domain.coded_values_count();r++){const n=e.coded_value_domain.coded_value_at(r);n.deleteLater(),t.push(new yt.A({name:n.name,code:n.get_code()}))}return t}Et=(0,p.Cg)([(0,ut.$)("esri.rest.knowledgeGraph.wasmInterface.wasmToDataModelFactories")],Et);let Bt=class extends u.A{constructor(e){super(e),this.asyncStatusUrl=null,this.createReplicaResult=null}};(0,p.Cg)([(0,y.MZ)()],Bt.prototype,"asyncStatusUrl",void 0),(0,p.Cg)([(0,y.MZ)()],Bt.prototype,"createReplicaResult",void 0),Bt=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.CreateReplicaResponse")],Bt);let Ht=class extends u.A{constructor(e){super(e),this.replicaName=null,this.replicaId=null,this.replicaOwner=null,this.lastSyncDate=null,this.creationDate=null,this.syncDirection=null,this.replicaFilters=null}};(0,p.Cg)([(0,y.MZ)()],Ht.prototype,"replicaName",void 0),(0,p.Cg)([(0,y.MZ)()],Ht.prototype,"replicaId",void 0),(0,p.Cg)([(0,y.MZ)()],Ht.prototype,"replicaOwner",void 0),(0,p.Cg)([(0,y.MZ)()],Ht.prototype,"lastSyncDate",void 0),(0,p.Cg)([(0,y.MZ)()],Ht.prototype,"creationDate",void 0),(0,p.Cg)([(0,y.MZ)()],Ht.prototype,"syncDirection",void 0),(0,p.Cg)([(0,y.MZ)()],Ht.prototype,"replicaFilters",void 0),Ht=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.ReplicaDefinition")],Ht);let Wt=class extends u.A{constructor(e){super(e),this.replicas=[]}};(0,p.Cg)([(0,y.MZ)()],Wt.prototype,"replicas",void 0),Wt=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.ReplicasInformationResponse")],Wt);let Yt=class extends u.A{constructor(e){super(e),this.decoderError=null,this.unregisterReplicaResults=[]}};(0,p.Cg)([(0,y.MZ)()],Yt.prototype,"decoderError",void 0),(0,p.Cg)([(0,y.MZ)()],Yt.prototype,"unregisterReplicaResults",void 0),Yt=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.UnregisterReplicaResponse")],Yt);const Xt=new c.A({wkid:4326});function er(e,t){const r=[];for(let n=0;n<e;n++){const e=ie(t.get_warning_at(n));e&&r.push(e)}return r}function tr(e,t){const r=[];for(let n=0;n<e;n++){const e=ie(t.get_error_at(n));e&&r.push(e)}return r}function rr(e){return{replicaName:e.get_replica_name(),replicaId:e.get_replica_id(),lastSyncDate:hr(e.get_last_sync_date())}}function nr(e){return{replicaId:e.get_replica_id(),error:e.has_error()?ie(e.get_error()):void 0}}function ar(e,t){const r=e.get_static_definition();return r.deleteLater(),{inputQuantizationParameters:void 0,inputSpatialReference:new c.A(e.input_spatial_reference),staticDefinition:or(r,t)}}function or(e,t){const r=[],n=[];for(let n=0;n<e.get_entity_type_replica_definition_count();n++){const a=e.get_entity_type_replica_definition_at(n);a.deleteLater(),r.push(ir(a,t))}for(let r=0;r<e.get_relationship_type_replica_definition_count();r++){const a=e.get_relationship_type_replica_definition_at(r);a.deleteLater(),n.push(sr(a,t))}return{entityTypeReplicaDefinitions:r,relationshipTypeReplicaDefinitions:n}}function ir(e,t){const r=e.document_options.get_include_connected_documents();return r?.deleteLater(),{...dr(e,t),documentOptions:r?cr(r):{includeConnectedDocuments:!1}}}function sr(e,t){return dr(e,t)}function dr(e,t){const r=e.provenance_options;r.deleteLater();const n={},a=e.get_parameter_count();for(let r=0;r<a;r++)n[e.get_parameter_key_at(r)]=lr(e.get_parameter_value_at(r),t);return{typeName:e.type_name,openCypherWhereClause:e.open_cypher_where_clause,provenanceOptions:pr(r),parameters:a?n:void 0}}function lr(e,t){return xt(e,t,Xt)}function cr(e){const t=e.get_provenance_options();t.deleteLater();const r=pr(t);return r.includeProvenance?{includeConnectedDocuments:!0,includeDocumentProvenance:!0,includeDocumentSourceDocuments:r.includeSourceDocuments}:{includeConnectedDocuments:!0,includeDocumentProvenance:!1}}function pr(e){const t=e.get_include_provenance();return t?{includeProvenance:!0,includeSourceDocuments:ur(t)}:{includeProvenance:!1}}function ur(e){return e.get_include_source_documents()}function yr(e,t){const r=e.value,n=t.SyncDirection;if(r===n.BIDIRECTIONAL.value)return"bidirectional";if(r===n.UPLOAD.value)return"upload";if(r===n.DOWNLOAD.value)return"download";throw new i.A("knowledge-graph:replica-invalid-sync-direction",`Unsupported replica sync direction value: ${r}`)}function gr(e){switch(e.value){case 0:return;case 1:return"pbf";case 2:return"spbf";case 3:return"geoparquet";case 4:return"sqlite";default:throw new i.A("knowledge-graph:replica-invalid-sync-data-format",`Unsupported replica sync data format value: ${e.value}`)}}function hr(e){return e?new Date(e):null}let fr=class extends u.A{constructor(e){super(e),this.hasError=!1,this.error=null,this.username=null,this.timestamp=null,this.editResults=[],this.cascadeRelationshipDeleteResults=[],this.cascadeProvenanceDeleteResults=[]}};(0,p.Cg)([(0,y.MZ)()],fr.prototype,"hasError",void 0),(0,p.Cg)([(0,y.MZ)()],fr.prototype,"error",void 0),(0,p.Cg)([(0,y.MZ)()],fr.prototype,"username",void 0),(0,p.Cg)([(0,y.MZ)()],fr.prototype,"timestamp",void 0),(0,p.Cg)([(0,y.MZ)()],fr.prototype,"editResults",void 0),(0,p.Cg)([(0,y.MZ)()],fr.prototype,"cascadeRelationshipDeleteResults",void 0),(0,p.Cg)([(0,y.MZ)()],fr.prototype,"cascadeProvenanceDeleteResults",void 0),fr=(0,p.Cg)([(0,y.$K)("esri.rest.knowledgeGraph.GraphApplyEditsResult")],fr);const wr=fr;function mr(e){const t=e.has_error(),r=function(e){const t=e.get_apply_edits_metadata();t.deleteLater();const r=t.get_username(),n=t.get_timestamp();return{username:r,timestamp:null!=n?new Date(n):null}}(e),n=new wr({hasError:t,error:t?ie(e.error):null});n.username=r.username,n.timestamp=r.timestamp;const a=e.get_edit_results_count();for(let t=0;t<a;t++){const r=e.get_edit_results_at(t);r.deleteLater();const a=e.get_edit_results_type_name_at(t),o=[],i=[],s=[],d=r.get_add_results_count(),l=r.get_update_results_count(),c=r.get_delete_results_count();for(let e=0;e<d;e++){const t=r.get_add_result_at(e);t.deleteLater(),o.push({id:t.id,error:ie(t.error)})}for(let e=0;e<l;e++){const t=r.get_update_result_at(e);t.deleteLater(),i.push({id:t.id,error:ie(t.error)})}for(let e=0;e<c;e++){const t=r.get_delete_result_at(e);t.deleteLater(),s.push({id:t.id,error:ie(t.error)})}n.editResults.push({typeName:a,adds:o,updates:i,deletes:s})}const o=e.get_cascaded_rel_deletes_count();for(let t=0;t<o;t++){const r=e.get_cascaded_rel_deletes_at(t);r.deleteLater();const a=e.get_cascaded_rel_deletes_type_name_at(t),o=[];for(let e=0;e<r.get_count();e++){const t=r.get_result_at(e);t.deleteLater(),o.push({id:t.id,originId:t.origin_id,destinationId:t.dest_id,error:ie(t.error)})}n.cascadeRelationshipDeleteResults.push({typeName:a,cascadeRelationshipDeletes:o})}if(e.has_cascading_provenance_deletes()){const t=e.get_cascading_provenance_deletes();t.deleteLater();const r=t.get_count();for(let e=0;e<r;e++){const r=t.get_result_at(e);r.deleteLater(),n.cascadeProvenanceDeleteResults.push({id:r.id,error:ie(r.error)})}}return n}const _r=new Map,vr=()=>new Map(_r.entries()),br={fetchKnowledgeGraph:async e=>{const t=new ae({url:e}),r=[];return r.push(Or(t)),r.push(Lr(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await cn(e)},refreshServiceDefinition:async e=>{const t=(await(0,o.A)(e.url,{query:{f:"json"}})).data;return t.capabilities=t?.capabilities?.split(","),t.supportedQueryFormats=t?.supportedQueryFormats?.split(","),e.serviceDefinition=new ne(t),e.serviceDefinition},executeFindPathsAsynchronous:async(e,t)=>{const r=e.inKnowledgeGraphUrl.split("/rest/services");if(r.length<2)throw new i.A("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=r[0],a=(await en(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,o=`/rest/services/${a&&a<12?"System":"Utilities"}/KnowledgeGraphServerToolsAsync/GPServer/ServerFilteredFindPaths`;return await Xr(`${n}${o}`,{in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:e.config.toJSON(),result_type:"STRING"},{},t)},executeFindPaths:async(e,t)=>{const r=e.inKnowledgeGraphUrl.split("/rest/services");if(r.length<2)throw new i.A("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=r[0],a=(await en(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,o=`/rest/services/${a&&a<12?"System":"Utilities"}/KnowledgeGraphServerTools/GPServer/ServerFilteredFindPaths/execute`,s=await en(`${n}${o}`,{method:"post",query:{f:"json",in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:JSON.stringify(e.config),result_type:"STRING"},...t});if(s.data.results.length<1)throw new i.A("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results returned",s);let d;for(const e of s.data.results)if("out_results_string"===e.paramName){d=e.value;break}if(!d)throw new i.A("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results were returned on the expected paramater out_results_string",s);return d},fetchAsynchronousFindPathsResultData:async(e,t)=>(await e.fetchResultData("out_results_string",null,t)).value,executeQueryStreaming:async(e,t,r)=>{const n=`${e.url}/graph/query`;await tn(e);const a=await nn(n,r);if(!e.serviceDefinition?.supportsProvenance&&"include"===t.provenanceBehavior)throw new i.A("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");a.data.body=await async function(e,t){const r=await(0,le.I)(),n=new r.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=r.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[t,a]of Object.entries(e.bindParameters))rn(t,a,n,r);if(e.bindGeometryQuantizationParameters)!function(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await Or(t),4326!==t.dataModel?.spatialReference?.wkid)throw new i.A("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=r.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&function(e,t,r){if(!e.extent)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);t.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:r.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}(e.outputQuantizationParameters,n,r),e.provenanceBehavior&&function(e,t){t.provenance_behavior={value:ge[e]}}(e.provenanceBehavior,n);try{n.encode()}catch(e){throw new i.A("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:e})}const a=n.get_encoding_result();if(0!==a.error.error_code)throw new i.A("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:a.error.error_code,errorMessage:a.error.error_message});return structuredClone(a.get_byte_buffer())}(t,e);const o=await Yr(a.data.url,a.data);if(e.dataModel){const t=await ln(o,e.dataModel);return new Q({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,r)=>{if(e.serviceDefinition?.dataEditingNotSupported||null!=e.dataModel.arcgisManaged&&!e.dataModel.arcgisManaged)throw new i.A("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await tn(e);const a=await nn(n,r);return a.data.body=await async function(e,t){if(t.dataModel||await Or(t),!t.dataModel)throw new i.A("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const r=await(0,le.I)(),n=!!e.options?.cascadeDelete,a=!!e.options?.cascadeProvenanceDelete,o=new r.GraphApplyEditsEncoder(r.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?be(e.options?.inputQuantizationParameters):r.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n,o.cascade_delete_provenance=a;try{let t;e.entityAdds?.forEach(e=>{t=o.add_entity(ve(e,r)),oe(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(e=>{if(!e.originId||!e.destinationId)throw new i.A("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");t=o.add_relationship(ve(e,r)),oe(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(e=>{if(!e.id)throw new i.A("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=o.update_entity(ve(e,r)),oe(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(e=>{if(!e.id)throw new i.A("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=o.update_relationship(ve(e,r)),oe(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(e=>{if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=o.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach(e=>{t.delete_by_id(e)})}),e.relationshipDeletes?.forEach(e=>{if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=o.make_delete_helper(e.typeName,!1);e.ids?.forEach(e=>{t.delete_by_id(e)})}),o.encode()}catch(e){throw new i.A("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:e})}const s=o.get_encoding_result();return oe(s.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(s.get_byte_buffer())}(t,e),async function(e){return an(e,(await(0,le.I)()).GraphApplyEditsDecoder,mr)}(await Yr(a.data.url,a.data))},executeAddNamedTypes:async(e,t,r)=>{if(!t.newEntityTypes?.length&&!t.newRelationshipTypes?.length)throw new i.A("knowledge-graph:no-arguments","The operation to add types to the data model contained no values");const n=`${e.url}/dataModel/edit/namedTypes/add`;await tn(e);const a=await nn(n,r);a.data.body=await async function(e){const t=await(0,le.I)(),r=new t.GraphNamedObjectTypeAddsRequestEncoder;r.deleteLater(),e.newEntityTypes?.forEach(e=>{r.add_entity_type(function(e,t){const r=new t.EntityType;return r.deleteLater(),Ge(e,t,r)}(e,t))}),e.newRelationshipTypes?.forEach(e=>{r.add_relationship_type(function(e,t){const r=new t.RelationshipType;r.deleteLater();for(const n of e.endPoints){const e=new t.EndPoint;e.deleteLater(),e.origin_entity_type=n.originEntityType,e.dest_entity_type=n.destinationEntityType,r.add_end_point(e)}return Ge(e,t,r)}(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed",{error:e})}const n=r.get_encoding_result();return oe(n.error,"knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed"),structuredClone(n.get_byte_buffer())}(t);const o=await Yr(a.data.url,a.data),s=await async function(e){return an(e,(await(0,le.I)()).GraphNamedObjectTypeAddsResponseDecoder,tt)}(o);return s.updatedKnowledgeGraph=await Nr(e.url),s},executeDeleteNamedType:async(e,t,r)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to delete a named type from the data model contained no value");const n=`${e.url}/dataModel/edit/namedTypes/${t}/delete`;await tn(e);const a=await nn(n,r);a.data.body="";const o=await Yr(a.data.url,a.data),s=await async function(e){return an(e,(await(0,le.I)()).GraphNamedObjectTypeDeleteResponseDecoder,nt)}(o);return s.updatedKnowledgeGraph=await Nr(e.url),s},executeUpdateNamedType:async(e,t,r,n)=>{if(!t&&!Object.keys(r).length)throw new i.A("knowledge-graph:no-arguments","The operation to update types in the data model contained missing or empty values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/update`;await tn(e);const o=await nn(a,n);o.data.body=await async function(e,t,r){const n=await(0,le.I)(),a=new n.GraphNamedObjectTypeUpdateRequestEncoder;if(a.deleteLater(),r.entityTypes.some(e=>e.name===t))a.update_entity_type(function(e,t){const r=new t.EntityType;return r.deleteLater(),xe(e,r)}(e,n));else{if(!r.relationshipTypes.some(e=>e.name===t))throw new i.A("knowledge-graph:updateNamedType-encoding-failed","The named type you are trying to update does not exist in the data model");a.update_relationship_type(function(e,t){const r=new t.RelationshipType;return r.deleteLater(),xe(e,r)}(e,n))}a.update_alias=e.hasOwnProperty("alias");try{a.encode()}catch(e){throw new i.A("knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed",{error:e})}const o=a.get_encoding_result();return oe(o.error,"knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed"),structuredClone(o.get_byte_buffer())}(r,t,e.dataModel);const s=await Yr(o.data.url,o.data),d=await async function(e){return an(e,(await(0,le.I)()).GraphNamedObjectTypeUpdateResponseDecoder,rt)}(s);return d.updatedKnowledgeGraph=await Nr(e.url),d},executeAddGraphProperties:async(e,t,r,n)=>{if(!t&&!r.length)throw new i.A("knowledge-graph:no-arguments","The operation to add properties to the data model contained missing or empty values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/fields/add`;await tn(e);const o=await nn(a,n);o.data.body=await async function(e){const t=await(0,le.I)(),r=new t.GraphPropertyAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_graph_property(Ce(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed",{error:e})}const n=r.get_encoding_result();return oe(n.error,"knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed"),structuredClone(n.get_byte_buffer())}(r);const s=await Yr(o.data.url,o.data),d=await async function(e){return an(e,(await(0,le.I)()).GraphPropertyAddsResponseDecoder,at)}(s);return d.updatedKnowledgeGraph=await Nr(e.url),d},executeDeleteGraphProperty:async(e,t,r,n)=>{if(!t&&!r)throw new i.A("knowledge-graph:no-arguments","The operation to delete property contained missing or empty values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/fields/delete`;await tn(e);const o=await nn(a,n);o.data.body=await async function(e){const t=new((await(0,le.I)()).GraphPropertyDeleteRequestEncoder);t.deleteLater(),t.field_name=e;try{t.encode()}catch(e){throw new i.A("knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed",{error:e})}const r=t.get_encoding_result();return oe(r.error,"knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed"),structuredClone(r.get_byte_buffer())}(r);const s=await Yr(o.data.url,o.data),d=await async function(e){return an(e,(await(0,le.I)()).GraphPropertyDeleteResponseDecoder,ot)}(s);return d.updatedKnowledgeGraph=await Nr(e.url),d},executeUpdateGraphProperty:async(e,t,r,n,a)=>{if(!t&&!r&&!Object.keys(n).length)throw new i.A("knowledge-graph:no-arguments","The operation to update properties in the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/update`;await tn(e);const s=await nn(o,a);s.data.body=await async function(e,t){const r=await(0,le.I)(),n=new r.GraphPropertyUpdateRequestEncoder;n.deleteLater(),n.update_graph_property(function(e,t){const r=new t.GraphProperty;return r.deleteLater(),e.hasOwnProperty("alias")&&(r.alias=e.alias),e.hasOwnProperty("editable")&&(r.editable=e.editable),e.hasOwnProperty("required")&&(r.required=e.required),e.hasOwnProperty("defaultVisibility")&&(r.default_visibility=e.defaultVisibility),e.hasOwnProperty("defaultValue")&&(r.default_value=Re(e.defaultValue,t)),e.hasOwnProperty("domain")&&(r.domain=e.domain),r}(t,r)),n.set_property_name(e),n.update_alias=t.hasOwnProperty("alias"),n.update_editable=t.hasOwnProperty("editable"),n.update_required=t.hasOwnProperty("required"),n.update_visible=t.hasOwnProperty("defaultVisibility"),n.update_default_value=t.hasOwnProperty("defaultValue"),n.update_domain=t.hasOwnProperty("domain");try{n.encode()}catch(e){throw new i.A("knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed",{error:e})}const a=n.get_encoding_result();return oe(a.error,"knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed"),structuredClone(a.get_byte_buffer())}(r,n);const d=await Yr(s.data.url,s.data),l=await async function(e){return an(e,(await(0,le.I)()).GraphPropertyUpdateResponseDecoder,it)}(d);return l.updatedKnowledgeGraph=await Nr(e.url),l},executeAddGraphFieldIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!r?.length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/add`;await tn(e);const o=await nn(a,n);o.data.body=await async function(e){const t=await(0,le.I)(),r=new t.GraphIndexAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_field_index(function(e,t){const r=new t.FieldIndex;r.deleteLater(),r.name=e.name,r.unique=e.unique,r.ascending=e.ascending,r.description=e.description??"";for(const t of e.fieldNames)r.add_field(t);return r}(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed",{error:e})}const n=r.get_encoding_result();return oe(n.error,"knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed"),structuredClone(n.get_byte_buffer())}(r);const s=await Yr(o.data.url,o.data),d=await async function(e){return an(e,(await(0,le.I)()).GraphIndexAddsResponseDecoder,dt)}(s);return d.updatedKnowledgeGraph=await Nr(e.url),d},executeDeleteGraphFieldIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!r?.length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/delete`;await tn(e);const o=await nn(a,n);o.data.body=await async function(e){const t=new((await(0,le.I)()).GraphIndexDeleteRequestEncoder);t.deleteLater(),e.forEach(e=>{t.add_index_name(e)});try{t.encode()}catch(e){throw new i.A("knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed",{error:e})}const r=t.get_encoding_result();return oe(r.error,"knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed"),structuredClone(r.get_byte_buffer())}(r);const s=await Yr(o.data.url,o.data),d=await async function(e){return an(e,(await(0,le.I)()).GraphIndexDeleteResponseDecoder,lt)}(s);return d.updatedKnowledgeGraph=await Nr(e.url),d},executeUpdateSearchIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!Object.keys(r.addSearchProperties??{}).length&&!Object.keys(r.removeSearchProperties??{}).length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty properties values");const a=`${e.url}/dataModel/searchIndex/update`;await tn(e);const o=await nn(a,n);o.data.body=await async function(e,t){const r=await(0,le.I)(),n=new r.GraphUpdateSearchIndexRequestEncoder;n.deleteLater(),t.hasOwnProperty("addSearchProperties")&&n.insert_add_search_property(e,Ae(t.addSearchProperties,r)),t.hasOwnProperty("removeSearchProperties")&&n.insert_delete_search_property(e,Ae(t.removeSearchProperties,r));try{n.encode()}catch(e){throw new i.A("knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed",{error:e})}const a=n.get_encoding_result();return oe(a.error,"knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed"),structuredClone(a.get_byte_buffer())}(t,r);const s=await Yr(o.data.url,o.data),d=await async function(e){return an(e,(await(0,le.I)()).GraphUpdateSearchIndexResponseDecoder,st)}(s);return d.updatedKnowledgeGraph=await Nr(e.url),d},executeAddDomain:async(e,t,r,{mergePolicy:n="esriMergePolicyTypeDefaultValue",splitPolicy:a="esriSplitPolicyTypeDefaultValue"},o)=>{const s=`${e.url}/dataModel/domains/add`;await tn(e);const d=await nn(s,o);d.data.body=await async function(e,t,r){const n=await(0,le.I)(),a=new n.GraphDomainAddRequestEncoder;a.deleteLater(),a.set_domain(Me(e,n,t,r));try{a.encode()}catch(e){throw new i.A("knowledge-graph:addDomain-encoding-failed","Attempting to encode the domain failed",{error:e})}const o=a.get_encoding_result();return oe(o.error,"knowledge-graph:addDomain-encoding-failed","Attempting to encode the domain failed"),structuredClone(o.get_byte_buffer())}(t,r,{mergePolicy:n,splitPolicy:a});const l=await Yr(d.data.url,d.data),c=await async function(e){return an(e,(await(0,le.I)()).GraphDomainAddResponseDecoder,ct)}(l);return c.updatedKnowledgeGraph=await Nr(e.url),c},executeUpdateDomain:async(e,t,r,n,a)=>{const o=`${e.url}/dataModel/domains/${t.name}/update`;await tn(e);const s=await nn(o,a);s.data.body=await async function(e,t,r){const n=await(0,le.I)(),a=new n.GraphDomainUpdateRequestEncoder;a.deleteLater(),a.set_domain(Me(e,n,t,r)),a.update_domain=!0,r?.mergePolicy&&(a.update_merge_policy=!0),r?.splitPolicy&&(a.update_split_policy=!0);try{a.encode()}catch(e){throw new i.A("knowledge-graph:updateDomain-encoding-failed","Attempting to encode the domain failed",{error:e})}const o=a.get_encoding_result();return oe(o.error,"knowledge-graph:updateDomain-encoding-failed","Attempting to encode the domain failed"),structuredClone(o.get_byte_buffer())}(t,r,n);const d=await Yr(s.data.url,s.data),l=await async function(e){return an(e,(await(0,le.I)()).GraphDomainUpdateResponseDecoder,ct)}(d);return l.updatedKnowledgeGraph=await Nr(e.url),l},executeDeleteDomain:async(e,t,r)=>{const n=`${e.url}/dataModel/domains/${t}/delete`;if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to delete a domain from the data model contained missing or empty domain name");await tn(e);const a=await nn(n,r);a.data.body="";const o=await Yr(a.data.url,a.data),s=await async function(e){return an(e,(await(0,le.I)()).GraphDomainDeleteResponseDecoder,ct)}(o);return s.updatedKnowledgeGraph=await Nr(e.url),s},executeCreateReplica:async(e,t,r)=>{const n=`${e.url}/replicas/create`;await tn(e);const a=await nn(n,r);return a.data.body=await async function(e){const t=function(e,t){const r=new t.CreateReplicaRequestEncoder;return r.deleteLater(),e.requestedReplicaId&&(r.replica_id=e.requestedReplicaId),e.requestedReplicaName&&(r.requested_replica_name=e.requestedReplicaName),r.sync_direction=function(e,t){const r=t.SyncDirection,n=e.toUpperCase(),a=r?.[n];if(!a)throw new i.A("knowledge-graph:replica-invalid-sync-direction",`Unsupported replica sync direction: ${e}`);return a}(e.syncDirection,t),r.sync_data_format=function(e,t){const r=t.SyncDataFormat,n=e.toUpperCase(),a=r?.[n];if(!a)throw new i.A("knowledge-graph:replica-invalid-sync-data-format",`Unsupported replica sync data format: ${e}`);return a}(e.syncDataFormat,t),r.async=!1,"reference"===e.type&&(r.reference_replica=function(e,t){const r=new t.ReferenceReplica;return r.deleteLater(),r.replica_id=e.replicaId,r}(e.referenceReplica,t)),"filter"===e.type&&(r.replica_filters=function(e,t){const r=e.inputQuantizationParameters?be(e.inputQuantizationParameters):t.InputQuantizationUtil.WGS84_lossless(),n=function(e,t){const r=new t.StaticDefinition;r.deleteLater();const n=e.entityTypeReplicaDefinitions??[],a=e.relationshipTypeReplicaDefinitions??[];if(n.length<1&&a.length<1)throw new i.A("knowledge-graph:replica-invalid-static-definition","A Filter Replica static definition must include at least one entity type or relationship type replica definition");for(const e of n)r.add_entity_type_replica_definition(Te(e,t));for(const e of a)r.add_relationship_type_replica_definition(De(e,t));return r}(e.staticDefinition,t),a=new t.ReplicaFilters(n);return a.deleteLater(),a.input_quantization_parameters=r,e.inputSpatialReference&&(a.input_spatial_reference=e.inputSpatialReference),a}(e.replicaFilters,t)),r}(e,await(0,le.I)());try{t.encode()}catch(e){throw new i.A("knowledge-graph:createReplica-encoding-failed","Attempting to encode createReplica failed",{error:e})}const r=t.get_encoding_result();return oe(r.error,"knowledge-graph:createReplica-encoding-failed","Attempting to encode createReplica failed"),structuredClone(r.get_byte_buffer())}(t),async function(e){const t=e.headers.get("content-type");if(t?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),r=new((await(0,le.I)()).CreateReplicaResponseDecoder);try{return r.decode(new Uint8Array(t)),r.has_error()&&oe(r.error,"knowledge-graph:createReplica-decoding-error","An error occurred while decoding the createReplica response"),function(e){const t=new Bt;if(e.has_async_status_url()&&(t.asyncStatusUrl=e.get_async_status_url()),e.has_create_replica_result()){const r=e.get_create_replica_result();r.deleteLater(),t.createReplicaResult=function(e){return{errors:tr(e.get_error_count(),e),warnings:er(e.get_warning_count(),e),replicaName:e.get_replica_name(),requestedReplicaName:e.get_requested_replica_name(),replicaId:e.get_replica_id(),syncDate:hr(e.get_sync_date()),replicaDataFormat:gr(e.get_replica_data_format()),replicaDataUrl:e.get_replica_data_url()}}(r)}return t}(r)}finally{r.deleteLater()}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response for createReplica",{responseType:t,data:await e.text()})}(await Yr(a.data.url,a.data))},fetchReplicaDefinition:async(e,t,r)=>{const n=`${e.url}/replicas/${t}`,a=await(0,o.A)(n,{responseType:"array-buffer",query:{f:"pbf",...r?.query},signal:r?.signal,timeout:r?.timeout}),s=a.getHeader?.("content-type"),d=a.data;if(s?.includes("application/x-protobuf")){const t=await(0,le.I)(),r=new t.ReplicaDefinitionResponseDecoder;return r.deleteLater(),r.decode(new Uint8Array(d)),r.has_error()&&oe(r.error,"knowledge-graph:fetchReplica-decoding-error","An error occurred while decoding the replica definition response"),function(e,t,r){const n=e.get_replica_definition();n.deleteLater();const a=n.get_replica_filters();return a.deleteLater(),new Ht({replicaName:n.get_replica_name(),replicaId:n.get_replica_id(),replicaOwner:n.get_replica_owner(),lastSyncDate:hr(n.get_last_sync_date()),creationDate:hr(n.get_creation_date()),syncDirection:yr(n.get_sync_direction(),t),replicaFilters:ar(a,r)})}(r,t,e.dataModel)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching a replica",{responseType:s,data:a.data})},fetchReplicasInformation:async(e,t)=>{const r=`${e.url}/replicas`,n=await(0,o.A)(r,{responseType:"array-buffer",query:{f:"pbf",...t?.query},signal:t?.signal,timeout:t?.timeout}),a=n.getHeader?.("content-type"),s=n.data;if(a?.includes("application/x-protobuf")){const e=new((await(0,le.I)()).ReplicasResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(s)),e.has_error()&&oe(e.error,"knowledge-graph:fetchReplicasInformation-decoding-error","An error occurred while decoding the replicas information response"),function(e){const t=[];for(let r=0;r<e.get_replicas_count();r++){const n=e.get_replica_info_at(r);n.deleteLater(),t.push(rr(n))}return new Wt({replicas:t})}(e)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching replicas information",{responseType:a,data:n.data})},executeUnregisterReplica:async(e,t,r)=>{if(!0===t.unregisterAll&&"replicaIds"in t)throw new i.A("knowledge-graph:no-arguments","The operation to unregister replicas cannot include replica ids when unregisterAll is true");if(!0!==t.unregisterAll){const e="replicaIds"in t?t.replicaIds:void 0;if(!Array.isArray(e)||!e.some(e=>!!e))throw new i.A("knowledge-graph:no-arguments","The operation to unregister replicas requires at least one replica id")}const n=`${e.url}/replicas/unregister`;await tn(e);const a=await nn(n,r);return a.data.body=await async function(e){const t=function(e,t){const r=new t.UnregisterReplicaRequestEncoder;if(r.deleteLater(),e.unregisterAll)r.set_unregister_all();else{const{replicaIds:t=[]}=e;t.forEach(e=>r.add_replica_id(e))}return r}(e,await(0,le.I)());try{t.encode()}catch(e){throw new i.A("knowledge-graph:unregisterReplica-encoding-failed","Attempting to encode unregisterReplica failed",{error:e})}const r=t.get_encoding_result();return oe(r.error,"knowledge-graph:unregisterReplica-encoding-failed","Attempting to encode unregisterReplica failed"),structuredClone(r.get_byte_buffer())}(t),async function(e){const t=e.headers.get("content-type");if(t?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),r=new((await(0,le.I)()).UnregisterReplicaResponseDecoder);try{return r.decode(new Uint8Array(t)),r.has_error()&&oe(r.error,"knowledge-graph:unregisterReplica-decoding-error","An error occurred while decoding the unregisterReplica response"),function(e){const t=[];for(let r=0;r<e.get_unregister_replica_result_count();r++){const n=e.get_unregister_replica_result_at(r);n.deleteLater(),t.push(nr(n))}return new Yt({decoderError:ie(e.error)??null,unregisterReplicaResults:t})}(r)}finally{r.deleteLater()}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response for unregisterReplica",{responseType:t,data:await e.text()})}(await Yr(a.data.url,a.data))},executeQuery:async(e,t,r)=>{const n=`${e.url}/graph/query`,a=await(0,o.A)(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:t.openCypherQuery,...r?.query},signal:r?.signal,timeout:r?.timeout}),s=a.getHeader?.("content-type"),d=a.data;if(s?.includes("application/x-protobuf")){const t=new((await(0,le.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=dn({wasmQueryDecoder:t,newArrayBufferToParse:d,dataModel:e.dataModel});return new J({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:a.data})},executeSearch:async(e,t,r)=>{const n="provenance"===t.typeCategoryFilter?"metaEntityProvenance":t.typeCategoryFilter,a=`${e.url}/graph/search`,s=await(0,o.A)(a,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${t.searchQuery}"`,typeCategoryFilter:n,...r?.query},signal:r?.signal,timeout:r?.timeout}),d=s.getHeader?.("content-type"),l=s.data;if(d?.includes("application/x-protobuf")){const t=new((await(0,le.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=dn({wasmQueryDecoder:t,newArrayBufferToParse:l,dataModel:e.dataModel});return new J({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:d,data:s.data})},executeSearchStreaming:async(e,t,r)=>{const n=`${e.url}/graph/search`;await tn(e);const a=await nn(n,r);a.data.body=await async function(e){const t=await(0,le.I)(),r=new t.GraphSearchRequestEncoder;r.deleteLater(),r.search_query=e.searchQuery;const n="provenance"===e.typeCategoryFilter?"meta_entity_provenance":e.typeCategoryFilter;if(r.type_category_filter=t.esriNamedTypeCategory[n],!0===e.returnSearchContext&&(r.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(r.start_index=e.start),null!=e.num&&(r.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{r.set_ids_filter(he(e.idsFilter,t))}catch(e){throw new i.A("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:e})}e.namedTypesFilter?.forEach(e=>{r.add_named_type_filter(e)});try{r.encode()}catch(e){throw new i.A("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:e})}const a=r.get_encoding_result();if(0!==a.error.error_code)throw new i.A("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:a.error.error_code,errorMessage:a.error.error_message});return structuredClone(a.get_byte_buffer())}(t);const o=await Yr(a.data.url,a.data);if(e.dataModel){const t=await ln(o,e.dataModel);return new Q({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,t,r={ignoreCache:!1})=>{if(!t.length)return new Map;let n=_r.get(e.url||"");n||(n=new Map,_r.set(e.url||"",n));const a=new Map(n.entries()),o=`${e.url}/clientData/fetch`;t=Array.from(new Set(t));const s=await(0,le.I)(),d=se(t,n,s,r.ignoreCache),l=await nn(o,r.requestOptions);l.data.body=d;const c=await Yr(l.data.url,l.data),p=c.headers.get("content-type");if(p?.includes("application/x-protobuf")){const e=new s.ClientDataFetchResponseDecoder;e.deleteLater();const t=await c.arrayBuffer();return e.decode(new Uint8Array(t)),e.has_error()&&oe(e.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),function(e,t,r,n=!1){const a=new Map;for(let o=0;o<e.get_results_count();o++){const i=e.get_result_at(o);if(2!==i.get_fetch_result_case().value||0!==i.error().error_code){const e=i.get_key().key_string;r.has(e)&&t.delete(e);continue}const s=i.get_value(),d=i.get_key().key_string,l=r.get(d);let c;if(2===s.get_data_case().value&&l)c=l.value;else{if(1!==s.get_data_case().value)continue;{c=s.get_data().client_data_string;const e=i.get_value().get_v_tag().v_tag;n||t.set(d,{key:d,version:e,value:c})}}a.set(d,c)}return a}(e,n,a,r.ignoreCache)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:p,data:c})},fetchAllClientDataKeys:async(e,t)=>{const r=`${e.url}/clientData`,n=await(0,o.A)(r,{responseType:"array-buffer",query:{f:"pbf"},signal:t?.signal,timeout:t?.timeout}),a=n.getHeader?.("content-type"),s=n.data;if(a?.includes("application/x-protobuf")){const e=new((await(0,le.I)()).ClientDataKeysResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(s)),e.has_error()&&oe(e.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),function(e){const t=e.get_keys(),r=new Array;for(let e=0;e<t.get_keys_count();e++){const n=t.get_key_at(e);1===n.get_client_data_key_type().value&&r.push(n.key_string)}return r}(e)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:a,data:n.data})},clearClientDataCache:()=>_r.clear(),_fetchWrapper:async(e,t)=>fetch(e,t),_submitJobWrapper:async(e,t,r,n)=>async function(e,t,r,n){return r=f.from(r||{}),async function(e,t,r,n,a){const i={},s={},d=[];return function(e,t,r){for(const n in e){const a=e[n];if(a&&"object"==typeof a&&a instanceof x.A){const{features:e}=a;r[n]=[t.length,t.length+e.length],e.forEach(e=>{t.push(e.geometry)})}}}(n,d,i),(0,w.el)(d).then(d=>{const{outSpatialReference:l,processExtent:c,processSpatialReference:p,returnColumnName:u,returnFeatureCollection:y,returnM:g,returnZ:h}=r,{path:f}=(0,b.Dl)(e);for(const e in i){const[t,r]=i[e];s[e]=d.slice(t,r)}const w=l?l.wkid||l:null,m=p?p.wkid||p:null,_="execute"===t?{returnColumnName:u||void 0,returnFeatureCollection:y||void 0,returnM:g||void 0,returnZ:h||void 0}:null,v=L({...c?{context:{extent:c,outSR:w,processSR:m}}:{"env:outSR":w,"env:processSR":m},...n,..._,f:"json"},null,s),C={...a,query:v};return(0,o.A)(`${f}/${t}`,C)})}(e,"submitJob",r,t??{},n).then(({data:t})=>{const r=V.fromJSON(t);return r.sourceUrl=e,r})}(e,t,r,n),_esriRequestWrapper:async(e,t)=>(0,o.A)(e,t)};async function Cr(e,t,r){return br.executeApplyEdits(e,t,r)}async function Ar(e,t,r){return br.executeAddNamedTypes(e,t,r)}async function Mr(e,t,r){return br.executeDeleteNamedType(e,t,r)}async function Gr(e,t,r,n){return br.executeUpdateNamedType(e,t,r,n)}async function xr(e,t,r,n){return br.executeAddGraphProperties(e,t,r,n)}async function Rr(e,t,r,n){return br.executeDeleteGraphProperty(e,t,r,n)}async function Tr(e,t,r,n,a){return br.executeUpdateGraphProperty(e,t,r,n,a)}async function Dr(e,t,r,n){return br.executeAddGraphFieldIndex(e,t,r,n)}async function Pr(e,t,r,n){return br.executeDeleteGraphFieldIndex(e,t,r,n)}async function Sr(e,t,r,n){return br.executeUpdateSearchIndex(e,t,r,n)}async function kr(e,t,r){return br.executeQuery(e,t,r)}async function Ir(e,t,r){return br.executeQueryStreaming(e,t,r)}async function jr(e,t,r){return br.executeSearch(e,t,r)}async function Zr(e,t,r){return br.executeSearchStreaming(e,t,r)}function Er(e,t){return br.fetchAllClientDataKeys(e,t)}function Fr(e,t,r){return br.fetchClientDataAtKeys(e,t,r)}async function Nr(e){return br.fetchKnowledgeGraph(e)}async function Or(e){return br.refreshDataModel(e)}async function Lr(e){return br.refreshServiceDefinition(e)}async function $r(e,t){return br.executeFindPathsAsynchronous(e,t)}async function qr(e,t){return br.executeFindPaths(e,t)}async function Ur(e,t){return br.fetchAsynchronousFindPathsResultData(e,t)}async function Kr(e,t,r,n={mergePolicy:"esriMergePolicyTypeDefaultValue",splitPolicy:"esriSplitPolicyTypeDefaultValue"},a){return br.executeAddDomain(e,t,r,n,a)}async function Vr(e,t,r,n,a){return br.executeUpdateDomain(e,t,r,n,a)}async function zr(e,t,r){return br.executeDeleteDomain(e,t,r)}async function Jr(e,t,r){return br.executeCreateReplica(e,t,r)}async function Qr(e,t,r){return br.fetchReplicaDefinition(e,t,r)}async function Br(e,t){return br.fetchReplicasInformation(e,t)}async function Hr(e,t,r){return br.executeUnregisterReplica(e,t,r)}function Wr(){return br.clearClientDataCache()}async function Yr(e,t){return br._fetchWrapper(e,t)}async function Xr(e,t,r,n){return br._submitJobWrapper(e,t,r,n)}async function en(e,t){return br._esriRequestWrapper(e,t)}async function tn(e){const t=a.id?.findCredential(e.url);t||(e.dataModel?await cn(e):await Or(e))}function rn(e,t,r,n){null==t?r.set_param_key_value(e,""):"object"!=typeof t||t instanceof Date?r.set_param_key_value(e,t):t instanceof l.A?r.set_param_key_value(e,we(t,n)):Array.isArray(t)?r.set_param_key_value(e,he(t,n)):r.set_param_key_value(e,fe(t,n))}async function nn(e,t){return(0,o.A)(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...t?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:t?.signal,timeout:t?.timeout})}async function an(e,t,r){const n=e.headers.get("content-type");if(n?.includes("application/x-protobuf")){const n=await e.arrayBuffer(),a=new t;try{return a.decode(new Uint8Array(n)),r(a)}finally{a.deleteLater()}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:await e.text()})}let on=50;function sn(e){on=e}function dn({wasmQueryDecoder:e,newArrayBufferToParse:t,dataModel:r,decodedHeader:n,limitMaxProcessingTime:a=!1}){t&&e.push_buffer(new Uint8Array(t));const o=[];let s,d,l=0;const p=Date.now();let u=!0;for(;e.next_row();){s&&d||(s=n??Pt(e),d=s.outSpatialReference??new c.A({wkid:4326})),l||(l=e.get_header_keys().size());const t=new Array(l);for(let n=0;n<l;n++){const a=e.get_value(n);t[n]=xt(a,r,d)}if(o.push(t),a&&Date.now()-p>on){u=!1;break}}if(e.has_error())throw new i.A("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - inner row decoding",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return{resultHeader:s,resultRows:o,parsedAllResultsFromBuffer:u}}async function ln(e,t){const r=e.headers.get("content-type");if(e.headers.get("content-length")&&s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("Found `Content-Length` header when expecting a streaming HTTP response! Please investigate whether all intermediate HTTP proxies and/or load balancers are configured such that they don't forcefully buffer the entire response before returning it to the client. A valid HTTP streaming response should use Chunked Transfer Encoding and not have a Content Length defined."),r?.includes("application/x-protobuf")){const r=e.body?.getReader(),n=new((await(0,le.I)()).GraphQueryDecoder);let a,o,l;n.deleteLater();const c=new Promise((e,t)=>{o=e,l=t});let p=!1,u=null;const y=new ReadableStream({pull:async function e(c){if(!r){const e=new i.A("knowledge-graph:stream-decoding-error","Error reading from stream - reader is undefined");throw l(e),e}const{done:y,value:g}=u?{done:!1,value:null}:await r.read().catch(e=>{throw l(e),r.releaseLock(),e});g&&(u=g);try{if(y){let e;if(n.has_error()?e=new i.A("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:n.error.error_code,errorMessage:n.error.error_message}):p||o(new z),r.releaseLock(),e)throw c.error(e),l(e),e;return void c.close()}const{resultHeader:s,resultRows:d,parsedAllResultsFromBuffer:h}=dn({wasmQueryDecoder:n,newArrayBufferToParse:g,dataModel:t,decodedHeader:a,limitMaxProcessingTime:!0});return h&&(u=null),!a&&s&&(a=s,o(s),p=!0),d.length>0?void c.enqueue(d):await e(c)}catch(e){throw s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(e),l(e),r.releaseLock(),(0,d.zf)(e)?e:new i.A("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:e})}}});return{readableStream:y,resultHeader:await c}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}async function cn(e){const t=`${e.url}/dataModel/queryDataModel`,r=await(0,o.A)(t,{responseType:"array-buffer",query:{f:"pbf"}}),n=r.getHeader?.("content-type"),a=r.data;if(n?.includes("application/x-protobuf")){const e=(await(0,le.I)()).decode_data_model_from_protocol_buffer(new Uint8Array(a));if(!e)throw new i.A("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return function(e){e.deleteLater(),St=!1;const t=new re({timestamp:e.timestamp,spatialReference:new c.A(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:(0,pt.i7)(_e.vy,e.identifier_info?.identifier_mapping_info?.identifier_info_type?.value),databaseNativeIdentifier:e.identifier_info?.identifier_mapping_info?.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:e.identifier_info?.identifier_mapping_info?.uniform_property_identifier?.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:(0,pt.i7)(_e.wr,e.identifier_info?.identifier_generation_info?.uuid_method_hint?.value)}},searchIndexes:zt(e.search_indexes),entityTypes:Lt(e.entity_types),relationshipTypes:Kt(e.relationship_types),metaEntityTypes:Lt(e.meta_entity_types),provenanceSourceTypeValues:Vt(e.provenance_source_type_values.value_behavior_array),domains:Jt(e)});return St&&s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("A big integer field was detected in the retrieved data model. The `big-integer` field type is not fully supported in web clients. Please see https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type"),t}(e)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:r.data})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3359,5740],{46130(e,t,r){r.d(t,{v:()=>n});var a=r(76553);function n(e){e?.writtenProperties&&e.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{(0,a.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}},76553(e,t,r){function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>a})},33359(e,t,r){r.d(t,{save:()=>E,saveAs:()=>U});var a=r(4576),n=(r(49186),r(71530)),o=r(60694),i=r(23154),s=r(77548),l=r(88788),c=r(10407);const u="Feature Service",y="feature-layer-utils",f=`${y}-save`,p=`${y}-save-as`;function d(e){return{isValid:(0,s.W_)(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function m(e,t){const r=(0,l.m)(e,"portal-item");return t?.isTable&&(r.layerContainerType="tables"),r}function h(e){const t=[],r=[];for(const{layer:a,layerJSON:n}of e)w(a)?r.push(n):t.push(n);return{layers:t,tables:r}}function w(e,t){return e.isTable}function L(e){return h([e])}async function b(e,t){return/\/\d+\/?$/.test(e.url)?L(t[0]):async function(e,t){if(e.reverse(),!t)return h(e);const a=await async function(e,t){let a=await e.fetchData("json");if(function(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}(a)&&!(0,c.Y)(e,c.mm.HOSTED_SERVICE))return a;a||={},function(e){e.layers||=[],e.tables||=[]}(a);const{layer:{url:n,customParameters:o,apiKey:s}}=t[0];return await async function(e,t,a){const{url:n,customParameters:o,apiKey:s}=t,{serviceJSON:l,layersJSON:c}=await(0,i.QM)(n,{customParameters:o,apiKey:s}),u=v(e.layers,l.layers,a),y=v(e.tables,l.tables,a);e.layers=u.itemResources,e.tables=y.itemResources;const f=[...u.added,...y.added],p=c?[...c.layers,...c.tables]:[];await async function(e,t,a,n){const o=await async function(e){const t=[];e.forEach(({type:e})=>{switch((0,i.KU)(e)){case"AnnotationFeatureLayer":t.push(r.e(737).then(r.bind(r,20737)).then(e=>e.default));break;case"CatalogLayer":t.push(Promise.all([r.e(1214),r.e(893),r.e(3636),r.e(9279)]).then(r.bind(r,83508)).then(e=>e.default));break;case"DimensionFeatureLayer":t.push(r.e(5077).then(r.bind(r,25077)).then(e=>e.default));break;case"FeatureLayer":t.push(Promise.all([r.e(9953),r.e(1214),r.e(1017),r.e(3781),r.e(4342)]).then(r.bind(r,53781)).then(e=>e.default));break;case"OrientedImageryLayer":t.push(Promise.all([r.e(9953),r.e(1214),r.e(1017),r.e(3781),r.e(2293)]).then(r.bind(r,16852)).then(e=>e.default))}});const a=await Promise.all(t),n=new Map;return e.forEach(({type:e},t)=>{n.set(e,a[t])}),n}(t),s=t.map(({id:e,type:t})=>new(o.get(t))({url:a,layerId:e,sourceJSON:n.find(({id:t})=>t===e)}));await Promise.allSettled(s.map(e=>e.load())),s.forEach(t=>{const{layerId:r,loaded:a,defaultPopupTemplate:n}=t;if(!a||null==n)return;const o={id:r,popupInfo:n.toJSON()};I(t,"ArcGISFeatureLayer"===t.operationalLayerType?o:{...o,layerType:t.operationalLayerType},e)})}(e,f,n,p)}(a,{url:n??"",customParameters:o,apiKey:s},t.map(e=>e.layer.layerId)),a}(t,e);for(const t of e)I(t.layer,t.layerJSON,a);return function(e,t){const r=[],a=[];for(const{layer:e}of t){const{isTable:t,layerId:n}=e;t?a.push(n):r.push(n)}g(e.layers,r),g(e.tables,a)}(a,e),a}(t,e)}function g(e,t){if(e.length<2)return;const r=[];for(const{id:t}of e)r.push(t);(0,a.aI)(r.sort(S),t.slice().sort(S))&&e.sort((e,r)=>{const a=t.indexOf(e.id),n=t.indexOf(r.id);return a<n?-1:a>n?1:0})}function S(e,t){return e<t?-1:e>t?1:0}function v(e,t,r){const n=(0,a.iv)(e,t,(e,t)=>e.id===t.id);e=e.filter(e=>!n.removed.some(t=>t.id===e.id));const o=n.added;return o.forEach(({id:t})=>{e.push({id:t})}),{itemResources:e,added:o.filter(({id:e})=>!r.includes(e))}}function I(e,t,r){e.isTable?A(r.tables,t):A(r.layers,t)}function A(e,t){const r=e.findIndex(({id:e})=>e===t.id);-1===r?e.push(t):e[r]=t}function T(e){if(!("layerType"in e))return!!e.charts?.length;switch(e.layerType){case"OrientedImageryLayer":return!!e.charts?.length;case"SubtypeGroupLayer":return!!e.layers.some(e=>!!e.charts?.length);case"SubtypeGroupTable":return!!e.tables.some(e=>!!e.charts?.length);case"CatalogLayer":return!!e.footprintLayer?.charts?.length}}function P(e,t){let r=0,a=0,n=0,o=0;for(const e of[...t.layers,...t.tables])if(T(e)&&o++,"layerType"in e)switch(e.layerType){case"OrientedImageryLayer":r++;break;case"SubtypeGroupLayer":a++;break;case"SubtypeGroupTable":n++}(0,c.Sm)(e,c.mm.ORIENTED_IMAGERY_LAYER,r>0),(0,c.Sm)(e,c.mm.SUBTYPE_GROUP_LAYER,a>0),(0,c.Sm)(e,c.mm.SUBTYPE_GROUP_TABLE,n>0),(0,c.Sm)(e,c.mm.CHARTS,o>0)}function O(e,t,r){P(t,r)}async function N(e,t,r){const{url:a,layerId:n,title:i,fullExtent:s,isTable:l}=e,u=(0,o.qg)(a);t.url=("FeatureServer"===u?.serverType?a:`${a}/${n}`)??null,t.title||=i,t.extent=null,l||null==s||(t.extent=await(0,c.sQ)(s)),function(e,t,r){(0,c.OM)(t,c.mm.METADATA),(0,c.Sm)(t,c.mm.MULTI_LAYER,e.length>1),(0,c.Sm)(t,c.mm.SINGLE_LAYER,1===e.length),(0,c.Sm)(t,c.mm.TABLE,r.tables.length>0&&0===r.layers.length),P(t,r)}([e],t,r)}async function E(e,t){return(0,n.UN)({layer:e,itemType:u,validateLayer:d,createJSONContext:t=>m(t,e),createItemData:(e,t)=>b(t,[e]),errorNamePrefix:f,setItemProperties:O},t)}async function U(e,t,r){return(0,n.Uh)({layer:e,itemType:u,validateLayer:d,createJSONContext:t=>m(t,e),createItemData:(e,t)=>Promise.resolve(L(e)),errorNamePrefix:p,newItem:t,setItemProperties:N},r)}},71530(e,t,r){r.d(t,{UN:()=>L,Uh:()=>b});var a=r(49186),n=r(46130),o=r(20655),i=r(80812),s=r(88788),l=r(10407),c=r(26121);async function u(e){const{layer:t,errorNamePrefix:r,validateLayer:n}=e;await t.load(),function(e,t,r){const n=r(e);if(!n.isValid)throw new a.A(`${t}:invalid-parameters`,n.errorMessage,{layer:e})}(t,r,n)}function y(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function f(e){const{item:t,errorNamePrefix:r,layer:n,validateItem:o}=e;if(function(e){const{item:t,itemType:r,additionalItemType:n,errorNamePrefix:o,layer:i}=e,s=[r];if(n&&s.push(n),!s.includes(t.type)){const e=s.map(e=>`'${e}'`).join(", ");throw new a.A(`${o}:portal-item-wrong-type`,`Portal item type should be one of: "${e}"`,{item:t,layer:i})}}(e),o){const e=o(t);if(!e.isValid)throw new a.A(`${r}:invalid-parameters`,e.errorMessage,{layer:n})}}function p(e){const{layer:t,errorNamePrefix:r}=e,{portalItem:n}=t;if(!n)throw new a.A(`${r}:portal-item-not-set`,y(t,"requires the portalItem property to be set"));if(!n.loaded)throw new a.A(`${r}:portal-item-not-loaded`,y(t,"cannot be saved to a portal item that does not exist or is inaccessible"));f({...e,item:n})}function d(e){const{newItem:t,itemType:r}=e;let a=i.default.from(t);return a.id&&(a=a.clone(),a.id=null),a.type??=r,a.portal??=o.A.getDefault(),f({...e,item:a}),a}function m(e){return(0,s.m)(e,"portal-item")}async function h(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const a=e.write({},t);return await Promise.all(t.resources?.pendingOperations??[]),(0,c.ci)(t,{errorName:"layer-write:unsupported"},r),a}function w(e){(0,l.LG)(e,l.mm.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}async function L(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:i,saveResources:s,supplementalUnsupportedErrors:l}=e;await u(e),p(e);const c=r.portalItem,y=o?o(c):m(c),f=await h(r,y,{...t,supplementalUnsupportedErrors:l}),d=await a({layer:r,layerJSON:f},c);return await(i?.(r,c,d)),w(c),await c.update({data:d}),(0,n.v)(y),await(s?.(c,y)),c}async function b(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:i,saveResources:s,supplementalUnsupportedErrors:l}=e;await u(e);const c=d(e),y=o?o(c):m(c),f=await h(r,y,{...t,supplementalUnsupportedErrors:l}),p=await a({layer:r,layerJSON:f},c);return await i(r,c,p),w(c),await async function(e,t,r){const a=e.portal;await a.signIn(),await a.user.addItem({item:e,data:t,folder:r?.folder})}(c,p,t),r.portalItem=c,(0,n.v)(y),await(s?.(c,y)),c}},23154(e,t,r){r.d(t,{Aq:()=>d,KU:()=>p,QM:()=>i});var a=r(77548),n=r(7861);const o=new Set(["Annotation Layer","Catalog Layer","Dimension Layer","Feature Layer","Oriented Imagery Layer"]);async function i(e,t){const{loadContext:r,...o}=t||{},i=r?await r.fetchServiceMetadata(e,o):await(0,n.L)(e,o),s=(0,a.G$)();f(i),c(i);const l={serviceJSON:i,preferredHost:s};if((i.currentVersion??0)<10.5)return l;const u=`${(0,a.$x)()??e}/layers`,y=r?await r.fetchServiceMetadata(u,o):await(0,n.L)(u,o);return f(y),c(y),l.layersJSON={layers:y.layers,tables:y.tables},l}function s(e){const{type:t}=e;return!!t&&o.has(t)}function l(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(s),e.tables=e.tables?.filter(l)}function u(e){e.type||="Feature Layer"}function y(e){e.type||="Table"}function f(e){e.layers?.forEach(u),e.tables?.forEach(y)}function p(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"DimensionFeatureLayer";case"Annotation Layer":return"AnnotationFeatureLayer"}return"FeatureLayer"}function d(e){switch(e){case"Annotation Layer":return"ArcGISAnnotationLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"ArcGISDimensionLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Parcel Layer":return"ParcelLayer";case"Topology Layer":return"TopologyLayer";case"Trace Network Layer":return"TraceNetworkLayer";case"Utility Network Layer":return"UtilityNetworkLayer"}return null}},88788(e,t,r){r.d(t,{m:()=>i,v:()=>o});var a=r(84952),n=r(20655);function o(e,t){return{...s(e,t),readResourcePaths:[]}}function i(e,t,r){const n=(0,a.An)(e.itemUrl);return{...s(e,t),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:n?{rootPath:n.path,writtenUrls:[]}:null,resources:r?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function s(e,t){return{origin:t,url:(0,a.An)(e.itemUrl),portal:e.portal||n.A.getDefault(),portalItem:e}}},7861(e,t,r){r.d(t,{L:()=>n});var a=r(11254);async function n(e,t){return(await(0,a.A)(e,{responseType:"json",query:{f:"json",...t?.customParameters,token:t?.apiKey}})).data}},26121(e,t,r){r.d(t,{I6:()=>l,ci:()=>s,dL:()=>i});var a=r(49186),n=r(77548),o=r(59923);async function i(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}function s(e,t,r){let n=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new a.A(e,t,r));if(e.blockedRelativeUrls&&(n=n.concat(e.blockedRelativeUrls.map(e=>(0,o.GL)("url",`Relative url '${e}' is not supported`)))),r){const{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:a}=r;e&&(n=n.filter(({name:e})=>!(o.MG.has(e)||t.includes(e)))),a&&(n=n.filter(e=>"web-document-write:property-required"!==e.name))}if(n.length>0)throw new a.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:n})}function l(e){return(0,n.qd)(e).some(e=>!!e.charts?.length)}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3359,5740],{46130(e,t,r){r.d(t,{v:()=>n});var a=r(76553);function n(e){e?.writtenProperties&&e.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{(0,a.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}},76553(e,t,r){function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>a})},33359(e,t,r){r.d(t,{save:()=>E,saveAs:()=>U});var a=r(4576),n=(r(49186),r(71530)),o=r(60694),i=r(23154),s=r(77548),l=r(88788),c=r(10407);const u="Feature Service",y="feature-layer-utils",f=`${y}-save`,p=`${y}-save-as`;function d(e){return{isValid:(0,s.W_)(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function m(e,t){const r=(0,l.m)(e,"portal-item");return t?.isTable&&(r.layerContainerType="tables"),r}function h(e){const t=[],r=[];for(const{layer:a,layerJSON:n}of e)w(a)?r.push(n):t.push(n);return{layers:t,tables:r}}function w(e,t){return e.isTable}function L(e){return h([e])}async function b(e,t){return/\/\d+\/?$/.test(e.url)?L(t[0]):async function(e,t){if(e.reverse(),!t)return h(e);const a=await async function(e,t){let a=await e.fetchData("json");if(function(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}(a)&&!(0,c.Y)(e,c.mm.HOSTED_SERVICE))return a;a||={},function(e){e.layers||=[],e.tables||=[]}(a);const{layer:{url:n,customParameters:o,apiKey:s}}=t[0];return await async function(e,t,a){const{url:n,customParameters:o,apiKey:s}=t,{serviceJSON:l,layersJSON:c}=await(0,i.QM)(n,{customParameters:o,apiKey:s}),u=v(e.layers,l.layers,a),y=v(e.tables,l.tables,a);e.layers=u.itemResources,e.tables=y.itemResources;const f=[...u.added,...y.added],p=c?[...c.layers,...c.tables]:[];await async function(e,t,a,n){const o=await async function(e){const t=[];e.forEach(({type:e})=>{switch((0,i.KU)(e)){case"AnnotationFeatureLayer":t.push(r.e(737).then(r.bind(r,20737)).then(e=>e.default));break;case"CatalogLayer":t.push(Promise.all([r.e(1214),r.e(893),r.e(3636),r.e(4571)]).then(r.bind(r,83508)).then(e=>e.default));break;case"DimensionFeatureLayer":t.push(r.e(5077).then(r.bind(r,25077)).then(e=>e.default));break;case"FeatureLayer":t.push(Promise.all([r.e(9953),r.e(1214),r.e(1017),r.e(3781),r.e(6196)]).then(r.bind(r,53781)).then(e=>e.default));break;case"OrientedImageryLayer":t.push(Promise.all([r.e(9953),r.e(1214),r.e(1017),r.e(3781),r.e(6113)]).then(r.bind(r,16852)).then(e=>e.default))}});const a=await Promise.all(t),n=new Map;return e.forEach(({type:e},t)=>{n.set(e,a[t])}),n}(t),s=t.map(({id:e,type:t})=>new(o.get(t))({url:a,layerId:e,sourceJSON:n.find(({id:t})=>t===e)}));await Promise.allSettled(s.map(e=>e.load())),s.forEach(t=>{const{layerId:r,loaded:a,defaultPopupTemplate:n}=t;if(!a||null==n)return;const o={id:r,popupInfo:n.toJSON()};I(t,"ArcGISFeatureLayer"===t.operationalLayerType?o:{...o,layerType:t.operationalLayerType},e)})}(e,f,n,p)}(a,{url:n??"",customParameters:o,apiKey:s},t.map(e=>e.layer.layerId)),a}(t,e);for(const t of e)I(t.layer,t.layerJSON,a);return function(e,t){const r=[],a=[];for(const{layer:e}of t){const{isTable:t,layerId:n}=e;t?a.push(n):r.push(n)}g(e.layers,r),g(e.tables,a)}(a,e),a}(t,e)}function g(e,t){if(e.length<2)return;const r=[];for(const{id:t}of e)r.push(t);(0,a.aI)(r.sort(S),t.slice().sort(S))&&e.sort((e,r)=>{const a=t.indexOf(e.id),n=t.indexOf(r.id);return a<n?-1:a>n?1:0})}function S(e,t){return e<t?-1:e>t?1:0}function v(e,t,r){const n=(0,a.iv)(e,t,(e,t)=>e.id===t.id);e=e.filter(e=>!n.removed.some(t=>t.id===e.id));const o=n.added;return o.forEach(({id:t})=>{e.push({id:t})}),{itemResources:e,added:o.filter(({id:e})=>!r.includes(e))}}function I(e,t,r){e.isTable?A(r.tables,t):A(r.layers,t)}function A(e,t){const r=e.findIndex(({id:e})=>e===t.id);-1===r?e.push(t):e[r]=t}function T(e){if(!("layerType"in e))return!!e.charts?.length;switch(e.layerType){case"OrientedImageryLayer":return!!e.charts?.length;case"SubtypeGroupLayer":return!!e.layers.some(e=>!!e.charts?.length);case"SubtypeGroupTable":return!!e.tables.some(e=>!!e.charts?.length);case"CatalogLayer":return!!e.footprintLayer?.charts?.length}}function P(e,t){let r=0,a=0,n=0,o=0;for(const e of[...t.layers,...t.tables])if(T(e)&&o++,"layerType"in e)switch(e.layerType){case"OrientedImageryLayer":r++;break;case"SubtypeGroupLayer":a++;break;case"SubtypeGroupTable":n++}(0,c.Sm)(e,c.mm.ORIENTED_IMAGERY_LAYER,r>0),(0,c.Sm)(e,c.mm.SUBTYPE_GROUP_LAYER,a>0),(0,c.Sm)(e,c.mm.SUBTYPE_GROUP_TABLE,n>0),(0,c.Sm)(e,c.mm.CHARTS,o>0)}function O(e,t,r){P(t,r)}async function N(e,t,r){const{url:a,layerId:n,title:i,fullExtent:s,isTable:l}=e,u=(0,o.qg)(a);t.url=("FeatureServer"===u?.serverType?a:`${a}/${n}`)??null,t.title||=i,t.extent=null,l||null==s||(t.extent=await(0,c.sQ)(s)),function(e,t,r){(0,c.OM)(t,c.mm.METADATA),(0,c.Sm)(t,c.mm.MULTI_LAYER,e.length>1),(0,c.Sm)(t,c.mm.SINGLE_LAYER,1===e.length),(0,c.Sm)(t,c.mm.TABLE,r.tables.length>0&&0===r.layers.length),P(t,r)}([e],t,r)}async function E(e,t){return(0,n.UN)({layer:e,itemType:u,validateLayer:d,createJSONContext:t=>m(t,e),createItemData:(e,t)=>b(t,[e]),errorNamePrefix:f,setItemProperties:O},t)}async function U(e,t,r){return(0,n.Uh)({layer:e,itemType:u,validateLayer:d,createJSONContext:t=>m(t,e),createItemData:(e,t)=>Promise.resolve(L(e)),errorNamePrefix:p,newItem:t,setItemProperties:N},r)}},71530(e,t,r){r.d(t,{UN:()=>L,Uh:()=>b});var a=r(49186),n=r(46130),o=r(20655),i=r(80812),s=r(88788),l=r(10407),c=r(26121);async function u(e){const{layer:t,errorNamePrefix:r,validateLayer:n}=e;await t.load(),function(e,t,r){const n=r(e);if(!n.isValid)throw new a.A(`${t}:invalid-parameters`,n.errorMessage,{layer:e})}(t,r,n)}function y(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function f(e){const{item:t,errorNamePrefix:r,layer:n,validateItem:o}=e;if(function(e){const{item:t,itemType:r,additionalItemType:n,errorNamePrefix:o,layer:i}=e,s=[r];if(n&&s.push(n),!s.includes(t.type)){const e=s.map(e=>`'${e}'`).join(", ");throw new a.A(`${o}:portal-item-wrong-type`,`Portal item type should be one of: "${e}"`,{item:t,layer:i})}}(e),o){const e=o(t);if(!e.isValid)throw new a.A(`${r}:invalid-parameters`,e.errorMessage,{layer:n})}}function p(e){const{layer:t,errorNamePrefix:r}=e,{portalItem:n}=t;if(!n)throw new a.A(`${r}:portal-item-not-set`,y(t,"requires the portalItem property to be set"));if(!n.loaded)throw new a.A(`${r}:portal-item-not-loaded`,y(t,"cannot be saved to a portal item that does not exist or is inaccessible"));f({...e,item:n})}function d(e){const{newItem:t,itemType:r}=e;let a=i.default.from(t);return a.id&&(a=a.clone(),a.id=null),a.type??=r,a.portal??=o.A.getDefault(),f({...e,item:a}),a}function m(e){return(0,s.m)(e,"portal-item")}async function h(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const a=e.write({},t);return await Promise.all(t.resources?.pendingOperations??[]),(0,c.ci)(t,{errorName:"layer-write:unsupported"},r),a}function w(e){(0,l.LG)(e,l.mm.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}async function L(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:i,saveResources:s,supplementalUnsupportedErrors:l}=e;await u(e),p(e);const c=r.portalItem,y=o?o(c):m(c),f=await h(r,y,{...t,supplementalUnsupportedErrors:l}),d=await a({layer:r,layerJSON:f},c);return await(i?.(r,c,d)),w(c),await c.update({data:d}),(0,n.v)(y),await(s?.(c,y)),c}async function b(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:i,saveResources:s,supplementalUnsupportedErrors:l}=e;await u(e);const c=d(e),y=o?o(c):m(c),f=await h(r,y,{...t,supplementalUnsupportedErrors:l}),p=await a({layer:r,layerJSON:f},c);return await i(r,c,p),w(c),await async function(e,t,r){const a=e.portal;await a.signIn(),await a.user.addItem({item:e,data:t,folder:r?.folder})}(c,p,t),r.portalItem=c,(0,n.v)(y),await(s?.(c,y)),c}},23154(e,t,r){r.d(t,{Aq:()=>d,KU:()=>p,QM:()=>i});var a=r(77548),n=r(7861);const o=new Set(["Annotation Layer","Catalog Layer","Dimension Layer","Feature Layer","Oriented Imagery Layer"]);async function i(e,t){const{loadContext:r,...o}=t||{},i=r?await r.fetchServiceMetadata(e,o):await(0,n.L)(e,o),s=(0,a.G$)();f(i),c(i);const l={serviceJSON:i,preferredHost:s};if((i.currentVersion??0)<10.5)return l;const u=`${(0,a.$x)()??e}/layers`,y=r?await r.fetchServiceMetadata(u,o):await(0,n.L)(u,o);return f(y),c(y),l.layersJSON={layers:y.layers,tables:y.tables},l}function s(e){const{type:t}=e;return!!t&&o.has(t)}function l(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(s),e.tables=e.tables?.filter(l)}function u(e){e.type||="Feature Layer"}function y(e){e.type||="Table"}function f(e){e.layers?.forEach(u),e.tables?.forEach(y)}function p(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"DimensionFeatureLayer";case"Annotation Layer":return"AnnotationFeatureLayer"}return"FeatureLayer"}function d(e){switch(e){case"Annotation Layer":return"ArcGISAnnotationLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"ArcGISDimensionLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Parcel Layer":return"ParcelLayer";case"Topology Layer":return"TopologyLayer";case"Trace Network Layer":return"TraceNetworkLayer";case"Utility Network Layer":return"UtilityNetworkLayer"}return null}},88788(e,t,r){r.d(t,{m:()=>i,v:()=>o});var a=r(84952),n=r(20655);function o(e,t){return{...s(e,t),readResourcePaths:[]}}function i(e,t,r){const n=(0,a.An)(e.itemUrl);return{...s(e,t),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:n?{rootPath:n.path,writtenUrls:[]}:null,resources:r?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function s(e,t){return{origin:t,url:(0,a.An)(e.itemUrl),portal:e.portal||n.A.getDefault(),portalItem:e}}},7861(e,t,r){r.d(t,{L:()=>n});var a=r(11254);async function n(e,t){return(await(0,a.A)(e,{responseType:"json",query:{f:"json",...t?.customParameters,token:t?.apiKey}})).data}},26121(e,t,r){r.d(t,{I6:()=>l,ci:()=>s,dL:()=>i});var a=r(49186),n=r(77548),o=r(59923);async function i(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}function s(e,t,r){let n=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new a.A(e,t,r));if(e.blockedRelativeUrls&&(n=n.concat(e.blockedRelativeUrls.map(e=>(0,o.GL)("url",`Relative url '${e}' is not supported`)))),r){const{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:a}=r;e&&(n=n.filter(({name:e})=>!(o.MG.has(e)||t.includes(e)))),a&&(n=n.filter(e=>"web-document-write:property-required"!==e.name))}if(n.length>0)throw new a.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:n})}function l(e){return(0,n.qd)(e).some(e=>!!e.charts?.length)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9171],{9775(t,e,s){s.d(e,{A:()=>n});var i=s(62788),r=s(95488);class n{constructor(t=t=>t.values().next().value){this._peeker=t,this._observable=new r.I,this._items=new Set}get length(){return(0,i.gc)(this._observable),this._items.size}clear(){0!==this.length&&(this._items.clear(),this._observable.notify())}last(){if(0===this.length)return;let t;for(t of this._items);return t}peek(){if(0!==this.length)return this._peeker(this._items)}push(t){this.contains(t)||(this._items.add(t),this._observable.notify())}contains(t){return(0,i.gc)(this._observable),this._items.has(t)}pop(){if(0===this.length)return;const t=this.peek();return this._items.delete(t),this._observable.notify(),t}popLast(){if(0===this.length)return;const t=this.last();return this._items.delete(t),this._observable.notify(),t}remove(t){this.contains(t)&&(this._items.delete(t),this._observable.notify())}filter(t){const e=this.length;return this._items.forEach(e=>{t(e)||this._items.delete(e)}),e!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){(0,i.gc)(this._observable),yield*this._items}}},36745(t,e,s){s.d(e,{z:()=>o});var i=s(4718),r=s(51118),n=s(60408),a=s(92722);class o{static fromOptimized(t,e,s=1){return(new u).initialize(t,e,s)}static fromJSON(t){const[e,s]=l(t),i=(0,n.Pv)(t),r=(0,n.W0)(t);return(new c).initialize(e,s,i,r,1)}static fromOptimizedCIM(t,e,s=1){return(new p).initialize(t,e,s)}static fromJSONCIM(t,e=1){const[s,i]=l(t),r=(0,n.Pv)(t),a=(0,n.W0)(t);return(new d).initialize(s,i,r,a,e)}static fromFeatureSetReader(t){const e=t.readGeometryForDisplay(),s=t.geometryType;return e&&s?this.fromOptimized(e,s):null}static fromFeatureSetReaderCIM(t){const e=t.readGeometryForDisplay(),s=t.geometryType;return e&&s?this.fromOptimizedCIM(e,s):null}static createEmptyOptimized(t,e=!1,s=!1,i=1){return(new p).initialize(new a.A([],[],e,s),t,i)}static createEmptyJSON(t,e=!1,s=!1){return(new c).initialize([],t,e,s,1)}static createEmptyOptimizedCIM(t,e=!1,s=!1,i=1){return(new p).initialize(new a.A([],[],e,s),t,i)}static createEmptyJSONCIM(t,e=!1,s=!1,i=1){return(new d).initialize([],t,e,s,i)}asJSON(){const t=(0,r.x)(this),{hasZ:e,hasM:s}=this;return"esriGeometryEnvelope"===this.geometryType?{xmin:t[0][0][0],ymin:t[0][0][1],xmax:t[0][2][0],ymax:t[0][2][1]}:"esriGeometryMultipoint"===this.geometryType?{points:t.flat(),hasZ:e,hasM:s}:"esriGeometryPoint"===this.geometryType?{x:t[0][0][0],y:t[0][0][1],z:e?t[0][0][2]:void 0,m:s?t[0][0][e?3:2]:void 0}:"esriGeometryPolygon"===this.geometryType?{rings:t,hasZ:e,hasM:s}:{paths:t,hasZ:e,hasM:s}}getCurrentRingArea(){if(this.pathSize<3)return 0;let t,e,s=0;if(this.seekPathStart(),!this.nextPoint())return 0;t=this.x,e=this.y;const i=t,r=e;for(;this.nextPoint();)s+=(t-this.x)*(e+this.y),t=this.x,e=this.y;return s+=(t-i)*(e+r),-.5*s}invertY(){this.yFactor*=-1}}class u extends o{constructor(){super(...arguments),this._end=-1}get hasZ(){return this._geometry?.hasZ}get hasM(){return this._geometry?.hasM}initialize(t,e,s){return this.geometryType=e,this._stride=t.stride,this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=s,this}reset(){this.initialize(this._geometry,this.geometryType,this.yFactor)}seekPath(t){if(t>=0&&t<this.totalSize){if(this._pathIndex<t)for(;this._pathIndex<t&&this.nextPath(););else if(this._pathIndex>t)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const e=this._pathOffset+t*this._stride;return e>=0&&e<this._end&&(this._pointOffset=e,!0)}nextPoint(){return(this._pointOffset+=this._stride)<this._end}prevPoint(){return(this._pointOffset-=this._stride)>=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1||(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,0))}prevPath(){return!(this.pathIndex<=0||(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,0))}getCurrentPath(){const t=this._end,e=this._geometry.coords,s=this._pathOffset;return(new u).initialize(new a.A([this.pathSize],e.slice(s,t),this.hasZ,this.hasM),this.geometryType,this.yFactor)}pathLength(){const t=this._end,e=this._stride,s=this._geometry.coords;let i=0;for(let r=this._pathOffset+e;r<t;r+=e){const t=s[r-e],n=s[r-e+1],a=s[r]-t,o=s[r+1]-n;i+=Math.sqrt(a*a+o*o)}return i}startPath(){this._geometry.lengths.push(0)}pushPath(t){this.startPath(),this.pushPoints(t)}pushPoint(t){for(let e=0;e<this._stride;++e)this._geometry.coords.push(t[e]);this._geometry.lengths[this.totalSize-1]++}pushXY(t,e){this._geometry.coords.push(t,e),this._geometry.lengths[this.totalSize-1]++}pushPoints(t){for(const e of t)for(let t=0;t<this._stride;++t)this._geometry.coords.push(e[t]);this._geometry.lengths[this.totalSize-1]+=t.length}pushCursor(t){const e=t.asOptimized();this._geometry.coords.push(...e.coords),this._geometry.lengths.push(...e.lengths)}asOptimized(){const t=this._geometry.clone();if(1!==this.yFactor)for(let e=1;e<t.coords.length;e+=this._stride)t.coords[e]*=this.yFactor;return"esriGeometryPoint"===this.geometryType&&(t.lengths.length=0),t}isClosed(){const t=this._geometry.coords,e=this._pathOffset,s=this._end-this._stride;for(let i=0;i<this._stride;i++)if(t[e+i]!==t[s+i])return!1;return!0}clone(){return(new u).initialize(this._geometry.clone(),this.geometryType,this.yFactor)}get totalPoints(){return this._geometry.isPoint?1:this._geometry.lengths.reduce((t,e)=>t+e)}get pathSize(){const{lengths:t}=this._geometry;return this._geometry.isPoint?1:this._pathIndex<0||this._pathIndex>t.length-1?0:t[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}}function h(t){const e=[t.x,t.y];return t.z&&e.push(t.z),t.m&&e.push(t.m),e}function l(t){return(0,n.Bi)(t)?[t.rings,"esriGeometryPolygon"]:(0,n.Rg)(t)?[t.paths,"esriGeometryPolyline"]:(0,n.U9)(t)?[[t.points],"esriGeometryMultipoint"]:(0,n.ZC)(t)?[[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]],"esriGeometryEnvelope"]:(0,n.fT)(t)?[[[h(t)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}class c extends o{initialize(t,e,s,i,r){return this._paths=t,this.geometryType=e,this.hasZ=s,this.hasM=i,this._pathIndex=this._pointIndex=-1,this.yFactor=r,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t<this.totalSize&&(this._currentPath=this._paths[t],!0)}seekPathStart(){this._pointIndex=-1}seekPathEnd(){this._pointIndex=this._currentPath.length}seekInPath(t){return t>=0&&t<this._currentPath.length&&(this._pointIndex=t,this._currentPoint=this._currentPath[this._pointIndex],!0)}nextPoint(){return this._currentPoint=this._currentPath[++this._pointIndex],this._pointIndex<this._currentPath.length}prevPoint(){return this._currentPoint=this._currentPath[--this._pointIndex],this._pointIndex>=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex<this.totalSize}prevPath(){return this.pathIndex>0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const t=this._currentPath.length,e=this._currentPath;let s=0;for(let i=1;i<t;i++){const t=e[i-1],r=e[i],n=t[0],a=t[1],o=r[0]-n,u=r[1]-a;s+=Math.sqrt(o*o+u*u)}return s}startPath(){this._paths.push([])}getCurrentPath(){return(new c).initialize([this._currentPath],this.geometryType,this.hasZ,this.hasM,this.yFactor)}pushPath(t){this._paths.push(t)}pushPoint(t){this._paths[this.totalSize-1].push(t)}pushXY(t,e){this._paths[this.totalSize-1].push([t,e])}pushPoints(t){this._paths[this.totalSize-1].push(...t)}pushCursor(t){const e=(0,r.x)(t);for(const t of e)this.pushPath(t)}asOptimized(){const{hasZ:t,hasM:e}=this,s=new a.A([],[],t,e),{coords:i,lengths:r}=s;if("esriGeometryPoint"===this.geometryType)i.push(...this._paths[0][0]),r.length=0;else for(const s of this._paths){for(const r of s)i.push(r[0]),i.push(r[1]*this.yFactor),t&&i.push(r[2]),e&&i.push(r[this._mIndex]);r.push(s.length)}return s}isClosed(){const t=this._currentPath[0],e=this._currentPath[this._currentPath.length-1];for(let s=0;s<t.length;s++)if(t[s]!==e[s])return!1;return!0}clone(){return(new c).initialize((0,i.o8)(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}get totalPoints(){return this._paths.map(t=>t.length).reduce((t,e)=>t+e)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}}class p extends u{initialize(t,e,s){return super.initialize(t,e,s),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(t=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=(new p).initialize(this._geometry.clone(),this.geometryType,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}}class d extends c{initialize(t,e,s,i,r){return super.initialize(t,e,s,i,r)}clone(){return(new d).initialize((0,i.o8)(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][4]=1}getControlPoint(){return 1===this._paths[this.pathIndex][this._pointIndex][4]}setControlPointAt(t){this._paths[this.pathIndex][t][4]=1}getControlPointAt(t){return 1===this._paths[this.pathIndex][t][4]}}},32011(t,e,s){s.d(e,{d:()=>u});var i=s(19419),r=s(537),n=s(12359),a=s(95108),o=s(12176);function u(t){if(0===t.totalSize)return null;const e=(0,r.z8)(t);if(!e)return null;const s=4*(Math.abs(e[0])+Math.abs(e[2])+Math.abs(e[1])+Math.abs(e[3])+1)*222045e-19;let a=0,o=0;t.reset();for(let e=0;t.nextPath();e++){const s=t.getCurrentRingArea();s>o&&(o=s,a=e)}if(t.seekPath(a),0===t.pathSize)return null;t.seekPathStart();const u=(0,r.B$)(t);if(Math.abs(o)<=2*s*s)return[(u[0]+u[2])/2,(u[1]+u[3])/2];t.seekPathStart();const p=(0,n.w2)(t,(0,i.vt)());if(null===p)return null;if(t.totalPoints<4)return p;const d=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],f=[NaN,NaN,NaN,NaN],g=[NaN,NaN,NaN,NaN];let x=!1,w=l(p,t,!0);0===w.distance&&(x=!0,d[0][0]=p[0],d[0][1]=p[1],w=l(p,t,!1)),f[0]=w.distance,g[0]=0;const I=[NaN,NaN];let P=!1,S=.25,F=-1,v=NaN;do{if(v=NaN,d[1]=c(t,y(u[0],u[2],S),0,e),isNaN(d[1][0])||isNaN(d[1][1])||(w=l(d[1],t,!1),v=w.distance),!isNaN(v)&&v>s&&h(d[1],t))P=!0,f[1]=v,g[1]=_(d[1],p);else if(!isNaN(v)&&v>F&&(F=v,I[0]=d[1][0],I[1]=d[1][1]),S-=.01,S<.1){if(!(F>=0))break;P=!0,f[1]=F,d[1][0]=I[0],d[1][1]=I[1],g[1]=_(d[1],p)}}while(!P);P=!1,S=.5,F=-1;let N=.01,z=1;do{if(v=NaN,d[2]=c(t,y(u[0],u[2],S),0,e),isNaN(d[2][0])||isNaN(d[2][1])||(w=l(d[2],t,!1),v=w.distance),!isNaN(v)&&v>s&&h(d[2],t))P=!0,f[2]=v,g[2]=_(d[2],p);else if(!isNaN(v)&&v>F)F=v,I[0]=d[2][0],I[1]=d[2][1];else if(v>F&&(F=v,I[0]=d[2][0],I[1]=d[2][1]),S=.5+N*z,N+=.01,z*=-1,S<.3||S>.7){if(!(F>=0))break;P=!0,f[2]=F,d[2][0]=I[0],d[2][1]=I[1],g[2]=_(d[2],p)}}while(!P);P=!1,S=.75,F=-1;do{if(v=NaN,d[3]=c(t,y(u[0],u[2],S),0,e),isNaN(d[3][0])||isNaN(d[3][1])||(w=l(d[3],t,!1),v=w.distance),!isNaN(v)&&v>s&&h(d[3],t))P=!0,f[3]=v,g[3]=_(d[3],p);else if(v>F&&(F=v,I[0]=d[3][0],I[1]=d[3][1]),S+=.01,S>.9){if(!(F>=0))break;P=!0,f[3]=F,d[3][0]=I[0],d[3][1]=I[1],g[3]=_(d[3],p)}}while(!P);const b=[0,1,2,3],O=x?0:1;let C;for(let t=O;t<4;t++)for(let t=O;t<3;t++){const e=g[t],s=g[t+1];m(e,s)>0&&(C=b[t],b[t]=b[t+1],b[t+1]=C,g[t]=s,g[t+1]=e)}let q=O,R=0,T=0;for(let t=O;t<4;t++){switch(t){case 0:T=2*f[b[t]];break;case 1:T=1.66666666*f[b[t]];break;case 2:T=1.33333333*f[b[t]];break;case 3:T=f[b[t]]}T>R&&(R=T,q=b[t])}return d[q]}function h(t,e){let s,i,r,n,a=0;for(e.reset();e.nextPath()&&e.nextPoint();)for(s=e.x,i=e.y;e.nextPoint();s=r,i=n)r=e.x,n=e.y,i>t[1]!=n>t[1]&&((r-s)*(t[1]-i)-(n-i)*(t[0]-s)>0?a++:a--);return 0!==a}function l(t,e,s){if(s&&h(t,e))return{coord:t,distance:0};let i=1/0,r=0,n=0,o=[0,0],u=[0,0];const l=[0,0];for(e.reset();e.nextPath()&&e.nextPoint();)if(!(e.pathSize<2))for(o[0]=e.x,o[1]=e.y;e.nextPoint();o=u){u=[e.x,e.y],(0,a.gR)(l,t,o,u);const s=_(t,l);s<i&&(i=s,r=l[0],n=l[1])}return{coord:[r,n],distance:Math.sqrt(i)}}function c(t,e,s,r){const n=[e,0];let a=1/0,u=1/0,h=!1,l=!1;const c=[[e,r[1]-1],[e,r[3]+1]],f=[0,0],y=[0,0],_=[0,0],m=[[0,0],[0,0]],g=(0,i.vt)();for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(m[0][0]=t.x,m[0][1]=t.y;t.nextPoint();m[0][0]=m[1][0],m[0][1]=m[1][1]){if(m[1][0]=t.x,m[1][1]=t.y,null===p(g,m))continue;if(y[0]=c[0][0],y[1]=c[0][1],_[0]=c[1][0],_[1]=c[1][1],0===d(g,y,_))continue;if(!(0,o.Ql)(c[0],c[1],m[0],m[1],f))continue;const e=f[1];a>u?e<a&&(a=e,h=!0):e<u&&(u=e,l=!0)}return h&&l?n[1]=(a+u)/2:n[0]=n[1]=NaN,n}function p(t,e){if(e.length<2)return null;t||(t=(0,i.vt)());const[s,r]=e[0],[n,a]=e[1];return t[0]=Math.min(s,n),t[1]=Math.min(r,a),t[2]=Math.max(s,n),t[3]=Math.max(r,a),t}function d(t,e,s){let i=f(e,t),r=f(s,t);const n=t[0],a=t[1],o=t[2],u=t[3];if(i&r)return 0;if(!(i|r))return 4;const h=(i?1:0)|(r?2:0);do{const h=s[0]-e[0],l=s[1]-e[1];if(h>l)3&i?(1&i?(e[1]+=l*(n-e[0])/h,e[0]=n):(e[1]+=l*(o-e[0])/h,e[0]=o),i=f(e,t)):3&r?(1&r?(s[1]+=l*(n-s[0])/h,s[0]=n):(s[1]+=l*(o-s[0])/h,s[0]=o),r=f(s,t)):i?(4&i?(e[0]+=h*(a-e[1])/l,e[1]=a):(e[0]+=h*(u-e[1])/l,e[1]=u),i=f(e,t)):(4&r?(s[0]+=h*(a-s[1])/l,s[1]=a):(s[0]+=h*(u-s[1])/l,s[1]=u),r=f(s,t));else if(12&i?(4&i?(e[0]+=h*(a-e[1])/l,e[1]=a):(e[0]+=h*(u-e[1])/l,e[1]=u),i=f(e,t)):12&r?(4&r?(s[0]+=h*(a-s[1])/l,s[1]=a):(s[0]+=h*(u-s[1])/l,s[1]=u),r=f(s,t)):i?(1&i?(e[1]+=l*(n-e[0])/h,e[0]=n):(e[1]+=l*(o-e[0])/h,e[0]=o),i=f(e,t)):(1&r?(s[1]+=l*(n-s[0])/h,s[0]=n):(s[1]+=l*(o-s[0])/h,s[0]=o),r=f(s,t)),i&r)return 0}while(i|r);return h}function f(t,e){return(t[0]<e[0]?1:0)|(t[0]>e[2]?1:0)<<1|(t[1]<e[1]?1:0)<<2|(t[1]>e[3]?1:0)<<3}function y(t,e,s){return t+(e-t)*s}function _(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function m(t,e){if(t<e)return-1;if(t>e)return 1;if(t===e)return 0;const s=isNaN(t),i=isNaN(e);return s<i?-1:s>i?1:0}},62815(t,e,s){s.d(e,{N:()=>o,d:()=>u});var i=s(86211),r=s(73941),n=s(21325),a=s(52006);function o(t,e,s){const i=u(e,s);if(1!==i)switch(t){case"point":case"esriGeometryPoint":return t=>function(t,e){null!=t?.z&&(t.z*=e)}(t,i);case"polyline":case"esriGeometryPolyline":return t=>function(t,e){if(t){if(t.curvePaths)for(const s of t.curvePaths)for(const t of s){const s=(0,a.yP)(t);s.length>2&&(s[2]*=e)}if(t.paths)for(const s of t.paths)for(const t of s)t.length>2&&(t[2]*=e)}}(t,i);case"polygon":case"esriGeometryPolygon":return t=>function(t,e){if(t){if(t.curveRings)for(const s of t.curveRings)for(const t of s){const s=(0,a.yP)(t);s.length>2&&(s[2]*=e)}if(t.rings)for(const s of t.rings)for(const t of s)t.length>2&&(t[2]*=e)}}(t,i);case"multipoint":case"esriGeometryMultipoint":return t=>function(t,e){if(t)for(const s of t.points)s.length>2&&(s[2]*=e)}(t,i);case"extent":case"esriGeometryEnvelope":return t=>function(t,e){t&&null!=t.zmin&&null!=t.zmax&&(t.zmin*=e,t.zmax*=e)}(t,i);default:return}}function u(t,e){return null==t||null==e||(0,n.aI)(t,e)||(0,r.xP)(t)||(0,r.xP)(e)?1:(0,i.G9)(t)/(0,i.G9)(e)}},6557(t,e,s){s.r(e),s.d(e,{default:()=>Z});var i=s(5482),r=s(21818),n=s(49186),a=s(44208),o=s(53966),u=s(17676),h=s(563),l=s(39516),c=s(16930),p=s(70328),d=s(19419),f=s(83960),y=s(21325),_=s(90708),m=s(75752),g=s(99352),x=s(8384),w=s(58727),I=s(90951),P=s(64714),S=s(17754),F=s(20437),v=s(95466),N=s(30524),z=s(50639),b=s(42760),O=s(39412),C=s(30661),q=s(28923),R=s(44320),T=s(35258),E=s(16630);const A=new C.Z,M="__OBJECTID",G=new TextDecoder,k=8e3;class Q{constructor(t,e){this._files=t,this._createFileStream=e,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(t){for(await this._fill(t);this._pending.size>0;){(0,u.Te)(t),await this._fill(t);const e=await B(this._pending);if(this._pending.delete(e.read),this._resolvedCount++,null!=e.chunk)return e.chunk}return null}async _fill(t){for(this._removeDone();this._pending.size<8;){const e=this._getOrCreateNextStream(t);if(null==e)return;this._pending.add(e.read(t))}}_getOrCreateNextStream(t){const e=this._resolvedCount>=8?8:2;if(this._fileIndex<this._files.length&&this._streams.length<e){const e=this._files[this._fileIndex++],s=new D(e.id,this._createFileStream(e,t));return this._streams.push(s),s}return this._getNextStream()}_getNextStream(){const t=this._streams.length;for(let e=0;e<t;e++){const s=(this._streamIndex+e)%t,i=this._streams[s];if(i.canRead)return this._streamIndex=(s+1)%t,i}return null}_removeDone(){let t=this._streamIndex;for(let e=this._streams.length-1;e>=0;e--)this._streams[e].done&&(this._streams.splice(e,1),e<t&&t--);this._streamIndex=this._streams.length>0?t%this._streams.length:0}}function B(t){return Promise.race(Array.from(t,async t=>({read:t,chunk:await t})))}class D{constructor(t,e){this._fileId=t,this._stream=e,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&0===this._readCount}async read(t){this._readCount++;try{const e=await this._stream,s=await e.next(t);return null==s?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:s}}finally{this._readCount--}}}class Z{constructor(){this._queue=new h.QueueProcessor({concurrency:4,process:(t,e)=>this._executeQuery(t,e)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={}}async load(t){const e=t.spatialReference?c.A.fromJSON(t.spatialReference):void 0;if(e&&!e.isWGS84&&!e.isWebMercator)throw new n.A("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");this._customParameters=t.customParameters,this._provider=(0,I.M)(t.provider,null,()=>this._customParameters);const s=await this._provider.getMetadata(),i=await(0,b.nc)(s,{fields:t.fields?.map(t=>F.A.fromJSON(t)),geometryEncoding:t.geometryEncoding?(0,z.G)(t.geometryEncoding):null,geometryType:t.geometryType?(0,b.hG)(t.geometryType):null,displayOptimization:t.displayOptimization,spatialReference:e});if(!i.fields)throw new n.A("parquet:unsupported","Fields must be defined");let r;if(i.spatialReference&&i.geometryType){if(!i.spatialReference)throw new n.A("parquet:unsupported","SpatialReference must be defined");if(!i.spatialReference.isGeographic&&!i.spatialReference.isWebMercator)throw new n.A("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");i.spatialReference.isGeographic&&!i.spatialReference.isWGS84&&(o.A.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:i.spatialReference}),i.spatialReference=c.A.WGS84),r={geometry:i.geometryEncoding?{geometryType:(0,b.sA)(i.geometryType),spatialReference:i.spatialReference.toJSON(),encoding:i.geometryEncoding.toJSON()}:null,displayOptimization:i.displayOptimization}}this.setCustomParameters(t.customParameters),this._displayOptimization=i.displayOptimization,await this._provider.updateGeometryInfo(r),this._capabilities=K(await this._getFileStatistics());const a=await this._provider.getFiles();if(!a.length)return{layerDefinition:{},capabilities:K(null)};const u=await a[0].file;i.file=u;const{fields:h}=i;if(null==h)throw new n.A("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",h);h.push(new F.A({name:M,type:"oid",alias:M}));for(const t of h){const e=u.getColumnId(t.name);null!=e&&(this._indexMap[t.name]=e)}const l=new v.A(h.map(t=>t.toJSON()));this._fieldsIndex=l;const p=(0,b.sA)(i.geometryType??"point");return this._metadata=T.i.createFeature({fieldsIndex:l.toJSON(),geometryType:p,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:M},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:i.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:p,featureIdInfo:{type:"object-id",fieldName:M},hasM:!1,hasZ:!1,spatialReference:i.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=s?.extent?s.extent:await this._tryDeriveParquetFullExtent(i),{capabilities:this._capabilities,layerDefinition:{fields:i.fields?.map(t=>t.toJSON()),drawingInfo:(0,P.F0)(p),extent:this._fullExtent??void 0,geometryType:p,geometryEncoding:i.geometryEncoding?.toJSON(),displayOptimization:i.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(const{handle:t}of this._streams.values())t.remove();this._streams.clear()}setCustomParameters(t){this._customParameters=t}getIndexMap(){return this._indexMap}async updateFileProvider(t){this._provider=(0,I.M)(t,this._provider.getGeometryInfo(),()=>this._customParameters)}async queryFeatures(t,e){const s=await(0,w.T2)(t,null,this._queryEngineParams.spatialReference);return this._validateQuery(s),function(t){return!!(t.objectIds?.length||t.outStatistics||t.orderByFields?.length||t.returnDistinctValues)}(s)||(s.resultRecordCount=s.resultRecordCount?Math.min(s.resultRecordCount,k):k,s.resultOffset=s.resultOffset??0),s.outStatistics?this._queryStatistics(s,e):(s.returnDistinctValues&&(s.returnGeometry=void 0),(await this._enqueueQuery(s,e)).createQueryResponse())}async queryFeatureCount(t,e){const s=await(0,w.T2)(t,null,this._queryEngineParams.spatialReference);return this._validateQuery(s),V(s)?(s.outFields=void 0,s.returnGeometry=void 0,(await this._enqueueQuery(s,e)).createQueryResponseForCount()):this._getFeatureCount()}async queryObjectIds(t,e){const s=await(0,w.T2)(t,null,this._queryEngineParams.spatialReference);return this._validateQuery(s),V(s)?(s.resultRecordCount=s.resultRecordCount?Math.min(s.resultRecordCount,8e3):8e3,s.resultOffset=s.resultOffset??0,s.returnGeometry=void 0,s.outFields=void 0,(await this._enqueueQuery(s,e)).items.map(t=>t.getObjectId())):Array.from({length:await this._getFeatureCount()},(t,e)=>e)}async queryAttributeBins(t,e={}){throw new n.A("parquet:unsupported","queryAttributeBins not supported.")}async queryExtent(t,e){const s=await(0,w.T2)(t,null,this._queryEngineParams.spatialReference);if(this._validateQuery(s),this._fullExtent&&!V(s))return{count:await this._getFeatureCount(),extent:this._fullExtent};const i=(0,r.z)(this._metadata.spatialReference);s.returnGeometry=!0,s.outFields=void 0;const n=(0,p.hZ)((0,p.vt)(),p.qv),a=(0,p.vt)(),o=await this._enqueueQuery(s,e);let u=0;for(const t of o.items)t.getBounds(a)&&((0,p.RF)(n,a),u+=1);return{count:u,extent:(0,m.Wc)(n,i,s.outSR?(0,r.z)(s.outSR):i.toJSON(),i,!1)}}async queryStream(t,e){if(!e.signal)throw new Error("InternalError: AbortSignal must be passed");const s=await this._getCandidateFiles(t),i=new Q(s,async(e,s)=>{const i=await e.file,r=await this._createParquetQuery(i,e.id,t);return i.executeQuery(r,s)}),r=this._streamIdCounter++,n=(0,u.NY)(e.signal,t=>{const e=this._streams.get(r);null!=e&&(e.handle.remove(),this._streams.delete(r))});return this._streams.set(r,{stream:i,handle:n}),r}async getStreamNext(t,e){if(!e.signal)throw new Error("InternalError: AbortSignal must be passed");const s=this._streams.get(t);if(!s)return{result:null};const i=await s.stream.next(e.signal);if(null==i)return s.handle.remove(),this._streams.delete(t),{result:null};const r=i.chunk.serialize().buffer,n={fileId:i.fileId,buffer:r};return r instanceof ArrayBuffer?{result:n,transferList:[r]}:{result:n}}async getStreamNextFeatures(t,e){const{result:s}=await this.getStreamNext(t,e);if(null==s)return null;const i=(await(0,O.N)()).ParquetChunk.deserialize(new Uint8Array(s.buffer)),r=new E.s(this._metadata,this._indexMap,i,s.fileId),n=[];for(;r.next();){const t=(0,_.zv)(r.readGeometryWorldSpace(),r.geometryType,r.hasZ,r.hasM),e=r.readAttributes();n.push({attributes:e,geometry:t})}return{features:n}}async createPatch(t,e,s,i,r){if(!r.signal)throw new Error("InternalError: AbortSignal must be passed");const n=await this._getFileInfoById(t),a=await n.file;return(await a.createChunkPatch(e,s,i,r.signal)).serialize().buffer}async _getCandidateFiles(t){const e=await this._provider.getFiles(),s=await this._getSpatialFilePruning(t);if(null==s)return e;const i=e.filter(t=>this._mayIncludeFileForSpatialPruning(t,s));return"xz"===s.type?function(t,e){return t.slice().sort((t,s)=>{const i=H(t,e),r=H(s,e);return i===r?0:i<r?-1:1})}(i,s):i}async _queryStatistics(t,e){const s=await(0,w.T2)({...t},null,this._queryEngineParams.spatialReference);if(s.returnGeometry=void 0,function(t,e){return!!t.outStatistics?.length&&!V(t)&&!t.groupByFieldsForStatistics?.length&&!t.orderByFields?.length&&!t.returnDistinctValues&&!t.returnAggIds&&t.outStatistics.every(t=>function(t,e){switch(t.statisticType){case"count":return"1"===t.onStatisticField||null!=e.get(t.onStatisticField);case"min":case"max":{const s=e.get(t.onStatisticField);return null!=s&&(0,N.WA)(s)}default:return!1}}(t,e))}(s,this._fieldsIndex)){const t=await this._getStatisticsFromFiles(s);if(t)return t}return(await this._enqueueQuery(s,e)).createQueryResponse()}async _getStatisticsFromFiles(t){const e=await this._provider.getFiles(),s={},i=[];for(const r of t.outStatistics??[]){const t=J(r,e);if(!t.available)return null;s[r.outStatisticFieldName]=t.value,i.push(W(r,this._fieldsIndex))}return{fields:i,features:[{attributes:s}]}}async _getSpatialFilePruning(t){if("tile"!==t.type&&("arcade"!==t.type||null==t.extent))return null;const e=this._displayOptimization,s=e?.index;if(null==s)return null;const i=t.outSpatialReference.wkid;if(null==s.wkid||null==i)return null;const r=s.wkid,n=await(0,O.N)();switch(s.type){case"xz":return{type:"xz",fieldName:s.code,intersects:(e,a)=>n.queryIntersectsXZStatistics(s.fullExtent,t.extent,i,r,20,e,a)};case"z":return{type:"xy",xFieldName:s.xColumn,yFieldName:s.yColumn,intersects:(e,s,a,o)=>n.queryIntersectsXYStatistics(t.extent,i,r,e,s,a,o)}}}_mayIncludeFileForSpatialPruning(t,e){switch(e.type){case"xz":{const s=Y(t,e);return null==s||function(t,e){const s=X(t.minValue),i=X(t.maxValue);return null==s||null==i||e.intersects(s,i)}(s,e)}case"xy":{const{xStatistics:s,yStatistics:i}=function(t,e){return{xStatistics:t.statistics.statistics.get(e.xFieldName)??null,yStatistics:t.statistics.statistics.get(e.yFieldName)??null}}(t,e);return null==s||null==i||function(t,e,s){const i=X(t.minValue),r=X(t.maxValue),n=X(e.minValue),a=X(e.maxValue);return null==i||null==r||null==n||null==a||s.intersects(i,r,n,a)}(s,i,e)}}}async _tryDeriveParquetFullExtent(t){if(!t.spatialReference)return null;if(null==this._fullExtent&&"location"===t.geometryEncoding?.type){const e=await this._provider.getFiles(),{xField:s,yField:r}=t.geometryEncoding,n=(0,p.hZ)((0,p.vt)(),p.qv);for(const t of e){const e=await t.file;for(const t of e.rowGroups()){const e={stack:[],error:void 0,hasError:!1};try{const a=(0,i.mS)(e,t.columnDescriptorForAttribute(s),!1),o=(0,i.mS)(e,t.columnDescriptorForAttribute(r),!1),u=[a.minValue(),o.minValue(),a.maxValue(),o.maxValue()];(0,p.DC)(n,u),t.free()}catch(t){e.error=t,e.hasError=!0}finally{(0,i.hk)(e)}}}return{xmin:n[0],ymin:n[1],xmax:n[3],ymax:n[4],spatialReference:t.spatialReference?.toJSON()}}return null}async _getFileInfoById(t){const e=await this._provider.getFiles();for(const s of e)if(s.id===t)return s;throw new Error(`InternalError: File ${t} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(t){return(await this._getFileInfoById(t)).file}async _createParquetQuery(t,e,s){const i=(await(0,O.N)()).Query.new();return"tile"===s.type?(i.setExtent(s.extent),i.setQuantizationTransform(s.transform),i.setScale(s.scale)):"arcade"===s.type&&null!=s.extent&&i.setExtent(s.extent),i.setOutFields(s.outFields.filter(t=>null!=this._indexMap[t])),i.setOutSpatialReference(s.outSpatialReference.wkid),i.setReturnGeometry(s.returnGeometry),s.where&&await this._setWhereClause(i,t,e,s.where),i}async _getFeatureCount(){return(await this._provider.getFiles()).map(t=>t.statistics.rowCount).reduce((t,e)=>t+e,0)}async _getByteLength(){return(await this._provider.getFiles()).map(t=>t.statistics.byteSize).reduce((t,e)=>t+e,0)}_validateQuery(t){if(!this._capabilities.query.supportsStatistics&&t.outStatistics)throw new n.A("parquet:unsupported","Statistics queries are not supported",{query:t});if(!this._capabilities.query.supportsOrderBy&&t.orderByFields?.length)throw new n.A("parquet:unsupported","Queries using orderBy are not supported",{query:t});if(!this._capabilities.query.supportsDistinct&&t.returnDistinctValues)throw new n.A("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:t})}async _setWhereClause(t,e,s,i){const r=this._indexMap,a=this._fieldsIndex,o={getAttribute(t,i){const n=r[i];if(null==n){const e=a.get(i);if("__OBJECTID"===e?.name){const e=t.row+t.rowGroupStart;return(0,S.xb)(s,e)}return null}const o=e.readAttribute(t.rowGroup,t.row,n);if(null==o)return null;const u=a.get(i);return"esriFieldTypeString"===u.type||"esriFieldTypeDateOnly"===u.type||"esriFieldTypeTimeOnly"===u.type||"esriFieldTypeTimestampOffset"===u.type?G.decode(o):o}},u=await(0,l.GP)(i,this._fieldsIndex);if(!u.isStandardized)throw new n.A("sql-parse-error","expression is not standardized");const h=u.fieldNames.map(t=>a.get(t)).filter(t=>t&&null!=this._indexMap[t?.name]);t.setWhere(i),t.setWhereEvaluator((t,e,s)=>u.testFeatureCompiled({rowGroup:t,row:e,rowGroupStart:s},o,null)),t.setWhereFields(h.map(t=>t.name))}async*_queryChunks(t,e){const s=await(0,O.N)(),i=await this._provider.getFiles(),r=await this._getRequiredFields(t),n=this._tryGetGeneralizedGeometryScale(t);for(const a of i){const i=await a.file,o=s.Query.new();o.setOutFields(r),(t.geometry||t.returnGeometry)&&o.setReturnGeometry(!0),null!=n&&o.setScale(n);const h=t.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=h.wkid;if(t.geometry&&((0,y.K8)(h)||(0,y.oT)(h))){const e=(0,d.C)((0,d.vt)(),d.qv);for(const s of(0,m.qo)(t.geometry))(0,d.DC)(e,s);o.setOutSpatialReference(l),o.setExtent({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3]})}t.where&&await this._setWhereClause(o,i,a.id,t.where);const c=await i.executeQuery(o),p=[],f=c.next(e);for(let t=0;t<4;t++)p.push(c.next(e));let _=await f;for(;null!=_;){(0,u.Te)(e);const t=new E.s(this._metadata,this._indexMap,_,a.id),s=L([new q.j(t,null,0,!1)],this._queryEngineParams),i=p.shift();p.push(c.next(e)),yield s,_=await i}}}_enqueueQuery(t,e){return this._queue.push(t,e)}async _executeQuery(t,e){if(t.objectIds?.length){const s=new Map;for(const e of t.objectIds){const t=(0,S.wY)(e),i=(0,S.gE)(e);let r=s.get(t);r||(r=[],s.set(t,r)),r.push(i)}const i=[];for(const[r,n]of s.entries()){const s=await this._executeFileIdQuery(t,r,n,e);for(const t of s)i.push(t)}return new x.G(i,t,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:A,featureIdInfo:this._queryEngineParams.featureIdInfo})}let s=t.resultRecordCount??await this._getFeatureCount(),i=t.resultOffset??0;if(s>2e7)throw new n.A("parquet:cannot-execute-query","Unable to execute query, dataset is too large.");const r={...t};t.where=void 0,t.resultRecordCount=void 0,t.resultOffset=void 0;const a=[];for await(const n of this._queryChunks(r,e)){const r=await n.executeQueryForOpaqueFeatures(t,e);if(r.length>i){const e=r.slice(i,Math.min(i+s,r.length));for(const t of e)a.push(t);if(i=0,s-=e.length,0===s)return new x.G(a,t,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:A,featureIdInfo:this._queryEngineParams.featureIdInfo})}else i-=r.length}return new x.G(a,t,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:A,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(t,e,s,i){const r=await this._getRequiredFields(t),n=(await(0,O.N)()).Query.new();n.setOutFields(r),n.setReturnGeometry(!!t.returnGeometry),n.setIds(new Uint32Array(s));const a=await this._getFile(e),o=await a.executeQuery(n,i);let u=await o.next(i),h=0;const l=[];for(;null!=u;){const t=new E.s(this._metadata,this._indexMap,u,e),s=new q.j(t,null,h++,!1);l.push(s),u=await o.next(i)}return L(l,this._queryEngineParams).executeQueryForOpaqueFeatures(t,i)}async _getRequiredFields(t){const e=new Set;if(t.outStatistics)for(const s of t.outStatistics)null!=s.onStatisticField&&e.add(s.onStatisticField);else if(t.outFields)for(const s of t.outFields)e.add(s);return(e.has("*")?this._fieldsIndex.fields.map(t=>t.name):Array.from(e)).filter(t=>null!=this._indexMap[t])}_tryGetGeneralizedGeometryScale(t){if(!this._displayOptimization)return null;const e=t.outSR??this._queryEngineParams.spatialReference;if(!(0,y.K8)(e)&&!(0,y.oT)(e))return null;const s=t.quantizationParameters?.tolerance??t.maxAllowableOffset;return s?(0,f.gB)(s,e):null}}function V(t){for(const e in t){const s=e;switch(s){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"objectIds":case"historicMoment":case"where":return null!=t[s]}}return!1}function W(t,e){const s="exceedslimit"!==t.statisticType?e.get(t.onStatisticField):null,i="min"!==t.statisticType&&"max"!==t.statisticType||"esriFieldTypeDate"!==s?.type?"esriFieldTypeDouble":s.type;return{name:t.outStatisticFieldName,alias:t.outStatisticFieldName,type:i}}function J(t,e){switch(t.statisticType){case"count":return function(t,e){if("count"!==t.statisticType)return{available:!1,value:null};if("1"===t.onStatisticField)return{available:!0,value:e.reduce((t,e)=>t+e.statistics.rowCount,0)};let s=0;for(const i of e){const e=i.statistics.statistics.get(t.onStatisticField);if(null==e||null==e.nullCount)return{available:!1,value:null};s+=i.statistics.rowCount-e.nullCount}return{available:!0,value:s}}(t,e);case"min":return j(t,e,Math.min);case"max":return j(t,e,Math.max);default:return{available:!1,value:null}}}function j(t,e,s){if("min"!==t.statisticType&&"max"!==t.statisticType)return{available:!1,value:null};let i=null;const r="min"===t.statisticType?"minValue":"maxValue";for(const n of e){const e=n.statistics.statistics.get(t.onStatisticField);if(null==e)return{available:!1,value:null};const a=U(e[r]);null!=a&&(i=null==i?a:s(i,a))}return{available:!0,value:i}}function U(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function L(t,e){const s=new R.I;for(const e of t)s.insert(e);return new m.do({...e,featureStore:s})}function Y(t,e){return t.statistics.statistics.get(e.fieldName)??null}function H(t,e){const s=Y(t,e);if(null==s)return Number.POSITIVE_INFINITY;const i=X(s.minValue),r=X(s.maxValue);return null==i||null==r||r<i?Number.POSITIVE_INFINITY:r-i}function X(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function K(t){const e=t?.featureCount;let s=!1;return null!=e&&e<(0,a.A)("parquetlayer-full-query-feature-count")&&(s=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{...g.F,maxRecordCount:k,supportsOrderBy:s,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}}}]);
|