1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import {
- B,
- H,
- ce,
- ie,
- ne
- } from "./chunk-WZQZRKNH.js";
- import {
- I
- } from "./chunk-MRJEICT6.js";
- import {
- t
- } from "./chunk-GZT4BVFP.js";
- // node_modules/@arcgis/core/layers/graphics/sources/support/sourceUtils.js
- var l = class {
- constructor() {
- this.code = null, this.description = null;
- }
- };
- var u = class {
- constructor(e) {
- this.error = new l(), this.globalId = null, this.objectId = null, this.success = false, this.uniqueId = null, this.error.description = e;
- }
- };
- function a(e) {
- return new u(e);
- }
- var c = class {
- constructor(e) {
- this.globalId = null, this.success = true, this.objectId = this.uniqueId = e;
- }
- };
- function f(e) {
- return new c(e);
- }
- var d = new Set();
- function m(e, t2, n, s = false, o) {
- d.clear();
- for (const l2 in n) {
- const u2 = e.get(l2);
- if (!u2)
- continue;
- const c2 = n[l2], f2 = p(u2, c2);
- if (f2 !== c2 && o && o.push({ name: "invalid-value-type", message: "attribute value was converted to match the field type", details: { field: u2, originalValue: c2, sanitizedValue: f2 } }), d.add(u2.name), u2 && (s || u2.editable)) {
- const e2 = ie(u2, f2);
- if (e2)
- return a(ce(e2, u2, f2));
- t2[u2.name] = f2;
- }
- }
- for (const i of e.requiredFields)
- if (!d.has(i.name))
- return a(`missing required field "${i.name}"`);
- return null;
- }
- function p(e, t2) {
- let i = t2;
- return typeof t2 == "string" && B(e) ? i = parseFloat(t2) : t2 != null && H(e) && typeof t2 != "string" && (i = String(t2)), ne(i);
- }
- var h;
- function g(n, i) {
- if (!n || !I(i))
- return n;
- if ("rings" in n || "paths" in n) {
- if (t(h))
- throw new TypeError("geometry engine not loaded");
- return h.simplify(i, n);
- }
- return n;
- }
- async function y() {
- return t(h) && (h = await import("./geometryEngineJSON-XXKTYTFH.js")), h;
- }
- async function w(e, n) {
- !I(e) || n !== "esriGeometryPolygon" && n !== "esriGeometryPolyline" || await y();
- }
- export {
- a,
- f,
- m,
- g,
- w
- };
- //# sourceMappingURL=chunk-XHRYELNQ.js.map
|