reactaform 1.2.0 → 1.2.1

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.
@@ -1,5 +1,5 @@
1
- import N, { createContext as yr, useContext as xr, useRef as k, useEffect as C, useCallback as Z, useState as D, useMemo as G, memo as ve } from "react";
2
- import Me from "react-dom";
1
+ import F, { createContext as yr, useContext as xr, useRef as E, useEffect as k, useCallback as X, useState as V, useMemo as J, memo as ve } from "react";
2
+ import $e from "react-dom";
3
3
  const vr = `/* ReactaForm CSS Custom Properties (CSS Variables) */\r
4
4
  \r
5
5
  /* Default Light Theme */\r
@@ -140,7 +140,7 @@ const vr = `/* ReactaForm CSS Custom Properties (CSS Variables) */\r
140
140
  line-height: 1.4;\r
141
141
  min-width: 100px;\r
142
142
  color: var(--reactaform-text-color);\r
143
- font-weight: var(--reactaform-font-weight);\r
143
+ font-weight: 600;\r
144
144
  font-size: var(--reactaform-font-size);\r
145
145
  user-select: none;\r
146
146
  }\r
@@ -287,28 +287,28 @@ const vr = `/* ReactaForm CSS Custom Properties (CSS Variables) */\r
287
287
  \r
288
288
  }\r
289
289
  `;
290
- var be = { exports: {} }, de = {};
290
+ var be = { exports: {} }, fe = {};
291
291
  var qe;
