UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

1 lines • 28.3 kB
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2330],{13069(t,e,s){s.d(e,{AG:()=>a,lk:()=>n,vD:()=>o,yS:()=>i});const r="randomUUID"in crypto;function n(){if(r)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint16Array(8));t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const e=e=>t[e].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}function i(){return`{${n().toUpperCase()}}`}function o(){return`{${n()}}`}function a(t){const e=t.toUpperCase();return t.startsWith("{")?e:`{${e}}`}},58501(t,e,s){s.d(e,{q:()=>n});var r=s(62815);function n(t,e,s){if(!s?.features||!s.hasZ)return;const n=(0,r.N)(s.geometryType,e,t.outSpatialReference);if(n)for(const t of s.features)n(t.geometry)}},62815(t,e,s){s.d(e,{N:()=>a,d:()=>l});var r=s(86211),n=s(73941),i=s(21325),o=s(52006);function a(t,e,s){const r=l(e,s);if(1!==r)switch(t){case"point":case"esriGeometryPoint":return t=>function(t,e){null!=t?.z&&(t.z*=e)}(t,r);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,o.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,r);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,o.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,r);case"multipoint":case"esriGeometryMultipoint":return t=>function(t,e){if(t)for(const s of t.points)s.length>2&&(s[2]*=e)}(t,r);case"extent":case"esriGeometryEnvelope":return t=>function(t,e){t&&null!=t.zmin&&null!=t.zmax&&(t.zmin*=e,t.zmax*=e)}(t,r);default:return}}function l(t,e){return null==t||null==e||e.vcsWkid||(0,i.aI)(t,e)||(0,n.xP)(t)||(0,n.xP)(e)?1:(0,r.G9)(t)/(0,r.G9)(e)}},72802(t,e,s){s.d(e,{U:()=>n});var r=s(19419);class n{constructor(t,e,s,n=(0,r.vt)()){this._level=t,this._row=e,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(t){this._level=t,this._id=null}get row(){return this._row}set row(t){this._row=t,this._id=null}get col(){return this._col}set col(t){this._col=t,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(t){return new n(t.level,t.row,t.col,t.extent)}}},79677(t,e,s){s.d(e,{A:()=>c});var r,n=s(5482),i=s(25482),o=s(88930),a=s(91429),l=s(98623),u=s(36005),h=s(43937);let c=class extends i.o{static{r=this}static get allTime(){return g}static get empty(){return p}static fromArray(t){return new r({start:null!=t[0]?new Date(t[0]):t[0],end:null!=t[1]?new Date(t[1]):t[1]})}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,s=this.end?.getTime()??this.end,r=t.start?.getTime()??t.start,n=t.end?.getTime()??t.end;return e===r&&s===n}expandTo(t,e=l.qU){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();let s=this.start;s&&(s=(0,o.lL)(s,t,e));let n=this.end;if(n){const s=(0,o.lL)(n,t,e);n=n.getTime()===s.getTime()?s:(0,o.S1)(s,1,t,e)}return new r({start:s,end:n})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return r.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,s=this.end?.getTime()??1/0,n=t.start?.getTime()??-1/0,i=t.end?.getTime()??1/0;let o,a;return n>=e&&n<=s?o=n:e>=n&&e<=i&&(o=e),s>=n&&s<=i?a=s:i>=e&&i<=s&&(a=i),null==o||null==a||isNaN(o)||isNaN(a)?r.empty:new r({start:o===-1/0?null:new Date(o),end:a===1/0?null:new Date(a)})}offset(t,e,s=l.qU){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();const n=new r,{start:i,end:a}=this;return null!=i&&(n.start=(0,o.S1)(i,t,e,s)),null!=a&&(n.end=(0,o.S1)(a,t,e,s)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return g.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,s=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new r({start:e,end:s})}};(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"end",void 0),(0,n.Cg)([(0,u.w)("end")],c.prototype,"readEnd",null),(0,n.Cg)([(0,h.K)("end")],c.prototype,"writeEnd",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],c.prototype,"isAllTime",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],c.prototype,"isEmpty",null),(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"start",void 0),(0,n.Cg)([(0,u.w)("start")],c.prototype,"readStart",null),(0,n.Cg)([(0,h.K)("start")],c.prototype,"writeStart",null),c=r=(0,n.Cg)([(0,a.$K)("esri.time.TimeExtent")],c);const g=new c,p=new c({start:void 0,end:void 0})},79897(t,e,s){s.d(e,{U:()=>h});var r=s(5482),n=s(69622),i=s(36563),o=s(36708),a=s(76030),l=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(t,e,s={}){return this._installWatch(t,e,s,o.wB)}addWhen(t,e,s={}){return this._installWatch(t,e,s,o.z7)}addOnCollectionChange(t,e,{initial:s=!1,final:r=!1}={}){const n=++this._handleId;return this.addHandles([(0,o.on)(t,"after-changes",this._createSyncUpdatingCallback(),o.OH),(0,o.on)(t,"change",e,{onListenerAdd:s?t=>e({added:t.toArray(),removed:[]}):void 0,onListenerRemove:r?t=>e({added:[],removed:t.toArray()}):void 0})],n),(0,i.hA)(()=>this.removeHandles(n))}addPromise(t){if(null==t)return t;const e=++this._handleId;this.addHandles((0,i.hA)(()=>{this._pendingPromises.delete(t)&&(0!==this._pendingPromises.size||this.hasHandles(c)||this._set("updating",!1))}),e),this._pendingPromises.add(t),this._set("updating",!0);const s=()=>this.removeHandles(e);return t.then(s,s),t}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(t,e,s={},r){const n=++this._handleId;s.sync||this._installSyncUpdatingWatch(t,n);const o=r(t,e,s);return this.addHandles(o,n),(0,i.hA)(()=>this.removeHandles(n))}_installSyncUpdatingWatch(t,e){const s=this._createSyncUpdatingCallback(),r=(0,o.wB)(t,s,{sync:!0,equals:()=>!1});return this.addHandles(r,e),r}_createSyncUpdatingCallback(){return()=>{this.removeHandles(c),++this._scheduleHandleId;const t=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,a._)(()=>{t===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(c))}),c)}}};(0,r.Cg)([(0,l.MZ)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,r.Cg)([(0,u.$)("esri.core.support.UpdatingHandles")],h);const c=-42},87045(t,e,s){s.d(e,{A:()=>x});var r,n=s(5482),i=s(66552),o=s(25482),a=s(86211),l=s(91429),u=s(56507),h=s(86738),c=s(16930),g=s(21325),p=s(28735),d=s(91806),f=s(72802),m=s(36005),v=s(43937);const y=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(t={}){const{resolutionFactor:e=1,scales:s,size:n=256,spatialReference:i=c.A.WebMercator,numLODs:o=24}=t;if(!(0,g.fn)(i)){const t=[];if(s)for(let e=0;e<s.length;e++){const r=s[e];t.push(new d.A({level:e,scale:r,resolution:r}))}else{let e=5e-4;for(let s=o-1;s>=0;s--)t.unshift(new d.A({level:s,scale:e,resolution:e})),e*=2}return new r({dpi:96,lods:t,origin:new h.A(0,0,i),size:[n,n],spatialReference:i})}const l=(0,g.Vp)(i),u=t.origin?new h.A({x:t.origin.x,y:t.origin.y,spatialReference:i}):new h.A(l?{x:l.origin[0],y:l.origin[1],spatialReference:i}:{x:0,y:0,spatialReference:i}),p=1/(39.37*(0,a.GA)(i)*96),f=[];if(s)for(let t=0;t<s.length;t++){const e=s[t],r=e*p;f.push(new d.A({level:t,scale:e,resolution:r}))}else{let t=(0,g.EA)(i)?512/n*591657527.5917094:256/n*591657527.591555;const s=Math.ceil(o/e);f.push(new d.A({level:0,scale:t,resolution:t*p}));for(let r=1;r<s;r++){const s=t/2**e,n=s*p;f.push(new d.A({level:r,scale:s,resolution:n})),t=s}}return new r({dpi:96,lods:f,origin:u,size:[n,n],spatialReference:i})}constructor(t){super(t),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:t,origin:e}=this;if(t&&e){const s=(0,g.Vp)(t);return t.isWrappable&&!!s&&Math.abs(s.origin[0]-e.x)<=s.dx}return!1}readOrigin(t,e){return h.A.fromJSON({spatialReference:e.spatialReference,...t})}set lods(t){let e=0,s=0;const r=[],n=this._levelToLOD={};t&&(e=-1/0,s=1/0,t.forEach(t=>{r.push(t.scale),e=t.scale>e?t.scale:e,s=t.scale<s?t.scale:s,n[t.level]=t})),this._set("scales",r),this._set("lods",t),this._initializeUpsampleLevels()}readSize(t,e){return[e.cols,e.rows]}writeSize(t,e){e.cols=t[0],e.rows=t[1]}zoomToScale(t){const e=this.scales;if(t<=0)return e[0];if(t>=e.length-1)return e[e.length-1];const s=Math.floor(t),r=s+1;return e[s]/(e[s]/e[r])**(t-s)}scaleToZoom(t){const e=this.scales,s=e.length-1;let r=0;for(;r<s;r++){const s=e[r],n=e[r+1];if(s<=t)return r;if(n===t)return r+1;if(s>t&&n<t)return r+Math.log(s/t)/Math.log(s/n)}return r}tileAt(t,e,s,r){const n=this.lodAt(t);if(!n)return null;let i,o;if("number"==typeof e)i=e,o=s;else if((0,g.aI)(e.spatialReference,this.spatialReference))i=e.x,o=e.y,r=s;else{const t=(0,p.Cv)(e,this.spatialReference);if(null==t)return null;i=t.x,o=t.y,r=s}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return r??=new f.U(0,0,0),r.level=t,r.row=Math.floor((this.origin.y-o)/l+.001),r.col=Math.floor((i-this.origin.x)/a+.001),this.updateTileInfo(r),r}updateTileInfo(t,e=0){if(!("extent"in t))return!1;let s=this.lodAt(t.level);if(!s&&1===e){const e=this.lods[this.lods.length-1];e.level<t.level&&(s=e)}if(!s)return!1;const r=t.level-s.level,n=s.resolution*this.size[0]/2**r,i=s.resolution*this.size[1]/2**r;return t.extent[0]=this.origin.x+t.col*n,t.extent[1]=this.origin.y-(t.row+1)*i,t.extent[2]=t.extent[0]+n,t.extent[3]=t.extent[1]+i,!0}upsampleTile(t){const e=this._upsampleLevels[t.level];return!(!e||-1===e.parentLevel||(t.level=e.parentLevel,t.row=Math.floor(t.row/e.factor+.001),t.col=Math.floor(t.col/e.factor+.001),this.updateTileInfo(t),0))}getTileBounds(t,e){const s=this.lodAt(e.level);if(null==s)return null;const{resolution:r}=s,n=r*this.size[0],i=r*this.size[1];return t[0]=this.origin.x+e.col*n,t[1]=this.origin.y-(e.row+1)*i,t[2]=t[0]+n,t[3]=t[1]+i,t}lodAt(t){return this._levelToLOD?.[t]??null}clone(){return r.fromJSON(this.write({}))}getCompatibleForVTL(t){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===t)return null;const e=(512===this.size[0]&&256===t?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===t&&0===e)return this;const s=[],n=this.lods.length-e;for(let t=0;t<n;t++){const r=t+e,{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:t,scale:n,resolution:i}))}return new r({size:[t,t],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const t=this.lods;this._upsampleLevels=[];let e=null;for(let s=0;s<t.length;s++){const r=t[s];this._upsampleLevels[r.level]={parentLevel:e?e.level:-1,factor:e?e.resolution/r.resolution:0},e=r}}};(0,n.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],x.prototype,"compressionQuality",void 0),(0,n.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],x.prototype,"dpi",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{read:y.read,write:y.write,origins:{"web-scene":{read:!1,write:!1}}}})],x.prototype,"format",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],x.prototype,"isWrappable",null),(0,n.Cg)([(0,l.MZ)({type:h.A,json:{write:!0}})],x.prototype,"origin",void 0),(0,n.Cg)([(0,m.w)("origin")],x.prototype,"readOrigin",null),(0,n.Cg)([(0,l.MZ)({type:[d.A],value:null,json:{write:!0}})],x.prototype,"lods",null),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],x.prototype,"scales",void 0),(0,n.Cg)([(0,l.MZ)({cast:t=>Array.isArray(t)?t:"number"==typeof t?[t,t]:[256,256]})],x.prototype,"size",void 0),(0,n.Cg)([(0,m.w)("size",["rows","cols"])],x.prototype,"readSize",null),(0,n.Cg)([(0,v.K)("size",{cols:{type:u.jz},rows:{type:u.jz}})],x.prototype,"writeSize",null),(0,n.Cg)([(0,l.MZ)({type:c.A,json:{write:!0}})],x.prototype,"spatialReference",void 0),x=r=(0,n.Cg)([(0,l.$K)("esri.layers.support.TileInfo")],x)},87992(t,e,s){s.d(e,{JR:()=>E,ME:()=>M,MY:()=>S,NO:()=>C,Nh:()=>A,V2:()=>Z,_s:()=>b,e6:()=>I,gh:()=>_,tr:()=>V,uX:()=>m});var r=s(5482),n=s(69397),i=s(16930),o=(s(70328),s(19419)),a=s(60408),l=s(21325),u=s(513),h=s(50954),c=s(79567),g=s(52006),p=s(49663),d=s(46068),f=s(92722);class m{constructor({type:t,spatialReference:e,vertexCount:s,vertexXY:r,vertexZ:n,vertexM:i,partCount:o,partOffsets:a,partFlags:l,segmentFlags:u,segmentIndices:h,segmentParams:c,segmentCountArc:g,segmentCountBezier:p}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=t,this.spatialReference=e,this.vertexCount=s,this.vertexXY=r,this.vertexZ=n,this.vertexM=i,this.partCount=o,this.partOffsets=a,this.partFlags=l,this.segmentFlags=u,this.segmentIndices=h,this.segmentParams=c,this.segmentCountArc=g,this.segmentCountBezier=p}get segmentParamCount(){return 10*this.segmentCountArc+4*this.segmentCountBezier}get segmentCountLine(){const{segmentCount:t,segmentCountArc:e,segmentCountBezier:s}=this;return t&&t-e-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 null!=this.segmentFlags}isMultipart(){return"polyline"===this.type||"polygon"===this.type}get usedMemory(){function t(t){return t?n.Ul+t.byteLength:0}return t(this.vertexXY)+t(this.vertexZ)+t(this.vertexM)+t(this.partOffsets)+t(this.partFlags)+t(this.segmentFlags)+t(this.segmentIndices)+t(this.segmentParams)}clone(){const{type:t,vertexCount:e,partCount:s,hasZ:r,hasM:n,segmentCountArc:i,segmentCountBezier:o}=this,a=Z(t,e,s,r,n,this.hasCurves(),i,o);a.spatialReference=this.spatialReference;const{vertexXY:l,vertexZ:u,vertexM:h}=this;if(a.vertexXY.set(l.subarray(0,2*e),0),a.vertexZ?.set(u.subarray(0,e),0),a.vertexM?.set(h.subarray(0,e),0),this.isMultipart()){const{partOffsets:t,partFlags:e}=this;a.partFlags.set(e.subarray(0,s+1)),a.partOffsets.set(t.subarray(0,s+1))}if(this.hasCurves()){const{segmentFlags:t,segmentIndices:s,segmentParams:r,segmentParamCount:n}=this;a.segmentFlags.set(t.subarray(0,e),0),a.segmentIndices.set(s.subarray(0,e),0),a.segmentParams.set(r.subarray(0,n),0)}return a}equals(t){return this.equalsWithinTolerance(t,0)}equalsWithinTolerance(t,e){if(null==t)return!1;if(this===t)return!0;if(!(0,l.aI)(this.spatialReference,t.spatialReference))return!1;if(this.vertexCount!==t.vertexCount||this.partCount!==t.partCount)return!1;if(this.hasZ!==t.hasZ||this.hasM!==t.hasM)return!1;if(this.hasCurves()!==t.hasCurves()||this.segmentCountArc!==t.segmentCountArc||this.segmentCountBezier!==t.segmentCountBezier)return!1;const s=0===e?(t,e)=>t!==e||isNaN(t)!==isNaN(e):(t,s)=>Math.abs(t-s)>e||isNaN(t)!==isNaN(s);for(let e=0;e<this.vertexCount;++e)if(s(this.vertexXY[2*e],t.vertexXY[2*e])||s(this.vertexXY[2*e+1],t.vertexXY[2*e+1]))return!1;if(this.hasZ)for(let e=0;e<this.vertexCount;++e)if(s(this.vertexZ[e],t.vertexZ[e]))return!1;if(this.hasM)for(let e=0;e<this.vertexCount;++e)if(s(this.vertexM[e],t.vertexM[e]))return!1;for(let e=0;e<this.partCount;++e)if(this.partFlags[e]!==t.partFlags[e]||this.partOffsets[e]!==t.partOffsets[e])return!1;if(this.hasCurves()){for(let e=0;e<this.vertexCount;++e)if(this.segmentFlags[e]!==t.segmentFlags[e]||this.segmentIndices[e]!==t.segmentIndices[e])return!1;for(let e=0;e<this.segmentParamCount;++e)if(s(this.segmentParams[e],t.segmentParams[e]))return!1}return!0}get parts(){return this.isMultipart()?new v(this):[][Symbol.iterator]()}}class v{constructor(t){this.geometry=t,this.value=new y(t)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class y{constructor(t){this.geometry=t,this.index=-1,this._readVertex=T(t),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 t=this.geometry.partOffsets;return t[this.index+1]-t[this.index]}}class x{constructor(t){this._part=t,this._partStart=0,this._partEnd=0,this._isPolygon="polygon"===t.geometry.type,this.value=new w(t.geometry)}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;const t=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=t&&this._isPolygon?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){const{index:t}=this._part,e=this._part.geometry.partOffsets;this._partStart=e[t],this._partEnd=e[t+1]-(this._isPolygon?1:2),this.value.indexOfStartVertex=this._partStart-1}}class w{constructor(t){this.geometry=t,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=T(t)}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 t=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===t)return this.end;const e=this.geometry.segmentParams;let s=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===t){const t=e[s++],r=e[s++],n=e[s++],i=e[s++];return{b:[this.end,[t,r],[n,i]]}}const r=e[s++],n=e[s++],i=e[s++],o=e[s++],a=e[s++],l=e[s++];s++,s++;const u=e[s++],h=e[s++];if(!Boolean(4&r)&&1===i)return{c:[this.end,[u,h]]};const c=2&r?0:1,g=1&r?0:1;return{a:[this.end,[a,l],c,g,o,n,i]}}}function C(t,e){const s={stack:[],error:void 0,hasError:!1};try{return e??=(0,o.Ie)(),(0,r.mS)(s,new P(t,["vertexZ","vertexM","spatialReference"]),!1),(0,o.bx)(e,function(t){let e;const{vertexCount:s,vertexXY:n,vertexZ:i,vertexM:a}=t,l=O(t);if(t.hasCurves()){const s={stack:[],error:void 0,hasError:!1};try{(0,r.mS)(s,new P(t,["vertexZ","vertexM"]),!1);const n=(0,o.Ie)();for(const e of t.parts){let t=e.startVertex;for(const{curve:s}of e.segments)(0,c.e)(n,t,s),t=(0,g.yP)(s)}const[i,a,u,h]=n;e={xmin:i,ymin:a,xmax:u,ymax:h,spatialReference:l}}catch(t){s.error=t,s.hasError=!0}finally{(0,r.hk)(s)}}else{let t,r,i,o;t=r=1/0,i=o=-1/0;for(let e=0;e<s;++e){const s=n[2*e],a=n[2*e+1];t=Math.min(t,s),i=Math.max(i,s),r=Math.min(r,a),o=Math.max(o,a)}e={xmin:t,ymin:r,xmax:i,ymax:o,spatialReference:l}}if(i){let t=1/0,s=-1/0;for(const e of i)t=Math.min(t,e),s=Math.max(s,e);e.zmin=t,e.zmax=s}if(a){let t=1/0,s=-1/0;for(const e of a)t=Math.min(t,e),s=Math.max(s,e);e.mmin=t,e.mmax=s}return e}(t)),e}catch(t){s.error=t,s.hasError=!0}finally{(0,r.hk)(s)}}function M(t){let e,s,r;if((0,a.fT)(t)){r="point";const{x:n,y:i,z:o,m:a}=t,l=[n,i];null!=o&&l.push(o),null!=a&&l.push(a),s=[[l]],e=1}else(0,a.U9)(t)?(r="multipoint",s=[t.points],e=t.points.length):(0,a.Rg)(t)?(r="polyline",s=t.curvePaths??t.paths,e=s.reduce((t,e)=>t+e.length,0)):(r="polygon",s=t.curveRings??t.rings,e=s.reduce((t,e)=>(0===e.length||(t+=e.length,R(e[0],(0,g.yP)(e.at(-1)))&&--t),t),0));const n=Z(r,e,r.includes("point")?0:s.length,(0,a.Pv)(t),(0,a.W0)(t),(0,g.Ed)(t)),{hasZ:i,hasM:o,vertexXY:l,vertexZ:u,vertexM:h}=n;function c(t){l[2*d]=t[0],l[2*d+1]=t[1],i&&(u[d]=t[2]),o&&(h[d]=t[p]),++d}n.spatialReference=t.spatialReference??void 0;const p=n.hasZ?3:2;let d=0;if(!n.isMultipart()){if(!i&&!o){for(const[t,e]of s[0])l[2*d]=t,l[2*d+1]=e,++d;return n}for(const t of s[0])c(t);return n}const f="polygon"===r,{partOffsets:m}=n;let v=0;if(!n.hasCurves()){for(const t of s){if(m[v++]=d,0===t.length)continue;let e=t.length;if(f&&R(t[0],t.at(-1))&&--e,i||o)for(let s=0;s<e;++s)c(t[s]);else for(let s=0;s<e;++s){const[e,r]=t[s];l[2*d]=e,l[2*d+1]=r,++d}}return m[v]=d,n}function y(t){const e=x+t;if(e<=(n.segmentParams?.length??0))return;let s=e*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 t of s){if(n.partOffsets[v++]=d,0===t.length)continue;const e=t[0];let s=e;for(let e=1;e<t.length;++e){const r=t[e];c(s);const i=d-1;(0,g.wY)(r)?(y(10),++n.segmentCountArc,x=b(s,r,n,i,x),s=r.a[0]):(0,g.DA)(r)?(y(10),++n.segmentCountArc,x=z(s,r,n,i,x),s=r.a[0]):(0,g.aO)(r)?(y(10),++n.segmentCountArc,x=I(s,r,n,i,x),s=r.c[0]):(0,g.n1)(r)?(y(4),++n.segmentCountBezier,x=V(0,r,n,i,x),s=r.b[0]):s=r}f&&R(e,s)||c(s)}return n.partOffsets[v]=d,n}function _(t){const e=T(t),{vertexCount:s,partCount:r,hasZ:n,hasM:i}=t,o=O(t);if("point"===t.type){const[e,s]=t.vertexXY,r=t.vertexZ?.[0],n=t.vertexM?.[0];return{x:e,y:s,z:r,m:n,spatialReference:o}}let a=0;if("multipoint"===t.type){const t=[];for(;a<s;)t.push(e(a++));return{points:t,spatialReference:o,hasZ:n,hasM:i}}const l="polygon"===t.type;if(!t.hasCurves()){const s=new Array;for(let n=0;n<r;++n){const r=t.partOffsets[n+1],i=new Array;for(;a<r;)i.push(e(a++));l&&i.length>0&&i.push(i[0]),s.push(i)}return l?{rings:s,hasZ:n,hasM:i,spatialReference:o}:{paths:s,hasZ:n,hasM:i,spatialReference:o}}const u=new Array;for(const{segments:e,startVertex:s}of t.parts){const t=[s];for(const{curve:s}of e)t.push(s);u.push(t)}return l?{rings:[],curveRings:u,hasZ:n,hasM:i,spatialReference:o}:{paths:[],curvePaths:u,hasZ:n,hasM:i,spatialReference:o}}function A(t,{lengths:e,coords:s,hasZ:r,hasM:n},i){const o=t.includes("point")?0:e.length,a="polygon"===t,l="point"===t?1:e.reduce((t,e)=>t+e,0)-(a?o:0);r??=!1,n??=!1;const u=Z(t,l,o,r,n,!1,0,0);if(u.spatialReference=i??void 0,!u.isMultipart()){for(let t=0,e=0;t<l;++t)u.vertexXY[2*t]=s[e++],u.vertexXY[2*t+1]=s[e++],r&&(u.vertexZ[t]=s[e++]),n&&(u.vertexM[t]=s[e++]);return u}const h=2+Number(r)+Number(n);let c=0,g=0;u.partOffsets[0]=0;for(const t of e){const e=u.partOffsets[g],i=e+t-Number(a);u.partOffsets[++g]=i;for(let t=e;t<i;++t)u.vertexXY[2*t]=s[c++],u.vertexXY[2*t+1]=s[c++],r&&(u.vertexZ[t]=s[c++]),n&&(u.vertexM[t]=s[c++]);a&&(c+=h)}return u}function E({type:t,vertexCount:e,vertexXY:s,vertexZ:r,vertexM:n,partCount:i,partOffsets:o,hasZ:a,hasM:l}){const u=new f.A([],[],a,l);i=Math.max(i,1);const h="polygon"===t;let c=0;for(let t=0;t<i;++t){const i=o?.[t+1]??e,g=u.coords.length;for(let t=c;t<i;++t)u.coords.push(s[2*t],s[2*t+1]),a&&u.coords.push(r[t]),l&&u.coords.push(n[t]);if(h){const t=c;u.coords.push(s[2*t],s[2*t+1]),a&&u.coords.push(r[t]),l&&u.coords.push(n[t])}u.lengths.push((u.coords.length-g)/u.stride),c=i}return"point"===t&&(u.lengths.length=0),u}function S(t,e){return"getSpatialReference"in t&&(e=function(t){if(null==t)return;const e=t.getText()||void 0,s=t.isCustomWkid()?0:t.getOldID();if(s<=0)return{wkt:e};let r=t.getLatestID();(r<=0||r===s)&&(r=void 0);const n=t.getVCS();if(null==n)return{wkid:s,latestWkid:r,wkt:e};const i=n.isCustomWkid()?0:n.getOldID();if(i<=0)return{wkt:e};let o=t.getLatestVerticalID();return(o<=0||o===i)&&(o=void 0),{wkid:s,wkt:e,latestWkid:r,vcsWkid:i,latestVcsWkid:o}}(t.getSpatialReference()),t=t.getGeometry()),new m({...t.toFlatGeometry(),spatialReference:e})}class P{constructor(t,e){this.target=t,this.keys=e,this.oldValues=e.map(e=>t[e]);for(const s of e)t[s]=void 0}[Symbol.dispose](){this.keys.map((t,e)=>{this.target[t]=this.oldValues[e]})}}function O({spatialReference:t}){return t instanceof i.A?t.toJSON():t}function T({vertexXY:t,vertexZ:e,vertexM:s}){return e?s?r=>[t[2*r],t[2*r+1],e[r],s[r]]:s=>[t[2*s],t[2*s+1],e[s]]:s?e=>[t[2*e],t[2*e+1],s[e]]:e=>[t[2*e],t[2*e+1]]}function R(t,e){return t.every((t,s)=>t===e[s])}function Z(t,e,s,r,n,i,o,a){o??=0,a??=0;const l=new m({type:t,vertexCount:e,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:a});let u=2*Float64Array.BYTES_PER_ELEMENT*e;r&&(u+=Float64Array.BYTES_PER_ELEMENT*e),n&&(u+=Float64Array.BYTES_PER_ELEMENT*e),l.isMultipart()&&(u+=(s+1)*Int32Array.BYTES_PER_ELEMENT,u+=(s+1)*Int8Array.BYTES_PER_ELEMENT),i&&(u+=e*Int8Array.BYTES_PER_ELEMENT,u+=e*Int32Array.BYTES_PER_ELEMENT,u+=l.segmentParamCount*Float64Array.BYTES_PER_ELEMENT);const h=new ArrayBuffer(u);let c=0;return l.vertexXY=new Float64Array(h,c,2*e),c+=l.vertexXY.byteLength,r&&(l.vertexZ=new Float64Array(h,c,e),c+=l.vertexZ.byteLength),n&&(l.vertexM=new Float64Array(h,c,e),c+=l.vertexM.byteLength),i&&(l.segmentParams=new Float64Array(h,c,l.segmentParamCount),c+=l.segmentParams.byteLength,l.segmentIndices=new Int32Array(h,c,e),l.segmentIndices.fill(L),c+=l.segmentIndices.byteLength),l.isMultipart()&&(l.partOffsets=new Int32Array(h,c,s+1),c+=l.partOffsets.byteLength,l.partFlags=new Int8Array(h,c,s+1),c+=l.partFlags.byteLength,"polygon"===l.type&&l.partFlags.subarray(0,s).fill(1)),i&&(l.segmentFlags=new Int8Array(h,c,e),l.segmentFlags.fill(1),c+=l.segmentFlags.byteLength),l}function b(t,e,{segmentFlags:s,segmentIndices:r,segmentParams:n},i,o){s[i]=4,r[i]=o;const[a,[l,u],h,c,g,p,f]=e.a;let m=4;c||(m|=1),h||(m|=2);const v=(0,d.SW)(t,e),[y,x]=(0,d.Uk)(v,.5);return n[o++]=m,n[o++]=p,n[o++]=f,n[o++]=g,n[o++]=l,n[o++]=u,n[o++]=v.u2-v.u1,n[o++]=v.u1,n[o++]=y,n[o++]=x,o}function z(t,e,{segmentFlags:s,segmentIndices:r,segmentParams:n},i,o){s[i]=4,r[i]=o;const a=(0,p.i)(t,e);return F(a,4,...(0,u.mq)(a,.5),n,o)}function I(t,e,{segmentFlags:s,segmentIndices:r,segmentParams:n},i,o){return s[i]=4,r[i]=o,F((0,h.pM)(t,e),0,...e.c[1],n,o)}function F(t,e,s,r,n,i){const{cx:o,cy:a,thetaStart:l,thetaEnd:u,radius:h}=t;return l>u||(e|=1),Math.abs(u-l)<=Math.PI||(e|=2),n[i++]=e,n[i++]=h,n[i++]=1,n[i++]=0,n[i++]=o,n[i++]=a,n[i++]=u-l,n[i++]=l,n[i++]=s,n[i++]=r,i}function V(t,{b:[e,[s,r],[n,i]]},{segmentFlags:o,segmentIndices:a,segmentParams:l},u,h){return o[u]=2,a[u]=h,l[h++]=s,l[h++]=r,l[h++]=n,l[h++]=i,h}const N=1.61803,L=-1},91806(t,e,s){s.d(e,{A:()=>l});var r,n=s(5482),i=s(25482),o=s(91429),a=s(56507);let l=class extends i.o{static{r=this}constructor(t){super(t),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}}}})],l.prototype,"cols",void 0),(0,n.Cg)([(0,o.MZ)({type:a.jz,json:{write:!0}})],l.prototype,"level",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],l.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}}}})],l.prototype,"origin",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.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}}}})],l.prototype,"rows",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.prototype,"scale",void 0),l=r=(0,n.Cg)([(0,o.$K)("esri.layers.support.LOD")],l)}}]);