chunk-IHXECKQQ.js 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. import {
  2. s
  3. } from "./chunk-EMJ4ZSM2.js";
  4. // node_modules/@arcgis/core/core/MapUtils.js
  5. function n(n2, t2) {
  6. for (const [r3, o2] of n2)
  7. if (t2(o2, r3))
  8. return true;
  9. return false;
  10. }
  11. function r(n2, t2, r3) {
  12. const o2 = n2.get(t2);
  13. if (o2 !== void 0)
  14. return o2;
  15. const u2 = r3();
  16. return n2.set(t2, u2), u2;
  17. }
  18. // node_modules/@arcgis/core/core/accessorSupport/ensureType.js
  19. var r2 = s.getLogger("esri.core.Accessor");
  20. function t(e) {
  21. return e == null ? e : new Date(e);
  22. }
  23. function o(e) {
  24. return e == null ? e : !!e;
  25. }
  26. function u(e) {
  27. return e == null ? e : e.toString();
  28. }
  29. function a(e) {
  30. return e == null ? e : (e = parseFloat(e), isNaN(e) ? 0 : e);
  31. }
  32. function s2(e) {
  33. return e == null ? e : Math.round(parseFloat(e));
  34. }
  35. function i(e) {
  36. return e && e.constructor && e.constructor.__accessorMetadata__ !== void 0;
  37. }
  38. function l(e, n2) {
  39. return n2 != null && e && !(n2 instanceof e);
  40. }
  41. function c(e) {
  42. return e && "isCollection" in e;
  43. }
  44. function f(e) {
  45. return e && e.Type ? typeof e.Type == "function" ? e.Type : e.Type.base : null;
  46. }
  47. function p(e, n2) {
  48. if (!n2 || !n2.constructor || !c(n2.constructor))
  49. return y(e, n2) ? n2 : new e(n2);
  50. const r3 = f(e.prototype.itemType), t2 = f(n2.constructor.prototype.itemType);
  51. return r3 ? t2 ? r3 === t2 ? n2 : r3.prototype.isPrototypeOf(t2.prototype) ? new e(n2) : (y(e, n2), n2) : new e(n2) : n2;
  52. }
  53. function y(e, n2) {
  54. return !!i(n2) && (r2.error("Accessor#set", "Assigning an instance of '" + (n2.declaredClass || "unknown") + "' which is not a subclass of '" + g(e) + "'"), true);
  55. }
  56. function v(e, n2) {
  57. return n2 == null ? n2 : c(e) ? p(e, n2) : l(e, n2) ? y(e, n2) ? n2 : new e(n2) : n2;
  58. }
  59. function g(e) {
  60. return e && e.prototype && e.prototype.declaredClass || "unknown";
  61. }
  62. var d = new WeakMap();
  63. function h(e) {
  64. switch (e) {
  65. case Number:
  66. return a;
  67. case S:
  68. return s2;
  69. case Boolean:
  70. return o;
  71. case String:
  72. return u;
  73. case Date:
  74. return t;
  75. default:
  76. return r(d, e, () => v.bind(null, e));
  77. }
  78. }
  79. function b(e, n2) {
  80. const r3 = h(e);
  81. return arguments.length === 1 ? r3 : r3(n2);
  82. }
  83. function m(e, n2, r3) {
  84. return arguments.length === 1 ? m.bind(null, e) : n2 ? Array.isArray(n2) ? n2.map((n3) => e(n3, r3)) : [e(n2, r3)] : n2;
  85. }
  86. function w(e, n2) {
  87. return arguments.length === 1 ? m(b.bind(null, e)) : m(b.bind(null, e), n2);
  88. }
  89. function A(e, n2, r3) {
  90. return n2 !== 0 && Array.isArray(r3) ? r3.map((r4) => A(e, n2 - 1, r4)) : e(r3);
  91. }
  92. function $(e, n2, r3) {
  93. if (arguments.length === 2)
  94. return $.bind(null, e, n2);
  95. if (!r3)
  96. return r3;
  97. let t2 = n2, o2 = r3 = A(e, n2, r3);
  98. for (; t2 > 0 && Array.isArray(o2); )
  99. t2--, o2 = o2[0];
  100. if (o2 !== void 0)
  101. for (let u2 = 0; u2 < t2; u2++)
  102. r3 = [r3];
  103. return r3;
  104. }
  105. function j(e, n2, r3) {
  106. return arguments.length === 2 ? $(b.bind(null, e), n2) : $(b.bind(null, e), n2, r3);
  107. }
  108. function k(e) {
  109. return !!Array.isArray(e) && !e.some((n2) => {
  110. const r3 = typeof n2;
  111. return !(r3 === "string" || r3 === "number" || r3 === "function" && e.length > 1);
  112. });
  113. }
  114. function M(e, n2) {
  115. if (arguments.length === 2)
  116. return M(e).call(null, n2);
  117. const t2 = new Set(), o2 = e.filter((e2) => typeof e2 != "function"), u2 = e.filter((e2) => typeof e2 == "function");
  118. for (const r3 of e)
  119. typeof r3 != "string" && typeof r3 != "number" || t2.add(r3);
  120. let a2 = null, s3 = null;
  121. return (e2, n3) => {
  122. if (e2 == null)
  123. return e2;
  124. const i2 = typeof e2, c2 = i2 === "string" || i2 === "number";
  125. return c2 && (t2.has(e2) || u2.some((e3) => i2 === "string" && e3 === String || i2 === "number" && e3 === Number)) || i2 === "object" && u2.some((n4) => !l(e2, n4)) ? e2 : (c2 && o2.length ? (a2 || (a2 = o2.map((e3) => typeof e3 == "string" ? `'${e3}'` : `${e3}`).join(", ")), r2.error("Accessor#set", `'${e2}' is not a valid value for this property, only the following values are valid: ${a2}`)) : typeof e2 == "object" && u2.length ? (s3 || (s3 = u2.map((e3) => g(e3)).join(", ")), r2.error("Accessor#set", `'${e2}' is not a valid value for this property, value must be one of ${s3}`)) : r2.error("Accessor#set", `'${e2}' is not a valid value for this property`), n3 && (n3.valid = false), null);
  126. };
  127. }
  128. function N(e, n2) {
  129. if (arguments.length === 2)
  130. return N(e).call(null, n2);
  131. const t2 = {}, o2 = [], u2 = [];
  132. for (const r3 in e.typeMap) {
  133. const n3 = e.typeMap[r3];
  134. t2[r3] = b(n3), o2.push(g(n3)), u2.push(r3);
  135. }
  136. const a2 = () => `'${o2.join("', '")}'`, s3 = () => `'${u2.join("', '")}'`, c2 = typeof e.key == "string" ? (n3) => n3[e.key] : e.key;
  137. return (n3) => {
  138. if (e.base && !l(e.base, n3))
  139. return n3;
  140. if (n3 == null)
  141. return n3;
  142. const o3 = c2(n3) || e.defaultKeyValue, u3 = t2[o3];
  143. if (!u3)
  144. return r2.error("Accessor#set", `Invalid property value, value needs to be one of ${a2()}, or a plain object that can autocast (having .type = ${s3()})`), null;
  145. if (!l(e.typeMap[o3], n3))
  146. return n3;
  147. if (typeof e.key == "string" && !i(n3)) {
  148. const r3 = {};
  149. for (const t3 in n3)
  150. t3 !== e.key && (r3[t3] = n3[t3]);
  151. return u3(r3);
  152. }
  153. return u3(n3);
  154. };
  155. }
  156. var S = class {
  157. };
  158. var T = { native: (e) => ({ type: "native", value: e }), array: (e) => ({ type: "array", value: e }), oneOf: (e) => ({ type: "one-of", values: e }) };
  159. function _(e) {
  160. if (!e || !("type" in e))
  161. return false;
  162. switch (e.type) {
  163. case "native":
  164. case "array":
  165. case "one-of":
  166. return true;
  167. }
  168. return false;
  169. }
  170. function B(e) {
  171. switch (e.type) {
  172. case "native":
  173. return b(e.value);
  174. case "array":
  175. return m(B(e.value));
  176. case "one-of":
  177. return C(e);
  178. default:
  179. return null;
  180. }
  181. }
  182. function C(e) {
  183. let n2 = null;
  184. return (t2, o2) => F(t2, e) ? t2 : (n2 == null && (n2 = D(e)), r2.error("Accessor#set", `Invalid property value, value needs to be of type ${n2}`), o2 && (o2.valid = false), null);
  185. }
  186. function D(e) {
  187. switch (e.type) {
  188. case "native":
  189. switch (e.value) {
  190. case Number:
  191. return "number";
  192. case String:
  193. return "string";
  194. case Boolean:
  195. return "boolean";
  196. case S:
  197. return "integer";
  198. case Date:
  199. return "date";
  200. default:
  201. return g(e.value);
  202. }
  203. case "array":
  204. return `array of ${D(e.value)}`;
  205. case "one-of": {
  206. const n2 = e.values.map((e2) => D(e2));
  207. return `one of ${n2.slice(0, n2.length - 1)} or ${n2[n2.length - 1]}`;
  208. }
  209. }
  210. return "unknown";
  211. }
  212. function F(e, n2) {
  213. if (e == null)
  214. return true;
  215. switch (n2.type) {
  216. case "native":
  217. switch (n2.value) {
  218. case Number:
  219. case S:
  220. return typeof e == "number";
  221. case Boolean:
  222. return typeof e == "boolean";
  223. case String:
  224. return typeof e == "string";
  225. }
  226. return e instanceof n2.value;
  227. case "array":
  228. return !!Array.isArray(e) && !e.some((e2) => !F(e2, n2.value));
  229. case "one-of":
  230. return n2.values.some((n3) => F(e, n3));
  231. }
  232. }
  233. export {
  234. n,
  235. r,
  236. u,
  237. a,
  238. s2 as s,
  239. v,
  240. b,
  241. m,
  242. w,
  243. $,
  244. j,
  245. k,
  246. M,
  247. N,
  248. S,
  249. T,
  250. _,
  251. B
  252. };
  253. //# sourceMappingURL=chunk-IHXECKQQ.js.map