@opennsw/jsonforms-renderers 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,10 +2,10 @@ var mr = Object.defineProperty;
2
2
  var gr = (e, t, r) => t in e ? mr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var Pe = (e, t, r) => gr(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import { jsx as n, jsxs as g, Fragment as be } from "react/jsx-runtime";
5
- import { useContext as Ze, createContext as Qe, useMemo as yr, useEffect as fe, useState as F, useRef as de, useCallback as _e } from "react";
6
- import { rankWith as W, isStringControl as vr, or as Le, isNumberControl as br, isIntegerControl as wr, isBooleanControl as Er, isEnumControl as er, isOneOfControl as rr, schemaMatches as ze, isDateControl as Rr, isDateTimeControl as Cr, isTimeControl as Tr, uiTypeIs as Te, and as Ar, Resolve as Sr, createDefaultValue as Or, isObjectArrayControl as Nr, isPrimitiveArrayControl as Ir } from "@jsonforms/core";
5
+ import { useContext as Ze, createContext as Qe, useMemo as yr, useEffect as fe, useState as U, useRef as de, useCallback as _e } from "react";
6
+ import { rankWith as K, isStringControl as vr, or as Le, isNumberControl as br, isIntegerControl as wr, isBooleanControl as Er, isEnumControl as er, isOneOfControl as rr, schemaMatches as ze, isDateControl as Rr, isDateTimeControl as Cr, isTimeControl as Tr, uiTypeIs as Te, and as Ar, Resolve as Sr, createDefaultValue as Or, isObjectArrayControl as Nr, isPrimitiveArrayControl as Ir } from "@jsonforms/core";
7
7
  import { withJsonFormsControlProps as se, JsonFormsDispatch as Ae, useJsonForms as xr, withJsonFormsArrayControlProps as Mr } from "@jsonforms/react";
8
- import { Box as C, Flex as S, Text as h, TextField as ye, Checkbox as kr, RadioGroup as Ve, Select as Ne, ScrollArea as Lr, Spinner as Me, Button as ke, Tabs as Ie, Heading as tr, Card as nr, IconButton as Ue, Tooltip as We, Table as $ } from "@radix-ui/themes";
8
+ import { Box as R, Flex as S, Text as h, TextField as ye, Checkbox as kr, RadioGroup as Ve, Select as Ne, ScrollArea as Lr, Spinner as Me, Button as ke, Tabs as Ie, Heading as tr, Card as nr, IconButton as Ue, Tooltip as We, Table as P } from "@radix-ui/themes";
9
9
  import { ChevronDownIcon as zr, FileTextIcon as Dr, CheckCircledIcon as Fr, Cross2Icon as or, ExclamationTriangleIcon as lr, UploadIcon as He, TrashIcon as Ur, PlusIcon as Hr } from "@radix-ui/react-icons";
10
10
  import $r from "dayjs";
11
11
  import { read as _r, utils as Pr } from "@e965/xlsx";
@@ -55,7 +55,7 @@ const ce = (e, t, r, i = void 0) => {
55
55
  if (ce(c, r, t), c === !1)
56
56
  return null;
57
57
  const u = s.length === 0;
58
- return /* @__PURE__ */ n(C, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
58
+ return /* @__PURE__ */ n(R, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
59
59
  /* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
60
60
  i,
61
61
  " ",
@@ -75,7 +75,7 @@ const ce = (e, t, r, i = void 0) => {
75
75
  !u && /* @__PURE__ */ n(h, { color: "red", size: "1", children: ae(s, i) }),
76
76
  a.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: a.description })
77
77
  ] }) });
78
- }, Kr = W(1, vr), Gr = se(Br), Xr = ({
78
+ }, Kr = K(1, vr), Gr = se(Br), Xr = ({
79
79
  data: e,
80
80
  handleChange: t,
81
81
  path: r,
@@ -98,7 +98,7 @@ const ce = (e, t, r, i = void 0) => {
98
98
  const v = Number(m);
99
99
  isNaN(v) || t(r, v);
100
100
  };
101
- return /* @__PURE__ */ n(C, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
101
+ return /* @__PURE__ */ n(R, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
102
102
  /* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
103
103
  i,
104
104
  " ",
@@ -119,7 +119,7 @@ const ce = (e, t, r, i = void 0) => {
119
119
  !u && /* @__PURE__ */ n(h, { color: "red", size: "1", children: ae(s, i) }),
120
120
  a.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: a.description })
121
121
  ] }) });
