chunk-XHRYELNQ.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import {
  2. B,
  3. H,
  4. ce,
  5. ie,
  6. ne
  7. } from "./chunk-WZQZRKNH.js";
  8. import {
  9. I
  10. } from "./chunk-MRJEICT6.js";
  11. import {
  12. t
  13. } from "./chunk-GZT4BVFP.js";
  14. // node_modules/@arcgis/core/layers/graphics/sources/support/sourceUtils.js
  15. var l = class {
  16. constructor() {
  17. this.code = null, this.description = null;
  18. }
  19. };
  20. var u = class {
  21. constructor(e) {
  22. this.error = new l(), this.globalId = null, this.objectId = null, this.success = false, this.uniqueId = null, this.error.description = e;
  23. }
  24. };
  25. function a(e) {
  26. return new u(e);
  27. }
  28. var c = class {
  29. constructor(e) {
  30. this.globalId = null, this.success = true, this.objectId = this.uniqueId = e;
  31. }
  32. };
  33. function f(e) {
  34. return new c(e);
  35. }
  36. var d = new Set();
  37. function m(e, t2, n, s = false, o) {
  38. d.clear();
  39. for (const l2 in n) {
  40. const u2 = e.get(l2);
  41. if (!u2)
  42. continue;
  43. const c2 = n[l2], f2 = p(u2, c2);
  44. 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)) {
  45. const e2 = ie(u2, f2);
  46. if (e2)
  47. return a(ce(e2, u2, f2));
  48. t2[u2.name] = f2;
  49. }
  50. }
  51. for (const i of e.requiredFields)
  52. if (!d.has(i.name))
  53. return a(`missing required field "${i.name}"`);
  54. return null;
  55. }
  56. function p(e, t2) {
  57. let i = t2;
  58. return typeof t2 == "string" && B(e) ? i = parseFloat(t2) : t2 != null && H(e) && typeof t2 != "string" && (i = String(t2)), ne(i);
  59. }
  60. var h;
  61. function g(n, i) {
  62. if (!n || !I(i))
  63. return n;
  64. if ("rings" in n || "paths" in n) {
  65. if (t(h))
  66. throw new TypeError("geometry engine not loaded");
  67. return h.simplify(i, n);
  68. }
  69. return n;
  70. }
  71. async function y() {
  72. return t(h) && (h = await import("./geometryEngineJSON-XXKTYTFH.js")), h;
  73. }
  74. async function w(e, n) {
  75. !I(e) || n !== "esriGeometryPolygon" && n !== "esriGeometryPolyline" || await y();
  76. }
  77. export {
  78. a,
  79. f,
  80. m,
  81. g,
  82. w
  83. };
  84. //# sourceMappingURL=chunk-XHRYELNQ.js.map