292
292
  function wr() {
293
- if (qe) return de;
293
+ if (qe) return fe;
294
294
  qe = 1;
295
295
  var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
296
- function n(o, t, a) {
296
+ function n(a, t, o) {
297
297
  var s = null;
298
- if (a !== void 0 && (s = "" + a), t.key !== void 0 && (s = "" + t.key), "key" in t) {
299
- a = {};
298
+ if (o !== void 0 && (s = "" + o), t.key !== void 0 && (s = "" + t.key), "key" in t) {
299
+ o = {};
300
300
  for (var i in t)
301
- i !== "key" && (a[i] = t[i]);
302
- } else a = t;
303
- return t = a.ref, {
301
+ i !== "key" && (o[i] = t[i]);
302
+ } else o = t;
303
+ return t = o.ref, {
304
304
  $$typeof: e,
305
- type: o,
305
+ type: a,
306
306
  key: s,
307
307
  ref: t !== void 0 ? t : null,
308
- props: a
308
+ props: o
309
309
  };
310
310
  }
311
- return de.Fragment = r, de.jsx = n, de.jsxs = n, de;
311
+ return fe.Fragment = r, fe.jsx = n, fe.jsxs = n, fe;
312
312
  }
313
313
  var pe = {};
314
314
  var Be;
@@ -317,20 +317,20 @@ function Sr() {
317
317
  function e(h) {
318
318
  if (h == null) return null;
319
319
  if (typeof h == "function")
320
- return h.$$typeof === z ? null : h.displayName || h.name || null;
320
+ return h.$$typeof === O ? null : h.displayName || h.name || null;
321
321
  if (typeof h == "string") return h;
322
322
  switch (h) {
323
323
  case y:
324
324
  return "Fragment";
325
- case v:
326
- return "Profiler";
327
325
  case x:
326
+ return "Profiler";
327
+ case C:
328
328
  return "StrictMode";
329
- case j:
329
+ case w:
330
330
  return "Suspense";
331
331
  case I:
332
332
  return "SuspenseList";
333
- case M:
333
+ case $:
334
334
  return "Activity";
335
335
  }
336
336
  if (typeof h == "object")
@@ -339,19 +339,19 @@ function Sr() {
339
339
  ), h.$$typeof) {
340
340
  case f:
341
341
  return "Portal";
342
- case R:
342
+ case N:
343
343
  return h.displayName || "Context";
344
- case F:
344
+ case j:
345
345
  return (h._context.displayName || "Context") + ".Consumer";
346
- case w:
347
- var E = h.render;
348
- return h = h.displayName, h || (h = E.displayName || E.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
349
- case S:
350
- return E = h.displayName || null, E !== null ? E : e(h.type) || "Memo";
346
+ case v:
347
+ var S = h.render;
348
+ return h = h.displayName, h || (h = S.displayName || S.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
351
349
  case A:
352
- E = h._payload, h = h._init;
350
+ return S = h.displayName || null, S !== null ? S : e(h.type) || "Memo";
351
+ case R:
352
+ S = h._payload, h = h._init;
353
353
  try {
354
- return e(h(E));
354
+ return e(h(S));
355
355
  } catch {
356
356
  }
357
357
  }
@@ -363,74 +363,74 @@ function Sr() {
363
363
  function n(h) {
364
364
  try {
365
365
  r(h);
366
- var E = !1;
366
+ var S = !1;
367
367
  } catch {
368
- E = !0;
368
+ S = !0;
369
369
  }
370
- if (E) {
371
- E = console;
372
- var B = E.error, U = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
373
- return B.call(
374
- E,
370
+ if (S) {
371
+ S = console;
372
+ var z = S.error, Y = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
373
+ return z.call(
374
+ S,
375
375
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
376
- U
376
+ Y
377
377
  ), r(h);
378
378
  }
379
379
  }
380
- function o(h) {
380
+ function a(h) {
381
381
  if (h === y) return "<>";
382
- if (typeof h == "object" && h !== null && h.$$typeof === A)
382
+ if (typeof h == "object" && h !== null && h.$$typeof === R)
383
383
  return "<...>";
384
384
  try {
385
- var E = e(h);
386
- return E ? "<" + E + ">" : "<...>";
385
+ var S = e(h);
386
+ return S ? "<" + S + ">" : "<...>";
387
387
  } catch {
388
388
  return "<...>";
389
389
  }
390
390
  }
391
391
  function t() {
392
- var h = L.A;
392
+ var h = P.A;
393
393
  return h === null ? null : h.getOwner();
394
394
  }
395
- function a() {
395
+ function o() {
396
396
  return Error("react-stack-top-frame");
397
397
  }
398
398
  function s(h) {
399
- if (J.call(h, "key")) {
400
- var E = Object.getOwnPropertyDescriptor(h, "key").get;
401
- if (E && E.isReactWarning) return !1;
399
+ if (W.call(h, "key")) {
400
+ var S = Object.getOwnPropertyDescriptor(h, "key").get;
401
+ if (S && S.isReactWarning) return !1;
402
402
  }
403
403
  return h.key !== void 0;
404
404
  }
405
- function i(h, E) {
406
- function B() {
405
+ function i(h, S) {
406
+ function z() {
407
407
  ue || (ue = !0, console.error(
408
408
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
409
- E
409
+ S
410
410
  ));
411
411
  }
412
- B.isReactWarning = !0, Object.defineProperty(h, "key", {
413
- get: B,
412
+ z.isReactWarning = !0, Object.defineProperty(h, "key", {
413
+ get: z,
414
414
  configurable: !0
415
415
  });
416
416
  }
417
- function u() {
417
+ function m() {
418
418
  var h = e(this.type);
419
419
  return Q[h] || (Q[h] = !0, console.error(
420
420
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
421
421
  )), h = this.props.ref, h !== void 0 ? h : null;
422
422
  }
423
- function m(h, E, B, U, ne, ae) {
424
- var _ = B.ref;
423
+ function d(h, S, z, Y, te, se) {
424
+ var q = z.ref;
425
425
  return h = {
426
426
  $$typeof: b,
427
427
  type: h,
428
- key: E,
429
- props: B,
430
- _owner: U
431
- }, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(h, "ref", {
428
+ key: S,
429
+ props: z,
430
+ _owner: Y
431
+ }, (q !== void 0 ? q : null) !== null ? Object.defineProperty(h, "ref", {
432
432
  enumerable: !1,
433
- get: u
433
+ get: m
434
434
  }) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
435
435
  configurable: !1,
436
436
  enumerable: !1,
@@ -445,99 +445,99 @@ function Sr() {
445
445
  configurable: !1,
446
446
  enumerable: !1,
447
447
  writable: !0,
448
- value: ne
448
+ value: te
449
449
  }), Object.defineProperty(h, "_debugTask", {
450
450
  configurable: !1,
451
451
  enumerable: !1,
452
452
  writable: !0,
453
- value: ae
453
+ value: se
454
454
  }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
455
455
  }
456
- function l(h, E, B, U, ne, ae) {
457
- var _ = E.children;
458
- if (_ !== void 0)
459
- if (U)
460
- if (ce(_)) {
461
- for (U = 0; U < _.length; U++)
462
- p(_[U]);
463
- Object.freeze && Object.freeze(_);
456
+ function l(h, S, z, Y, te, se) {
457
+ var q = S.children;
458
+ if (q !== void 0)
459
+ if (Y)
460
+ if (ae(q)) {
461
+ for (Y = 0; Y < q.length; Y++)
462
+ u(q[Y]);
463
+ Object.freeze && Object.freeze(q);
464
464
  } else
465
465
  console.error(
466
466
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
467
467
  );
468
- else p(_);
469
- if (J.call(E, "key")) {
470
- _ = e(h);
471
- var V = Object.keys(E).filter(function(X) {
472
- return X !== "key";
468
+ else u(q);
469
+ if (W.call(S, "key")) {
470
+ q = e(h);
471
+ var D = Object.keys(S).filter(function(K) {
472
+ return K !== "key";
473
473
  });
474
- U = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", O[_ + U] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
474
+ Y = 0 < D.length ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}", T[q + Y] || (D = 0 < D.length ? "{" + D.join(": ..., ") + ": ...}" : "{}", console.error(
475
475
  `A props object containing a "key" prop is being spread into JSX:
476
476
  let props = %s;
477
477
  <%s {...props} />
478
478
  React keys must be passed directly to JSX without using spread:
479
479
  let props = %s;
480
480
  <%s key={someKey} {...props} />`,
481
- U,
482
- _,
483
- V,
484
- _
485
- ), O[_ + U] = !0);
481
+ Y,
482
+ q,
483
+ D,
484
+ q
485
+ ), T[q + Y] = !0);
486
486
  }
487
- if (_ = null, B !== void 0 && (n(B), _ = "" + B), s(E) && (n(E.key), _ = "" + E.key), "key" in E) {
488
- B = {};
489
- for (var q in E)
490
- q !== "key" && (B[q] = E[q]);
491
- } else B = E;
492
- return _ && i(
493
- B,
487
+ if (q = null, z !== void 0 && (n(z), q = "" + z), s(S) && (n(S.key), q = "" + S.key), "key" in S) {
488
+ z = {};
489
+ for (var _ in S)
490
+ _ !== "key" && (z[_] = S[_]);
491
+ } else z = S;
492
+ return q && i(
493
+ z,
494
494
  typeof h == "function" ? h.displayName || h.name || "Unknown" : h
495
- ), m(
495
+ ), d(
496
496
  h,
497
- _,
498
- B,
497
+ q,
498
+ z,
499
499
  t(),
500
- ne,
501
- ae
500
+ te,
501
+ se
502
502
  );
503
503
  }
504
- function p(h) {
505
- c(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === A && (h._payload.status === "fulfilled" ? c(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
504
+ function u(h) {
505
+ c(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === R && (h._payload.status === "fulfilled" ? c(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
506
506
  }
507
507
  function c(h) {
508
508
  return typeof h == "object" && h !== null && h.$$typeof === b;
509
509
  }
510
- var d = N, b = Symbol.for("react.transitional.element"), f = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), F = Symbol.for("react.consumer"), R = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), M = Symbol.for("react.activity"), z = Symbol.for("react.client.reference"), L = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, ce = Array.isArray, re = console.createTask ? console.createTask : function() {
510
+ var p = F, b = Symbol.for("react.transitional.element"), f = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), j = Symbol.for("react.consumer"), N = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), A = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), $ = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), P = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, ae = Array.isArray, re = console.createTask ? console.createTask : function() {
511
511
  return null;
512
512
  };
513
- d = {
513
+ p = {
514
514
  react_stack_bottom_frame: function(h) {
515
515
  return h();
516
516
  }
517
517
  };
518
- var ue, Q = {}, oe = d.react_stack_bottom_frame.bind(
519
- d,
520
- a
521
- )(), P = re(o(a)), O = {};
522
- pe.Fragment = y, pe.jsx = function(h, E, B) {
523
- var U = 1e4 > L.recentlyCreatedOwnerStacks++;
518
+ var ue, Q = {}, oe = p.react_stack_bottom_frame.bind(
519
+ p,
520
+ o
521
+ )(), Z = re(a(o)), T = {};
522
+ pe.Fragment = y, pe.jsx = function(h, S, z) {
523
+ var Y = 1e4 > P.recentlyCreatedOwnerStacks++;
524
524
  return l(
525
525
  h,
526
- E,
527
- B,
526
+ S,
527
+ z,
528
528
  !1,
529
- U ? Error("react-stack-top-frame") : oe,
530
- U ? re(o(h)) : P
529
+ Y ? Error("react-stack-top-frame") : oe,
530
+ Y ? re(a(h)) : Z
531
531
  );
532
- }, pe.jsxs = function(h, E, B) {
533
- var U = 1e4 > L.recentlyCreatedOwnerStacks++;
532
+ }, pe.jsxs = function(h, S, z) {
533
+ var Y = 1e4 > P.recentlyCreatedOwnerStacks++;
534
534
  return l(
535
535
  h,
536
- E,
537
- B,
536
+ S,
537
+ z,
538
538
  !0,
539
- U ? Error("react-stack-top-frame") : oe,
540
- U ? re(o(h)) : P
539
+ Y ? Error("react-stack-top-frame") : oe,
540
+ Y ? re(a(h)) : Z
541
541
  );
542
542
  };
543
543
  })()), pe;
@@ -547,8 +547,8 @@ function Cr() {
547
547
  return He || (He = 1, process.env.NODE_ENV === "production" ? be.exports = wr() : be.exports = Sr()), be.exports;
548
548
  }
549
549
  var g = Cr();
550
- const Oe = yr(void 0), T = () => {
551
- const e = xr(Oe);
550
+ const Me = yr(void 0), L = () => {
551
+ const e = xr(Me);
552
552
  if (!e)
553
553
  throw new Error("❌ useReactaFormContext must be used within a <ReactaFormProvider>");
554
554
  return e;
@@ -584,7 +584,7 @@ class we {
584
584
  }
585
585
  // Batch operations for better performance
586
586
  registerAll(r) {
587
- Array.isArray(r) ? r.forEach(([n, o]) => this.register(n, o)) : Object.entries(r).forEach(([n, o]) => this.register(n, o));
587
+ Array.isArray(r) ? r.forEach(([n, a]) => this.register(n, a)) : Object.entries(r).forEach(([n, a]) => this.register(n, a));
588
588
  }
589
589
  // Get with fallback
590
590
  getOrDefault(r, n) {
@@ -592,41 +592,41 @@ class we {
592
592
  }
593
593
  }
594
594
  function jr(e, r = 300, n) {
595
- const o = k(void 0), t = k(e), a = k(null), s = k(!1);
596
- C(() => {
595
+ const a = E(void 0), t = E(e), o = E(null), s = E(!1);
596
+ k(() => {
597
597
  t.current = e;
598
- }, [e]), C(
598
+ }, [e]), k(
599
599
  () => () => {
600
- o.current !== void 0 && (window.clearTimeout(o.current), o.current = void 0);
600
+ a.current !== void 0 && (window.clearTimeout(a.current), a.current = void 0);
601
601
  },
602
602
  []
603
603
  );
604
- const i = Z(() => {
605
- o.current !== void 0 && (window.clearTimeout(o.current), o.current = void 0), a.current = null, s.current = !1;
606
- }, []), u = Z(() => {
607
- if (o.current !== void 0 && (window.clearTimeout(o.current), o.current = void 0), a.current)
604
+ const i = X(() => {
605
+ a.current !== void 0 && (window.clearTimeout(a.current), a.current = void 0), o.current = null, s.current = !1;
606
+ }, []), m = X(() => {
607
+ if (a.current !== void 0 && (window.clearTimeout(a.current), a.current = void 0), o.current)
608
608
  try {
609
- t.current(...a.current);
609
+ t.current(...o.current);
610
610
  } finally {
611
- a.current = null, s.current = !1;
611
+ o.current = null, s.current = !1;
612
612
  }
613
613
  }, []);
614
- return { callback: Z(
614
+ return { callback: X(
615
615
  (...l) => {
616
616
  if (n?.leading === !0 && !s.current) {
617
- s.current = !0, t.current(...l), window.clearTimeout(o.current), o.current = window.setTimeout(() => {
618
- s.current = !1, o.current = void 0;
617
+ s.current = !0, t.current(...l), window.clearTimeout(a.current), a.current = window.setTimeout(() => {
618
+ s.current = !1, a.current = void 0;
619
619
  }, r);
620
620
  return;
621
621
  }
622
- a.current = l, window.clearTimeout(o.current), o.current = window.setTimeout(() => {
623
- o.current = void 0, a.current && (t.current(...a.current), a.current = null, s.current = !1);
622
+ o.current = l, window.clearTimeout(a.current), a.current = window.setTimeout(() => {
623
+ a.current = void 0, o.current && (t.current(...o.current), o.current = null, s.current = !1);
624
624
  }, r);
625
625
  },
626
626
  [r, n?.leading]
627
- ), cancel: i, flush: u };
627
+ ), cancel: i, flush: m };
628
628
  }
629
- const $ = {
629
+ const M = {
630
630
  field: "reactaform-field",
631
631
  label: "reactaform-label",
632
632
  input: "reactaform-input",
@@ -635,16 +635,16 @@ const $ = {
635
635
  inputSelect: "reactaform-select",
636
636
  rangeInput: "reactaform-input--range",
637
637
  button: "reactaform-button"
638
- }, K = (...e) => {
638
+ }, G = (...e) => {
639
639
  const r = [];
640
640
  for (const n of e)
641
- n && (typeof n == "string" ? r.push(n) : typeof n == "object" && Object.entries(n).forEach(([o, t]) => {
642
- t && r.push(o);
641
+ n && (typeof n == "string" ? r.push(n) : typeof n == "object" && Object.entries(n).forEach(([a, t]) => {
642
+ t && r.push(a);
643
643
  }));
644
644
  return r.join(" ");
645
645
  }, er = ({ content: e, size: r = "medium", animation: n = !0 }) => {
646
- const { t: o, darkMode: t, formStyle: a, fieldStyle: s } = T(), [i, u] = D(!1), [m, l] = D({ x: 0, y: 0 }), [p, c] = D(!1), d = k(null), b = k(null), f = k(null), y = G(() => {
647
- const R = {
646
+ const { t: a, darkMode: t, formStyle: o, fieldStyle: s } = L(), [i, m] = V(!1), [d, l] = V({ x: 0, y: 0 }), [u, c] = V(!1), p = E(null), b = E(null), f = E(null), y = J(() => {
647
+ const N = {
648
648
  icon: {
649
649
  display: "inline-flex",
650
650
  alignItems: "center",
@@ -686,58 +686,58 @@ const $ = {
686
686
  opacity: 1,
687
687
  visibility: "visible"
688
688
  }
689
- }, w = (I, S, A) => {
690
- const z = I?.[S];
691
- return (A && z ? z[A] : void 0) ?? {};
689
+ }, v = (I, A, R) => {
690
+ const O = I?.[A];
691
+ return (R && O ? O[R] : void 0) ?? {};
692
692
  };
693
693
  return {
694
- icon: { ...R.icon, ...w(a, "tooltip", "icon"), ...w(s, "tooltip", "icon") },
695
- text: { ...R.text, ...w(a, "tooltip", "text"), ...w(s, "tooltip", "text") },
696
- textVisible: R.textVisible
694
+ icon: { ...N.icon, ...v(o, "tooltip", "icon"), ...v(s, "tooltip", "icon") },
695
+ text: { ...N.text, ...v(o, "tooltip", "text"), ...v(s, "tooltip", "text") },
696
+ textVisible: N.textVisible
697
697
  };
698
- }, [t, r, n, a, s]);
699
- C(() => {
698
+ }, [t, r, n, o, s]);
699
+ k(() => {
700
700
  if (i) {
701
- const F = requestAnimationFrame(() => c(!1)), R = requestAnimationFrame(() => {
702
- if (d.current) {
703
- const w = d.current.getBoundingClientRect(), j = 8;
704
- f.current = w;
705
- const I = w.right + j, S = w.top;
706
- l({ x: I, y: S }), c(!0);
701
+ const j = requestAnimationFrame(() => c(!1)), N = requestAnimationFrame(() => {
702
+ if (p.current) {
703
+ const v = p.current.getBoundingClientRect(), w = 8;
704
+ f.current = v;
705
+ const I = v.right + w, A = v.top;
706
+ l({ x: I, y: A }), c(!0);
707
707
  }
708
708
  });
709
709
  return () => {
710
- cancelAnimationFrame(R), cancelAnimationFrame(F);
710
+ cancelAnimationFrame(N), cancelAnimationFrame(j);
711
711
  };
712
712
  } else
713
713
  requestAnimationFrame(() => c(!1));
714
- }, [i]), C(() => {
715
- if (!p) return;
716
- const F = requestAnimationFrame(() => {
714
+ }, [i]), k(() => {
715
+ if (!u) return;
716
+ const j = requestAnimationFrame(() => {
717
717
  if (!b.current) return;
718
- const R = b.current.getBoundingClientRect(), w = 8, j = typeof window < "u" ? window.innerWidth : 1024, I = typeof window < "u" ? window.innerHeight : 768;
719
- let S = m.x, A = m.y;
720
- const M = f.current;
721
- M && (S = M.right + w, A = M.top + M.height / 2 - R.height / 2 + -4, S + R.width > j - w && (S = M.left - w - R.width)), S + R.width > j - w && (S = Math.max(w, j - R.width - w)), S < w && (S = w), A + R.height > I - w && (A = Math.max(w, I - R.height - w)), A < w && (A = w), (S !== m.x || A !== m.y) && l({ x: S, y: A });
718
+ const N = b.current.getBoundingClientRect(), v = 8, w = typeof window < "u" ? window.innerWidth : 1024, I = typeof window < "u" ? window.innerHeight : 768;
719
+ let A = d.x, R = d.y;
720
+ const $ = f.current;
721
+ $ && (A = $.right + v, R = $.top + $.height / 2 - N.height / 2 + -4, A + N.width > w - v && (A = $.left - v - N.width)), A + N.width > w - v && (A = Math.max(v, w - N.width - v)), A < v && (A = v), R + N.height > I - v && (R = Math.max(v, I - N.height - v)), R < v && (R = v), (A !== d.x || R !== d.y) && l({ x: A, y: R });
722
722
  });
723
- return () => cancelAnimationFrame(F);
724
- }, [p, m.x, m.y]);
725
- const x = typeof document < "u" ? document.getElementById("popup-root") : null, v = /* @__PURE__ */ g.jsx(
723
+ return () => cancelAnimationFrame(j);
724
+ }, [u, d.x, d.y]);
725
+ const C = typeof document < "u" ? document.getElementById("popup-root") : null, x = /* @__PURE__ */ g.jsx(
726
726
  "div",
727
727
  {
728
728
  ref: b,
729
729
  style: {
730
730
  ...y.text,
731
- transform: p ? "translateY(0) scale(1)" : "translateY(-4px) scale(0.98)",
731
+ transform: u ? "translateY(0) scale(1)" : "translateY(-4px) scale(0.98)",
732
732
  transition: "opacity 120ms ease, transform 120ms ease, visibility 120ms ease",
733
733
  width: 240,
734
734
  // When positioned is true, apply the visible styles
735
- ...p ? y.textVisible : {},
736
- top: m.y,
737
- left: m.x
735
+ ...u ? y.textVisible : {},
736
+ top: d.y,
737
+ left: d.x
738
738
  },
739
739
  "data-reactaform-theme": t ? "dark" : "light",
740
- children: o(e)
740
+ children: a(e)
741
741
  }
742
742
  );
743
743
  return /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
@@ -745,45 +745,47 @@ const $ = {
745
745
  "span",
746
746
  {
747
747
  "data-testid": "tooltip-icon",
748
- ref: d,
749
- onMouseEnter: () => u(!0),
750
- onMouseLeave: () => u(!1),
748
+ ref: p,
749
+ onMouseEnter: () => m(!0),
750
+ onMouseLeave: () => m(!1),
751
751
  style: {
752
752
  ...y.icon
753
753
  },
754
754
  children: "?"
755
755
  }
756
756
  ),
757
- i && (x ? Me.createPortal(v, x) : v)
757
+ i && (C ? $e.createPortal(x, C) : x)
758
758
  ] });
759
759
  }, Re = ve(({
760
760
  field: e,
761
761
  error: r,
762
762
  children: n,
763
- showLabel: o = !0
763
+ showLabel: a = !0
764
764
  }) => {
765
- const { t } = T(), a = e?.labelLayout === "column-center" ? "center" : "left";
765
+ const { t } = L(), o = e?.labelLayout === "column-center" ? "center" : "left";
766
766
  return /* @__PURE__ */ g.jsxs(
767
767
  "div",
768
768
  {
769
- className: `${$.field} column-layout`,
769
+ className: `${M.field} column-layout`,
770
770
  style: {
771
771
  display: "flex",
772
772
  flexDirection: "column",
773
773
  gap: "var(--reactaform-label-gap, 4px)",
774
- "--label-align": a
774
+ "--label-align": o
775
775
  },
776
776
  children: [
777
- o && /* @__PURE__ */ g.jsx("div", { style: { textAlign: a, width: "100%" }, children: /* @__PURE__ */ g.jsx(
777
+ a && /* @__PURE__ */ g.jsx("div", { style: { textAlign: o, width: "100%" }, children: /* @__PURE__ */ g.jsx(
778
778
  "label",
779
779
  {
780
- className: $.label,
780
+ id: `${e.name}-label`,
781
+ className: M.label,
781
782
  htmlFor: e.name,
782
783
  style: {
783
- textAlign: a,
784
+ textAlign: o,
784
785
  width: "100%",
785
786
  minWidth: "unset",
786
- display: "block"
787
+ display: "block",
788
+ marginBottom: "10px"
787
789
  },
788
790
  children: t(e.displayName)
789
791
  }
@@ -803,7 +805,7 @@ const $ = {
803
805
  ]
804
806
  }
805
807
  ),
806
- r && /* @__PURE__ */ g.jsx($e, { children: r })
808
+ r && /* @__PURE__ */ g.jsx(Oe, { id: `${e.name}-error`, children: r })
807
809
  ]
808
810
  }
809
811
  );
@@ -813,31 +815,32 @@ const rr = ve(({
813
815
  field: e,
814
816
  error: r,
815
817
  children: n,
816
- rightAlign: o = !1
818
+ rightAlign: a = !1
817
819
  }) => {
818
- const { t } = T(), a = G(() => ({
820
+ const { t } = L(), o = J(() => ({
819
821
  display: "flex",
820
822
  flexDirection: "column",
821
823
  gap: 0
822
- }), []), s = G(() => ({
824
+ }), []), s = J(() => ({
823
825
  display: "flex",
824
826
  flexDirection: "row",
825
827
  alignItems: "center",
826
828
  gap: "3px"
827
829
  }), []);
828
- return /* @__PURE__ */ g.jsxs("div", { className: `${$.field} row-layout`, children: [
830
+ return /* @__PURE__ */ g.jsxs("div", { className: `${M.field} row-layout`, children: [
829
831
  /* @__PURE__ */ g.jsx(
830
832
  "label",
831
833
  {
832
- className: $.label,
834
+ id: `${e.name}-label`,
835
+ className: M.label,
833
836
  htmlFor: e.name,
834
837
  style: { textAlign: "left", justifyContent: "flex-start" },
835
838
  children: t(e.displayName)
836
839
  }
837
840
  ),
838
- /* @__PURE__ */ g.jsxs("div", { style: a, children: [
841
+ /* @__PURE__ */ g.jsxs("div", { style: o, children: [
839
842
  /* @__PURE__ */ g.jsxs("div", { style: s, children: [
840
- o ? /* @__PURE__ */ g.jsx(
843
+ a ? /* @__PURE__ */ g.jsx(
841
844
  "div",
842
845
  {
843
846
  style: {
@@ -852,18 +855,18 @@ const rr = ve(({
852
855
  ) : n,
853
856
  e.tooltip && /* @__PURE__ */ g.jsx(er, { content: e.tooltip })
854
857
  ] }),
855
- r && /* @__PURE__ */ g.jsx($e, { children: r })
858
+ r && /* @__PURE__ */ g.jsx(Oe, { id: `${e.name}-error`, children: r })
856
859
  ] })
857
860
  ] });
858
861
  });
859
862
  rr.displayName = "RowFieldLayout";
860
- const W = ({
863
+ const U = ({
861
864
  field: e,
862
865
  error: r,
863
866
  children: n,
864
- rightAlign: o = !1
865
- }) => e?.labelLayout === "column-left" || e?.labelLayout === "column-center" ? /* @__PURE__ */ g.jsx(Re, { field: e, error: r, showLabel: !0, children: n }) : e?.type === "checkbox" || e?.type === "switch" ? /* @__PURE__ */ g.jsx(Re, { field: e, error: r, showLabel: !1, children: n }) : /* @__PURE__ */ g.jsx(rr, { field: e, error: r, rightAlign: o, children: n }), $e = ve(({ children: e }) => {
866
- const r = G(() => ({
867
+ rightAlign: a = !1
868
+ }) => e.labelLayout === "column-left" || e.labelLayout === "column-center" ? /* @__PURE__ */ g.jsx(Re, { field: e, error: r, showLabel: !0, children: n }) : e.type === "checkbox" || e.type === "switch" ? /* @__PURE__ */ g.jsx(Re, { field: e, error: r, showLabel: !1, children: n }) : /* @__PURE__ */ g.jsx(rr, { field: e, error: r, rightAlign: a, children: n }), Oe = ve(({ children: e, id: r }) => {
869
+ const n = J(() => ({
867
870
  color: "var(--reactaform-error-color)",
868
871
  fontSize: "13px",
869
872
  marginTop: "4px",
@@ -873,11 +876,11 @@ const W = ({
873
876
  justifyContent: "flex-start",
874
877
  alignItems: "flex-start"
875
878
  }), []);
876
- return /* @__PURE__ */ g.jsx("div", { style: r, children: e });
879
+ return /* @__PURE__ */ g.jsx("div", { id: r, style: n, children: e });
877
880
  });
878
- $e.displayName = "ErrorDiv";
881
+ Oe.displayName = "ErrorDiv";
879
882
  const tr = ve(({ name: e, onChange: r }) => {
880
- const { t: n } = T();
883
+ const { t: n } = L();
881
884
  return /* @__PURE__ */ g.jsxs("div", { style: { marginBottom: 16 }, children: [
882
885
  /* @__PURE__ */ g.jsxs("div", { style: { display: "grid", gridTemplateColumns: "1fr 2fr", gap: 12, alignItems: "center" }, children: [
883
886
  /* @__PURE__ */ g.jsx(
@@ -899,7 +902,7 @@ const tr = ve(({ name: e, onChange: r }) => {
899
902
  id: "instance-name-input",
900
903
  type: "text",
901
904
  value: e,
902
- onChange: (o) => r(o.target.value),
905
+ onChange: (a) => r(a.target.value),
903
906
  style: {
904
907
  width: "100%",
905
908
  padding: "var(--reactaform-input-padding, 8px 12px)",
@@ -919,10 +922,10 @@ const tr = ve(({ name: e, onChange: r }) => {
919
922
  });
920
923
  tr.displayName = "InstanceName";
921
924
  class kr extends we {
922
- registerInCategory(r, n, o) {
925
+ registerInCategory(r, n, a) {
923
926
  this.get(r) || this.register(r, {});
924
927
  const t = this.get(r);
925
- t[n] = o;
928
+ t[n] = a;
926
929
  }
927
930
  getFromCategory(r, n) {
928
931
  return this.get(r)?.[n];
@@ -934,123 +937,123 @@ class kr extends we {
934
937
  return this.list();
935
938
  }
936
939
  }
937
- const nr = new we(), or = new kr();
940
+ const nr = new we(), ar = new kr();
938
941
  function Zt(e, r) {
939
942
  nr.register(e, r);
940
943
  }
941
944
  function Qt(e, r, n) {
942
- or.registerInCategory(e, r, n);
945
+ ar.registerInCategory(e, r, n);
943
946
  }
944
947
  function Rr(e, r) {
945
- return or.getFromCategory(e, r) || null;
948
+ return ar.getFromCategory(e, r) || null;
946
949
  }
947
950
  function Er(e) {
948
951
  return nr.get(e) || null;
949
952
  }
950
953
  const Ce = /* @__PURE__ */ new Map(), je = /* @__PURE__ */ new Map();
951
- function Y(e, r, n, o) {
954
+ function H(e, r, n, a) {
952
955
  if (r && typeof r.validationHandlerName == "string") {
953
956
  const t = `${e}:${r.validationHandlerName}`;
954
957
  if (!Ce.has(t)) {
955
958
  const s = Rr(e, r.validationHandlerName);
956
959
  Ce.set(t, s);
957
960
  }
958
- const a = Ce.get(t);
959
- if (a)
960
- return a(n, o) || null;
961
+ const o = Ce.get(t);
962
+ if (o)
963
+ return o(n, a) || null;
961
964
  }
962
965
  return null;
963
966
  }
964
967
  function Nr(e, r, n) {
965
968
  if (e && typeof e.validationHandlerName == "string") {
966
- const o = e.validationHandlerName;
967
- if (!je.has(o)) {
968
- const a = Er(o);
969
- je.set(o, a);
969
+ const a = e.validationHandlerName;
970
+ if (!je.has(a)) {
971
+ const o = Er(a);
972
+ je.set(a, o);
970
973
  }
971
- const t = je.get(o);
974
+ const t = je.get(a);
972
975
  if (t)
973
976
  return t(r, n) || null;
974
977
  }
975
978
  return null;
976
979
  }
977
- function ie(e) {
980
+ function ce(e) {
978
981
  return typeof e == "object" && e !== null;
979
982
  }
980
- function Ve(e) {
981
- if (!ie(e)) return !1;
983
+ function De(e) {
984
+ if (!ce(e)) return !1;
982
985
  const r = e;
983
986
  return typeof r.name == "string" && typeof r.displayName == "string";
984
987
  }
985
- function ar(e) {
986
- if (!ie(e)) return !1;
988
+ function or(e) {
989
+ if (!ce(e)) return !1;
987
990
  const r = e;
988
- return typeof r.name != "string" || typeof r.version != "string" || !Array.isArray(r.properties) ? !1 : r.properties.every((n) => Ve(n));
991
+ return typeof r.name != "string" || typeof r.version != "string" || !Array.isArray(r.properties) ? !1 : r.properties.every((n) => De(n));
989
992
  }
990
993
  function Ee(e) {
991
994
  try {
992
995
  return typeof File < "u" && e instanceof File;
993
996
  } catch {
994
- const r = ie(e) ? e : void 0;
997
+ const r = ce(e) ? e : void 0;
995
998
  return !!r && typeof r.name == "string" && typeof r.size == "number";
996
999
  }
997
1000
  }
998
1001
  function en(e, r, n = {}) {
999
1002
  try {
1000
1003
  const {
1001
- includeMetadata: o = !1,
1004
+ includeMetadata: a = !1,
1002
1005
  dateFormat: t = "iso",
1003
- fileHandling: a = "metadata",
1006
+ fileHandling: o = "metadata",
1004
1007
  prettify: s = !1,
1005
1008
  excludeFields: i = [],
1006
- includeOnlyFields: u = []
1009
+ includeOnlyFields: m = []
1007
1010
  } = n;
1008
1011
  if (!e || typeof e != "object")
1009
1012
  return {
1010
1013
  success: !1,
1011
1014
  error: "Instance must be a valid object"
1012
1015
  };
1013
- const m = [], l = [], p = {}, d = (ar(r) || ie(r) && Array.isArray(r.properties) ? r.properties : []).filter(Ve), b = new Map(d.map((y) => [y.name, y]));
1014
- for (const [y, x] of Object.entries(e)) {
1016
+ const d = [], l = [], u = {}, p = (or(r) || ce(r) && Array.isArray(r.properties) ? r.properties : []).filter(De), b = new Map(p.map((y) => [y.name, y]));
1017
+ for (const [y, C] of Object.entries(e)) {
1015
1018
  if (i.includes(y)) {
1016
1019
  l.push(y);
1017
1020
  continue;
1018
1021
  }
1019
- if (u.length > 0 && !u.includes(y)) {
1022
+ if (m.length > 0 && !m.includes(y)) {
1020
1023
  l.push(y);
1021
1024
  continue;
1022
1025
  }
1023
- if (x === void 0) continue;
1024
- const v = b.get(y);
1026
+ if (C === void 0) continue;
1027
+ const x = b.get(y);
1025
1028
  try {
1026
- p[y] = Ir(x, v, { dateFormat: t, fileHandling: a });
1027
- } catch (F) {
1028
- m.push(`Error serializing field '${y}': ${String(F)}`), p[y] = null;
1029
+ u[y] = Ir(C, x, { dateFormat: t, fileHandling: o });
1030
+ } catch (j) {
1031
+ d.push(`Error serializing field '${y}': ${String(j)}`), u[y] = null;
1029
1032
  }
1030
1033
  }
1031
- return o && (p._metadata = {
1034
+ return a && (u._metadata = {
1032
1035
  serializedAt: (/* @__PURE__ */ new Date()).toISOString(),
1033
- version: (ie(r) ? r.version : void 0) || "1.0.0",
1034
- fieldCount: Object.keys(p).length - 1
1036
+ version: (ce(r) ? r.version : void 0) || "1.0.0",
1037
+ fieldCount: Object.keys(u).length - 1
1035
1038
  // Exclude metadata itself
1036
1039
  }), {
1037
1040
  success: !0,
1038
- data: s ? JSON.stringify(p, null, 2) : JSON.stringify(p),
1041
+ data: s ? JSON.stringify(u, null, 2) : JSON.stringify(u),
1039
1042
  metadata: {
1040
- fieldCount: Object.keys(p).length,
1043
+ fieldCount: Object.keys(u).length,
1041
1044
  excludedFields: l,
1042
- warnings: m
1045
+ warnings: d
1043
1046
  }
1044
1047
  };
1045
- } catch (o) {
1048
+ } catch (a) {
1046
1049
  return {
1047
1050
  success: !1,
1048
- error: `Serialization failed: ${o instanceof Error ? o.message : "Unknown error"}`
1051
+ error: `Serialization failed: ${a instanceof Error ? a.message : "Unknown error"}`
1049
1052
  };
1050
1053
  }
1051
1054
  }
1052
1055
  function Ir(e, r, n = {}) {
1053
- const { dateFormat: o = "iso", fileHandling: t = "metadata" } = n;
1056
+ const { dateFormat: a = "iso", fileHandling: t = "metadata" } = n;
1054
1057
  if (e == null)
1055
1058
  return null;
1056
1059
  if (r)
@@ -1058,7 +1061,7 @@ function Ir(e, r, n = {}) {
1058
1061
  case "date":
1059
1062
  case "datetime":
1060
1063
  case "date-time":
1061
- return Ue(e, o);
1064
+ return Ue(e, a);
1062
1065
  case "file":
1063
1066
  return We(e, t);
1064
1067
  case "int":
@@ -1071,20 +1074,20 @@ function Ir(e, r, n = {}) {
1071
1074
  return typeof e == "string" ? e === "true" : !!e;
1072
1075
  case "int-array":
1073
1076
  case "float-array":
1074
- return Array.isArray(e) ? e.map((a) => typeof a == "string" ? Number(a) : a) : e;
1077
+ return Array.isArray(e) ? e.map((o) => typeof o == "string" ? Number(o) : o) : e;
1075
1078
  default:
1076
1079
  return e;
1077
1080
  }
1078
- return e instanceof Date ? Ue(e, o) : Ee(e) || Array.isArray(e) && Ee(e[0]) ? We(e, t) : e;
1081
+ return e instanceof Date ? Ue(e, a) : Ee(e) || Array.isArray(e) && Ee(e[0]) ? We(e, t) : e;
1079
1082
  }
1080
1083
  function Ue(e, r) {
1081
1084
  let n = null;
1082
1085
  if (e instanceof Date)
1083
1086
  n = e;
1084
1087
  else if (typeof e == "string") {
1085
- const o = new Date(e);
1086
- if (!isNaN(o.getTime()))
1087
- n = o;
1088
+ const a = new Date(e);
1089
+ if (!isNaN(a.getTime()))
1090
+ n = a;
1088
1091
  else
1089
1092
  return e;
1090
1093
  } else
@@ -1122,9 +1125,9 @@ function Ye(e, r) {
1122
1125
  function rn(e, r, n = {}) {
1123
1126
  try {
1124
1127
  const {
1125
- strict: o = !1,
1128
+ strict: a = !1,
1126
1129
  validateTypes: t = !0,
1127
- preserveUnknownFields: a = !0,
1130
+ preserveUnknownFields: o = !0,
1128
1131
  dateFormat: s = "auto"
1129
1132
  } = n;
1130
1133
  if (!e || typeof e != "string")
@@ -1146,39 +1149,39 @@ function rn(e, r, n = {}) {
1146
1149
  success: !1,
1147
1150
  error: "Parsed data must be an object"
1148
1151
  };
1149
- const u = [], m = [], l = {}, c = (ar(r) || ie(r) && Array.isArray(r.properties) ? r.properties : []).filter(Ve), d = new Map(c.map((f) => [f.name, f]));
1152
+ const m = [], d = [], l = {}, c = (or(r) || ce(r) && Array.isArray(r.properties) ? r.properties : []).filter(De), p = new Map(c.map((f) => [f.name, f]));
1150
1153
  for (const f of c) {
1151
- const y = f.name, x = i[y];
1152
- if (x === void 0) {
1153
- o && f.required && m.push(`Required field '${y}' is missing`);
1154
+ const y = f.name, C = i[y];
1155
+ if (C === void 0) {
1156
+ a && f.required && d.push(`Required field '${y}' is missing`);
1154
1157
  continue;
1155
1158
  }
1156
1159
  try {
1157
- l[y] = Ar(x, f, { validateTypes: t, dateFormat: s });
1158
- } catch (v) {
1159
- const F = `Error deserializing field '${y}': ${String(v)}`;
1160
- o ? m.push(F) : (u.push(F), l[y] = x);
1160
+ l[y] = Ar(C, f, { validateTypes: t, dateFormat: s });
1161
+ } catch (x) {
1162
+ const j = `Error deserializing field '${y}': ${String(x)}`;
1163
+ a ? d.push(j) : (m.push(j), l[y] = C);
1161
1164
  }
1162
1165
  }
1163
- if (a)
1166
+ if (o)
1164
1167
  for (const [f, y] of Object.entries(i))
1165
- !d.has(f) && f !== "_metadata" && (o && u.push(`Unknown field '${f}' preserved`), l[f] = y);
1166
- const b = m.length > 0;
1168
+ !p.has(f) && f !== "_metadata" && (a && m.push(`Unknown field '${f}' preserved`), l[f] = y);
1169
+ const b = d.length > 0;
1167
1170
  return {
1168
1171
  success: !b,
1169
1172
  data: l,
1170
- warnings: u.length > 0 ? u : void 0,
1171
- validationErrors: b ? m : void 0
1173
+ warnings: m.length > 0 ? m : void 0,
1174
+ validationErrors: b ? d : void 0
1172
1175
  };
1173
- } catch (o) {
1176
+ } catch (a) {
1174
1177
  return {
1175
1178
  success: !1,
1176
- error: `Deserialization failed: ${o instanceof Error ? o.message : "Unknown error"}`
1179
+ error: `Deserialization failed: ${a instanceof Error ? a.message : "Unknown error"}`
1177
1180
  };
1178
1181
  }
1179
1182
  }
1180
1183
  function Ar(e, r, n = {}) {
1181
- const { validateTypes: o = !0, dateFormat: t = "auto" } = n;
1184
+ const { validateTypes: a = !0, dateFormat: t = "auto" } = n;
1182
1185
  if (e == null)
1183
1186
  return e;
1184
1187
  try {
@@ -1186,44 +1189,44 @@ function Ar(e, r, n = {}) {
1186
1189
  case "date":
1187
1190
  case "datetime":
1188
1191
  case "date-time":
1189
- return Fr(e, t, o);
1192
+ return Fr(e, t, a);
1190
1193
  case "int":
1191
1194
  case "integer":
1192
- return Ne(e, o);
1195
+ return Ne(e, a);
1193
1196
  case "float":
1194
1197
  case "number":
1195
- return Ie(e, o);
1198
+ return Ie(e, a);
1196
1199
  case "boolean":
1197
- return Mr(e, o);
1200
+ return $r(e, a);
1198
1201
  case "int-array":
1199
- return Je(e, "integer", o);
1202
+ return Je(e, "integer", a);
1200
1203
  case "float-array":
1201
- return Je(e, "number", o);
1204
+ return Je(e, "number", a);
1202
1205
  case "string":
1203
1206
  case "text":
1204
1207
  case "email":
1205
1208
  case "url":
1206
1209
  case "phone":
1207
- return o ? String(e) : e;
1210
+ return a ? String(e) : e;
1208
1211
  default:
1209
1212
  return e;
1210
1213
  }
1211
- } catch (a) {
1212
- if (o)
1213
- throw new Error(`Type conversion failed: ${String(a)}`);
1214
+ } catch (o) {
1215
+ if (a)
1216
+ throw new Error(`Type conversion failed: ${String(o)}`);
1214
1217
  return e;
1215
1218
  }
1216
1219
  }
1217
1220
  function tn(e, r = {}) {
1218
1221
  try {
1219
- const { prettify: n = !0, includeMetadata: o = !0 } = r;
1222
+ const { prettify: n = !0, includeMetadata: a = !0 } = r;
1220
1223
  if (!e || typeof e != "object")
1221
1224
  return {
1222
1225
  success: !1,
1223
1226
  error: "Definition must be a valid object"
1224
1227
  };
1225
1228
  const t = { ...e };
1226
- return o && (t._metadata = {
1229
+ return a && (t._metadata = {
1227
1230
  serializedAt: (/* @__PURE__ */ new Date()).toISOString(),
1228
1231
  version: t.version || "1.0.0",
1229
1232
  propertyCount: (Array.isArray(t.properties) ? t.properties.length : 0) || 0
@@ -1245,7 +1248,7 @@ function tn(e, r = {}) {
1245
1248
  }
1246
1249
  function nn(e, r = {}) {
1247
1250
  try {
1248
- const { strict: n = !1, validateTypes: o = !0 } = r;
1251
+ const { strict: n = !1, validateTypes: a = !0 } = r;
1249
1252
  let t;
1250
1253
  if (typeof e == "string")
1251
1254
  try {
@@ -1263,13 +1266,13 @@ function nn(e, r = {}) {
1263
1266
  success: !1,
1264
1267
  error: "Input must be a string or object"
1265
1268
  };
1266
- const a = [], s = [], i = ["name", "version", "displayName"];
1269
+ const o = [], s = [], i = ["name", "version", "displayName"];
1267
1270
  for (const l of i)
1268
1271
  if (!t[l])
1269
1272
  if (n)
1270
1273
  s.push(`Required field '${l}' is missing`);
1271
1274
  else
1272
- switch (a.push(`Missing field '${l}', using default`), l) {
1275
+ switch (o.push(`Missing field '${l}', using default`), l) {
1273
1276
  case "name":
1274
1277
  t.name = "unnamed-definition";
1275
1278
  break;
@@ -1280,21 +1283,21 @@ function nn(e, r = {}) {
1280
1283
  t.displayName = t.name || "Unnamed Definition";
1281
1284
  break;
1282
1285
  }
1283
- const u = Array.isArray(t.properties) ? t.properties : null;
1284
- u ? t.properties = u.map((l, p) => {
1285
- const c = ie(l) ? l : {}, d = { ...c };
1286
+ const m = Array.isArray(t.properties) ? t.properties : null;
1287
+ m ? t.properties = m.map((l, u) => {
1288
+ const c = ce(l) ? l : {}, p = { ...c };
1286
1289
  if (!c.name) {
1287
- const b = `Property at index ${p} missing 'name'`;
1288
- n ? s.push(b) : (a.push(`${b}, using 'field_${p}'`), d.name = `field_${p}`);
1290
+ const b = `Property at index ${u} missing 'name'`;
1291
+ n ? s.push(b) : (o.push(`${b}, using 'field_${u}'`), p.name = `field_${u}`);
1289
1292
  }
1290
- return c.displayName || (d.displayName = c.name || `Field ${p}`), c.type || (n && o ? s.push(`Property '${c.name || p}' missing 'type'`) : (a.push(`Property '${c.name || p}' missing 'type', using 'string'`), d.type = "string")), c.defaultValue === void 0 && (d.defaultValue = null), c.required === void 0 && (d.required = !1), d;
1291
- }) : n ? s.push("Properties must be an array") : (a.push("Properties not found or invalid, using empty array"), t.properties = []);
1292
- const m = s.length > 0;
1293
+ return c.displayName || (p.displayName = c.name || `Field ${u}`), c.type || (n && a ? s.push(`Property '${c.name || u}' missing 'type'`) : (o.push(`Property '${c.name || u}' missing 'type', using 'string'`), p.type = "string")), c.defaultValue === void 0 && (p.defaultValue = null), c.required === void 0 && (p.required = !1), p;
1294
+ }) : n ? s.push("Properties must be an array") : (o.push("Properties not found or invalid, using empty array"), t.properties = []);
1295
+ const d = s.length > 0;
1293
1296
  return {
1294
- success: !m,
1297
+ success: !d,
1295
1298
  data: t,
1296
- warnings: a.length > 0 ? a : void 0,
1297
- validationErrors: m ? s : void 0
1299
+ warnings: o.length > 0 ? o : void 0,
1300
+ validationErrors: d ? s : void 0
1298
1301
  };
1299
1302
  } catch (n) {
1300
1303
  return {
@@ -1307,16 +1310,16 @@ function Fr(e, r, n) {
1307
1310
  if (e instanceof Date)
1308
1311
  return e;
1309
1312
  if (typeof e == "number") {
1310
- const o = new Date(e);
1311
- if (n && isNaN(o.getTime()))
1313
+ const a = new Date(e);
1314
+ if (n && isNaN(a.getTime()))
1312
1315
  throw new Error(`Invalid timestamp: ${e}`);
1313
- return o;
1316
+ return a;
1314
1317
  }
1315
1318
  if (typeof e == "string") {
1316
- const o = new Date(e);
1317
- if (n && isNaN(o.getTime()))
1319
+ const a = new Date(e);
1320
+ if (n && isNaN(a.getTime()))
1318
1321
  throw new Error(`Invalid date string: ${e}`);
1319
- return o;
1322
+ return a;
1320
1323
  }
1321
1324
  if (n)
1322
1325
  throw new Error(`Cannot convert ${typeof e} to Date`);
@@ -1348,7 +1351,7 @@ function Ie(e, r) {
1348
1351
  throw new Error(`Cannot convert ${typeof e} to number`);
1349
1352
  return e;
1350
1353
  }
1351
- function Mr(e, r) {
1354
+ function $r(e, r) {
1352
1355
  if (typeof e == "boolean")
1353
1356
  return e;
1354
1357
  if (typeof e == "string") {
@@ -1372,56 +1375,56 @@ function Je(e, r, n) {
1372
1375
  throw new Error(`Expected array, got ${typeof e}`);
1373
1376
  return e;
1374
1377
  }
1375
- return e.map((o, t) => {
1378
+ return e.map((a, t) => {
1376
1379
  try {
1377
- return r === "integer" ? Ne(o, n) : Ie(o, n);
1378
- } catch (a) {
1380
+ return r === "integer" ? Ne(a, n) : Ie(a, n);
1381
+ } catch (o) {
1379
1382
  if (n)
1380
- throw new Error(`Array element ${t}: ${a}`);
1381
- return o;
1383
+ throw new Error(`Array element ${t}: ${o}`);
1384
+ return a;
1382
1385
  }
1383
1386
  });
1384
1387
  }
1385
- const Or = (e, r) => {
1388
+ const Mr = (e, r) => {
1386
1389
  const n = /* @__PURE__ */ new Map();
1387
- let o = null, t = null, a = 0;
1390
+ let a = null, t = null, o = 0;
1388
1391
  for (const s of e) {
1389
1392
  const i = s.group;
1390
1393
  if (!i) {
1391
- o = null, t = null;
1394
+ a = null, t = null;
1392
1395
  continue;
1393
1396
  }
1394
- if (i === o)
1397
+ if (i === a)
1395
1398
  r[s.name].group = t ?? i;
1396
1399
  else {
1397
1400
  if (!n.has(i))
1398
1401
  n.set(i, 1), t = null, r[s.name].group = i;
1399
1402
  else {
1400
- const u = n.get(i), m = `${i}(${u})`;
1401
- n.set(i, u + 1), t = m, r[s.name].group = m, a++;
1403
+ const m = n.get(i), d = `${i}(${m})`;
1404
+ n.set(i, m + 1), t = d, r[s.name].group = d, o++;
1402
1405
  }
1403
- o = i;
1406
+ a = i;
1404
1407
  }
1405
1408
  }
1406
- return a;
1407
- }, $r = (e, r = {}) => {
1408
- const { includeEmpty: n = !0 } = r, o = [];
1409
- let t = null, a = [], s = 0;
1410
- for (const u of e) {
1411
- const m = u.group || null;
1412
- m !== t ? ((a.length > 0 || n) && (a.length === 0 && s++, o.push({ name: t, fields: a })), t = m, a = [u]) : a.push(u);
1409
+ return o;
1410
+ }, Or = (e, r = {}) => {
1411
+ const { includeEmpty: n = !0 } = r, a = [];
1412
+ let t = null, o = [], s = 0;
1413
+ for (const m of e) {
1414
+ const d = m.group || null;
1415
+ d !== t ? ((o.length > 0 || n) && (o.length === 0 && s++, a.push({ name: t, fields: o })), t = d, o = [m]) : o.push(m);
1413
1416
  }
1414
- (a.length > 0 || n) && (a.length === 0 && s++, o.push({ name: t, fields: a }));
1415
- const i = Math.max(0, ...o.map((u) => u.fields.length));
1417
+ (o.length > 0 || n) && (o.length === 0 && s++, a.push({ name: t, fields: o }));
1418
+ const i = Math.max(0, ...a.map((m) => m.fields.length));
1416
1419
  return {
1417
- groups: o,
1420
+ groups: a,
1418
1421
  metadata: {
1419
- totalGroups: o.length,
1422
+ totalGroups: a.length,
1420
1423
  emptyGroups: s,
1421
1424
  largestGroup: i
1422
1425
  }
1423
1426
  };
1424
- }, ke = /* @__PURE__ */ new Map(), ye = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Set(), Ae = /* @__PURE__ */ new Map(), Vr = async (e) => {
1427
+ }, ke = /* @__PURE__ */ new Map(), ye = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Set(), Ae = /* @__PURE__ */ new Map(), Dr = async (e) => {
1425
1428
  try {
1426
1429
  let r;
1427
1430
  switch (e.toLowerCase()) {
@@ -1455,7 +1458,7 @@ const Or = (e, r) => {
1455
1458
  error: `Failed to load common translations for ${e}: ${r}`
1456
1459
  };
1457
1460
  }
1458
- }, Dr = async (e) => {
1461
+ }, Vr = async (e) => {
1459
1462
  if (!e)
1460
1463
  return { success: !1, translations: {}, error: "Language is required" };
1461
1464
  const r = e.toLowerCase();
@@ -1467,7 +1470,7 @@ const Or = (e, r) => {
1467
1470
  translations: ke.get(r) || {},
1468
1471
  fromCache: !0
1469
1472
  };
1470
- const n = await Vr(r);
1473
+ const n = await Dr(r);
1471
1474
  return n.success && (ke.set(r, n.translations), Ae.set(r, {
1472
1475
  loadedAt: /* @__PURE__ */ new Date(),
1473
1476
  size: Object.keys(n.translations).length,
@@ -1481,7 +1484,7 @@ const Or = (e, r) => {
1481
1484
  error: "Both language and localizeName are required"
1482
1485
  };
1483
1486
  const n = `${e.toLowerCase()}/${r}`;
1484
- if (se.has(n))
1487
+ if (ie.has(n))
1485
1488
  return {
1486
1489
  success: !1,
1487
1490
  translations: {},
@@ -1495,11 +1498,11 @@ const Or = (e, r) => {
1495
1498
  fromCache: !0
1496
1499
  };
1497
1500
  try {
1498
- let o = r;
1499
- !r.includes("/") && !r.includes(".") && (o = `/locales/${e}/${r}.json`);
1500
- const t = await fetch(o);
1501
+ let a = r;
1502
+ !r.includes("/") && !r.includes(".") && (a = `/locales/${e}/${r}.json`);
1503
+ const t = await fetch(a);
1501
1504
  if (!t.ok) {
1502
- const m = `HTTP ${t.status}: ${t.statusText}`;
1505
+ const d = `HTTP ${t.status}: ${t.statusText}`;
1503
1506
  return t.status === 404 ? (ye.set(n, {}), Ae.set(n, {
1504
1507
  loadedAt: /* @__PURE__ */ new Date(),
1505
1508
  size: 0,
@@ -1508,62 +1511,62 @@ const Or = (e, r) => {
1508
1511
  success: !0,
1509
1512
  translations: {},
1510
1513
  fromCache: !1
1511
- }) : (se.add(n), {
1514
+ }) : (ie.add(n), {
1512
1515
  success: !1,
1513
1516
  translations: {},
1514
- error: m
1517
+ error: d
1515
1518
  });
1516
1519
  }
1517
- const a = t.headers.get("content-type") || "";
1518
- !a.includes("application/json") && !a.includes("text/json") && sr() && console.warn(
1519
- `Translation file at ${o} has unexpected content-type: ${a}`
1520
+ const o = t.headers.get("content-type") || "";
1521
+ !o.includes("application/json") && !o.includes("text/json") && sr() && console.warn(
1522
+ `Translation file at ${a} has unexpected content-type: ${o}`
1520
1523
  );
1521
1524
  const s = await t.text();
1522
1525
  if (!s) {
1523
- const m = "Empty translation file";
1524
- return se.add(n), { success: !1, translations: {}, error: m };
1526
+ const d = "Empty translation file";
1527
+ return ie.add(n), { success: !1, translations: {}, error: d };
1525
1528
  }
1526
1529
  let i;
1527
1530
  try {
1528
1531
  i = JSON.parse(s);
1529
- } catch (m) {
1530
- const l = `Invalid JSON in translation file: ${m instanceof Error ? m.message : String(m)}`;
1531
- return se.add(n), { success: !1, translations: {}, error: l };
1532
+ } catch (d) {
1533
+ const l = `Invalid JSON in translation file: ${d instanceof Error ? d.message : String(d)}`;
1534
+ return ie.add(n), { success: !1, translations: {}, error: l };
1532
1535
  }
1533
1536
  if (!i || typeof i != "object") {
1534
- const m = "Invalid translation file format";
1535
- return se.add(n), {
1537
+ const d = "Invalid translation file format";
1538
+ return ie.add(n), {
1536
1539
  success: !1,
1537
1540
  translations: {},
1538
- error: m
1541
+ error: d
1539
1542
  };
1540
1543
  }
1541
- const u = Object.fromEntries(
1542
- Object.entries(i).map(([m, l]) => [
1543
- m,
1544
+ const m = Object.fromEntries(
1545
+ Object.entries(i).map(([d, l]) => [
1546
+ d,
1544
1547
  typeof l == "string" ? l : String(l)
1545
1548
  ])
1546
1549
  );
1547
- if (!u || typeof u != "object") {
1548
- const m = "Invalid translation file format";
1549
- return se.add(n), {
1550
+ if (!m || typeof m != "object") {
1551
+ const d = "Invalid translation file format";
1552
+ return ie.add(n), {
1550
1553
  success: !1,
1551
1554
  translations: {},
1552
- error: m
1555
+ error: d
1553
1556
  };
1554
1557
  }
1555
- return ye.set(n, u), Ae.set(n, {
1558
+ return ye.set(n, m), Ae.set(n, {
1556
1559
  loadedAt: /* @__PURE__ */ new Date(),
1557
- size: Object.keys(u).length,
1560
+ size: Object.keys(m).length,
1558
1561
  source: "user"
1559
1562
  }), {
1560
1563
  success: !0,
1561
- translations: u,
1564
+ translations: m,
1562
1565
  fromCache: !1
1563
1566
  };
1564
- } catch (o) {
1565
- const t = `Failed to load user translations: ${o instanceof Error ? o.message : "Unknown error"}`;
1566
- return se.add(n), {
1567
+ } catch (a) {
1568
+ const t = `Failed to load user translations: ${a instanceof Error ? a.message : "Unknown error"}`;
1569
+ return ie.add(n), {
1567
1570
  success: !1,
1568
1571
  translations: {},
1569
1572
  error: t
@@ -1579,23 +1582,23 @@ function sr() {
1579
1582
  return !1;
1580
1583
  }
1581
1584
  function Tr(e, r) {
1582
- return r.length === 0 ? e : e.replace(/\{\{(\d+)\}\}/g, (n, o) => {
1583
- const t = parseInt(o, 10) - 1, a = r[t];
1584
- if (a == null)
1585
+ return r.length === 0 ? e : e.replace(/\{\{(\d+)\}\}/g, (n, a) => {
1586
+ const t = parseInt(a, 10) - 1, o = r[t];
1587
+ if (o == null)
1585
1588
  return n;
1586
1589
  try {
1587
- return String(a);
1590
+ return String(o);
1588
1591
  } catch {
1589
1592
  return n;
1590
1593
  }
1591
1594
  });
1592
1595
  }
1593
- const Lr = (e, r, n) => (o, ...t) => {
1594
- let a = o, s = !1;
1595
- return !o || typeof o != "string" ? String(o || "") : (e.toLowerCase() === "en" ? (a = o, s = !0) : Object.prototype.hasOwnProperty.call(n, o) ? (a = n[o], s = !0) : Object.prototype.hasOwnProperty.call(r, o) ? (a = r[o], s = !0) : a = o, a = Tr(a, t), !s && sr() && console.debug(
1596
- `Missing translation for "${o}" in language "${e}"`
1597
- ), a);
1598
- }, De = {
1596
+ const Lr = (e, r, n) => (a, ...t) => {
1597
+ let o = a, s = !1;
1598
+ return !a || typeof a != "string" ? String(a || "") : (e.toLowerCase() === "en" ? (o = a, s = !0) : Object.prototype.hasOwnProperty.call(n, a) ? (o = n[a], s = !0) : Object.prototype.hasOwnProperty.call(r, a) ? (o = r[a], s = !0) : o = a, o = Tr(o, t), !s && sr() && console.debug(
1599
+ `Missing translation for "${a}" in language "${e}"`
1600
+ ), o);
1601
+ }, Ve = {
1599
1602
  length: ["m", "cm", "mm", "km", "in", "ft", "yd", "mi"],
1600
1603
  area: ["m^2", "cm^2", "mm^2", "in^2", "ft^2", "yd^2"],
1601
1604
  volume: ["L", "m^3", "cm^3", "mL", "in^3", "ft^3", "yd^3"],
@@ -1713,74 +1716,76 @@ const Lr = (e, r, n) => (o, ...t) => {
1713
1716
  rev: 1 / 360
1714
1717
  }
1715
1718
  }, Le = {}, Pr = /* @__PURE__ */ new Set([
1716
- ...Object.keys(De),
1719
+ ...Object.keys(Ve),
1717
1720
  ...Object.keys(ze),
1718
1721
  ...Object.keys(Te)
1719
1722
  ]);
1720
1723
  for (const e of Pr) {
1721
- const r = {}, n = De[e] ?? [], o = ze[e] ?? {}, t = Te[e] ?? {};
1722
- for (const a of n) {
1723
- const s = o[a];
1724
- r[a] = {
1725
- name: typeof s == "string" ? s : String(a),
1726
- shortName: a,
1727
- factor: Object.prototype.hasOwnProperty.call(t, a) ? t[a] : void 0
1724
+ const r = {}, n = Ve[e] ?? [], a = ze[e] ?? {}, t = Te[e] ?? {};
1725
+ for (const o of n) {
1726
+ const s = a[o];
1727
+ r[o] = {
1728
+ name: typeof s == "string" ? s : String(o),
1729
+ shortName: o,
1730
+ factor: Object.prototype.hasOwnProperty.call(t, o) ? t[o] : void 0
1728
1731
  };
1729
1732
  }
1730
- for (const [a, s] of Object.entries(o))
1731
- if (!r[a]) {
1732
- const i = typeof s == "string" ? s : String(a);
1733
- r[a] = { name: i, shortName: a, factor: Object.prototype.hasOwnProperty.call(t, a) ? t[a] : void 0 };
1733
+ for (const [o, s] of Object.entries(a))
1734
+ if (!r[o]) {
1735
+ const i = typeof s == "string" ? s : String(o);
1736
+ r[o] = { name: i, shortName: o, factor: Object.prototype.hasOwnProperty.call(t, o) ? t[o] : void 0 };
1734
1737
  }
1735
- for (const [a, s] of Object.entries(t))
1736
- r[a] || (r[a] = { name: String(a), shortName: String(a), factor: s });
1738
+ for (const [o, s] of Object.entries(t))
1739
+ r[o] || (r[o] = { name: String(o), shortName: String(o), factor: s });
1737
1740
  Le[e] = r;
1738
1741
  }
1739
- const on = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1742
+ const an = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1740
1743
  __proto__: null,
1741
1744
  dimensionUnitDisplayMap: ze,
1742
- dimensionUnitsMap: De,
1745
+ dimensionUnitsMap: Ve,
1743
1746
  dimensonUnitFactorsMap: Te,
1744
1747
  unitsByDimension: Le
1745
1748
  }, Symbol.toStringTag, { value: "Module" })), _r = ({
1746
1749
  field: e,
1747
1750
  value: r,
1748
1751
  onChange: n,
1749
- onError: o
1752
+ onError: a
1750
1753
  }) => {
1751
- const { definitionName: t, t: a } = T(), s = k(o);
1752
- C(() => {
1753
- s.current = o;
1754
- }, [o]), C(() => {
1755
- const l = Y(t, e, r ?? !1, a);
1756
- s.current?.(l ?? null);
1757
- }, [r, e, t, a]);
1758
- const i = (l) => {
1759
- const p = l.target.checked;
1760
- n?.(p, null);
1761
- }, u = (l) => {
1762
- (l.key === " " || l.key === "Spacebar" || l.key === "Space" || l.key === "Enter") && (l.preventDefault(), n?.(!r, null));
1763
- }, m = e.name;
1764
- return /* @__PURE__ */ g.jsx(W, { field: e, rightAlign: !1, children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
1754
+ const { definitionName: t, t: o } = L(), s = E(a);
1755
+ k(() => {
1756
+ s.current = a;
1757
+ }, [a]), k(() => {
1758
+ const u = H(t, e, r ?? !1, o);
1759
+ s.current?.(u ?? null);
1760
+ }, [r, e, t, o]);
1761
+ const i = (u) => {
1762
+ const c = u.target.checked;
1763
+ n?.(c, null);
1764
+ }, m = (u) => {
1765
+ (u.key === " " || u.key === "Spacebar" || u.key === "Space" || u.key === "Enter") && (u.preventDefault(), n?.(!r, null));
1766
+ }, d = e.name, l = H(t, e, r ?? !1, o);
1767
+ return /* @__PURE__ */ g.jsx(U, { field: e, rightAlign: !1, children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
1765
1768
  /* @__PURE__ */ g.jsx(
1766
1769
  "label",
1767
1770
  {
1768
- className: $.label,
1769
- htmlFor: m,
1771
+ className: M.label,
1772
+ htmlFor: d,
1770
1773
  style: { textAlign: "left", justifyContent: "flex-start" },
1771
- children: a(e.displayName)
1774
+ children: o(e.displayName)
1772
1775
  }
1773
1776
  ),
1774
1777
  /* @__PURE__ */ g.jsx(
1775
1778
  "input",
1776
1779
  {
1777
- id: m,
1780
+ id: d,
1778
1781
  "data-testid": "boolean-checkbox",
1779
1782
  type: "checkbox",
1780
1783
  checked: !!r,
1781
1784
  onChange: i,
1782
- onKeyDown: u,
1785
+ onKeyDown: m,
1783
1786
  "aria-checked": !!r,
1787
+ "aria-invalid": !!l,
1788
+ "aria-describedby": l ? `${e.name}-error` : void 0,
1784
1789
  style: {
1785
1790
  cursor: "pointer",
1786
1791
  margin: "8px 0 8px 0",
@@ -1825,45 +1830,47 @@ function qr(e) {
1825
1830
  function cr(e) {
1826
1831
  return e ? (e = e.toLowerCase(), /^#([a-f0-9]){3}$/i.test(e) ? "#" + e.slice(1).split("").map((r) => r + r).join("") : e) : "#000000";
1827
1832
  }
1828
- const Br = ({ field: e, value: r, onChange: n, onError: o }) => {
1829
- const { t, definitionName: a } = T(), [s, i] = D("#000000"), u = N.useRef(null), m = N.useRef(null), l = N.useRef(o);
1830
- N.useEffect(() => {
1831
- l.current = o;
1832
- }, [o]), C(() => {
1833
- const x = r && ir(r) ? r : "#000000", v = cr(x);
1834
- i(v);
1835
- }, [r]), N.useEffect(() => {
1836
- const x = Y(a, e, r ?? "#000000", t);
1833
+ const Br = ({ field: e, value: r, onChange: n, onError: a }) => {
1834
+ const { t, definitionName: o } = L(), [s, i] = V("#000000"), m = F.useRef(null), d = F.useRef(null), l = F.useRef(a);
1835
+ F.useEffect(() => {
1836
+ l.current = a;
1837
+ }, [a]), k(() => {
1838
+ const x = r && ir(r) ? r : "#000000", j = cr(x);
1839
+ i(j);
1840
+ }, [r]), F.useEffect(() => {
1841
+ const x = H(o, e, r ?? "#000000", t);
1837
1842
  l.current?.(x ?? null);
1838
- }, [r, e, a, t]);
1839
- const p = (x) => {
1840
- const v = x.target.value;
1841
- i(v), n?.(v, null);
1842
- }, c = (x) => {
1843
- const v = x.target.value;
1844
- i(v), n?.(v, null);
1845
- }, d = Ge.find(
1843
+ }, [r, e, o, t]);
1844
+ const u = H(o, e, r ?? "#000000", t), c = (x) => {
1845
+ const j = x.target.value;
1846
+ i(j), n?.(j, null);
1847
+ }, p = (x) => {
1848
+ const j = x.target.value;
1849
+ i(j), n?.(j, null);
1850
+ }, b = Ge.find(
1846
1851
  (x) => x.value === s
1847
- ), { r: b, g: f, b: y } = qr(s) || { r: 0, g: 0, b: 0 };
1848
- return /* @__PURE__ */ g.jsx(W, { field: e, error: null, children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", width: "100%" }, children: [
1852
+ ), { r: f, g: y, b: C } = qr(s) || { r: 0, g: 0, b: 0 };
1853
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: u, children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", width: "100%" }, children: [
1849
1854
  /* @__PURE__ */ g.jsxs(
1850
1855
  "select",
1851
1856
  {
1852
- ref: u,
1857
+ ref: m,
1853
1858
  id: e.name,
1854
1859
  value: s,
1855
- onChange: p,
1860
+ onChange: c,
1856
1861
  style: { minWidth: "120px", flex: 1 },
1857
- className: K($.input, $.inputSelect),
1862
+ className: G(M.input, M.inputSelect),
1863
+ "aria-invalid": !!u,
1864
+ "aria-describedby": u ? `${e.name}-error` : void 0,
1858
1865
  children: [
1859
1866
  Ge.map((x) => /* @__PURE__ */ g.jsx("option", { value: x.value, children: t(x.label) }, x.value)),
1860
- d ? null : /* @__PURE__ */ g.jsxs("option", { value: s, children: [
1867
+ b ? null : /* @__PURE__ */ g.jsxs("option", { value: s, children: [
1861
1868
  "(",
1862
- b,
1863
- ", ",
1864
1869
  f,
1865
1870
  ", ",
1866
1871
  y,
1872
+ ", ",
1873
+ C,
1867
1874
  ")"
1868
1875
  ] }, s)
1869
1876
  ]
@@ -1886,10 +1893,11 @@ const Br = ({ field: e, value: r, onChange: n, onError: o }) => {
1886
1893
  children: /* @__PURE__ */ g.jsx(
1887
1894
  "input",
1888
1895
  {
1889
- ref: m,
1896
+ ref: d,
1897
+ id: `${e.name}-color`,
1890
1898
  type: "color",
1891
1899
  value: s,
1892
- onChange: c,
1900
+ onChange: p,
1893
1901
  style: {
1894
1902
  opacity: 0,
1895
1903
  width: "100%",
@@ -1897,7 +1905,9 @@ const Br = ({ field: e, value: r, onChange: n, onError: o }) => {
1897
1905
  border: "none",
1898
1906
  padding: 0,
1899
1907
  cursor: "pointer"
1900
- }
1908
+ },
1909
+ "aria-invalid": !!u,
1910
+ "aria-describedby": u ? `${e.name}-error` : void 0
1901
1911
  }
1902
1912
  )
1903
1913
  }
@@ -1913,21 +1923,21 @@ const Br = ({ field: e, value: r, onChange: n, onError: o }) => {
1913
1923
  return ge(e) ? e : "";
1914
1924
  const n = ge(e);
1915
1925
  if (n) {
1916
- const o = n.getFullYear(), t = String(n.getMonth() + 1).padStart(2, "0"), a = String(n.getDate()).padStart(2, "0");
1917
- return `${o}-${t}-${a}`;
1926
+ const a = n.getFullYear(), t = String(n.getMonth() + 1).padStart(2, "0"), o = String(n.getDate()).padStart(2, "0");
1927
+ return `${a}-${t}-${o}`;
1918
1928
  }
1919
1929
  return "";
1920
1930
  }, Ur = ({
1921
1931
  field: e,
1922
1932
  value: r,
1923
1933
  onChange: n,
1924
- onError: o
1934
+ onError: a
1925
1935
  }) => {
1926
- const { t, definitionName: a } = T(), { name: s, required: i } = e, u = k(null), m = k(o);
1927
- C(() => {
1928
- m.current = o;
1929
- }, [o]);
1930
- const l = N.useCallback((c) => {
1936
+ const { t, definitionName: o } = L(), { name: s, required: i } = e, m = E(null), d = E(a);
1937
+ k(() => {
1938
+ d.current = a;
1939
+ }, [a]);
1940
+ const l = F.useCallback((c) => {
1931
1941
  if (!c || c.trim() === "")
1932
1942
  return i ? t("Value required") : null;
1933
1943
  if (c) {
@@ -1944,22 +1954,22 @@ const Br = ({ field: e, value: r, onChange: n, onError: o }) => {
1944
1954
  return t("Date must be on or before {{1}}", e.maxDate);
1945
1955
  }
1946
1956
  }
1947
- return Y(a, e, c, t) ?? null;
1948
- }, [e, a, t, i]), p = (c) => {
1949
- const d = c.target.value, b = l(d);
1950
- n?.(d, b);
1957
+ return H(o, e, c, t) ?? null;
1958
+ }, [e, o, t, i]), u = (c) => {
1959
+ const p = c.target.value, b = l(p);
1960
+ n?.(p, b);
1951
1961
  };
1952
- return C(() => {
1962
+ return k(() => {
1953
1963
  const c = l(r);
1954
- c !== u.current && (u.current = c, m.current?.(c ?? null));
1955
- }, [r, l]), /* @__PURE__ */ g.jsx(W, { field: e, error: l(r), children: /* @__PURE__ */ g.jsx(
1964
+ c !== m.current && (m.current = c, d.current?.(c ?? null));
1965
+ }, [r, l]), /* @__PURE__ */ g.jsx(U, { field: e, error: l(r), children: /* @__PURE__ */ g.jsx(
1956
1966
  "input",
1957
1967
  {
1958
1968
  id: s,
1959
1969
  type: "date",
1960
1970
  value: Hr(r),
1961
- onChange: p,
1962
- className: K($.input, $.textInput),
1971
+ onChange: u,
1972
+ className: G(M.input, M.textInput),
1963
1973
  ...e.minDate ? { min: e.minDate } : {},
1964
1974
  ...e.maxDate ? { max: e.maxDate } : {},
1965
1975
  "aria-invalid": !!l(r),
@@ -1970,37 +1980,40 @@ const Br = ({ field: e, value: r, onChange: n, onError: o }) => {
1970
1980
  field: e,
1971
1981
  value: r,
1972
1982
  onChange: n,
1973
- onError: o
1983
+ onError: a
1974
1984
  }) => {
1975
- const { t, definitionName: a } = T(), s = k(null), i = k(o);
1976
- C(() => {
1977
- i.current = o;
1978
- }, [o]);
1979
- const u = Z(
1980
- (l) => l === "" || l === null || l === void 0 ? t("Value required") : !e.options || e.options.length === 0 ? null : e.options.some((c) => c.value === l) ? Y(a, e, l, t) ?? null : t("Invalid option selected"),
1981
- [e, t, a]
1985
+ const { t, definitionName: o } = L(), s = E(null), i = E(a);
1986
+ k(() => {
1987
+ i.current = a;
1988
+ }, [a]);
1989
+ const m = X(
1990
+ (l) => l === "" || l === null || l === void 0 ? t("Value required") : !e.options || e.options.length === 0 ? null : e.options.some((c) => c.value === l) ? H(o, e, l, t) ?? null : t("Invalid option selected"),
1991
+ [e, t, o]
1982
1992
  );
1983
- C(() => {
1984
- const l = r != null ? String(r) : "", p = u(l);
1985
- if (p && e.options && e.options.length > 0) {
1993
+ k(() => {
1994
+ const l = r != null ? String(r) : "", u = m(l);
1995
+ if (u && e.options && e.options.length > 0) {
1986
1996
  const c = String(e.options[0].value);
1987
1997
  s.current && (s.current.value = c), n?.(c, null), i.current?.(null);
1988
1998
  } else
1989
- s.current && (s.current.value = l), i.current?.(p ?? null);
1990
- }, [r, u, n, e.options]);
1991
- const m = (l) => {
1992
- const p = l.target.value, c = u(p);
1993
- n?.(p, c);
1999
+ s.current && (s.current.value = l), i.current?.(u ?? null);
2000
+ }, [r, m, n, e.options]);
2001
+ const d = (l) => {
2002
+ const u = l.target.value, c = m(u);
2003
+ n?.(u, c);
1994
2004
  };
1995
- return /* @__PURE__ */ g.jsx(W, { field: e, error: u(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
2005
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: m(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
1996
2006
  "select",
1997
2007
  {
2008
+ id: e.name,
2009
+ "aria-invalid": !!m(String(r ?? "")),
2010
+ "aria-describedby": m(String(r ?? "")) ? `${e.name}-error` : void 0,
1998
2011
  defaultValue: String(r ?? ""),
1999
2012
  ref: s,
2000
- onChange: m,
2001
- className: K(
2002
- $.input,
2003
- $.inputSelect
2013
+ onChange: d,
2014
+ className: G(
2015
+ M.input,
2016
+ M.inputSelect
2004
2017
  ),
2005
2018
  children: (e.options ?? []).map((l) => /* @__PURE__ */ g.jsx("option", { value: String(l.value), children: t(l.label) }, String(l.value)))
2006
2019
  }
@@ -2013,40 +2026,42 @@ const Jr = ({
2013
2026
  field: e,
2014
2027
  value: r,
2015
2028
  onChange: n,
2016
- onError: o
2029
+ onError: a
2017
2030
  }) => {
2018
- const { definitionName: t, t: a } = T(), s = k(null), i = N.useCallback(
2019
- (p) => {
2020
- const c = p.trim();
2021
- return c === "" ? e.required ? a("Value required") : null : Yr(c) ? e.pattern && !new RegExp(e.pattern).test(c) ? a("Email does not match pattern: {{%1}}", {
2031
+ const { definitionName: t, t: o } = L(), s = E(null), i = F.useCallback(
2032
+ (u) => {
2033
+ const c = u.trim();
2034
+ return c === "" ? e.required ? o("Value required") : null : Yr(c) ? e.pattern && !new RegExp(e.pattern).test(c) ? e.patternErrorMessage ? o(e.patternErrorMessage) : o("Email does not match pattern: {{%1}}", {
2022
2035
  "%1": `${e.pattern}`
2023
- }) : Y(t, e, p, a) ?? null : a("Must be valid email format");
2036
+ }) : H(t, e, u, o) ?? null : o("Must be valid email format");
2024
2037
  },
2025
- [e, t, a]
2026
- ), u = (p) => {
2027
- const c = p.target.value, d = i(c);
2028
- n?.(c, d);
2029
- }, m = k(null), l = k(o);
2030
- return C(() => {
2031
- l.current = o;
2032
- }, [o]), C(() => {
2033
- const p = r ?? "", c = i(p);
2034
- s.current && s.current.value !== String(p) && (s.current.value = String(p)), c !== m.current && (m.current = c, l.current?.(c ?? null));
2035
- }, [r, i]), /* @__PURE__ */ g.jsx(W, { field: e, error: i(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
2038
+ [e, t, o]
2039
+ ), m = (u) => {
2040
+ const c = u.target.value, p = i(c);
2041
+ n?.(c, p);
2042
+ }, d = E(null), l = E(a);
2043
+ return k(() => {
2044
+ l.current = a;
2045
+ }, [a]), k(() => {
2046
+ const u = r ?? "", c = i(u);
2047
+ s.current && s.current.value !== String(u) && (s.current.value = String(u)), c !== d.current && (d.current = c, l.current?.(c ?? null));
2048
+ }, [r, i]), /* @__PURE__ */ g.jsx(U, { field: e, error: i(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
2036
2049
  "input",
2037
2050
  {
2038
2051
  id: e.name,
2039
2052
  type: "email",
2040
2053
  defaultValue: String(r ?? ""),
2041
2054
  ref: s,
2042
- onChange: u,
2043
- className: K($.input, $.textInput)
2055
+ onChange: m,
2056
+ className: G(M.input, M.textInput),
2057
+ "aria-invalid": !!i(String(r ?? "")),
2058
+ "aria-describedby": i(String(r ?? "")) ? `${e.name}-error` : void 0
2044
2059
  }
2045
2060
  ) });
2046
2061
  }, Gr = ({ field: e }) => {
2047
- const { darkMode: r } = T(), {
2062
+ const { darkMode: r } = L(), {
2048
2063
  color: n = r ? "#444444" : "#CCCCCC",
2049
- thickness: o = 1,
2064
+ thickness: a = 1,
2050
2065
  margin: t = "8px 0"
2051
2066
  } = e;
2052
2067
  return /* @__PURE__ */ g.jsx(
@@ -2056,63 +2071,63 @@ const Jr = ({
2056
2071
  width: "auto",
2057
2072
  height: "0",
2058
2073
  // ensures only 1 line
2059
- borderTop: `${o}px solid ${n}`,
2074
+ borderTop: `${a}px solid ${n}`,
2060
2075
  margin: t
2061
2076
  }
2062
2077
  }
2063
2078
  );
2064
- }, Kr = ({ field: e, value: r, onChange: n, onError: o }) => {
2065
- const { t, definitionName: a } = T(), [s, i] = D(!1), u = k(null), m = k(o);
2066
- C(() => {
2067
- m.current = o;
2068
- }, [o]);
2069
- const l = N.useCallback(
2070
- (v) => e.required && (!v || Array.isArray(v) && v.length === 0) ? t("Value required") : Y(a, e, v, t) ?? null,
2071
- [e, a, t]
2072
- ), p = N.useMemo(() => l(r), [r, l]);
2073
- C(() => {
2074
- const v = l(r);
2075
- n?.(r, v), m.current?.(v ?? null);
2079
+ }, Kr = ({ field: e, value: r, onChange: n, onError: a }) => {
2080
+ const { t, definitionName: o } = L(), [s, i] = V(!1), m = E(null), d = E(a);
2081
+ k(() => {
2082
+ d.current = a;
2083
+ }, [a]);
2084
+ const l = F.useCallback(
2085
+ (x) => e.required && (!x || Array.isArray(x) && x.length === 0) ? t("Value required") : H(o, e, x, t) ?? null,
2086
+ [e, o, t]
2087
+ ), u = F.useMemo(() => l(r), [r, l]);
2088
+ k(() => {
2089
+ const x = l(r);
2090
+ n?.(r, x), d.current?.(x ?? null);
2076
2091
  }, [r, l]);
2077
- const c = (v) => {
2078
- const F = v.target.files;
2079
- let R = null;
2080
- if (F && F.length > 0) {
2081
- const j = Array.from(F);
2082
- e.multiple ? R = [...Array.isArray(r) ? r : [], ...j] : R = j[0];
2092
+ const c = (x) => {
2093
+ const j = x.target.files;
2094
+ let N = null;
2095
+ if (j && j.length > 0) {
2096
+ const w = Array.from(j);
2097
+ e.multiple ? N = [...Array.isArray(r) ? r : [], ...w] : N = w[0];
2083
2098
  }
2084
- const w = l(R);
2085
- n?.(R, w);
2086
- }, d = (v) => {
2087
- v.preventDefault(), v.stopPropagation(), i(!1);
2088
- const F = v.dataTransfer.files;
2089
- if (F && F.length > 0) {
2090
- const R = Array.from(F);
2091
- let w = null;
2092
- e.multiple ? w = [...Array.isArray(r) ? r : [], ...R] : w = R[0];
2093
- const j = l(w);
2094
- n?.(w, j);
2099
+ const v = l(N);
2100
+ n?.(N, v);
2101
+ }, p = (x) => {
2102
+ x.preventDefault(), x.stopPropagation(), i(!1);
2103
+ const j = x.dataTransfer.files;
2104
+ if (j && j.length > 0) {
2105
+ const N = Array.from(j);
2106
+ let v = null;
2107
+ e.multiple ? v = [...Array.isArray(r) ? r : [], ...N] : v = N[0];
2108
+ const w = l(v);
2109
+ n?.(v, w);
2095
2110
  }
2096
- }, b = (v) => {
2097
- v.preventDefault(), v.stopPropagation(), i(!0);
2098
- }, f = (v) => {
2099
- v.preventDefault(), v.stopPropagation(), i(!1);
2100
- }, y = (v) => {
2101
- if (Array.isArray(r) && typeof v == "number") {
2102
- const F = r.filter((j, I) => I !== v), R = F.length > 0 ? F : null, w = l(R);
2103
- n?.(R, w);
2111
+ }, b = (x) => {
2112
+ x.preventDefault(), x.stopPropagation(), i(!0);
2113
+ }, f = (x) => {
2114
+ x.preventDefault(), x.stopPropagation(), i(!1);
2115
+ }, y = (x) => {
2116
+ if (Array.isArray(r) && typeof x == "number") {
2117
+ const j = r.filter((w, I) => I !== x), N = j.length > 0 ? j : null, v = l(N);
2118
+ n?.(N, v);
2104
2119
  } else {
2105
- const F = l(null);
2106
- n?.(null, F);
2120
+ const j = l(null);
2121
+ n?.(null, j);
2107
2122
  }
2108
- }, x = () => {
2109
- const v = Array.isArray(r) ? r : r ? [r] : [];
2110
- return v.length === 0 ? null : /* @__PURE__ */ g.jsx("div", { style: {
2123
+ }, C = () => {
2124
+ const x = Array.isArray(r) ? r : r ? [r] : [];
2125
+ return x.length === 0 ? null : /* @__PURE__ */ g.jsx("div", { style: {
2111
2126
  marginTop: "8px",
2112
2127
  display: "flex",
2113
2128
  flexDirection: "column",
2114
2129
  gap: "6px"
2115
- }, children: v.map((F, R) => /* @__PURE__ */ g.jsxs(
2130
+ }, children: x.map((j, N) => /* @__PURE__ */ g.jsxs(
2116
2131
  "div",
2117
2132
  {
2118
2133
  style: {
@@ -2133,12 +2148,12 @@ const Jr = ({
2133
2148
  overflow: "hidden",
2134
2149
  textOverflow: "ellipsis",
2135
2150
  whiteSpace: "nowrap"
2136
- }, children: F.name }),
2151
+ }, children: j.name }),
2137
2152
  /* @__PURE__ */ g.jsx(
2138
2153
  "button",
2139
2154
  {
2140
2155
  type: "button",
2141
- onClick: () => y(Array.isArray(r) ? R : void 0),
2156
+ onClick: () => y(Array.isArray(r) ? N : void 0),
2142
2157
  "aria-label": t("Remove file"),
2143
2158
  style: {
2144
2159
  background: "transparent",
@@ -2152,30 +2167,30 @@ const Jr = ({
2152
2167
  transition: "background-color 0.2s",
2153
2168
  flexShrink: 0
2154
2169
  },
2155
- onMouseEnter: (w) => {
2156
- w.currentTarget.style.backgroundColor = "var(--reactaform-bg-hover, #fee)";
2170
+ onMouseEnter: (v) => {
2171
+ v.currentTarget.style.backgroundColor = "var(--reactaform-bg-hover, #fee)";
2157
2172
  },
2158
- onMouseLeave: (w) => {
2159
- w.currentTarget.style.backgroundColor = "transparent";
2173
+ onMouseLeave: (v) => {
2174
+ v.currentTarget.style.backgroundColor = "transparent";
2160
2175
  },
2161
2176
  children: "×"
2162
2177
  }
2163
2178
  )
2164
2179
  ]
2165
2180
  },
2166
- `${F.name}-${R}`
2181
+ `${j.name}-${N}`
2167
2182
  )) });
2168
2183
  };
2169
- return /* @__PURE__ */ g.jsx(W, { field: e, error: p, children: /* @__PURE__ */ g.jsxs("div", { style: { width: "100%" }, children: [
2184
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: u, children: /* @__PURE__ */ g.jsxs("div", { style: { width: "100%" }, children: [
2170
2185
  /* @__PURE__ */ g.jsxs(
2171
2186
  "div",
2172
2187
  {
2173
- onDrop: d,
2188
+ onDrop: p,
2174
2189
  onDragOver: b,
2175
2190
  onDragLeave: f,
2176
2191
  style: {
2177
2192
  position: "relative",
2178
- border: `1px dashed ${s ? "var(--reactaform-color-primary, #2563eb)" : p ? "var(--reactaform-color-error, #ef4444)" : "var(--reactaform-border-color, #d1d5db)"}`,
2193
+ border: `1px dashed ${s ? "var(--reactaform-color-primary, #2563eb)" : u ? "var(--reactaform-color-error, #ef4444)" : "var(--reactaform-border-color, #d1d5db)"}`,
2179
2194
  borderRadius: "var(--reactaform-border-radius, 4px)",
2180
2195
  padding: "8px 12px",
2181
2196
  textAlign: "center",
@@ -2192,13 +2207,20 @@ const Jr = ({
2192
2207
  justifyContent: "center",
2193
2208
  gap: "8px"
2194
2209
  },
2195
- onClick: () => u.current?.click(),
2210
+ onClick: () => m.current?.click(),
2211
+ onKeyDown: (x) => {
2212
+ (x.key === "Enter" || x.key === " ") && (x.preventDefault(), m.current?.click());
2213
+ },
2214
+ role: "button",
2215
+ "aria-label": e.multiple ? t("Choose Files or Drag & Drop") : t("Choose File or Drag & Drop"),
2216
+ "aria-invalid": !!u,
2217
+ "aria-describedby": u ? `${e.name}-error` : void 0,
2196
2218
  children: [
2197
2219
  /* @__PURE__ */ g.jsx(
2198
2220
  "input",
2199
2221
  {
2200
2222
  id: e.name,
2201
- ref: u,
2223
+ ref: m,
2202
2224
  type: "file",
2203
2225
  accept: e.accept,
2204
2226
  multiple: e.multiple,
@@ -2232,7 +2254,7 @@ const Jr = ({
2232
2254
  ]
2233
2255
  }
2234
2256
  ),
2235
- x()
2257
+ C()
2236
2258
  ] }) });
2237
2259
  }, Xr = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/;
2238
2260
  function Zr(e) {
@@ -2242,22 +2264,22 @@ const Qr = (e) => !e || e.trim() === "" ? [] : e.split(",").map((r) => r.trim())
2242
2264
  field: e,
2243
2265
  value: r,
2244
2266
  onChange: n,
2245
- onError: o
2267
+ onError: a
2246
2268
  }) => {
2247
- const { t, definitionName: a } = T(), [s, i] = D(
2269
+ const { t, definitionName: o } = L(), [s, i] = V(
2248
2270
  Array.isArray(r) ? r.join(", ") : String(r ?? "")
2249
- ), u = N.useCallback(
2271
+ ), m = F.useCallback(
2250
2272
  (c) => {
2251
2273
  if (c.trim() === "")
2252
2274
  return e.required ? t("Value required") : null;
2253
2275
  if (!Zr(c))
2254
2276
  return t("Each value must be a valid float");
2255
- const d = Qr(c);
2256
- if (e.minCount !== void 0 && d.length < e.minCount)
2277
+ const p = Qr(c);
2278
+ if (e.minCount !== void 0 && p.length < e.minCount)
2257
2279
  return t("Minimum number of values: {{1}}", e.minCount);
2258
- if (e.maxCount !== void 0 && d.length > e.maxCount)
2280
+ if (e.maxCount !== void 0 && p.length > e.maxCount)
2259
2281
  return t("Maximum number of values: {{1}}", e.maxCount);
2260
- for (const f of d) {
2282
+ for (const f of p) {
2261
2283
  if (e.min !== void 0 && (e.minInclusive ? f < e.min : f <= e.min))
2262
2284
  return t(
2263
2285
  "Each value must be {{1}} {{2}}",
@@ -2271,26 +2293,29 @@ const Qr = (e) => !e || e.trim() === "" ? [] : e.split(",").map((r) => r.trim())
2271
2293
  e.max
2272
2294
  );
2273
2295
  }
2274
- return Y(a, e, d, t) ?? null;
2296
+ return H(o, e, p, t) ?? null;
2275
2297
  },
2276
- [a, e, t]
2277
- ), m = (c) => {
2278
- const d = c.target.value, b = u(d);
2279
- i(d), n?.(d, b);
2280
- }, l = k(null), p = k(o);
2281
- return C(() => {
2282
- p.current = o;
2283
- }, [o]), C(() => {
2284
- const c = Array.isArray(r) ? r.join(", ") : String(r ?? ""), d = u(c);
2285
- d !== l.current && (l.current = d, p.current?.(d ?? null));
2286
- }, [r, e.required, u, t]), /* @__PURE__ */ g.jsx(W, { field: e, error: u(s), children: /* @__PURE__ */ g.jsx(
2298
+ [o, e, t]
2299
+ ), d = (c) => {
2300
+ const p = c.target.value, b = m(p);
2301
+ i(p), n?.(p, b);
2302
+ }, l = E(null), u = E(a);
2303
+ return k(() => {
2304
+ u.current = a;
2305
+ }, [a]), k(() => {
2306
+ const c = Array.isArray(r) ? r.join(", ") : String(r ?? ""), p = m(c);
2307
+ p !== l.current && (l.current = p, u.current?.(p ?? null));
2308
+ }, [r, e.required, m, t]), /* @__PURE__ */ g.jsx(U, { field: e, error: m(s), children: /* @__PURE__ */ g.jsx(
2287
2309
  "input",
2288
2310
  {
2311
+ id: e.name,
2289
2312
  type: "text",
2290
2313
  value: s,
2291
- onChange: m,
2292
- className: K($.input, $.textInput),
2293
- style: { flex: 1 }
2314
+ onChange: d,
2315
+ className: G(M.input, M.textInput),
2316
+ style: { flex: 1 },
2317
+ "aria-invalid": !!m(s),
2318
+ "aria-describedby": m(s) ? `${e.name}-error` : void 0
2294
2319
  }
2295
2320
  ) });
2296
2321
  }, rt = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/, tt = (e) => {
@@ -2300,15 +2325,15 @@ const Qr = (e) => !e || e.trim() === "" ? [] : e.split(",").map((r) => r.trim())
2300
2325
  field: e,
2301
2326
  value: r,
2302
2327
  onChange: n,
2303
- onError: o
2328
+ onError: a
2304
2329
  }) => {
2305
- const { t, definitionName: a } = T(), s = k(null), i = N.useCallback(
2306
- (p) => {
2307
- if (p.trim() === "")
2330
+ const { t, definitionName: o } = L(), s = E(null), i = F.useCallback(
2331
+ (u) => {
2332
+ if (u.trim() === "")
2308
2333
  return e.required ? t("Value required") : null;
2309
- if (!rt.test(p))
2334
+ if (!rt.test(u))
2310
2335
  return t("Must be a valid float");
2311
- const c = tt(p);
2336
+ const c = tt(u);
2312
2337
  return c === null ? t("Must be a valid float") : e.min !== void 0 && (e.minInclusive ? c < e.min : c <= e.min) ? t(
2313
2338
  "Must be {{1}} {{2}}",
2314
2339
  e.minInclusive ? "≥" : ">",
@@ -2317,21 +2342,21 @@ const Qr = (e) => !e || e.trim() === "" ? [] : e.split(",").map((r) => r.trim())
2317
2342
  "Must be {{1}} {{2}}",
2318
2343
  e.maxInclusive ? "≤" : "<",
2319
2344
  e.max
2320
- ) : Y(a, e, c, t) ?? null;
2345
+ ) : H(o, e, c, t) ?? null;
2321
2346
  },
2322
- [e, a, t]
2323
- ), u = k(null), m = k(o);
2324
- C(() => {
2325
- m.current = o;
2326
- }, [o]), C(() => {
2327
- const p = String(r ?? ""), c = i(p);
2328
- c !== u.current && (u.current = c, m.current?.(c ?? null)), s.current && document.activeElement !== s.current && (s.current.value = p);
2347
+ [e, o, t]
2348
+ ), m = E(null), d = E(a);
2349
+ k(() => {
2350
+ d.current = a;
2351
+ }, [a]), k(() => {
2352
+ const u = String(r ?? ""), c = i(u);
2353
+ c !== m.current && (m.current = c, d.current?.(c ?? null)), s.current && document.activeElement !== s.current && (s.current.value = u);
2329
2354
  }, [r, e, i, t]);
2330
- const l = (p) => {
2331
- const c = p.target.value, d = i(c);
2332
- n?.(c, d);
2355
+ const l = (u) => {
2356
+ const c = u.target.value, p = i(c);
2357
+ n?.(c, p);
2333
2358
  };
2334
- return /* @__PURE__ */ g.jsx(W, { field: e, error: i(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
2359
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: i(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
2335
2360
  "input",
2336
2361
  {
2337
2362
  id: e.name,
@@ -2339,14 +2364,16 @@ const Qr = (e) => !e || e.trim() === "" ? [] : e.split(",").map((r) => r.trim())
2339
2364
  defaultValue: String(r ?? ""),
2340
2365
  ref: s,
2341
2366
  onChange: l,
2342
- className: K(
2343
- $.input,
2344
- $.inputNumber
2345
- )
2367
+ className: G(
2368
+ M.input,
2369
+ M.inputNumber
2370
+ ),
2371
+ "aria-invalid": !!i(String(r ?? "")),
2372
+ "aria-describedby": i(String(r ?? "")) ? `${e.name}-error` : void 0
2346
2373
  }
2347
2374
  ) });
2348
2375
  };
2349
- function ot() {
2376
+ function at() {
2350
2377
  try {
2351
2378
  return "/";
2352
2379
  } catch {
@@ -2358,59 +2385,59 @@ function ot() {
2358
2385
  }
2359
2386
  return "/";
2360
2387
  }
2361
- const at = ({ field: e, value: r }) => {
2362
- const { language: n, t: o } = T(), t = e.alignment || "center", a = {
2388
+ const ot = ({ field: e, value: r }) => {
2389
+ const { language: n, t: a } = L(), t = e.alignment || "center", o = {
2363
2390
  left: "flex-start",
2364
2391
  center: "center",
2365
2392
  right: "flex-end"
2366
2393
  }, s = typeof r == "string" ? r : "";
2367
2394
  let i = s && s.trim() !== "" ? s : typeof e.defaultValue == "string" ? e.defaultValue : "";
2368
- i && !i.startsWith("/") && (i = `${ot()}${i}`);
2369
- const u = e.localized?.split(";").map((y) => y.trim()), [m, l] = D(i || ""), p = k(i || null);
2370
- if (C(() => {
2395
+ i && !i.startsWith("/") && (i = `${at()}${i}`);
2396
+ const m = e.localized?.split(";").map((y) => y.trim()), [d, l] = V(i || ""), u = E(i || null);
2397
+ if (k(() => {
2371
2398
  if (!i) return;
2372
- const y = i.split("/"), x = y.pop(), v = x.lastIndexOf(".");
2373
- if (v === -1) return;
2374
- const F = x.substring(0, v), R = x.substring(v);
2375
- let w = null;
2376
- u?.includes(n) && (w = `${F}_${n}${R}`);
2377
- const j = new AbortController();
2378
- if (w) {
2379
- const I = [...y, w].join("/");
2380
- fetch(I, { method: "HEAD", signal: j.signal }).then((S) => {
2381
- const A = S.ok ? I : i;
2382
- A !== p.current && (p.current = A, l(A));
2399
+ const y = i.split("/"), C = y.pop(), x = C.lastIndexOf(".");
2400
+ if (x === -1) return;
2401
+ const j = C.substring(0, x), N = C.substring(x);
2402
+ let v = null;
2403
+ m?.includes(n) && (v = `${j}_${n}${N}`);
2404
+ const w = new AbortController();
2405
+ if (v) {
2406
+ const I = [...y, v].join("/");
2407
+ fetch(I, { method: "HEAD", signal: w.signal }).then((A) => {
2408
+ const R = A.ok ? I : i;
2409
+ R !== u.current && (u.current = R, l(R));
2383
2410
  }).catch(() => {
2384
- i !== p.current && (p.current = i, l(i));
2411
+ i !== u.current && (u.current = i, l(i));
2385
2412
  });
2386
2413
  } else {
2387
2414
  const I = i;
2388
- I !== p.current && (p.current = I, requestAnimationFrame(() => l(I)));
2415
+ I !== u.current && (u.current = I, requestAnimationFrame(() => l(I)));
2389
2416
  }
2390
2417
  return () => {
2391
- j.abort();
2418
+ w.abort();
2392
2419
  };
2393
- }, [i, n, u]), !m) return null;
2394
- const { width: c, height: d } = e, b = {}, f = {
2420
+ }, [i, n, m]), !d) return null;
2421
+ const { width: c, height: p } = e, b = {}, f = {
2395
2422
  borderRadius: "8px",
2396
2423
  objectFit: "contain",
2397
2424
  boxShadow: "0 2px 6px rgba(0,0,0,0.1)",
2398
2425
  margin: "0 0 8px 0"
2399
2426
  };
2400
- return c && d ? (b.width = c, b.height = d, f.width = `${c}px`, f.height = `${d}px`) : c && !d ? (b.width = c, f.width = `${c}px`, f.height = "auto") : !c && d && (b.height = d, f.width = "auto", f.height = `${d}px`), /* @__PURE__ */ g.jsx(W, { field: e, children: /* @__PURE__ */ g.jsx(
2427
+ return c && p ? (b.width = c, b.height = p, f.width = `${c}px`, f.height = `${p}px`) : c && !p ? (b.width = c, f.width = `${c}px`, f.height = "auto") : !c && p && (b.height = p, f.width = "auto", f.height = `${p}px`), /* @__PURE__ */ g.jsx(U, { field: e, children: /* @__PURE__ */ g.jsx(
2401
2428
  "div",
2402
2429
  {
2403
2430
  "data-testid": "image-wrapper",
2404
2431
  style: {
2405
2432
  display: "flex",
2406
- justifyContent: a[t] || "center",
2433
+ justifyContent: o[t] || "center",
2407
2434
  margin: "0 0"
2408
2435
  },
2409
2436
  children: /* @__PURE__ */ g.jsx(
2410
2437
  "img",
2411
2438
  {
2412
- src: m,
2413
- alt: o?.(e.displayName || "Image") || e.displayName || "Image",
2439
+ src: d,
2440
+ alt: a?.(e.displayName || "Image") || e.displayName || "Image",
2414
2441
  ...b,
2415
2442
  style: f
2416
2443
  }
@@ -2426,22 +2453,22 @@ const it = ({
2426
2453
  field: e,
2427
2454
  value: r,
2428
2455
  onChange: n,
2429
- onError: o
2456
+ onError: a
2430
2457
  }) => {
2431
- const { t, definitionName: a } = T(), s = ",", [i, u] = D(
2458
+ const { t, definitionName: o } = L(), s = ",", [i, m] = V(
2432
2459
  Array.isArray(r) ? r.join(s + " ") : String(r ?? "")
2433
- ), m = (b) => !b || b.trim() === "" ? [] : b.split(s).map((f) => f.trim()).filter(Boolean).map((f) => Number(f)), l = N.useCallback(
2434
- (b) => {
2435
- if (b.trim() === "")
2460
+ ), d = (f) => !f || f.trim() === "" ? [] : f.split(s).map((y) => y.trim()).filter(Boolean).map((y) => Number(y)), l = F.useCallback(
2461
+ (f) => {
2462
+ if (f.trim() === "")
2436
2463
  return e.required ? t("Value required") : null;
2437
- if (!st(b))
2464
+ if (!st(f))
2438
2465
  return t("Each value must be a valid integer");
2439
- const f = m(b);
2440
- if (e.minCount !== void 0 && f.length < e.minCount)
2466
+ const y = d(f);
2467
+ if (e.minCount !== void 0 && y.length < e.minCount)
2441
2468
  return t("Minimum number of values: {{1}}", `${e.minCount}`);
2442
- if (e.maxCount !== void 0 && f.length > e.maxCount)
2469
+ if (e.maxCount !== void 0 && y.length > e.maxCount)
2443
2470
  return t("Maximum number of values: {{1}}", `${e.maxCount}`);
2444
- for (const x of f) {
2471
+ for (const x of y) {
2445
2472
  if (e.min !== void 0 && (e.minInclusive ? x < e.min : x <= e.min))
2446
2473
  return t(
2447
2474
  "Each value must be {{1}} {{2}}",
@@ -2455,28 +2482,33 @@ const it = ({
2455
2482
  e.max
2456
2483
  );
2457
2484
  }
2458
- return Y(a, e, f, t) ?? null;
2485
+ return H(o, e, y, t) ?? null;
2459
2486
  },
2460
- [a, e, t]
2461
- ), p = (b) => {
2462
- const f = b.target.value, y = l(f);
2463
- u(f), n?.(f, y);
2464
- }, c = k(null), d = k(
2465
- o
2487
+ [o, e, t]
2488
+ ), u = (f) => {
2489
+ const y = f.target.value, C = l(y);
2490
+ m(y), n?.(y, C);
2491
+ }, c = E(null), p = E(
2492
+ a
2466
2493
  );
2467
- return C(() => {
2468
- d.current = o;
2469
- }, [o]), C(() => {
2470
- const b = Array.isArray(r) ? r.join(s + " ") : String(r ?? ""), f = l(b);
2471
- f !== c.current && (c.current = f, d.current?.(f ?? null));
2472
- }, [r, e.required, l, t]), /* @__PURE__ */ g.jsx(W, { field: e, error: l(i), children: /* @__PURE__ */ g.jsx(
2494
+ k(() => {
2495
+ p.current = a;
2496
+ }, [a]), k(() => {
2497
+ const f = Array.isArray(r) ? r.join(s + " ") : String(r ?? ""), y = l(f);
2498
+ y !== c.current && (c.current = y, p.current?.(y ?? null));
2499
+ }, [r, e.required, l, t]);
2500
+ const b = l(i);
2501
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: b, children: /* @__PURE__ */ g.jsx(
2473
2502
  "input",
2474
2503
  {
2504
+ id: e.name,
2475
2505
  type: "text",
2476
2506
  value: i,
2477
- onChange: p,
2478
- className: K($.input, $.textInput),
2479
- style: { flex: 1 }
2507
+ onChange: u,
2508
+ className: G(M.input, M.textInput),
2509
+ style: { flex: 1 },
2510
+ "aria-invalid": !!b,
2511
+ "aria-describedby": b ? `${e.name}-error` : void 0
2480
2512
  }
2481
2513
  ) });
2482
2514
  };
@@ -2487,135 +2519,145 @@ const lt = ({
2487
2519
  field: e,
2488
2520
  value: r,
2489
2521
  onChange: n,
2490
- onError: o
2522
+ onError: a
2491
2523
  }) => {
2492
- const { t, definitionName: a } = T(), s = k(null), i = Z((c) => {
2493
- const d = parseInt(c, 10);
2494
- return Number.isNaN(d) ? null : d;
2495
- }, []), u = N.useCallback(
2496
- (c) => {
2497
- if (c.trim() === "")
2524
+ const { t, definitionName: o } = L(), s = E(null), i = X((p) => {
2525
+ const b = parseInt(p, 10);
2526
+ return Number.isNaN(b) ? null : b;
2527
+ }, []), m = F.useCallback(
2528
+ (p) => {
2529
+ if (p.trim() === "")
2498
2530
  return e.required ? t("Value required") : null;
2499
- if (!ct(c))
2531
+ if (!ct(p))
2500
2532
  return t("Must be a valid integer");
2501
- const d = i(c);
2502
- if (d === null) return t("Must be a valid integer");
2503
- if (e.min !== void 0 && (e.minInclusive ? d < e.min : d <= e.min))
2533
+ const b = i(p);
2534
+ if (b === null) return t("Must be a valid integer");
2535
+ if (e.min !== void 0 && (e.minInclusive ? b < e.min : b <= e.min))
2504
2536
  return t(
2505
2537
  "Must be {{1}} {{2}}",
2506
2538
  e.minInclusive ? "≥" : ">",
2507
2539
  e.min
2508
2540
  );
2509
- if (e.max !== void 0 && (e.maxInclusive ? d > e.max : d >= e.max))
2541
+ if (e.max !== void 0 && (e.maxInclusive ? b > e.max : b >= e.max))
2510
2542
  return t(
2511
2543
  "Must be {{1}} {{2}}",
2512
2544
  e.maxInclusive ? "≤" : "<",
2513
2545
  e.max
2514
2546
  );
2515
2547
  if (e.step !== void 0) {
2516
- const f = Number(e.step);
2517
- if (!Number.isInteger(f))
2548
+ const y = Number(e.step);
2549
+ if (!Number.isInteger(y))
2518
2550
  return t("Invalid step value");
2519
- if (d % f !== 0)
2520
- return t("Must be a multiple of {{1}}", f);
2551
+ if (b % y !== 0)
2552
+ return t("Must be a multiple of {{1}}", y);
2521
2553
  }
2522
- return Y(a, e, d, t) ?? null;
2554
+ return H(o, e, b, t) ?? null;
2523
2555
  },
2524
- [e, a, t, i]
2525
- ), m = k(null), l = k(o);
2526
- C(() => {
2527
- l.current = o;
2528
- }, [o]), C(() => {
2529
- const c = String(r ?? ""), d = u(c);
2530
- d !== m.current && (m.current = d, l.current?.(d ?? null)), s.current && document.activeElement !== s.current && (s.current.value = c);
2531
- }, [r, e, u, t]);
2532
- const p = (c) => {
2533
- const d = c.target.value, b = u(d);
2534
- n?.(d, b);
2535
- };
2536
- return /* @__PURE__ */ g.jsx(W, { field: e, error: u(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
2556
+ [e, o, t, i]
2557
+ ), d = E(null), l = E(a);
2558
+ k(() => {
2559
+ l.current = a;
2560
+ }, [a]), k(() => {
2561
+ const p = String(r ?? ""), b = m(p);
2562
+ b !== d.current && (d.current = b, l.current?.(b ?? null)), s.current && document.activeElement !== s.current && (s.current.value = p);
2563
+ }, [r, e, m, t]);
2564
+ const u = (p) => {
2565
+ const b = p.target.value, f = m(b);
2566
+ n?.(b, f);
2567
+ }, c = m(String(r ?? ""));
2568
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: c, children: /* @__PURE__ */ g.jsx(
2537
2569
  "input",
2538
2570
  {
2539
2571
  id: e.name,
2540
2572
  type: "text",
2541
2573
  defaultValue: String(r ?? ""),
2542
2574
  ref: s,
2543
- onChange: p,
2544
- className: K(
2545
- $.input,
2546
- $.inputNumber
2547
- )
2575
+ onChange: u,
2576
+ className: G(
2577
+ M.input,
2578
+ M.inputNumber
2579
+ ),
2580
+ "aria-invalid": !!c,
2581
+ "aria-describedby": c ? `${e.name}-error` : void 0
2548
2582
  }
2549
2583
  ) });
2550
2584
  }, ut = ({
2551
2585
  field: e,
2552
2586
  value: r,
2553
2587
  onChange: n,
2554
- onError: o
2588
+ onError: a
2555
2589
  }) => {
2556
- const { t, definitionName: a } = T(), s = e.minHeight ?? "80px", i = N.useRef(null), u = N.useRef(null), m = N.useRef(
2557
- o
2590
+ const { t, definitionName: o } = L(), s = e.minHeight ?? "80px", i = F.useRef(null), m = F.useRef(null), d = F.useRef(
2591
+ a
2558
2592
  );
2559
- N.useEffect(() => {
2560
- m.current = o;
2561
- }, [o]);
2562
- const l = N.useCallback(
2563
- (d) => d.trim() === "" ? e.required ? t("Value required") : null : e.minLength !== void 0 && d.length < e.minLength ? t("Must be at least {{1}} characters", e.minLength) : e.maxLength !== void 0 && d.length > e.maxLength ? t("Must be at most {{1}} characters", e.maxLength) : Y(a, e, d, t),
2564
- [e, a, t]
2565
- ), p = (d) => {
2566
- const b = d.target.value, f = l(b);
2567
- n?.(b, f);
2593
+ F.useEffect(() => {
2594
+ d.current = a;
2595
+ }, [a]);
2596
+ const l = F.useCallback(
2597
+ (b) => b.trim() === "" ? e.required ? t("Value required") : null : e.minLength !== void 0 && b.length < e.minLength ? t("Must be at least {{1}} characters", e.minLength) : e.maxLength !== void 0 && b.length > e.maxLength ? t("Must be at most {{1}} characters", e.maxLength) : H(o, e, b, t),
2598
+ [e, o, t]
2599
+ ), u = (b) => {
2600
+ const f = b.target.value, y = l(f);
2601
+ n?.(f, y);
2568
2602
  };
2569
- C(() => {
2570
- const d = l(r);
2571
- d !== u.current && (u.current = d, m.current?.(d ?? null)), i.current && i.current.value !== String(r ?? "") && (i.current.value = String(r ?? ""));
2603
+ k(() => {
2604
+ const b = l(r);
2605
+ b !== m.current && (m.current = b, d.current?.(b ?? null)), i.current && i.current.value !== String(r ?? "") && (i.current.value = String(r ?? ""));
2572
2606
  }, [r, l]);
2573
2607
  const c = {
2608
+ id: e.name,
2574
2609
  defaultValue: String(r ?? ""),
2575
2610
  ref: i,
2576
- onChange: p,
2611
+ onChange: u,
2577
2612
  style: {
2578
2613
  resize: "vertical",
2579
2614
  minHeight: s,
2580
2615
  width: "100%",
2581
2616
  boxSizing: "border-box"
2582
2617
  },
2583
- className: K($.input, $.textInput)
2584
- };
2585
- return /* @__PURE__ */ g.jsx(W, { field: e, error: l(r), children: /* @__PURE__ */ g.jsx("textarea", { ...c }) });
2618
+ className: G(M.input, M.textInput)
2619
+ }, p = l(r);
2620
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: p, children: /* @__PURE__ */ g.jsx(
2621
+ "textarea",
2622
+ {
2623
+ ...c,
2624
+ "aria-invalid": !!p,
2625
+ "aria-describedby": p ? `${e.name}-error` : void 0
2626
+ }
2627
+ ) });
2586
2628
  }, mt = ({
2587
2629
  field: e,
2588
2630
  value: r,
2589
2631
  onChange: n,
2590
- onError: o
2632
+ onError: a
2591
2633
  }) => {
2592
- const t = k(o);
2593
- C(() => {
2594
- t.current = o;
2595
- }, [o]);
2596
- const { t: a, darkMode: s, formStyle: i, fieldStyle: u, definitionName: m } = T(), l = (S, A, M) => {
2597
- if (!A) return {};
2598
- const L = S?.[A];
2599
- return (M && L ? L[M] : void 0) ?? {};
2600
- }, p = k(null), [c, d] = D(!1), [b, f] = D(
2634
+ const t = E(a);
2635
+ k(() => {
2636
+ t.current = a;
2637
+ }, [a]);
2638
+ const { t: o, darkMode: s, formStyle: i, fieldStyle: m, definitionName: d } = L(), l = (R, $, O) => {
2639
+ if (!$) return {};
2640
+ const W = R?.[$];
2641
+ return (O && W ? W[O] : void 0) ?? {};
2642
+ }, u = E(null), [c, p] = V(!1), [b, f] = V(
2601
2643
  null
2602
- ), y = G(
2603
- () => e.options.map((S) => ({ value: S.value, label: a(S.label) })),
2604
- [e.options, a]
2605
- ), x = G(() => {
2606
- const S = Array.isArray(r) ? r : [], A = new Set(y.map((M) => M.value));
2607
- return S.filter((M) => A.has(M));
2608
- }, [r, y]), v = (S) => {
2609
- const A = Array.isArray(S) ? S : [];
2610
- return e.required && A.length === 0 ? a("Value required") : Y(m, e, A, a) ?? null;
2611
- }, F = () => {
2612
- if (!p.current) return;
2613
- const S = p.current.getBoundingClientRect();
2614
- f({ x: S.left, y: S.bottom }), d((A) => !A);
2615
- }, R = (S) => {
2616
- const A = x.includes(S) ? x.filter((z) => z !== S) : [...x, S], M = v(A);
2617
- t.current?.(M ?? null), n?.(A, M);
2618
- }, w = G(() => ({
2644
+ ), y = J(
2645
+ () => e.options.map((R) => ({ value: R.value, label: o(R.label) })),
2646
+ [e.options, o]
2647
+ ), C = J(() => {
2648
+ const R = Array.isArray(r) ? r : [], $ = new Set(y.map((O) => O.value));
2649
+ return R.filter((O) => $.has(O));
2650
+ }, [r, y]), x = (R) => {
2651
+ const $ = Array.isArray(R) ? R : [];
2652
+ return e.required && $.length === 0 ? o("Value required") : H(d, e, $, o) ?? null;
2653
+ }, j = () => {
2654
+ if (!u.current) return;
2655
+ const R = u.current.getBoundingClientRect();
2656
+ f({ x: R.left, y: R.bottom }), p(($) => !$);
2657
+ }, N = (R) => {
2658
+ const $ = C.includes(R) ? C.filter((P) => P !== R) : [...C, R], O = x($);
2659
+ t.current?.(O ?? null), n?.($, O);
2660
+ }, v = J(() => ({
2619
2661
  height: "var(--reactaform-input-height, 2.5rem)",
2620
2662
  padding: "var(--reactaform-input-padding, 8px)",
2621
2663
  display: "flex",
@@ -2628,8 +2670,8 @@ const lt = ({
2628
2670
  background: "var(--reactaform-secondary-bg, #fff)",
2629
2671
  color: "var(--reactaform-text-color, #000)",
2630
2672
  ...l(i, "multiSelect", "control"),
2631
- ...l(u, void 0, "control")
2632
- }), [i, u]), j = G(() => ({
2673
+ ...l(m, void 0, "control")
2674
+ }), [i, m]), w = J(() => ({
2633
2675
  position: "absolute",
2634
2676
  right: "1.5em",
2635
2677
  top: "50%",
@@ -2641,8 +2683,8 @@ const lt = ({
2641
2683
  color: "var(--reactaform-text-muted, #999)",
2642
2684
  padding: 0,
2643
2685
  ...l(i, "multiSelect", "clearButton"),
2644
- ...l(u, void 0, "clearButton")
2645
- }), [i, u]), I = G(() => ({
2686
+ ...l(m, void 0, "clearButton")
2687
+ }), [i, m]), I = J(() => ({
2646
2688
  position: "absolute",
2647
2689
  right: "0.7em",
2648
2690
  top: "50%",
@@ -2651,46 +2693,42 @@ const lt = ({
2651
2693
  fontSize: "0.8em",
2652
2694
  color: "var(--reactaform-text-muted, #999)",
2653
2695
  ...l(i, "multiSelect", "arrow"),
2654
- ...l(u, void 0, "arrow")
2655
- }), [i, u]);
2696
+ ...l(m, void 0, "arrow")
2697
+ }), [i, m]), A = x(Array.isArray(r) ? r : []);
2656
2698
  return /* @__PURE__ */ g.jsxs("div", { children: [
2657
- /* @__PURE__ */ g.jsx(W, { field: e, error: null, children: /* @__PURE__ */ g.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ g.jsxs(
2699
+ /* @__PURE__ */ g.jsx(U, { field: e, error: null, children: /* @__PURE__ */ g.jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ g.jsxs(
2658
2700
  "div",
2659
2701
  {
2660
- ref: p,
2702
+ ref: u,
2661
2703
  className: "reactaform-multiselection-control",
2662
- style: w,
2663
- onClick: F,
2704
+ style: v,
2705
+ onClick: j,
2664
2706
  tabIndex: 0,
2665
2707
  role: "button",
2666
2708
  "aria-haspopup": "listbox",
2667
2709
  "aria-expanded": c,
2668
- onKeyDown: (S) => {
2669
- (S.key === "Enter" || S.key === " ") && (S.preventDefault(), F());
2710
+ "aria-invalid": !!A,
2711
+ "aria-describedby": A ? `${e.name}-error` : void 0,
2712
+ onKeyDown: (R) => {
2713
+ (R.key === "Enter" || R.key === " ") && (R.preventDefault(), j());
2670
2714
  },
2671
2715
  children: [
2672
- /* @__PURE__ */ g.jsxs(
2673
- "span",
2674
- {
2675
- style: { flex: 1, color: "var(--reactaform-text-muted, #888)" },
2676
- children: [
2677
- x.length,
2678
- " / ",
2679
- y.length,
2680
- " selected"
2681
- ]
2682
- }
2683
- ),
2684
- x.length > 0 && /* @__PURE__ */ g.jsx(
2716
+ /* @__PURE__ */ g.jsxs("span", { style: { flex: 1, color: "var(--reactaform-text-muted, #888)" }, children: [
2717
+ C.length,
2718
+ " / ",
2719
+ y.length,
2720
+ " selected"
2721
+ ] }),
2722
+ C.length > 0 && /* @__PURE__ */ g.jsx(
2685
2723
  "button",
2686
2724
  {
2687
2725
  type: "button",
2688
2726
  "aria-label": "Clear selections",
2689
- onClick: (S) => {
2690
- S.stopPropagation(), n?.([], null);
2727
+ onClick: (R) => {
2728
+ R.stopPropagation(), n?.([], null);
2691
2729
  },
2692
- style: j,
2693
- children: /* @__PURE__ */ g.jsx("span", { style: j, "aria-hidden": !0, children: "✖" })
2730
+ style: w,
2731
+ children: /* @__PURE__ */ g.jsx("span", { style: w, "aria-hidden": !0, children: "✖" })
2694
2732
  }
2695
2733
  ),
2696
2734
  /* @__PURE__ */ g.jsx("span", { style: I, "aria-hidden": !0, children: "▼" })
@@ -2698,32 +2736,32 @@ const lt = ({
2698
2736
  }
2699
2737
  ) }) }),
2700
2738
  c && b && /* @__PURE__ */ g.jsx(
2701
- ft,
2739
+ dt,
2702
2740
  {
2703
2741
  position: b,
2704
2742
  options: y,
2705
- selectedValues: x,
2706
- onToggleOption: R,
2707
- onClose: () => d(!1),
2708
- controlRef: p,
2743
+ selectedValues: C,
2744
+ onToggleOption: N,
2745
+ onClose: () => p(!1),
2746
+ controlRef: u,
2709
2747
  darkMode: s
2710
2748
  }
2711
2749
  )
2712
2750
  ] });
2713
- }, ft = ({
2751
+ }, dt = ({
2714
2752
  position: e,
2715
2753
  options: r,
2716
2754
  selectedValues: n,
2717
- onToggleOption: o,
2755
+ onToggleOption: a,
2718
2756
  onClose: t,
2719
- controlRef: a,
2757
+ controlRef: o,
2720
2758
  darkMode: s
2721
2759
  }) => {
2722
- const i = k(null), [u, m] = D(-1), { formStyle: l, fieldStyle: p } = T(), c = (j, I, S) => {
2760
+ const i = E(null), [m, d] = V(-1), { formStyle: l, fieldStyle: u } = L(), c = (w, I, A) => {
2723
2761
  if (!I) return {};
2724
- const M = j?.[I];
2725
- return (S && M ? M[S] : void 0) ?? {};
2726
- }, d = G(() => ({
2762
+ const $ = w?.[I];
2763
+ return (A && $ ? $[A] : void 0) ?? {};
2764
+ }, p = J(() => ({
2727
2765
  maxHeight: 200,
2728
2766
  overflowY: "auto",
2729
2767
  background: "var(--reactaform-secondary-bg, #fff)",
@@ -2735,8 +2773,8 @@ const lt = ({
2735
2773
  color: "var(--reactaform-text-color, #000)",
2736
2774
  fontSize: "var(--reactaform-popup-font-size, 0.875rem)",
2737
2775
  ...c(l, "multiSelect", "popup"),
2738
- ...c(p, void 0, "popup")
2739
- }), [l, p]), b = G(() => ({
2776
+ ...c(u, void 0, "popup")
2777
+ }), [l, u]), b = J(() => ({
2740
2778
  padding: "6px 8px",
2741
2779
  cursor: "pointer",
2742
2780
  display: "flex",
@@ -2744,111 +2782,111 @@ const lt = ({
2744
2782
  background: "transparent",
2745
2783
  color: "var(--reactaform-text-color, #000)",
2746
2784
  ...c(l, "multiSelect", "option"),
2747
- ...c(p, void 0, "option")
2748
- }), [l, p]);
2749
- C(() => {
2750
- const j = (I) => {
2751
- const S = I.target;
2752
- !i.current?.contains(S) && !a.current?.contains(S) && t();
2785
+ ...c(u, void 0, "option")
2786
+ }), [l, u]);
2787
+ k(() => {
2788
+ const w = (I) => {
2789
+ const A = I.target;
2790
+ !i.current?.contains(A) && !o.current?.contains(A) && t();
2753
2791
  };
2754
- return document.addEventListener("mousedown", j), () => document.removeEventListener("mousedown", j);
2755
- }, [t, a]), C(() => {
2756
- i.current && r.length > 0 && requestAnimationFrame(() => m((j) => j === -1 ? 0 : j));
2757
- }, [r.length]), C(() => {
2758
- if (!i.current || u < 0) return;
2759
- const j = i.current.querySelector(`#multi-opt-${u}`);
2760
- j && requestAnimationFrame(() => j.focus());
2761
- }, [u]);
2762
- const f = 250, y = 200, [x, v] = D(
2792
+ return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
2793
+ }, [t, o]), k(() => {
2794
+ i.current && r.length > 0 && requestAnimationFrame(() => d((w) => w === -1 ? 0 : w));
2795
+ }, [r.length]), k(() => {
2796
+ if (!i.current || m < 0) return;
2797
+ const w = i.current.querySelector(`#multi-opt-${m}`);
2798
+ w && requestAnimationFrame(() => w.focus());
2799
+ }, [m]);
2800
+ const f = 250, y = 200, [C, x] = V(
2763
2801
  null
2764
- ), [F, R] = D(null);
2765
- if (C(() => {
2802
+ ), [j, N] = V(null);
2803
+ if (k(() => {
2766
2804
  if (typeof window > "u") return;
2767
- const j = () => {
2768
- let A = e.x, M = e.y, z = f;
2769
- const L = a?.current;
2770
- if (L) {
2771
- const J = L.getBoundingClientRect();
2772
- A = J.left, M = J.bottom, z = Math.max(80, Math.round(J.width));
2805
+ const w = () => {
2806
+ let R = e.x, $ = e.y, O = f;
2807
+ const P = o?.current;
2808
+ if (P) {
2809
+ const W = P.getBoundingClientRect();
2810
+ R = W.left, $ = W.bottom, O = Math.max(80, Math.round(W.width));
2773
2811
  }
2774
- A = Math.min(A, window.innerWidth - z), M = Math.min(M, window.innerHeight - y), v({ left: A, top: M }), R(z);
2812
+ R = Math.min(R, window.innerWidth - O), $ = Math.min($, window.innerHeight - y), x({ left: R, top: $ }), N(O);
2775
2813
  };
2776
- j(), window.addEventListener("scroll", j, !0), window.addEventListener("resize", j);
2814
+ w(), window.addEventListener("scroll", w, !0), window.addEventListener("resize", w);
2777
2815
  let I = null;
2778
- const S = a?.current;
2779
- return typeof ResizeObserver < "u" && S && (I = new ResizeObserver(() => j()), I.observe(S)), () => {
2780
- window.removeEventListener("scroll", j, !0), window.removeEventListener("resize", j), I && S && I.unobserve(S);
2816
+ const A = o?.current;
2817
+ return typeof ResizeObserver < "u" && A && (I = new ResizeObserver(() => w()), I.observe(A)), () => {
2818
+ window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", w), I && A && I.unobserve(A);
2781
2819
  };
2782
- }, [a, e.x, e.y]), typeof window > "u") return null;
2783
- let w = document.getElementById("popup-root");
2784
- return w || (w = document.createElement("div"), w.id = "popup-root", document.body.appendChild(w)), Me.createPortal(
2820
+ }, [o, e.x, e.y]), typeof window > "u") return null;
2821
+ let v = document.getElementById("popup-root");
2822
+ return v || (v = document.createElement("div"), v.id = "popup-root", document.body.appendChild(v)), $e.createPortal(
2785
2823
  /* @__PURE__ */ g.jsx(
2786
2824
  "div",
2787
2825
  {
2788
2826
  ref: i,
2789
2827
  role: "listbox",
2790
- "aria-activedescendant": u >= 0 ? `multi-opt-${u}` : void 0,
2828
+ "aria-activedescendant": m >= 0 ? `multi-opt-${m}` : void 0,
2791
2829
  style: {
2792
2830
  position: "absolute",
2793
- top: x ? x.top : e.y,
2794
- left: x ? x.left : e.x,
2795
- width: F ?? f,
2831
+ top: C ? C.top : e.y,
2832
+ left: C ? C.left : e.x,
2833
+ width: j ?? f,
2796
2834
  // spread the static popup styles
2797
- ...d
2835
+ ...p
2798
2836
  },
2799
2837
  "data-reactaform-theme": s ? "dark" : "light",
2800
- children: r.map((j, I) => {
2801
- const S = n.includes(j.value), A = s ? "var(--reactaform-hover-bg, rgba(255,255,255,0.01))" : "var(--reactaform-hover-bg, #eee)", M = {
2838
+ children: r.map((w, I) => {
2839
+ const A = n.includes(w.value), R = s ? "var(--reactaform-hover-bg, rgba(255,255,255,0.01))" : "var(--reactaform-hover-bg, #eee)", $ = {
2802
2840
  ...b,
2803
- background: I === u ? A : b.background
2841
+ background: I === m ? R : b.background
2804
2842
  };
2805
2843
  return /* @__PURE__ */ g.jsxs(
2806
2844
  "div",
2807
2845
  {
2808
2846
  id: `multi-opt-${I}`,
2809
- onMouseDown: (z) => {
2810
- z.stopPropagation(), o(j.value);
2847
+ onMouseDown: (O) => {
2848
+ O.stopPropagation(), a(w.value);
2811
2849
  },
2812
- onKeyDown: (z) => {
2813
- const L = r.length;
2814
- switch (z.key) {
2850
+ onKeyDown: (O) => {
2851
+ const P = r.length;
2852
+ switch (O.key) {
2815
2853
  case "ArrowDown":
2816
- z.preventDefault(), m((J) => (J + 1) % L);
2854
+ O.preventDefault(), d((W) => (W + 1) % P);
2817
2855
  break;
2818
2856
  case "ArrowUp":
2819
- z.preventDefault(), m((J) => (J - 1 + L) % L);
2857
+ O.preventDefault(), d((W) => (W - 1 + P) % P);
2820
2858
  break;
2821
2859
  case "Home":
2822
- z.preventDefault(), m(0);
2860
+ O.preventDefault(), d(0);
2823
2861
  break;
2824
2862
  case "End":
2825
- z.preventDefault(), m(L - 1);
2863
+ O.preventDefault(), d(P - 1);
2826
2864
  break;
2827
2865
  case "Enter":
2828
2866
  case " ":
2829
- z.preventDefault(), z.stopPropagation(), o(j.value);
2867
+ O.preventDefault(), O.stopPropagation(), a(w.value);
2830
2868
  break;
2831
2869
  case "Escape":
2832
- z.preventDefault(), t(), a?.current?.focus();
2870
+ O.preventDefault(), t(), o?.current?.focus();
2833
2871
  break;
2834
2872
  }
2835
2873
  },
2836
- tabIndex: I === u ? 0 : -1,
2874
+ tabIndex: I === m ? 0 : -1,
2837
2875
  role: "option",
2838
- "aria-selected": S,
2839
- style: M,
2840
- onMouseEnter: (z) => {
2841
- z.currentTarget.style.background = A, m(I);
2876
+ "aria-selected": A,
2877
+ style: $,
2878
+ onMouseEnter: (O) => {
2879
+ O.currentTarget.style.background = R, d(I);
2842
2880
  },
2843
- onMouseLeave: (z) => {
2844
- z.currentTarget.style.background = "transparent", m((L) => L === I ? -1 : L);
2881
+ onMouseLeave: (O) => {
2882
+ O.currentTarget.style.background = "transparent", d((P) => P === I ? -1 : P);
2845
2883
  },
2846
2884
  children: [
2847
2885
  /* @__PURE__ */ g.jsx(
2848
2886
  "input",
2849
2887
  {
2850
2888
  type: "checkbox",
2851
- checked: S,
2889
+ checked: A,
2852
2890
  readOnly: !0,
2853
2891
  style: {
2854
2892
  marginRight: 8,
@@ -2860,44 +2898,44 @@ const lt = ({
2860
2898
  }
2861
2899
  }
2862
2900
  ),
2863
- j.label
2901
+ w.label
2864
2902
  ]
2865
2903
  },
2866
- j.value
2904
+ w.value
2867
2905
  );
2868
2906
  })
2869
2907
  }
2870
2908
  ),
2871
- w
2909
+ v
2872
2910
  );
2873
- }, dt = ({
2911
+ }, ft = ({
2874
2912
  field: e,
2875
2913
  value: r,
2876
2914
  onChange: n,
2877
- onError: o
2915
+ onError: a
2878
2916
  }) => {
2879
- const { t, definitionName: a } = T(), s = N.useRef(null), i = e.min ?? void 0, u = e.max ?? void 0, m = Math.max(1, Math.round(e.step ?? 1)), l = Z(
2880
- (f) => isNaN(f) ? t("Must be a valid integer") : Number.isInteger(f) ? i !== void 0 && f < i ? t("Must be �?{{1}}", i) : u !== void 0 && f > u ? t("Must be �?{{1}}", u) : Y(a, e, f, t) ?? null : t("Must be an integer"),
2881
- [a, e, t, i, u]
2882
- ), p = k(null), c = k(
2883
- o
2917
+ const { t, definitionName: o } = L(), s = F.useRef(null), i = e.min ?? void 0, m = e.max ?? void 0, d = Math.max(1, Math.round(e.step ?? 1)), l = X(
2918
+ (y) => isNaN(y) ? t("Must be a valid integer") : Number.isInteger(y) ? i !== void 0 && y < i ? t("Must be �?{{1}}", i) : m !== void 0 && y > m ? t("Must be �?{{1}}", m) : H(o, e, y, t) ?? null : t("Must be an integer"),
2919
+ [o, e, t, i, m]
2920
+ ), u = E(null), c = E(
2921
+ a
2884
2922
  );
2885
- C(() => {
2886
- c.current = o;
2887
- }, [o]), C(() => {
2923
+ k(() => {
2924
+ c.current = a;
2925
+ }, [a]), k(() => {
2888
2926
  if (document.activeElement === s.current) return;
2889
- const y = String(r), x = l(r);
2890
- s.current && (s.current.value = y), x !== p.current && (p.current = x, c.current?.(x ?? null));
2927
+ const C = String(r), x = l(r);
2928
+ s.current && (s.current.value = C), x !== u.current && (u.current = x, c.current?.(x ?? null));
2891
2929
  }, [r, l]);
2892
- const d = (f) => {
2893
- if (f.trim() === "") return e.required ? t("Value required") : null;
2894
- const x = Number(f);
2930
+ const p = (y) => {
2931
+ if (y.trim() === "") return e.required ? t("Value required") : null;
2932
+ const x = Number(y);
2895
2933
  return l(x);
2896
- }, b = (f) => {
2897
- const y = f.target.value, x = f.target.valueAsNumber, v = d(y);
2898
- n?.(x, v);
2899
- };
2900
- return /* @__PURE__ */ g.jsx(W, { field: e, error: d(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
2934
+ }, b = (y) => {
2935
+ const C = y.target.value, x = y.target.valueAsNumber, j = p(C);
2936
+ n?.(x, j);
2937
+ }, f = p(String(r ?? ""));
2938
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: f, children: /* @__PURE__ */ g.jsx(
2901
2939
  "input",
2902
2940
  {
2903
2941
  ref: s,
@@ -2905,108 +2943,129 @@ const lt = ({
2905
2943
  type: "number",
2906
2944
  defaultValue: String(r ?? ""),
2907
2945
  min: i,
2908
- max: u,
2909
- step: m,
2946
+ max: m,
2947
+ step: d,
2910
2948
  onChange: b,
2911
2949
  style: { width: "100%", height: "100%" },
2912
- className: $.input
2950
+ className: M.input,
2951
+ "aria-invalid": !!f,
2952
+ "aria-describedby": f ? `${e.name}-error` : void 0
2913
2953
  }
2914
2954
  ) });
2915
2955
  }, pt = ({
2916
2956
  field: e,
2917
2957
  value: r,
2918
2958
  onChange: n,
2919
- onError: o
2959
+ onError: a
2920
2960
  }) => {
2921
- const { t } = T(), a = N.useRef(null), { definitionName: s } = T(), i = Z(
2922
- (p) => {
2923
- const c = String(p ?? "").trim();
2961
+ const { t } = L(), o = F.useRef(null), { definitionName: s } = L(), i = X(
2962
+ (u) => {
2963
+ const c = String(u ?? "").trim();
2924
2964
  if (c === "")
2925
2965
  return e.required ? t("Value required") : null;
2926
2966
  if (e.pattern)
2927
2967
  try {
2928
2968
  if (!new RegExp(e.pattern).test(c))
2929
- return t(
2969
+ return e.patternErrorMessage ? t(e.patternErrorMessage) : t(
2930
2970
  "Phone number does not match pattern: {{1}}",
2931
2971
  `${e.pattern}`
2932
2972
  );
2933
2973
  } catch {
2934
2974
  }
2935
- return Y(s, e, c, t);
2975
+ return H(s, e, c, t);
2936
2976
  },
2937
2977
  [s, e, t]
2938
- ), u = k(null), m = k(o);
2939
- C(() => {
2940
- m.current = o;
2941
- }, [o]), C(() => {
2942
- const p = String(r ?? ""), c = i(p);
2943
- a.current && a.current.value !== String(p) && (a.current.value = String(p)), c !== u.current && (u.current = c, m.current?.(c ?? null));
2978
+ ), m = E(null), d = E(a);
2979
+ k(() => {
2980
+ d.current = a;
2981
+ }, [a]), k(() => {
2982
+ const u = String(r ?? ""), c = i(u);
2983
+ o.current && o.current.value !== String(u) && (o.current.value = String(u)), c !== m.current && (m.current = c, d.current?.(c ?? null));
2944
2984
  }, [r, i]);
2945
- const l = (p) => {
2946
- const c = p.target.value, d = c.trim();
2985
+ const l = (u) => {
2986
+ const c = u.target.value, p = c.trim();
2947
2987
  let b = null;
2948
- if (d === "") {
2988
+ if (p === "") {
2949
2989
  b = e.required ? t("Value required") : null, n?.(c, b);
2950
2990
  return;
2951
2991
  }
2952
- !b && e.pattern && !new RegExp(e.pattern).test(d) && (b = t("Phone number does not match pattern: {{1}}", `${e.pattern}`)), n?.(c, b);
2992
+ b || (b = i(c)), n?.(c, b);
2953
2993
  };
2954
- return /* @__PURE__ */ g.jsx(W, { field: e, error: i(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
2994
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: i(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
2955
2995
  "input",
2956
2996
  {
2997
+ id: e.name,
2957
2998
  type: "tel",
2958
2999
  defaultValue: String(r ?? ""),
2959
- ref: a,
3000
+ ref: o,
2960
3001
  onChange: l,
2961
- className: K($.input, $.textInput)
3002
+ className: G(M.input, M.textInput),
3003
+ "aria-invalid": !!i(String(r ?? "")),
3004
+ "aria-describedby": i(String(r ?? "")) ? `${e.name}-error` : void 0
2962
3005
  }
2963
3006
  ) });
2964
- }, gt = ({ field: e, value: r, onChange: n, onError: o }) => {
2965
- const { t, definitionName: a } = T(), s = e.layout?.toLowerCase() === "horizontal" ? "row" : "column", i = k(null), u = k(o);
2966
- C(() => {
2967
- u.current = o;
2968
- }, [o]);
2969
- const m = Z(
2970
- (p) => p === "" || p === null || p === void 0 ? t("Value required") : !e.options || e.options.length === 0 ? null : e.options.some((d) => d.value === p) ? Y(a, e, p, t) ?? null : t("Invalid option selected"),
2971
- [e, t, a]
3007
+ }, gt = ({
3008
+ field: e,
3009
+ value: r,
3010
+ onChange: n,
3011
+ onError: a
3012
+ }) => {
3013
+ const { t, definitionName: o } = L(), s = e.layout?.toLowerCase() === "horizontal" ? "row" : "column", i = E(null), m = E(a);
3014
+ k(() => {
3015
+ m.current = a;
3016
+ }, [a]);
3017
+ const d = X(
3018
+ (u) => u === "" || u === null || u === void 0 ? t("Value required") : !e.options || e.options.length === 0 ? null : e.options.some((p) => p.value === u) ? H(o, e, u, t) ?? null : t("Invalid option selected"),
3019
+ [e, t, o]
2972
3020
  );
2973
- C(() => {
2974
- const p = r != null ? String(r) : "", c = m(p);
2975
- if (u.current?.(c ?? null), i.current) {
2976
- const d = Array.from(
3021
+ k(() => {
3022
+ const u = r != null ? String(r) : "", c = d(u);
3023
+ if (m.current?.(c ?? null), i.current) {
3024
+ const p = Array.from(
2977
3025
  i.current.querySelectorAll("input[type=radio]")
2978
3026
  );
2979
3027
  if (c && e.options && e.options.length > 0) {
2980
3028
  const b = String(e.options[0].value);
2981
- d.forEach((f) => f.checked = f.value === b), n?.(b, null);
3029
+ p.forEach((f) => f.checked = f.value === b), n?.(b, null);
2982
3030
  } else
2983
- d.forEach((b) => b.checked = b.value === p);
3031
+ p.forEach((b) => b.checked = b.value === u);
2984
3032
  }
2985
- }, [r, m, n, e.options]);
2986
- const l = (p) => {
2987
- const c = p.target.value, d = m(c);
2988
- u.current?.(d ?? null), n?.(c, d);
3033
+ }, [r, d, n, e.options]);
3034
+ const l = (u) => {
3035
+ const c = u.target.value, p = d(c);
3036
+ m.current?.(p ?? null), n?.(c, p);
2989
3037
  };
2990
- return /* @__PURE__ */ g.jsx(W, { field: e, error: m(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
3038
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: d(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
2991
3039
  "div",
2992
3040
  {
3041
+ className: M.input,
3042
+ role: "radiogroup",
3043
+ "aria-labelledby": `${e.name}-label`,
3044
+ "aria-invalid": !!d(String(r ?? "")),
2993
3045
  style: {
2994
3046
  display: "flex",
2995
3047
  flexDirection: s,
2996
3048
  flexWrap: s === "row" ? "wrap" : "nowrap",
2997
3049
  gap: s === "row" ? "12px" : "4px",
2998
- alignItems: s === "row" ? "center" : "flex-start",
2999
- width: "100%"
3050
+ alignItems: s === "row" ? "center" : "stretch",
3051
+ width: "100%",
3052
+ padding: s === "row" ? "8px" : void 0,
3053
+ boxSizing: "border-box"
3000
3054
  },
3001
3055
  ref: i,
3002
- children: (e.options ?? []).map((p) => /* @__PURE__ */ g.jsxs(
3056
+ children: (e.options ?? []).map((u) => /* @__PURE__ */ g.jsxs(
3003
3057
  "label",
3004
3058
  {
3059
+ className: G(M.label),
3005
3060
  style: {
3006
- display: "flex",
3007
- gap: "6px",
3061
+ display: s === "column" ? "flex" : "inline-flex",
3062
+ gap: "8px",
3008
3063
  alignItems: "center",
3009
- whiteSpace: "nowrap"
3064
+ whiteSpace: "nowrap",
3065
+ marginBottom: s === "column" ? 6 : 0,
3066
+ cursor: "pointer",
3067
+ width: s === "column" ? "100%" : void 0,
3068
+ justifyContent: "flex-start"
3010
3069
  },
3011
3070
  children: [
3012
3071
  /* @__PURE__ */ g.jsx(
@@ -3014,15 +3073,28 @@ const lt = ({
3014
3073
  {
3015
3074
  type: "radio",
3016
3075
  name: e.name,
3017
- value: String(p.value),
3018
- defaultChecked: String(r ?? "") === String(p.value),
3019
- onChange: l
3076
+ value: String(u.value),
3077
+ defaultChecked: String(r ?? "") === String(u.value),
3078
+ onChange: l,
3079
+ style: { width: "1.1em", height: "1.1em" }
3020
3080
  }
3021
3081
  ),
3022
- t(p.label)
3082
+ /* @__PURE__ */ g.jsx(
3083
+ "span",
3084
+ {
3085
+ style: {
3086
+ userSelect: "none",
3087
+ textAlign: s === "column" ? "left" : void 0,
3088
+ flex: s === "column" ? 1 : void 0,
3089
+ fontWeight: 400
3090
+ // Use normal font weight for option labels
3091
+ },
3092
+ children: t(u.label)
3093
+ }
3094
+ )
3023
3095
  ]
3024
3096
  },
3025
- String(p.value)
3097
+ String(u.value)
3026
3098
  ))
3027
3099
  }
3028
3100
  ) });
@@ -3041,74 +3113,101 @@ const lt = ({
3041
3113
  field: e,
3042
3114
  value: r,
3043
3115
  onChange: n,
3044
- onError: o
3116
+ onError: a
3045
3117
  }) => {
3046
- const { t, definitionName: a } = T(), [s, i] = D(null), u = e.max || 5, m = Z(
3047
- (b) => e.required && b === 0 ? t("Value required") : Y(a, e, b, t) ?? null,
3048
- [e, t, a]
3049
- ), l = k(null), p = k(o);
3050
- C(() => {
3051
- p.current = o;
3052
- }, [o]), C(() => {
3053
- let b = r || 0;
3054
- r < 0 && (b = 0), r > u && (b = u);
3055
- const f = m(b);
3056
- f !== l.current && (l.current = f, p.current?.(f ?? null));
3057
- }, [r, m, u]);
3058
- const c = (b) => {
3059
- const f = m(b);
3060
- n?.(b, f);
3061
- }, d = (() => {
3062
- let b = r || 0;
3063
- return b < 0 && (b = 0), b > u && (b = u), b;
3118
+ const { t, definitionName: o } = L(), [s, i] = V(null), m = E([]), d = e.max || 5, l = X(
3119
+ (f) => e.required && f === 0 ? t("Value required") : H(o, e, f, t) ?? null,
3120
+ [e, t, o]
3121
+ ), u = E(null), c = E(a);
3122
+ k(() => {
3123
+ c.current = a;
3124
+ }, [a]), k(() => {
3125
+ let f = r || 0;
3126
+ r < 0 && (f = 0), r > d && (f = d);
3127
+ const y = l(f);
3128
+ y !== u.current && (u.current = y, c.current?.(y ?? null));
3129
+ }, [r, l, d]);
3130
+ const p = (f) => {
3131
+ const y = l(f);
3132
+ n?.(f, y);
3133
+ }, b = (() => {
3134
+ let f = r || 0;
3135
+ return f < 0 && (f = 0), f > d && (f = d), f;
3064
3136
  })();
3065
- return /* @__PURE__ */ g.jsx(W, { field: e, error: m(d), children: /* @__PURE__ */ g.jsx("div", { style: ht, children: (() => {
3066
- const b = e.icon, f = b && String(b).trim() ? String(b) : "";
3067
- return [...Array(u)].map((y, x) => {
3068
- const v = x < d, R = s !== null && x <= s || v ? "gold" : "lightgray";
3069
- return /* @__PURE__ */ g.jsx(
3070
- "span",
3071
- {
3072
- onClick: () => c(x + 1),
3073
- onMouseEnter: () => i(x),
3074
- onMouseLeave: () => i(null),
3075
- style: { ...bt, color: R },
3076
- "aria-label": `Rating ${x + 1}`,
3077
- title: t(`${e.displayName} ${x + 1}`),
3078
- children: f
3079
- },
3080
- x
3081
- );
3082
- });
3083
- })() }) });
3137
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: l(b), children: /* @__PURE__ */ g.jsx(
3138
+ "div",
3139
+ {
3140
+ role: "radiogroup",
3141
+ "aria-labelledby": `${e.name}-label`,
3142
+ style: ht,
3143
+ "aria-invalid": !!l(b),
3144
+ "aria-describedby": l(b) ? `${e.name}-error` : void 0,
3145
+ children: (() => {
3146
+ const f = e.icon, y = f && String(f).trim() ? String(f) : "★";
3147
+ return [...Array(d)].map((C, x) => {
3148
+ const j = x < b, v = s !== null && x <= s || j ? "gold" : "lightgray";
3149
+ return /* @__PURE__ */ g.jsx(
3150
+ "span",
3151
+ {
3152
+ ref: (w) => m.current[x] = w,
3153
+ role: "radio",
3154
+ tabIndex: b > 0 ? x === b - 1 ? 0 : -1 : x === 0 ? 0 : -1,
3155
+ "aria-checked": j,
3156
+ onClick: () => p(x + 1),
3157
+ onKeyDown: (w) => {
3158
+ if (w.key === "Enter" || w.key === " ")
3159
+ w.preventDefault(), p(x + 1);
3160
+ else if (w.key === "ArrowRight" || w.key === "ArrowUp") {
3161
+ w.preventDefault();
3162
+ const I = Math.min(d - 1, x + 1);
3163
+ m.current[I]?.focus();
3164
+ } else if (w.key === "ArrowLeft" || w.key === "ArrowDown") {
3165
+ w.preventDefault();
3166
+ const I = Math.max(0, x - 1);
3167
+ m.current[I]?.focus();
3168
+ }
3169
+ },
3170
+ onMouseEnter: () => i(x),
3171
+ onMouseLeave: () => i(null),
3172
+ style: { ...bt, color: v },
3173
+ "aria-label": `Rating ${x + 1}`,
3174
+ title: t(`${e.displayName} ${x + 1}`),
3175
+ children: y
3176
+ },
3177
+ x
3178
+ );
3179
+ });
3180
+ })()
3181
+ }
3182
+ ) });
3084
3183
  }, xt = ({
3085
3184
  field: e,
3086
3185
  value: r,
3087
3186
  onChange: n,
3088
- onError: o
3187
+ onError: a
3089
3188
  }) => {
3090
- const { t, definitionName: a } = T(), s = N.useRef(null), i = N.useRef(null), u = N.useRef(
3091
- o
3189
+ const { t, definitionName: o } = L(), s = F.useRef(null), i = F.useRef(null), m = F.useRef(
3190
+ a
3092
3191
  );
3093
- N.useEffect(() => {
3094
- u.current = o;
3095
- }, [o]);
3096
- const m = G(
3192
+ F.useEffect(() => {
3193
+ m.current = a;
3194
+ }, [a]);
3195
+ const d = J(
3097
3196
  () => e.pattern ? new RegExp(e.pattern) : null,
3098
3197
  [e.pattern]
3099
- ), l = N.useCallback(
3100
- (f) => f === "" ? e.required ? t("Value required") : null : e.minLength !== void 0 && f.length < e.minLength ? t("Must be at least {{1}} characters", e.minLength) : e.maxLength !== void 0 && f.length > e.maxLength ? t("Must be at most {{1}} characters", e.maxLength) : m && !m.test(f) ? t("Input does not match pattern: {{1}}", e.pattern) : Y(a, e, f, t),
3101
- [e, a, t, m]
3102
- ), p = (f) => {
3103
- const y = f.target.value, x = l(y);
3104
- n?.(y, x);
3198
+ ), l = F.useCallback(
3199
+ (f) => f === "" ? e.required ? t("Value required") : null : e.minLength !== void 0 && f.length < e.minLength ? t("Must be at least {{1}} characters", e.minLength) : e.maxLength !== void 0 && f.length > e.maxLength ? t("Must be at most {{1}} characters", e.maxLength) : d && !d.test(f) ? e.patternErrorMessage ? t(e.patternErrorMessage) : t("Input does not match pattern: {{1}}", e.pattern) : H(o, e, f, t),
3200
+ [e, o, t, d]
3201
+ ), u = (f) => {
3202
+ const y = f.target.value, C = l(y);
3203
+ n?.(y, C);
3105
3204
  };
3106
- C(() => {
3205
+ k(() => {
3107
3206
  const f = l(r ?? "");
3108
- s.current && s.current.value !== String(r ?? "") && (s.current.value = String(r ?? "")), f !== i.current && (i.current = f, u.current?.(f ?? null));
3207
+ s.current && s.current.value !== String(r ?? "") && (s.current.value = String(r ?? "")), f !== i.current && (i.current = f, m.current?.(f ?? null));
3109
3208
  }, [r, l]);
3110
- const [c, d] = N.useState(!1), b = () => d((f) => !f);
3111
- return /* @__PURE__ */ g.jsx(W, { field: e, error: l(String(r ?? "")), children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, width: "100%" }, children: [
3209
+ const [c, p] = F.useState(!1), b = () => p((f) => !f);
3210
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: l(String(r ?? "")), children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, width: "100%" }, children: [
3112
3211
  /* @__PURE__ */ g.jsx(
3113
3212
  "input",
3114
3213
  {
@@ -3116,9 +3215,11 @@ const lt = ({
3116
3215
  type: c ? "text" : "password",
3117
3216
  defaultValue: String(r ?? ""),
3118
3217
  ref: s,
3119
- onChange: p,
3120
- className: K($.input, $.textInput),
3121
- style: { flex: 1, minWidth: 0 }
3218
+ onChange: u,
3219
+ className: G(M.input, M.textInput),
3220
+ style: { flex: 1, minWidth: 0 },
3221
+ "aria-invalid": !!l(String(r ?? "")),
3222
+ "aria-describedby": l(String(r ?? "")) ? `${e.name}-error` : void 0
3122
3223
  }
3123
3224
  ),
3124
3225
  /* @__PURE__ */ g.jsx(
@@ -3148,9 +3249,9 @@ const St = ({
3148
3249
  field: e,
3149
3250
  value: r,
3150
3251
  onChange: n,
3151
- onError: o
3252
+ onError: a
3152
3253
  }) => {
3153
- const { t, definitionName: a } = T(), s = k(null), i = k(null), u = N.useCallback(
3254
+ const { t, definitionName: o } = L(), s = E(null), i = E(null), m = F.useCallback(
3154
3255
  (b) => {
3155
3256
  let f = null;
3156
3257
  if (b.trim() === "")
@@ -3158,45 +3259,49 @@ const St = ({
3158
3259
  if (!wt(b))
3159
3260
  return t("Invalid number");
3160
3261
  const y = Number(b);
3161
- return typeof e.min == "number" && y < e.min ? t("Value should be at least {{1}}", e.min) : typeof e.max == "number" && y > e.max ? t("Value should be at most {{1}}", e.max) : (f || (f = Y(a, e, y, t)), f);
3262
+ return typeof e.min == "number" && y < e.min ? t("Value should be at least {{1}}", e.min) : typeof e.max == "number" && y > e.max ? t("Value should be at most {{1}}", e.max) : (f || (f = H(o, e, y, t)), f);
3162
3263
  },
3163
- [a, e, t]
3164
- ), m = k(null), l = k(o);
3165
- C(() => {
3166
- l.current = o;
3167
- }, [o]), C(() => {
3168
- const b = String(r), f = u(b);
3169
- i.current && document.activeElement !== i.current && (i.current.value = isNaN(Number(b)) ? String(e.min ?? 0) : String(Number(b))), s.current && document.activeElement !== s.current && (s.current.value = b), f !== m.current && (m.current = f, l.current?.(f ?? null));
3170
- }, [r, u, e.min]);
3171
- const p = e.min ?? 0, c = e.max ?? 100, d = (b) => {
3172
- const f = b.target.value, y = u(f);
3264
+ [o, e, t]
3265
+ ), d = E(null), l = E(a);
3266
+ k(() => {
3267
+ l.current = a;
3268
+ }, [a]), k(() => {
3269
+ const b = String(r), f = m(b);
3270
+ i.current && document.activeElement !== i.current && (i.current.value = isNaN(Number(b)) ? String(e.min ?? 0) : String(Number(b))), s.current && document.activeElement !== s.current && (s.current.value = b), f !== d.current && (d.current = f, l.current?.(f ?? null));
3271
+ }, [r, m, e.min]);
3272
+ const u = e.min ?? 0, c = e.max ?? 100, p = (b) => {
3273
+ const f = b.target.value, y = m(f);
3173
3274
  n?.(f, y);
3174
3275
  };
3175
- return /* @__PURE__ */ g.jsx(W, { field: e, error: u(String(r ?? "")), children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", width: "100%" }, children: [
3276
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: m(String(r ?? "")), children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", width: "100%" }, children: [
3176
3277
  /* @__PURE__ */ g.jsx(
3177
3278
  "input",
3178
3279
  {
3179
3280
  ref: i,
3281
+ id: `${e.name}-range`,
3180
3282
  type: "range",
3181
- defaultValue: isNaN(Number(r)) ? String(p) : String(Number(r)),
3182
- onChange: d,
3183
- min: p,
3283
+ defaultValue: isNaN(Number(r)) ? String(u) : String(Number(r)),
3284
+ onChange: p,
3285
+ min: u,
3184
3286
  max: c,
3185
3287
  style: {
3186
3288
  padding: "0px, 0px",
3187
3289
  // Remove padding to make Chrome browser works fine.
3188
3290
  flex: 1
3189
3291
  },
3190
- className: $.rangeInput
3292
+ className: M.rangeInput,
3293
+ "aria-invalid": !!m(String(r ?? "")),
3294
+ "aria-describedby": m(String(r ?? "")) ? `${e.name}-error` : void 0
3191
3295
  }
3192
3296
  ),
3193
3297
  /* @__PURE__ */ g.jsx(
3194
3298
  "input",
3195
3299
  {
3300
+ id: e.name,
3196
3301
  ref: s,
3197
3302
  type: "text",
3198
3303
  defaultValue: String(r ?? ""),
3199
- onChange: d,
3304
+ onChange: p,
3200
3305
  required: !0,
3201
3306
  style: {
3202
3307
  width: "40px",
@@ -3205,7 +3310,9 @@ const St = ({
3205
3310
  textAlign: "center",
3206
3311
  flexShrink: 0
3207
3312
  },
3208
- className: K($.input, $.textInput)
3313
+ className: G(M.input, M.textInput),
3314
+ "aria-invalid": !!m(String(r ?? "")),
3315
+ "aria-describedby": m(String(r ?? "")) ? `${e.name}-error` : void 0
3209
3316
  }
3210
3317
  )
3211
3318
  ] }) });
@@ -3213,20 +3320,20 @@ const St = ({
3213
3320
  field: e,
3214
3321
  value: r,
3215
3322
  onChange: n,
3216
- onError: o
3323
+ onError: a
3217
3324
  }) => {
3218
- const { t, formStyle: a, fieldStyle: s, definitionName: i } = T(), u = a, m = s, l = (w, j, I) => {
3219
- if (!j) return {};
3220
- const S = w?.[j];
3221
- return (I && S ? S[I] : void 0) ?? {};
3222
- }, p = N.useMemo(() => ({
3325
+ const { t, formStyle: o, fieldStyle: s, definitionName: i } = L(), m = o, d = s, l = (v, w, I) => {
3326
+ if (!w) return {};
3327
+ const A = v?.[w];
3328
+ return (I && A ? A[I] : void 0) ?? {};
3329
+ }, u = F.useMemo(() => ({
3223
3330
  display: "inline-block",
3224
3331
  position: "relative",
3225
3332
  width: 44,
3226
3333
  height: 24,
3227
- ...l(u, "switch", "label"),
3228
- ...l(m, void 0, "label")
3229
- }), [u, m]), c = N.useMemo(() => ({
3334
+ ...l(m, "switch", "label"),
3335
+ ...l(d, void 0, "label")
3336
+ }), [m, d]), c = F.useMemo(() => ({
3230
3337
  position: "absolute",
3231
3338
  opacity: 0,
3232
3339
  top: 0,
@@ -3237,9 +3344,9 @@ const St = ({
3237
3344
  cursor: "pointer",
3238
3345
  pointerEvents: "none",
3239
3346
  // Make hidden input non-interactive to avoid event conflicts
3240
- ...l(u, "switch", "hiddenInput"),
3241
- ...l(m, void 0, "hiddenInput")
3242
- }), [u, m]), d = N.useMemo(() => ({
3347
+ ...l(m, "switch", "hiddenInput"),
3348
+ ...l(d, void 0, "hiddenInput")
3349
+ }), [m, d]), p = F.useMemo(() => ({
3243
3350
  position: "absolute",
3244
3351
  cursor: "pointer",
3245
3352
  top: 0,
@@ -3256,9 +3363,9 @@ const St = ({
3256
3363
  borderWidth: 2,
3257
3364
  borderStyle: "solid",
3258
3365
  borderColor: "transparent",
3259
- ...l(u, "switch", "slider"),
3260
- ...l(m, void 0, "slider")
3261
- }), [u, m]), b = N.useMemo(() => ({
3366
+ ...l(m, "switch", "slider"),
3367
+ ...l(d, void 0, "slider")
3368
+ }), [m, d]), b = F.useMemo(() => ({
3262
3369
  position: "absolute",
3263
3370
  height: 16,
3264
3371
  width: 16,
@@ -3268,30 +3375,30 @@ const St = ({
3268
3375
  transition: "0.3s",
3269
3376
  borderRadius: "50%",
3270
3377
  boxShadow: "0 1px 3px rgba(0, 0, 0, 0.3)",
3271
- ...l(u, "switch", "knob"),
3272
- ...l(m, void 0, "knob")
3273
- }), [u, m]), f = !!r, y = N.useRef(null), x = N.useRef(o), v = N.useCallback((w) => w ? Y(i, e, w, t) ?? null : e.required ? t("Value required") : null, [e, t, i]), F = () => {
3274
- const w = !f, j = v(w);
3275
- n?.(w, j);
3378
+ ...l(m, "switch", "knob"),
3379
+ ...l(d, void 0, "knob")
3380
+ }), [m, d]), f = !!r, y = F.useRef(null), C = F.useRef(a), x = F.useCallback((v) => v ? H(i, e, v, t) ?? null : e.required ? t("Value required") : null, [e, t, i]), j = () => {
3381
+ const v = !f, w = x(v);
3382
+ n?.(v, w);
3276
3383
  };
3277
- N.useEffect(() => {
3278
- x.current = o;
3279
- }, [o]), N.useEffect(() => {
3280
- const w = v(f);
3281
- w !== y.current && (y.current = w, x.current?.(w ?? null));
3282
- }, [f, e, v]);
3283
- const R = e.name;
3284
- return /* @__PURE__ */ g.jsx(W, { field: e, error: v(f), rightAlign: !1, children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
3384
+ F.useEffect(() => {
3385
+ C.current = a;
3386
+ }, [a]), F.useEffect(() => {
3387
+ const v = x(f);
3388
+ v !== y.current && (y.current = v, C.current?.(v ?? null));
3389
+ }, [f, e, x]);
3390
+ const N = e.name;
3391
+ return /* @__PURE__ */ g.jsx(U, { field: e, error: x(f), rightAlign: !1, children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
3285
3392
  /* @__PURE__ */ g.jsx(
3286
3393
  "label",
3287
3394
  {
3288
- className: $.label,
3289
- htmlFor: R,
3395
+ className: M.label,
3396
+ htmlFor: N,
3290
3397
  style: { textAlign: "left", justifyContent: "flex-start" },
3291
3398
  children: t(e.displayName)
3292
3399
  }
3293
3400
  ),
3294
- /* @__PURE__ */ g.jsxs("label", { style: p, children: [
3401
+ /* @__PURE__ */ g.jsxs("label", { style: u, children: [
3295
3402
  /* @__PURE__ */ g.jsx(
3296
3403
  "input",
3297
3404
  {
@@ -3300,6 +3407,8 @@ const St = ({
3300
3407
  checked: f,
3301
3408
  readOnly: !0,
3302
3409
  "aria-label": t(e.displayName),
3410
+ "aria-invalid": !!x(f),
3411
+ "aria-describedby": x(f) ? `${e.name}-error` : void 0,
3303
3412
  style: c,
3304
3413
  tabIndex: -1
3305
3414
  }
@@ -3311,12 +3420,14 @@ const St = ({
3311
3420
  "data-testid": "switch",
3312
3421
  tabIndex: 0,
3313
3422
  "aria-checked": f,
3314
- onClick: F,
3315
- onKeyDown: (w) => {
3316
- (w.key === " " || w.key === "Spacebar" || w.key === "Space" || w.key === "Enter") && (w.preventDefault(), F());
3423
+ "aria-invalid": !!x(f),
3424
+ "aria-describedby": x(f) ? `${e.name}-error` : void 0,
3425
+ onClick: j,
3426
+ onKeyDown: (v) => {
3427
+ (v.key === " " || v.key === "Spacebar" || v.key === "Space" || v.key === "Enter") && (v.preventDefault(), j());
3317
3428
  },
3318
3429
  className: `reactaform-switch ${f ? "active checked on" : ""} `,
3319
- style: f ? { ...d, backgroundColor: "var(--reactaform-switch-on-bg, #22c55e)", borderColor: "var(--reactaform-switch-on-border, #16a34a)" } : d,
3430
+ style: f ? { ...p, backgroundColor: "var(--reactaform-switch-on-bg, #22c55e)", borderColor: "var(--reactaform-switch-on-border, #16a34a)" } : p,
3320
3431
  children: /* @__PURE__ */ g.jsx(
3321
3432
  "span",
3322
3433
  {
@@ -3334,95 +3445,99 @@ const St = ({
3334
3445
  field: e,
3335
3446
  value: r,
3336
3447
  onChange: n,
3337
- onError: o
3448
+ onError: a
3338
3449
  }) => {
3339
- const { t, definitionName: a } = T(), s = N.useRef(null), i = N.useRef(null), u = N.useRef(
3340
- o
3450
+ const { t, definitionName: o } = L(), s = F.useRef(null), i = F.useRef(null), m = F.useRef(
3451
+ a
3341
3452
  );
3342
- N.useEffect(() => {
3343
- u.current = o;
3344
- }, [o]);
3345
- const m = G(
3453
+ F.useEffect(() => {
3454
+ m.current = a;
3455
+ }, [a]);
3456
+ const d = J(
3346
3457
  () => e.pattern ? new RegExp(e.pattern) : null,
3347
3458
  [e.pattern]
3348
- ), l = N.useCallback(
3349
- (c) => c.trim() === "" ? e.required ? t("Value required") : null : e.minLength !== void 0 && c.length < e.minLength ? t("Must be at least {{1}} characters", e.minLength) : e.maxLength !== void 0 && c.length > e.maxLength ? t("Must be at most {{1}} characters", e.maxLength) : m && !m.test(c) ? t("Input does not match pattern: {{1}}", e.pattern) : Y(a, e, c, t),
3350
- [e, a, t, m]
3351
- ), p = (c) => {
3352
- const d = c.target.value, b = l(d);
3353
- n?.(d, b);
3459
+ ), l = F.useCallback(
3460
+ (c) => c.trim() === "" ? e.required ? t("Value required") : null : e.minLength !== void 0 && c.length < e.minLength ? t("Must be at least {{1}} characters", e.minLength) : e.maxLength !== void 0 && c.length > e.maxLength ? t("Must be at most {{1}} characters", e.maxLength) : d && !d.test(c) ? e.patternErrorMessage ? t(e.patternErrorMessage) : t("Input does not match pattern: {{1}}", e.pattern) : H(o, e, c, t),
3461
+ [e, o, t, d]
3462
+ ), u = (c) => {
3463
+ const p = c.target.value, b = l(p);
3464
+ n?.(p, b);
3354
3465
  };
3355
- return C(() => {
3466
+ return k(() => {
3356
3467
  const c = l(r);
3357
- s.current && s.current.value !== String(r ?? "") && (s.current.value = String(r ?? "")), c !== i.current && (i.current = c, u.current?.(c ?? null));
3358
- }, [r, l]), /* @__PURE__ */ g.jsx(W, { field: e, error: l(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
3468
+ s.current && s.current.value !== String(r ?? "") && (s.current.value = String(r ?? "")), c !== i.current && (i.current = c, m.current?.(c ?? null));
3469
+ }, [r, l]), /* @__PURE__ */ g.jsx(U, { field: e, error: l(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
3359
3470
  "input",
3360
3471
  {
3361
3472
  id: e.name,
3473
+ "aria-invalid": !!l(String(r ?? "")),
3474
+ "aria-describedby": l(String(r ?? "")) ? `${e.name}-error` : void 0,
3362
3475
  type: "text",
3363
3476
  defaultValue: String(r ?? ""),
3364
3477
  ref: s,
3365
- onChange: p,
3366
- className: K($.input, $.textInput)
3478
+ onChange: u,
3479
+ className: G(M.input, M.textInput)
3367
3480
  }
3368
3481
  ) });
3369
3482
  }, jt = ({
3370
3483
  field: e,
3371
3484
  value: r,
3372
3485
  onChange: n,
3373
- onError: o
3486
+ onError: a
3374
3487
  }) => {
3375
- const { t, definitionName: a } = T(), s = k(null), i = k(o), u = e.includeSeconds ?? !0;
3376
- C(() => {
3377
- i.current = o;
3378
- }, [o]);
3379
- const m = N.useCallback((p) => {
3380
- if (!p || p.trim() === "")
3488
+ const { t, definitionName: o } = L(), s = E(null), i = E(a), m = e.includeSeconds ?? !0;
3489
+ k(() => {
3490
+ i.current = a;
3491
+ }, [a]);
3492
+ const d = F.useCallback((u) => {
3493
+ if (!u || u.trim() === "")
3381
3494
  return e.required || e.min || e.max ? t("Value required") : null;
3382
3495
  const c = (f) => {
3383
- const y = f.split(":").map((v) => parseInt(v, 10));
3384
- if (y.some((v) => Number.isNaN(v))) return NaN;
3385
- let x = 0;
3496
+ const y = f.split(":").map((x) => parseInt(x, 10));
3497
+ if (y.some((x) => Number.isNaN(x))) return NaN;
3498
+ let C = 0;
3386
3499
  if (y.length === 3)
3387
- x = y[0] * 3600 + y[1] * 60 + y[2];
3500
+ C = y[0] * 3600 + y[1] * 60 + y[2];
3388
3501
  else if (y.length === 2)
3389
- x = y[0] * 3600 + y[1] * 60;
3502
+ C = y[0] * 3600 + y[1] * 60;
3390
3503
  else if (y.length === 1)
3391
- x = y[0] * 3600;
3504
+ C = y[0] * 3600;
3392
3505
  else
3393
3506
  return NaN;
3394
- return x;
3395
- }, d = c(p);
3396
- if (Number.isNaN(d)) return t("Invalid time format");
3507
+ return C;
3508
+ }, p = c(u);
3509
+ if (Number.isNaN(p)) return t("Invalid time format");
3397
3510
  if (e.min && typeof e.min == "string") {
3398
3511
  const f = c(e.min);
3399
- if (!Number.isNaN(f) && d < f)
3512
+ if (!Number.isNaN(f) && p < f)
3400
3513
  return t("Time must be on or after {{1}}", e.min);
3401
3514
  }
3402
3515
  if (e.max && typeof e.max == "string") {
3403
3516
  const f = c(e.max);
3404
- if (!Number.isNaN(f) && d > f)
3517
+ if (!Number.isNaN(f) && p > f)
3405
3518
  return t("Time must be on or before {{1}}", e.max);
3406
3519
  }
3407
- return Y(a, e, p, t) ?? null;
3408
- }, [e, a, t]), l = (p) => {
3409
- const c = p.target.value, d = m(c);
3410
- n?.(c, d);
3520
+ return H(o, e, u, t) ?? null;
3521
+ }, [e, o, t]), l = (u) => {
3522
+ const c = u.target.value, p = d(c);
3523
+ n?.(c, p);
3411
3524
  };
3412
- return C(() => {
3413
- const p = m(r);
3414
- p !== s.current && (s.current = p, i.current?.(p ?? null));
3415
- }, [r, m]), /* @__PURE__ */ g.jsx(W, { field: e, error: m(r), children: /* @__PURE__ */ g.jsx(
3525
+ return k(() => {
3526
+ const u = d(r);
3527
+ u !== s.current && (s.current = u, i.current?.(u ?? null));
3528
+ }, [r, d]), /* @__PURE__ */ g.jsx(U, { field: e, error: d(r), children: /* @__PURE__ */ g.jsx(
3416
3529
  "input",
3417
3530
  {
3418
3531
  id: e.name,
3419
3532
  type: "time",
3420
3533
  value: r,
3421
- step: u ? 1 : 60,
3534
+ step: m ? 1 : 60,
3422
3535
  onChange: l,
3423
3536
  min: typeof e.min == "string" ? e.min : void 0,
3424
3537
  max: typeof e.max == "string" ? e.max : void 0,
3425
- className: K($.input, $.textInput)
3538
+ className: G(M.input, M.textInput),
3539
+ "aria-invalid": !!d(r),
3540
+ "aria-describedby": d(r) ? `${e.name}-error` : void 0
3426
3541
  }
3427
3542
  ) });
3428
3543
  };
@@ -3430,28 +3545,28 @@ function kt({
3430
3545
  pos: e,
3431
3546
  options: r,
3432
3547
  onClose: n,
3433
- onClickOption: o
3548
+ onClickOption: a
3434
3549
  }) {
3435
- const t = k(null), a = k(!1), s = typeof window < "u" ? document.getElementById("popup-root") || document.body : null;
3436
- if (C(() => {
3437
- function d(b) {
3438
- a.current || b.target.dataset?.popupMenu === "item" || t.current && b.target instanceof Node && !t.current.contains(b.target) && n();
3550
+ const t = E(null), o = E(!1), s = typeof window < "u" ? document.getElementById("popup-root") || document.body : null;
3551
+ if (k(() => {
3552
+ function p(b) {
3553
+ o.current || b.target.dataset?.popupMenu === "item" || t.current && b.target instanceof Node && !t.current.contains(b.target) && n();
3439
3554
  }
3440
- return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
3555
+ return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
3441
3556
  }, [n]), !s || r === void 0 || r.length === 0 || !e || e.x == null || e.y == null) return null;
3442
- const i = e.x, u = e.y, m = typeof window < "u" ? window.innerWidth : 1024, l = Math.max(0, m - 160), p = Math.max(0, Math.min(i, l)), c = Math.max(0, u);
3443
- return Me.createPortal(
3557
+ const i = e.x, m = e.y, d = typeof window < "u" ? window.innerWidth : 1024, l = Math.max(0, d - 160), u = Math.max(0, Math.min(i, l)), c = Math.max(0, m);
3558
+ return $e.createPortal(
3444
3559
  /* @__PURE__ */ g.jsx(
3445
3560
  "div",
3446
3561
  {
3447
3562
  ref: t,
3448
- onMouseDown: (d) => {
3449
- d.stopPropagation();
3563
+ onMouseDown: (p) => {
3564
+ p.stopPropagation();
3450
3565
  },
3451
3566
  style: {
3452
3567
  position: "fixed",
3453
3568
  top: c,
3454
- left: p,
3569
+ left: u,
3455
3570
  backgroundColor: "var(--reactaform-primary-bg, #fff)",
3456
3571
  border: "1px solid var(--reactaform-border-color, #ccc)",
3457
3572
  borderRadius: "var(--reactaform-border-radius, 4px)",
@@ -3460,16 +3575,16 @@ function kt({
3460
3575
  minWidth: "var(--reactaform-menu-min-width, 150px)",
3461
3576
  pointerEvents: "auto"
3462
3577
  },
3463
- children: r.map((d, b) => /* @__PURE__ */ g.jsx(
3578
+ children: r.map((p, b) => /* @__PURE__ */ g.jsx(
3464
3579
  "div",
3465
3580
  {
3466
3581
  "data-popup-menu": "item",
3467
3582
  onMouseDown: (f) => {
3468
- f.stopPropagation(), a.current = !0;
3583
+ f.stopPropagation(), o.current = !0;
3469
3584
  },
3470
3585
  onClick: (f) => {
3471
- f.stopPropagation(), f.preventDefault(), o(d), n(), setTimeout(() => {
3472
- a.current = !1;
3586
+ f.stopPropagation(), f.preventDefault(), a(p), n(), setTimeout(() => {
3587
+ o.current = !1;
3473
3588
  }, 100);
3474
3589
  },
3475
3590
  style: {
@@ -3485,9 +3600,9 @@ function kt({
3485
3600
  onMouseLeave: (f) => {
3486
3601
  f.currentTarget.style.backgroundColor = "transparent";
3487
3602
  },
3488
- children: d.label
3603
+ children: p.label
3489
3604
  },
3490
- d.label ?? b
3605
+ p.label ?? b
3491
3606
  ))
3492
3607
  }
3493
3608
  ),
@@ -3498,15 +3613,15 @@ const he = {};
3498
3613
  function Rt(e, r) {
3499
3614
  if (e in he)
3500
3615
  return;
3501
- const n = Le[e] ?? {}, o = {}, t = {}, a = {};
3502
- for (const [i, u] of Object.entries(n))
3503
- typeof u.factor == "number" && (o[i] = u.factor), t[i] = r(i), a[r(i)] = i;
3616
+ const n = Le[e] ?? {}, a = {}, t = {}, o = {};
3617
+ for (const [i, m] of Object.entries(n))
3618
+ typeof m.factor == "number" && (a[i] = m.factor), t[i] = r(i), o[r(i)] = i;
3504
3619
  const s = Object.keys(n)[0] ?? "";
3505
3620
  he[e] = {
3506
3621
  default: s,
3507
- factors: o,
3622
+ factors: a,
3508
3623
  labels: t,
3509
- reverseLabels: a
3624
+ reverseLabels: o
3510
3625
  };
3511
3626
  }
3512
3627
  function Et(e, r, n) {
@@ -3525,14 +3640,14 @@ function Et(e, r, n) {
3525
3640
  function Nt(e, r, n) {
3526
3641
  if (!Number.isFinite(e)) return [];
3527
3642
  if (n === he.temperature)
3528
- return Object.keys(n.labels).map((a) => {
3529
- const s = Et(r, a, e);
3530
- return Number.isFinite(s) ? { label: `${s.toFixed(6)} ${a}`, value: s.toString(), unit: a } : { label: `${String(s)} ${a}`, value: String(s), unit: a };
3643
+ return Object.keys(n.labels).map((o) => {
3644
+ const s = Et(r, o, e);
3645
+ return Number.isFinite(s) ? { label: `${s.toFixed(6)} ${o}`, value: s.toString(), unit: o } : { label: `${String(s)} ${o}`, value: String(s), unit: o };
3531
3646
  });
3532
3647
  const t = n.factors[r];
3533
- return t === void 0 ? [] : Object.entries(n.factors).map(([a, s]) => {
3648
+ return t === void 0 ? [] : Object.entries(n.factors).map(([o, s]) => {
3534
3649
  const i = e / t * s;
3535
- return Number.isFinite(i) ? { label: `${i.toFixed(6)} ${a}`, value: i.toString(), unit: a } : { label: `${String(i)} ${a}`, value: String(i), unit: a };
3650
+ return Number.isFinite(i) ? { label: `${i.toFixed(6)} ${o}`, value: i.toString(), unit: o } : { label: `${String(i)} ${o}`, value: String(i), unit: o };
3536
3651
  });
3537
3652
  }
3538
3653
  function xe(e, r) {
@@ -3542,71 +3657,71 @@ const It = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/, At = ({
3542
3657
  unitFactors: e,
3543
3658
  field: r,
3544
3659
  value: n,
3545
- onChange: o,
3660
+ onChange: a,
3546
3661
  onError: t
3547
3662
  }) => {
3548
- const { t: a, definitionName: s } = T(), i = k(null), u = k(null), m = k(null), [l, p] = D(null), [c, d] = D(null), [b, f] = D(!1), [y, x] = D(null), [v, F] = D([]), R = Z(
3549
- (P, O) => {
3550
- if (!P || P.trim() === "")
3551
- return r.required ? a("Value required") : null;
3552
- if (!It.test(P)) return a("Must be a valid number");
3553
- const h = Y(s, r, [P, O], a);
3554
- return h || null;
3663
+ const { t: o, definitionName: s } = L(), i = E(null), m = E(null), d = E(null), [l, u] = V(null), [c, p] = V(null), [b, f] = V(!1), [y, C] = V(null), [x, j] = V([]), N = X(
3664
+ (T, h) => {
3665
+ if (!T || T.trim() === "")
3666
+ return r.required ? o("Value required") : null;
3667
+ if (!It.test(T)) return o("Must be a valid number");
3668
+ const S = H(s, r, [T, h], o);
3669
+ return S || null;
3555
3670
  },
3556
- [s, r, a]
3557
- ), w = e.reverseLabels !== void 0 ? e.reverseLabels : Object.fromEntries(
3558
- Object.entries(e.labels).map(([P, O]) => [O, P])
3671
+ [s, r, o]
3672
+ ), v = e.reverseLabels !== void 0 ? e.reverseLabels : Object.fromEntries(
3673
+ Object.entries(e.labels).map(([T, h]) => [h, T])
3559
3674
  );
3560
- C(() => {
3561
- const P = String(n[0]);
3562
- let O = n[1] ?? e.default;
3563
- O = xe(O, e) || O;
3564
- const h = document.activeElement;
3565
- h === i.current || h === u.current || (i.current && (i.current.value = P), u.current && (u.current.value = O), m.current !== null && (cancelAnimationFrame(m.current), m.current = null), m.current = requestAnimationFrame(() => {
3566
- m.current = null, p(null), d(null);
3675
+ k(() => {
3676
+ const T = String(n[0]);
3677
+ let h = n[1] ?? e.default;
3678
+ h = xe(h, e) || h;
3679
+ const S = document.activeElement;
3680
+ S === i.current || S === m.current || (i.current && (i.current.value = T), m.current && (m.current.value = h), d.current !== null && (cancelAnimationFrame(d.current), d.current = null), d.current = requestAnimationFrame(() => {
3681
+ d.current = null, u(null), p(null);
3567
3682
  }));
3568
- }, [n, e]), C(() => () => {
3569
- m.current !== null && (cancelAnimationFrame(m.current), m.current = null);
3683
+ }, [n, e]), k(() => () => {
3684
+ d.current !== null && (cancelAnimationFrame(d.current), d.current = null);
3570
3685
  }, []);
3571
- const j = k(null), I = k(
3686
+ const w = E(null), I = E(
3572
3687
  t
3573
3688
  );
3574
- C(() => {
3689
+ k(() => {
3575
3690
  I.current = t;
3576
- }, [t]), C(() => {
3577
- const P = String(n[0]);
3578
- let O = n[1] ?? e.default;
3579
- O = xe(O, e) || O;
3580
- const h = R(P, O);
3581
- h !== j.current && (j.current = h, I.current?.(h ?? null));
3582
- }, [n, e, R]);
3583
- const S = (P, O, h) => {
3584
- const E = w[O] || O;
3585
- o?.([P, E], h);
3586
- }, A = (P) => {
3587
- const O = P.target.value, h = u.current ? u.current.value : e.default, E = R(O, h);
3588
- p(O), S(O, h, E);
3589
- }, M = (P) => {
3590
- const O = P.target.value, h = i.current ? i.current.value : String(n[0] ?? ""), E = R(h, O);
3591
- d(O), u.current && (u.current.value = O), S(h, O, E);
3592
- }, z = (P) => {
3593
- const O = i.current ? i.current.value : String(n[0] ?? ""), h = parseFloat(O), E = u.current ? u.current.value : e.default;
3594
- if (R(O, E) || !O.trim() || !Number.isFinite(h))
3691
+ }, [t]), k(() => {
3692
+ const T = String(n[0]);
3693
+ let h = n[1] ?? e.default;
3694
+ h = xe(h, e) || h;
3695
+ const S = N(T, h);
3696
+ S !== w.current && (w.current = S, I.current?.(S ?? null));
3697
+ }, [n, e, N]);
3698
+ const A = (T, h, S) => {
3699
+ const z = v[h] || h;
3700
+ a?.([T, z], S);
3701
+ }, R = (T) => {
3702
+ const h = T.target.value, S = m.current ? m.current.value : e.default, z = N(h, S);
3703
+ u(h), A(h, S, z);
3704
+ }, $ = (T) => {
3705
+ const h = T.target.value, S = i.current ? i.current.value : String(n[0] ?? ""), z = N(S, h);
3706
+ p(h), m.current && (m.current.value = h), A(S, h, z);
3707
+ }, O = (T) => {
3708
+ const h = i.current ? i.current.value : String(n[0] ?? ""), S = parseFloat(h), z = m.current ? m.current.value : e.default;
3709
+ if (N(h, z) || !h.trim() || !Number.isFinite(S))
3595
3710
  return;
3596
- const U = P.currentTarget.getBoundingClientRect(), ne = U.left, ae = U.bottom;
3597
- x({ x: ne, y: ae });
3598
- const _ = Nt(h, E, e);
3599
- if (_.length === 0) {
3600
- F([]), f(!1);
3711
+ const te = T.currentTarget.getBoundingClientRect(), se = te.left, q = te.bottom;
3712
+ C({ x: se, y: q });
3713
+ const D = Nt(S, z, e);
3714
+ if (D.length === 0) {
3715
+ j([]), f(!1);
3601
3716
  return;
3602
3717
  }
3603
- F(_), f((V) => !V);
3604
- }, L = (P) => {
3605
- const { value: O, unit: h } = P;
3606
- f(!1), x(null), i.current && (i.current.value = O), u.current && (u.current.value = h), p(O), d(h);
3607
- const E = R(O, h);
3608
- S(O, h, E);
3609
- }, J = String(n[0] ?? ""), ce = xe(n[1] ?? e.default, e) || (n[1] ?? e.default), re = l ?? J, Q = !!R(re, c ?? ce) || !re.trim(), oe = {
3718
+ j(D), f((_) => !_);
3719
+ }, P = (T) => {
3720
+ const { value: h, unit: S } = T;
3721
+ f(!1), C(null), i.current && (i.current.value = h), m.current && (m.current.value = S), u(h), p(S);
3722
+ const z = N(h, S);
3723
+ A(h, S, z);
3724
+ }, W = String(n[0] ?? ""), ae = xe(n[1] ?? e.default, e) || (n[1] ?? e.default), re = l ?? W, Q = !!N(re, c ?? ae) || !re.trim(), oe = {
3610
3725
  width: "var(--reactaform-unit-btn-width, 2.5em)",
3611
3726
  height: "var(--reactaform-unit-btn-height, 2.5em)",
3612
3727
  padding: "var(--reactaform-unit-btn-padding, 0)",
@@ -3619,41 +3734,47 @@ const It = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/, At = ({
3619
3734
  display: "flex",
3620
3735
  alignItems: "center",
3621
3736
  justifyContent: "center"
3622
- };
3623
- return /* @__PURE__ */ g.jsx(W, { field: r, error: R(J, ce), children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "var(--reactaform-unit-gap, 8px)", width: "100%" }, children: [
3737
+ }, Z = N(W, ae);
3738
+ return /* @__PURE__ */ g.jsx(U, { field: r, error: Z, children: /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "var(--reactaform-unit-gap, 8px)", width: "100%" }, children: [
3624
3739
  /* @__PURE__ */ g.jsx(
3625
3740
  "input",
3626
3741
  {
3742
+ id: r.name,
3627
3743
  type: "text",
3628
3744
  ref: i,
3629
3745
  defaultValue: String(n[0] ?? ""),
3630
- onChange: A,
3746
+ onChange: R,
3631
3747
  style: { width: "var(--reactaform-unit-input-width, 100px)" },
3632
- className: K($.input, $.textInput)
3748
+ className: G(M.input, M.textInput),
3749
+ "aria-invalid": !!Z,
3750
+ "aria-describedby": Z ? `${r.name}-error` : void 0
3633
3751
  }
3634
3752
  ),
3635
3753
  /* @__PURE__ */ g.jsx(
3636
3754
  "select",
3637
3755
  {
3638
- ref: u,
3756
+ id: `${r.name}-unit`,
3757
+ ref: m,
3639
3758
  defaultValue: xe(n[1] ?? e.default, e) || (n[1] ?? e.default),
3640
- onChange: M,
3641
- className: K(
3642
- $.input,
3643
- $.inputSelect
3759
+ onChange: $,
3760
+ className: G(
3761
+ M.input,
3762
+ M.inputSelect
3644
3763
  ),
3645
- children: Object.keys(e.labels).map((P) => /* @__PURE__ */ g.jsx("option", { value: P, children: e.labels[P] ?? P }, P))
3764
+ "aria-invalid": !!Z,
3765
+ "aria-describedby": Z ? `${r.name}-error` : void 0,
3766
+ children: Object.keys(e.labels).map((T) => /* @__PURE__ */ g.jsx("option", { value: T, children: e.labels[T] ?? T }, T))
3646
3767
  }
3647
3768
  ),
3648
3769
  /* @__PURE__ */ g.jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
3649
3770
  /* @__PURE__ */ g.jsx(
3650
3771
  "button",
3651
3772
  {
3652
- onClick: z,
3773
+ onClick: O,
3653
3774
  "aria-disabled": Q,
3654
3775
  disabled: Q,
3655
3776
  style: oe,
3656
- className: $.button,
3777
+ className: M.button,
3657
3778
  children: /* @__PURE__ */ g.jsx(
3658
3779
  "span",
3659
3780
  {
@@ -3668,29 +3789,29 @@ const It = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?$/, At = ({
3668
3789
  )
3669
3790
  }
3670
3791
  ),
3671
- b && v && /* @__PURE__ */ g.jsx(
3792
+ b && x && /* @__PURE__ */ g.jsx(
3672
3793
  kt,
3673
3794
  {
3674
3795
  pos: y,
3675
- options: v,
3796
+ options: x,
3676
3797
  onClose: () => {
3677
- x(null), f(!1);
3798
+ C(null), f(!1);
3678
3799
  },
3679
- onClickOption: L
3800
+ onClickOption: P
3680
3801
  }
3681
3802
  )
3682
3803
  ] })
3683
3804
  ] }) });
3684
3805
  };
3685
3806
  function Ft({ field: e, value: r, onChange: n }) {
3686
- const { t: o } = T(), t = e.dimension;
3807
+ const { t: a } = L(), t = e.dimension;
3687
3808
  if (!t) return null;
3688
- he[t] || Rt(t, o);
3689
- const a = he[t];
3690
- return a ? /* @__PURE__ */ g.jsx(
3809
+ he[t] || Rt(t, a);
3810
+ const o = he[t];
3811
+ return o ? /* @__PURE__ */ g.jsx(
3691
3812
  At,
3692
3813
  {
3693
- unitFactors: a,
3814
+ unitFactors: o,
3694
3815
  field: e,
3695
3816
  value: r,
3696
3817
  onChange: n
@@ -3703,15 +3824,15 @@ const Xe = /^(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]
3703
3824
  } catch {
3704
3825
  return !1;
3705
3826
  }
3706
- }, Mt = ({
3827
+ }, $t = ({
3707
3828
  field: e,
3708
3829
  value: r,
3709
3830
  onChange: n,
3710
- onError: o
3831
+ onError: a
3711
3832
  }) => {
3712
- const { t, definitionName: a } = T(), s = k(null), i = Z(
3713
- (p) => {
3714
- const c = p.trim();
3833
+ const { t, definitionName: o } = L(), s = E(null), i = X(
3834
+ (u) => {
3835
+ const c = u.trim();
3715
3836
  if (c === "")
3716
3837
  return e.required ? t("Value required") : null;
3717
3838
  if (!Xe.test(c) && !Ze(c)) {
@@ -3727,32 +3848,34 @@ const Xe = /^(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]
3727
3848
  }
3728
3849
  if (!f) return t("Must be a valid URL");
3729
3850
  }
3730
- return Y(a, e, c, t) ?? null;
3851
+ return H(o, e, c, t) ?? null;
3731
3852
  },
3732
- [a, e, t]
3733
- ), u = (p) => {
3734
- const c = p.target.value, d = i(c);
3735
- n?.(c.trim(), d);
3736
- }, m = k(null), l = k(o);
3737
- return C(() => {
3738
- l.current = o;
3739
- }, [o]), C(() => {
3740
- const p = r ?? "", c = i(p);
3741
- s.current && s.current.value !== String(p) && (s.current.value = String(p)), c !== m.current && (m.current = c, l.current?.(c ?? null));
3742
- }, [r, i]), /* @__PURE__ */ g.jsx(W, { field: e, error: i(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
3853
+ [o, e, t]
3854
+ ), m = (u) => {
3855
+ const c = u.target.value, p = i(c);
3856
+ n?.(c.trim(), p);
3857
+ }, d = E(null), l = E(a);
3858
+ return k(() => {
3859
+ l.current = a;
3860
+ }, [a]), k(() => {
3861
+ const u = r ?? "", c = i(u);
3862
+ s.current && s.current.value !== String(u) && (s.current.value = String(u)), c !== d.current && (d.current = c, l.current?.(c ?? null));
3863
+ }, [r, i]), /* @__PURE__ */ g.jsx(U, { field: e, error: i(String(r ?? "")), children: /* @__PURE__ */ g.jsx(
3743
3864
  "input",
3744
3865
  {
3745
3866
  id: e.name,
3746
3867
  type: "url",
3747
3868
  defaultValue: String(r ?? ""),
3748
3869
  ref: s,
3749
- onChange: u,
3870
+ onChange: m,
3750
3871
  style: { alignItems: "left" },
3751
- className: K($.input, $.textInput),
3752
- placeholder: "https://example.com"
3872
+ className: G(M.input, M.textInput),
3873
+ placeholder: "https://example.com",
3874
+ "aria-invalid": !!i(String(r ?? "")),
3875
+ "aria-describedby": i(String(r ?? "")) ? `${e.name}-error` : void 0
3753
3876
  }
3754
3877
  ) });
3755
- }, Fe = new we(), Ot = /* @__PURE__ */ new Set([
3878
+ }, Fe = new we(), Mt = /* @__PURE__ */ new Set([
3756
3879
  "checkbox",
3757
3880
  "switch",
3758
3881
  "dropdown",
@@ -3771,7 +3894,7 @@ const Xe = /^(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]
3771
3894
  file: Kr,
3772
3895
  float: nt,
3773
3896
  "float-array": et,
3774
- image: at,
3897
+ image: ot,
3775
3898
  int: lt,
3776
3899
  "int-array": it,
3777
3900
  "multi-selection": mt,
@@ -3783,12 +3906,12 @@ const Xe = /^(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]
3783
3906
  separator: Gr,
3784
3907
  slider: St,
3785
3908
  string: Ke,
3786
- stepper: dt,
3909
+ stepper: ft,
3787
3910
  switch: Ct,
3788
3911
  text: Ke,
3789
3912
  time: jt,
3790
3913
  unit: Ft,
3791
- url: Mt
3914
+ url: $t
3792
3915
  };
3793
3916
  function ur(e, r, n) {
3794
3917
  if (!n && e in lr) {
@@ -3797,28 +3920,28 @@ function ur(e, r, n) {
3797
3920
  );
3798
3921
  return;
3799
3922
  }
3800
- if (Ot.has(e)) {
3923
+ if (Mt.has(e)) {
3801
3924
  Fe.register(e, r);
3802
3925
  return;
3803
3926
  }
3804
- const o = (t) => {
3927
+ const a = (t) => {
3805
3928
  const { callback: s, cancel: i } = jr(
3806
- (...u) => {
3807
- const m = t.onChange;
3808
- typeof m == "function" && m(...u);
3929
+ (...m) => {
3930
+ const d = t.onChange;
3931
+ typeof d == "function" && d(...m);
3809
3932
  },
3810
3933
  200
3811
3934
  );
3812
- return C(() => () => {
3935
+ return k(() => () => {
3813
3936
  i();
3814
- }, [i]), N.createElement(r, { ...t, onChange: s });
3937
+ }, [i]), F.createElement(r, { ...t, onChange: s });
3815
3938
  };
3816
- Fe.register(e, o);
3939
+ Fe.register(e, a);
3817
3940
  }
3818
- function an(e, r) {
3941
+ function on(e, r) {
3819
3942
  ur(e, r, !1);
3820
3943
  }
3821
- function $t(e) {
3944
+ function Ot(e) {
3822
3945
  return Fe.get(e);
3823
3946
  }
3824
3947
  let Qe = !1;
@@ -3827,63 +3950,63 @@ function mr() {
3827
3950
  ur(e, r, !0);
3828
3951
  }), Qe = !0);
3829
3952
  }
3830
- const fr = new we();
3831
- function Vt(e, r) {
3832
- fr.register(e, r);
3953
+ const dr = new we();
3954
+ function Dt(e, r) {
3955
+ dr.register(e, r);
3833
3956
  }
3834
- function Dt(e) {
3835
- return fr.get(e);
3957
+ function Vt(e) {
3958
+ return dr.get(e);
3836
3959
  }
3837
- Vt(
3960
+ Dt(
3838
3961
  "Preset_AlertSubmitHandler",
3839
3962
  (e, r, n) => {
3840
- const o = {
3963
+ const a = {
3841
3964
  name: r || "Unnamed Instance",
3842
3965
  version: e.version,
3843
3966
  definition: e.name,
3844
3967
  values: n
3845
- }, t = JSON.stringify(o, null, 2);
3968
+ }, t = JSON.stringify(a, null, 2);
3846
3969
  alert(t);
3847
3970
  }
3848
3971
  );
3849
- const dr = N.memo(({ field: e, value: r, handleChange: n, handleError: o }) => {
3850
- const t = $t(e.type), a = N.useCallback(
3851
- (i, u) => n(e.name, i, u),
3972
+ const fr = F.memo(({ field: e, value: r, handleChange: n, handleError: a }) => {
3973
+ const t = Ot(e.type), o = F.useCallback(
3974
+ (i, m) => n(e.name, i, m),
3852
3975
  [n, e.name]
3853
- ), s = N.useCallback(
3854
- (i) => o?.(e.name, i),
3855
- [o, e.name]
3976
+ ), s = F.useCallback(
3977
+ (i) => a?.(e.name, i),
3978
+ [a, e.name]
3856
3979
  );
3857
3980
  return t ? /* @__PURE__ */ g.jsx(
3858
3981
  t,
3859
3982
  {
3860
3983
  field: e,
3861
3984
  value: r,
3862
- onChange: a,
3985
+ onChange: o,
3863
3986
  onError: s
3864
3987
  }
3865
3988
  ) : null;
3866
3989
  }, (e, r) => e.field === r.field && e.value === r.value && e.handleChange === r.handleChange && e.handleError === r.handleError);
3867
- dr.displayName = "FieldWrapper";
3868
- const pr = (e, r, n, o) => /* @__PURE__ */ g.jsx(
3869
- dr,
3990
+ fr.displayName = "FieldWrapper";
3991
+ const pr = (e, r, n, a) => /* @__PURE__ */ g.jsx(
3992
+ fr,
3870
3993
  {
3871
3994
  field: e,
3872
3995
  value: r[e.name],
3873
3996
  handleChange: n,
3874
- handleError: o
3997
+ handleError: a
3875
3998
  },
3876
3999
  e.name
3877
- ), gr = N.memo(({ groupName: e, isOpen: r, fields: n, valuesMap: o, handleChange: t, handleError: a, toggleGroup: s, t: i }) => {
3878
- const u = N.useCallback(() => s(e), [s, e]), { formStyle: m, fieldStyle: l } = T(), p = N.useMemo(() => ({
4000
+ ), gr = F.memo(({ groupName: e, isOpen: r, fields: n, valuesMap: a, handleChange: t, handleError: o, toggleGroup: s, t: i }) => {
4001
+ const m = F.useCallback(() => s(e), [s, e]), { formStyle: d, fieldStyle: l } = L(), u = F.useMemo(() => ({
3879
4002
  border: "1px solid var(--reactaform-border-color, #bbb)",
3880
4003
  padding: "var(--reactaform-fieldset-padding, 0.5em)",
3881
4004
  borderRadius: "var(--reactaform-border-radius, 4px)",
3882
4005
  marginBottom: "var(--reactaform-space, 8px)",
3883
4006
  // allow per-form overrides if provider exposes them
3884
- ...m?.fieldset || {},
4007
+ ...d?.fieldset || {},
3885
4008
  ...l?.fieldset || {}
3886
- }), [m, l]), c = N.useMemo(() => ({
4009
+ }), [d, l]), c = F.useMemo(() => ({
3887
4010
  fontWeight: "bold",
3888
4011
  cursor: "pointer",
3889
4012
  display: "flex",
@@ -3891,141 +4014,141 @@ const pr = (e, r, n, o) => /* @__PURE__ */ g.jsx(
3891
4014
  alignItems: "center",
3892
4015
  padding: "0 var(--reactaform-space, 8px)",
3893
4016
  color: "var(--reactaform-text-color, inherit)",
3894
- ...m?.legend || {},
4017
+ ...d?.legend || {},
3895
4018
  ...l?.legend || {}
3896
- }), [m, l]);
3897
- return /* @__PURE__ */ g.jsxs("fieldset", { style: p, children: [
3898
- /* @__PURE__ */ g.jsxs("legend", { onClick: u, style: c, children: [
4019
+ }), [d, l]);
4020
+ return /* @__PURE__ */ g.jsxs("fieldset", { style: u, children: [
4021
+ /* @__PURE__ */ g.jsxs("legend", { onClick: m, style: c, children: [
3899
4022
  /* @__PURE__ */ g.jsx("span", { children: i(e) }),
3900
4023
  /* @__PURE__ */ g.jsx("span", { children: r ? "▼" : "▶" })
3901
4024
  ] }),
3902
- r && n.map((d) => /* @__PURE__ */ g.jsx("div", { children: pr(d, o, t, a) }, d.name))
4025
+ r && n.map((p) => /* @__PURE__ */ g.jsx("div", { children: pr(p, a, t, o) }, p.name))
3903
4026
  ] });
3904
4027
  });
3905
4028
  gr.displayName = "FieldGroup";
3906
- const zt = (e, r, n, o, t, a, s, i, u) => {
3907
- const m = r.slice(0, i).filter((d) => s[d.name]), p = $r(m).groups, c = [];
3908
- return p.forEach((d) => {
3909
- if (d.name) {
3910
- const b = e[d.name] ?? !0;
4029
+ const zt = (e, r, n, a, t, o, s, i, m) => {
4030
+ const d = r.slice(0, i).filter((p) => s[p.name]), u = Or(d).groups, c = [];
4031
+ return u.forEach((p) => {
4032
+ if (p.name) {
4033
+ const b = e[p.name] ?? !0;
3911
4034
  c.push(
3912
4035
  /* @__PURE__ */ g.jsx(
3913
4036
  gr,
3914
4037
  {
3915
- groupName: d.name,
4038
+ groupName: p.name,
3916
4039
  isOpen: b,
3917
- fields: d.fields,
4040
+ fields: p.fields,
3918
4041
  valuesMap: n,
3919
4042
  handleChange: t,
3920
- handleError: a,
3921
- toggleGroup: u,
3922
- t: o
4043
+ handleError: o,
4044
+ toggleGroup: m,
4045
+ t: a
3923
4046
  },
3924
- d.name
4047
+ p.name
3925
4048
  )
3926
4049
  );
3927
4050
  } else
3928
- d.fields.forEach((b) => c.push(/* @__PURE__ */ g.jsx("div", { children: pr(b, n, t, a) }, b.name)));
4051
+ p.fields.forEach((b) => c.push(/* @__PURE__ */ g.jsx("div", { children: pr(b, n, t, o) }, b.name)));
3929
4052
  }), c;
3930
4053
  }, Tt = (e) => {
3931
4054
  const r = {};
3932
4055
  return e.forEach((n) => {
3933
4056
  r[n.name] = !1;
3934
4057
  }), r;
3935
- }, Pe = (e, r, n, o) => {
4058
+ }, Pe = (e, r, n, a) => {
3936
4059
  const t = r[e];
3937
4060
  if (!t?.children) return;
3938
- const a = n[e], s = a != null ? String(a) : "";
3939
- (t.children[s] || []).forEach((u) => {
3940
- o[u] = !0, Pe(u, r, n, o);
4061
+ const o = n[e], s = o != null ? String(o) : "";
4062
+ (t.children[s] || []).forEach((m) => {
4063
+ a[m] = !0, Pe(m, r, n, a);
3941
4064
  });
3942
4065
  }, hr = (e, r, n) => {
3943
- const o = r[e];
3944
- o?.children && Object.values(o.children).flat().forEach((t) => {
4066
+ const a = r[e];
4067
+ a?.children && Object.values(a.children).flat().forEach((t) => {
3945
4068
  n[t] = !1, hr(t, r, n);
3946
4069
  });
3947
- }, Lt = (e, r, n, o) => {
4070
+ }, Lt = (e, r, n, a) => {
3948
4071
  const t = { ...n };
3949
- return e.forEach((a) => {
3950
- (!a.parents || Object.keys(a.parents).length === 0) && (t[a.name] = !0, Pe(a.name, o, r, t));
4072
+ return e.forEach((o) => {
4073
+ (!o.parents || Object.keys(o.parents).length === 0) && (t[o.name] = !0, Pe(o.name, a, r, t));
3951
4074
  }), t;
3952
- }, Pt = (e, r, n, o, t) => {
3953
- const a = { ...e };
3954
- if (hr(o, r, a), t != null) {
3955
- const s = r[o];
4075
+ }, Pt = (e, r, n, a, t) => {
4076
+ const o = { ...e };
4077
+ if (hr(a, r, o), t != null) {
4078
+ const s = r[a];
3956
4079
  if (s?.children) {
3957
4080
  const i = String(t);
3958
- (s.children[i] || []).forEach((m) => {
3959
- a[m] = !0, Pe(m, r, n, a);
4081
+ (s.children[i] || []).forEach((d) => {
4082
+ o[d] = !0, Pe(d, r, n, o);
3960
4083
  });
3961
4084
  }
3962
4085
  }
3963
- return a;
4086
+ return o;
3964
4087
  };
3965
- function _t(e, r, n, o, t) {
3966
- const a = Object.values(t).filter(Boolean);
3967
- if (a.length > 0)
4088
+ function _t(e, r, n, a, t) {
4089
+ const o = Object.values(t).filter(Boolean);
4090
+ if (o.length > 0)
3968
4091
  return {
3969
4092
  success: !1,
3970
- message: o("Please fix validation errors before submitting."),
3971
- errors: a
4093
+ message: a("Please fix validation errors before submitting."),
4094
+ errors: o
3972
4095
  };
3973
4096
  const s = { ...n }, i = [];
3974
4097
  if (e && Array.isArray(e.properties))
3975
- for (const m of e.properties) {
3976
- const l = m.name, p = s[l];
3977
- if (p == null) continue;
3978
- const c = m.type;
4098
+ for (const d of e.properties) {
4099
+ const l = d.name, u = s[l];
4100
+ if (u == null) continue;
4101
+ const c = d.type;
3979
4102
  try {
3980
4103
  if (c === "int" || c === "number" || c === "float") {
3981
- const d = Number(String(p).trim());
3982
- isNaN(d) ? i.push(o(`Invalid number format for field ${m.displayName || l}`)) : s[l] = d;
4104
+ const p = Number(String(u).trim());
4105
+ isNaN(p) ? i.push(a(`Invalid number format for field ${d.displayName || l}`)) : s[l] = p;
3983
4106
  } else if (c === "int-array" || c === "float-array") {
3984
- const b = String(p).split(",").map((f) => f.trim()).filter(Boolean).map((f) => {
4107
+ const b = String(u).split(",").map((f) => f.trim()).filter(Boolean).map((f) => {
3985
4108
  const y = Number(f);
3986
- return isNaN(y) ? (i.push(o(`Invalid number "${f}" in array for field ${m.displayName || l}`)), 0) : y;
4109
+ return isNaN(y) ? (i.push(a(`Invalid number "${f}" in array for field ${d.displayName || l}`)), 0) : y;
3987
4110
  });
3988
4111
  i.length === 0 && (s[l] = b);
3989
4112
  }
3990
- } catch (d) {
3991
- i.push(o(`Error processing field ${m.displayName || l}: ${d}`));
4113
+ } catch (p) {
4114
+ i.push(a(`Error processing field ${d.displayName || l}: ${p}`));
3992
4115
  }
3993
4116
  }
3994
4117
  if (i.length > 0)
3995
4118
  return {
3996
4119
  success: !1,
3997
- message: o("Data transformation errors occurred."),
4120
+ message: a("Data transformation errors occurred."),
3998
4121
  errors: i
3999
4122
  };
4000
- const u = Nr(e, s, o);
4001
- if (u && u.length > 0)
4123
+ const m = Nr(e, s, a);
4124
+ if (m && m.length > 0)
4002
4125
  return {
4003
4126
  success: !1,
4004
4127
  message: "Validation Fail",
4005
- errors: u
4128
+ errors: m
4006
4129
  };
4007
4130
  if (e && typeof e.submitHandlerName == "string") {
4008
- const m = Dt(e.submitHandlerName);
4009
- if (m)
4131
+ const d = Vt(e.submitHandlerName);
4132
+ if (d)
4010
4133
  try {
4011
- const l = m(e, r?.name ?? null, s, o);
4134
+ const l = d(e, r?.name ?? null, s, a);
4012
4135
  if (l && l.length > 0)
4013
4136
  return {
4014
4137
  success: !1,
4015
- message: o("Submission failed."),
4138
+ message: a("Submission failed."),
4016
4139
  errors: Array.isArray(l) ? l : [l]
4017
4140
  };
4018
4141
  } catch (l) {
4019
4142
  return {
4020
4143
  success: !1,
4021
- message: o("Submission handler error occurred."),
4144
+ message: a("Submission handler error occurred."),
4022
4145
  errors: [String(l)]
4023
4146
  };
4024
4147
  }
4025
4148
  }
4026
4149
  return {
4027
4150
  success: !0,
4028
- message: o("Form submitted successfully."),
4151
+ message: a("Form submitted successfully."),
4029
4152
  data: s
4030
4153
  };
4031
4154
  }
@@ -4033,122 +4156,122 @@ const qt = ({
4033
4156
  definition: e,
4034
4157
  instance: r,
4035
4158
  chunkSize: n = 50,
4036
- chunkDelay: o = 50
4159
+ chunkDelay: a = 50
4037
4160
  }) => {
4038
- const { properties: t, displayName: a } = e, s = T(), { t: i, formStyle: u, language: m } = s, l = {
4161
+ const { properties: t, displayName: o } = e, s = L(), { t: i, formStyle: m, language: d } = s, l = {
4039
4162
  ...s,
4040
4163
  definitionName: e?.name ?? s.definitionName
4041
- }, [p, c] = D("en"), [d, b] = D([]), [f, y] = D({}), [x, v] = D(
4164
+ }, [u, c] = V("en"), [p, b] = V([]), [f, y] = V({}), [C, x] = V(
4042
4165
  {}
4043
- ), [F, R] = D({}), [w, j] = D({}), [I, S] = D({}), [A, M] = D(null), [z, L] = D(null), [J, ce] = D(0), [re, ue] = D(!1), [Q, oe] = D(!1), [P, O] = D(r.name || ""), h = k(r), E = k(!1);
4044
- C(() => {
4045
- const V = Object.fromEntries(
4046
- t.map((H) => [
4047
- H.name,
4048
- { ...H, children: {} }
4166
+ ), [j, N] = V({}), [v, w] = V({}), [I, A] = V({}), [R, $] = V(null), [O, P] = V(null), [W, ae] = V(0), [re, ue] = V(!1), [Q, oe] = V(!1), [Z, T] = V(r.name || ""), h = E(r), S = E(!1);
4167
+ k(() => {
4168
+ const D = Object.fromEntries(
4169
+ t.map((B) => [
4170
+ B.name,
4171
+ { ...B, children: {} }
4049
4172
  ])
4050
4173
  );
4051
- t.forEach((H) => {
4052
- H.parents && Object.entries(H.parents).forEach(([me, Se]) => {
4053
- const fe = V[me];
4054
- fe && Se.forEach((br) => {
4055
- fe.children || (fe.children = {});
4174
+ t.forEach((B) => {
4175
+ B.parents && Object.entries(B.parents).forEach(([me, Se]) => {
4176
+ const de = D[me];
4177
+ de && Se.forEach((br) => {
4178
+ de.children || (de.children = {});
4056
4179
  const _e = String(br);
4057
- fe.children[_e] = [
4058
- ...fe.children[_e] || [],
4059
- H.name
4180
+ de.children[_e] = [
4181
+ ...de.children[_e] || [],
4182
+ B.name
4060
4183
  ];
4061
4184
  });
4062
4185
  });
4063
- }), Or(t, V);
4064
- const q = Object.values(
4065
- V
4066
- ), X = {};
4067
- q.forEach((H) => {
4068
- if (H.type === "unit") {
4069
- const me = typeof H.defaultValue == "number" ? String(H.defaultValue) : "", Se = typeof H.defaultUnit == "string" ? H.defaultUnit : String(H.defaultUnit ?? "m");
4070
- X[H.name] = [me, Se];
4186
+ }), Mr(t, D);
4187
+ const _ = Object.values(
4188
+ D
4189
+ ), K = {};
4190
+ _.forEach((B) => {
4191
+ if (B.type === "unit") {
4192
+ const me = typeof B.defaultValue == "number" ? String(B.defaultValue) : "", Se = typeof B.defaultUnit == "string" ? B.defaultUnit : String(B.defaultUnit ?? "m");
4193
+ K[B.name] = [me, Se];
4071
4194
  } else
4072
- X[H.name] = H.defaultValue;
4073
- }), h.current = r, Object.keys(r.values).forEach((H) => {
4074
- V[H] !== void 0 && (X[H] = r.values[H]);
4195
+ K[B.name] = B.defaultValue;
4196
+ }), h.current = r, Object.keys(r.values).forEach((B) => {
4197
+ D[B] !== void 0 && (K[B] = r.values[B]);
4075
4198
  });
4076
- const ee = Tt(q), te = {};
4077
- q.forEach((H) => {
4078
- H.group && !(H.group in te) && (te[H.group] = !0);
4199
+ const ee = Tt(_), ne = {};
4200
+ _.forEach((B) => {
4201
+ B.group && !(B.group in ne) && (ne[B.group] = !0);
4079
4202
  });
4080
4203
  const le = requestAnimationFrame(() => {
4081
- b(q), y(V), v(X), R(
4082
- Lt(q, X, ee, V)
4083
- ), j(te), ue(!0), O(r.name);
4204
+ b(_), y(D), x(K), N(
4205
+ Lt(_, K, ee, D)
4206
+ ), w(ne), ue(!0), T(r.name);
4084
4207
  });
4085
4208
  return () => cancelAnimationFrame(le);
4086
- }, [t, r, e]), C(() => {
4087
- if (!re || J >= d.length) return;
4088
- const V = setTimeout(() => {
4089
- ce(
4090
- (q) => Math.min(q + n, d.length)
4209
+ }, [t, r, e]), k(() => {
4210
+ if (!re || W >= p.length) return;
4211
+ const D = setTimeout(() => {
4212
+ ae(
4213
+ (_) => Math.min(_ + n, p.length)
4091
4214
  );
4092
- }, o);
4093
- return () => clearTimeout(V);
4094
- }, [re, J, d.length, n, o]);
4095
- const B = Z(
4096
- (V, q, X) => {
4097
- M(null), L(null), v((ee) => {
4098
- const te = { ...ee, [V]: q }, le = f[V];
4215
+ }, a);
4216
+ return () => clearTimeout(D);
4217
+ }, [re, W, p.length, n, a]);
4218
+ const z = X(
4219
+ (D, _, K) => {
4220
+ $(null), P(null), x((ee) => {
4221
+ const ne = { ...ee, [D]: _ }, le = f[D];
4099
4222
  return le && [
4100
4223
  "checkbox",
4101
4224
  "dropdown",
4102
4225
  "multi-select",
4103
4226
  "radio",
4104
4227
  "switch"
4105
- ].includes(le.type) && R(
4228
+ ].includes(le.type) && N(
4106
4229
  (me) => Pt(
4107
4230
  me,
4108
4231
  f,
4109
- te,
4110
- V,
4111
- String(q)
4232
+ ne,
4233
+ D,
4234
+ String(_)
4112
4235
  )
4113
- ), te;
4114
- }), S((ee) => X ? { ...ee, [V]: X } : Object.fromEntries(Object.entries(ee).filter(([le]) => le !== V)));
4236
+ ), ne;
4237
+ }), A((ee) => K ? { ...ee, [D]: K } : Object.fromEntries(Object.entries(ee).filter(([le]) => le !== D)));
4115
4238
  },
4116
- [f, M, L]
4239
+ [f, $, P]
4117
4240
  );
4118
- C(() => {
4119
- let V = 0;
4120
- return V = requestAnimationFrame(() => {
4121
- m !== p && (c(m || "en"), M(null), L(null));
4122
- }), () => cancelAnimationFrame(V);
4123
- }, [m, p]), C(() => {
4124
- let V = 0;
4125
- return V = requestAnimationFrame(() => {
4126
- if (E.current) {
4127
- E.current = !1, h.current = r, O(r.name || "");
4241
+ k(() => {
4242
+ let D = 0;
4243
+ return D = requestAnimationFrame(() => {
4244
+ d !== u && (c(d || "en"), $(null), P(null));
4245
+ }), () => cancelAnimationFrame(D);
4246
+ }, [d, u]), k(() => {
4247
+ let D = 0;
4248
+ return D = requestAnimationFrame(() => {
4249
+ if (S.current) {
4250
+ S.current = !1, h.current = r, T(r.name || "");
4128
4251
  return;
4129
4252
  }
4130
- h.current = r, M(null), L(null), O(r.name || "");
4131
- }), () => cancelAnimationFrame(V);
4253
+ h.current = r, $(null), P(null), T(r.name || "");
4254
+ }), () => cancelAnimationFrame(D);
4132
4255
  }, [r, r.name]);
4133
- const U = Z((V, q) => {
4134
- S((X) => q ? { ...X, [V]: String(q) } : Object.fromEntries(Object.entries(X).filter(([te]) => te !== V)));
4135
- }, []), ne = () => {
4136
- E.current = !0;
4137
- const V = h.current?.name;
4138
- h.current.name = P;
4139
- const q = _t(e, h.current, x, i, I), X = typeof q.message == "string" ? q.message : String(q.message), ee = Object.values(q.errors ?? {}).join(`
4256
+ const Y = X((D, _) => {
4257
+ A((K) => _ ? { ...K, [D]: String(_) } : Object.fromEntries(Object.entries(K).filter(([ne]) => ne !== D)));
4258
+ }, []), te = () => {
4259
+ S.current = !0;
4260
+ const D = h.current?.name;
4261
+ h.current.name = Z;
4262
+ const _ = _t(e, h.current, C, i, I), K = typeof _.message == "string" ? _.message : String(_.message), ee = Object.values(_.errors ?? {}).join(`
4140
4263
  `);
4141
- M(ee ? X + `
4142
- ` + ee : X), L(q.success), q.success || (h.current.name = V ?? h.current.name, O(V ?? ""));
4143
- }, ae = (V) => {
4144
- j((q) => ({ ...q, [V]: !q[V] }));
4145
- }, _ = G(
4264
+ $(ee ? K + `
4265
+ ` + ee : K), P(_.success), _.success || (h.current.name = D ?? h.current.name, T(D ?? ""));
4266
+ }, se = (D) => {
4267
+ w((_) => ({ ..._, [D]: !_[D] }));
4268
+ }, q = J(
4146
4269
  () => Object.values(I).some(Boolean),
4147
4270
  [I]
4148
4271
  );
4149
- return /* @__PURE__ */ g.jsx(Oe.Provider, { value: l, children: /* @__PURE__ */ g.jsxs("div", { style: u.container, children: [
4150
- a && /* @__PURE__ */ g.jsx("h2", { style: u.titleStyle, children: i(a) }),
4151
- A && /* @__PURE__ */ g.jsxs(
4272
+ return /* @__PURE__ */ g.jsx(Me.Provider, { value: l, children: /* @__PURE__ */ g.jsxs("div", { style: m.container, children: [
4273
+ o && /* @__PURE__ */ g.jsx("h2", { style: m.titleStyle, children: i(o) }),
4274
+ R && /* @__PURE__ */ g.jsxs(
4152
4275
  "div",
4153
4276
  {
4154
4277
  role: "status",
@@ -4156,20 +4279,20 @@ const qt = ({
4156
4279
  marginBottom: 12,
4157
4280
  padding: 12,
4158
4281
  borderRadius: 6,
4159
- backgroundColor: z ? "rgba(76, 175, 80, 0.12)" : "rgba(225, 29, 72, 0.06)",
4160
- border: `1px solid ${z ? "rgba(76,175,80,0.3)" : "rgba(225,29,72,0.12)"}`,
4161
- color: z ? "var(--reactaform-success-color, #4CAF50)" : "var(--reactaform-error-color, #e11d48)",
4282
+ backgroundColor: O ? "rgba(76, 175, 80, 0.12)" : "rgba(225, 29, 72, 0.06)",
4283
+ border: `1px solid ${O ? "rgba(76,175,80,0.3)" : "rgba(225,29,72,0.12)"}`,
4284
+ color: O ? "var(--reactaform-success-color, #4CAF50)" : "var(--reactaform-error-color, #e11d48)",
4162
4285
  display: "flex",
4163
4286
  alignItems: "center",
4164
4287
  justifyContent: "space-between"
4165
4288
  },
4166
4289
  children: [
4167
- /* @__PURE__ */ g.jsx("div", { style: { whiteSpace: "pre-wrap", flex: 1 }, children: A }),
4290
+ /* @__PURE__ */ g.jsx("div", { style: { whiteSpace: "pre-wrap", flex: 1 }, children: R }),
4168
4291
  /* @__PURE__ */ g.jsx(
4169
4292
  "button",
4170
4293
  {
4171
4294
  onClick: () => {
4172
- M(null), L(null);
4295
+ $(null), P(null);
4173
4296
  },
4174
4297
  "aria-label": i("Dismiss"),
4175
4298
  style: {
@@ -4190,25 +4313,25 @@ const qt = ({
4190
4313
  r && /* @__PURE__ */ g.jsx(
4191
4314
  tr,
4192
4315
  {
4193
- name: P,
4194
- onChange: (V) => {
4195
- O(V), M(null), L(null);
4316
+ name: Z,
4317
+ onChange: (D) => {
4318
+ T(D), $(null), P(null);
4196
4319
  }
4197
4320
  }
4198
4321
  ),
4199
4322
  /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
4200
4323
  zt(
4201
- w,
4202
- d,
4203
- x,
4324
+ v,
4325
+ p,
4326
+ C,
4204
4327
  i,
4205
- B,
4206
- U,
4207
- F,
4208
- J,
4209
- ae
4328
+ z,
4329
+ Y,
4330
+ j,
4331
+ W,
4332
+ se
4210
4333
  ),
4211
- J < d.length && /* @__PURE__ */ g.jsx(
4334
+ W < p.length && /* @__PURE__ */ g.jsx(
4212
4335
  "div",
4213
4336
  {
4214
4337
  style: {
@@ -4221,23 +4344,23 @@ const qt = ({
4221
4344
  /* @__PURE__ */ g.jsx(
4222
4345
  "button",
4223
4346
  {
4224
- onClick: ne,
4225
- disabled: _,
4347
+ onClick: te,
4348
+ disabled: q,
4226
4349
  onMouseEnter: () => oe(!0),
4227
4350
  onMouseLeave: () => oe(!1),
4228
4351
  style: {
4229
4352
  padding: "var(--reactaform-button-padding, var(--reactaform-space) 12px)",
4230
- backgroundColor: _ ? "var(--reactaform-button-disabled-bg, #cccccc)" : "var(--reactaform-button-bg, var(--reactaform-success-color))",
4353
+ backgroundColor: q ? "var(--reactaform-button-disabled-bg, #cccccc)" : "var(--reactaform-button-bg, var(--reactaform-success-color))",
4231
4354
  color: "var(--reactaform-button-text, #ffffff)",
4232
4355
  border: "none",
4233
4356
  borderRadius: "4px",
4234
- cursor: _ ? "var(--reactaform-button-disabled-cursor, not-allowed)" : "pointer",
4357
+ cursor: q ? "var(--reactaform-button-disabled-cursor, not-allowed)" : "pointer",
4235
4358
  fontSize: "var(--reactaform-button-font-size, 14px)",
4236
4359
  fontWeight: "var(--reactaform-button-font-weight, 500)",
4237
4360
  boxShadow: "var(--reactaform-button-shadow, none)",
4238
4361
  marginTop: "var(--reactaform-button-margin-top, 0.5em)",
4239
4362
  transition: "opacity 0.2s ease",
4240
- opacity: _ ? "var(--reactaform-button-disabled-opacity, 0.6)" : Q ? "var(--reactaform-button-hover-opacity, 0.9)" : "1"
4363
+ opacity: q ? "var(--reactaform-button-disabled-opacity, 0.6)" : Q ? "var(--reactaform-button-hover-opacity, 0.9)" : "1"
4241
4364
  },
4242
4365
  children: i("Submit")
4243
4366
  }
@@ -4349,57 +4472,57 @@ const Bt = (e, r = !1) => ({
4349
4472
  children: e,
4350
4473
  definitionName: r = "",
4351
4474
  defaultStyle: n,
4352
- defaultLanguage: o = "en",
4475
+ defaultLanguage: a = "en",
4353
4476
  defaultDarkMode: t = !1,
4354
- defaultLocalizeName: a = "",
4477
+ defaultLocalizeName: o = "",
4355
4478
  className: s = "reactaform-container"
4356
4479
  }) => {
4357
- const i = r, u = a, m = t, l = o, p = G(
4480
+ const i = r, m = o, d = t, l = a, u = J(
4358
4481
  () => n ?? {},
4359
4482
  [n]
4360
- ), [c, d] = D({}), [b, f] = D({}), [y, x] = D({}), [v, F] = D({});
4361
- C(() => {
4362
- let S = !0;
4483
+ ), [c, p] = V({}), [b, f] = V({}), [y, C] = V({}), [x, j] = V({});
4484
+ k(() => {
4485
+ let A = !0;
4363
4486
  return (async () => {
4364
4487
  if (l === "en") {
4365
- S && (d({}), f({}));
4488
+ A && (p({}), f({}));
4366
4489
  return;
4367
4490
  }
4368
4491
  try {
4369
- const M = await Dr(l), z = M.success ? M.translations : {};
4370
- S && d(z);
4371
- const L = await zr(l, u), J = L.success ? L.translations : {};
4372
- S && f(J);
4492
+ const $ = await Vr(l), O = $.success ? $.translations : {};
4493
+ A && p(O);
4494
+ const P = await zr(l, m), W = P.success ? P.translations : {};
4495
+ A && f(W);
4373
4496
  } catch {
4374
- S && (d({}), f({}));
4497
+ A && (p({}), f({}));
4375
4498
  }
4376
4499
  })(), () => {
4377
- S = !1;
4500
+ A = !1;
4378
4501
  };
4379
- }, [l, u]), C(() => {
4380
- F(Bt(p, m)), x(Ht(p, m));
4381
- }, [p, m]);
4382
- const R = G(
4502
+ }, [l, m]), k(() => {
4503
+ j(Bt(u, d)), C(Ht(u, d));
4504
+ }, [u, d]);
4505
+ const N = J(
4383
4506
  () => Lr(l, c, b),
4384
4507
  [l, c, b]
4385
- ), w = Z(
4386
- (S, ...A) => R(S, ...A),
4387
- [R]
4388
- ), j = G(
4508
+ ), v = X(
4509
+ (A, ...R) => N(A, ...R),
4510
+ [N]
4511
+ ), w = J(
4389
4512
  () => ({
4390
4513
  definitionName: i,
4391
4514
  language: l,
4392
- darkMode: m,
4393
- formStyle: v,
4515
+ darkMode: d,
4516
+ formStyle: x,
4394
4517
  fieldStyle: y,
4395
- t: w
4518
+ t: v
4396
4519
  }),
4397
- [i, l, m, y, v, w]
4398
- ), I = p?.height ? { height: "100%" } : void 0;
4399
- return /* @__PURE__ */ g.jsx(Oe.Provider, { value: j, children: /* @__PURE__ */ g.jsx(
4520
+ [i, l, d, y, x, v]
4521
+ ), I = u?.height ? { height: "100%" } : void 0;
4522
+ return /* @__PURE__ */ g.jsx(Me.Provider, { value: w, children: /* @__PURE__ */ g.jsx(
4400
4523
  "div",
4401
4524
  {
4402
- "data-reactaform-theme": m ? "dark" : "light",
4525
+ "data-reactaform-theme": d ? "dark" : "light",
4403
4526
  className: s,
4404
4527
  style: I,
4405
4528
  children: e
@@ -4414,10 +4537,10 @@ function Wt(e) {
4414
4537
  if (r.properties !== void 0 && !Array.isArray(r.properties)) return "'properties' must be an array if provided";
4415
4538
  if (Array.isArray(r.properties))
4416
4539
  for (let n = 0; n < r.properties.length; n++) {
4417
- const o = r.properties[n];
4418
- if (!o || typeof o != "object") return `Property at index ${n} must be an object`;
4419
- if (!o.name || typeof o.name != "string") return `Property at index ${n} must have a string 'name'`;
4420
- if (!o.type || typeof o.type != "string") return `Property '${o.name}' must have a string 'type'`;
4540
+ const a = r.properties[n];
4541
+ if (!a || typeof a != "object") return `Property at index ${n} must be an object`;
4542
+ if (!a.name || typeof a.name != "string") return `Property at index ${n} must have a string 'name'`;
4543
+ if (!a.type || typeof a.type != "string") return `Property '${a.name}' must have a string 'type'`;
4421
4544
  }
4422
4545
  return null;
4423
4546
  }
@@ -4426,26 +4549,26 @@ async function sn(e, r = {}) {
4426
4549
  try {
4427
4550
  if (!e || typeof e != "string")
4428
4551
  return { success: !1, error: "jsonData must be a non-empty JSON string" };
4429
- const o = e.trim();
4430
- if (!o)
4552
+ const a = e.trim();
4553
+ if (!a)
4431
4554
  return { success: !1, error: "jsonData is empty" };
4432
4555
  let t;
4433
4556
  try {
4434
- t = JSON.parse(o);
4435
- } catch (a) {
4557
+ t = JSON.parse(a);
4558
+ } catch (o) {
4436
4559
  return {
4437
4560
  success: !1,
4438
- error: `Invalid JSON format: ${a instanceof Error ? a.message : "Unknown parsing error"}`
4561
+ error: `Invalid JSON format: ${o instanceof Error ? o.message : "Unknown parsing error"}`
4439
4562
  };
4440
4563
  }
4441
4564
  if (n) {
4442
- const a = Wt(t);
4443
- if (a)
4444
- return { success: !1, error: `Schema validation failed: ${a}` };
4565
+ const o = Wt(t);
4566
+ if (o)
4567
+ return { success: !1, error: `Schema validation failed: ${o}` };
4445
4568
  }
4446
4569
  return { success: !0, definition: t };
4447
- } catch (o) {
4448
- return { success: !1, error: `Unexpected error loading definition: ${o instanceof Error ? o.message : "Unknown error"}` };
4570
+ } catch (a) {
4571
+ return { success: !1, error: `Unexpected error loading definition: ${a instanceof Error ? a.message : "Unknown error"}` };
4449
4572
  }
4450
4573
  }
4451
4574
  function Yt(e, r) {
@@ -4459,10 +4582,10 @@ function Yt(e, r) {
4459
4582
  definition: e.name ?? "unknown",
4460
4583
  version: e.version ?? "1.0.0",
4461
4584
  values: {}
4462
- }, o = e.properties || [];
4463
- return Array.isArray(o) && o.forEach((t) => {
4464
- const a = t;
4465
- a.defaultValue !== void 0 && (n.values[a.name] = a.defaultValue);
4585
+ }, a = e.properties || [];
4586
+ return Array.isArray(a) && a.forEach((t) => {
4587
+ const o = t;
4588
+ o.defaultValue !== void 0 && (n.values[o.name] = o.defaultValue);
4466
4589
  }), { success: !0, instance: n };
4467
4590
  } catch (n) {
4468
4591
  return {
@@ -4497,17 +4620,17 @@ function cn(e) {
4497
4620
  }
4498
4621
  mr();
4499
4622
  function Jt(e) {
4500
- const [r, n] = D(null);
4501
- return C(() => {
4502
- const o = document.querySelector("[data-reactaform-theme]");
4503
- if (!o) return;
4504
- const t = o.closest("[data-reactaform-theme]");
4623
+ const [r, n] = V(null);
4624
+ return k(() => {
4625
+ const a = document.querySelector("[data-reactaform-theme]");
4626
+ if (!a) return;
4627
+ const t = a.closest("[data-reactaform-theme]");
4505
4628
  if (!t) return;
4506
- const a = () => n(t.getAttribute("data-reactaform-theme"));
4507
- a();
4629
+ const o = () => n(t.getAttribute("data-reactaform-theme"));
4630
+ o();
4508
4631
  const s = new MutationObserver((i) => {
4509
- for (const u of i)
4510
- u.type === "attributes" && u.attributeName === "data-reactaform-theme" && a();
4632
+ for (const m of i)
4633
+ m.type === "attributes" && m.attributeName === "data-reactaform-theme" && o();
4511
4634
  });
4512
4635
  return s.observe(t, { attributes: !0, attributeFilter: ["data-reactaform-theme"] }), () => s.disconnect();
4513
4636
  }, [e]), r;
@@ -4516,28 +4639,28 @@ const ln = ({
4516
4639
  definitionData: e,
4517
4640
  instance: r,
4518
4641
  language: n,
4519
- className: o,
4642
+ className: a,
4520
4643
  darkMode: t,
4521
- style: a
4644
+ style: o
4522
4645
  }) => {
4523
- const s = G(() => {
4646
+ const s = J(() => {
4524
4647
  try {
4525
4648
  return typeof e == "string" ? JSON.parse(e) : e ?? null;
4526
4649
  } catch {
4527
4650
  return null;
4528
4651
  }
4529
- }, [e]), i = { fontSize: "inherit", fontFamily: "inherit", ...a }, u = Jt(), m = t ?? u === "dark", l = n ?? "en";
4530
- if (C(() => {
4652
+ }, [e]), i = { fontSize: "inherit", fontFamily: "inherit", ...o }, m = Jt(), d = t ?? m === "dark", l = n ?? "en";
4653
+ if (k(() => {
4531
4654
  let c = document.getElementById("popup-root");
4532
4655
  c || (c = document.createElement("div"), c.id = "popup-root", document.body.appendChild(c));
4533
4656
  }, []), !s)
4534
4657
  return /* @__PURE__ */ g.jsx("div", { style: { color: "red" }, children: "Error: No form definition provided." });
4535
- let p = r;
4536
- if (!p) {
4658
+ let u = r;
4659
+ if (!u) {
4537
4660
  const c = Yt(s, s.name);
4538
4661
  if (!c.success || !c.instance)
4539
4662
  return /* @__PURE__ */ g.jsx("div", { style: { color: "red" }, children: "Error: Failed to create instance from definition." });
4540
- p = c.instance;
4663
+ u = c.instance;
4541
4664
  }
4542
4665
  return /* @__PURE__ */ g.jsx(
4543
4666
  Ut,
@@ -4545,14 +4668,14 @@ const ln = ({
4545
4668
  definitionName: s.name,
4546
4669
  defaultStyle: i,
4547
4670
  defaultLanguage: l,
4548
- defaultDarkMode: m,
4671
+ defaultDarkMode: d,
4549
4672
  defaultLocalizeName: s.localization || "",
4550
- className: o,
4673
+ className: a,
4551
4674
  children: /* @__PURE__ */ g.jsx(
4552
4675
  qt,
4553
4676
  {
4554
4677
  definition: s,
4555
- instance: p
4678
+ instance: u
4556
4679
  }
4557
4680
  )
4558
4681
  }
@@ -4568,27 +4691,27 @@ function Gt() {
4568
4691
  }
4569
4692
  Gt();
4570
4693
  export {
4571
- $ as CSS_CLASSES,
4694
+ M as CSS_CLASSES,
4572
4695
  ln as ReactaForm,
4573
4696
  Ut as ReactaFormProvider,
4574
4697
  qt as ReactaFormRenderer,
4575
- W as StandardFieldLayout,
4576
- on as Units,
4577
- K as combineClasses,
4698
+ U as StandardFieldLayout,
4699
+ an as Units,
4700
+ G as combineClasses,
4578
4701
  Yt as createInstanceFromDefinition,
4579
4702
  nn as deserializeDefinition,
4580
4703
  rn as deserializeInstance,
4581
- $t as getComponent,
4704
+ Ot as getComponent,
4582
4705
  cn as loadInstance,
4583
4706
  sn as loadJsonDefinition,
4584
- an as registerComponent,
4707
+ on as registerComponent,
4585
4708
  Qt as registerFieldValidationHandler,
4586
4709
  Zt as registerFormValidationHandler,
4587
- Vt as registerSubmissionHandler,
4710
+ Dt as registerSubmissionHandler,
4588
4711
  tn as serializeDefinition,
4589
4712
  en as serializeInstance,
4590
4713
  jr as useDebouncedCallback,
4591
- T as useReactaFormContext,
4592
- Y as validateFieldValue,
4714
+ L as useReactaFormContext,
4715
+ H as validateFieldValue,
4593
4716
  Nr as validateFormValues
4594
4717
  };