chunk-WZQZRKNH.js 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. import {
  2. a
  3. } from "./chunk-LRDX4TO7.js";
  4. import {
  5. s3 as s
  6. } from "./chunk-EMJ4ZSM2.js";
  7. import {
  8. o,
  9. t as t2
  10. } from "./chunk-IKP3YN53.js";
  11. import {
  12. r,
  13. t
  14. } from "./chunk-GZT4BVFP.js";
  15. // node_modules/@arcgis/core/layers/support/domainUtils.js
  16. var e;
  17. function a2(n, a3) {
  18. switch (n.type) {
  19. case "range": {
  20. const r3 = "range" in n ? n.range[0] : n.minValue, u2 = "range" in n ? n.range[1] : n.maxValue;
  21. if (+a3 < r3 || +a3 > u2)
  22. return e.VALUE_OUT_OF_RANGE;
  23. break;
  24. }
  25. case "coded-value":
  26. case "codedValue":
  27. if (n.codedValues == null || n.codedValues.every((e2) => e2 == null || e2.code !== a3))
  28. return e.INVALID_CODED_VALUE;
  29. }
  30. return null;
  31. }
  32. !function(e2) {
  33. e2.VALUE_OUT_OF_RANGE = "domain-validation-error::value-out-of-range", e2.INVALID_CODED_VALUE = "domain-validation-error::invalid-coded-value";
  34. }(e || (e = {}));
  35. // node_modules/@arcgis/core/layers/support/fieldUtils.js
  36. var u = ["field", "field2", "field3", "normalizationField", "rotationInfo.field", "proportionalSymbolInfo.field", "proportionalSymbolInfo.normalizationField", "colorInfo.field", "colorInfo.normalizationField"];
  37. var f = ["field", "normalizationField"];
  38. function c(e2, n) {
  39. if (e2 != null && n != null) {
  40. for (const i of Array.isArray(e2) ? e2 : [e2])
  41. if (d(u, i, n), "visualVariables" in i && i.visualVariables)
  42. for (const e3 of i.visualVariables)
  43. d(f, e3, n);
  44. }
  45. }
  46. function d(e2, n, i) {
  47. if (e2)
  48. for (const o2 of e2) {
  49. const e3 = t2(o2, n), l = e3 && typeof e3 != "function" && i.get(e3);
  50. l && o(o2, l.name, n);
  51. }
  52. }
  53. function m(e2, n) {
  54. if (e2 != null && n?.fields.length)
  55. if ("startField" in e2) {
  56. const i = n.get(e2.startField), t3 = n.get(e2.endField);
  57. e2.startField = i && i.name || null, e2.endField = t3 && t3.name || null;
  58. } else {
  59. const i = n.get(e2.startTimeField), t3 = n.get(e2.endTimeField);
  60. e2.startTimeField = i && i.name || null, e2.endTimeField = t3 && t3.name || null;
  61. }
  62. }
  63. var p = new Set();
  64. function y(e2, n) {
  65. return e2 && n ? (p.clear(), g(p, e2, n), Array.from(p).sort()) : [];
  66. }
  67. function g(e2, n, i) {
  68. if (i)
  69. if (n?.fields?.length)
  70. if (i.includes("*"))
  71. for (const { name: t3 } of n.fields)
  72. e2.add(t3);
  73. else
  74. for (const t3 of i)
  75. F(e2, n, t3);
  76. else {
  77. if (i.includes("*"))
  78. return e2.clear(), void e2.add("*");
  79. for (const n2 of i)
  80. e2.add(n2);
  81. }
  82. }
  83. function F(e2, n, i) {
  84. if (typeof i == "string")
  85. if (n) {
  86. const t3 = n.get(i);
  87. t3 && e2.add(t3.name);
  88. } else
  89. e2.add(i);
  90. }
  91. function I(e2, i) {
  92. return t(i) || t(e2) ? [] : i.includes("*") ? e2.fields.map((e3) => e3.name) : i;
  93. }
  94. async function b(e2, n, i) {
  95. if (!i)
  96. return;
  97. const { arcadeUtils: t3 } = await a(), r3 = t3.extractFieldNames(i, n?.fields?.map((e3) => e3.name));
  98. for (const o2 of r3)
  99. F(e2, n, o2);
  100. }
  101. async function T(n, i, t3) {
  102. if (t3 && t3 !== "1=1") {
  103. const r3 = (await import("./WhereClause-3WNNGKYX.js")).WhereClause.create(t3, i);
  104. if (!r3.isStandardized)
  105. throw new s("fieldUtils:collectFilterFields", "Where clause is not standardized", { where: t3 });
  106. g(n, i, r3.fieldNames);
  107. }
  108. }
  109. function h({ displayField: e2, fields: n }) {
  110. return e2 || (n && n.length ? S(n, "name-or-title") || S(n, "unique-identifier") || S(n, "type-or-category") || w(n) : null);
  111. }
  112. function w(e2) {
  113. for (const n of e2) {
  114. if (!n || !n.name)
  115. continue;
  116. const e3 = n.name.toLowerCase();
  117. if (e3.includes("name") || e3.includes("title"))
  118. return n.name;
  119. }
  120. return null;
  121. }
  122. function S(e2, n) {
  123. for (const i of e2)
  124. if (i && i.valueType && i.valueType === n)
  125. return i.name;
  126. return null;
  127. }
  128. async function A(e2, n) {
  129. if (!n)
  130. return;
  131. const i = t2("elevationInfo.featureExpressionInfo", n);
  132. return i ? i.collectRequiredFields(e2, n.fieldsIndex) : void 0;
  133. }
  134. async function E(e2, n, i) {
  135. i.outStatistic.onStatisticValueExpression ? b(e2, n, i.outStatistic.onStatisticValueExpression) : e2.add(i.outStatistic.onStatisticField);
  136. }
  137. async function N(e2, n, i) {
  138. if (!n || !i || !("fields" in i))
  139. return;
  140. const t3 = [];
  141. if (i.popupTemplate?.expressionInfos && t3.push(...i.popupTemplate.expressionInfos.map((i2) => b(e2, n.fieldsIndex, i2.expression))), Array.isArray(i.popupTemplate?.content)) {
  142. const r3 = i.popupTemplate.content;
  143. for (const i2 of r3)
  144. i2.type === "expression" && i2.expressionInfo && t3.push(b(e2, n.fieldsIndex, i2.expressionInfo.expression));
  145. }
  146. i.fields && t3.push(...i.fields.map((i2) => E(e2, n.fieldsIndex, i2))), await Promise.all(t3);
  147. }
  148. async function V(e2, n, t3) {
  149. n && (n.timeInfo && r(t3) && t3.timeExtent && g(e2, n.fieldsIndex, [n.timeInfo.startField, n.timeInfo.endField]), n.floorInfo && g(e2, n.fieldsIndex, [n.floorInfo.floorField]), r(t3) && r(t3.where) && await T(e2, n.fieldsIndex, t3.where));
  150. }
  151. async function _(e2, n, i) {
  152. n && i && await Promise.all(i.map((i2) => D(e2, n, i2)));
  153. }
  154. async function D(e2, n, i) {
  155. n && i && (i.valueExpression ? await b(e2, n.fieldsIndex, i.valueExpression) : i.field && F(e2, n.fieldsIndex, i.field));
  156. }
  157. function L(e2) {
  158. if (!e2)
  159. return [];
  160. const n = "editFieldsInfo" in e2 && e2.editFieldsInfo;
  161. return n ? y(e2.fieldsIndex, [n && n.creatorField, n && n.creationDateField, n && n.editorField, n && n.editDateField]) : [];
  162. }
  163. async function j(e2, n) {
  164. const { labelingInfo: i, fieldsIndex: t3 } = n;
  165. i && i.length && await Promise.all(i.map((n2) => z(e2, t3, n2)));
  166. }
  167. async function z(e2, n, i) {
  168. if (!i)
  169. return;
  170. const t3 = i.getLabelExpression(), r3 = i.where;
  171. if (t3.type === "arcade")
  172. await b(e2, n, t3.expression);
  173. else {
  174. const i2 = t3.expression.match(/{[^}]*}/g);
  175. i2 && i2.forEach((i3) => {
  176. F(e2, n, i3.slice(1, -1));
  177. });
  178. }
  179. await T(e2, n, r3);
  180. }
  181. function P(e2) {
  182. const n = e2.defaultValue;
  183. return n !== void 0 && Y(e2, n) ? n : e2.nullable ? null : void 0;
  184. }
  185. function k(e2) {
  186. return typeof e2 == "number" && !isNaN(e2) && isFinite(e2);
  187. }
  188. function C(e2) {
  189. return e2 === null || k(e2);
  190. }
  191. var R = "isInteger" in Number ? Number.isInteger : (e2) => typeof e2 == "number" && isFinite(e2) && Math.floor(e2) === e2;
  192. function G(e2) {
  193. return e2 === null || R(e2);
  194. }
  195. function W(e2) {
  196. return e2 != null && typeof e2 == "string";
  197. }
  198. function q(e2) {
  199. return e2 === null || W(e2);
  200. }
  201. function M() {
  202. return true;
  203. }
  204. function Y(e2, n) {
  205. let i;
  206. switch (e2.type) {
  207. case "date":
  208. case "integer":
  209. case "long":
  210. case "small-integer":
  211. case "esriFieldTypeDate":
  212. case "esriFieldTypeInteger":
  213. case "esriFieldTypeLong":
  214. case "esriFieldTypeSmallInteger":
  215. i = e2.nullable ? G : R;
  216. break;
  217. case "double":
  218. case "single":
  219. case "esriFieldTypeSingle":
  220. case "esriFieldTypeDouble":
  221. i = e2.nullable ? C : k;
  222. break;
  223. case "string":
  224. case "esriFieldTypeString":
  225. i = e2.nullable ? q : W;
  226. break;
  227. default:
  228. i = M;
  229. }
  230. return arguments.length === 1 ? i : i(n);
  231. }
  232. var J = ["integer", "small-integer", "single", "double"];
  233. var X = new Set([...J, "esriFieldTypeInteger", "esriFieldTypeSmallInteger", "esriFieldTypeSingle", "esriFieldTypeDouble"]);
  234. function B(e2) {
  235. return e2 != null && X.has(e2.type);
  236. }
  237. function H(e2) {
  238. return e2 != null && (e2.type === "string" || e2.type === "esriFieldTypeString");
  239. }
  240. var Z;
  241. var ee;
  242. function ne(e2) {
  243. return e2 == null || typeof e2 == "number" && isNaN(e2) ? null : e2;
  244. }
  245. function ie(e2, n) {
  246. return e2.nullable && n === null ? null : B(e2) && !te(e2.type, Number(n)) ? Z.OUT_OF_RANGE : Y(e2, n) ? e2.domain ? a2(e2.domain, n) : null : ee.INVALID_TYPE;
  247. }
  248. function te(e2, n) {
  249. const i = typeof e2 == "string" ? oe(e2) : e2;
  250. return !!i && (i.isInteger ? R(n) && n >= i.min && n <= i.max : n >= i.min && n <= i.max);
  251. }
  252. function oe(e2) {
  253. switch (e2) {
  254. case "esriFieldTypeSmallInteger":
  255. case "small-integer":
  256. return se;
  257. case "esriFieldTypeInteger":
  258. case "integer":
  259. return ae;
  260. case "esriFieldTypeSingle":
  261. case "single":
  262. return ue;
  263. case "esriFieldTypeDouble":
  264. case "double":
  265. return fe;
  266. }
  267. }
  268. !function(e2) {
  269. e2.OUT_OF_RANGE = "numeric-range-validation-error::out-of-range";
  270. }(Z || (Z = {})), function(e2) {
  271. e2.INVALID_TYPE = "type-validation-error::invalid-type";
  272. }(ee || (ee = {}));
  273. var se = { min: -32768, max: 32767, isInteger: true };
  274. var ae = { min: -2147483648, max: 2147483647, isInteger: true };
  275. var ue = { min: -34e37, max: 12e37, isInteger: false };
  276. var fe = { min: -Number.MAX_VALUE, max: Number.MAX_VALUE, isInteger: false };
  277. function ce(e2, n, i) {
  278. switch (e2) {
  279. case e.INVALID_CODED_VALUE:
  280. return `Value ${i} is not in the coded domain - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;
  281. case e.VALUE_OUT_OF_RANGE:
  282. return `Value ${i} is out of the range of valid values - field: ${n.name}, domain: ${JSON.stringify(n.domain)}`;
  283. case ee.INVALID_TYPE:
  284. return `Value ${i} is not a valid value for the field type - field: ${n.name}, type: ${n.type}, nullable: ${n.nullable}`;
  285. case Z.OUT_OF_RANGE: {
  286. const { min: e3, max: t3 } = oe(n.type);
  287. return `Value ${i} is out of range for the number type - field: ${n.name}, type: ${n.type}, value range is ${e3} to ${t3}`;
  288. }
  289. }
  290. }
  291. function de(e2, n) {
  292. return !me(e2, n, null);
  293. }
  294. function me(e2, n, t3) {
  295. if (!n || !n.attributes || !e2) {
  296. if (r(t3))
  297. for (const n2 of e2)
  298. t3.add(n2);
  299. return true;
  300. }
  301. const r3 = n.attributes;
  302. let o2 = false;
  303. for (const l of e2)
  304. if (!(l in r3)) {
  305. if (o2 = true, !r(t3))
  306. break;
  307. t3.add(l);
  308. }
  309. return o2;
  310. }
  311. function ye(e2) {
  312. return ["raster.itempixelvalue", "raster.servicepixelvalue"].some((n) => e2.toLowerCase().startsWith(n));
  313. }
  314. export {
  315. c,
  316. m,
  317. y,
  318. g,
  319. F,
  320. I,
  321. b,
  322. h,
  323. A,
  324. N,
  325. V,
  326. _,
  327. L,
  328. j,
  329. P,
  330. B,
  331. H,
  332. ne,
  333. ie,
  334. ce,
  335. de,
  336. ye
  337. };
  338. //# sourceMappingURL=chunk-WZQZRKNH.js.map