featuresetstring-6A7U67BI.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. import {
  2. J as J2
  3. } from "./chunk-PLCWBBQ4.js";
  4. import {
  5. Ae,
  6. Ce,
  7. Fe,
  8. Ie,
  9. J,
  10. K,
  11. P,
  12. P2,
  13. Re,
  14. V,
  15. ce,
  16. e,
  17. fe,
  18. me,
  19. re,
  20. t,
  21. te,
  22. v2 as v
  23. } from "./chunk-FT2BCPUP.js";
  24. import "./chunk-5JZ72JAQ.js";
  25. import "./chunk-JGBXYDGB.js";
  26. import "./chunk-QEWF7QPH.js";
  27. import "./chunk-5N7JLUJJ.js";
  28. import "./chunk-5UVJ64RB.js";
  29. import "./chunk-VCH45Q2I.js";
  30. import "./chunk-HZRKBTHJ.js";
  31. import "./chunk-6T6G6LCQ.js";
  32. import "./chunk-YEJL5NEF.js";
  33. import "./chunk-PQFTYGF5.js";
  34. import "./chunk-2Z2TG5CU.js";
  35. import "./chunk-6KZ2LTDA.js";
  36. import "./chunk-U2XHEJM7.js";
  37. import "./chunk-SQOPWYIT.js";
  38. import "./chunk-V6P2MAQQ.js";
  39. import "./chunk-E5O6P5I2.js";
  40. import "./chunk-SPWQ3AWG.js";
  41. import "./chunk-2TIUKVZN.js";
  42. import "./chunk-YXWMMD76.js";
  43. import "./chunk-S5KM4IGW.js";
  44. // node_modules/@arcgis/core/arcade/functions/featuresetstring.js
  45. function h(e2) {
  46. return e2 && e2.domain ? "coded-value" === e2.domain.type || "codedValue" === e2.domain.type ? J2.convertObjectToArcadeDictionary({ type: "codedValue", name: e2.domain.name, dataType: P[e2.field.type], codedValues: e2.domain.codedValues.map((n) => ({ name: n.name, code: n.code })) }) : J2.convertObjectToArcadeDictionary({ type: "range", name: e2.domain.name, dataType: P[e2.field.type], min: e2.domain.min, max: e2.domain.max }) : null;
  47. }
  48. function A(T) {
  49. "async" === T.mode && (T.functions.domain = function(n, u) {
  50. return T.standardFunctionAsync(n, u, async (m, f, l) => {
  51. if (V(l, 2, 3, n, u), J(l[0])) {
  52. return h(Ae(l[0], K(l[1]), void 0 === l[2] ? void 0 : re(l[2])));
  53. }
  54. if (P2(l[0])) {
  55. await l[0]._ensureLoaded();
  56. return h(me(K(l[1]), l[0], null, void 0 === l[2] ? void 0 : re(l[2])));
  57. }
  58. throw new t(n, e.InvalidParameter, u);
  59. });
  60. }, T.functions.subtypes = function(o, i) {
  61. return T.standardFunctionAsync(o, i, async (c, d, m) => {
  62. if (V(m, 1, 1, o, i), J(m[0])) {
  63. const e2 = Re(m[0]);
  64. return e2 ? J2.convertObjectToArcadeDictionary(e2) : null;
  65. }
  66. if (P2(m[0])) {
  67. await m[0]._ensureLoaded();
  68. const e2 = m[0].subtypes();
  69. return e2 ? J2.convertObjectToArcadeDictionary(e2) : null;
  70. }
  71. throw new t(o, e.InvalidParameter, i);
  72. });
  73. }, T.functions.domainname = function(n, o) {
  74. return T.standardFunctionAsync(n, o, async (u, l, y) => {
  75. if (V(y, 2, 4, n, o), J(y[0]))
  76. return Fe(y[0], K(y[1]), y[2], void 0 === y[3] ? void 0 : re(y[3]));
  77. if (P2(y[0])) {
  78. await y[0]._ensureLoaded();
  79. const n2 = me(K(y[1]), y[0], null, void 0 === y[3] ? void 0 : re(y[3]));
  80. return fe(n2, y[2]);
  81. }
  82. throw new t(n, e.InvalidParameter, o);
  83. });
  84. }, T.signatures.push({ name: "domainname", min: 2, max: 4 }), T.functions.domaincode = function(n, o) {
  85. return T.standardFunctionAsync(n, o, async (u, m, f) => {
  86. if (V(f, 2, 4, n, o), J(f[0]))
  87. return Ce(f[0], K(f[1]), f[2], void 0 === f[3] ? void 0 : re(f[3]));
  88. if (P2(f[0])) {
  89. await f[0]._ensureLoaded();
  90. const n2 = me(K(f[1]), f[0], null, void 0 === f[3] ? void 0 : re(f[3]));
  91. return ce(n2, f[2]);
  92. }
  93. throw new t(n, e.InvalidParameter, o);
  94. });
  95. }, T.signatures.push({ name: "domaincode", min: 2, max: 4 })), T.functions.text = function(n, e2) {
  96. return T.standardFunctionAsync(n, e2, (a, r, o) => {
  97. if (V(o, 1, 2, n, e2), !P2(o[0]))
  98. return te(o[0], o[1]);
  99. {
  100. const n2 = v(o[1], "");
  101. if ("" === n2)
  102. return o[0].castToText();
  103. if ("schema" === n2.toLowerCase())
  104. return o[0].convertToText("schema", a.abortSignal);
  105. if ("featureset" === n2.toLowerCase())
  106. return o[0].convertToText("featureset", a.abortSignal);
  107. }
  108. });
  109. }, T.functions.gdbversion = function(n, o) {
  110. return T.standardFunctionAsync(n, o, async (i, c, d) => {
  111. if (V(d, 1, 1, n, o), J(d[0]))
  112. return d[0].gdbVersion();
  113. if (P2(d[0])) {
  114. return (await d[0].load()).gdbVersion;
  115. }
  116. throw new t(n, e.InvalidParameter, o);
  117. });
  118. }, T.functions.schema = function(o, i) {
  119. return T.standardFunctionAsync(o, i, async (c, d, u) => {
  120. if (V(u, 1, 1, o, i), P2(u[0]))
  121. return await u[0].load(), J2.convertObjectToArcadeDictionary(u[0].schema());
  122. if (J(u[0])) {
  123. const e2 = Ie(u[0]);
  124. return e2 ? J2.convertObjectToArcadeDictionary(e2) : null;
  125. }
  126. throw new t(o, e.InvalidParameter, i);
  127. });
  128. };
  129. }
  130. export {
  131. A as registerFunctions
  132. };
  133. //# sourceMappingURL=featuresetstring-6A7U67BI.js.map