featuresetstring-RP6DTLWZ.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import {
  2. d
  3. } from "./chunk-R5LRKX5A.js";
  4. import {
  5. Ae,
  6. Fe,
  7. G,
  8. I,
  9. J,
  10. P,
  11. Re,
  12. X,
  13. Y,
  14. ce,
  15. ee,
  16. fe,
  17. je,
  18. le,
  19. ne,
  20. ve
  21. } from "./chunk-25BNEBXZ.js";
  22. import "./chunk-3ZFH4KQV.js";
  23. import "./chunk-BJHM4JNS.js";
  24. import "./chunk-F6A2QQ26.js";
  25. import "./chunk-7ZIDBK7B.js";
  26. import "./chunk-OWVBLVP3.js";
  27. import "./chunk-XH7RUGVZ.js";
  28. import "./chunk-PDKDCAAD.js";
  29. import "./chunk-ECW2QABR.js";
  30. import "./chunk-GCDJLKH4.js";
  31. import "./chunk-MRJEICT6.js";
  32. import "./chunk-Y3WMVFTW.js";
  33. import "./chunk-SAS7RONY.js";
  34. import "./chunk-WSRBH7BF.js";
  35. import "./chunk-IHXECKQQ.js";
  36. import "./chunk-ULGDPLM2.js";
  37. import "./chunk-EMJ4ZSM2.js";
  38. import "./chunk-IKP3YN53.js";
  39. import "./chunk-GZT4BVFP.js";
  40. import "./chunk-A5ICIBVI.js";
  41. // node_modules/@arcgis/core/arcade/functions/featuresetstring.js
  42. function w(a) {
  43. 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;
  44. }
  45. function h(p) {
  46. p.mode === "async" && (p.functions.domain = function(n, s) {
  47. return p.standardFunctionAsync(n, s, async function(n2, s2, d2) {
  48. if (G(d2, 2, 3), Y(d2[0])) {
  49. return w(je(d2[0], X(d2[1]), d2[2] === void 0 ? void 0 : ne(d2[2])));
  50. }
  51. if (J(d2[0])) {
  52. await d2[0]._ensureLoaded();
  53. return w(ce(X(d2[1]), d2[0], null, d2[2] === void 0 ? void 0 : ne(d2[2])));
  54. }
  55. throw new Error("Invalid Parameter");
  56. });
  57. }, p.functions.subtypes = function(t, r) {
  58. return p.standardFunctionAsync(t, r, async function(t2, r2, o) {
  59. if (G(o, 1, 1), Y(o[0])) {
  60. const a = Ae(o[0]);
  61. return a ? d.convertObjectToArcadeDictionary(a) : null;
  62. }
  63. if (J(o[0])) {
  64. await o[0]._ensureLoaded();
  65. const a = o[0].subtypes();
  66. return a ? d.convertObjectToArcadeDictionary(a) : null;
  67. }
  68. throw new Error("Invalid Parameter");
  69. });
  70. }, p.functions.domainname = function(n, t) {
  71. return p.standardFunctionAsync(n, t, async function(n2, t2, s) {
  72. if (G(s, 2, 4), Y(s[0]))
  73. return Re(s[0], X(s[1]), s[2], s[3] === void 0 ? void 0 : ne(s[3]));
  74. if (J(s[0])) {
  75. await s[0]._ensureLoaded();
  76. const n3 = ce(X(s[1]), s[0], null, s[3] === void 0 ? void 0 : ne(s[3]));
  77. return le(n3, s[2]);
  78. }
  79. throw new Error("Invalid Parameter");
  80. });
  81. }, p.signatures.push({ name: "domainname", min: "2", max: "4" }), p.functions.domaincode = function(n, t) {
  82. return p.standardFunctionAsync(n, t, async function(n2, t2, s) {
  83. if (G(s, 2, 4), Y(s[0]))
  84. return Fe(s[0], X(s[1]), s[2], s[3] === void 0 ? void 0 : ne(s[3]));
  85. if (J(s[0])) {
  86. await s[0]._ensureLoaded();
  87. const n3 = ce(X(s[1]), s[0], null, s[3] === void 0 ? void 0 : ne(s[3]));
  88. return fe(n3, s[2]);
  89. }
  90. throw new Error("Invalid Parameter");
  91. });
  92. }, p.signatures.push({ name: "domaincode", min: "2", max: "4" })), p.functions.text = function(n, e) {
  93. return p.standardFunctionAsync(n, e, function(n2, e2, t) {
  94. if (G(t, 1, 2), !J(t[0]))
  95. return ee(t[0], t[1]);
  96. {
  97. const a = I(t[1], "");
  98. if (a === "")
  99. return t[0].castToText();
  100. if (a.toLowerCase() === "schema")
  101. return t[0].convertToText("schema", n2.abortSignal);
  102. if (a.toLowerCase() === "featureset")
  103. return t[0].convertToText("featureset", n2.abortSignal);
  104. }
  105. });
  106. }, p.functions.gdbversion = function(n, t) {
  107. return p.standardFunctionAsync(n, t, async function(n2, t2, r) {
  108. if (G(r, 1, 1), Y(r[0]))
  109. return r[0].gdbVersion();
  110. if (J(r[0])) {
  111. return (await r[0].load()).gdbVersion;
  112. }
  113. throw new Error("Invalid Parameter");
  114. });
  115. }, p.functions.schema = function(t, r) {
  116. return p.standardFunctionAsync(t, r, async function(t2, r2, o) {
  117. if (G(o, 1, 1), J(o[0]))
  118. return await o[0].load(), d.convertObjectToArcadeDictionary(o[0].schema());
  119. if (Y(o[0])) {
  120. const a = ve(o[0]);
  121. return a ? d.convertObjectToArcadeDictionary(a) : null;
  122. }
  123. throw new Error("Invalid Parameter");
  124. });
  125. };
  126. }
  127. export {
  128. h as registerFunctions
  129. };
  130. //# sourceMappingURL=featuresetstring-RP6DTLWZ.js.map