import { d } from "./chunk-R5LRKX5A.js"; import { Ae, Fe, G, I, J, P, Re, X, Y, ce, ee, fe, je, le, ne, ve } from "./chunk-25BNEBXZ.js"; import "./chunk-3ZFH4KQV.js"; import "./chunk-BJHM4JNS.js"; import "./chunk-F6A2QQ26.js"; import "./chunk-7ZIDBK7B.js"; import "./chunk-OWVBLVP3.js"; import "./chunk-XH7RUGVZ.js"; import "./chunk-PDKDCAAD.js"; import "./chunk-ECW2QABR.js"; import "./chunk-GCDJLKH4.js"; import "./chunk-MRJEICT6.js"; import "./chunk-Y3WMVFTW.js"; import "./chunk-SAS7RONY.js"; import "./chunk-WSRBH7BF.js"; import "./chunk-IHXECKQQ.js"; import "./chunk-ULGDPLM2.js"; import "./chunk-EMJ4ZSM2.js"; import "./chunk-IKP3YN53.js"; import "./chunk-GZT4BVFP.js"; import "./chunk-A5ICIBVI.js"; // node_modules/@arcgis/core/arcade/functions/featuresetstring.js function w(a) { return a && a.domain ? a.domain.type === "coded-value" || a.domain.type === "codedValue" ? d.convertObjectToArcadeDictionary({ type: "codedValue", name: a.domain.name, dataType: P[a.field.type], codedValues: a.domain.codedValues.map((n) => ({ name: n.name, code: n.code })) }) : d.convertObjectToArcadeDictionary({ type: "range", name: a.domain.name, dataType: P[a.field.type], min: a.domain.min, max: a.domain.max }) : null; } function h(p) { p.mode === "async" && (p.functions.domain = function(n, s) { return p.standardFunctionAsync(n, s, async function(n2, s2, d2) { if (G(d2, 2, 3), Y(d2[0])) { return w(je(d2[0], X(d2[1]), d2[2] === void 0 ? void 0 : ne(d2[2]))); } if (J(d2[0])) { await d2[0]._ensureLoaded(); return w(ce(X(d2[1]), d2[0], null, d2[2] === void 0 ? void 0 : ne(d2[2]))); } throw new Error("Invalid Parameter"); }); }, p.functions.subtypes = function(t, r) { return p.standardFunctionAsync(t, r, async function(t2, r2, o) { if (G(o, 1, 1), Y(o[0])) { const a = Ae(o[0]); return a ? d.convertObjectToArcadeDictionary(a) : null; } if (J(o[0])) { await o[0]._ensureLoaded(); const a = o[0].subtypes(); return a ? d.convertObjectToArcadeDictionary(a) : null; } throw new Error("Invalid Parameter"); }); }, p.functions.domainname = function(n, t) { return p.standardFunctionAsync(n, t, async function(n2, t2, s) { if (G(s, 2, 4), Y(s[0])) return Re(s[0], X(s[1]), s[2], s[3] === void 0 ? void 0 : ne(s[3])); if (J(s[0])) { await s[0]._ensureLoaded(); const n3 = ce(X(s[1]), s[0], null, s[3] === void 0 ? void 0 : ne(s[3])); return le(n3, s[2]); } throw new Error("Invalid Parameter"); }); }, p.signatures.push({ name: "domainname", min: "2", max: "4" }), p.functions.domaincode = function(n, t) { return p.standardFunctionAsync(n, t, async function(n2, t2, s) { if (G(s, 2, 4), Y(s[0])) return Fe(s[0], X(s[1]), s[2], s[3] === void 0 ? void 0 : ne(s[3])); if (J(s[0])) { await s[0]._ensureLoaded(); const n3 = ce(X(s[1]), s[0], null, s[3] === void 0 ? void 0 : ne(s[3])); return fe(n3, s[2]); } throw new Error("Invalid Parameter"); }); }, p.signatures.push({ name: "domaincode", min: "2", max: "4" })), p.functions.text = function(n, e) { return p.standardFunctionAsync(n, e, function(n2, e2, t) { if (G(t, 1, 2), !J(t[0])) return ee(t[0], t[1]); { const a = I(t[1], ""); if (a === "") return t[0].castToText(); if (a.toLowerCase() === "schema") return t[0].convertToText("schema", n2.abortSignal); if (a.toLowerCase() === "featureset") return t[0].convertToText("featureset", n2.abortSignal); } }); }, p.functions.gdbversion = function(n, t) { return p.standardFunctionAsync(n, t, async function(n2, t2, r) { if (G(r, 1, 1), Y(r[0])) return r[0].gdbVersion(); if (J(r[0])) { return (await r[0].load()).gdbVersion; } throw new Error("Invalid Parameter"); }); }, p.functions.schema = function(t, r) { return p.standardFunctionAsync(t, r, async function(t2, r2, o) { if (G(o, 1, 1), J(o[0])) return await o[0].load(), d.convertObjectToArcadeDictionary(o[0].schema()); if (Y(o[0])) { const a = ve(o[0]); return a ? d.convertObjectToArcadeDictionary(a) : null; } throw new Error("Invalid Parameter"); }); }; } export { h as registerFunctions }; //# sourceMappingURL=featuresetstring-RP6DTLWZ.js.map