import { K } from "./chunk-Z32FUDOP.js"; import "./chunk-FEH5F4VW.js"; import { L, O as O2 } from "./chunk-YVTH4OGO.js"; import { m } from "./chunk-XHRYELNQ.js"; import { u } from "./chunk-5FHVUYVE.js"; import { Y } from "./chunk-NP2BYFXT.js"; import "./chunk-6H5PP7QI.js"; import "./chunk-HSPVIAVJ.js"; import "./chunk-XIEPNAEI.js"; import { f as f2, g as g2 } from "./chunk-M5BTTMP6.js"; import "./chunk-WQJRLXWG.js"; import "./chunk-ETWBEEKL.js"; import "./chunk-XZA4MVET.js"; import "./chunk-4GGRJYTB.js"; import "./chunk-D5GG5NVO.js"; import "./chunk-USORKAIZ.js"; import "./chunk-Q34L5KZA.js"; import "./chunk-ROWZMUVJ.js"; import "./chunk-7IKYLNB5.js"; import "./chunk-P4UZNLD5.js"; import { ne, te } from "./chunk-FYNVVMWY.js"; import "./chunk-Q52DVFYK.js"; import "./chunk-HBMVUVZX.js"; import "./chunk-QOV6ITMI.js"; import "./chunk-DH2OBAUC.js"; import "./chunk-TNLRDNTC.js"; import { d } from "./chunk-KMAHKQ2G.js"; import "./chunk-522WBHUO.js"; import "./chunk-WNCU6BFU.js"; import "./chunk-BJHM4JNS.js"; import "./chunk-F6A2QQ26.js"; import "./chunk-EOSZHC5H.js"; import "./chunk-C43UE3Z5.js"; import "./chunk-NE3ESGA6.js"; import "./chunk-YIS6BAC3.js"; import "./chunk-7XXXCK2A.js"; import "./chunk-7ZIDBK7B.js"; import "./chunk-WZQZRKNH.js"; import "./chunk-LRDX4TO7.js"; import "./chunk-WDLTDV2L.js"; import "./chunk-TERAW6FT.js"; import "./chunk-N2663GRX.js"; import "./chunk-O4FY3ITT.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-MXB2XLKV.js"; import "./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 "./chunk-ECW2QABR.js"; import "./chunk-GCDJLKH4.js"; import { E, c } from "./chunk-MRJEICT6.js"; import "./chunk-Y3WMVFTW.js"; import "./chunk-SAS7RONY.js"; import "./chunk-WSRBH7BF.js"; import "./chunk-IHXECKQQ.js"; import { O, f, g } from "./chunk-ULGDPLM2.js"; import { s, s3 as s2 } from "./chunk-EMJ4ZSM2.js"; import "./chunk-IKP3YN53.js"; import { e, r } from "./chunk-GZT4BVFP.js"; import "./chunk-A5ICIBVI.js"; // node_modules/@arcgis/core/layers/graphics/sources/WFSSourceWorker.js var E2 = class { constructor() { this._queryEngine = null, this._customParameters = null, this._snapshotFeatures = async (e2) => { const { objectIdField: t } = this._queryEngine, s3 = await K(this._getFeatureUrl, this._featureType.typeName, this._getFeatureOutputFormat, { customParameters: this._customParameters, dateFields: this._queryEngine.fieldsIndex.dateFields.map((e3) => e3.name), signal: e2 }); await O2(s3), f(e2); const i = L(s3, { geometryType: this._queryEngine.geometryType, hasZ: false, objectIdField: t }); if (!E(this._queryEngine.spatialReference, c)) for (const a of i) r(a.geometry) && (a.geometry = te(g2(ne(a.geometry, this._queryEngine.geometryType, false, false), c, this._queryEngine.spatialReference))); let o = 1; for (const r2 of i) { const e3 = {}; m(this._fieldsIndex, e3, r2.attributes, true), r2.attributes = e3, r2.attributes[t] == null && (r2.objectId = r2.attributes[t] = o++); } return i; }; } destroy() { this._queryEngine?.destroy(), this._queryEngine = null; } async load(e2, t) { const { getFeatureUrl: r2, getFeatureOutputFormat: i, spatialReference: o, fields: n, geometryType: u2, featureType: p, objectIdField: h, customParameters: c2 } = e2; this._featureType = p, this._customParameters = c2, this._getFeatureUrl = r2, this._getFeatureOutputFormat = i, this._fieldsIndex = new d(n), await this._checkProjection(o), f(t), this._queryEngine = new Y({ fields: n, geometryType: u2, hasM: false, hasZ: false, objectIdField: h, spatialReference: o, timeInfo: null, featureStore: new u({ geometryType: u2, hasM: false, hasZ: false }) }); const m2 = await this._snapshotFeatures(e(t.signal)); return this._queryEngine.featureStore.addMany(m2), { extent: this._queryEngine.fullExtent }; } async applyEdits() { throw new s2("wfs-source:editing-not-supported", "applyEdits() is not supported on WFSLayer"); } async queryFeatures(e2 = {}, t = {}) { return await this._waitSnapshotComplete(), this._queryEngine.executeQuery(e2, t.signal); } async queryFeatureCount(e2 = {}, t = {}) { return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForCount(e2, t.signal); } async queryObjectIds(e2 = {}, t = {}) { return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForIds(e2, t.signal); } async queryExtent(e2 = {}, t = {}) { return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForExtent(e2, t.signal); } async querySnapping(e2, t = {}) { return await this._waitSnapshotComplete(), this._queryEngine.executeQueryForSnapping(e2, t.signal); } async refresh(r2) { return this._customParameters = r2, this._snapshotTask?.abort(), this._snapshotTask = O(this._snapshotFeatures), this._snapshotTask.promise.then((e2) => { this._queryEngine.featureStore.clear(), e2 && this._queryEngine.featureStore.addMany(e2); }, (r3) => { this._queryEngine.featureStore.clear(), g(r3) || s.getLogger("esri.layers.WFSLayer").error(new s2("wfs-layer:getfeature-error", "An error occurred during the GetFeature request", { error: r3 })); }), await this._waitSnapshotComplete(), { extent: this._queryEngine.fullExtent }; } async _waitSnapshotComplete() { if (this._snapshotTask && !this._snapshotTask.finished) { try { await this._snapshotTask.promise; } catch { } return this._waitSnapshotComplete(); } } async _checkProjection(t) { try { await f2(c, t); } catch { throw new s2("unsupported-projection", "Projection not supported", { spatialReference: t }); } } }; export { E2 as default }; //# sourceMappingURL=WFSSourceWorker-2XJ7RNZY.js.map