(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-15c3b8fe"],{9651:function(e,t,i){"use strict";i.d(t,"a",(function(){return D}));var a,l=i("a4ee"),r=i("2eab"),n=i("fc29"),s=i("f0b9"),o=i("ce50"),c=i("9096"),h=i("e92d"),p=i("c24e"),u=i("8a44"),b=i("f4cc"),d=i("477c"),v=i("5815"),m=i("e041"),f=i("59b2"),y=i("b50f"),O=(i("c120"),i("1a3e")),j=i("d386"),w=i("7ffa");class g{constructor(){this.location={left:0,top:0,width:0,height:0},this._allAvailability="unknown",this.byteSize=40}getAvailability(e,t){if("unknown"!==this._allAvailability)return this._allAvailability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),a=i%8,l=i>>3,r=this._tileAvailabilityBitSet;return l<0||l>r.length?"unknown":r[l]&1<e.data).catch(e=>{if(e&&e.details&&422===e.details.httpStatus)return{location:{top:a,left:l,width:n,height:s},valid:!0,data:Object(y["c"])(n*s,0)};throw e}).then(e=>{if(e.location&&(e.location.top!==a||e.location.left!==l||e.location.width!==n||e.location.height!==s))throw new o["a"]("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:a,left:l,width:n,height:s}});return g.fromJSON(e)})}static fromJSON(e){g._validateJSON(e);const t=new g;return t.location=Object.freeze(Object(w["a"])(e.location)),t._updateFromData(e.data),Object.freeze(t)}static _validateJSON(e){if(!e||!e.location)throw new o["a"]("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new o["a"]("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new o["a"]("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new o["a"]("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new o["a"]("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function _(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function S(e){let t;if("vector-tile"===e.service.type)t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;else{const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}const i=e.service.query;return i&&(t=`${t}?${i}`),t}const T=h["a"].getLogger("esri.layers.support.TilemapCache");let D=a=class extends(Object(c["b"])(n["a"])){constructor(e){super(e),this._pendingTilemapRequests={},this._availableLevels={},this.levels=5,this.cacheByteSize=2*s["a"].MEGABYTES,this.request=r["default"],this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new p["a"](this.cacheByteSize),this.handles.add([this.watch(["layer.parsedUrl","layer.tileServers?","layer.apiKey?","layer.customParameters?"],()=>this._initializeTilemapDefinition()),Object(d["e"])(()=>{var e,t;return null==(e=this.layer)||null==(t=e.tileInfo)?void 0:t.lods},e=>this._initializeAvailableLevels(e),d["d"])]),this._initializeTilemapDefinition()}castLevels(e){return e<=2?(T.error("Minimum levels for Tilemap is 3, but got ",e),3):e}get size(){return 1<{Object(b["q"])(n,()=>t(Object(b["e"])()));const i=_(l);let r=this._pendingTilemapRequests[i];if(!r){r=g.fromDefinition(l,a).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));const e=()=>delete this._pendingTilemapRequests[i];this._pendingTilemapRequests[i]=r,r.then(e,e)}r.then(e,t)})}getAvailability(e,t,i){if(!this._availableLevels[e])return"unavailable";const a=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return a?a.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,a){return this._availableLevels[e]?this.fetchTilemap(e,t,i,a).catch(e=>e).then(a=>{if(a instanceof g){const l=a.getAvailability(t,i);return"unavailable"===l?Promise.reject(new o["a"]("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})):l}if(Object(b["m"])(a))throw a;return"unknown"}):Promise.reject(new o["a"]("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`))}fetchAvailabilityUpsample(e,t,i,a,l){a.level=e,a.row=t,a.col=i;const r=this.layer.tileInfo;r.updateTileInfo(a);const n=this.fetchAvailability(e,t,i,l).catch(e=>{if(Object(b["m"])(e))throw e;if(r.upsampleTile(a))return this.fetchAvailabilityUpsample(a.level,a.row,a.col,a);throw e});return this._fetchAvailabilityUpsamplePrefetch(a.id,e,t,i,l,n),n}async _fetchAvailabilityUpsamplePrefetch(e,t,i,l,r,n){if(!this._prefetchingEnabled)return;const s="prefetch-"+e;if(this.handles.has(s))return;const o=new AbortController;n.then(()=>o.abort(),()=>o.abort());let c=!1;const h={remove(){c||(c=!0,o.abort())}};if(this.handles.add(h,s),await Object(v["d"])(10,o.signal).catch(()=>{}),c||(c=!0,this.handles.remove(s)),Object(b["n"])(o))return;const p={id:e,level:t,row:i,col:l},u={...r,signal:o.signal},d=this.layer.tileInfo;for(let b=0;a._prefetches.length{a._prefetches.removeUnordered(e)};e.then(t,t)}}_initializeTilemapDefinition(){var e;if(!this.layer.parsedUrl)return;const{parsedUrl:t,apiKey:i,customParameters:a}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:t.path,query:Object(m["G"])({...t.query,...a,token:null!=i?i:null==(e=t.query)?void 0:e.token}),tileServers:this.layer.tileServers,request:this.request,type:this.layer.type},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,a){a.level=e,a.row=t-t%this.size,a.col=i-i%this.size;const l=_(a);return this._tilemapCache.get(l)}_initializeAvailableLevels(e){this._availableLevels={},e&&e.forEach(e=>this._availableLevels[e.level]=!0)}get test(){const e=this;return{get prefetchingEnabled(){return e._prefetchingEnabled},set prefetchingEnabled(t){e._prefetchingEnabled=t},hasTilemap:(t,i,a)=>!!e._tilemapFromCache(t,i,a,e._tmpTilemapDefinition)}}};D._maxPrefetch=4,D._prefetches=new u["a"]({initialSize:a._maxPrefetch}),Object(l["a"])([Object(f["b"])({constructOnly:!0,type:Number})],D.prototype,"levels",void 0),Object(l["a"])([Object(O["a"])("levels")],D.prototype,"castLevels",null),Object(l["a"])([Object(f["b"])({readOnly:!0,type:Number})],D.prototype,"size",null),Object(l["a"])([Object(f["b"])({constructOnly:!0,type:Number})],D.prototype,"cacheByteSize",void 0),Object(l["a"])([Object(f["b"])({constructOnly:!0})],D.prototype,"layer",void 0),Object(l["a"])([Object(f["b"])({constructOnly:!0})],D.prototype,"request",void 0),D=a=Object(l["a"])([Object(j["a"])("esri.layers.support.TilemapCache")],D)},ab68:function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return l}));var a=i("dff3");const l={type:a["a"],json:{origins:{service:{read:{source:["tileInfo","minScale","maxScale","minLOD","maxLOD"],reader:r}}}}};function r(e,t,i,l){if(!e)return null;const{minScale:r,maxScale:n,minLOD:s,maxLOD:o}=t;if(null!=s&&null!=o)return l&&l.ignoreMinMaxLOD?a["a"].fromJSON(e):a["a"].fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=s&&e<=o)});if(0!==r&&0!==n){const t=e=>Math.round(1e4*e)/1e4,i=r?t(r):1/0,l=n?t(n):-1/0;return a["a"].fromJSON({...e,lods:e.lods.filter(e=>{const a=t(e.scale);return a<=i&&a>=l})})}return a["a"].fromJSON(e)}},b485:function(e,t,i){"use strict";i.d(t,"a",(function(){return h}));var a=i("a4ee"),l=(i("e06a"),i("59b2")),r=(i("b50f"),i("c120"),i("cea0"),i("afcf")),n=i("d386"),s=i("ab68"),o=i("9651"),c=i("5996");const h=e=>{let t=class extends e{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(e,t){return t.capabilities&&t.capabilities.indexOf("Tilemap")>-1?new o["a"]({layer:this}):null}};return Object(a["a"])([Object(l["b"])({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),Object(a["a"])([Object(l["b"])()],t.prototype,"minScale",void 0),Object(a["a"])([Object(r["a"])("service","minScale")],t.prototype,"readMinScale",null),Object(a["a"])([Object(l["b"])()],t.prototype,"maxScale",void 0),Object(a["a"])([Object(r["a"])("service","maxScale")],t.prototype,"readMaxScale",null),Object(a["a"])([Object(l["b"])({type:c["a"]})],t.prototype,"spatialReference",void 0),Object(a["a"])([Object(l["b"])({readOnly:!0})],t.prototype,"supportsBlankTile",null),Object(a["a"])([Object(l["b"])(s["b"])],t.prototype,"tileInfo",void 0),Object(a["a"])([Object(l["b"])()],t.prototype,"tilemapCache",void 0),Object(a["a"])([Object(r["a"])("service","tilemapCache",["capabilities"])],t.prototype,"readTilemapCache",null),Object(a["a"])([Object(l["b"])()],t.prototype,"version",void 0),t=Object(a["a"])([Object(n["a"])("esri.layers.mixins.ArcGISCachedService")],t),t}},f20e:function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return S}));var a=i("a4ee"),l=i("2eab"),r=i("ce50"),n=i("e92d"),s=i("b2b2"),o=i("e694"),c=i("f4cc"),h=i("e041"),p=i("59b2"),u=(i("b50f"),i("c120"),i("cea0"),i("afcf")),b=i("d386"),d=i("e64d"),v=i("a6a3"),m=i("b485"),f=i("3d59"),y=i("b911"),O=i("0db5"),j=i("22f4"),w=i("d378");const g=n["a"].getLogger("esri.layers.ElevationLayer");let _=class extends(Object(m["a"])(Object(f["a"])(Object(y["a"])(Object(O["a"])(Object(o["a"])(v["a"])))))){constructor(...e){super(...e),this.copyright=null,this.heightModelInfo=null,this.path=null,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=Object(w["a"])()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._lercDecoder=Object(s["r"])(this._lercDecoder)}set minScale(e){this.constructed&&g.warn(this.declaredClass+".minScale support has been removed (since 4.5)")}get minScale(){}set maxScale(e){this.constructed&&g.warn(this.declaredClass+".maxScale support has been removed (since 4.5)")}get maxScale(){}readVersion(e,t){let i=t.currentVersion;return i||(i=9.3),i}load(e){const t=Object(s["k"])(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:e=>{for(let t=0;tthis._fetchImageService(t))),Promise.resolve(this)}fetchTile(e,t,i,a){const r=Object(s["k"])((a=a||{signal:null}).signal)?a.signal:a.signal=(new AbortController).signal,n={responseType:"array-buffer",signal:r},o={noDataValue:a.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(e,t,i,a)).then(()=>Object(l["default"])(this.getTileUrl(e,t,i),n)).then(e=>this._lercDecoder.decode(e.data,o,r)).then(e=>({values:e.pixelData,width:e.width,height:e.height,maxZError:e.fileInfo.maxZError,noDataValue:e.noDataValue,minValue:e.minValue,maxValue:e.maxValue}))}getTileUrl(e,t,i){const a=!this.tilemapCache&&this.supportsBlankTile,l=Object(h["G"])({...this.parsedUrl.query,blankTile:!a&&null});return`${this.parsedUrl.path}/tile/${e}/${t}/${i}${l?"?"+l:""}`}async queryElevation(e,t){const{ElevationQuery:a}=await i.e("chunk-2d0bdf78").then(i.bind(null,"2df6"));return Object(c["v"])(t),(new a).query(this,e,t)}async createElevationSampler(e,t){const{ElevationQuery:a}=await i.e("chunk-2d0bdf78").then(i.bind(null,"2df6"));return Object(c["v"])(t),(new a).createSampler(this,e,t)}_fetchTileAvailability(e,t,i,a){return this.tilemapCache?this.tilemapCache.fetchAvailability(e,t,i,a):Promise.resolve("unknown")}async _fetchImageService(e){if(this.sourceJSON)return this.sourceJSON;const t={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:e},i=await Object(l["default"])(this.parsedUrl.path,t);i.ssl&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=i.data,this.read(i.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile.__isDefault__}};Object(a["a"])([Object(p["b"])({json:{read:{source:"copyrightText"}}})],_.prototype,"copyright",void 0),Object(a["a"])([Object(p["b"])({readOnly:!0,type:d["a"]})],_.prototype,"heightModelInfo",void 0),Object(a["a"])([Object(p["b"])({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],_.prototype,"path",void 0),Object(a["a"])([Object(p["b"])({type:["show","hide"]})],_.prototype,"listMode",void 0),Object(a["a"])([Object(p["b"])({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],_.prototype,"minScale",null),Object(a["a"])([Object(p["b"])({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],_.prototype,"maxScale",null),Object(a["a"])([Object(p["b"])({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],_.prototype,"opacity",void 0),Object(a["a"])([Object(p["b"])({type:["ArcGISTiledElevationServiceLayer"]})],_.prototype,"operationalLayerType",void 0),Object(a["a"])([Object(p["b"])()],_.prototype,"sourceJSON",void 0),Object(a["a"])([Object(p["b"])({json:{read:!1},value:"elevation",readOnly:!0})],_.prototype,"type",void 0),Object(a["a"])([Object(p["b"])(j["n"])],_.prototype,"url",void 0),Object(a["a"])([Object(p["b"])()],_.prototype,"version",void 0),Object(a["a"])([Object(u["a"])("version",["currentVersion"])],_.prototype,"readVersion",null),_=Object(a["a"])([Object(b["a"])("esri.layers.ElevationLayer")],_),_.prototype.fetchTile.__isDefault__=!0;const S=_}}]); //# sourceMappingURL=chunk-15c3b8fe.abeb2894.js.map