122
- }, jr = W(2, Le(br, wr)), Yr = se(Xr), Jr = ({
122
+ }, jr = K(2, Le(br, wr)), Yr = se(Xr), Jr = ({
123
123
  data: e,
124
124
  handleChange: t,
125
125
  path: r,
@@ -133,7 +133,7 @@ const ce = (e, t, r, i = void 0) => {
133
133
  if (ce(o, r, t), o === !1)
134
134
  return null;
135
135
  const c = s.length === 0;
136
- return /* @__PURE__ */ g(C, { mb: "4", children: [
136
+ return /* @__PURE__ */ g(R, { mb: "4", children: [
137
137
  /* @__PURE__ */ g(S, { gap: "2", align: "center", children: [
138
138
  /* @__PURE__ */ n(
139
139
  kr,
@@ -153,7 +153,7 @@ const ce = (e, t, r, i = void 0) => {
153
153
  !c && /* @__PURE__ */ n(h, { color: "red", size: "1", className: "block mt-1", children: ae(s, i) }),
154
154
  l.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", className: "block mt-1", children: l.description })
155
155
  ] });
156
- }, qr = W(2, Er), Zr = se(Jr), Qr = ({
156
+ }, qr = K(2, Er), Zr = se(Jr), Qr = ({
157
157
  data: e,
158
158
  handleChange: t,
159
159
  path: r,
@@ -173,7 +173,7 @@ const ce = (e, t, r, i = void 0) => {
173
173
  label: p.title || String(p.const)
174
174
  })));
175
175
  const y = e;
176
- return /* @__PURE__ */ n(C, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
176
+ return /* @__PURE__ */ n(R, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
177
177
  /* @__PURE__ */ g(h, { as: "div", size: "2", weight: "bold", children: [
178
178
  i,
179
179
  " ",
@@ -233,7 +233,7 @@ const ce = (e, t, r, i = void 0) => {
233
233
  label: v.title || String(v.const)
234
234
  })));
235
235
  const p = e !== void 0 ? String(e) : "";
236
- return /* @__PURE__ */ n(C, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
236
+ return /* @__PURE__ */ n(R, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
237
237
  /* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
238
238
  i,
239
239
  " ",
@@ -253,7 +253,7 @@ const ce = (e, t, r, i = void 0) => {
253
253
  !u && /* @__PURE__ */ n(h, { color: "red", size: "1", children: ae(s, i) }),
254
254
  l.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: l.description })
255
255
  ] }) });
256
- }, nt = W(2, Le(er, rr)), ot = se(tt), lt = {
256
+ }, nt = K(2, Le(er, rr)), ot = se(tt), lt = {
257
257
  "small-list": { fetchOnOpen: !0, searchable: !1, paginated: !1 },
258
258
  "large-searchable-list": { fetchOnOpen: !0, searchable: !0, paginated: !1 },
259
259
  "large-paginated-list": { fetchOnOpen: !1, searchable: !0, paginated: !0 }
@@ -270,27 +270,27 @@ const ce = (e, t, r, i = void 0) => {
270
270
  uischema: c
271
271
  }) => {
272
272
  var Re;
273
- const u = (o == null ? void 0 : o["x-search"]) ?? { service: "" }, y = u.service ?? "", p = u.mode ?? "large-paginated-list", m = lt[p], v = (m == null ? void 0 : m.fetchOnOpen) ?? !1, N = u.params, A = Wr(y), w = o.type === "object", R = w ? typeof e == "string" ? { value: e } : e ?? void 0 : void 0, L = w ? R == null ? void 0 : R.value : e, P = R == null ? void 0 : R.label, I = y ? A ? m ? null : `Invalid x-search.mode "${p}". Expected "small-list", "large-searchable-list", or "large-paginated-list".` : `Search service "${y}" is not registered.` : "Search not configured.", B = l !== !1, j = !s || s.length === 0, [M, O] = F(!1), [D, V] = F(""), [oe, ee] = F([]), [le, Y] = F(!1), [Z, re] = F(!1), [he, ne] = F(!1), [ue, b] = F(null), [k, U] = F(void 0), T = de(void 0), H = de(null), J = de(null), Q = de(null), K = de(void 0);
273
+ const u = (o == null ? void 0 : o["x-search"]) ?? { service: "" }, y = u.service ?? "", p = u.mode ?? "large-paginated-list", m = lt[p], v = (m == null ? void 0 : m.fetchOnOpen) ?? !1, N = u.params, A = Wr(y), w = o.type === "object", I = w ? typeof e == "string" ? { value: e } : e ?? void 0 : void 0, L = w ? I == null ? void 0 : I.value : e, D = I == null ? void 0 : I.label, C = y ? A ? m ? null : `Invalid x-search.mode "${p}". Expected "small-list", "large-searchable-list", or "large-paginated-list".` : `Search service "${y}" is not registered.` : "Search not configured.", H = l !== !1, W = !s || s.length === 0, [x, O] = U(!1), [F, B] = U(""), [oe, ee] = U([]), [le, Y] = U(!1), [Z, re] = U(!1), [he, ne] = U(!1), [ue, b] = U(null), [k, $] = U(void 0), T = de(void 0), _ = de(null), J = de(null), Q = de(null), G = de(void 0);
274
274
  fe(() => {
275
275
  var E, q;
276
276
  if (!L) {
277
- U(void 0), K.current = void 0;
277
+ $(void 0), G.current = void 0;
278
278
  return;
279
279
  }
280
- if (((E = K.current) == null ? void 0 : E.value) === L && ((q = K.current) == null ? void 0 : q.label) === P) return;
281
- if (K.current = { value: L, label: P }, w && P) {
282
- U({ id: L, name: P });
280
+ if (((E = G.current) == null ? void 0 : E.value) === L && ((q = G.current) == null ? void 0 : q.label) === D) return;
281
+ if (G.current = { value: L, label: D }, w && D) {
282
+ $({ id: L, name: D });
283
283
  return;
284
284
  }
285
- if (U({ id: L, name: P ?? L }), !(A != null && A.resolve)) return;
285
+ if ($({ id: L, name: D ?? L }), !(A != null && A.resolve)) return;
286
286
  let d = !1;
287
287
  return A.resolve(L, N).then((te) => {
288
- !d && te && U(te);
288
+ !d && te && $(te);
289
289
  }).catch(() => {
290
290
  }), () => {
291
291
  d = !0;
292
292
  };
293
- }, [L, P, w, A, N]);
293
+ }, [L, D, w, A, N]);
294
294
  const we = _e(
295
295
  async (d, E = !1) => {
296
296
  var te;
@@ -319,39 +319,39 @@ const ce = (e, t, r, i = void 0) => {
319
319
  [A, m == null ? void 0 : m.paginated, N]
320
320
  );
321
321
  if (fe(() => {
322
- if (!M) return;
322
+ if (!x) return;
323
323
  const d = (E) => {
324
324
  Q.current && !Q.current.contains(E.target) && O(!1);
325
325
  };
326
326
  return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
327
- }, [M]), fe(() => {
327
+ }, [x]), fe(() => {
328
328
  var d;
329
- M || ((d = J.current) == null || d.abort(), V(""), ee([]), Y(!1), b(null), re(!1), ne(!1), T.current = void 0);
330
- }, [M]), fe(() => {
331
- if (!M) return;
332
- if (!D && !v) {
329
+ x || ((d = J.current) == null || d.abort(), B(""), ee([]), Y(!1), b(null), re(!1), ne(!1), T.current = void 0);
330
+ }, [x]), fe(() => {
331
+ if (!x) return;
332
+ if (!F && !v) {
333
333
  ee([]), Y(!1), b(null), T.current = void 0;
334
334
  return;
335
335
  }
336
- H.current && clearTimeout(H.current);
337
- const d = D ? 300 : 0;
338
- return H.current = setTimeout(() => {
339
- ee([]), Y(!1), T.current = void 0, we(D);
336
+ _.current && clearTimeout(_.current);
337
+ const d = F ? 300 : 0;
338
+ return _.current = setTimeout(() => {
339
+ ee([]), Y(!1), T.current = void 0, we(F);
340
340
  }, d), () => {
341
- H.current && clearTimeout(H.current);
341
+ _.current && clearTimeout(_.current);
342
342
  };
343
- }, [D, M, v, we]), ce(a, r, t, w ? void 0 : null), a === !1)
343
+ }, [F, x, v, we]), ce(a, r, t, w ? void 0 : null), a === !1)
344
344
  return null;
345
345
  const Ee = () => {
346
- V(""), ee([]), Y(!1), b(null), T.current = void 0, O(!0);
346
+ B(""), ee([]), Y(!1), b(null), T.current = void 0, O(!0);
347
347
  }, De = (d) => {
348
- t(r, w ? { value: d.id, label: d.name } : d.id), U(d), K.current = { value: d.id, label: w ? d.name : void 0 }, O(!1);
348
+ t(r, w ? { value: d.id, label: d.name } : d.id), $(d), G.current = { value: d.id, label: w ? d.name : void 0 }, O(!1);
349
349
  }, Se = (d) => {
350
- d.stopPropagation(), t(r, w ? void 0 : null), U(void 0);
350
+ d.stopPropagation(), t(r, w ? void 0 : null), $(void 0);
351
351
  }, Fe = (d) => {
352
352
  (d.key === "Enter" || d.key === " ") && Se(d);
353
353
  }, Oe = ((Re = c == null ? void 0 : c.options) == null ? void 0 : Re.placeholder) ?? "Select an option";
354
- return /* @__PURE__ */ n(C, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
354
+ return /* @__PURE__ */ n(R, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
355
355
  /* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
356
356
  i,
357
357
  " ",
@@ -362,22 +362,22 @@ const ce = (e, t, r, i = void 0) => {
362
362
  ye.Root,
363
363
  {
364
364
  id: r,
365
- value: M ? D : (k == null ? void 0 : k.name) ?? "",
366
- placeholder: M && (m != null && m.searchable) ? "Search..." : Oe,
367
- disabled: !B,
368
- readOnly: M && !(m != null && m.searchable),
369
- style: j ? void 0 : { outline: "2px solid var(--red-7)", outlineOffset: "-1px" },
365
+ value: x ? F : (k == null ? void 0 : k.name) ?? "",
366
+ placeholder: x && (m != null && m.searchable) ? "Search..." : Oe,
367
+ disabled: !H,
368
+ readOnly: x && !(m != null && m.searchable),
369
+ style: W ? void 0 : { outline: "2px solid var(--red-7)", outlineOffset: "-1px" },
370
370
  onChange: (d) => {
371
- m != null && m.searchable && (V(d.target.value), M || Ee());
371
+ m != null && m.searchable && (B(d.target.value), x || Ee());
372
372
  },
373
373
  onFocus: () => {
374
- B && !M && Ee();
374
+ H && !x && Ee();
375
375
  },
376
376
  onKeyDown: (d) => {
377
377
  d.key === "Escape" && O(!1);
378
378
  },
379
379
  children: /* @__PURE__ */ n(ye.Slot, { side: "right", children: /* @__PURE__ */ g(S, { align: "center", gap: "1", children: [
380
- L && B && /* @__PURE__ */ n(
380
+ L && H && /* @__PURE__ */ n(
381
381
  "span",
382
382
  {
383
383
  role: "button",
@@ -393,14 +393,14 @@ const ce = (e, t, r, i = void 0) => {
393
393
  /* @__PURE__ */ n(
394
394
  zr,
395
395
  {
396
- style: { transform: M ? "rotate(180deg)" : void 0, transition: "transform 150ms" }
396
+ style: { transform: x ? "rotate(180deg)" : void 0, transition: "transform 150ms" }
397
397
  }
398
398
  )
399
399
  ] }) })
400
400
  }
401
401
  ),
402
- M && /* @__PURE__ */ n(
403
- C,
402
+ x && /* @__PURE__ */ n(
403
+ R,
404
404
  {
405
405
  style: {
406
406
  position: "absolute",
@@ -414,12 +414,12 @@ const ce = (e, t, r, i = void 0) => {
414
414
  border: "1px solid var(--gray-a6)",
415
415
  overflow: "hidden"
416
416
  },
417
- children: I ? /* @__PURE__ */ n(C, { p: "3", children: /* @__PURE__ */ n(h, { size: "2", color: "gray", children: I }) }) : /* @__PURE__ */ n(Lr, { style: { maxHeight: 240 }, children: /* @__PURE__ */ g(C, { p: "1", children: [
417
+ children: C ? /* @__PURE__ */ n(R, { p: "3", children: /* @__PURE__ */ n(h, { size: "2", color: "gray", children: C }) }) : /* @__PURE__ */ n(Lr, { style: { maxHeight: 240 }, children: /* @__PURE__ */ g(R, { p: "1", children: [
418
418
  Z && /* @__PURE__ */ n(S, { justify: "center", p: "4", children: /* @__PURE__ */ n(Me, {}) }),
419
- !Z && ue && /* @__PURE__ */ n(C, { px: "3", py: "2", children: /* @__PURE__ */ n(h, { size: "2", color: "red", children: ue }) }),
420
- !Z && !ue && oe.length === 0 && /* @__PURE__ */ n(C, { px: "3", py: "2", children: /* @__PURE__ */ n(h, { size: "2", color: "gray", children: D || v ? "No results found." : "Type to search…" }) }),
419
+ !Z && ue && /* @__PURE__ */ n(R, { px: "3", py: "2", children: /* @__PURE__ */ n(h, { size: "2", color: "red", children: ue }) }),
420
+ !Z && !ue && oe.length === 0 && /* @__PURE__ */ n(R, { px: "3", py: "2", children: /* @__PURE__ */ n(h, { size: "2", color: "gray", children: F || v ? "No results found." : "Type to search…" }) }),
421
421
  oe.map((d) => /* @__PURE__ */ n(
422
- C,
422
+ R,
423
423
  {
424
424
  px: "3",
425
425
  py: "2",
@@ -435,14 +435,14 @@ const ce = (e, t, r, i = void 0) => {
435
435
  },
436
436
  d.id
437
437
  )),
438
- (m == null ? void 0 : m.paginated) && le && !he && /* @__PURE__ */ n(C, { px: "3", py: "2", children: /* @__PURE__ */ n(
438
+ (m == null ? void 0 : m.paginated) && le && !he && /* @__PURE__ */ n(R, { px: "3", py: "2", children: /* @__PURE__ */ n(
439
439
  ke,
440
440
  {
441
441
  variant: "ghost",
442
442
  size: "1",
443
443
  style: { width: "100%" },
444
444
  onMouseDown: (d) => d.preventDefault(),
445
- onClick: () => void we(D, !0),
445
+ onClick: () => void we(F, !0),
446
446
  children: "Load more"
447
447
  }
448
448
  ) }),
@@ -451,10 +451,10 @@ const ce = (e, t, r, i = void 0) => {
451
451
  }
452
452
  )
453
453
  ] }),
454
- !j && /* @__PURE__ */ n(h, { color: "red", size: "1", children: ae(s, i) }),
454
+ !W && /* @__PURE__ */ n(h, { color: "red", size: "1", children: ae(s, i) }),
455
455
  o.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: o.description })
456
456
  ] }) });
457
- }, st = se(it), ct = W(
457
+ }, st = se(it), ct = K(
458
458
  3,
459
459
  ze((e) => {
460
460
  const t = e["x-search"];
@@ -462,7 +462,7 @@ const ce = (e, t, r, i = void 0) => {
462
462
  })
463
463
  ), at = (e, t) => $r(`${e}T${t}`).format(), ut = ({ path: e, label: t, required: r, errors: i, description: f, children: s }) => {
464
464
  const l = i.length === 0;
465
- return /* @__PURE__ */ n(C, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
465
+ return /* @__PURE__ */ n(R, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
466
466
  /* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", htmlFor: e, children: [
467
467
  t,
468
468
  " ",
@@ -502,12 +502,12 @@ const ce = (e, t, r, i = void 0) => {
502
502
  }
503
503
  )
504
504
  );
505
- const p = l.format === "date-time", [m = "", v = ""] = u.split("T"), N = v.slice(0, 5), A = (w, R) => {
505
+ const p = l.format === "date-time", [m = "", v = ""] = u.split("T"), N = v.slice(0, 5), A = (w, I) => {
506
506
  if (!w) {
507
507
  t(r, void 0);
508
508
  return;
509
509
  }
510
- t(r, p ? at(w, R || "00:00") : w);
510
+ t(r, p ? at(w, I || "00:00") : w);
511
511
  };
512
512
  return y(
513
513
  /* @__PURE__ */ g(S, { gap: "2", align: "center", children: [
@@ -536,7 +536,7 @@ const ce = (e, t, r, i = void 0) => {
536
536
  )
537
537
  ] })
538
538
  );
539
- }, ft = W(2, Le(Rr, Cr, Tr)), ht = se(dt), pt = ({
539
+ }, ft = K(2, Le(Rr, Cr, Tr)), ht = se(dt), pt = ({
540
540
  uischema: e,
541
541
  schema: t,
542
542
  path: r,
@@ -558,7 +558,7 @@ const ce = (e, t, r, i = void 0) => {
558
558
  },
559
559
  `${r}-${u}`
560
560
  )) });
561
- }, mt = W(1, Te("VerticalLayout")), gt = ({
561
+ }, mt = K(1, Te("VerticalLayout")), gt = ({
562
562
  uischema: e,
563
563
  schema: t,
564
564
  path: r,
@@ -568,7 +568,7 @@ const ce = (e, t, r, i = void 0) => {
568
568
  visible: l = !0
569
569
  }) => {
570
570
  const o = e.elements;
571
- return l === !1 ? null : /* @__PURE__ */ n(S, { direction: "row", gap: "4", children: o.map((c, u) => /* @__PURE__ */ n(C, { style: { flex: 1 }, children: /* @__PURE__ */ n(
571
+ return l === !1 ? null : /* @__PURE__ */ n(S, { direction: "row", gap: "4", children: o.map((c, u) => /* @__PURE__ */ n(R, { style: { flex: 1 }, children: /* @__PURE__ */ n(
572
572
  Ae,
573
573
  {
574
574
  uischema: c,
@@ -579,7 +579,7 @@ const ce = (e, t, r, i = void 0) => {
579
579
  enabled: s
580
580
  }
581
581
  ) }, `${r}-${u}`)) });
582
- }, yt = W(1, Te("HorizontalLayout")), vt = ({
582
+ }, yt = K(1, Te("HorizontalLayout")), vt = ({
583
583
  uischema: e,
584
584
  schema: t,
585
585
  path: r,
@@ -589,7 +589,7 @@ const ce = (e, t, r, i = void 0) => {
589
589
  visible: l = !0
590
590
  }) => {
591
591
  const a = e, o = a.elements;
592
- return l === !1 ? null : /* @__PURE__ */ g(C, { mb: "6", children: [
592
+ return l === !1 ? null : /* @__PURE__ */ g(R, { mb: "6", children: [
593
593
  a.label && /* @__PURE__ */ n(tr, { size: "3", mb: "3", className: "text-gray-500 uppercase tracking-wide font-semibold", children: a.label }),
594
594
  /* @__PURE__ */ n(S, { direction: "column", gap: "4", children: o.map((c, u) => /* @__PURE__ */ n(
595
595
  Ae,
@@ -604,7 +604,7 @@ const ce = (e, t, r, i = void 0) => {
604
604
  `${r}-${u}`
605
605
  )) })
606
606
  ] });
607
- }, bt = W(1, Te("Group")), wt = ({
607
+ }, bt = K(1, Te("Group")), wt = ({
608
608
  uischema: e,
609
609
  schema: t,
610
610
  path: r,
@@ -614,12 +614,12 @@ const ce = (e, t, r, i = void 0) => {
614
614
  visible: l = !0
615
615
  }) => {
616
616
  var p;
617
- const o = e.elements.filter((m) => m.type === "Category"), [c, u] = F(((p = o[0]) == null ? void 0 : p.label) || "");
617
+ const o = e.elements.filter((m) => m.type === "Category"), [c, u] = U(((p = o[0]) == null ? void 0 : p.label) || "");
618
618
  if (l === !1 || !o.length) return null;
619
619
  const y = o.find((m) => m.label === c) ? c : o[0].label;
620
620
  return /* @__PURE__ */ g(Ie.Root, { value: y, onValueChange: u, children: [
621
621
  /* @__PURE__ */ n(Ie.List, { children: o.map((m, v) => /* @__PURE__ */ n(Ie.Trigger, { value: m.label, children: m.label }, `${r}-${v}`)) }),
622
- /* @__PURE__ */ n(C, { pt: "3", children: o.map((m, v) => /* @__PURE__ */ n(Ie.Content, { value: m.label, children: /* @__PURE__ */ n(S, { direction: "column", gap: "4", children: m.elements.map((N, A) => /* @__PURE__ */ n(
622
+ /* @__PURE__ */ n(R, { pt: "3", children: o.map((m, v) => /* @__PURE__ */ n(Ie.Content, { value: m.label, children: /* @__PURE__ */ n(S, { direction: "column", gap: "4", children: m.elements.map((N, A) => /* @__PURE__ */ n(
623
623
  Ae,
624
624
  {
625
625
  uischema: N,
@@ -632,7 +632,7 @@ const ce = (e, t, r, i = void 0) => {
632
632
  `${r}-${v}-${A}`
633
633
  )) }) }, `${r}-${v}`)) })
634
634
  ] });
635
- }, Et = W(1, Te("Categorization"));
635
+ }, Et = K(1, Te("Categorization"));
636
636
  function me(e) {
637
637
  return e >= 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(0)} MB` : e >= 1024 ? `${(e / 1024).toFixed(0)} KB` : `${e} B`;
638
638
  }
@@ -663,80 +663,80 @@ const Ct = ({
663
663
  }) => {
664
664
  const u = Vr();
665
665
  ce(c, r, t, null);
666
- const y = !o || o.length === 0, p = (l == null ? void 0 : l["x-file"]) ?? {}, m = (s == null ? void 0 : s.options) ?? {}, v = p.maxFiles ?? m.maxFiles ?? 1, N = p.maxSize ?? m.maxSize ?? 5 * 1024 * 1024, A = p.accept ?? m.accept ?? "image/*,application/pdf", w = v > 1, R = a !== !1, [L, P] = F(!1), [I, B] = F(null), [j, M] = F({}), O = de(/* @__PURE__ */ new Set()), D = de(null), V = Rt(e), oe = V.length >= v;
666
+ const y = !o || o.length === 0, p = (l == null ? void 0 : l["x-file"]) ?? {}, m = (s == null ? void 0 : s.options) ?? {}, v = p.maxFiles ?? m.maxFiles ?? 1, N = p.maxSize ?? m.maxSize ?? 5 * 1024 * 1024, A = p.accept ?? m.accept ?? "image/*,application/pdf", w = v > 1, I = a !== !1, [L, D] = U(!1), [C, H] = U(null), [W, x] = U({}), O = de(/* @__PURE__ */ new Set()), F = de(null), B = Rt(e), oe = B.length >= v;
667
667
  fe(() => () => {
668
668
  O.current.forEach((b) => URL.revokeObjectURL(b)), O.current.clear();
669
669
  }, []);
670
670
  const ee = _e(
671
671
  async (b) => {
672
- if (B(null), V.length >= v) {
673
- B(`Maximum ${v} file${v > 1 ? "s" : ""} allowed.`);
672
+ if (H(null), B.length >= v) {
673
+ H(`Maximum ${v} file${v > 1 ? "s" : ""} allowed.`);
674
674
  return;
675
675
  }
676
676
  if (b.size > N) {
677
- B(`File exceeds the ${me(N)} limit.`);
677
+ H(`File exceeds the ${me(N)} limit.`);
678
678
  return;
679
679
  }
680
680
  if (!A.split(",").map((T) => T.trim()).some((T) => T === "*" || T === "*/*" ? !0 : T.endsWith("/*") ? b.type.startsWith(T.slice(0, -1)) : T.startsWith(".") ? b.name.toLowerCase().endsWith(T.toLowerCase()) : b.type === T)) {
681
- B(`Invalid type. Accepted: ${ge(A)}`);
681
+ H(`Invalid type. Accepted: ${ge(A)}`);
682
682
  return;
683
683
  }
684
684
  if (!(u != null && u.onUpload)) {
685
- B("Upload service not configured.");
685
+ H("Upload service not configured.");
686
686
  return;
687
687
  }
688
688
  try {
689
- const T = await u.onUpload(b), H = URL.createObjectURL(b);
690
- O.current.add(H);
691
- const J = { key: T.key, name: T.name ?? b.name, blobUrl: H };
692
- M((K) => ({ ...K, [T.key]: J }));
693
- const Q = [...V, T.key];
689
+ const T = await u.onUpload(b), _ = URL.createObjectURL(b);
690
+ O.current.add(_);
691
+ const J = { key: T.key, name: T.name ?? b.name, blobUrl: _ };
692
+ x((G) => ({ ...G, [T.key]: J }));
693
+ const Q = [...B, T.key];
694
694
  t(r, w ? Q : Q[0]);
695
695
  } catch {
696
- B("Upload failed. Please try again."), D.current && (D.current.value = "");
696
+ H("Upload failed. Please try again."), F.current && (F.current.value = "");
697
697
  }
698
698
  },
699
- [V, v, N, A, u, r, t, w]
699
+ [B, v, N, A, u, r, t, w]
700
700
  );
701
701
  if (c === !1)
702
702
  return null;
703
703
  const le = (b) => {
704
- b.preventDefault(), b.stopPropagation(), !(!R || oe) && P(b.type === "dragenter" || b.type === "dragover");
704
+ b.preventDefault(), b.stopPropagation(), !(!I || oe) && D(b.type === "dragenter" || b.type === "dragover");
705
705
  }, Y = (b) => {
706
706
  var k;
707
- b.preventDefault(), b.stopPropagation(), P(!1), !(!R || oe) && (k = b.dataTransfer.files) != null && k[0] && ee(b.dataTransfer.files[0]);
707
+ b.preventDefault(), b.stopPropagation(), D(!1), !(!I || oe) && (k = b.dataTransfer.files) != null && k[0] && ee(b.dataTransfer.files[0]);
708
708
  }, Z = (b) => {
709
709
  var k;
710
710
  (k = b.target.files) != null && k[0] && (ee(b.target.files[0]), b.target.value = "");
711
711
  }, re = (b) => {
712
- if (!R) return;
713
- M((U) => {
712
+ if (!I) return;
713
+ x(($) => {
714
714
  var J;
715
- const T = { ...U }, H = (J = T[b]) == null ? void 0 : J.blobUrl;
716
- return H && (URL.revokeObjectURL(H), O.current.delete(H)), delete T[b], T;
715
+ const T = { ...$ }, _ = (J = T[b]) == null ? void 0 : J.blobUrl;
716
+ return _ && (URL.revokeObjectURL(_), O.current.delete(_)), delete T[b], T;
717
717
  });
718
- const k = V.filter((U) => U !== b);
718
+ const k = B.filter(($) => $ !== b);
719
719
  t(r, w ? k.length > 0 ? k : null : k[0] ?? null);
720
720
  }, he = async (b, k) => {
721
- var H, J, Q;
721
+ var _, J, Q;
722
722
  b.preventDefault();
723
- const U = (H = j[k]) == null ? void 0 : H.blobUrl;
724
- if (U) {
725
- (J = window.open(U, "_blank", "noopener,noreferrer")) == null || J.focus();
723
+ const $ = (_ = W[k]) == null ? void 0 : _.blobUrl;
724
+ if ($) {
725
+ (J = window.open($, "_blank", "noopener,noreferrer")) == null || J.focus();
726
726
  return;
727
727
  }
728
728
  const T = window.open("", "_blank");
729
729
  if (T)
730
730
  try {
731
- const K = await ((Q = u == null ? void 0 : u.getDownloadUrl) == null ? void 0 : Q.call(u, k));
732
- K != null && K.url ? T.location.href = K.url : T.close();
731
+ const G = await ((Q = u == null ? void 0 : u.getDownloadUrl) == null ? void 0 : Q.call(u, k));
732
+ G != null && G.url ? T.location.href = G.url : T.close();
733
733
  } catch {
734
734
  T.close();
735
735
  }
736
736
  };
737
- if (!R && V.length === 0) return null;
738
- const ne = v - V.length, ue = R && !oe;
739
- return /* @__PURE__ */ g(C, { mb: "4", children: [
737
+ if (!I && B.length === 0) return null;
738
+ const ne = v - B.length, ue = I && !oe;
739
+ return /* @__PURE__ */ g(R, { mb: "4", children: [
740
740
  /* @__PURE__ */ g(S, { align: "center", justify: "between", mb: "2", children: [
741
741
  /* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", children: [
742
742
  i,
@@ -744,11 +744,11 @@ const Ct = ({
744
744
  ] }),
745
745
  /* @__PURE__ */ n(h, { size: "1", color: "gray", children: w ? `Up to ${v} files · ${me(N)} each · ${ge(A)}` : `${me(N)} · ${ge(A)}` })
746
746
  ] }),
747
- V.map((b) => {
747
+ B.map((b) => {
748
748
  var k;
749
749
  return /* @__PURE__ */ n(nr, { size: "2", variant: "surface", mb: "2", children: /* @__PURE__ */ g(S, { align: "center", gap: "3", children: [
750
750
  /* @__PURE__ */ n(
751
- C,
751
+ R,
752
752
  {
753
753
  style: {
754
754
  background: "var(--blue-3)",
@@ -760,7 +760,7 @@ const Ct = ({
760
760
  children: /* @__PURE__ */ n(Dr, { width: "20", height: "20" })
761
761
  }
762
762
  ),
763
- /* @__PURE__ */ n(C, { style: { flex: 1, overflow: "hidden" }, children: /* @__PURE__ */ n(
763
+ /* @__PURE__ */ n(R, { style: { flex: 1, overflow: "hidden" }, children: /* @__PURE__ */ n(
764
764
  h,
765
765
  {
766
766
  size: "2",
@@ -771,13 +771,13 @@ const Ct = ({
771
771
  textOverflow: "ellipsis",
772
772
  whiteSpace: "nowrap"
773
773
  },
774
- children: ((k = j[b]) == null ? void 0 : k.name) ?? "Uploaded File"
774
+ children: ((k = W[b]) == null ? void 0 : k.name) ?? "Uploaded File"
775
775
  }
776
776
  ) }),
777
777
  /* @__PURE__ */ g(S, { align: "center", gap: "2", style: { flexShrink: 0 }, children: [
778
- /* @__PURE__ */ n(ke, { variant: "soft", color: "blue", size: "1", onClick: (U) => he(U, b), children: "View" }),
778
+ /* @__PURE__ */ n(ke, { variant: "soft", color: "blue", size: "1", onClick: ($) => he($, b), children: "View" }),
779
779
  /* @__PURE__ */ n(Fr, { style: { color: "var(--green-9)", width: 18, height: 18 } }),
780
- R && /* @__PURE__ */ n(Ue, { variant: "ghost", color: "gray", onClick: () => re(b), children: /* @__PURE__ */ n(or, {}) })
780
+ I && /* @__PURE__ */ n(Ue, { variant: "ghost", color: "gray", onClick: () => re(b), children: /* @__PURE__ */ n(or, {}) })
781
781
  ] })
782
782
  ] }) }, b);
783
783
  }),
@@ -788,11 +788,11 @@ const Ct = ({
788
788
  tabIndex: 0,
789
789
  onClick: () => {
790
790
  var b;
791
- return (b = D.current) == null ? void 0 : b.click();
791
+ return (b = F.current) == null ? void 0 : b.click();
792
792
  },
793
793
  onKeyDown: (b) => {
794
794
  var k;
795
- (b.key === "Enter" || b.key === " ") && (b.preventDefault(), (k = D.current) == null || k.click());
795
+ (b.key === "Enter" || b.key === " ") && (b.preventDefault(), (k = F.current) == null || k.click());
796
796
  },
797
797
  onDragEnter: le,
798
798
  onDragLeave: le,
@@ -802,17 +802,17 @@ const Ct = ({
802
802
  className: [
803
803
  "border-2 border-dashed rounded-lg p-6 text-center",
804
804
  "transition-all duration-200 ease-in-out",
805
- L ? "border-blue-500 bg-blue-50" : I ? "border-red-300 bg-red-50" : "border-gray-300 hover:border-blue-400 hover:bg-gray-50"
805
+ L ? "border-blue-500 bg-blue-50" : C ? "border-red-300 bg-red-50" : "border-gray-300 hover:border-blue-400 hover:bg-gray-50"
806
806
  ].join(" "),
807
807
  children: [
808
- /* @__PURE__ */ n("input", { ref: D, type: "file", style: { display: "none" }, accept: A, onChange: Z }),
809
- /* @__PURE__ */ n(S, { direction: "column", align: "center", gap: "2", children: I ? /* @__PURE__ */ g(be, { children: [
808
+ /* @__PURE__ */ n("input", { ref: F, type: "file", style: { display: "none" }, accept: A, onChange: Z }),
809
+ /* @__PURE__ */ n(S, { direction: "column", align: "center", gap: "2", children: C ? /* @__PURE__ */ g(be, { children: [
810
810
  /* @__PURE__ */ n(lr, { style: { width: 32, height: 32, color: "var(--red-9)" } }),
811
- /* @__PURE__ */ n(h, { size: "2", color: "red", weight: "medium", children: I }),
811
+ /* @__PURE__ */ n(h, { size: "2", color: "red", weight: "medium", children: C }),
812
812
  /* @__PURE__ */ n(h, { size: "1", color: "gray", children: "Click to try again" })
813
813
  ] }) : /* @__PURE__ */ g(be, { children: [
814
814
  /* @__PURE__ */ n(He, { style: { width: 32, height: 32, color: "var(--gray-8)" } }),
815
- /* @__PURE__ */ n(h, { size: "2", weight: "medium", children: V.length > 0 ? `Add another file (${ne} remaining)` : "Click to upload or drag and drop" }),
815
+ /* @__PURE__ */ n(h, { size: "2", weight: "medium", children: B.length > 0 ? `Add another file (${ne} remaining)` : "Click to upload or drag and drop" }),
816
816
  /* @__PURE__ */ g(h, { size: "1", color: "gray", children: [
817
817
  me(N),
818
818
  " max · ",
@@ -822,14 +822,14 @@ const Ct = ({
822
822
  ]
823
823
  }
824
824
  ),
825
- R && oe && w && /* @__PURE__ */ g(h, { size: "1", color: "gray", mt: "1", style: { display: "block", textAlign: "center" }, children: [
825
+ I && oe && w && /* @__PURE__ */ g(h, { size: "1", color: "gray", mt: "1", style: { display: "block", textAlign: "center" }, children: [
826
826
  "Maximum ",
827
827
  v,
828
828
  " files uploaded. Remove one to replace it."
829
829
  ] }),
830
830
  !y && /* @__PURE__ */ n(h, { color: "red", size: "1", mt: "2", style: { display: "block" }, children: ae(o, i) })
831
831
  ] });
832
- }, Tt = se(Ct), At = W(
832
+ }, Tt = se(Ct), At = K(
833
833
  10,
834
834
  // high rank to beat default array renderer
835
835
  Ar(
@@ -872,7 +872,7 @@ function Nt(e) {
872
872
  }
873
873
  return r;
874
874
  }
875
- class X extends Error {
875
+ class j extends Error {
876
876
  constructor(r, i) {
877
877
  super(i ?? r);
878
878
  Pe(this, "code");
@@ -949,7 +949,7 @@ function Ft(e) {
949
949
  for (; (r = Be.exec(t)) !== null; ) {
950
950
  const i = r[1].toUpperCase();
951
951
  if (!zt.has(i))
952
- throw new X("NAME", `Function ${i} is not allowed.`);
952
+ throw new j("NAME", `Function ${i} is not allowed.`);
953
953
  }
954
954
  }
955
955
  function Ut(e, t, r) {
@@ -967,20 +967,20 @@ function pe(e) {
967
967
  const t = cr(e);
968
968
  return Array.isArray(t) ? t.flat(1 / 0) : [t];
969
969
  }
970
- function x(e) {
970
+ function M(e) {
971
971
  const t = cr(e);
972
972
  return Array.isArray(t) ? t.flat(1 / 0)[0] : t;
973
973
  }
974
974
  function xe(e) {
975
- return e === void 0 ? void 0 : x(e);
975
+ return e === void 0 ? void 0 : M(e);
976
976
  }
977
- function G(e) {
977
+ function X(e) {
978
978
  return e == null || e === "" ? "" : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : e instanceof Date ? e.toLocaleDateString() : String(e);
979
979
  }
980
980
  function Ht(e, t) {
981
981
  return e instanceof t ? e : new t(e.message || "#ERROR!");
982
982
  }
983
- function _(e) {
983
+ function V(e) {
984
984
  return e.find((t) => t instanceof Error);
985
985
  }
986
986
  function $t(e, t) {
@@ -989,15 +989,15 @@ function $t(e, t) {
989
989
  }, i = (s, { checkArgsForErrors: l = !0 } = {}) => (...a) => {
990
990
  const o = a.flatMap(pe);
991
991
  if (l) {
992
- const u = _(o);
992
+ const u = V(o);
993
993
  u && r(u);
994
994
  }
995
995
  const c = s(...o);
996
996
  return c instanceof Error ? r(c) : c;
997
997
  }, f = (s, { toText: l = !1 } = {}) => (a) => {
998
- const o = x(a), c = _([o]);
998
+ const o = M(a), c = V([o]);
999
999
  c && r(c);
1000
- const u = s(l ? G(o) : o);
1000
+ const u = s(l ? X(o) : o);
1001
1001
  return u instanceof Error ? r(u) : u;
1002
1002
  };
1003
1003
  return {
@@ -1022,25 +1022,25 @@ function $t(e, t) {
1022
1022
  // the other aggregates use.
1023
1023
  COUNTA: i(e.COUNTA, { checkArgsForErrors: !1 }),
1024
1024
  LARGE: (s, l) => {
1025
- const a = pe(s), o = x(l), c = _([...a, o]);
1025
+ const a = pe(s), o = M(l), c = V([...a, o]);
1026
1026
  c && r(c);
1027
1027
  const u = e.LARGE(a, o);
1028
1028
  return u instanceof Error ? r(u) : u;
1029
1029
  },
1030
1030
  SMALL: (s, l) => {
1031
- const a = pe(s), o = x(l), c = _([...a, o]);
1031
+ const a = pe(s), o = M(l), c = V([...a, o]);
1032
1032
  c && r(c);
1033
1033
  const u = e.SMALL(a, o);
1034
1034
  return u instanceof Error ? r(u) : u;
1035
1035
  },
1036
1036
  PERMUT: (s, l) => {
1037
- const a = [x(s), x(l)], o = _(a);
1037
+ const a = [M(s), M(l)], o = V(a);
1038
1038
  o && r(o);
1039
1039
  const c = e.PERMUT(a[0], a[1]);
1040
1040
  return c instanceof Error ? r(c) : c;
1041
1041
  },
1042
1042
  PERMUTATIONA: (s, l) => {
1043
- const a = [x(s), x(l)], o = _(a);
1043
+ const a = [M(s), M(l)], o = V(a);
1044
1044
  o && r(o);
1045
1045
  const c = e.PERMUTATIONA(a[0], a[1]);
1046
1046
  return c instanceof Error ? r(c) : c;
@@ -1052,27 +1052,27 @@ function $t(e, t) {
1052
1052
  // real-world data. Same scope decision as the hand-rolled engine this
1053
1053
  // replaces, carried forward deliberately rather than dropped.
1054
1054
  MATCH: (s, l) => {
1055
- const a = x(s), o = pe(l), c = _([a, ...o]);
1055
+ const a = M(s), o = pe(l), c = V([a, ...o]);
1056
1056
  c && r(c);
1057
1057
  const u = e.MATCH(a, o, 0);
1058
1058
  return u instanceof Error ? r(u) : u;
1059
1059
  },
1060
1060
  SWITCH: (...s) => {
1061
- const l = s.map(x), a = _(l);
1061
+ const l = s.map(M), a = V(l);
1062
1062
  a && r(a);
1063
1063
  const o = e.SWITCH(...l);
1064
1064
  return o instanceof Error ? r(o) : o;
1065
1065
  },
1066
1066
  SUBSTITUTE: (s, l, a, o) => {
1067
- const c = [G(x(s)), G(x(l)), G(x(a))];
1068
- o !== void 0 && c.push(x(o));
1069
- const u = _(c);
1067
+ const c = [X(M(s)), X(M(l)), X(M(a))];
1068
+ o !== void 0 && c.push(M(o));
1069
+ const u = V(c);
1070
1070
  u && r(u);
1071
1071
  const y = e.SUBSTITUTE(...c);
1072
1072
  return y instanceof Error ? r(y) : y;
1073
1073
  },
1074
1074
  TEXTJOIN: (s, l, ...a) => {
1075
- const o = G(x(s)), c = x(l), u = a.flatMap(pe).map(G), y = _([o, c]);
1075
+ const o = X(M(s)), c = M(l), u = a.flatMap(pe).map(X), y = V([o, c]);
1076
1076
  y && r(y);
1077
1077
  const p = e.TEXTJOIN(o, c, u);
1078
1078
  return p instanceof Error ? r(p) : p;
@@ -1084,7 +1084,7 @@ function $t(e, t) {
1084
1084
  MONTH: f(e.MONTH),
1085
1085
  DAY: f(e.DAY),
1086
1086
  WEEKDAY: (s, l) => {
1087
- const a = x(s), o = x(l), c = _([a]);
1087
+ const a = M(s), o = M(l), c = V([a]);
1088
1088
  c && r(c);
1089
1089
  const u = e.WEEKDAY(a, o);
1090
1090
  return u instanceof Error ? r(u) : u;
@@ -1099,48 +1099,48 @@ function $t(e, t) {
1099
1099
  // separator, matching Excel's own range-argument behavior — the native
1100
1100
  // implementation instead inserts stray commas for a whole-range argument.
1101
1101
  CONCATENATE: (...s) => {
1102
- const l = s.flatMap(pe), a = _(l);
1102
+ const l = s.flatMap(pe), a = V(l);
1103
1103
  a && r(a);
1104
- const o = e.CONCATENATE(...l.map(G));
1104
+ const o = e.CONCATENATE(...l.map(X));
1105
1105
  return o instanceof Error ? r(o) : o;
1106
1106
  },
1107
1107
  CONCAT: (...s) => {
1108
- const l = s.flatMap(pe), a = _(l);
1108
+ const l = s.flatMap(pe), a = V(l);
1109
1109
  a && r(a);
1110
- const o = e.CONCAT(...l.map(G));
1110
+ const o = e.CONCAT(...l.map(X));
1111
1111
  return o instanceof Error ? r(o) : o;
1112
1112
  },
1113
1113
  LEN: f(e.LEN, { toText: !0 }),
1114
1114
  TRIM: f(e.TRIM, { toText: !0 }),
1115
1115
  LOWER: f(e.LOWER, { toText: !0 }),
1116
1116
  LEFT: (s, l) => {
1117
- const a = x(s), o = xe(l), c = _([a]);
1117
+ const a = M(s), o = xe(l), c = V([a]);
1118
1118
  c && r(c);
1119
- const u = e.LEFT(G(a), o);
1119
+ const u = e.LEFT(X(a), o);
1120
1120
  return u instanceof Error ? r(u) : u;
1121
1121
  },
1122
1122
  RIGHT: (s, l) => {
1123
- const a = x(s), o = xe(l), c = _([a]);
1123
+ const a = M(s), o = xe(l), c = V([a]);
1124
1124
  c && r(c);
1125
- const u = e.RIGHT(G(a), o);
1125
+ const u = e.RIGHT(X(a), o);
1126
1126
  return u instanceof Error ? r(u) : u;
1127
1127
  },
1128
1128
  MID: (s, l, a) => {
1129
- const o = x(s), c = x(l), u = x(a), y = _([o, c, u]);
1129
+ const o = M(s), c = M(l), u = M(a), y = V([o, c, u]);
1130
1130
  y && r(y);
1131
- const p = e.MID(G(o), c, u);
1131
+ const p = e.MID(X(o), c, u);
1132
1132
  return p instanceof Error ? r(p) : p;
1133
1133
  },
1134
1134
  FIND: (s, l, a) => {
1135
- const o = x(s), c = x(l), u = xe(a), y = _([o, c]);
1135
+ const o = M(s), c = M(l), u = xe(a), y = V([o, c]);
1136
1136
  y && r(y);
1137
- const p = e.FIND(G(o), G(c), u);
1137
+ const p = e.FIND(X(o), X(c), u);
1138
1138
  return p instanceof Error ? r(p) : p;
1139
1139
  },
1140
1140
  SEARCH: (s, l, a) => {
1141
- const o = x(s), c = x(l), u = xe(a), y = _([o, c]);
1141
+ const o = M(s), c = M(l), u = xe(a), y = V([o, c]);
1142
1142
  y && r(y);
1143
- const p = e.SEARCH(G(o), G(c), u);
1143
+ const p = e.SEARCH(X(o), X(c), u);
1144
1144
  return p instanceof Error ? r(p) : p;
1145
1145
  }
1146
1146
  };
@@ -1158,12 +1158,12 @@ function Ke(e) {
1158
1158
  return _t[e.error] ?? "ERROR";
1159
1159
  }
1160
1160
  function Ge(e, t) {
1161
- if (e instanceof X) return e;
1161
+ if (e instanceof j) return e;
1162
1162
  if (e instanceof t) {
1163
1163
  const r = e.details;
1164
- return r instanceof X ? r : r instanceof t ? new X(Ke(r), r.message) : new X(Ke(e), e.message);
1164
+ return r instanceof j ? r : r instanceof t ? new j(Ke(r), r.message) : new j(Ke(e), e.message);
1165
1165
  }
1166
- return new X("ERROR", e instanceof Error ? e.message : void 0);
1166
+ return new j("ERROR", e instanceof Error ? e.message : void 0);
1167
1167
  }
1168
1168
  function Pt(e) {
1169
1169
  return Math.max(0, ...e.map((t) => (t == null ? void 0 : t.length) ?? 0));
@@ -1172,7 +1172,7 @@ function Vt(e) {
1172
1172
  return (t) => {
1173
1173
  const r = e[t.row - 1];
1174
1174
  if (t.row < 1 || t.col < 1 || r == null || t.col - 1 >= r.length)
1175
- throw new X("REF");
1175
+ throw new j("REF");
1176
1176
  const i = r[t.col - 1];
1177
1177
  return i == null || i === "" ? null : i;
1178
1178
  };
@@ -1181,7 +1181,7 @@ function Wt(e) {
1181
1181
  return (t) => {
1182
1182
  const r = Math.min(t.from.row, t.to.row), i = Math.min(t.from.col, t.to.col), f = Math.max(t.from.row, t.to.row), s = Math.max(t.from.col, t.to.col), l = Pt(e);
1183
1183
  if (r > e.length || i > l)
1184
- throw new X("REF");
1184
+ throw new j("REF");
1185
1185
  const a = Math.min(f, e.length), o = [];
1186
1186
  for (let c = r; c <= a; c++) {
1187
1187
  const u = e[c - 1], y = [];
@@ -1201,12 +1201,12 @@ function Bt(e) {
1201
1201
  if (e == null || e === "") return null;
1202
1202
  if (typeof e == "number" || typeof e == "string" || typeof e == "boolean" || e instanceof Date)
1203
1203
  return e;
1204
- throw new X("VALUE");
1204
+ throw new j("VALUE");
1205
1205
  }
1206
1206
  async function ar(e, t) {
1207
- if (typeof e != "string") throw new X("ERROR");
1207
+ if (typeof e != "string") throw new j("ERROR");
1208
1208
  const r = e.trim();
1209
- if (r === "") throw new X("ERROR");
1209
+ if (r === "") throw new j("ERROR");
1210
1210
  const i = r.startsWith("=") ? r.slice(1) : r;
1211
1211
  Ft(i);
1212
1212
  const [f, s] = await Promise.all([
@@ -1240,10 +1240,10 @@ async function Gt(e, t) {
1240
1240
  },
1241
1241
  onCell: (i) => {
1242
1242
  if (i.row === Xe) return e[r[i.col - 1]] ?? null;
1243
- throw new X("REF");
1243
+ throw new j("REF");
1244
1244
  },
1245
1245
  onRange: () => {
1246
- throw new X("REF");
1246
+ throw new j("REF");
1247
1247
  }
1248
1248
  });
1249
1249
  }
@@ -1258,7 +1258,7 @@ const ur = {
1258
1258
  NULL: "#NULL!"
1259
1259
  };
1260
1260
  function dr(e) {
1261
- const t = e instanceof X ? e.code : "ERROR";
1261
+ const t = e instanceof j ? e.code : "ERROR";
1262
1262
  return ur[t];
1263
1263
  }
1264
1264
  async function Xt(e, t) {
@@ -1271,7 +1271,7 @@ async function Xt(e, t) {
1271
1271
  t.map(async (r) => {
1272
1272
  try {
1273
1273
  if (!r || typeof r.label != "string" || typeof r.expression != "string" || typeof r.id != "string")
1274
- throw new X("ERROR");
1274
+ throw new j("ERROR");
1275
1275
  return { id: r.id, label: r.label, value: await Kt(e, r.expression) };
1276
1276
  } catch (i) {
1277
1277
  return {
@@ -1353,9 +1353,9 @@ const rn = ({
1353
1353
  visible: c = !0
1354
1354
  }) => {
1355
1355
  ce(c, r, t, null);
1356
- const u = !o || o.length === 0, y = St(l, a), p = (s == null ? void 0 : s["x-spreadsheet"]) ?? {}, m = (s == null ? void 0 : s["x-evaluate"]) ?? en, v = p.accept ?? Zt, N = p.maxSize ?? Qt, A = p.persistSheet !== !1, w = p.columnHeader === !0, R = p.rowHeader === !0, L = p.showSheet !== !1, P = p.sheetName, I = e ?? null, [B, j] = F(
1357
- () => I != null && I.sheet || Object.keys((I == null ? void 0 : I.derivations) ?? {}).length > 0 ? "ready" : "empty"
1358
- ), [M, O] = F(null), [D, V] = F(!1), [oe, ee] = F(null), le = de(null), Y = (I == null ? void 0 : I.sheet) ?? null, Z = oe ?? (Y && !je(Y) ? Y : null), re = oe == null && Y && je(Y) ? Y : null, he = (I == null ? void 0 : I.derivations) ?? {}, ne = Z != null || I != null, ue = _e(
1356
+ const u = !o || o.length === 0, y = St(l, a), p = (s == null ? void 0 : s["x-spreadsheet"]) ?? {}, m = (s == null ? void 0 : s["x-evaluate"]) ?? en, v = p.accept ?? Zt, N = p.maxSize ?? Qt, A = p.persistSheet !== !1, w = p.columnHeader === !0, I = p.rowHeader === !0, L = p.showSheet !== !1, D = p.sheetName, C = e ?? null, [H, W] = U(
1357
+ () => C != null && C.sheet || Object.keys((C == null ? void 0 : C.derivations) ?? {}).length > 0 ? "ready" : "empty"
1358
+ ), [x, O] = U(null), [F, B] = U(!1), [oe, ee] = U(null), le = de(null), Y = (C == null ? void 0 : C.sheet) ?? null, Z = oe ?? (Y && !je(Y) ? Y : null), re = oe == null && Y && je(Y) ? Y : null, he = (C == null ? void 0 : C.derivations) ?? {}, ne = Z != null || C != null, ue = _e(
1359
1359
  async (d) => {
1360
1360
  if (O(null), d.size > N) {
1361
1361
  O(`File exceeds the ${me(N)} limit.`);
@@ -1365,13 +1365,13 @@ const rn = ({
1365
1365
  O(`Invalid type. Accepted: ${ge(v)}`);
1366
1366
  return;
1367
1367
  }
1368
- j("parsing");
1368
+ W("parsing");
1369
1369
  let te;
1370
1370
  try {
1371
1371
  const z = await d.arrayBuffer();
1372
- te = Ot(z, P).matrix;
1372
+ te = Ot(z, D).matrix;
1373
1373
  } catch (z) {
1374
- j("error"), O(
1374
+ W("error"), O(
1375
1375
  z instanceof $e ? z.message : "This doesn't look like a valid spreadsheet. Please check the file and try again."
1376
1376
  );
1377
1377
  return;
@@ -1379,38 +1379,38 @@ const rn = ({
1379
1379
  ee(te);
1380
1380
  let ie;
1381
1381
  try {
1382
- ie = await qt(te, m, { persistSheet: A, columnHeader: w, rowHeader: R });
1382
+ ie = await qt(te, m, { persistSheet: A, columnHeader: w, rowHeader: I });
1383
1383
  } catch (z) {
1384
- j("error"), O(z instanceof Error ? z.message : "Failed to process the uploaded spreadsheet.");
1384
+ W("error"), O(z instanceof Error ? z.message : "Failed to process the uploaded spreadsheet.");
1385
1385
  return;
1386
1386
  }
1387
- t(r, ie), j("ready");
1387
+ t(r, ie), W("ready");
1388
1388
  },
1389
- [v, N, A, w, R, P, m, r, t]
1389
+ [v, N, A, w, I, D, m, r, t]
1390
1390
  );
1391
1391
  if (c === !1)
1392
1392
  return null;
1393
- if (w && R)
1394
- return /* @__PURE__ */ g(C, { mb: "4", children: [
1393
+ if (w && I)
1394
+ return /* @__PURE__ */ g(R, { mb: "4", children: [
1395
1395
  /* @__PURE__ */ n(h, { as: "label", size: "2", weight: "bold", children: i }),
1396
1396
  /* @__PURE__ */ n(h, { size: "2", color: "red", style: { display: "block" }, children: "Invalid x-spreadsheet config: columnHeader and rowHeader cannot both be true — pick one orientation." })
1397
1397
  ] });
1398
1398
  if (!y && !ne) return null;
1399
1399
  const b = (d) => {
1400
- d.preventDefault(), d.stopPropagation(), y && V(d.type === "dragenter" || d.type === "dragover");
1400
+ d.preventDefault(), d.stopPropagation(), y && B(d.type === "dragenter" || d.type === "dragover");
1401
1401
  }, k = (d) => {
1402
1402
  var E;
1403
- d.preventDefault(), d.stopPropagation(), V(!1), y && (E = d.dataTransfer.files) != null && E[0] && ue(d.dataTransfer.files[0]);
1404
- }, U = (d) => {
1403
+ d.preventDefault(), d.stopPropagation(), B(!1), y && (E = d.dataTransfer.files) != null && E[0] && ue(d.dataTransfer.files[0]);
1404
+ }, $ = (d) => {
1405
1405
  var E;
1406
1406
  (E = d.target.files) != null && E[0] && (ue(d.target.files[0]), d.target.value = "");
1407
1407
  }, T = () => {
1408
- y && (ee(null), O(null), j("empty"), t(r, null));
1409
- }, H = w ? 1 : 0, J = R ? 1 : 0, Q = Z ? Z.slice(H) : [], K = Q.slice(0, ve), we = Math.min(
1408
+ y && (ee(null), O(null), W("empty"), t(r, null));
1409
+ }, _ = w ? 1 : 0, J = I ? 1 : 0, Q = Z ? Z.slice(_) : [], G = Q.slice(0, ve), we = Math.min(
1410
1410
  Ye,
1411
- Math.max(0, ...K.map((d) => Math.max(0, d.length - J)))
1412
- ), Ee = Array.from({ length: we }, (d, E) => E + J), De = L && Z == null && re == null && I != null, Se = "", Fe = R && !w, Oe = re ? re.slice(0, ve) : [], Re = Array.from(new Set(Oe.flatMap((d) => Object.keys(d)))).slice(0, Ye);
1413
- return /* @__PURE__ */ g(C, { mb: "4", children: [
1411
+ Math.max(0, ...G.map((d) => Math.max(0, d.length - J)))
1412
+ ), Ee = Array.from({ length: we }, (d, E) => E + J), De = L && Z == null && re == null && C != null, Se = "", Fe = I && !w, Oe = re ? re.slice(0, ve) : [], Re = Array.from(new Set(Oe.flatMap((d) => Object.keys(d)))).slice(0, Ye);
1413
+ return /* @__PURE__ */ g(R, { mb: "4", children: [
1414
1414
  /* @__PURE__ */ g(S, { align: "center", justify: "between", mb: "2", children: [
1415
1415
  /* @__PURE__ */ g(S, { align: "center", gap: "1", children: [
1416
1416
  /* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", children: [
@@ -1450,8 +1450,8 @@ const rn = ({
1450
1450
  ge(v)
1451
1451
  ] })
1452
1452
  ] }),
1453
- ne && M && /* @__PURE__ */ n(h, { size: "2", color: "red", mb: "2", style: { display: "block" }, children: M }),
1454
- /* @__PURE__ */ n("input", { ref: le, type: "file", style: { display: "none" }, accept: v, onChange: U }),
1453
+ ne && x && /* @__PURE__ */ n(h, { size: "2", color: "red", mb: "2", style: { display: "block" }, children: x }),
1454
+ /* @__PURE__ */ n("input", { ref: le, type: "file", style: { display: "none" }, accept: v, onChange: $ }),
1455
1455
  y && !ne && /* @__PURE__ */ n(
1456
1456
  "div",
1457
1457
  {
@@ -1473,14 +1473,14 @@ const rn = ({
1473
1473
  className: [
1474
1474
  "border-2 border-dashed rounded-lg p-6 text-center",
1475
1475
  "transition-all duration-200 ease-in-out",
1476
- D ? "border-blue-500 bg-blue-50" : M ? "border-red-300 bg-red-50" : "border-gray-300 hover:border-blue-400 hover:bg-gray-50"
1476
+ F ? "border-blue-500 bg-blue-50" : x ? "border-red-300 bg-red-50" : "border-gray-300 hover:border-blue-400 hover:bg-gray-50"
1477
1477
  ].join(" "),
1478
- children: /* @__PURE__ */ n(S, { direction: "column", align: "center", gap: "2", children: B === "parsing" ? /* @__PURE__ */ g(be, { children: [
1478
+ children: /* @__PURE__ */ n(S, { direction: "column", align: "center", gap: "2", children: H === "parsing" ? /* @__PURE__ */ g(be, { children: [
1479
1479
  /* @__PURE__ */ n(Me, { size: "3" }),
1480
1480
  /* @__PURE__ */ n(h, { size: "2", color: "gray", children: "Parsing spreadsheet…" })
1481
- ] }) : M ? /* @__PURE__ */ g(be, { children: [
1481
+ ] }) : x ? /* @__PURE__ */ g(be, { children: [
1482
1482
  /* @__PURE__ */ n(lr, { style: { width: 32, height: 32, color: "var(--red-9)" } }),
1483
- /* @__PURE__ */ n(h, { size: "2", color: "red", weight: "medium", children: M }),
1483
+ /* @__PURE__ */ n(h, { size: "2", color: "red", weight: "medium", children: x }),
1484
1484
  /* @__PURE__ */ n(h, { size: "1", color: "gray", children: "Click to try again" })
1485
1485
  ] }) : /* @__PURE__ */ g(be, { children: [
1486
1486
  /* @__PURE__ */ n(He, { style: { width: 32, height: 32, color: "var(--gray-8)" } }),
@@ -1493,10 +1493,10 @@ const rn = ({
1493
1493
  ] }) })
1494
1494
  }
1495
1495
  ),
1496
- Z && L && /* @__PURE__ */ g(C, { mt: "3", children: [
1497
- /* @__PURE__ */ n(C, { style: { overflow: "auto", maxHeight: 420 }, children: /* @__PURE__ */ g($.Root, { variant: "surface", size: "1", children: [
1498
- !Fe && /* @__PURE__ */ n($.Header, { children: /* @__PURE__ */ g($.Row, { children: [
1499
- /* @__PURE__ */ n($.ColumnHeaderCell, { children: Se }),
1496
+ Z && L && /* @__PURE__ */ g(R, { mt: "3", children: [
1497
+ /* @__PURE__ */ n(R, { style: { overflow: "auto", maxHeight: 420 }, children: /* @__PURE__ */ g(P.Root, { variant: "surface", size: "1", children: [
1498
+ !Fe && /* @__PURE__ */ n(P.Header, { children: /* @__PURE__ */ g(P.Row, { children: [
1499
+ /* @__PURE__ */ n(P.ColumnHeaderCell, { children: Se }),
1500
1500
  Ee.map((d) => {
1501
1501
  var E;
1502
1502
  return (
@@ -1504,22 +1504,22 @@ const rn = ({
1504
1504
  // flag set (see suppressColumnHeaderRow) — so reaching
1505
1505
  // here, either columnHeader is true (real labels) or
1506
1506
  // both are false (columnLetter fallback).
1507
- /* @__PURE__ */ n($.ColumnHeaderCell, { children: w ? Ce((E = Z[0]) == null ? void 0 : E[d]) : Nt(d) }, d)
1507
+ /* @__PURE__ */ n(P.ColumnHeaderCell, { children: w ? Ce((E = Z[0]) == null ? void 0 : E[d]) : Nt(d) }, d)
1508
1508
  );
1509
1509
  })
1510
1510
  ] }) }),
1511
- /* @__PURE__ */ n($.Body, { children: K.map((d, E) => {
1511
+ /* @__PURE__ */ n(P.Body, { children: G.map((d, E) => {
1512
1512
  var te;
1513
- const q = H + E;
1514
- return /* @__PURE__ */ g($.Row, { children: [
1513
+ const q = _ + E;
1514
+ return /* @__PURE__ */ g(P.Row, { children: [
1515
1515
  /* @__PURE__ */ n(
1516
- $.RowHeaderCell,
1516
+ P.RowHeaderCell,
1517
1517
  {
1518
- style: R ? { fontWeight: 700, background: "var(--gray-a3)" } : void 0,
1519
- children: R ? Ce((te = Z[q]) == null ? void 0 : te[0]) : w ? "" : q + 1
1518
+ style: I ? { fontWeight: 700, background: "var(--gray-a3)" } : void 0,
1519
+ children: I ? Ce((te = Z[q]) == null ? void 0 : te[0]) : w ? "" : q + 1
1520
1520
  }
1521
1521
  ),
1522
- Ee.map((ie) => /* @__PURE__ */ n($.Cell, { children: Ce(d[ie]) }, ie))
1522
+ Ee.map((ie) => /* @__PURE__ */ n(P.Cell, { children: Ce(d[ie]) }, ie))
1523
1523
  ] }, E);
1524
1524
  }) })
1525
1525
  ] }) }),
@@ -1531,15 +1531,15 @@ const rn = ({
1531
1531
  " rows"
1532
1532
  ] })
1533
1533
  ] }),
1534
- re && L && /* @__PURE__ */ g(C, { mt: "3", children: [
1535
- /* @__PURE__ */ n(C, { style: { overflow: "auto", maxHeight: 420 }, children: /* @__PURE__ */ g($.Root, { variant: "surface", size: "1", children: [
1536
- /* @__PURE__ */ n($.Header, { children: /* @__PURE__ */ g($.Row, { children: [
1537
- /* @__PURE__ */ n($.ColumnHeaderCell, {}),
1538
- Re.map((d) => /* @__PURE__ */ n($.ColumnHeaderCell, { children: d }, d))
1534
+ re && L && /* @__PURE__ */ g(R, { mt: "3", children: [
1535
+ /* @__PURE__ */ n(R, { style: { overflow: "auto", maxHeight: 420 }, children: /* @__PURE__ */ g(P.Root, { variant: "surface", size: "1", children: [
1536
+ /* @__PURE__ */ n(P.Header, { children: /* @__PURE__ */ g(P.Row, { children: [
1537
+ /* @__PURE__ */ n(P.ColumnHeaderCell, {}),
1538
+ Re.map((d) => /* @__PURE__ */ n(P.ColumnHeaderCell, { children: d }, d))
1539
1539
  ] }) }),
1540
- /* @__PURE__ */ n($.Body, { children: Oe.map((d, E) => /* @__PURE__ */ g($.Row, { children: [
1541
- /* @__PURE__ */ n($.RowHeaderCell, { children: E + 1 }),
1542
- Re.map((q) => /* @__PURE__ */ n($.Cell, { children: Ce(d[q]) }, q))
1540
+ /* @__PURE__ */ n(P.Body, { children: Oe.map((d, E) => /* @__PURE__ */ g(P.Row, { children: [
1541
+ /* @__PURE__ */ n(P.RowHeaderCell, { children: E + 1 }),
1542
+ Re.map((q) => /* @__PURE__ */ n(P.Cell, { children: Ce(d[q]) }, q))
1543
1543
  ] }, E)) })
1544
1544
  ] }) }),
1545
1545
  re.length > ve && /* @__PURE__ */ g(h, { size: "1", color: "gray", mt: "1", style: { display: "block" }, children: [
@@ -1551,7 +1551,7 @@ const rn = ({
1551
1551
  ] })
1552
1552
  ] }),
1553
1553
  De && /* @__PURE__ */ n(h, { size: "2", color: "gray", mt: "3", style: { display: "block" }, children: "Sheet preview not stored for this field — re-upload to view contents." }),
1554
- Object.keys(he).length > 0 && /* @__PURE__ */ g(C, { mt: "3", children: [
1554
+ Object.keys(he).length > 0 && /* @__PURE__ */ g(R, { mt: "3", children: [
1555
1555
  /* @__PURE__ */ n(h, { size: "2", weight: "bold", as: "div", mb: "1", children: "Computed values" }),
1556
1556
  /* @__PURE__ */ n(S, { direction: "column", gap: "1", children: Object.entries(he).map(([d, E]) => /* @__PURE__ */ g(S, { justify: "between", children: [
1557
1557
  /* @__PURE__ */ n(h, { size: "2", children: E.label }),
@@ -1567,7 +1567,7 @@ const rn = ({
1567
1567
  ] }),
1568
1568
  !u && /* @__PURE__ */ n(h, { color: "red", size: "1", mt: "2", style: { display: "block" }, children: ae(o, i) })
1569
1569
  ] });
1570
- }, tn = se(rn), nn = W(
1570
+ }, tn = se(rn), nn = K(
1571
1571
  10,
1572
1572
  // matches FileControlTester's rank — beats the default object/Group renderer
1573
1573
  ze(
@@ -1600,41 +1600,41 @@ function cn(e) {
1600
1600
  return Number.isFinite(e) ? Math.min(100, Math.max(0, Math.trunc(e))) : 0;
1601
1601
  }
1602
1602
  const Je = "{value}", an = 2, un = {}, dn = ({ data: e, handleChange: t, path: r, label: i, schema: f, visible: s = !0 }) => {
1603
- var B;
1603
+ var H;
1604
1604
  ce(s, r, t, null);
1605
- const l = f == null ? void 0 : f["x-computed"], a = (l == null ? void 0 : l.inputs) ?? un, o = (l == null ? void 0 : l.formula) ?? "", c = (l == null ? void 0 : l.format) ?? Je, u = (l == null ? void 0 : l.decimals) ?? an, y = xr(), p = r.split(".").slice(0, -1).join("."), m = on((B = y.core) == null ? void 0 : B.data, p, a), v = m ? JSON.stringify(m) : null, N = y.readonly === !0, [A, w] = F(() => typeof e == "number" ? "ok" : "unavailable"), [R, L] = F(() => typeof e == "number" ? e : null), [P, I] = F(null);
1605
+ const l = f == null ? void 0 : f["x-computed"], a = (l == null ? void 0 : l.inputs) ?? un, o = (l == null ? void 0 : l.formula) ?? "", c = (l == null ? void 0 : l.format) ?? Je, u = (l == null ? void 0 : l.decimals) ?? an, y = xr(), p = r.split(".").slice(0, -1).join("."), m = on((H = y.core) == null ? void 0 : H.data, p, a), v = m ? JSON.stringify(m) : null, N = y.readonly === !0, [A, w] = U(() => typeof e == "number" ? "ok" : "unavailable"), [I, L] = U(() => typeof e == "number" ? e : null), [D, C] = U(null);
1606
1606
  return fe(() => {
1607
1607
  if (!s) return;
1608
- let j = !1;
1609
- const M = (O) => {
1608
+ let W = !1;
1609
+ const x = (O) => {
1610
1610
  N || O !== (e ?? null) && t(r, O);
1611
1611
  };
1612
1612
  if (m === void 0) {
1613
- w("unavailable"), I(null), L(null), M(null);
1613
+ w("unavailable"), C(null), L(null), x(null);
1614
1614
  return;
1615
1615
  }
1616
1616
  return w((O) => O === "ok" ? O : "loading"), ln(m, o).then((O) => {
1617
- if (j) return;
1618
- const D = O.status === "ok" && typeof O.value == "number" && Number.isFinite(O.value) ? O.value : null;
1619
- if (D === null) {
1620
- w("error"), I(
1617
+ if (W) return;
1618
+ const F = O.status === "ok" && typeof O.value == "number" && Number.isFinite(O.value) ? O.value : null;
1619
+ if (F === null) {
1620
+ w("error"), C(
1621
1621
  O.status === "error" ? O.error ?? "Unable to compute value." : "Computed value must be a number."
1622
- ), L(null), M(null);
1622
+ ), L(null), x(null);
1623
1623
  return;
1624
1624
  }
1625
- w("ok"), I(null), L(D), M(D);
1625
+ w("ok"), C(null), L(F), x(F);
1626
1626
  }), () => {
1627
- j = !0;
1627
+ W = !0;
1628
1628
  };
1629
- }, [v, o, s, N]), s === !1 ? null : /* @__PURE__ */ n(C, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
1629
+ }, [v, o, s, N]), s === !1 ? null : /* @__PURE__ */ n(R, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
1630
1630
  /* @__PURE__ */ n(h, { as: "label", size: "2", weight: "bold", children: i }),
1631
1631
  A === "unavailable" ? /* @__PURE__ */ n(h, { size: "2", color: "gray", children: "Not yet available." }) : A === "loading" ? /* @__PURE__ */ g(S, { align: "center", gap: "2", children: [
1632
1632
  /* @__PURE__ */ n(Me, { size: "1" }),
1633
1633
  /* @__PURE__ */ n(h, { size: "2", color: "gray", children: "Computing…" })
1634
- ] }) : A === "error" ? /* @__PURE__ */ n(h, { size: "2", color: "red", children: P }) : /* @__PURE__ */ n(h, { size: "2", children: c.split(Je).join(sn(R, u)) }),
1634
+ ] }) : A === "error" ? /* @__PURE__ */ n(h, { size: "2", color: "red", children: D }) : /* @__PURE__ */ n(h, { size: "2", children: c.split(Je).join(sn(I, u)) }),
1635
1635
  f.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: f.description })
1636
1636
  ] }) });
1637
- }, fn = se(dn), hn = W(
1637
+ }, fn = se(dn), hn = K(
1638
1638
  5,
1639
1639
  ze((e) => {
1640
1640
  const t = e["x-computed"];
@@ -1655,34 +1655,34 @@ const Je = "{value}", an = 2, un = {}, dn = ({ data: e, handleChange: t, path: r
1655
1655
  const u = c ? r : r.items, y = c || r;
1656
1656
  if (s === !1 || !u || typeof u != "object" || Array.isArray(u))
1657
1657
  return null;
1658
- const p = u, m = Array.isArray(e) ? e : [], v = y.title || "Array Items", N = () => {
1659
- const w = Or(p, o);
1660
- l && l(t, w)();
1661
- }, A = (w) => {
1658
+ const p = u, m = Array.isArray(e) ? e : [], v = y.title || "Array Items", N = i.options ?? {}, A = f && N.addable !== !1, w = f && N.removable !== !1, I = () => {
1659
+ const D = Or(p, o);
1660
+ l && l(t, D)();
1661
+ }, L = (D) => {
1662
1662
  if (a) {
1663
- const R = a(t, [w]);
1664
- R && R();
1663
+ const C = a(t, [D]);
1664
+ C && C();
1665
1665
  }
1666
1666
  };
1667
- return /* @__PURE__ */ n(C, { mb: "6", children: /* @__PURE__ */ g(S, { direction: "column", gap: "4", children: [
1667
+ return /* @__PURE__ */ n(R, { mb: "6", children: /* @__PURE__ */ g(S, { direction: "column", gap: "4", children: [
1668
1668
  /* @__PURE__ */ n(h, { as: "div", size: "4", weight: "bold", children: v }),
1669
- m.length === 0 && /* @__PURE__ */ n(C, { py: "4", px: "4", style: { backgroundColor: "var(--gray-3)", borderRadius: "var(--radius-3)" }, children: /* @__PURE__ */ n(h, { size: "2", color: "gray", children: "No items have been added yet." }) }),
1670
- m.map((w, R) => {
1671
- var P;
1672
- const L = `${t}.${R}`;
1669
+ m.length === 0 && /* @__PURE__ */ n(R, { py: "4", px: "4", style: { backgroundColor: "var(--gray-3)", borderRadius: "var(--radius-3)" }, children: /* @__PURE__ */ n(h, { size: "2", color: "gray", children: "No items have been added yet." }) }),
1670
+ m.map((D, C) => {
1671
+ var W;
1672
+ const H = `${t}.${C}`;
1673
1673
  return /* @__PURE__ */ n(nr, { size: "3", variant: "surface", children: /* @__PURE__ */ g(S, { direction: "column", gap: "4", children: [
1674
1674
  /* @__PURE__ */ g(S, { justify: "between", align: "center", children: [
1675
1675
  /* @__PURE__ */ g(h, { size: "3", weight: "bold", children: [
1676
1676
  "Item ",
1677
- R + 1
1677
+ C + 1
1678
1678
  ] }),
1679
- f && /* @__PURE__ */ g(
1679
+ w && /* @__PURE__ */ g(
1680
1680
  ke,
1681
1681
  {
1682
1682
  type: "button",
1683
1683
  color: "red",
1684
1684
  variant: "soft",
1685
- onClick: () => A(R),
1685
+ onClick: () => L(C),
1686
1686
  title: "Remove item",
1687
1687
  children: [
1688
1688
  /* @__PURE__ */ n(Ur, {}),
@@ -1691,37 +1691,37 @@ const Je = "{value}", an = 2, un = {}, dn = ({ data: e, handleChange: t, path: r
1691
1691
  }
1692
1692
  )
1693
1693
  ] }),
1694
- /* @__PURE__ */ n(C, { children: /* @__PURE__ */ n(
1694
+ /* @__PURE__ */ n(R, { children: /* @__PURE__ */ n(
1695
1695
  Ae,
1696
1696
  {
1697
1697
  schema: p,
1698
- uischema: ((P = i.options) == null ? void 0 : P.detail) || (p.type === "object" || p.properties ? {
1698
+ uischema: ((W = i.options) == null ? void 0 : W.detail) || (p.type === "object" || p.properties ? {
1699
1699
  type: "VerticalLayout",
1700
- elements: Object.keys(p.properties || {}).map((I) => ({
1700
+ elements: Object.keys(p.properties || {}).map((x) => ({
1701
1701
  type: "Control",
1702
- scope: `#/properties/${I}`
1702
+ scope: `#/properties/${x}`
1703
1703
  }))
1704
1704
  } : {
1705
1705
  type: "Control",
1706
1706
  scope: "#"
1707
1707
  }),
1708
- path: L,
1708
+ path: H,
1709
1709
  enabled: f,
1710
1710
  renderers: void 0,
1711
1711
  cells: void 0
1712
1712
  }
1713
1713
  ) })
1714
- ] }) }, L);
1714
+ ] }) }, H);
1715
1715
  }),
1716
- f && /* @__PURE__ */ n(C, { mt: "2", children: /* @__PURE__ */ g(ke, { type: "button", variant: "surface", onClick: N, children: [
1716
+ A && /* @__PURE__ */ n(R, { mt: "2", children: /* @__PURE__ */ g(ke, { type: "button", variant: "surface", onClick: I, children: [
1717
1717
  /* @__PURE__ */ n(Hr, {}),
1718
1718
  "Add Item"
1719
1719
  ] }) })
1720
1720
  ] }) });
1721
- }, qe = Mr(pn), mn = W(3, Nr), gn = ({ uischema: e, visible: t }) => {
1721
+ }, qe = Mr(pn), mn = K(3, Nr), gn = ({ uischema: e, visible: t }) => {
1722
1722
  const r = e;
1723
- return t === !1 ? null : /* @__PURE__ */ n(C, { mb: "4", children: /* @__PURE__ */ n(tr, { size: "4", children: r.text }) });
1724
- }, yn = W(1, Te("Label")), vn = W(3, Ir), xn = [
1723
+ return t === !1 ? null : /* @__PURE__ */ n(R, { mb: "4", children: /* @__PURE__ */ n(tr, { size: "4", children: r.text }) });
1724
+ }, yn = K(1, Te("Label")), vn = K(3, Ir), xn = [
1725
1725
  { tester: Kr, renderer: Gr },
1726
1726
  { tester: jr, renderer: Yr },
1727
1727
  { tester: qr, renderer: Zr },