import { v } from "./chunk-KHA63LLS.js"; import { c } from "./chunk-FGKNEJKJ.js"; import { O } from "./chunk-I3OBGWNS.js"; import { S, p } from "./chunk-RBZL6SRZ.js"; import { n as n2 } from "./chunk-CYI7KFYB.js"; import { a } from "./chunk-5LXROFTA.js"; import { t } from "./chunk-W72F6AS3.js"; import { b } from "./chunk-4DDBH2K5.js"; import { U } from "./chunk-VNFRAYHO.js"; import { F, ft, y } from "./chunk-VBRY5KJM.js"; import { M2 as M, j2 as j, o } from "./chunk-ECW2QABR.js"; import { k2 as k, r as r2 } from "./chunk-MRJEICT6.js"; import { d, e, l3 as l, n2 as n } from "./chunk-Y3WMVFTW.js"; import { s3 as s } from "./chunk-EMJ4ZSM2.js"; import { m, r } from "./chunk-IKP3YN53.js"; // node_modules/@arcgis/core/layers/support/WMTSLayerInfo.js var i; var p2 = i = class extends l { constructor(r3) { super(r3); } clone() { return new i({ customLayerParameters: m(this.customLayerParameters), customParameters: m(this.customParameters), layerIdentifier: this.layerIdentifier, tileMatrixSet: this.tileMatrixSet, url: this.url }); } }; e([d({ json: { type: Object, write: true } })], p2.prototype, "customLayerParameters", void 0), e([d({ json: { type: Object, write: true } })], p2.prototype, "customParameters", void 0), e([d({ type: String, json: { write: true } })], p2.prototype, "layerIdentifier", void 0), e([d({ type: String, json: { write: true } })], p2.prototype, "tileMatrixSet", void 0), e([d({ type: String, json: { write: true } })], p2.prototype, "url", void 0), p2 = i = e([n("esri.layer.support.WMTSLayerInfo")], p2); // node_modules/@arcgis/core/layers/WebTileLayer.js var R = class extends a(n2(t(c(v(O(b)))))) { constructor(...e2) { super(...e2), this.copyright = "", this.fullExtent = new M(-20037508342787e-6, -2003750834278e-5, 2003750834278e-5, 20037508342787e-6, k.WebMercator), this.legendEnabled = false, this.isReference = null, this.popupEnabled = false, this.spatialReference = k.WebMercator, this.subDomains = null, this.tileInfo = new S({ size: [256, 256], dpi: 96, format: "png8", compressionQuality: 0, origin: new j({ x: -20037508342787e-6, y: 20037508342787e-6, spatialReference: k.WebMercator }), spatialReference: k.WebMercator, lods: [new p({ level: 0, scale: 591657527591555e-6, resolution: 156543.033928 }), new p({ level: 1, scale: 295828763795777e-6, resolution: 78271.5169639999 }), new p({ level: 2, scale: 147914381897889e-6, resolution: 39135.7584820001 }), new p({ level: 3, scale: 73957190948944e-6, resolution: 19567.8792409999 }), new p({ level: 4, scale: 36978595474472e-6, resolution: 9783.93962049996 }), new p({ level: 5, scale: 18489297737236e-6, resolution: 4891.96981024998 }), new p({ level: 6, scale: 9244648868618e-6, resolution: 2445.98490512499 }), new p({ level: 7, scale: 4622324434309e-6, resolution: 1222.99245256249 }), new p({ level: 8, scale: 2311162217155e-6, resolution: 611.49622628138 }), new p({ level: 9, scale: 1155581108577e-6, resolution: 305.748113140558 }), new p({ level: 10, scale: 577790.554289, resolution: 152.874056570411 }), new p({ level: 11, scale: 288895.277144, resolution: 76.4370282850732 }), new p({ level: 12, scale: 144447.638572, resolution: 38.2185141425366 }), new p({ level: 13, scale: 72223.819286, resolution: 19.1092570712683 }), new p({ level: 14, scale: 36111.909643, resolution: 9.55462853563415 }), new p({ level: 15, scale: 18055.954822, resolution: 4.77731426794937 }), new p({ level: 16, scale: 9027.977411, resolution: 2.38865713397468 }), new p({ level: 17, scale: 4513.988705, resolution: 1.19432856685505 }), new p({ level: 18, scale: 2256.994353, resolution: 0.597164283559817 }), new p({ level: 19, scale: 1128.497176, resolution: 0.298582141647617 }), new p({ level: 20, scale: 564.248588, resolution: 0.14929107082380833 }), new p({ level: 21, scale: 282.124294, resolution: 0.07464553541190416 }), new p({ level: 22, scale: 141.062147, resolution: 0.03732276770595208 }), new p({ level: 23, scale: 70.5310735, resolution: 0.01866138385297604 })] }), this.type = "web-tile", this.urlTemplate = null, this.wmtsInfo = null; } normalizeCtorArgs(e2, t2) { return typeof e2 == "string" ? { urlTemplate: e2, ...t2 } : e2; } load(e2) { const t2 = this.loadFromPortal({ supportedTypes: ["WMTS"] }, e2).then(() => { let e3 = ""; if (this.urlTemplate) if (this.spatialReference.equals(this.tileInfo.spatialReference)) { const t3 = new y(this.urlTemplate); !(!!this.subDomains && this.subDomains.length > 0) && t3.authority.includes("{subDomain}") && (e3 = "is missing 'subDomains' property"); } else e3 = "spatialReference must match tileInfo.spatialReference"; else e3 = "is missing the required 'urlTemplate' property value"; if (e3) throw new s("web-tile-layer:load", `WebTileLayer (title: '${this.title}', id: '${this.id}') ${e3}`); }); return this.addResolvingPromise(t2), Promise.resolve(this); } get levelValues() { const e2 = []; if (!this.tileInfo) return null; for (const t2 of this.tileInfo.lods) e2[t2.level] = t2.levelValue || t2.level; return e2; } readSpatialReference(e2, t2) { return e2 || t2.fullExtent && t2.fullExtent.spatialReference && k.fromJSON(t2.fullExtent.spatialReference); } get tileServers() { if (!this.urlTemplate) return null; const e2 = [], { urlTemplate: t2, subDomains: r3 } = this, l2 = new y(t2), o2 = l2.scheme ? l2.scheme + "://" : "//", i2 = o2 + l2.authority + "/"; if (l2.authority.includes("{subDomain}")) { if (r3 && r3.length > 0 && l2.authority.split(".").length > 1) for (const s2 of r3) e2.push(o2 + l2.authority.replace(/\{subDomain\}/gi, s2) + "/"); } else e2.push(i2); return e2.map((e3) => (e3.charAt(e3.length - 1) !== "/" && (e3 += "/"), e3)); } get urlPath() { if (!this.urlTemplate) return null; const e2 = this.urlTemplate, t2 = new y(e2), r3 = (t2.scheme ? t2.scheme + "://" : "//") + t2.authority + "/"; return e2.substring(r3.length); } readUrlTemplate(e2, t2) { return e2 || t2.templateUrl; } writeUrlTemplate(e2, t2) { e2 && ft(e2) && (e2 = "https:" + e2), e2 && (e2 = e2.replace(/\{z\}/gi, "{level}").replace(/\{x\}/gi, "{col}").replace(/\{y\}/gi, "{row}"), e2 = F(e2)), t2.templateUrl = e2; } fetchTile(e2, r3, l2, o2 = {}) { const { signal: s2 } = o2, i2 = this.getTileUrl(e2, r3, l2), n3 = { responseType: "image", signal: s2, query: { ...this.refreshParameters } }; return U(i2, n3).then((e3) => e3.data); } getTileUrl(e2, t2, r3) { const l2 = this.levelValues[e2]; return this.tileServers[t2 % this.tileServers.length] + r(this.urlPath, { level: l2, z: l2, col: r3, x: r3, row: t2, y: t2 }); } }; e([d({ type: String, value: "", json: { write: true } })], R.prototype, "copyright", void 0), e([d({ type: M, json: { write: true }, nonNullable: true })], R.prototype, "fullExtent", void 0), e([d({ readOnly: true, json: { read: false, write: false } })], R.prototype, "legendEnabled", void 0), e([d({ type: ["show", "hide"] })], R.prototype, "listMode", void 0), e([d({ json: { read: true, write: true } })], R.prototype, "blendMode", void 0), e([d()], R.prototype, "levelValues", null), e([d({ type: Boolean, json: { read: false, write: { enabled: true, overridePolicy: () => ({ enabled: false }) } } })], R.prototype, "isReference", void 0), e([d({ type: ["WebTiledLayer"], value: "WebTiledLayer" })], R.prototype, "operationalLayerType", void 0), e([d({ readOnly: true, json: { read: false, write: false } })], R.prototype, "popupEnabled", void 0), e([d({ type: k })], R.prototype, "spatialReference", void 0), e([o("spatialReference", ["spatialReference", "fullExtent.spatialReference"])], R.prototype, "readSpatialReference", null), e([d({ type: [String], json: { write: true } })], R.prototype, "subDomains", void 0), e([d({ type: S, json: { write: true } })], R.prototype, "tileInfo", void 0), e([d({ readOnly: true })], R.prototype, "tileServers", null), e([d({ json: { read: false } })], R.prototype, "type", void 0), e([d()], R.prototype, "urlPath", null), e([d({ type: String, json: { origins: { "portal-item": { read: { source: "url" } } } } })], R.prototype, "urlTemplate", void 0), e([o("urlTemplate", ["urlTemplate", "templateUrl"])], R.prototype, "readUrlTemplate", null), e([r2("urlTemplate", { templateUrl: { type: String } })], R.prototype, "writeUrlTemplate", null), e([d({ type: p2, json: { write: true } })], R.prototype, "wmtsInfo", void 0), R = e([n("esri.layers.WebTileLayer")], R); var x = R; export { p2 as p, x }; //# sourceMappingURL=chunk-UYUDNSNC.js.map