import { n as n2 } from "./chunk-YDZD6ESX.js"; import { a as a2, c as c2 } from "./chunk-LE3RIDC7.js"; import { Ke } from "./chunk-6NQ3AA2U.js"; import "./chunk-524XACB7.js"; import "./chunk-XKHC7KKF.js"; import "./chunk-HGDNY7J3.js"; import "./chunk-GD5TMIPM.js"; import "./chunk-ZRX5UNQH.js"; import "./chunk-VEAEIBHK.js"; import "./chunk-6SASJ6IM.js"; import "./chunk-3OHML7FO.js"; import "./chunk-JGOAMEPM.js"; import "./chunk-Z64YKYHD.js"; import "./chunk-2VFJVI2I.js"; import "./chunk-F37AVPUF.js"; import "./chunk-FUEX356Y.js"; import { L } from "./chunk-P4UZNLD5.js"; import { An, en, rn, tn } from "./chunk-DH2OBAUC.js"; import "./chunk-TNLRDNTC.js"; import "./chunk-OSNKP4CI.js"; import "./chunk-435DJNTD.js"; import "./chunk-T3EUPDKL.js"; import "./chunk-2SJEIKRW.js"; import "./chunk-PHRSJJ3U.js"; import "./chunk-VVBOYBFX.js"; import "./chunk-S7R5EXHN.js"; import "./chunk-FMKGHOGD.js"; import "./chunk-6URTNEGN.js"; import "./chunk-KN7TOKVN.js"; import "./chunk-RQJNTZAL.js"; import "./chunk-QTOOFNRV.js"; import "./chunk-7O56JPWQ.js"; import "./chunk-6B2LQBKM.js"; import "./chunk-MFI6BALW.js"; import "./chunk-CIG5OHC7.js"; import "./chunk-FUD7XO3N.js"; import "./chunk-6EU7GFUT.js"; import "./chunk-MFUAILAT.js"; import "./chunk-HZJYXMI6.js"; import "./chunk-27P5ZSC7.js"; import "./chunk-UPD4MTCL.js"; import "./chunk-GRBROWI6.js"; import "./chunk-5NKYXKIA.js"; import "./chunk-MPWGHCZG.js"; import "./chunk-FTI5VP6T.js"; import { g } from "./chunk-RZFGRBD7.js"; import "./chunk-PUSPZYFZ.js"; import { S2 as S, m as m2, m2 as m3, y as y2 } from "./chunk-EN7YGJWG.js"; import "./chunk-VBNMTM7L.js"; import "./chunk-3D3QEPRE.js"; import "./chunk-JFNNSBWL.js"; import "./chunk-UD63WBG3.js"; import "./chunk-X7DBH4KK.js"; import "./chunk-LY74KTXV.js"; import "./chunk-EWE6EXPY.js"; import "./chunk-KUXNUNAI.js"; import "./chunk-KMAHKQ2G.js"; import "./chunk-522WBHUO.js"; import "./chunk-WNCU6BFU.js"; import "./chunk-PIGRDDRG.js"; import { y } from "./chunk-BJHM4JNS.js"; import "./chunk-F6A2QQ26.js"; import "./chunk-XLV7RUSE.js"; import "./chunk-NTUXR253.js"; import "./chunk-EOSZHC5H.js"; import "./chunk-C43UE3Z5.js"; import "./chunk-H2KDMZTR.js"; import "./chunk-RMX2AZ4P.js"; import "./chunk-NE3ESGA6.js"; import "./chunk-YIS6BAC3.js"; import "./chunk-7XXXCK2A.js"; import "./chunk-7ZIDBK7B.js"; import { v } from "./chunk-KHA63LLS.js"; import { c } from "./chunk-FGKNEJKJ.js"; import { x } from "./chunk-PSV473TI.js"; import { O } from "./chunk-I3OBGWNS.js"; import "./chunk-FONIFA5N.js"; import "./chunk-EG5OI4V4.js"; import "./chunk-65BYCSII.js"; import "./chunk-WZQZRKNH.js"; import "./chunk-LRDX4TO7.js"; import "./chunk-6A4U74YA.js"; import "./chunk-CYI7KFYB.js"; import { a } from "./chunk-5LXROFTA.js"; import "./chunk-GJXW4HL5.js"; import "./chunk-WJW5DUN6.js"; import { t as t3 } from "./chunk-W72F6AS3.js"; import "./chunk-PJ7ZQ4VD.js"; import "./chunk-WDLTDV2L.js"; import "./chunk-TERAW6FT.js"; import "./chunk-N2663GRX.js"; import "./chunk-O4FY3ITT.js"; import "./chunk-WEMIK25H.js"; import { b } from "./chunk-4DDBH2K5.js"; import "./chunk-7N4X6GF3.js"; import "./chunk-JXW4QTJA.js"; import "./chunk-UXF37FQ4.js"; import "./chunk-ZOEK6QHJ.js"; import "./chunk-XNLG7T2T.js"; import "./chunk-IR4PV7VK.js"; import "./chunk-2Z6LERTI.js"; import "./chunk-OWVBLVP3.js"; import "./chunk-AFZ7XSEW.js"; import "./chunk-EGZW6HC3.js"; import "./chunk-4NKD334K.js"; import "./chunk-65K7LC56.js"; import "./chunk-ATPLLI5W.js"; import "./chunk-WJ3OEUD3.js"; import "./chunk-MXB2XLKV.js"; import "./chunk-XH7RUGVZ.js"; import "./chunk-TBBTRX4O.js"; import "./chunk-YBSUITLL.js"; import { j } from "./chunk-ALDCDSPV.js"; import "./chunk-DT6EAZQ5.js"; import "./chunk-HNOZUNJ4.js"; import "./chunk-VNFRAYHO.js"; import "./chunk-R5IG2D6H.js"; import "./chunk-VBRY5KJM.js"; import "./chunk-PDKDCAAD.js"; import { M2 as M, o as o2 } from "./chunk-ECW2QABR.js"; import "./chunk-GCDJLKH4.js"; import { E, k2 as k, r as r2 } from "./chunk-MRJEICT6.js"; import { d, e, n2 as n, t as t2 } from "./chunk-Y3WMVFTW.js"; import "./chunk-SAS7RONY.js"; import "./chunk-WSRBH7BF.js"; import "./chunk-IHXECKQQ.js"; import "./chunk-ULGDPLM2.js"; import { s3 as s } from "./chunk-EMJ4ZSM2.js"; import { m, o } from "./chunk-IKP3YN53.js"; import { r, t } from "./chunk-GZT4BVFP.js"; import "./chunk-A5ICIBVI.js"; // node_modules/@arcgis/core/layers/GraphicsLayer.js var n3 = class extends a(t3(b)) { constructor(r3) { super(r3), this.elevationInfo = null, this.graphics = new c2(), this.screenSizePerspectiveEnabled = true, this.type = "graphics", this.internal = false; } destroy() { this.removeAll(), this.graphics.destroy(); } add(r3) { return this.graphics.add(r3), this; } addMany(r3) { return this.graphics.addMany(r3), this; } removeAll() { return this.graphics.removeAll(), this; } remove(r3) { this.graphics.remove(r3); } removeMany(r3) { this.graphics.removeMany(r3); } on(r3, e2) { return super.on(r3, e2); } graphicChanged(r3) { this.emit("graphic-update", r3); } }; e([d({ type: x })], n3.prototype, "elevationInfo", void 0), e([d(a2(c2, "graphics"))], n3.prototype, "graphics", void 0), e([d({ type: ["show", "hide"] })], n3.prototype, "listMode", void 0), e([d()], n3.prototype, "screenSizePerspectiveEnabled", void 0), e([d({ readOnly: true })], n3.prototype, "type", void 0), e([d({ constructOnly: true })], n3.prototype, "internal", void 0), n3 = e([n("esri.layers.GraphicsLayer")], n3); var h = n3; // node_modules/@arcgis/core/layers/MapNotesLayer.js function F(e2) { return e2.layers.some((e3) => e3.layerDefinition.visibilityField != null); } var G = new y({ name: "OBJECTID", alias: "OBJECTID", type: "oid", nullable: false, editable: false }); var _ = new y({ name: "title", alias: "Title", type: "string", nullable: true, editable: true }); var P = class extends h { constructor(e2) { super(e2), this.visibilityMode = "inherited"; } initialize() { for (const e2 of this.graphics) e2.sourceLayer = this.layer; this.graphics.on("after-add", (e2) => { e2.item.sourceLayer = this.layer; }), this.graphics.on("after-remove", (e2) => { e2.item.sourceLayer = null; }); } get sublayers() { return this.graphics; } }; e([d({ readOnly: true })], P.prototype, "sublayers", null), e([d()], P.prototype, "layer", void 0), e([d()], P.prototype, "layerId", void 0), e([d({ readOnly: true })], P.prototype, "visibilityMode", void 0), P = e([n("esri.layers.MapNotesLayer.MapNotesSublayer")], P); var k2 = [{ geometryType: "polygon", geometryTypeJSON: "esriGeometryPolygon", id: "polygonLayer", layerId: 0, title: "Polygons", identifyingSymbol: new S().toJSON() }, { geometryType: "polyline", geometryTypeJSON: "esriGeometryPolyline", id: "polylineLayer", layerId: 1, title: "Polylines", identifyingSymbol: new m2().toJSON() }, { geometryType: "multipoint", geometryTypeJSON: "esriGeometryMultipoint", id: "multipointLayer", layerId: 2, title: "Multipoints", identifyingSymbol: new y2().toJSON() }, { geometryType: "point", geometryTypeJSON: "esriGeometryPoint", id: "pointLayer", layerId: 3, title: "Points", identifyingSymbol: new y2().toJSON() }, { geometryType: "point", geometryTypeJSON: "esriGeometryPoint", id: "textLayer", layerId: 4, title: "Text", identifyingSymbol: new m3().toJSON() }]; var z = class extends a(t3(c(v(O(b))))) { constructor(e2) { super(e2), this.capabilities = { operations: { supportsMapNotesEditing: true } }, this.featureCollections = null, this.featureCollectionJSON = null, this.featureCollectionType = "notes", this.legendEnabled = false, this.minScale = 0, this.maxScale = 0, this.spatialReference = k.WGS84, this.sublayers = new j(k2.map((e3) => new P({ id: e3.id, layerId: e3.layerId, title: e3.title, layer: this }))), this.title = "Map Notes", this.type = "map-notes", this.visibilityMode = "inherited"; } readCapabilities(e2, t4, r3) { return { operations: { supportsMapNotesEditing: !F(t4) && r3?.origin !== "portal-item" } }; } readFeatureCollections(e2, t4, o3) { if (!F(t4)) return null; const i = t4.layers.map((e3) => { const t5 = new Ke(); return t5.read(e3, o3), t5; }); return new j({ items: i }); } readLegacyfeatureCollectionJSON(e2, t4) { return F(t4) ? m(t4.featureCollection) : null; } readFullExtent(e2, t4) { if (!t4.layers.length || t4.layers.every((e3) => !e3.layerDefinition.extent)) return new M({ xmin: -180, ymin: -90, xmax: 180, ymax: 90, spatialReference: k.WGS84 }); const r3 = k.fromJSON(t4.layers[0].layerDefinition.spatialReference); return t4.layers.reduce((e3, t5) => { const r4 = t5.layerDefinition.extent; return r4 ? M.fromJSON(r4).union(e3) : e3; }, new M({ spatialReference: r3 })); } readMinScale(e2, t4) { for (const r3 of t4.layers) if (r3.layerDefinition.minScale != null) return r3.layerDefinition.minScale; return 0; } readMaxScale(e2, t4) { for (const r3 of t4.layers) if (r3.layerDefinition.maxScale != null) return r3.layerDefinition.maxScale; return 0; } get multipointLayer() { return this._findSublayer("multipointLayer"); } get pointLayer() { return this._findSublayer("pointLayer"); } get polygonLayer() { return this._findSublayer("polygonLayer"); } get polylineLayer() { return this._findSublayer("polylineLayer"); } readSpatialReference(e2, t4) { return t4.layers.length ? k.fromJSON(t4.layers[0].layerDefinition.spatialReference) : k.WGS84; } readSublayers(e2, o3, i) { if (F(o3)) return null; const a3 = []; let l = o3.layers.reduce((e3, t4) => Math.max(e3, t4.layerDefinition.id ?? -1), -1) + 1; for (const { layerDefinition: r3, featureSet: n4 } of o3.layers) { const e3 = r3.geometryType ?? n4.geometryType, o4 = r3.id ?? l++, i2 = k2.find((t4) => e3 === t4.geometryTypeJSON && r3.drawingInfo?.renderer?.symbol?.type === t4.identifyingSymbol.type); if (i2) { const e4 = new P({ id: i2.id, title: r3.name, layerId: o4, layer: this, graphics: n4.features.map(({ geometry: e5, symbol: r4, attributes: o5, popupInfo: i3 }) => g.fromJSON({ attributes: o5, geometry: e5, symbol: r4, popupTemplate: i3 })) }); a3.push(e4); } } return new j(a3); } writeSublayers(e2, t4, r3, i) { const { minScale: n4, maxScale: p } = this; if (t(e2)) return; const y3 = e2.some((e3) => e3.graphics.length > 0); if (!this.capabilities.operations.supportsMapNotesEditing) return void (y3 && i?.messages?.push(new s("map-notes-layer:editing-not-supported", "New map notes cannot be added to this layer"))); const m4 = []; let u = this.spatialReference.toJSON(); e: for (const o3 of e2) for (const e3 of o3.graphics) if (r(e3.geometry)) { u = e3.geometry.spatialReference.toJSON(); break e; } for (const o3 of k2) { const t5 = e2.find((e3) => o3.id === e3.id); this._writeMapNoteSublayer(m4, t5, o3, n4, p, u, i); } o("featureCollection.layers", m4, t4); } get textLayer() { return this._findSublayer("textLayer"); } load(e2) { return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["Feature Collection"] }, e2)), Promise.resolve(this); } read(e2, t4) { "featureCollection" in e2 && (e2 = m(e2), Object.assign(e2, e2.featureCollection)), super.read(e2, t4); } async beforeSave() { if (t(this.sublayers)) return; let e2 = null; const t4 = []; for (const o3 of this.sublayers) for (const r4 of o3.graphics) if (r(r4.geometry)) { const o4 = r4.geometry; e2 ? E(o4.spatialReference, e2) || (An(o4.spatialReference, e2) || en() || await tn(), r4.geometry = rn(o4, e2)) : e2 = o4.spatialReference, t4.push(r4); } const r3 = await L(t4.map((e3) => e3.geometry)); t4.forEach((e3, t5) => e3.geometry = r3[t5]); } _findSublayer(e2) { return t(this.sublayers) ? null : this.sublayers?.find((t4) => t4.id === e2) ?? null; } _writeMapNoteSublayer(e2, t4, r3, o3, l, n4, s2) { const p = []; if (!t(t4)) { for (const e3 of t4.graphics) this._writeMapNote(p, e3, r3.geometryType, s2); this._normalizeObjectIds(p, G), e2.push({ layerDefinition: { name: t4.title, drawingInfo: { renderer: { type: "simple", symbol: m(r3.identifyingSymbol) } }, id: t4.layerId, geometryType: r3.geometryTypeJSON, minScale: o3, maxScale: l, objectIdField: "OBJECTID", fields: [G.toJSON(), _.toJSON()], spatialReference: n4 }, featureSet: { features: p, geometryType: r3.geometryTypeJSON } }); } } _writeMapNote(e2, t4, r3, o3) { if (t(t4)) return; const { geometry: i, symbol: n4, popupTemplate: s2 } = t4; if (t(i)) return; if (i.type !== r3) return void o3?.messages?.push(new t2("map-notes-layer:invalid-geometry-type", `Geometry "${i.type}" cannot be saved in "${r3}" layer`, { graphic: t4 })); if (t(n4)) return void o3?.messages?.push(new t2("map-notes-layer:no-symbol", "Skipping map notes with no symbol", { graphic: t4 })); const y3 = { attributes: { ...t4.attributes }, geometry: i.toJSON(), symbol: n4.toJSON() }; r(s2) && (y3.popupInfo = s2.toJSON()), e2.push(y3); } _normalizeObjectIds(e2, t4) { const r3 = t4.name; let o3 = n2(r3, e2) + 1; const i = new Set(); for (const a3 of e2) { a3.attributes || (a3.attributes = {}); const { attributes: e3 } = a3; (e3[r3] == null || i.has(e3[r3])) && (e3[r3] = o3++), i.add(e3[r3]); } } }; e([d({ readOnly: true })], z.prototype, "capabilities", void 0), e([o2(["portal-item", "web-map"], "capabilities", ["layers"])], z.prototype, "readCapabilities", null), e([d({ readOnly: true })], z.prototype, "featureCollections", void 0), e([o2(["web-map", "portal-item"], "featureCollections", ["layers"])], z.prototype, "readFeatureCollections", null), e([d({ readOnly: true, json: { origins: { "web-map": { write: { enabled: true, target: "featureCollection" } } } } })], z.prototype, "featureCollectionJSON", void 0), e([o2(["web-map", "portal-item"], "featureCollectionJSON", ["featureCollection"])], z.prototype, "readLegacyfeatureCollectionJSON", null), e([d({ readOnly: true, json: { read: false, write: { enabled: true, ignoreOrigin: true } } })], z.prototype, "featureCollectionType", void 0), e([d({ json: { write: false } })], z.prototype, "fullExtent", void 0), e([o2(["web-map", "portal-item"], "fullExtent", ["layers"])], z.prototype, "readFullExtent", null), e([d({ readOnly: true, json: { origins: { "web-map": { write: { target: "featureCollection.showLegend", overridePolicy() { return { enabled: this.featureCollectionJSON != null }; } } } } } })], z.prototype, "legendEnabled", void 0), e([d({ type: ["show", "hide"] })], z.prototype, "listMode", void 0), e([d({ type: Number, nonNullable: true, json: { write: false } })], z.prototype, "minScale", void 0), e([o2(["web-map", "portal-item"], "minScale", ["layers"])], z.prototype, "readMinScale", null), e([d({ type: Number, nonNullable: true, json: { write: false } })], z.prototype, "maxScale", void 0), e([o2(["web-map", "portal-item"], "maxScale", ["layers"])], z.prototype, "readMaxScale", null), e([d({ readOnly: true })], z.prototype, "multipointLayer", null), e([d({ value: "ArcGISFeatureLayer", type: ["ArcGISFeatureLayer"] })], z.prototype, "operationalLayerType", void 0), e([d({ readOnly: true })], z.prototype, "pointLayer", null), e([d({ readOnly: true })], z.prototype, "polygonLayer", null), e([d({ readOnly: true })], z.prototype, "polylineLayer", null), e([d({ type: k })], z.prototype, "spatialReference", void 0), e([o2(["web-map", "portal-item"], "spatialReference", ["layers"])], z.prototype, "readSpatialReference", null), e([d({ readOnly: true, json: { origins: { "web-map": { write: { ignoreOrigin: true } } } } })], z.prototype, "sublayers", void 0), e([o2("web-map", "sublayers", ["layers"])], z.prototype, "readSublayers", null), e([r2("web-map", "sublayers")], z.prototype, "writeSublayers", null), e([d({ readOnly: true })], z.prototype, "textLayer", null), e([d()], z.prototype, "title", void 0), e([d({ readOnly: true, json: { read: false } })], z.prototype, "type", void 0), z = e([n("esri.layers.MapNotesLayer")], z); var B = z; export { B as default }; //# sourceMappingURL=MapNotesLayer-RWML2Y3H.js.map