@nestledjs/forms-native 0.1.0 → 0.1.2

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.
package/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { z as r, ZodError as ce } from "zod";
2
- import { createContext as Q, useContext as ee, useMemo as W, useState as B, useEffect as E, useRef as Oe } from "react";
3
- import { zodResolver as Ve } from "@hookform/resolvers/zod";
2
+ import { createContext as X, useContext as Q, useMemo as W, useState as I, useEffect as q, useCallback as Oe, useRef as Ve } from "react";
3
+ import { zodResolver as Fe } from "@hookform/resolvers/zod";
4
4
  import ue from "dayjs";
5
- import { jsxs as x, Fragment as F, jsx as n } from "react/jsx-runtime";
6
- import { StyleSheet as w, TextInput as D, Text as u, View as f, Pressable as H, Switch as ie, ActivityIndicator as Fe, Platform as L, ScrollView as Pe } from "react-native";
7
- import { Controller as z, useWatch as pe, useForm as De } from "react-hook-form";
8
- var C = /* @__PURE__ */ ((t) => (t.Text = "Text", t.TextArea = "TextArea", t.Email = "Email", t.Password = "Password", t.Url = "Url", t.Phone = "Phone", t.Number = "Number", t.Currency = "Currency", t.Checkbox = "Checkbox", t.Switch = "Switch", t.Button = "Button", t.DatePicker = "DatePicker", t.DateTimePicker = "DateTimePicker", t.TimePicker = "TimePicker", t.Select = "Select", t.EnumSelect = "EnumSelect", t.MultiSelect = "MultiSelect", t.Radio = "Radio", t.CheckboxGroup = "CheckboxGroup", t.SearchSelect = "SearchSelect", t.SearchSelectApollo = "SearchSelectApollo", t.SearchSelectMulti = "SearchSelectMulti", t.SearchSelectMultiApollo = "SearchSelectMultiApollo", t.Content = "Content", t.Custom = "Custom", t.CustomCheckbox = "CustomCheckbox", t.MarkdownEditor = "MarkdownEditor", t))(C || {});
5
+ import { jsxs as S, Fragment as O, jsx as l } from "react/jsx-runtime";
6
+ import { StyleSheet as w, TextInput as P, Text as u, View as y, Pressable as R, Switch as ie, ActivityIndicator as Pe, Platform as j, ScrollView as De } from "react-native";
7
+ import { Controller as z, useWatch as pe, useForm as ze } from "react-hook-form";
8
+ var x = /* @__PURE__ */ ((t) => (t.Text = "Text", t.TextArea = "TextArea", t.Email = "Email", t.Password = "Password", t.Url = "Url", t.Phone = "Phone", t.Number = "Number", t.Currency = "Currency", t.Checkbox = "Checkbox", t.Switch = "Switch", t.Button = "Button", t.DatePicker = "DatePicker", t.DateTimePicker = "DateTimePicker", t.TimePicker = "TimePicker", t.Select = "Select", t.EnumSelect = "EnumSelect", t.MultiSelect = "MultiSelect", t.Radio = "Radio", t.CheckboxGroup = "CheckboxGroup", t.SearchSelect = "SearchSelect", t.SearchSelectApollo = "SearchSelectApollo", t.SearchSelectMulti = "SearchSelectMulti", t.SearchSelectMultiApollo = "SearchSelectMultiApollo", t.Content = "Content", t.Custom = "Custom", t.CustomCheckbox = "CustomCheckbox", t.MarkdownEditor = "MarkdownEditor", t))(x || {});
9
9
  const he = r.object({
10
10
  global: r.object({
11
11
  input: r.string().default(""),
@@ -351,8 +351,8 @@ const he = r.object({
351
351
  helpText: r.string().default("")
352
352
  }).default({})
353
353
  // Add more fields as needed
354
- }), X = "This field is required";
355
- class It {
354
+ }), J = "This field is required";
355
+ class qt {
356
356
  /**
357
357
  * Creates a generic form field. Usually you'll want to use specific methods like text(), email(), etc.
358
358
  *
@@ -361,8 +361,8 @@ class It {
361
361
  * @param options - Configuration options for the field
362
362
  * @returns A FormField object that can be used with Form component
363
363
  */
364
- static field(e, o, i = {}) {
365
- return { type: e, key: o, options: i };
364
+ static field(e, o, a = {}) {
365
+ return { type: e, key: o, options: a };
366
366
  }
367
367
  /**
368
368
  * Creates a text input field.
@@ -381,7 +381,7 @@ class It {
381
381
  * ```
382
382
  */
383
383
  static text(e, o = {}) {
384
- return this.field(C.Text, e, o);
384
+ return this.field(x.Text, e, o);
385
385
  }
386
386
  /**
387
387
  * Creates a textarea field for multi-line text input.
@@ -400,7 +400,7 @@ class It {
400
400
  * ```
401
401
  */
402
402
  static textArea(e, o = {}) {
403
- return this.field(C.TextArea, e, o);
403
+ return this.field(x.TextArea, e, o);
404
404
  }
405
405
  /**
406
406
  * Creates a markdown editor field with rich text editing capabilities.
@@ -441,7 +441,7 @@ class It {
441
441
  static markdownEditor(e, o = {}) {
442
442
  return {
443
443
  key: e,
444
- type: C.MarkdownEditor,
444
+ type: x.MarkdownEditor,
445
445
  options: {
446
446
  label: e,
447
447
  outputFormat: "markdown",
@@ -453,10 +453,10 @@ class It {
453
453
  /**
454
454
  * Creates a Markdown editor field with image upload support
455
455
  */
456
- static markdownEditorWithImages(e, o, i = {}) {
456
+ static markdownEditorWithImages(e, o, a = {}) {
457
457
  return {
458
458
  key: e,
459
- type: C.MarkdownEditor,
459
+ type: x.MarkdownEditor,
460
460
  options: {
461
461
  label: e,
462
462
  enableImageUpload: !0,
@@ -465,7 +465,7 @@ class It {
465
465
  // 5MB default
466
466
  allowedImageTypes: ["image/png", "image/jpeg", "image/gif", "image/webp"],
467
467
  imageUploadMode: "custom",
468
- ...i
468
+ ...a
469
469
  }
470
470
  };
471
471
  }
@@ -486,7 +486,7 @@ class It {
486
486
  * ```
487
487
  */
488
488
  static email(e, o = {}) {
489
- return this.field(C.Email, e, o);
489
+ return this.field(x.Email, e, o);
490
490
  }
491
491
  /**
492
492
  * Creates a password input field.
@@ -505,22 +505,22 @@ class It {
505
505
  * ```
506
506
  */
507
507
  static password(e, o = {}) {
508
- return this.field(C.Password, e, o);
508
+ return this.field(x.Password, e, o);
509
509
  }
510
510
  static url(e, o = {}) {
511
- return this.field(C.Url, e, o);
511
+ return this.field(x.Url, e, o);
512
512
  }
513
513
  static phone(e, o = {}) {
514
- return this.field(C.Phone, e, o);
514
+ return this.field(x.Phone, e, o);
515
515
  }
516
516
  static number(e, o = {}) {
517
- return this.field(C.Number, e, o);
517
+ return this.field(x.Number, e, o);
518
518
  }
519
519
  static currency(e, o = {}) {
520
- return this.field(C.Currency, e, o);
520
+ return this.field(x.Currency, e, o);
521
521
  }
522
522
  static checkbox(e, o = {}) {
523
- return this.field(C.Checkbox, e, o);
523
+ return this.field(x.Checkbox, e, o);
524
524
  }
525
525
  /**
526
526
  * Creates a checkbox group field with multiple selectable options.
@@ -544,227 +544,232 @@ class It {
544
544
  * ```
545
545
  */
546
546
  static checkboxGroup(e, o) {
547
- return this.field(C.CheckboxGroup, e, o);
547
+ return this.field(x.CheckboxGroup, e, o);
548
548
  }
549
549
  static customCheckbox(e, o = {}) {
550
- return this.field(C.CustomCheckbox, e, o);
550
+ return this.field(x.CustomCheckbox, e, o);
551
551
  }
552
552
  static switch(e, o = {}) {
553
- return this.field(C.Switch, e, o);
553
+ return this.field(x.Switch, e, o);
554
554
  }
555
555
  static button(e, o = {}) {
556
- const { label: i, ...s } = o;
557
- return this.field(C.Button, e, s);
556
+ const { label: a, ...s } = o;
557
+ return this.field(x.Button, e, s);
558
558
  }
559
559
  static datePicker(e, o = {}) {
560
- return this.field(C.DatePicker, e, o);
560
+ return this.field(x.DatePicker, e, o);
561
561
  }
562
562
  static dateTimePicker(e, o = {}) {
563
- return this.field(C.DateTimePicker, e, o);
563
+ return this.field(x.DateTimePicker, e, o);
564
564
  }
565
565
  static select(e, o) {
566
- return this.field(C.Select, e, o);
566
+ return this.field(x.Select, e, o);
567
567
  }
568
568
  static enumSelect(e, o) {
569
- return this.field(C.EnumSelect, e, o);
569
+ return this.field(x.EnumSelect, e, o);
570
570
  }
571
571
  static searchSelect(e, o) {
572
- return this.field(C.SearchSelect, e, o);
572
+ return this.field(x.SearchSelect, e, o);
573
573
  }
574
574
  static searchSelectApollo(e, o) {
575
- return this.field(C.SearchSelectApollo, e, o);
575
+ return this.field(x.SearchSelectApollo, e, o);
576
576
  }
577
577
  static searchSelectMulti(e, o) {
578
- return this.field(C.SearchSelectMulti, e, o);
578
+ return this.field(x.SearchSelectMulti, e, o);
579
579
  }
580
580
  static searchSelectMultiApollo(e, o) {
581
- return this.field(C.SearchSelectMultiApollo, e, o);
581
+ return this.field(x.SearchSelectMultiApollo, e, o);
582
582
  }
583
583
  static content(e, o) {
584
- return this.field(C.Content, e, o);
584
+ return this.field(x.Content, e, o);
585
585
  }
586
586
  static custom(e, o) {
587
- return this.field(C.Custom, e, o);
587
+ return this.field(x.Custom, e, o);
588
588
  }
589
589
  }
590
- const be = Q(null);
591
- function ze() {
592
- const t = ee(be);
590
+ const be = X(null);
591
+ function Ie() {
592
+ const t = Q(be);
593
593
  if (!t)
594
594
  throw new Error("FormField components must be used within a <Form> component.");
595
595
  return t;
596
596
  }
597
- const ye = Q({
597
+ const ye = X({
598
598
  labelDisplay: "default"
599
599
  // 'default' is the sensible default
600
600
  });
601
- function Ie() {
602
- const t = ee(ye);
601
+ function Re() {
602
+ const t = Q(ye);
603
603
  if (!t)
604
604
  throw new Error("useFormConfig must be used within a <Form> component.");
605
605
  return t;
606
606
  }
607
- const Re = he.parse({}), fe = Q(Re);
608
- function Rt() {
609
- return ee(fe);
607
+ const We = he.parse({}), fe = X(We);
608
+ function Lt() {
609
+ return Q(fe);
610
610
  }
611
- function Be(t, e) {
611
+ function Ae(t, e) {
612
612
  return async (o) => {
613
613
  try {
614
614
  return await t.parseAsync(o), !0;
615
- } catch (i) {
616
- if (i instanceof ce) {
617
- const s = i.errors[0], l = s.code;
618
- return e?.[l] ?? s.message;
615
+ } catch (a) {
616
+ if (a instanceof ce) {
617
+ const s = a.errors[0], n = s.code;
618
+ return e?.[n] ?? s.message;
619
619
  }
620
620
  return "Invalid value";
621
621
  }
622
622
  };
623
623
  }
624
- function se(t, e) {
625
- return async (o, i) => {
626
- const s = await t(o, i);
627
- return s !== !0 ? s : e(o, i);
624
+ function He(t, e) {
625
+ return async (o, a) => {
626
+ const s = await t(o, a);
627
+ return s !== !0 ? s : e(o, a);
628
628
  };
629
629
  }
630
- async function He(t, e, o) {
631
- const { options: i } = t;
632
- if (i.validateWhen && !i.validateWhen(o))
630
+ async function Be(t, e, o) {
631
+ try {
632
+ return await t.parseAsync(e), null;
633
+ } catch (a) {
634
+ if (a instanceof ce) {
635
+ const s = a.errors[0];
636
+ return {
637
+ type: s.code,
638
+ message: o?.[s.code] || s.message
639
+ };
640
+ }
633
641
  return null;
634
- if ((i.required || i.requiredWhen?.(o)) && !e)
642
+ }
643
+ }
644
+ async function Me(t, e, o) {
645
+ const { options: a } = t;
646
+ if (a.validateWhen && !a.validateWhen(o))
647
+ return null;
648
+ if ((a.required || a.requiredWhen?.(o)) && !e)
635
649
  return {
636
650
  type: "required",
637
- message: i.errorMessages?.required || "This field is required"
651
+ message: a.errorMessages?.required || "This field is required"
638
652
  };
639
- if (i.schema)
640
- try {
641
- await i.schema.parseAsync(e);
642
- } catch (l) {
643
- if (l instanceof ce) {
644
- const a = l.errors[0];
645
- return {
646
- type: a.code,
647
- message: i.errorMessages?.[a.code] || a.message
648
- };
649
- }
650
- }
651
- if (i.validate) {
652
- const l = await i.validate(e);
653
- if (l !== !0)
653
+ if (a.schema) {
654
+ const n = await Be(a.schema, e, a.errorMessages);
655
+ if (n) return n;
656
+ }
657
+ if (a.validate) {
658
+ const n = await a.validate(e);
659
+ if (n !== !0)
654
660
  return {
655
661
  type: "validate",
656
- message: l
662
+ message: n
657
663
  };
658
664
  }
659
- if (i.validateWithForm) {
660
- const l = await i.validateWithForm(e, o);
661
- if (l !== !0)
665
+ if (a.validateWithForm) {
666
+ const n = await a.validateWithForm(e, o);
667
+ if (n !== !0)
662
668
  return {
663
669
  type: "validateWithForm",
664
- message: l
670
+ message: n
665
671
  };
666
672
  }
667
673
  return null;
668
674
  }
669
- function We(t, e, o) {
670
- const i = {};
671
- if (e && (i.required = t.errorMessages?.required || "This field is required"), t.schema) {
672
- const s = Be(t.schema, t.errorMessages);
673
- i.validate && typeof i.validate == "object" ? i.validate.schema = s : i.validate = s;
675
+ function te(t, e, o) {
676
+ if (!t.validate) {
677
+ t.validate = e;
678
+ return;
674
679
  }
675
- if (t.validate)
676
- if (!i.validate)
677
- i.validate = t.validate;
678
- else if (typeof i.validate == "object")
679
- i.validate.custom = t.validate;
680
- else {
681
- const s = t.validate;
682
- i.validate = se(i.validate, (l) => s(l));
683
- }
684
- if (t.validateWithForm && (i.validate ? typeof i.validate == "object" ? i.validate.crossField = t.validateWithForm : i.validate = se(i.validate, t.validateWithForm) : i.validate = t.validateWithForm), i.validate && (t.validateWhen || t.validationGroup)) {
685
- const s = i.validate;
686
- i.validate = async (l, a) => {
687
- if (t.validateWhen && !t.validateWhen(a) || o && t.validationGroup && t.validationGroup !== o)
688
- return !0;
689
- if (typeof s == "function")
690
- return s(l, a);
691
- if (typeof s == "object") {
692
- for (const [, p] of Object.entries(s))
693
- if (typeof p == "function") {
694
- const h = await p(l, a);
695
- if (h !== !0) return h;
696
- }
697
- return !0;
698
- }
699
- return !0;
700
- };
680
+ if (typeof t.validate == "object") {
681
+ t.validate[o] = e;
682
+ return;
683
+ }
684
+ t.validate = He(t.validate, e);
685
+ }
686
+ async function je(t, e, o) {
687
+ for (const [, a] of Object.entries(t))
688
+ if (typeof a == "function") {
689
+ const s = await a(e, o);
690
+ if (s !== !0) return s;
691
+ }
692
+ return !0;
693
+ }
694
+ function qe(t, e, o) {
695
+ return async (a, s) => e.validateWhen && !e.validateWhen(s) || o && e.validationGroup && e.validationGroup !== o ? !0 : typeof t == "function" ? t(a, s) : typeof t == "object" ? je(t, a, s) : !0;
696
+ }
697
+ function Le(t, e, o) {
698
+ const a = {};
699
+ if (e && (a.required = t.errorMessages?.required || "This field is required"), t.schema) {
700
+ const n = Ae(t.schema, t.errorMessages);
701
+ te(a, n, "schema");
702
+ }
703
+ if (t.validate) {
704
+ const n = t.validate;
705
+ te(a, (i) => n(i), "custom");
701
706
  }
702
- return i;
707
+ return t.validateWithForm && te(a, t.validateWithForm, "crossField"), a.validate && (t.validateWhen || t.validationGroup) && (a.validate = qe(a.validate, t, o)), a;
703
708
  }
704
- function Ae(t, e, o) {
709
+ function Ne(t, e, o) {
705
710
  if (t)
706
- return Ve(t);
707
- const i = e?.filter(
711
+ return Fe(t);
712
+ const a = e?.filter(
708
713
  (s) => s.options.schema || s.options.validateWithForm || s.options.validate
709
714
  );
710
- if (i?.length)
711
- return async (s, l, a) => {
712
- const p = {};
713
- for (const h of i) {
714
- const c = s[h.key], b = await He(h, c, s);
715
- b && (p[h.key] = b);
715
+ if (a?.length)
716
+ return async (s, n, i) => {
717
+ const h = {};
718
+ for (const b of a) {
719
+ const c = s[b.key], p = await Me(b, c, s);
720
+ p && (h[b.key] = p);
716
721
  }
717
722
  return {
718
- values: Object.keys(p).length ? {} : s,
719
- errors: p
723
+ values: Object.keys(h).length ? {} : s,
724
+ errors: h
720
725
  };
721
726
  };
722
727
  }
723
- async function Bt(t, e, o) {
724
- const i = o.filter((s) => s.options.validationGroup === e).map((s) => s.key);
725
- return i.length === 0 ? !0 : await t.trigger(i);
728
+ async function Nt(t, e, o) {
729
+ const a = o.filter((s) => s.options.validationGroup === e).map((s) => s.key);
730
+ return a.length === 0 ? !0 : await t.trigger(a);
726
731
  }
727
- function Ht(t) {
732
+ function Et(t) {
728
733
  const e = /* @__PURE__ */ new Set();
729
734
  return t.forEach((o) => {
730
735
  o.options.validationGroup && e.add(o.options.validationGroup);
731
- }), Array.from(e).sort((o, i) => o.localeCompare(i));
736
+ }), Array.from(e).sort((o, a) => o.localeCompare(a));
732
737
  }
733
- function Wt(t, e) {
738
+ function $t(t, e) {
734
739
  return t.filter((o) => o.options.validationGroup === e);
735
740
  }
736
- function At(t, e, o) {
741
+ function Ut(t, e, o) {
737
742
  return !(t.options.validateWhen && !t.options.validateWhen(e) || o && t.options.validationGroup && t.options.validationGroup !== o);
738
743
  }
739
- function ae(t, e) {
744
+ function Gt(t, e) {
740
745
  return W(() => {
741
- const i = t.options.required || !1;
742
- return We(
746
+ const a = t.options.required || !1;
747
+ return Le(
743
748
  t.options,
744
- i,
749
+ a,
745
750
  void 0
746
751
  );
747
752
  }, [
748
- // Use stable references for the field options
749
753
  t.key,
750
754
  t.options.required,
751
- t.options.schema
752
- // Don't use function references as dependencies - they might change on every render
753
- // The validation functions themselves will be stable inside createFieldValidation
755
+ t.options.schema,
756
+ t.options.validate,
757
+ t.options.validateWithForm,
758
+ t.options.validateWhen
754
759
  ]);
755
760
  }
756
- function jt(t, e = 500) {
757
- const [o, i] = B(t);
758
- return E(() => {
761
+ function Kt(t, e = 500) {
762
+ const [o, a] = I(t);
763
+ return q(() => {
759
764
  const s = setTimeout(() => {
760
- i(t);
765
+ a(t);
761
766
  }, e);
762
767
  return () => {
763
768
  clearTimeout(s);
764
769
  };
765
770
  }, [t, e]), o;
766
771
  }
767
- const A = {
772
+ const H = {
768
773
  USD: {
769
774
  code: "USD",
770
775
  symbol: "$",
@@ -1054,85 +1059,85 @@ const A = {
1054
1059
  decimalSeparator: ","
1055
1060
  }
1056
1061
  };
1057
- function je(t) {
1058
- return A[t];
1062
+ function Ee(t) {
1063
+ return H[t];
1059
1064
  }
1060
- function Mt() {
1061
- return Object.values(A).map((t) => ({
1065
+ function Yt() {
1066
+ return Object.values(H).map((t) => ({
1062
1067
  value: t.code,
1063
1068
  label: `${t.symbol} ${t.code} - ${t.name}`
1064
1069
  }));
1065
1070
  }
1066
- function qt() {
1071
+ function Zt() {
1067
1072
  return ["USD", "EUR", "GBP", "JPY", "CAD", "AUD", "CHF", "CNY"].map((e) => ({
1068
1073
  value: e,
1069
- label: `${A[e].symbol} ${e} - ${A[e].name}`
1074
+ label: `${H[e].symbol} ${e} - ${H[e].name}`
1070
1075
  }));
1071
1076
  }
1072
- function Me(t, e) {
1073
- const o = t.startsWith("-"), i = o ? t.slice(1) : t;
1074
- if (i.length <= 3 || e === "")
1075
- return o ? "-" + i : i;
1077
+ function $e(t, e) {
1078
+ const o = t.startsWith("-"), a = o ? t.slice(1) : t;
1079
+ if (a.length <= 3 || e === "")
1080
+ return o ? "-" + a : a;
1076
1081
  let s = "";
1077
- for (let p = i.length; p > 3; p -= 3)
1078
- s = e + i.slice(p - 3, p) + s;
1079
- const l = i.length % 3 || 3, a = i.slice(0, l) + s;
1080
- return o ? "-" + a : a;
1082
+ for (let h = a.length; h > 3; h -= 3)
1083
+ s = e + a.slice(h - 3, h) + s;
1084
+ const n = a.length % 3 || 3, i = a.slice(0, n) + s;
1085
+ return o ? "-" + i : i;
1081
1086
  }
1082
- function q(t, e, o = {}) {
1083
- const { showSymbol: i = !0, showCode: s = !1, includeDecimals: l = !0 } = o;
1087
+ function M(t, e, o = {}) {
1088
+ const { showSymbol: a = !0, showCode: s = !1, includeDecimals: n = !0 } = o;
1084
1089
  if (t == null || t === "")
1085
1090
  return "";
1086
- const a = typeof t == "string" ? parseFloat(t) : t;
1087
- if (isNaN(a))
1091
+ const i = typeof t == "string" ? Number.parseFloat(t) : t;
1092
+ if (Number.isNaN(i))
1088
1093
  return "";
1089
- const p = l ? e.decimalPlaces : 0, h = a.toFixed(p), [c, b] = h.split("."), d = Me(c, e.thousandsSeparator);
1090
- let S = b ? `${d}${e.decimalSeparator}${b}` : d;
1091
- return i && (e.symbolPosition === "before" ? S = `${e.symbol}${S}` : S = `${S} ${e.symbol}`), s && (S = `${S} ${e.code}`), S;
1094
+ const h = n ? e.decimalPlaces : 0, b = i.toFixed(h), [c, p] = b.split("."), d = $e(c, e.thousandsSeparator);
1095
+ let g = p ? `${d}${e.decimalSeparator}${p}` : d;
1096
+ return a && (e.symbolPosition === "before" ? g = `${e.symbol}${g}` : g = `${g} ${e.symbol}`), s && (g = `${g} ${e.code}`), g;
1092
1097
  }
1093
- function Lt(t, e) {
1098
+ function _t(t, e) {
1094
1099
  if (!t || typeof t != "string")
1095
1100
  return null;
1096
1101
  let o = t.replace(e.symbol, "").replace(e.code, "").trim();
1097
- o = o.replace(new RegExp(`\\${e.thousandsSeparator}`, "g"), ""), e.decimalSeparator !== "." && (o = o.replace(e.decimalSeparator, "."));
1098
- const i = parseFloat(o);
1099
- return isNaN(i) ? null : i;
1102
+ o = o.replaceAll(e.thousandsSeparator, ""), e.decimalSeparator !== "." && (o = o.replace(e.decimalSeparator, "."));
1103
+ const a = Number.parseFloat(o);
1104
+ return Number.isNaN(a) ? null : a;
1100
1105
  }
1101
- function Et(t) {
1106
+ function Jt(t) {
1102
1107
  return t.decimalPlaces === 0 ? "1" : `0.${"0".repeat(t.decimalPlaces - 1)}1`;
1103
1108
  }
1104
- function qe(t = "USD", e) {
1109
+ function Ue(t = "USD", e) {
1105
1110
  return t === "custom" && e ? {
1106
- ...A.USD,
1111
+ ...H.USD,
1107
1112
  ...e,
1108
1113
  code: e.code || "USD"
1109
- } : A[t] || A.USD;
1114
+ } : H[t] || H.USD;
1110
1115
  }
1111
- function Nt(t) {
1112
- return t in A;
1116
+ function Xt(t) {
1117
+ return t in H;
1113
1118
  }
1114
- function $t(t, e, o, i) {
1119
+ function Qt(t, e, o, a) {
1115
1120
  if (e === o)
1116
1121
  return t;
1117
- if (!i)
1122
+ if (!a)
1118
1123
  throw new Error("Exchange rates required for currency conversion");
1119
- const s = i[`${e}_${o}`];
1124
+ const s = a[`${e}_${o}`];
1120
1125
  if (!s)
1121
1126
  throw new Error(`Exchange rate not found for ${e} to ${o}`);
1122
1127
  return t * s;
1123
1128
  }
1124
- function Ut(t, e, o = "display") {
1125
- const i = je(e);
1129
+ function er(t, e, o = "display") {
1130
+ const a = Ee(e);
1126
1131
  switch (o) {
1127
1132
  case "input":
1128
- return q(t, { ...i, thousandsSeparator: "" }, { showSymbol: !1 });
1133
+ return M(t, { ...a, thousandsSeparator: "" }, { showSymbol: !1 });
1129
1134
  case "compact": {
1130
- const s = typeof t == "string" ? parseFloat(t) : t;
1131
- return s && s >= 1e6 ? q(s / 1e6, i, { includeDecimals: !1 }) + "M" : s && s >= 1e3 ? q(s / 1e3, i, { includeDecimals: !1 }) + "K" : q(t, i);
1135
+ const s = typeof t == "string" ? Number.parseFloat(t) : t;
1136
+ return s && s >= 1e6 ? M(s / 1e6, a, { includeDecimals: !1 }) + "M" : s && s >= 1e3 ? M(s / 1e3, a, { includeDecimals: !1 }) + "K" : M(t, a);
1132
1137
  }
1133
1138
  case "display":
1134
1139
  default:
1135
- return q(t, i);
1140
+ return M(t, a);
1136
1141
  }
1137
1142
  }
1138
1143
  function ge(t) {
@@ -1141,13 +1146,13 @@ function ge(t) {
1141
1146
  function re(t, e) {
1142
1147
  return t ? ue(ge(t)).format(e ? "MM/DD/YYYY" : "MMMM DD, YYYY") : null;
1143
1148
  }
1144
- function Le(t) {
1149
+ function Ge(t) {
1145
1150
  return t ? t.slice(0, 16) : null;
1146
1151
  }
1147
- function le(t, e) {
1152
+ function ne(t, e) {
1148
1153
  return t ? ue(t).format(e ? "MM/DD/YYYY h:mm A" : "MMMM DD, YYYY h:mm A") : null;
1149
1154
  }
1150
- const $ = {
1155
+ const E = {
1151
1156
  // ── Global ──
1152
1157
  global: w.create({
1153
1158
  input: {
@@ -2103,108 +2108,109 @@ const $ = {
2103
2108
  flexDirection: "column"
2104
2109
  }
2105
2110
  })
2106
- }, me = Q($);
2107
- function v() {
2108
- return ee(me);
2111
+ }, me = X(E);
2112
+ function T() {
2113
+ return Q(me);
2109
2114
  }
2110
- function Ee(t = {}) {
2115
+ function Ke(t, e) {
2116
+ return e ? { ...t, ...e } : t;
2117
+ }
2118
+ function Ye(t, e) {
2119
+ if (!e)
2120
+ return t;
2121
+ const o = {};
2122
+ for (const a of Object.keys(t)) {
2123
+ const s = t[a], n = e[a];
2124
+ o[a] = Ke(s, n);
2125
+ }
2126
+ for (const a of Object.keys(e))
2127
+ a in o || (o[a] = e[a]);
2128
+ return o;
2129
+ }
2130
+ function Ze(t = {}) {
2111
2131
  if (!t || Object.keys(t).length === 0)
2112
- return $;
2132
+ return E;
2113
2133
  const e = {};
2114
- for (const o of Object.keys($)) {
2115
- const i = $[o], s = t[o];
2116
- if (!s) {
2117
- e[o] = i;
2118
- continue;
2119
- }
2120
- const l = {};
2121
- for (const a of Object.keys(i)) {
2122
- const p = i[a], h = s[a];
2123
- h ? l[a] = { ...p, ...h } : l[a] = p;
2124
- }
2125
- for (const a of Object.keys(s))
2126
- a in l || (l[a] = s[a]);
2127
- e[o] = l;
2134
+ for (const o of Object.keys(E)) {
2135
+ const a = E[o], s = t[o];
2136
+ e[o] = Ye(a, s);
2128
2137
  }
2129
2138
  return e;
2130
2139
  }
2131
- function Ne({
2140
+ function _e({
2132
2141
  form: t,
2133
2142
  field: e,
2134
2143
  hasError: o,
2135
- formReadOnly: i = !1,
2144
+ formReadOnly: a = !1,
2136
2145
  formReadOnlyStyle: s = "value"
2137
2146
  }) {
2138
- const l = v(), a = e.options.readOnly ?? i, p = e.options.readOnlyStyle ?? s, h = t.getValues(e.key) ?? "", c = ae(e);
2139
- if (a)
2140
- return p === "disabled" ? /* @__PURE__ */ x(F, { children: [
2141
- /* @__PURE__ */ n(
2142
- D,
2143
- {
2144
- nativeID: e.key,
2145
- editable: !1,
2146
- value: h,
2147
- style: [l.textField.input, o && l.textField.error, l.textField.disabled],
2148
- accessibilityLabel: e.options.label
2149
- }
2150
- ),
2151
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.textField.helpText, children: e.options.helpText })
2152
- ] }) : /* @__PURE__ */ x(F, { children: [
2153
- /* @__PURE__ */ n(f, { style: l.textField.readOnly, children: /* @__PURE__ */ n(u, { style: l.textField.readOnlyText, children: h || "—" }) }),
2154
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.textField.helpText, children: e.options.helpText })
2155
- ] });
2156
- const { onChange: b, onBlur: d, name: y, ref: S } = t.register(e.key, c);
2157
- return /* @__PURE__ */ x(F, { children: [
2158
- /* @__PURE__ */ n(
2159
- D,
2147
+ const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "";
2148
+ return i ? h === "disabled" ? /* @__PURE__ */ S(O, { children: [
2149
+ /* @__PURE__ */ l(
2150
+ P,
2151
+ {
2152
+ nativeID: e.key,
2153
+ editable: !1,
2154
+ value: b,
2155
+ style: [n.textField.input, o && n.textField.error, n.textField.disabled],
2156
+ accessibilityLabel: e.options.label
2157
+ }
2158
+ ),
2159
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.textField.helpText, children: e.options.helpText })
2160
+ ] }) : /* @__PURE__ */ S(O, { children: [
2161
+ /* @__PURE__ */ l(y, { style: n.textField.readOnly, children: /* @__PURE__ */ l(u, { style: n.textField.readOnlyText, children: b || "—" }) }),
2162
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.textField.helpText, children: e.options.helpText })
2163
+ ] }) : /* @__PURE__ */ S(O, { children: [
2164
+ /* @__PURE__ */ l(
2165
+ P,
2160
2166
  {
2161
2167
  nativeID: e.key,
2162
2168
  editable: !e.options.disabled,
2163
2169
  placeholder: e.options.placeholder,
2164
2170
  placeholderTextColor: "#9ca3af",
2165
2171
  defaultValue: e.options.defaultValue,
2166
- onChangeText: (m) => t.setValue(e.key, m, { shouldValidate: !0 }),
2172
+ onChangeText: (c) => t.setValue(e.key, c, { shouldValidate: !0 }),
2167
2173
  onBlur: () => t.trigger(e.key),
2168
2174
  style: [
2169
- l.textField.input,
2170
- e.options.disabled && l.textField.disabled,
2171
- o && l.textField.error
2175
+ n.textField.input,
2176
+ e.options.disabled && n.textField.disabled,
2177
+ o && n.textField.error
2172
2178
  ],
2173
2179
  accessibilityLabel: e.options.label,
2174
2180
  keyboardType: "default"
2175
2181
  }
2176
2182
  ),
2177
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.textField.helpText, children: e.options.helpText })
2183
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.textField.helpText, children: e.options.helpText })
2178
2184
  ] });
2179
2185
  }
2180
- function $e({
2186
+ function Je({
2181
2187
  form: t,
2182
2188
  field: e,
2183
2189
  hasError: o,
2184
- formReadOnly: i = !1,
2190
+ formReadOnly: a = !1,
2185
2191
  formReadOnlyStyle: s = "value"
2186
2192
  }) {
2187
- const l = v(), a = e.options.readOnly ?? i, p = e.options.readOnlyStyle ?? s, h = t.getValues(e.key) ?? "", c = e.options.rows ?? 4, [b, d] = B(c * 20);
2188
- return a ? p === "disabled" ? /* @__PURE__ */ x(F, { children: [
2189
- /* @__PURE__ */ n(
2190
- D,
2193
+ const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "", c = e.options.rows ?? 4, [p, d] = I(c * 20);
2194
+ return i ? h === "disabled" ? /* @__PURE__ */ S(O, { children: [
2195
+ /* @__PURE__ */ l(
2196
+ P,
2191
2197
  {
2192
2198
  nativeID: e.key,
2193
2199
  multiline: !0,
2194
2200
  numberOfLines: c,
2195
2201
  editable: !1,
2196
- value: h,
2197
- style: [l.textAreaField.textarea, l.textAreaField.disabled, o && l.textAreaField.error, { minHeight: c * 20 }],
2202
+ value: b,
2203
+ style: [n.textAreaField.textarea, n.textAreaField.disabled, o && n.textAreaField.error, { minHeight: c * 20 }],
2198
2204
  accessibilityLabel: e.options.label
2199
2205
  }
2200
2206
  ),
2201
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.textAreaField.helpText, children: e.options.helpText })
2202
- ] }) : /* @__PURE__ */ x(F, { children: [
2203
- /* @__PURE__ */ n(u, { style: l.textAreaField.readOnlyValue, children: h || "—" }),
2204
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.textAreaField.helpText, children: e.options.helpText })
2205
- ] }) : /* @__PURE__ */ x(F, { children: [
2206
- /* @__PURE__ */ n(
2207
- D,
2207
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.textAreaField.helpText, children: e.options.helpText })
2208
+ ] }) : /* @__PURE__ */ S(O, { children: [
2209
+ /* @__PURE__ */ l(u, { style: n.textAreaField.readOnlyValue, children: b || "—" }),
2210
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.textAreaField.helpText, children: e.options.helpText })
2211
+ ] }) : /* @__PURE__ */ S(O, { children: [
2212
+ /* @__PURE__ */ l(
2213
+ P,
2208
2214
  {
2209
2215
  nativeID: e.key,
2210
2216
  multiline: !0,
@@ -2213,42 +2219,42 @@ function $e({
2213
2219
  placeholder: e.options.placeholder,
2214
2220
  placeholderTextColor: "#9ca3af",
2215
2221
  defaultValue: e.options.defaultValue,
2216
- onChangeText: (y) => t.setValue(e.key, y, { shouldValidate: !0 }),
2222
+ onChangeText: (f) => t.setValue(e.key, f, { shouldValidate: !0 }),
2217
2223
  onBlur: () => t.trigger(e.key),
2218
- onContentSizeChange: (y) => {
2219
- d(Math.max(c * 20, y.nativeEvent.contentSize.height));
2224
+ onContentSizeChange: (f) => {
2225
+ d(Math.max(c * 20, f.nativeEvent.contentSize.height));
2220
2226
  },
2221
2227
  style: [
2222
- l.textAreaField.textarea,
2223
- { minHeight: b },
2224
- e.options.disabled && l.textAreaField.disabled,
2225
- o && l.textAreaField.error
2228
+ n.textAreaField.textarea,
2229
+ { minHeight: p },
2230
+ e.options.disabled && n.textAreaField.disabled,
2231
+ o && n.textAreaField.error
2226
2232
  ],
2227
2233
  accessibilityLabel: e.options.label
2228
2234
  }
2229
2235
  ),
2230
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.textAreaField.helpText, children: e.options.helpText })
2236
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.textAreaField.helpText, children: e.options.helpText })
2231
2237
  ] });
2232
2238
  }
2233
- function Ue({
2239
+ function Xe({
2234
2240
  form: t,
2235
2241
  field: e,
2236
2242
  hasError: o,
2237
- formReadOnly: i = !1,
2243
+ formReadOnly: a = !1,
2238
2244
  formReadOnlyStyle: s = "value"
2239
2245
  }) {
2240
- const l = v(), a = e.options.readOnly ?? i, p = e.options.readOnlyStyle ?? s, h = t.getValues(e.key) ?? "";
2241
- return ae(e), a ? p === "disabled" ? /* @__PURE__ */ n(
2242
- D,
2246
+ const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "";
2247
+ return i ? h === "disabled" ? /* @__PURE__ */ l(
2248
+ P,
2243
2249
  {
2244
2250
  nativeID: e.key,
2245
2251
  editable: !1,
2246
- value: h,
2247
- style: [l.emailField.input, l.emailField.disabled, o && l.emailField.error],
2252
+ value: b,
2253
+ style: [n.emailField.input, n.emailField.disabled, o && n.emailField.error],
2248
2254
  accessibilityLabel: e.options.label
2249
2255
  }
2250
- ) : /* @__PURE__ */ n(f, { style: l.emailField.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: h || "—" }) }) : /* @__PURE__ */ n(
2251
- D,
2256
+ ) : /* @__PURE__ */ l(y, { style: n.emailField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: b || "—" }) }) : /* @__PURE__ */ l(
2257
+ P,
2252
2258
  {
2253
2259
  nativeID: e.key,
2254
2260
  editable: !e.options.disabled,
@@ -2261,93 +2267,93 @@ function Ue({
2261
2267
  onChangeText: (c) => t.setValue(e.key, c, { shouldValidate: !0 }),
2262
2268
  onBlur: () => t.trigger(e.key),
2263
2269
  style: [
2264
- l.emailField.input,
2265
- e.options.disabled && l.emailField.disabled,
2266
- o && l.emailField.error
2270
+ n.emailField.input,
2271
+ e.options.disabled && n.emailField.disabled,
2272
+ o && n.emailField.error
2267
2273
  ],
2268
2274
  accessibilityLabel: e.options.label
2269
2275
  }
2270
2276
  );
2271
2277
  }
2272
- function Ke({
2278
+ function Qe({
2273
2279
  form: t,
2274
2280
  field: e,
2275
2281
  hasError: o,
2276
- formReadOnly: i = !1,
2282
+ formReadOnly: a = !1,
2277
2283
  formReadOnlyStyle: s = "value"
2278
2284
  }) {
2279
- const l = v(), [a, p] = B(!1), h = e.options.readOnly ?? i, c = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "";
2280
- return ae(e), h ? c === "disabled" ? /* @__PURE__ */ n(
2281
- D,
2285
+ const n = T(), [i, h] = I(!1), b = e.options.readOnly ?? a, c = e.options.readOnlyStyle ?? s, p = t.getValues(e.key) ?? "";
2286
+ return b ? c === "disabled" ? /* @__PURE__ */ l(
2287
+ P,
2282
2288
  {
2283
2289
  nativeID: e.key,
2284
2290
  editable: !1,
2285
2291
  secureTextEntry: !0,
2286
- value: b,
2287
- style: [l.passwordField.input, l.passwordField.disabled, o && l.passwordField.error],
2292
+ value: p,
2293
+ style: [n.passwordField.input, n.passwordField.disabled, o && n.passwordField.error],
2288
2294
  accessibilityLabel: e.options.label
2289
2295
  }
2290
- ) : /* @__PURE__ */ n(f, { style: l.passwordField.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: "*".repeat(b.length) || "—" }) }) : /* @__PURE__ */ x(f, { style: l.passwordField.container, children: [
2291
- /* @__PURE__ */ n(
2292
- D,
2296
+ ) : /* @__PURE__ */ l(y, { style: n.passwordField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: "*".repeat(p.length) || "—" }) }) : /* @__PURE__ */ S(y, { style: n.passwordField.container, children: [
2297
+ /* @__PURE__ */ l(
2298
+ P,
2293
2299
  {
2294
2300
  nativeID: e.key,
2295
2301
  editable: !e.options.disabled,
2296
2302
  placeholder: e.options.placeholder,
2297
2303
  placeholderTextColor: "#9ca3af",
2298
2304
  defaultValue: e.options.defaultValue,
2299
- secureTextEntry: !a,
2305
+ secureTextEntry: !i,
2300
2306
  autoCapitalize: "none",
2301
2307
  autoComplete: "password",
2302
2308
  onChangeText: (d) => t.setValue(e.key, d, { shouldValidate: !0 }),
2303
2309
  onBlur: () => t.trigger(e.key),
2304
2310
  style: [
2305
- l.passwordField.input,
2306
- e.options.disabled && l.passwordField.disabled,
2307
- o && l.passwordField.error
2311
+ n.passwordField.input,
2312
+ e.options.disabled && n.passwordField.disabled,
2313
+ o && n.passwordField.error
2308
2314
  ],
2309
2315
  accessibilityLabel: e.options.label
2310
2316
  }
2311
2317
  ),
2312
- /* @__PURE__ */ n(
2313
- H,
2318
+ /* @__PURE__ */ l(
2319
+ R,
2314
2320
  {
2315
- onPress: () => p(!a),
2316
- style: l.passwordField.toggleButton,
2317
- accessibilityLabel: a ? "Hide password" : "Show password",
2321
+ onPress: () => h(!i),
2322
+ style: n.passwordField.toggleButton,
2323
+ accessibilityLabel: i ? "Hide password" : "Show password",
2318
2324
  accessibilityRole: "button",
2319
- children: /* @__PURE__ */ n(u, { style: l.passwordField.toggleText, children: a ? "Hide" : "Show" })
2325
+ children: /* @__PURE__ */ l(u, { style: n.passwordField.toggleText, children: i ? "Hide" : "Show" })
2320
2326
  }
2321
2327
  ),
2322
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.passwordField.helpText, children: e.options.helpText })
2328
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.passwordField.helpText, children: e.options.helpText })
2323
2329
  ] });
2324
2330
  }
2325
- function Ge({
2331
+ function et({
2326
2332
  form: t,
2327
2333
  field: e,
2328
2334
  hasError: o,
2329
- formReadOnly: i = !1,
2335
+ formReadOnly: a = !1,
2330
2336
  formReadOnlyStyle: s = "value"
2331
2337
  }) {
2332
- const l = v(), a = e.options.readOnly ?? i, p = e.options.readOnlyStyle ?? s, h = t.getValues(e.key) ?? "";
2333
- return a ? p === "disabled" ? /* @__PURE__ */ x(F, { children: [
2334
- /* @__PURE__ */ n(
2335
- D,
2338
+ const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "";
2339
+ return i ? h === "disabled" ? /* @__PURE__ */ S(O, { children: [
2340
+ /* @__PURE__ */ l(
2341
+ P,
2336
2342
  {
2337
2343
  nativeID: e.key,
2338
2344
  editable: !1,
2339
- value: h,
2340
- style: [l.urlField.input, l.urlField.disabled, o && l.urlField.error],
2345
+ value: b,
2346
+ style: [n.urlField.input, n.urlField.disabled, o && n.urlField.error],
2341
2347
  accessibilityLabel: e.options.label
2342
2348
  }
2343
2349
  ),
2344
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.urlField.helpText, children: e.options.helpText })
2345
- ] }) : /* @__PURE__ */ x(F, { children: [
2346
- /* @__PURE__ */ n(f, { style: l.urlField.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: h || "—" }) }),
2347
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.urlField.helpText, children: e.options.helpText })
2348
- ] }) : /* @__PURE__ */ x(F, { children: [
2349
- /* @__PURE__ */ n(
2350
- D,
2350
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.urlField.helpText, children: e.options.helpText })
2351
+ ] }) : /* @__PURE__ */ S(O, { children: [
2352
+ /* @__PURE__ */ l(y, { style: n.urlField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: b || "—" }) }),
2353
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.urlField.helpText, children: e.options.helpText })
2354
+ ] }) : /* @__PURE__ */ S(O, { children: [
2355
+ /* @__PURE__ */ l(
2356
+ P,
2351
2357
  {
2352
2358
  nativeID: e.key,
2353
2359
  editable: !e.options.disabled,
@@ -2359,36 +2365,36 @@ function Ge({
2359
2365
  onChangeText: (c) => t.setValue(e.key, c, { shouldValidate: !0 }),
2360
2366
  onBlur: () => t.trigger(e.key),
2361
2367
  style: [
2362
- l.urlField.input,
2363
- e.options.disabled && l.urlField.disabled,
2364
- o && l.urlField.error
2368
+ n.urlField.input,
2369
+ e.options.disabled && n.urlField.disabled,
2370
+ o && n.urlField.error
2365
2371
  ],
2366
2372
  accessibilityLabel: e.options.label
2367
2373
  }
2368
2374
  ),
2369
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.urlField.helpText, children: e.options.helpText })
2375
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.urlField.helpText, children: e.options.helpText })
2370
2376
  ] });
2371
2377
  }
2372
- function Ye({
2378
+ function tt({
2373
2379
  form: t,
2374
2380
  field: e,
2375
2381
  hasError: o,
2376
- formReadOnly: i = !1,
2382
+ formReadOnly: a = !1,
2377
2383
  formReadOnlyStyle: s = "value"
2378
2384
  }) {
2379
- const l = v(), a = e.options.readOnly ?? i, p = e.options.readOnlyStyle ?? s, h = t.getValues(e.key) ?? "";
2380
- return a ? p === "disabled" ? /* @__PURE__ */ n(
2381
- D,
2385
+ const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "";
2386
+ return i ? h === "disabled" ? /* @__PURE__ */ l(
2387
+ P,
2382
2388
  {
2383
2389
  nativeID: e.key,
2384
2390
  editable: !1,
2385
- value: h,
2386
- style: [l.phoneField.input, l.phoneField.disabled, o && l.phoneField.error],
2391
+ value: b,
2392
+ style: [n.phoneField.input, n.phoneField.disabled, o && n.phoneField.error],
2387
2393
  accessibilityLabel: e.options.label
2388
2394
  }
2389
- ) : /* @__PURE__ */ n(f, { style: l.phoneField.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: h == null || h === "" ? "—" : h }) }) : /* @__PURE__ */ x(F, { children: [
2390
- /* @__PURE__ */ n(
2391
- D,
2395
+ ) : /* @__PURE__ */ l(y, { style: n.phoneField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: b == null || b === "" ? "—" : b }) }) : /* @__PURE__ */ S(O, { children: [
2396
+ /* @__PURE__ */ l(
2397
+ P,
2392
2398
  {
2393
2399
  nativeID: e.key,
2394
2400
  editable: !e.options.disabled,
@@ -2400,137 +2406,137 @@ function Ye({
2400
2406
  onChangeText: (c) => t.setValue(e.key, c, { shouldValidate: !0 }),
2401
2407
  onBlur: () => t.trigger(e.key),
2402
2408
  style: [
2403
- l.phoneField.input,
2404
- e.options.disabled && l.phoneField.disabled,
2405
- o && l.phoneField.error
2409
+ n.phoneField.input,
2410
+ e.options.disabled && n.phoneField.disabled,
2411
+ o && n.phoneField.error
2406
2412
  ],
2407
2413
  accessibilityLabel: e.options.label
2408
2414
  }
2409
2415
  ),
2410
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.phoneField.helpText, children: e.options.helpText })
2416
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.phoneField.helpText, children: e.options.helpText })
2411
2417
  ] });
2412
2418
  }
2413
- function Ze({
2419
+ function rt({
2414
2420
  form: t,
2415
2421
  field: e,
2416
2422
  hasError: o,
2417
- formReadOnly: i = !1,
2423
+ formReadOnly: a = !1,
2418
2424
  formReadOnlyStyle: s = "value"
2419
2425
  }) {
2420
- const l = v(), a = e.options.readOnly ?? i, p = e.options.readOnlyStyle ?? s, h = t.getValues(e.key) ?? "";
2421
- if (a)
2422
- return p === "disabled" ? /* @__PURE__ */ n(
2423
- D,
2426
+ const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "";
2427
+ if (i)
2428
+ return h === "disabled" ? /* @__PURE__ */ l(
2429
+ P,
2424
2430
  {
2425
2431
  nativeID: e.key,
2426
2432
  editable: !1,
2427
- value: String(h),
2433
+ value: String(b),
2428
2434
  keyboardType: "decimal-pad",
2429
- style: [l.numberField.input, l.numberField.disabled, o && l.numberField.error],
2435
+ style: [n.numberField.input, n.numberField.disabled, o && n.numberField.error],
2430
2436
  accessibilityLabel: e.options.label
2431
2437
  }
2432
- ) : /* @__PURE__ */ n(f, { style: l.numberField.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: h == null || h === "" ? "—" : String(h) }) });
2438
+ ) : /* @__PURE__ */ l(y, { style: n.numberField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: b == null || b === "" ? "—" : String(b) }) });
2433
2439
  const c = (d) => {
2434
- const y = d.replace(/[^0-9.-]/g, ""), S = y === "" || y === "-" ? y : parseFloat(y);
2435
- t.setValue(e.key, S === "" || isNaN(S) ? "" : S, { shouldValidate: !0 });
2436
- }, b = () => {
2440
+ const f = d.replaceAll(/[^0-9.-]/g, ""), g = f === "" || f === "-" ? f : Number.parseFloat(f);
2441
+ t.setValue(e.key, g === "" || Number.isNaN(g) ? "" : g, { shouldValidate: !0 });
2442
+ }, p = () => {
2437
2443
  const d = t.getValues(e.key);
2438
2444
  if (d !== "" && d !== void 0) {
2439
- let y = typeof d == "string" ? parseFloat(d) : d;
2440
- isNaN(y) || (e.options.min !== void 0 && y < e.options.min && (y = e.options.min), e.options.max !== void 0 && y > e.options.max && (y = e.options.max), t.setValue(e.key, y));
2445
+ let f = typeof d == "string" ? Number.parseFloat(d) : d;
2446
+ Number.isNaN(f) || (e.options.min !== void 0 && f < e.options.min && (f = e.options.min), e.options.max !== void 0 && f > e.options.max && (f = e.options.max), t.setValue(e.key, f));
2441
2447
  }
2442
2448
  t.trigger(e.key);
2443
2449
  };
2444
- return /* @__PURE__ */ x(F, { children: [
2445
- /* @__PURE__ */ n(
2446
- D,
2450
+ return /* @__PURE__ */ S(O, { children: [
2451
+ /* @__PURE__ */ l(
2452
+ P,
2447
2453
  {
2448
2454
  nativeID: e.key,
2449
2455
  editable: !e.options.disabled,
2450
2456
  placeholder: e.options.placeholder,
2451
2457
  placeholderTextColor: "#9ca3af",
2452
- defaultValue: e.options.defaultValue !== void 0 ? String(e.options.defaultValue) : void 0,
2458
+ defaultValue: e.options.defaultValue === void 0 ? void 0 : String(e.options.defaultValue),
2453
2459
  keyboardType: "decimal-pad",
2454
2460
  onChangeText: c,
2455
- onBlur: b,
2461
+ onBlur: p,
2456
2462
  style: [
2457
- l.numberField.input,
2458
- e.options.disabled && l.numberField.disabled,
2459
- o && l.numberField.error
2463
+ n.numberField.input,
2464
+ e.options.disabled && n.numberField.disabled,
2465
+ o && n.numberField.error
2460
2466
  ],
2461
2467
  accessibilityLabel: e.options.label
2462
2468
  }
2463
2469
  ),
2464
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.numberField.helpText, children: e.options.helpText })
2470
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.numberField.helpText, children: e.options.helpText })
2465
2471
  ] });
2466
2472
  }
2467
- function _e({
2473
+ function nt({
2468
2474
  form: t,
2469
2475
  field: e,
2470
2476
  hasError: o,
2471
- formReadOnly: i = !1,
2477
+ formReadOnly: a = !1,
2472
2478
  formReadOnlyStyle: s = "value"
2473
2479
  }) {
2474
- const l = v(), a = qe(e.options.currency, e.options.customCurrency), p = e.options.readOnly ?? i, h = e.options.readOnlyStyle ?? s, c = t.getValues(e.key) ?? "", b = e.options.hideSymbolWhenEmpty ?? !0, [d, y] = B(!!c);
2475
- E(() => {
2476
- const g = t.getValues(e.key);
2477
- y(!!g);
2480
+ const n = T(), i = Ue(e.options.currency, e.options.customCurrency), h = e.options.readOnly ?? a, b = e.options.readOnlyStyle ?? s, c = t.getValues(e.key) ?? "", p = e.options.hideSymbolWhenEmpty ?? !0, [d, f] = I(!!c);
2481
+ q(() => {
2482
+ const m = t.getValues(e.key);
2483
+ f(!!m);
2478
2484
  }, [t, e.key]);
2479
- const m = !b || d ? /* @__PURE__ */ x(u, { style: l.moneyField.currencySymbol, children: [
2480
- a.symbol,
2481
- e.options.showCurrencyCode && /* @__PURE__ */ x(u, { style: { fontSize: 12, opacity: 0.75 }, children: [
2485
+ const k = !p || d ? /* @__PURE__ */ S(u, { style: n.moneyField.currencySymbol, children: [
2486
+ i.symbol,
2487
+ e.options.showCurrencyCode && /* @__PURE__ */ S(u, { style: { fontSize: 12, opacity: 0.75 }, children: [
2482
2488
  " ",
2483
- a.code
2489
+ i.code
2484
2490
  ] })
2485
2491
  ] }) : null;
2486
- if (p) {
2487
- if (h === "disabled")
2488
- return /* @__PURE__ */ x(f, { style: l.moneyField.container, children: [
2489
- a.symbolPosition === "before" && m,
2490
- /* @__PURE__ */ n(
2491
- D,
2492
+ if (h) {
2493
+ if (b === "disabled")
2494
+ return /* @__PURE__ */ S(y, { style: n.moneyField.container, children: [
2495
+ i.symbolPosition === "before" && k,
2496
+ /* @__PURE__ */ l(
2497
+ P,
2492
2498
  {
2493
2499
  nativeID: e.key,
2494
2500
  editable: !1,
2495
2501
  value: String(c),
2496
2502
  keyboardType: "decimal-pad",
2497
- style: [l.moneyField.input, l.moneyField.disabled, o && l.moneyField.error],
2503
+ style: [n.moneyField.input, n.moneyField.disabled, o && n.moneyField.error],
2498
2504
  accessibilityLabel: e.options.label
2499
2505
  }
2500
2506
  ),
2501
- a.symbolPosition === "after" && m
2507
+ i.symbolPosition === "after" && k
2502
2508
  ] });
2503
- const g = q(c, a, {
2509
+ const m = M(c, i, {
2504
2510
  showSymbol: !0,
2505
2511
  showCode: e.options.showCurrencyCode
2506
2512
  });
2507
- return /* @__PURE__ */ n(f, { style: l.moneyField.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: g || "—" }) });
2513
+ return /* @__PURE__ */ l(y, { style: n.moneyField.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: m || "—" }) });
2508
2514
  }
2509
- return /* @__PURE__ */ x(f, { style: l.moneyField.container, children: [
2510
- a.symbolPosition === "before" && m,
2511
- /* @__PURE__ */ n(
2512
- D,
2515
+ return /* @__PURE__ */ S(y, { style: n.moneyField.container, children: [
2516
+ i.symbolPosition === "before" && k,
2517
+ /* @__PURE__ */ l(
2518
+ P,
2513
2519
  {
2514
2520
  nativeID: e.key,
2515
2521
  editable: !e.options.disabled,
2516
2522
  placeholder: e.options.placeholder,
2517
2523
  placeholderTextColor: "#9ca3af",
2518
- defaultValue: e.options.defaultValue !== void 0 ? String(e.options.defaultValue) : void 0,
2524
+ defaultValue: e.options.defaultValue === void 0 ? void 0 : String(e.options.defaultValue),
2519
2525
  keyboardType: "decimal-pad",
2520
- onChangeText: (g) => {
2521
- const k = g.replace(/[^0-9.-]/g, ""), T = k === "" ? "" : parseFloat(k);
2522
- y(!!k), t.setValue(e.key, T === "" || isNaN(T) ? "" : T, { shouldValidate: !0 });
2526
+ onChangeText: (m) => {
2527
+ const C = m.replaceAll(/[^0-9.-]/g, ""), v = C === "" ? "" : Number.parseFloat(C);
2528
+ f(!!C), t.setValue(e.key, v === "" || Number.isNaN(v) ? "" : v, { shouldValidate: !0 });
2523
2529
  },
2524
2530
  onBlur: () => t.trigger(e.key),
2525
2531
  style: [
2526
- l.moneyField.input,
2527
- e.options.disabled && l.moneyField.disabled,
2528
- o && l.moneyField.error
2532
+ n.moneyField.input,
2533
+ e.options.disabled && n.moneyField.disabled,
2534
+ o && n.moneyField.error
2529
2535
  ],
2530
2536
  accessibilityLabel: e.options.label
2531
2537
  }
2532
2538
  ),
2533
- a.symbolPosition === "after" && m
2539
+ i.symbolPosition === "after" && k
2534
2540
  ] });
2535
2541
  }
2536
2542
  let Se = null;
@@ -2538,140 +2544,140 @@ try {
2538
2544
  Se = require("expo-checkbox").default;
2539
2545
  } catch {
2540
2546
  }
2541
- function Je({ value: t, onValueChange: e, disabled: o, color: i }) {
2542
- return /* @__PURE__ */ n(
2543
- H,
2547
+ function lt({ value: t, onValueChange: e, disabled: o, color: a }) {
2548
+ return /* @__PURE__ */ l(
2549
+ R,
2544
2550
  {
2545
2551
  onPress: () => !o && e(!t),
2546
2552
  style: {
2547
2553
  width: 22,
2548
2554
  height: 22,
2549
2555
  borderWidth: 2,
2550
- borderColor: t ? i || "#0284c7" : "#d1d5db",
2556
+ borderColor: t ? a || "#0284c7" : "#d1d5db",
2551
2557
  borderRadius: 4,
2552
- backgroundColor: t ? i || "#0284c7" : "transparent",
2558
+ backgroundColor: t ? a || "#0284c7" : "transparent",
2553
2559
  justifyContent: "center",
2554
2560
  alignItems: "center",
2555
2561
  opacity: o ? 0.5 : 1
2556
2562
  },
2557
2563
  accessibilityRole: "checkbox",
2558
2564
  accessibilityState: { checked: t, disabled: o },
2559
- children: t && /* @__PURE__ */ n(u, { style: { color: "#ffffff", fontSize: 14, fontWeight: "700" }, children: "✓" })
2565
+ children: t && /* @__PURE__ */ l(u, { style: { color: "#ffffff", fontSize: 14, fontWeight: "700" }, children: "✓" })
2560
2566
  }
2561
2567
  );
2562
2568
  }
2563
- function Xe(t) {
2564
- const { field: e, form: o, hasError: i, errorMessage: s, formReadOnly: l = !1, formReadOnlyStyle: a = "value" } = t, p = e.options, c = v().checkbox, b = p.readOnly ?? l, d = p.readOnlyStyle ?? a, y = o.getValues(e.key), S = Se || Je;
2565
- return b ? d === "disabled" ? /* @__PURE__ */ x(f, { style: c.wrapper, children: [
2566
- /* @__PURE__ */ x(f, { style: c.row, children: [
2567
- /* @__PURE__ */ n(
2568
- S,
2569
+ function ot(t) {
2570
+ const { field: e, form: o, hasError: a, errorMessage: s, formReadOnly: n = !1, formReadOnlyStyle: i = "value" } = t, h = e.options, c = T().checkbox, p = h.readOnly ?? n, d = h.readOnlyStyle ?? i, f = o.getValues(e.key), g = Se || lt;
2571
+ return p ? d === "disabled" ? /* @__PURE__ */ S(y, { style: c.wrapper, children: [
2572
+ /* @__PURE__ */ S(y, { style: c.row, children: [
2573
+ /* @__PURE__ */ l(
2574
+ g,
2569
2575
  {
2570
- value: !!y,
2576
+ value: !!f,
2571
2577
  onValueChange: () => {
2572
2578
  },
2573
2579
  disabled: !0
2574
2580
  }
2575
2581
  ),
2576
- p.label && /* @__PURE__ */ n(u, { style: [c.label, c.disabled], children: p.label })
2582
+ h.label && /* @__PURE__ */ l(u, { style: [c.label, c.disabled], children: h.label })
2577
2583
  ] }),
2578
- p.helpText && /* @__PURE__ */ n(u, { style: c.helpText, children: p.helpText })
2579
- ] }) : /* @__PURE__ */ n(f, { style: c.wrapper, children: /* @__PURE__ */ n(u, { style: c.readOnly, children: y ? "Yes" : "No" }) }) : /* @__PURE__ */ n(
2584
+ h.helpText && /* @__PURE__ */ l(u, { style: c.helpText, children: h.helpText })
2585
+ ] }) : /* @__PURE__ */ l(y, { style: c.wrapper, children: /* @__PURE__ */ l(u, { style: c.readOnly, children: f ? "Yes" : "No" }) }) : /* @__PURE__ */ l(
2580
2586
  z,
2581
2587
  {
2582
2588
  name: e.key,
2583
2589
  control: o.control,
2584
- defaultValue: p.defaultValue,
2585
- rules: { required: p.required ? X : !1 },
2586
- render: ({ field: m }) => /* @__PURE__ */ x(f, { style: c.wrapper, children: [
2587
- /* @__PURE__ */ x(f, { style: c.row, children: [
2588
- /* @__PURE__ */ n(
2589
- S,
2590
+ defaultValue: h.defaultValue,
2591
+ rules: { required: h.required ? J : !1 },
2592
+ render: ({ field: k }) => /* @__PURE__ */ S(y, { style: c.wrapper, children: [
2593
+ /* @__PURE__ */ S(y, { style: c.row, children: [
2594
+ /* @__PURE__ */ l(
2595
+ g,
2590
2596
  {
2591
- value: !!m.value,
2592
- onValueChange: (g) => m.onChange(g),
2593
- disabled: p.disabled,
2594
- color: m.value ? "#0284c7" : void 0
2597
+ value: !!k.value,
2598
+ onValueChange: (m) => k.onChange(m),
2599
+ disabled: h.disabled,
2600
+ color: k.value ? "#0284c7" : void 0
2595
2601
  }
2596
2602
  ),
2597
- p.label && /* @__PURE__ */ x(u, { style: [c.label, p.disabled && c.disabled], children: [
2598
- p.label,
2599
- p.required && /* @__PURE__ */ n(u, { style: { color: "#dc2626" }, children: " *" })
2603
+ h.label && /* @__PURE__ */ S(u, { style: [c.label, h.disabled && c.disabled], children: [
2604
+ h.label,
2605
+ h.required && /* @__PURE__ */ l(u, { style: { color: "#dc2626" }, children: " *" })
2600
2606
  ] })
2601
2607
  ] }),
2602
- p.helpText && /* @__PURE__ */ n(u, { style: c.helpText, children: p.helpText }),
2603
- i && s && /* @__PURE__ */ n(u, { style: c.errorMessage, children: s })
2608
+ h.helpText && /* @__PURE__ */ l(u, { style: c.helpText, children: h.helpText }),
2609
+ a && s && /* @__PURE__ */ l(u, { style: c.errorMessage, children: s })
2604
2610
  ] })
2605
2611
  }
2606
2612
  );
2607
2613
  }
2608
- function Qe({
2614
+ function at({
2609
2615
  form: t,
2610
2616
  field: e,
2611
2617
  hasError: o,
2612
- formReadOnly: i = !1,
2618
+ formReadOnly: a = !1,
2613
2619
  formReadOnlyStyle: s = "value"
2614
2620
  }) {
2615
- const l = v(), a = e.options.readOnly ?? i, p = e.options.readOnlyStyle ?? s, h = t.getValues(e.key);
2616
- return a ? p === "disabled" ? /* @__PURE__ */ x(f, { style: l.switchField.container, children: [
2617
- /* @__PURE__ */ x(u, { style: l.switchField.label, children: [
2621
+ const n = T(), i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key);
2622
+ return i ? h === "disabled" ? /* @__PURE__ */ S(y, { style: n.switchField.container, children: [
2623
+ /* @__PURE__ */ S(u, { style: n.switchField.label, children: [
2618
2624
  e.options.label,
2619
- e.options.required && /* @__PURE__ */ n(u, { style: { color: "#dc2626" }, children: " *" })
2625
+ e.options.required && /* @__PURE__ */ l(u, { style: { color: "#dc2626" }, children: " *" })
2620
2626
  ] }),
2621
- /* @__PURE__ */ n(
2627
+ /* @__PURE__ */ l(
2622
2628
  ie,
2623
2629
  {
2624
- value: !!h,
2630
+ value: !!b,
2625
2631
  disabled: !0,
2626
2632
  trackColor: { false: "#d1d5db", true: "#7dd3fc" },
2627
- thumbColor: h ? "#0284c7" : "#f3f4f6"
2633
+ thumbColor: b ? "#0284c7" : "#f3f4f6"
2628
2634
  }
2629
2635
  )
2630
- ] }) : /* @__PURE__ */ n(u, { style: l.switchField.readOnlyValue, children: h ? "On" : "Off" }) : /* @__PURE__ */ n(
2636
+ ] }) : /* @__PURE__ */ l(u, { style: n.switchField.readOnlyValue, children: b ? "On" : "Off" }) : /* @__PURE__ */ l(
2631
2637
  z,
2632
2638
  {
2633
2639
  name: e.key,
2634
2640
  control: t.control,
2635
2641
  defaultValue: e.options.defaultValue,
2636
- render: ({ field: { onChange: c, value: b } }) => /* @__PURE__ */ x(f, { children: [
2637
- /* @__PURE__ */ x(f, { style: l.switchField.container, children: [
2638
- /* @__PURE__ */ x(u, { style: [l.switchField.label, e.options.disabled && l.switchField.disabled], children: [
2642
+ render: ({ field: { onChange: c, value: p } }) => /* @__PURE__ */ S(y, { children: [
2643
+ /* @__PURE__ */ S(y, { style: n.switchField.container, children: [
2644
+ /* @__PURE__ */ S(u, { style: [n.switchField.label, e.options.disabled && n.switchField.disabled], children: [
2639
2645
  e.options.label,
2640
- e.options.required && /* @__PURE__ */ n(u, { style: { color: "#dc2626" }, children: " *" })
2646
+ e.options.required && /* @__PURE__ */ l(u, { style: { color: "#dc2626" }, children: " *" })
2641
2647
  ] }),
2642
- /* @__PURE__ */ n(
2648
+ /* @__PURE__ */ l(
2643
2649
  ie,
2644
2650
  {
2645
- value: !!b,
2651
+ value: !!p,
2646
2652
  onValueChange: (d) => {
2647
2653
  e.options.disabled || c(d);
2648
2654
  },
2649
2655
  disabled: e.options.disabled,
2650
2656
  trackColor: { false: "#d1d5db", true: "#7dd3fc" },
2651
- thumbColor: b ? "#0284c7" : "#f3f4f6",
2657
+ thumbColor: p ? "#0284c7" : "#f3f4f6",
2652
2658
  accessibilityLabel: e.options.label,
2653
2659
  accessibilityRole: "switch"
2654
2660
  }
2655
2661
  )
2656
2662
  ] }),
2657
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.switchField.helpText, children: e.options.helpText })
2663
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.switchField.helpText, children: e.options.helpText })
2658
2664
  ] })
2659
2665
  }
2660
2666
  );
2661
2667
  }
2662
- function et({
2668
+ function it({
2663
2669
  children: t,
2664
2670
  variant: e = "primary",
2665
2671
  disabled: o,
2666
- loading: i = !1,
2672
+ loading: a = !1,
2667
2673
  fullWidth: s = !1,
2668
- onPress: l,
2669
- style: a,
2670
- textStyle: p,
2671
- className: h,
2674
+ onPress: n,
2675
+ style: i,
2676
+ textStyle: h,
2677
+ className: b,
2672
2678
  accessibilityLabel: c
2673
2679
  }) {
2674
- const d = v().button, y = o || i, S = () => {
2680
+ const d = T().button, f = o || a, g = () => {
2675
2681
  switch (e) {
2676
2682
  case "danger":
2677
2683
  return d.dangerText;
@@ -2680,359 +2686,359 @@ function et({
2680
2686
  default:
2681
2687
  return d.primaryText;
2682
2688
  }
2683
- };
2684
- return /* @__PURE__ */ n(
2685
- H,
2689
+ }, k = () => a ? /* @__PURE__ */ l(Pe, { size: "small", color: e === "secondary" ? "#374151" : "#ffffff" }) : typeof t == "string" ? /* @__PURE__ */ l(u, { style: [d.text, g(), f && d.disabledText, h], children: t }) : t;
2690
+ return /* @__PURE__ */ l(
2691
+ R,
2686
2692
  {
2687
- onPress: y ? void 0 : l,
2688
- disabled: y,
2693
+ onPress: f ? void 0 : n,
2694
+ disabled: f,
2689
2695
  style: [
2690
2696
  d.base,
2691
2697
  d[e],
2692
- y && d.disabled,
2693
- i && d.loading,
2698
+ f && d.disabled,
2699
+ a && d.loading,
2694
2700
  s && d.fullWidth,
2695
- a
2701
+ i
2696
2702
  ],
2697
2703
  accessibilityRole: "button",
2698
- accessibilityState: { disabled: y },
2704
+ accessibilityState: { disabled: f },
2699
2705
  accessibilityLabel: c,
2700
- ...h ? { className: h } : {},
2701
- children: i ? /* @__PURE__ */ n(Fe, { size: "small", color: e === "secondary" ? "#374151" : "#ffffff" }) : typeof t == "string" ? /* @__PURE__ */ n(u, { style: [d.text, S(), y && d.disabledText, p], children: t }) : t
2706
+ ...b ? { className: b } : {},
2707
+ children: k()
2702
2708
  }
2703
2709
  );
2704
2710
  }
2705
- function tt({
2711
+ function st({
2706
2712
  field: t,
2707
2713
  form: e,
2708
2714
  hasError: o
2709
2715
  }) {
2710
- const i = async () => {
2716
+ const a = async () => {
2711
2717
  t.options.disabled || (t.options.type === "submit" && e.handleSubmit((s) => {
2712
2718
  })(), t.options.onClick && await t.options.onClick());
2713
2719
  };
2714
- return /* @__PURE__ */ n(
2715
- et,
2720
+ return /* @__PURE__ */ l(
2721
+ it,
2716
2722
  {
2717
2723
  variant: t.options.variant,
2718
2724
  loading: t.options.loading,
2719
2725
  disabled: t.options.disabled,
2720
2726
  fullWidth: t.options.fullWidth,
2721
- onPress: i,
2727
+ onPress: a,
2722
2728
  accessibilityLabel: t.options.text ?? t.options.label ?? "Button",
2723
2729
  children: t.options.text ?? t.options.label ?? "Button"
2724
2730
  }
2725
2731
  );
2726
2732
  }
2727
- let ne = null;
2733
+ let le = null;
2728
2734
  try {
2729
- ne = require("@react-native-community/datetimepicker").default;
2735
+ le = require("@react-native-community/datetimepicker").default;
2730
2736
  } catch {
2731
2737
  }
2732
- function rt({
2738
+ function dt({
2733
2739
  form: t,
2734
2740
  field: e,
2735
2741
  hasError: o,
2736
- formReadOnly: i = !1,
2742
+ formReadOnly: a = !1,
2737
2743
  formReadOnlyStyle: s = "value"
2738
2744
  }) {
2739
- const l = v().datePicker, a = e.options, p = a.readOnly ?? i, h = a.readOnlyStyle ?? s, c = t.getValues(e.key) ?? "", [b, d] = B(!1);
2740
- return ne ? p ? h === "disabled" ? /* @__PURE__ */ x(F, { children: [
2741
- /* @__PURE__ */ n(f, { style: [l.trigger, l.disabled], children: /* @__PURE__ */ n(u, { style: l.triggerText, children: c ? re(c) ?? c : "—" }) }),
2742
- a.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: a.helpText })
2743
- ] }) : /* @__PURE__ */ x(F, { children: [
2744
- /* @__PURE__ */ n(f, { style: l.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: re(c) || "—" }) }),
2745
- a.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: a.helpText })
2746
- ] }) : /* @__PURE__ */ n(
2745
+ const n = T().datePicker, i = e.options, h = i.readOnly ?? a, b = i.readOnlyStyle ?? s, c = t.getValues(e.key) ?? "", [p, d] = I(!1);
2746
+ return le ? h ? b === "disabled" ? /* @__PURE__ */ S(O, { children: [
2747
+ /* @__PURE__ */ l(y, { style: [n.trigger, n.disabled], children: /* @__PURE__ */ l(u, { style: n.triggerText, children: c ? re(c) ?? c : "—" }) }),
2748
+ i.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: i.helpText })
2749
+ ] }) : /* @__PURE__ */ S(O, { children: [
2750
+ /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: re(c) || "—" }) }),
2751
+ i.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: i.helpText })
2752
+ ] }) : /* @__PURE__ */ l(
2747
2753
  z,
2748
2754
  {
2749
2755
  name: e.key,
2750
2756
  control: t.control,
2751
- defaultValue: ge(a.defaultValue ?? ""),
2752
- rules: { required: a.required },
2753
- render: ({ field: y }) => {
2754
- const S = y.value ? new Date(y.value) : /* @__PURE__ */ new Date();
2755
- return /* @__PURE__ */ x(f, { children: [
2756
- /* @__PURE__ */ n(
2757
- H,
2757
+ defaultValue: ge(i.defaultValue ?? ""),
2758
+ rules: { required: i.required },
2759
+ render: ({ field: f }) => {
2760
+ const g = f.value ? new Date(f.value) : /* @__PURE__ */ new Date();
2761
+ return /* @__PURE__ */ S(y, { children: [
2762
+ /* @__PURE__ */ l(
2763
+ R,
2758
2764
  {
2759
- onPress: () => !a.disabled && d(!0),
2765
+ onPress: () => !i.disabled && d(!0),
2760
2766
  style: [
2761
- l.trigger,
2762
- a.disabled && l.disabled,
2763
- o && l.error
2767
+ n.trigger,
2768
+ i.disabled && n.disabled,
2769
+ o && n.error
2764
2770
  ],
2765
- accessibilityLabel: a.label ?? "Select date",
2771
+ accessibilityLabel: i.label ?? "Select date",
2766
2772
  accessibilityRole: "button",
2767
- children: /* @__PURE__ */ n(u, { style: y.value ? l.triggerText : l.placeholderText, children: y.value ? re(y.value) ?? y.value : a.placeholder || "Select date..." })
2773
+ children: /* @__PURE__ */ l(u, { style: f.value ? n.triggerText : n.placeholderText, children: f.value ? re(f.value) ?? f.value : i.placeholder || "Select date..." })
2768
2774
  }
2769
2775
  ),
2770
- b && /* @__PURE__ */ n(
2771
- ne,
2776
+ p && /* @__PURE__ */ l(
2777
+ le,
2772
2778
  {
2773
- value: S,
2779
+ value: g,
2774
2780
  mode: "date",
2775
- display: L.OS === "ios" ? "spinner" : "default",
2776
- minimumDate: a.min ? new Date(a.min) : void 0,
2777
- maximumDate: a.max ? new Date(a.max) : void 0,
2778
- onChange: (m, g) => {
2779
- if (d(L.OS === "ios"), g) {
2780
- const k = g.toISOString().split("T")[0];
2781
- y.onChange(k);
2781
+ display: j.OS === "ios" ? "spinner" : "default",
2782
+ minimumDate: i.min ? new Date(i.min) : void 0,
2783
+ maximumDate: i.max ? new Date(i.max) : void 0,
2784
+ onChange: (k, m) => {
2785
+ if (d(j.OS === "ios"), m) {
2786
+ const C = m.toISOString().split("T")[0];
2787
+ f.onChange(C);
2782
2788
  }
2783
2789
  }
2784
2790
  }
2785
2791
  ),
2786
- a.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: a.helpText })
2792
+ i.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: i.helpText })
2787
2793
  ] });
2788
2794
  }
2789
2795
  }
2790
- ) : /* @__PURE__ */ n(f, { style: l.trigger, children: /* @__PURE__ */ n(u, { style: l.placeholderText, children: "Install @react-native-community/datetimepicker to use DatePickerField" }) });
2796
+ ) : /* @__PURE__ */ l(y, { style: n.trigger, children: /* @__PURE__ */ l(u, { style: n.placeholderText, children: "Install @react-native-community/datetimepicker to use DatePickerField" }) });
2791
2797
  }
2792
- let U = null;
2798
+ let $ = null;
2793
2799
  try {
2794
- U = require("@react-native-community/datetimepicker").default;
2800
+ $ = require("@react-native-community/datetimepicker").default;
2795
2801
  } catch {
2796
2802
  }
2797
- function lt({
2803
+ function ct({
2798
2804
  form: t,
2799
2805
  field: e,
2800
2806
  hasError: o,
2801
- formReadOnly: i = !1,
2807
+ formReadOnly: a = !1,
2802
2808
  formReadOnlyStyle: s = "value"
2803
2809
  }) {
2804
- const l = v().dateTimePicker, a = e.options, p = a.readOnly ?? i, h = a.readOnlyStyle ?? s, c = t.getValues(e.key) ?? "", [b, d] = B(!1), [y, S] = B(!1), [m, g] = B(null);
2805
- return U ? p ? h === "disabled" ? /* @__PURE__ */ n(f, { style: [l.trigger, l.disabled], children: /* @__PURE__ */ n(u, { style: l.triggerText, children: c ? le(c) ?? c : "—" }) }) : /* @__PURE__ */ n(f, { style: l.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: le(c) ?? "—" }) }) : /* @__PURE__ */ n(
2810
+ const n = T().dateTimePicker, i = e.options, h = i.readOnly ?? a, b = i.readOnlyStyle ?? s, c = t.getValues(e.key) ?? "", [p, d] = I(!1), [f, g] = I(!1), [k, m] = I(null);
2811
+ return $ ? h ? b === "disabled" ? /* @__PURE__ */ l(y, { style: [n.trigger, n.disabled], children: /* @__PURE__ */ l(u, { style: n.triggerText, children: c ? ne(c) ?? c : "—" }) }) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: ne(c) ?? "—" }) }) : /* @__PURE__ */ l(
2806
2812
  z,
2807
2813
  {
2808
2814
  name: e.key,
2809
2815
  control: t.control,
2810
- defaultValue: Le(a.defaultValue ?? ""),
2811
- rules: { required: a.required },
2812
- render: ({ field: k }) => {
2813
- const T = k.value ? new Date(k.value) : /* @__PURE__ */ new Date();
2814
- return /* @__PURE__ */ x(f, { children: [
2815
- /* @__PURE__ */ n(
2816
- H,
2816
+ defaultValue: Ge(i.defaultValue ?? ""),
2817
+ rules: { required: i.required },
2818
+ render: ({ field: C }) => {
2819
+ const v = C.value ? new Date(C.value) : /* @__PURE__ */ new Date();
2820
+ return /* @__PURE__ */ S(y, { children: [
2821
+ /* @__PURE__ */ l(
2822
+ R,
2817
2823
  {
2818
- onPress: () => !a.disabled && d(!0),
2824
+ onPress: () => !i.disabled && d(!0),
2819
2825
  style: [
2820
- l.trigger,
2821
- a.disabled && l.disabled,
2822
- o && l.error
2826
+ n.trigger,
2827
+ i.disabled && n.disabled,
2828
+ o && n.error
2823
2829
  ],
2824
- accessibilityLabel: a.label ?? "Select date and time",
2830
+ accessibilityLabel: i.label ?? "Select date and time",
2825
2831
  accessibilityRole: "button",
2826
- children: /* @__PURE__ */ n(u, { style: k.value ? l.triggerText : l.placeholderText, children: k.value ? le(k.value) ?? k.value : a.placeholder || "Select date and time..." })
2832
+ children: /* @__PURE__ */ l(u, { style: C.value ? n.triggerText : n.placeholderText, children: C.value ? ne(C.value) ?? C.value : i.placeholder || "Select date and time..." })
2827
2833
  }
2828
2834
  ),
2829
- b && /* @__PURE__ */ n(
2830
- U,
2835
+ p && /* @__PURE__ */ l(
2836
+ $,
2831
2837
  {
2832
- value: T,
2838
+ value: v,
2833
2839
  mode: "date",
2834
- display: L.OS === "ios" ? "spinner" : "default",
2835
- minimumDate: a.min ? new Date(a.min) : void 0,
2836
- maximumDate: a.max ? new Date(a.max) : void 0,
2837
- onChange: (I, O) => {
2838
- d(!1), O && (g(O), S(!0));
2840
+ display: j.OS === "ios" ? "spinner" : "default",
2841
+ minimumDate: i.min ? new Date(i.min) : void 0,
2842
+ maximumDate: i.max ? new Date(i.max) : void 0,
2843
+ onChange: (V, F) => {
2844
+ d(!1), F && (m(F), g(!0));
2839
2845
  }
2840
2846
  }
2841
2847
  ),
2842
- y && /* @__PURE__ */ n(
2843
- U,
2848
+ f && /* @__PURE__ */ l(
2849
+ $,
2844
2850
  {
2845
- value: m || T,
2851
+ value: k || v,
2846
2852
  mode: "time",
2847
- display: L.OS === "ios" ? "spinner" : "default",
2848
- onChange: (I, O) => {
2849
- if (S(!1), O && m) {
2850
- const V = new Date(m);
2851
- V.setHours(O.getHours()), V.setMinutes(O.getMinutes());
2852
- const R = V.toISOString().slice(0, 16);
2853
- k.onChange(R);
2853
+ display: j.OS === "ios" ? "spinner" : "default",
2854
+ onChange: (V, F) => {
2855
+ if (g(!1), F && k) {
2856
+ const D = new Date(k);
2857
+ D.setHours(F.getHours()), D.setMinutes(F.getMinutes());
2858
+ const A = D.toISOString().slice(0, 16);
2859
+ C.onChange(A);
2854
2860
  }
2855
- g(null);
2861
+ m(null);
2856
2862
  }
2857
2863
  }
2858
2864
  ),
2859
- a.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: a.helpText })
2865
+ i.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: i.helpText })
2860
2866
  ] });
2861
2867
  }
2862
2868
  }
2863
- ) : /* @__PURE__ */ n(f, { style: l.trigger, children: /* @__PURE__ */ n(u, { style: l.placeholderText, children: "Install @react-native-community/datetimepicker to use DateTimePickerField" }) });
2869
+ ) : /* @__PURE__ */ l(y, { style: n.trigger, children: /* @__PURE__ */ l(u, { style: n.placeholderText, children: "Install @react-native-community/datetimepicker to use DateTimePickerField" }) });
2864
2870
  }
2865
2871
  let oe = null;
2866
2872
  try {
2867
2873
  oe = require("@react-native-community/datetimepicker").default;
2868
2874
  } catch {
2869
2875
  }
2870
- function nt({
2876
+ function ut({
2871
2877
  form: t,
2872
2878
  field: e,
2873
2879
  hasError: o,
2874
- formReadOnly: i = !1,
2880
+ formReadOnly: a = !1,
2875
2881
  formReadOnlyStyle: s = "value"
2876
2882
  }) {
2877
- const l = v().timePicker, a = e.options.readOnly ?? i, p = e.options.readOnlyStyle ?? s, h = t.getValues(e.key) ?? "", [c, b] = B(!1);
2883
+ const n = T().timePicker, i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s, b = t.getValues(e.key) ?? "", [c, p] = I(!1);
2878
2884
  if (!oe)
2879
- return /* @__PURE__ */ n(f, { style: l.trigger, children: /* @__PURE__ */ n(u, { style: l.placeholderText, children: "Install @react-native-community/datetimepicker to use TimePickerField" }) });
2880
- if (a)
2881
- return p === "disabled" ? /* @__PURE__ */ x(F, { children: [
2882
- /* @__PURE__ */ n(f, { style: [l.trigger, l.disabled], children: /* @__PURE__ */ n(u, { style: l.triggerText, children: h || "—" }) }),
2883
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
2884
- ] }) : /* @__PURE__ */ x(F, { children: [
2885
- /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: h || "—" }),
2886
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
2885
+ return /* @__PURE__ */ l(y, { style: n.trigger, children: /* @__PURE__ */ l(u, { style: n.placeholderText, children: "Install @react-native-community/datetimepicker to use TimePickerField" }) });
2886
+ if (i)
2887
+ return h === "disabled" ? /* @__PURE__ */ S(O, { children: [
2888
+ /* @__PURE__ */ l(y, { style: [n.trigger, n.disabled], children: /* @__PURE__ */ l(u, { style: n.triggerText, children: b || "—" }) }),
2889
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
2890
+ ] }) : /* @__PURE__ */ S(O, { children: [
2891
+ /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: b || "—" }),
2892
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
2887
2893
  ] });
2888
- const d = (y) => {
2889
- const S = /* @__PURE__ */ new Date();
2890
- if (y) {
2891
- const [m, g] = y.split(":").map(Number);
2892
- S.setHours(m || 0), S.setMinutes(g || 0);
2894
+ const d = (f) => {
2895
+ const g = /* @__PURE__ */ new Date();
2896
+ if (f) {
2897
+ const [k, m] = f.split(":").map(Number);
2898
+ g.setHours(k || 0), g.setMinutes(m || 0);
2893
2899
  }
2894
- return S;
2900
+ return g;
2895
2901
  };
2896
- return /* @__PURE__ */ n(
2902
+ return /* @__PURE__ */ l(
2897
2903
  z,
2898
2904
  {
2899
2905
  name: e.key,
2900
2906
  control: t.control,
2901
2907
  defaultValue: e.options.defaultValue,
2902
2908
  rules: { required: e.options.required },
2903
- render: ({ field: y }) => /* @__PURE__ */ x(f, { children: [
2904
- /* @__PURE__ */ n(
2905
- H,
2909
+ render: ({ field: f }) => /* @__PURE__ */ S(y, { children: [
2910
+ /* @__PURE__ */ l(
2911
+ R,
2906
2912
  {
2907
- onPress: () => !e.options.disabled && b(!0),
2913
+ onPress: () => !e.options.disabled && p(!0),
2908
2914
  style: [
2909
- l.trigger,
2910
- e.options.disabled && l.disabled,
2911
- o && l.error
2915
+ n.trigger,
2916
+ e.options.disabled && n.disabled,
2917
+ o && n.error
2912
2918
  ],
2913
2919
  accessibilityLabel: e.options.label ?? "Select time",
2914
2920
  accessibilityRole: "button",
2915
- children: /* @__PURE__ */ n(u, { style: y.value ? l.triggerText : l.placeholderText, children: y.value || "Select time..." })
2921
+ children: /* @__PURE__ */ l(u, { style: f.value ? n.triggerText : n.placeholderText, children: f.value || "Select time..." })
2916
2922
  }
2917
2923
  ),
2918
- c && /* @__PURE__ */ n(
2924
+ c && /* @__PURE__ */ l(
2919
2925
  oe,
2920
2926
  {
2921
- value: d(y.value || ""),
2927
+ value: d(f.value || ""),
2922
2928
  mode: "time",
2923
- display: L.OS === "ios" ? "spinner" : "default",
2924
- onChange: (S, m) => {
2925
- if (b(L.OS === "ios"), m) {
2926
- const g = m.getHours().toString().padStart(2, "0"), k = m.getMinutes().toString().padStart(2, "0");
2927
- y.onChange(`${g}:${k}`);
2929
+ display: j.OS === "ios" ? "spinner" : "default",
2930
+ onChange: (g, k) => {
2931
+ if (p(j.OS === "ios"), k) {
2932
+ const m = k.getHours().toString().padStart(2, "0"), C = k.getMinutes().toString().padStart(2, "0");
2933
+ f.onChange(`${m}:${C}`);
2928
2934
  }
2929
2935
  }
2930
2936
  }
2931
2937
  ),
2932
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
2938
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
2933
2939
  ] })
2934
2940
  }
2935
2941
  );
2936
2942
  }
2937
- let K = null;
2943
+ let U = null;
2938
2944
  try {
2939
- K = require("react-native-element-dropdown").Dropdown;
2945
+ U = require("react-native-element-dropdown").Dropdown;
2940
2946
  } catch {
2941
2947
  }
2942
2948
  function xe({
2943
2949
  form: t,
2944
2950
  field: e,
2945
2951
  hasError: o,
2946
- formReadOnly: i = !1,
2952
+ formReadOnly: a = !1,
2947
2953
  formReadOnlyStyle: s = "value"
2948
2954
  }) {
2949
- const l = v().selectField, a = e.options.options || [], p = e.options.readOnly ?? i, h = e.options.readOnlyStyle ?? s, c = t.getValues(e.key);
2950
- if (!K)
2951
- return /* @__PURE__ */ n(f, { style: l.container, children: /* @__PURE__ */ n(u, { style: l.placeholder, children: "Install react-native-element-dropdown to use SelectField" }) });
2952
- if (p) {
2953
- const b = a.find((d) => d.value === c);
2954
- return h === "disabled" ? /* @__PURE__ */ x(F, { children: [
2955
- /* @__PURE__ */ n(
2956
- K,
2955
+ const n = T().selectField, i = e.options.options || [], h = e.options.readOnly ?? a, b = e.options.readOnlyStyle ?? s, c = t.getValues(e.key);
2956
+ if (!U)
2957
+ return /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectField" }) });
2958
+ if (h) {
2959
+ const p = i.find((d) => d.value === c);
2960
+ return b === "disabled" ? /* @__PURE__ */ S(O, { children: [
2961
+ /* @__PURE__ */ l(
2962
+ U,
2957
2963
  {
2958
- data: a.map((d) => ({ label: d.label, value: String(d.value) })),
2964
+ data: i.map((d) => ({ label: d.label, value: String(d.value) })),
2959
2965
  labelField: "label",
2960
2966
  valueField: "value",
2961
2967
  value: c ? String(c) : null,
2962
2968
  disable: !0,
2963
2969
  placeholder: e.options.placeholder || "Select...",
2964
- style: [l.container, l.disabled, o && l.error],
2965
- placeholderStyle: l.placeholder,
2966
- selectedTextStyle: l.selectedText,
2970
+ style: [n.container, n.disabled, o && n.error],
2971
+ placeholderStyle: n.placeholder,
2972
+ selectedTextStyle: n.selectedText,
2967
2973
  onChange: () => {
2968
2974
  }
2969
2975
  }
2970
2976
  ),
2971
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
2972
- ] }) : /* @__PURE__ */ x(F, { children: [
2973
- /* @__PURE__ */ n(f, { style: l.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: b?.label || "—" }) }),
2974
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
2977
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
2978
+ ] }) : /* @__PURE__ */ S(O, { children: [
2979
+ /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: p?.label || "—" }) }),
2980
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
2975
2981
  ] });
2976
2982
  }
2977
- return /* @__PURE__ */ n(
2983
+ return /* @__PURE__ */ l(
2978
2984
  z,
2979
2985
  {
2980
2986
  name: e.key,
2981
2987
  control: t.control,
2982
2988
  defaultValue: e.options.defaultValue,
2983
2989
  rules: { required: e.options.required },
2984
- render: ({ field: b }) => /* @__PURE__ */ x(f, { style: l.wrapper, children: [
2985
- /* @__PURE__ */ n(
2986
- K,
2990
+ render: ({ field: p }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
2991
+ /* @__PURE__ */ l(
2992
+ U,
2987
2993
  {
2988
- data: a.map((d) => ({ label: d.label, value: String(d.value) })),
2994
+ data: i.map((d) => ({ label: d.label, value: String(d.value) })),
2989
2995
  labelField: "label",
2990
2996
  valueField: "value",
2991
- value: b.value ? String(b.value) : null,
2997
+ value: p.value ? String(p.value) : null,
2992
2998
  onChange: (d) => {
2993
- b.onChange(d.value);
2999
+ p.onChange(d.value);
2994
3000
  },
2995
- onBlur: b.onBlur,
3001
+ onBlur: p.onBlur,
2996
3002
  disable: e.options.disabled,
2997
3003
  placeholder: e.options.placeholder || "Select...",
2998
- style: [l.container, e.options.disabled && l.disabled, o && l.error],
2999
- placeholderStyle: l.placeholder,
3000
- selectedTextStyle: l.selectedText,
3001
- itemTextStyle: l.itemText,
3002
- activeColor: l.selectedItem?.backgroundColor,
3004
+ style: [n.container, e.options.disabled && n.disabled, o && n.error],
3005
+ placeholderStyle: n.placeholder,
3006
+ selectedTextStyle: n.selectedText,
3007
+ itemTextStyle: n.itemText,
3008
+ activeColor: n.selectedItem?.backgroundColor,
3003
3009
  accessibilityLabel: e.options.label
3004
3010
  }
3005
3011
  ),
3006
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
3012
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
3007
3013
  ] })
3008
3014
  }
3009
3015
  );
3010
3016
  }
3011
- function ot({
3017
+ function pt({
3012
3018
  form: t,
3013
3019
  field: e,
3014
3020
  hasError: o,
3015
- formReadOnly: i = !1,
3021
+ formReadOnly: a = !1,
3016
3022
  formReadOnlyStyle: s = "value"
3017
3023
  }) {
3018
- const l = Object.entries(e.options.enum || {}).map(([p, h]) => ({
3019
- label: p,
3020
- value: String(h)
3021
- })), a = {
3024
+ const n = Object.entries(e.options.enum || {}).map(([h, b]) => ({
3025
+ label: h,
3026
+ value: String(b)
3027
+ })), i = {
3022
3028
  ...e,
3023
- type: C.Select,
3029
+ type: x.Select,
3024
3030
  options: {
3025
3031
  ...e.options,
3026
- options: l
3032
+ options: n
3027
3033
  }
3028
3034
  };
3029
- return /* @__PURE__ */ n(
3035
+ return /* @__PURE__ */ l(
3030
3036
  xe,
3031
3037
  {
3032
3038
  form: t,
3033
- field: a,
3039
+ field: i,
3034
3040
  hasError: o,
3035
- formReadOnly: i,
3041
+ formReadOnly: a,
3036
3042
  formReadOnlyStyle: s
3037
3043
  }
3038
3044
  );
@@ -3042,37 +3048,40 @@ try {
3042
3048
  G = require("react-native-element-dropdown").MultiSelect;
3043
3049
  } catch {
3044
3050
  }
3045
- function at(t) {
3051
+ function ht(t) {
3052
+ return typeof t == "string" ? t : t?.value !== void 0 ? String(t.value) : String(t);
3053
+ }
3054
+ function bt(t) {
3046
3055
  return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? e.value : String(e)) : [];
3047
3056
  }
3048
- function it({
3057
+ function yt({
3049
3058
  form: t,
3050
3059
  field: e,
3051
3060
  hasError: o,
3052
- formReadOnly: i = !1,
3061
+ formReadOnly: a = !1,
3053
3062
  formReadOnlyStyle: s = "value"
3054
3063
  }) {
3055
- const l = v().multiSelect, a = (e.options.options || []).map((c) => ({ label: c.label, value: String(c.value) })), p = e.options.readOnly ?? i, h = e.options.readOnlyStyle ?? s;
3056
- if (e.options.submitTransform ??= at, !G)
3057
- return /* @__PURE__ */ n(f, { style: l.container, children: /* @__PURE__ */ n(u, { style: l.placeholder, children: "Install react-native-element-dropdown to use SelectFieldMulti" }) });
3058
- if (p) {
3059
- const c = t.getValues(e.key) ?? [], b = Array.isArray(c) ? c.map(String) : [], d = a.filter((y) => b.includes(y.value)).map((y) => y.label);
3060
- return h === "disabled" ? /* @__PURE__ */ n(
3064
+ const n = T().multiSelect, i = (e.options.options || []).map((c) => ({ label: c.label, value: String(c.value) })), h = e.options.readOnly ?? a, b = e.options.readOnlyStyle ?? s;
3065
+ if (e.options.submitTransform ??= bt, !G)
3066
+ return /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectFieldMulti" }) });
3067
+ if (h) {
3068
+ const c = t.getValues(e.key) ?? [], p = Array.isArray(c) ? c.map(String) : [], d = i.filter((f) => p.includes(f.value)).map((f) => f.label);
3069
+ return b === "disabled" ? /* @__PURE__ */ l(
3061
3070
  G,
3062
3071
  {
3063
- data: a,
3072
+ data: i,
3064
3073
  labelField: "label",
3065
3074
  valueField: "value",
3066
- value: b,
3075
+ value: p,
3067
3076
  disable: !0,
3068
3077
  placeholder: e.options.placeholder || "Select...",
3069
- style: [l.container, l.disabled],
3078
+ style: [n.container, n.disabled],
3070
3079
  onChange: () => {
3071
3080
  }
3072
3081
  }
3073
- ) : /* @__PURE__ */ n(f, { style: l.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: d.join(", ") || "—" }) });
3082
+ ) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: d.join(", ") || "—" }) });
3074
3083
  }
3075
- return /* @__PURE__ */ n(
3084
+ return /* @__PURE__ */ l(
3076
3085
  z,
3077
3086
  {
3078
3087
  name: e.key,
@@ -3080,87 +3089,87 @@ function it({
3080
3089
  defaultValue: e.options.defaultValue ?? [],
3081
3090
  rules: { required: e.options.required },
3082
3091
  render: ({ field: c }) => {
3083
- const b = Array.isArray(c.value) ? c.value.map((d) => typeof d == "string" ? d : d?.value ? String(d.value) : String(d)) : [];
3084
- return /* @__PURE__ */ x(f, { style: l.wrapper, children: [
3085
- /* @__PURE__ */ n(
3092
+ const p = Array.isArray(c.value) ? c.value.map(ht) : [];
3093
+ return /* @__PURE__ */ S(y, { style: n.wrapper, children: [
3094
+ /* @__PURE__ */ l(
3086
3095
  G,
3087
3096
  {
3088
- data: a,
3097
+ data: i,
3089
3098
  labelField: "label",
3090
3099
  valueField: "value",
3091
- value: b,
3100
+ value: p,
3092
3101
  onChange: (d) => {
3093
3102
  c.onChange(d);
3094
3103
  },
3095
3104
  disable: e.options.disabled,
3096
3105
  placeholder: e.options.placeholder || "Select...",
3097
- style: [l.container, e.options.disabled && l.disabled, o && l.error],
3098
- placeholderStyle: l.placeholder,
3099
- selectedTextStyle: l.selectedItemText,
3106
+ style: [n.container, e.options.disabled && n.disabled, o && n.error],
3107
+ placeholderStyle: n.placeholder,
3108
+ selectedTextStyle: n.selectedItemText,
3100
3109
  accessibilityLabel: e.options.label
3101
3110
  }
3102
3111
  ),
3103
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
3112
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
3104
3113
  ] });
3105
3114
  }
3106
3115
  }
3107
3116
  );
3108
3117
  }
3109
- function st(t) {
3110
- const e = v(), [o, i] = B(), [s, l] = B(""), a = t.field?.options;
3111
- E(() => {
3112
- const S = t.form.getValues(t.field.key);
3113
- if (a?.defaultValue !== void 0 && (S === void 0 || S === "")) {
3114
- const m = a?.radioOptions?.find((g) => g.value === a?.defaultValue);
3115
- m?.value && t.form.setValue(t.field.key, m.value), a?.defaultSubValue !== void 0 && m?.checkedSubOption && (i(m.checkedSubOption.key), l(a.defaultSubValue), t.form.setValue(m.checkedSubOption.key, a.defaultSubValue));
3116
- }
3117
- }, [a?.defaultValue, a?.defaultSubValue, t.field.key]);
3118
- const p = a.readOnly ?? t.formReadOnly, h = a.readOnlyStyle ?? t.formReadOnlyStyle, c = t.form.getValues(t.field.key), b = a.radioOptions?.find((S) => S.value === c), d = e.radioField;
3119
- function y(S, m) {
3120
- m(S.value), S?.checkedSubOption?.key ? (i(S.checkedSubOption.key), l(""), t.form.setValue(S.checkedSubOption.key, "")) : o && (t.form.setValue(o, ""), i(void 0), l(""));
3118
+ function ft(t) {
3119
+ const e = T(), [o, a] = I(), [s, n] = I(""), i = t.field?.options;
3120
+ q(() => {
3121
+ const g = t.form.getValues(t.field.key);
3122
+ if (i?.defaultValue !== void 0 && (g === void 0 || g === "")) {
3123
+ const k = i?.radioOptions?.find((m) => m.value === i?.defaultValue);
3124
+ k?.value && t.form.setValue(t.field.key, k.value), i?.defaultSubValue !== void 0 && k?.checkedSubOption && (a(k.checkedSubOption.key), n(i.defaultSubValue), t.form.setValue(k.checkedSubOption.key, i.defaultSubValue));
3125
+ }
3126
+ }, [i?.defaultValue, i?.defaultSubValue, t.field.key]);
3127
+ const h = i.readOnly ?? t.formReadOnly, b = i.readOnlyStyle ?? t.formReadOnlyStyle, c = t.form.getValues(t.field.key), p = i.radioOptions?.find((g) => g.value === c), d = e.radioField;
3128
+ function f(g, k) {
3129
+ k(g.value), g?.checkedSubOption?.key ? (a(g.checkedSubOption.key), n(""), t.form.setValue(g.checkedSubOption.key, "")) : o && (t.form.setValue(o, ""), a(void 0), n(""));
3121
3130
  }
3122
- return p ? h === "disabled" ? /* @__PURE__ */ n(f, { style: a.radioDirection === "row" ? d.containerRow : d.containerColumn, children: a?.radioOptions?.map((S) => /* @__PURE__ */ x(f, { style: d.optionContainer, children: [
3123
- /* @__PURE__ */ n(f, { style: [d.radio, S.value === c && d.radioSelected, d.disabled], children: S.value === c && /* @__PURE__ */ n(f, { style: d.radioInner }) }),
3124
- /* @__PURE__ */ n(u, { style: [d.label, d.disabled], children: S.label })
3125
- ] }, S.key)) }) : b ? /* @__PURE__ */ n(f, { style: d.readOnlySelected, children: /* @__PURE__ */ n(u, { style: d.label, children: b.label }) }) : /* @__PURE__ */ n(u, { style: d.readOnlyUnselected, children: "—" }) : /* @__PURE__ */ n(
3131
+ return h ? b === "disabled" ? /* @__PURE__ */ l(y, { style: i.radioDirection === "row" ? d.containerRow : d.containerColumn, children: i?.radioOptions?.map((g) => /* @__PURE__ */ S(y, { style: d.optionContainer, children: [
3132
+ /* @__PURE__ */ l(y, { style: [d.radio, g.value === c && d.radioSelected, d.disabled], children: g.value === c && /* @__PURE__ */ l(y, { style: d.radioInner }) }),
3133
+ /* @__PURE__ */ l(u, { style: [d.label, d.disabled], children: g.label })
3134
+ ] }, g.key)) }) : p ? /* @__PURE__ */ l(y, { style: d.readOnlySelected, children: /* @__PURE__ */ l(u, { style: d.label, children: p.label }) }) : /* @__PURE__ */ l(u, { style: d.readOnlyUnselected, children: "—" }) : /* @__PURE__ */ l(
3126
3135
  z,
3127
3136
  {
3128
3137
  name: t.field.key,
3129
3138
  control: t.form.control,
3130
- defaultValue: a?.defaultValue,
3131
- render: ({ field: { value: S, onChange: m } }) => /* @__PURE__ */ x(f, { children: [
3132
- a.helpText && /* @__PURE__ */ n(u, { style: d.helpText, children: a.helpText }),
3133
- /* @__PURE__ */ n(f, { style: a.radioDirection === "row" ? d.containerRow : d.containerColumn, children: a?.radioOptions?.map((g) => {
3134
- if (g.hidden) return null;
3135
- const k = g.value === S;
3136
- return /* @__PURE__ */ x(f, { children: [
3137
- /* @__PURE__ */ x(
3138
- H,
3139
+ defaultValue: i?.defaultValue,
3140
+ render: ({ field: { value: g, onChange: k } }) => /* @__PURE__ */ S(y, { children: [
3141
+ i.helpText && /* @__PURE__ */ l(u, { style: d.helpText, children: i.helpText }),
3142
+ /* @__PURE__ */ l(y, { style: i.radioDirection === "row" ? d.containerRow : d.containerColumn, children: i?.radioOptions?.map((m) => {
3143
+ if (m.hidden) return null;
3144
+ const C = m.value === g;
3145
+ return /* @__PURE__ */ S(y, { children: [
3146
+ /* @__PURE__ */ S(
3147
+ R,
3139
3148
  {
3140
- onPress: () => !a.disabled && y(g, m),
3149
+ onPress: () => !i.disabled && f(m, k),
3141
3150
  style: d.optionContainer,
3142
3151
  accessibilityRole: "radio",
3143
- accessibilityState: { selected: k, disabled: a.disabled },
3152
+ accessibilityState: { selected: C, disabled: i.disabled },
3144
3153
  children: [
3145
- /* @__PURE__ */ n(f, { style: [d.radio, k && d.radioSelected, a.disabled && d.disabled], children: k && /* @__PURE__ */ n(f, { style: d.radioInner }) }),
3146
- /* @__PURE__ */ n(u, { style: [d.label, a.disabled && d.disabled], children: g.label })
3154
+ /* @__PURE__ */ l(y, { style: [d.radio, C && d.radioSelected, i.disabled && d.disabled], children: C && /* @__PURE__ */ l(y, { style: d.radioInner }) }),
3155
+ /* @__PURE__ */ l(u, { style: [d.label, i.disabled && d.disabled], children: m.label })
3147
3156
  ]
3148
3157
  }
3149
3158
  ),
3150
- k && g.checkedSubOption && /* @__PURE__ */ n(
3151
- D,
3159
+ C && m.checkedSubOption && /* @__PURE__ */ l(
3160
+ P,
3152
3161
  {
3153
- placeholder: g.checkedSubOption.label,
3162
+ placeholder: m.checkedSubOption.label,
3154
3163
  placeholderTextColor: "#9ca3af",
3155
3164
  value: s,
3156
- onChangeText: (T) => {
3157
- l(T), g.checkedSubOption?.key && t.form.setValue(g.checkedSubOption.key, T);
3165
+ onChangeText: (v) => {
3166
+ n(v), m.checkedSubOption?.key && t.form.setValue(m.checkedSubOption.key, v);
3158
3167
  },
3159
- editable: !a.disabled,
3168
+ editable: !i.disabled,
3160
3169
  style: d.subOptionInput
3161
3170
  }
3162
3171
  )
3163
- ] }, g.key);
3172
+ ] }, m.key);
3164
3173
  }) })
3165
3174
  ] })
3166
3175
  }
@@ -3171,272 +3180,275 @@ try {
3171
3180
  Ce = require("expo-checkbox").default;
3172
3181
  } catch {
3173
3182
  }
3174
- function dt({ value: t, onValueChange: e, disabled: o, color: i }) {
3175
- return /* @__PURE__ */ n(
3176
- H,
3183
+ function gt({ value: t, onValueChange: e, disabled: o, color: a }) {
3184
+ return /* @__PURE__ */ l(
3185
+ R,
3177
3186
  {
3178
3187
  onPress: () => !o && e(!t),
3179
3188
  style: {
3180
3189
  width: 22,
3181
3190
  height: 22,
3182
3191
  borderWidth: 2,
3183
- borderColor: t ? i || "#0284c7" : "#d1d5db",
3192
+ borderColor: t ? a || "#0284c7" : "#d1d5db",
3184
3193
  borderRadius: 4,
3185
- backgroundColor: t ? i || "#0284c7" : "transparent",
3194
+ backgroundColor: t ? a || "#0284c7" : "transparent",
3186
3195
  justifyContent: "center",
3187
3196
  alignItems: "center",
3188
3197
  opacity: o ? 0.5 : 1
3189
3198
  },
3190
3199
  accessibilityRole: "checkbox",
3191
3200
  accessibilityState: { checked: t, disabled: o },
3192
- children: t && /* @__PURE__ */ n(u, { style: { color: "#ffffff", fontSize: 14, fontWeight: "700" }, children: "✓" })
3201
+ children: t && /* @__PURE__ */ l(u, { style: { color: "#ffffff", fontSize: 14, fontWeight: "700" }, children: "✓" })
3193
3202
  }
3194
3203
  );
3195
3204
  }
3196
- const de = (t, e) => !t || t.trim() === "" ? [] : t.split(e).map((o) => o.trim()).filter((o) => o !== ""), ct = (t, e) => t.join(e);
3197
- function ut({
3205
+ const se = (t, e) => !t || t.trim() === "" ? [] : t.split(e).map((o) => o.trim()).filter((o) => o !== ""), mt = (t, e) => t.join(e);
3206
+ function St({
3198
3207
  form: t,
3199
3208
  field: e,
3200
3209
  hasError: o,
3201
- formReadOnly: i = !1,
3210
+ formReadOnly: a = !1,
3202
3211
  formReadOnlyStyle: s = "value"
3203
3212
  }) {
3204
- const a = v().checkboxGroup, p = e.options, h = p.readOnly ?? i, c = p.readOnlyStyle ?? s, b = p.valueSeparator ?? ",", d = Ce || dt;
3205
- if (h) {
3206
- const y = t.getValues(e.key), S = de(y, b), m = p.checkboxOptions.filter(
3207
- (g) => S.includes(String(g.value))
3213
+ const i = T().checkboxGroup, h = e.options, b = h.readOnly ?? a, c = h.readOnlyStyle ?? s, p = h.valueSeparator ?? ",", d = Ce || gt;
3214
+ if (b) {
3215
+ const f = t.getValues(e.key), g = se(f, p), k = h.checkboxOptions.filter(
3216
+ (m) => g.includes(String(m.value))
3208
3217
  );
3209
- return c === "disabled" ? /* @__PURE__ */ n(f, { style: a.wrapper, children: /* @__PURE__ */ n(f, { style: p.checkboxDirection === "row" ? a.containerRow : a.containerColumn, children: p.checkboxOptions.map((g) => {
3210
- const k = S.includes(String(g.value));
3211
- return /* @__PURE__ */ x(f, { style: a.optionContainer, children: [
3212
- /* @__PURE__ */ n(
3218
+ return c === "disabled" ? /* @__PURE__ */ l(y, { style: i.wrapper, children: /* @__PURE__ */ l(y, { style: h.checkboxDirection === "row" ? i.containerRow : i.containerColumn, children: h.checkboxOptions.map((m) => {
3219
+ const C = g.includes(String(m.value));
3220
+ return /* @__PURE__ */ S(y, { style: i.optionContainer, children: [
3221
+ /* @__PURE__ */ l(
3213
3222
  d,
3214
3223
  {
3215
- value: k,
3224
+ value: C,
3216
3225
  onValueChange: () => {
3217
3226
  },
3218
3227
  disabled: !0,
3219
- color: k ? "#0284c7" : void 0
3228
+ color: C ? "#0284c7" : void 0
3220
3229
  }
3221
3230
  ),
3222
- /* @__PURE__ */ n(u, { style: [a.label, a.disabled], children: g.label })
3223
- ] }, g.key);
3224
- }) }) }) : /* @__PURE__ */ n(f, { children: m.length > 0 ? m.map((g) => /* @__PURE__ */ x(u, { style: a.readOnlySelected, children: [
3231
+ /* @__PURE__ */ l(u, { style: [i.label, i.disabled], children: m.label })
3232
+ ] }, m.key);
3233
+ }) }) }) : /* @__PURE__ */ l(y, { children: k.length > 0 ? k.map((m) => /* @__PURE__ */ S(u, { style: i.readOnlySelected, children: [
3225
3234
  "✓ ",
3226
- g.label
3227
- ] }, g.key)) : /* @__PURE__ */ n(u, { style: a.readOnlyUnselected, children: "No options selected" }) });
3235
+ m.label
3236
+ ] }, m.key)) : /* @__PURE__ */ l(u, { style: i.readOnlyUnselected, children: "No options selected" }) });
3228
3237
  }
3229
- return /* @__PURE__ */ n(
3238
+ return /* @__PURE__ */ l(
3230
3239
  z,
3231
3240
  {
3232
3241
  control: t.control,
3233
3242
  name: e.key,
3234
- defaultValue: p.defaultValue || "",
3235
- rules: { required: p.required },
3236
- render: ({ field: { onChange: y, value: S } }) => {
3237
- const m = de(S, b), g = (k, T) => {
3238
- const I = String(k);
3239
- let O;
3240
- T ? O = m.includes(I) ? m : [...m, I] : O = m.filter((V) => V !== I), y(ct(O, b));
3243
+ defaultValue: h.defaultValue || "",
3244
+ rules: { required: h.required },
3245
+ render: ({ field: { onChange: f, value: g } }) => {
3246
+ const k = se(g, p), m = (C, v) => {
3247
+ const V = String(C);
3248
+ let F;
3249
+ v ? F = k.includes(V) ? k : [...k, V] : F = k.filter((D) => D !== V), f(mt(F, p));
3241
3250
  };
3242
- return /* @__PURE__ */ n(f, { style: a.wrapper, children: /* @__PURE__ */ n(f, { style: p.checkboxDirection === "row" ? a.containerRow : a.containerColumn, children: p.checkboxOptions.map((k) => {
3243
- if (k.hidden) return null;
3244
- const T = m.includes(String(k.value));
3245
- return /* @__PURE__ */ x(f, { style: a.optionContainer, children: [
3246
- /* @__PURE__ */ n(
3251
+ return /* @__PURE__ */ l(y, { style: i.wrapper, children: /* @__PURE__ */ l(y, { style: h.checkboxDirection === "row" ? i.containerRow : i.containerColumn, children: h.checkboxOptions.map((C) => {
3252
+ if (C.hidden) return null;
3253
+ const v = k.includes(String(C.value));
3254
+ return /* @__PURE__ */ S(y, { style: i.optionContainer, children: [
3255
+ /* @__PURE__ */ l(
3247
3256
  d,
3248
3257
  {
3249
- value: T,
3250
- onValueChange: (I) => g(k.value, I),
3251
- disabled: !!p.disabled,
3252
- color: T ? "#0284c7" : void 0
3258
+ value: v,
3259
+ onValueChange: (V) => m(C.value, V),
3260
+ disabled: !!h.disabled,
3261
+ color: v ? "#0284c7" : void 0
3253
3262
  }
3254
3263
  ),
3255
- /* @__PURE__ */ n(u, { style: [a.label, p.disabled && a.disabled], children: k.label })
3256
- ] }, k.key);
3264
+ /* @__PURE__ */ l(u, { style: [i.label, h.disabled && i.disabled], children: C.label })
3265
+ ] }, C.key);
3257
3266
  }) }) });
3258
3267
  }
3259
3268
  }
3260
3269
  );
3261
3270
  }
3262
- let Y = null;
3271
+ let K = null;
3263
3272
  try {
3264
- Y = require("react-native-element-dropdown").Dropdown;
3273
+ K = require("react-native-element-dropdown").Dropdown;
3265
3274
  } catch {
3266
3275
  }
3267
- function pt({
3276
+ function xt({
3268
3277
  form: t,
3269
3278
  field: e,
3270
3279
  hasError: o,
3271
- formReadOnly: i = !1,
3280
+ formReadOnly: a = !1,
3272
3281
  formReadOnlyStyle: s = "value"
3273
3282
  }) {
3274
- const l = v().searchSelect, a = e.options.options || [], p = e.options.readOnly ?? i, h = e.options.readOnlyStyle ?? s, c = t.getValues(e.key);
3275
- if (!Y)
3276
- return /* @__PURE__ */ n(f, { style: l.container, children: /* @__PURE__ */ n(u, { style: l.placeholder, children: "Install react-native-element-dropdown to use SelectFieldSearch" }) });
3277
- if (p) {
3278
- const b = a.find((d) => d.value === c);
3279
- return h === "disabled" ? /* @__PURE__ */ n(
3280
- Y,
3283
+ const n = T().searchSelect, i = e.options.options || [], h = e.options.readOnly ?? a, b = e.options.readOnlyStyle ?? s, c = t.getValues(e.key);
3284
+ if (!K)
3285
+ return /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectFieldSearch" }) });
3286
+ if (h) {
3287
+ const p = i.find((d) => d.value === c);
3288
+ return b === "disabled" ? /* @__PURE__ */ l(
3289
+ K,
3281
3290
  {
3282
- data: a.map((d) => ({ label: d.label, value: d.value })),
3291
+ data: i.map((d) => ({ label: d.label, value: d.value })),
3283
3292
  labelField: "label",
3284
3293
  valueField: "value",
3285
3294
  value: c,
3286
3295
  disable: !0,
3287
3296
  search: !0,
3288
3297
  placeholder: e.options.placeholder || "Search...",
3289
- style: [l.container, l.disabled],
3298
+ style: [n.container, n.disabled],
3290
3299
  onChange: () => {
3291
3300
  }
3292
3301
  }
3293
- ) : /* @__PURE__ */ n(f, { style: l.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: b?.label || "—" }) });
3302
+ ) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: p?.label || "—" }) });
3294
3303
  }
3295
- return /* @__PURE__ */ n(
3304
+ return /* @__PURE__ */ l(
3296
3305
  z,
3297
3306
  {
3298
3307
  name: e.key,
3299
3308
  control: t.control,
3300
3309
  defaultValue: e.options.defaultValue,
3301
3310
  rules: { required: e.options.required },
3302
- render: ({ field: b }) => /* @__PURE__ */ x(f, { style: l.wrapper, children: [
3303
- /* @__PURE__ */ n(
3304
- Y,
3311
+ render: ({ field: p }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
3312
+ /* @__PURE__ */ l(
3313
+ K,
3305
3314
  {
3306
- data: a.map((d) => ({ label: d.label, value: d.value })),
3315
+ data: i.map((d) => ({ label: d.label, value: d.value })),
3307
3316
  labelField: "label",
3308
3317
  valueField: "value",
3309
- value: b.value,
3318
+ value: p.value,
3310
3319
  search: !0,
3311
3320
  searchPlaceholder: "Search...",
3312
3321
  onChange: (d) => {
3313
- b.onChange(d.value), t.trigger && t.trigger(e.key);
3322
+ p.onChange(d.value), t.trigger && t.trigger(e.key);
3314
3323
  },
3315
- onBlur: b.onBlur,
3324
+ onBlur: p.onBlur,
3316
3325
  disable: e.options.disabled,
3317
3326
  placeholder: e.options.placeholder || "Search...",
3318
- style: [l.container, e.options.disabled && l.disabled, o && l.error],
3319
- placeholderStyle: l.placeholder,
3320
- inputSearchStyle: l.inputSearch,
3327
+ style: [n.container, e.options.disabled && n.disabled, o && n.error],
3328
+ placeholderStyle: n.placeholder,
3329
+ inputSearchStyle: n.inputSearch,
3321
3330
  accessibilityLabel: e.options.label
3322
3331
  }
3323
3332
  ),
3324
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
3333
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
3325
3334
  ] })
3326
3335
  }
3327
3336
  );
3328
3337
  }
3329
- let Z = null;
3338
+ let Y = null;
3330
3339
  try {
3331
- Z = require("react-native-element-dropdown").Dropdown;
3340
+ Y = require("react-native-element-dropdown").Dropdown;
3332
3341
  } catch {
3333
3342
  }
3334
- function ht(t) {
3343
+ function Ct(t) {
3335
3344
  return t ? typeof t == "string" ? t : t && typeof t == "object" && "value" in t ? t.value : String(t) : null;
3336
3345
  }
3337
- function bt({
3346
+ function kt({
3338
3347
  form: t,
3339
3348
  field: e,
3340
3349
  hasError: o,
3341
- formReadOnly: i = !1,
3350
+ formReadOnly: a = !1,
3342
3351
  formReadOnlyStyle: s = "value"
3343
3352
  }) {
3344
- const l = v().searchSelect, a = e.options.readOnly ?? i, p = e.options.readOnlyStyle ?? s;
3345
- e.options.submitTransform ??= ht;
3346
- let h = [], c = () => {
3353
+ const n = T().searchSelect, i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s;
3354
+ e.options.submitTransform ??= Ct;
3355
+ let b = [], c = () => {
3347
3356
  };
3348
3357
  try {
3349
- h = e.options.initialOptions ?? [];
3358
+ b = e.options.initialOptions ?? [];
3350
3359
  } catch {
3351
3360
  }
3352
- const b = pe({
3361
+ const p = pe({
3353
3362
  control: t.control,
3354
3363
  name: e.key
3355
- }), d = W(() => b ? b && typeof b == "object" && "value" in b && "label" in b ? b : typeof b == "string" ? h.find((S) => S.value === b) || { value: b, label: b } : { value: String(b), label: String(b) } : null, [b, h]);
3356
- return Z ? a ? p === "disabled" ? /* @__PURE__ */ n(
3357
- Z,
3364
+ }), d = W(() => p ? p && typeof p == "object" && "value" in p && "label" in p ? p : typeof p == "string" ? b.find((g) => g.value === p) || { value: p, label: p } : { value: String(p), label: String(p) } : null, [p, b]);
3365
+ return Y ? i ? h === "disabled" ? /* @__PURE__ */ l(
3366
+ Y,
3358
3367
  {
3359
- data: h,
3368
+ data: b,
3360
3369
  labelField: "label",
3361
3370
  valueField: "value",
3362
3371
  value: d?.value,
3363
3372
  disable: !0,
3364
3373
  search: !0,
3365
- style: [l.container, l.disabled],
3374
+ style: [n.container, n.disabled],
3366
3375
  onChange: () => {
3367
3376
  }
3368
3377
  }
3369
- ) : /* @__PURE__ */ n(f, { style: l.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: d?.label || "—" }) }) : /* @__PURE__ */ n(
3378
+ ) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: d?.label || "—" }) }) : /* @__PURE__ */ l(
3370
3379
  z,
3371
3380
  {
3372
3381
  name: e.key,
3373
3382
  control: t.control,
3374
3383
  defaultValue: e.options.defaultValue,
3375
3384
  rules: { required: e.options.required },
3376
- render: ({ field: y }) => /* @__PURE__ */ x(f, { style: l.wrapper, children: [
3377
- /* @__PURE__ */ n(
3378
- Z,
3385
+ render: ({ field: f }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
3386
+ /* @__PURE__ */ l(
3387
+ Y,
3379
3388
  {
3380
- data: h,
3389
+ data: b,
3381
3390
  labelField: "label",
3382
3391
  valueField: "value",
3383
3392
  value: d?.value,
3384
3393
  search: !0,
3385
3394
  searchPlaceholder: "Search...",
3386
3395
  onChangeText: c,
3387
- onChange: (S) => {
3388
- y.onChange(S), t.trigger && t.trigger(e.key);
3396
+ onChange: (g) => {
3397
+ f.onChange(g), t.trigger && t.trigger(e.key);
3389
3398
  },
3390
- onBlur: y.onBlur,
3399
+ onBlur: f.onBlur,
3391
3400
  disable: e.options.disabled,
3392
3401
  placeholder: e.options.placeholder || "Search...",
3393
- style: [l.container, e.options.disabled && l.disabled, o && l.error],
3394
- placeholderStyle: l.placeholder,
3395
- inputSearchStyle: l.inputSearch,
3402
+ style: [n.container, e.options.disabled && n.disabled, o && n.error],
3403
+ placeholderStyle: n.placeholder,
3404
+ inputSearchStyle: n.inputSearch,
3396
3405
  accessibilityLabel: e.options.label
3397
3406
  }
3398
3407
  ),
3399
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
3408
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
3400
3409
  ] })
3401
3410
  }
3402
- ) : /* @__PURE__ */ n(f, { style: l.container, children: /* @__PURE__ */ n(u, { style: l.placeholder, children: "Install react-native-element-dropdown to use SelectFieldSearchApollo" }) });
3411
+ ) : /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectFieldSearchApollo" }) });
3403
3412
  }
3404
- let _ = null;
3413
+ let Z = null;
3405
3414
  try {
3406
- _ = require("react-native-element-dropdown").MultiSelect;
3415
+ Z = require("react-native-element-dropdown").MultiSelect;
3407
3416
  } catch {
3408
3417
  }
3409
- function yt(t) {
3418
+ function de(t) {
3419
+ return typeof t == "string" ? t : t?.value !== void 0 ? String(t.value) : String(t);
3420
+ }
3421
+ function vt(t) {
3410
3422
  return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? e.value : String(e)) : [];
3411
3423
  }
3412
- function ft({
3424
+ function Tt({
3413
3425
  form: t,
3414
3426
  field: e,
3415
3427
  hasError: o,
3416
- formReadOnly: i = !1,
3428
+ formReadOnly: a = !1,
3417
3429
  formReadOnlyStyle: s = "value"
3418
3430
  }) {
3419
- const l = v().multiSelect, a = (e.options.options || []).map((c) => ({ label: c.label, value: c.value })), p = e.options.readOnly ?? i, h = e.options.readOnlyStyle ?? s;
3420
- if (e.options.submitTransform ??= yt, !_)
3421
- return /* @__PURE__ */ n(f, { style: l.container, children: /* @__PURE__ */ n(u, { style: l.placeholder, children: "Install react-native-element-dropdown to use SelectFieldMultiSearch" }) });
3422
- if (p) {
3423
- const c = t.getValues(e.key) ?? [], b = Array.isArray(c) ? c.map((y) => typeof y == "string" ? y : y?.value || String(y)) : [], d = a.filter((y) => b.includes(y.value)).map((y) => y.label);
3424
- return h === "disabled" ? /* @__PURE__ */ n(
3425
- _,
3431
+ const n = T().multiSelect, i = (e.options.options || []).map((c) => ({ label: c.label, value: c.value })), h = e.options.readOnly ?? a, b = e.options.readOnlyStyle ?? s;
3432
+ if (e.options.submitTransform ??= vt, !Z)
3433
+ return /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectFieldMultiSearch" }) });
3434
+ if (h) {
3435
+ const c = t.getValues(e.key) ?? [], p = Array.isArray(c) ? c.map(de) : [], d = i.filter((f) => p.includes(f.value)).map((f) => f.label);
3436
+ return b === "disabled" ? /* @__PURE__ */ l(
3437
+ Z,
3426
3438
  {
3427
- data: a,
3439
+ data: i,
3428
3440
  labelField: "label",
3429
3441
  valueField: "value",
3430
- value: b,
3442
+ value: p,
3431
3443
  disable: !0,
3432
3444
  search: !0,
3433
- style: [l.container, l.disabled],
3445
+ style: [n.container, n.disabled],
3434
3446
  onChange: () => {
3435
3447
  }
3436
3448
  }
3437
- ) : /* @__PURE__ */ n(f, { style: l.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: d.join(", ") || "—" }) });
3449
+ ) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: d.join(", ") || "—" }) });
3438
3450
  }
3439
- return /* @__PURE__ */ n(
3451
+ return /* @__PURE__ */ l(
3440
3452
  z,
3441
3453
  {
3442
3454
  name: e.key,
@@ -3444,15 +3456,15 @@ function ft({
3444
3456
  defaultValue: e.options.defaultValue ?? [],
3445
3457
  rules: { required: e.options.required },
3446
3458
  render: ({ field: c }) => {
3447
- const b = Array.isArray(c.value) ? c.value.map((d) => typeof d == "string" ? d : d?.value ? String(d.value) : String(d)) : [];
3448
- return /* @__PURE__ */ x(f, { style: l.wrapper, children: [
3449
- /* @__PURE__ */ n(
3450
- _,
3459
+ const p = Array.isArray(c.value) ? c.value.map(de) : [];
3460
+ return /* @__PURE__ */ S(y, { style: n.wrapper, children: [
3461
+ /* @__PURE__ */ l(
3462
+ Z,
3451
3463
  {
3452
- data: a,
3464
+ data: i,
3453
3465
  labelField: "label",
3454
3466
  valueField: "value",
3455
- value: b,
3467
+ value: p,
3456
3468
  search: !0,
3457
3469
  searchPlaceholder: "Search...",
3458
3470
  onChange: (d) => {
@@ -3460,104 +3472,104 @@ function ft({
3460
3472
  },
3461
3473
  disable: e.options.disabled,
3462
3474
  placeholder: e.options.placeholder || "Search...",
3463
- style: [l.container, e.options.disabled && l.disabled, o && l.error],
3464
- placeholderStyle: l.placeholder,
3475
+ style: [n.container, e.options.disabled && n.disabled, o && n.error],
3476
+ placeholderStyle: n.placeholder,
3465
3477
  accessibilityLabel: e.options.label
3466
3478
  }
3467
3479
  ),
3468
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
3480
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
3469
3481
  ] });
3470
3482
  }
3471
3483
  }
3472
3484
  );
3473
3485
  }
3474
- let J = null;
3486
+ let _ = null;
3475
3487
  try {
3476
- J = require("react-native-element-dropdown").MultiSelect;
3488
+ _ = require("react-native-element-dropdown").MultiSelect;
3477
3489
  } catch {
3478
3490
  }
3479
3491
  function ke(t) {
3480
3492
  return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? e.value : String(e)) : [];
3481
3493
  }
3482
- const Kt = ke;
3483
- function gt({
3494
+ const tr = ke;
3495
+ function wt({
3484
3496
  form: t,
3485
3497
  field: e,
3486
3498
  hasError: o,
3487
- formReadOnly: i = !1,
3499
+ formReadOnly: a = !1,
3488
3500
  formReadOnlyStyle: s = "value"
3489
3501
  }) {
3490
- const l = v().multiSelect, a = e.options.readOnly ?? i, p = e.options.readOnlyStyle ?? s;
3502
+ const n = T().multiSelect, i = e.options.readOnly ?? a, h = e.options.readOnlyStyle ?? s;
3491
3503
  e.options.submitTransform ??= ke;
3492
- const h = e.options.initialOptions ?? [], [c, b] = B(/* @__PURE__ */ new Map()), d = pe({ control: t.control, name: e.key }), y = W(() => {
3504
+ const b = e.options.initialOptions ?? [], [c, p] = I(/* @__PURE__ */ new Map()), d = pe({ control: t.control, name: e.key }), f = W(() => {
3493
3505
  const m = d ?? [];
3494
- return Array.isArray(m) ? m.map((g) => typeof g == "string" ? g : g && typeof g == "object" && "value" in g ? String(g.value) : String(g)) : [];
3506
+ return Array.isArray(m) ? m.map((C) => typeof C == "string" ? C : C && typeof C == "object" && "value" in C ? String(C.value) : String(C)) : [];
3495
3507
  }, [d]);
3496
- E(() => {
3497
- h.length > 0 && b((m) => {
3498
- let g = !1;
3499
- for (const T of h)
3500
- if (!m.has(T.value)) {
3501
- g = !0;
3508
+ q(() => {
3509
+ b.length > 0 && p((m) => {
3510
+ let C = !1;
3511
+ for (const V of b)
3512
+ if (!m.has(V.value)) {
3513
+ C = !0;
3502
3514
  break;
3503
3515
  }
3504
- if (!g) return m;
3505
- const k = new Map(m);
3506
- return h.forEach((T) => k.set(T.value, T)), k;
3516
+ if (!C) return m;
3517
+ const v = new Map(m);
3518
+ return b.forEach((V) => v.set(V.value, V)), v;
3507
3519
  });
3508
- }, [h]);
3509
- const S = W(() => {
3520
+ }, [b]);
3521
+ const g = W(() => {
3510
3522
  const m = /* @__PURE__ */ new Map();
3511
- return c.forEach((g, k) => m.set(k, g)), h.forEach((g) => m.set(g.value, g)), Array.from(m.values());
3512
- }, [h, c]);
3513
- if (!J)
3514
- return /* @__PURE__ */ n(f, { style: l.container, children: /* @__PURE__ */ n(u, { style: l.placeholder, children: "Install react-native-element-dropdown to use SelectFieldMultiSearchApollo" }) });
3515
- if (a) {
3516
- const m = y.map((g) => S.find((k) => k.value === g)?.label ?? g);
3517
- return p === "disabled" ? /* @__PURE__ */ n(
3518
- J,
3523
+ return c.forEach((C, v) => m.set(v, C)), b.forEach((C) => m.set(C.value, C)), Array.from(m.values());
3524
+ }, [b, c]), k = Oe((m) => g.find((v) => v.value === m) || { value: m, label: m }, [g]);
3525
+ if (!_)
3526
+ return /* @__PURE__ */ l(y, { style: n.container, children: /* @__PURE__ */ l(u, { style: n.placeholder, children: "Install react-native-element-dropdown to use SelectFieldMultiSearchApollo" }) });
3527
+ if (i) {
3528
+ const m = f.map((C) => g.find((v) => v.value === C)?.label ?? C);
3529
+ return h === "disabled" ? /* @__PURE__ */ l(
3530
+ _,
3519
3531
  {
3520
- data: S,
3532
+ data: g,
3521
3533
  labelField: "label",
3522
3534
  valueField: "value",
3523
- value: y,
3535
+ value: f,
3524
3536
  disable: !0,
3525
3537
  search: !0,
3526
- style: [l.container, l.disabled],
3538
+ style: [n.container, n.disabled],
3527
3539
  onChange: () => {
3528
3540
  }
3529
3541
  }
3530
- ) : /* @__PURE__ */ n(f, { style: l.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: m.join(", ") || "—" }) });
3542
+ ) : /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: m.join(", ") || "—" }) });
3531
3543
  }
3532
- return /* @__PURE__ */ n(
3544
+ return /* @__PURE__ */ l(
3533
3545
  z,
3534
3546
  {
3535
3547
  name: e.key,
3536
3548
  control: t.control,
3537
3549
  defaultValue: e.options.defaultValue ?? [],
3538
3550
  rules: { required: e.options.required },
3539
- render: ({ field: m }) => /* @__PURE__ */ x(f, { style: l.wrapper, children: [
3540
- /* @__PURE__ */ n(
3541
- J,
3551
+ render: ({ field: m }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
3552
+ /* @__PURE__ */ l(
3553
+ _,
3542
3554
  {
3543
- data: S,
3555
+ data: g,
3544
3556
  labelField: "label",
3545
3557
  valueField: "value",
3546
- value: y,
3558
+ value: f,
3547
3559
  search: !0,
3548
3560
  searchPlaceholder: "Search...",
3549
- onChange: (g) => {
3550
- const k = g.map((T) => S.find((O) => O.value === T) || { value: T, label: T });
3551
- m.onChange(k), t.trigger && t.trigger(e.key);
3561
+ onChange: (C) => {
3562
+ const v = C.map((V) => k(V));
3563
+ m.onChange(v), t.trigger && t.trigger(e.key);
3552
3564
  },
3553
3565
  disable: e.options.disabled,
3554
3566
  placeholder: e.options.placeholder || "Search...",
3555
- style: [l.container, e.options.disabled && l.disabled, o && l.error],
3556
- placeholderStyle: l.placeholder,
3567
+ style: [n.container, e.options.disabled && n.disabled, o && n.error],
3568
+ placeholderStyle: n.placeholder,
3557
3569
  accessibilityLabel: e.options.label
3558
3570
  }
3559
3571
  ),
3560
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
3572
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
3561
3573
  ] })
3562
3574
  }
3563
3575
  );
@@ -3566,11 +3578,11 @@ function ve({
3566
3578
  form: t,
3567
3579
  field: e,
3568
3580
  hasError: o,
3569
- formReadOnly: i = !1,
3581
+ formReadOnly: a = !1,
3570
3582
  formReadOnlyStyle: s = "value"
3571
3583
  }) {
3572
- const l = v().customField, a = e.options, p = a.readOnly ?? i, h = a.readOnlyStyle ?? s, c = t.getValues(e.key) ?? a.defaultValue;
3573
- if (p) {
3584
+ const n = T().customField, i = e.options, h = i.readOnly ?? a, b = i.readOnlyStyle ?? s, c = t.getValues(e.key) ?? i.defaultValue;
3585
+ if (h) {
3574
3586
  let d;
3575
3587
  if (c == null || c === "")
3576
3588
  d = "—";
@@ -3582,9 +3594,9 @@ function ve({
3582
3594
  } catch {
3583
3595
  d = String(c);
3584
3596
  }
3585
- return h === "disabled" ? /* @__PURE__ */ n(f, { style: l.wrapper, children: /* @__PURE__ */ n(D, { editable: !1, value: d, style: { fontSize: 16, color: "#9ca3af" } }) }) : /* @__PURE__ */ n(f, { style: l.wrapper, children: /* @__PURE__ */ n(f, { style: l.readOnlyValue, children: /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: d }) }) });
3597
+ return b === "disabled" ? /* @__PURE__ */ l(y, { style: n.wrapper, children: /* @__PURE__ */ l(P, { editable: !1, value: d, style: { fontSize: 16, color: "#9ca3af" } }) }) : /* @__PURE__ */ l(y, { style: n.wrapper, children: /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: d }) }) });
3586
3598
  }
3587
- const b = {
3599
+ const p = {
3588
3600
  value: c,
3589
3601
  onChange: (d) => {
3590
3602
  t.setValue(e.key, d), t.trigger(e.key);
@@ -3592,65 +3604,65 @@ function ve({
3592
3604
  field: e
3593
3605
  };
3594
3606
  try {
3595
- const d = a.customField(b);
3596
- return a.customWrapper ? a.customWrapper(d) : /* @__PURE__ */ n(f, { style: l.wrapper, children: d });
3607
+ const d = i.customField(p);
3608
+ return i.customWrapper ? i.customWrapper(d) : /* @__PURE__ */ l(y, { style: n.wrapper, children: d });
3597
3609
  } catch (d) {
3598
- return console.error("Error rendering custom field:", d), /* @__PURE__ */ n(f, { style: l.wrapper, children: /* @__PURE__ */ x(u, { style: l.errorText, children: [
3610
+ return console.error("Error rendering custom field:", d), /* @__PURE__ */ l(y, { style: n.wrapper, children: /* @__PURE__ */ S(u, { style: n.errorText, children: [
3599
3611
  "Error rendering custom field: ",
3600
3612
  e.key
3601
3613
  ] }) });
3602
3614
  }
3603
3615
  }
3604
3616
  ve.displayName = "CustomField";
3605
- function mt({
3617
+ function Ot({
3606
3618
  form: t,
3607
3619
  field: e,
3608
3620
  hasError: o,
3609
- formReadOnly: i = !1,
3621
+ formReadOnly: a = !1,
3610
3622
  formReadOnlyStyle: s = "value"
3611
3623
  }) {
3612
- const l = v().customCheckbox, a = e.options, p = a.readOnly ?? i, h = a.readOnlyStyle ?? s, c = t.getValues(e.key), b = a.checkedIcon ?? /* @__PURE__ */ n(u, { style: { fontSize: 20 }, children: "☑" }), d = a.uncheckedIcon ?? /* @__PURE__ */ n(u, { style: { fontSize: 20 }, children: "☐" }), y = a.label ? /* @__PURE__ */ x(u, { style: l.label, children: [
3613
- a.label,
3614
- a.required && /* @__PURE__ */ n(u, { style: { color: "#dc2626" }, children: " *" })
3615
- ] }) : null, S = a.helpText ? /* @__PURE__ */ n(u, { style: l.helpText, children: a.helpText }) : null;
3616
- return p ? h === "disabled" ? /* @__PURE__ */ x(f, { style: l.wrapper, children: [
3617
- /* @__PURE__ */ x(f, { style: l.row, children: [
3618
- /* @__PURE__ */ n(f, { style: [l.checkboxContainer, l.disabled], children: c ? b : d }),
3619
- y
3624
+ const n = T().customCheckbox, i = e.options, h = i.readOnly ?? a, b = i.readOnlyStyle ?? s, c = t.getValues(e.key), p = i.checkedIcon ?? /* @__PURE__ */ l(u, { style: { fontSize: 20 }, children: "☑" }), d = i.uncheckedIcon ?? /* @__PURE__ */ l(u, { style: { fontSize: 20 }, children: "☐" }), f = i.label ? /* @__PURE__ */ S(u, { style: n.label, children: [
3625
+ i.label,
3626
+ i.required && /* @__PURE__ */ l(u, { style: { color: "#dc2626" }, children: " *" })
3627
+ ] }) : null, g = i.helpText ? /* @__PURE__ */ l(u, { style: n.helpText, children: i.helpText }) : null;
3628
+ return h ? b === "disabled" ? /* @__PURE__ */ S(y, { style: n.wrapper, children: [
3629
+ /* @__PURE__ */ S(y, { style: n.row, children: [
3630
+ /* @__PURE__ */ l(y, { style: [n.checkboxContainer, n.disabled], children: c ? p : d }),
3631
+ f
3620
3632
  ] }),
3621
- S
3622
- ] }) : /* @__PURE__ */ n(f, { style: l.wrapper, children: /* @__PURE__ */ n(u, { style: l.readOnly, children: c ? "Yes" : "No" }) }) : /* @__PURE__ */ n(
3633
+ g
3634
+ ] }) : /* @__PURE__ */ l(y, { style: n.wrapper, children: /* @__PURE__ */ l(u, { style: n.readOnly, children: c ? "Yes" : "No" }) }) : /* @__PURE__ */ l(
3623
3635
  z,
3624
3636
  {
3625
3637
  name: e.key,
3626
3638
  control: t.control,
3627
- defaultValue: a.defaultValue,
3628
- rules: { required: a.required },
3629
- render: ({ field: m }) => /* @__PURE__ */ x(f, { style: l.wrapper, children: [
3630
- /* @__PURE__ */ x(f, { style: l.row, children: [
3631
- /* @__PURE__ */ n(
3632
- H,
3639
+ defaultValue: i.defaultValue,
3640
+ rules: { required: i.required },
3641
+ render: ({ field: k }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
3642
+ /* @__PURE__ */ S(y, { style: n.row, children: [
3643
+ /* @__PURE__ */ l(
3644
+ R,
3633
3645
  {
3634
- onPress: () => !a.disabled && m.onChange(!m.value),
3635
- style: [l.checkboxContainer, a.disabled && l.disabled],
3646
+ onPress: () => !i.disabled && k.onChange(!k.value),
3647
+ style: [n.checkboxContainer, i.disabled && n.disabled],
3636
3648
  accessibilityRole: "checkbox",
3637
- accessibilityState: { checked: !!m.value, disabled: a.disabled },
3638
- children: m.value ? b : d
3649
+ accessibilityState: { checked: !!k.value, disabled: i.disabled },
3650
+ children: k.value ? p : d
3639
3651
  }
3640
3652
  ),
3641
- y
3653
+ f
3642
3654
  ] }),
3643
- S
3655
+ g
3644
3656
  ] })
3645
3657
  }
3646
3658
  );
3647
3659
  }
3648
- let N = null;
3660
+ let L = null;
3649
3661
  try {
3650
- N = require("react-native-markdown-display").default;
3662
+ L = require("react-native-markdown-display").default;
3651
3663
  } catch {
3652
3664
  }
3653
- const St = [
3665
+ const Vt = [
3654
3666
  { label: "B", syntax: "**", wrap: !0, title: "Bold" },
3655
3667
  { label: "I", syntax: "*", wrap: !0, title: "Italic" },
3656
3668
  { label: "H", syntax: "# ", wrap: !1, title: "Heading" },
@@ -3660,28 +3672,28 @@ const St = [
3660
3672
  { label: "•", syntax: "- ", wrap: !1, title: "List item" },
3661
3673
  { label: "🔗", syntax: "[text](url)", wrap: !1, title: "Link" }
3662
3674
  ];
3663
- function xt({
3675
+ function Ft({
3664
3676
  form: t,
3665
3677
  field: e,
3666
3678
  hasError: o,
3667
- formReadOnly: i = !1,
3679
+ formReadOnly: a = !1,
3668
3680
  formReadOnlyStyle: s = "value"
3669
3681
  }) {
3670
- const l = v().markdownEditor, [a, p] = B("edit"), h = e.options.readOnly ?? i, c = e.options.readOnlyStyle ?? s;
3671
- if (h) {
3672
- const b = t.getValues(e.key) ?? "";
3673
- return c === "disabled" ? /* @__PURE__ */ x(F, { children: [
3674
- /* @__PURE__ */ x(f, { style: [l.editor, l.disabled], children: [
3675
- /* @__PURE__ */ n(f, { style: l.toolbar, children: /* @__PURE__ */ n(u, { style: { fontSize: 13, color: "#9ca3af" }, children: "Markdown Editor (Disabled)" }) }),
3676
- /* @__PURE__ */ n(f, { style: [l.preview, { opacity: 0.5, minHeight: 200 }], children: /* @__PURE__ */ n(u, { style: { fontFamily: "monospace", fontSize: 14 }, children: b || "—" }) })
3682
+ const n = T().markdownEditor, [i, h] = I("edit"), b = e.options.readOnly ?? a, c = e.options.readOnlyStyle ?? s;
3683
+ if (b) {
3684
+ const p = t.getValues(e.key) ?? "";
3685
+ return c === "disabled" ? /* @__PURE__ */ S(O, { children: [
3686
+ /* @__PURE__ */ S(y, { style: [n.editor, n.disabled], children: [
3687
+ /* @__PURE__ */ l(y, { style: n.toolbar, children: /* @__PURE__ */ l(u, { style: { fontSize: 13, color: "#9ca3af" }, children: "Markdown Editor (Disabled)" }) }),
3688
+ /* @__PURE__ */ l(y, { style: [n.preview, { opacity: 0.5, minHeight: 200 }], children: /* @__PURE__ */ l(u, { style: { fontFamily: "monospace", fontSize: 14 }, children: p || "—" }) })
3677
3689
  ] }),
3678
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
3679
- ] }) : /* @__PURE__ */ x(F, { children: [
3680
- /* @__PURE__ */ n(f, { style: l.readOnlyValue, children: N ? /* @__PURE__ */ n(N, { children: b || "—" }) : /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: b || "—" }) }),
3681
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
3690
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
3691
+ ] }) : /* @__PURE__ */ S(O, { children: [
3692
+ /* @__PURE__ */ l(y, { style: n.readOnlyValue, children: L ? /* @__PURE__ */ l(L, { children: p || "—" }) : /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: p || "—" }) }),
3693
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
3682
3694
  ] });
3683
3695
  }
3684
- return /* @__PURE__ */ n(
3696
+ return /* @__PURE__ */ l(
3685
3697
  z,
3686
3698
  {
3687
3699
  control: t.control,
@@ -3691,95 +3703,95 @@ function xt({
3691
3703
  required: e.options.required,
3692
3704
  maxLength: e.options.maxLength ? { value: e.options.maxLength, message: `Content must be less than ${e.options.maxLength} characters` } : void 0
3693
3705
  },
3694
- render: ({ field: { onChange: b, value: d } }) => /* @__PURE__ */ x(f, { style: l.wrapper, children: [
3695
- /* @__PURE__ */ x(f, { style: [l.editor, o && l.error, e.options.disabled && l.disabled], children: [
3696
- /* @__PURE__ */ x(f, { style: l.toggleContainer, children: [
3697
- /* @__PURE__ */ n(
3698
- H,
3706
+ render: ({ field: { onChange: p, value: d } }) => /* @__PURE__ */ S(y, { style: n.wrapper, children: [
3707
+ /* @__PURE__ */ S(y, { style: [n.editor, o && n.error, e.options.disabled && n.disabled], children: [
3708
+ /* @__PURE__ */ S(y, { style: n.toggleContainer, children: [
3709
+ /* @__PURE__ */ l(
3710
+ R,
3699
3711
  {
3700
- onPress: () => p("edit"),
3701
- style: [l.toggleButton, a === "edit" && l.toggleButtonActive],
3702
- children: /* @__PURE__ */ n(u, { style: [l.toggleButtonText, a === "edit" && l.toggleButtonTextActive], children: "Edit" })
3712
+ onPress: () => h("edit"),
3713
+ style: [n.toggleButton, i === "edit" && n.toggleButtonActive],
3714
+ children: /* @__PURE__ */ l(u, { style: [n.toggleButtonText, i === "edit" && n.toggleButtonTextActive], children: "Edit" })
3703
3715
  }
3704
3716
  ),
3705
- /* @__PURE__ */ n(
3706
- H,
3717
+ /* @__PURE__ */ l(
3718
+ R,
3707
3719
  {
3708
- onPress: () => p("preview"),
3709
- style: [l.toggleButton, a === "preview" && l.toggleButtonActive],
3710
- children: /* @__PURE__ */ n(u, { style: [l.toggleButtonText, a === "preview" && l.toggleButtonTextActive], children: "Preview" })
3720
+ onPress: () => h("preview"),
3721
+ style: [n.toggleButton, i === "preview" && n.toggleButtonActive],
3722
+ children: /* @__PURE__ */ l(u, { style: [n.toggleButtonText, i === "preview" && n.toggleButtonTextActive], children: "Preview" })
3711
3723
  }
3712
3724
  )
3713
3725
  ] }),
3714
- a === "edit" && /* @__PURE__ */ n(f, { style: l.toolbar, children: St.map((y) => /* @__PURE__ */ n(
3715
- H,
3726
+ i === "edit" && /* @__PURE__ */ l(y, { style: n.toolbar, children: Vt.map((f) => /* @__PURE__ */ l(
3727
+ R,
3716
3728
  {
3717
3729
  onPress: () => {
3718
- y.wrap ? b(`${d || ""}${y.syntax}text${y.syntax}`) : b(`${d || ""}${y.syntax}`);
3730
+ f.wrap ? p(`${d || ""}${f.syntax}text${f.syntax}`) : p(`${d || ""}${f.syntax}`);
3719
3731
  },
3720
- style: l.toolbarButton,
3721
- accessibilityLabel: y.title,
3722
- children: /* @__PURE__ */ n(u, { style: l.toolbarButtonText, children: y.label })
3732
+ style: n.toolbarButton,
3733
+ accessibilityLabel: f.title,
3734
+ children: /* @__PURE__ */ l(u, { style: n.toolbarButtonText, children: f.label })
3723
3735
  },
3724
- y.label
3736
+ f.label
3725
3737
  )) }),
3726
- a === "edit" ? /* @__PURE__ */ n(
3727
- D,
3738
+ i === "edit" ? /* @__PURE__ */ l(
3739
+ P,
3728
3740
  {
3729
3741
  multiline: !0,
3730
3742
  value: d ?? "",
3731
- onChangeText: (y) => {
3732
- e.options.maxLength && y.length > e.options.maxLength || b(y);
3743
+ onChangeText: (f) => {
3744
+ e.options.maxLength && f.length > e.options.maxLength || p(f);
3733
3745
  },
3734
3746
  placeholder: e.options.placeholder,
3735
3747
  placeholderTextColor: "#9ca3af",
3736
3748
  editable: !e.options.disabled,
3737
- style: [l.textInput, { minHeight: e.options.height ?? 200 }],
3749
+ style: [n.textInput, { minHeight: e.options.height ?? 200 }],
3738
3750
  accessibilityLabel: e.options.label
3739
3751
  }
3740
- ) : /* @__PURE__ */ n(Pe, { style: [l.preview, { minHeight: e.options.height ?? 200 }], children: N ? /* @__PURE__ */ n(N, { children: d || "" }) : /* @__PURE__ */ n(u, { style: { fontSize: 16, color: "#374151" }, children: d || "Nothing to preview" }) }),
3741
- e.options.maxLength && /* @__PURE__ */ x(u, { style: { fontSize: 13, color: "#6b7280", textAlign: "right", padding: 8 }, children: [
3752
+ ) : /* @__PURE__ */ l(De, { style: [n.preview, { minHeight: e.options.height ?? 200 }], children: L ? /* @__PURE__ */ l(L, { children: d || "" }) : /* @__PURE__ */ l(u, { style: { fontSize: 16, color: "#374151" }, children: d || "Nothing to preview" }) }),
3753
+ e.options.maxLength && /* @__PURE__ */ S(u, { style: { fontSize: 13, color: "#6b7280", textAlign: "right", padding: 8 }, children: [
3742
3754
  (d ?? "").length,
3743
3755
  "/",
3744
3756
  e.options.maxLength
3745
3757
  ] })
3746
3758
  ] }),
3747
- e.options.helpText && /* @__PURE__ */ n(u, { style: l.helpText, children: e.options.helpText })
3759
+ e.options.helpText && /* @__PURE__ */ l(u, { style: n.helpText, children: e.options.helpText })
3748
3760
  ] })
3749
3761
  }
3750
3762
  );
3751
3763
  }
3752
- function Ct({
3764
+ function Pt({
3753
3765
  field: t
3754
3766
  }) {
3755
- const e = v().contentField;
3756
- return /* @__PURE__ */ n(f, { style: e.wrapper, children: t.options.content });
3767
+ const e = T().contentField;
3768
+ return /* @__PURE__ */ l(y, { style: e.wrapper, children: t.options.content });
3757
3769
  }
3758
- function kt({
3770
+ function Dt({
3759
3771
  fieldKey: t,
3760
3772
  label: e,
3761
3773
  required: o,
3762
- unstyled: i,
3774
+ unstyled: a,
3763
3775
  containerStyle: s,
3764
- labelStyle: l,
3765
- requiredIndicatorStyle: a,
3766
- containerClassName: p,
3767
- labelClassName: h,
3776
+ labelStyle: n,
3777
+ requiredIndicatorStyle: i,
3778
+ containerClassName: h,
3779
+ labelClassName: b,
3768
3780
  requiredIndicatorClassName: c
3769
3781
  }) {
3770
- const b = v();
3771
- return /* @__PURE__ */ x(
3782
+ const p = T();
3783
+ return /* @__PURE__ */ S(
3772
3784
  u,
3773
3785
  {
3774
3786
  nativeID: `${t}-label`,
3775
- style: [!i && b.label.base, l],
3776
- ...h ? { className: h } : {},
3787
+ style: [!a && p.label.base, n],
3788
+ ...b ? { className: b } : {},
3777
3789
  children: [
3778
3790
  e,
3779
- o && /* @__PURE__ */ n(
3791
+ o && /* @__PURE__ */ l(
3780
3792
  u,
3781
3793
  {
3782
- style: [!i && b.label.requiredIndicator, a],
3794
+ style: [!a && p.label.requiredIndicator, i],
3783
3795
  ...c ? { className: c } : {},
3784
3796
  children: " *"
3785
3797
  }
@@ -3788,215 +3800,191 @@ function kt({
3788
3800
  }
3789
3801
  );
3790
3802
  }
3791
- function vt(t, e, o, i) {
3803
+ function zt(t, e, o, a) {
3792
3804
  const s = !!t.formState.errors[e.key];
3793
3805
  switch (e.type) {
3794
- case C.Text:
3795
- return /* @__PURE__ */ n(Ne, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3796
- case C.TextArea:
3797
- return /* @__PURE__ */ n($e, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3798
- case C.MarkdownEditor:
3799
- return /* @__PURE__ */ n(xt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3800
- case C.Email:
3801
- return /* @__PURE__ */ n(Ue, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3802
- case C.Password:
3803
- return /* @__PURE__ */ n(Ke, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3804
- case C.Url:
3805
- return /* @__PURE__ */ n(Ge, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3806
- case C.Phone:
3807
- return /* @__PURE__ */ n(Ye, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3808
- case C.Number:
3809
- return /* @__PURE__ */ n(Ze, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3810
- case C.Currency:
3811
- return /* @__PURE__ */ n(_e, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3812
- case C.Select:
3813
- return /* @__PURE__ */ n(xe, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3814
- case C.EnumSelect:
3815
- return /* @__PURE__ */ n(ot, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3816
- case C.MultiSelect:
3817
- return /* @__PURE__ */ n(it, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3818
- case C.Checkbox:
3819
- return /* @__PURE__ */ n(
3820
- Xe,
3806
+ case x.Text:
3807
+ return /* @__PURE__ */ l(_e, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3808
+ case x.TextArea:
3809
+ return /* @__PURE__ */ l(Je, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3810
+ case x.MarkdownEditor:
3811
+ return /* @__PURE__ */ l(Ft, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3812
+ case x.Email:
3813
+ return /* @__PURE__ */ l(Xe, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3814
+ case x.Password:
3815
+ return /* @__PURE__ */ l(Qe, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3816
+ case x.Url:
3817
+ return /* @__PURE__ */ l(et, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3818
+ case x.Phone:
3819
+ return /* @__PURE__ */ l(tt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3820
+ case x.Number:
3821
+ return /* @__PURE__ */ l(rt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3822
+ case x.Currency:
3823
+ return /* @__PURE__ */ l(nt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3824
+ case x.Select:
3825
+ return /* @__PURE__ */ l(xe, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3826
+ case x.EnumSelect:
3827
+ return /* @__PURE__ */ l(pt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3828
+ case x.MultiSelect:
3829
+ return /* @__PURE__ */ l(yt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3830
+ case x.Checkbox:
3831
+ return /* @__PURE__ */ l(
3832
+ ot,
3821
3833
  {
3822
3834
  form: t,
3823
3835
  field: e,
3824
3836
  hasError: s,
3825
- errorMessage: s ? t.formState.errors[e.key]?.message ?? X : void 0,
3837
+ errorMessage: s ? t.formState.errors[e.key]?.message ?? J : void 0,
3826
3838
  formReadOnly: o,
3827
- formReadOnlyStyle: i
3839
+ formReadOnlyStyle: a
3828
3840
  }
3829
3841
  );
3830
- case C.Switch:
3831
- return /* @__PURE__ */ n(Qe, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3832
- case C.Button:
3833
- return /* @__PURE__ */ n(tt, { field: e, form: t, hasError: s });
3834
- case C.DatePicker:
3835
- return /* @__PURE__ */ n(rt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3836
- case C.DateTimePicker:
3837
- return /* @__PURE__ */ n(lt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3838
- case C.TimePicker:
3839
- return /* @__PURE__ */ n(nt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3840
- case C.Radio:
3841
- return /* @__PURE__ */ n(st, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3842
- case C.CheckboxGroup:
3843
- return /* @__PURE__ */ n(ut, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3844
- case C.SearchSelect:
3845
- return /* @__PURE__ */ n(pt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3846
- case C.SearchSelectApollo:
3847
- return /* @__PURE__ */ n(bt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3848
- case C.SearchSelectMulti:
3849
- return /* @__PURE__ */ n(ft, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3850
- case C.SearchSelectMultiApollo:
3851
- return /* @__PURE__ */ n(gt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3852
- case C.Content:
3853
- return /* @__PURE__ */ n(Ct, { field: e });
3854
- case C.Custom:
3855
- return /* @__PURE__ */ n(ve, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3856
- case C.CustomCheckbox:
3857
- return /* @__PURE__ */ n(mt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: i });
3842
+ case x.Switch:
3843
+ return /* @__PURE__ */ l(at, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3844
+ case x.Button:
3845
+ return /* @__PURE__ */ l(st, { field: e, form: t, hasError: s });
3846
+ case x.DatePicker:
3847
+ return /* @__PURE__ */ l(dt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3848
+ case x.DateTimePicker:
3849
+ return /* @__PURE__ */ l(ct, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3850
+ case x.TimePicker:
3851
+ return /* @__PURE__ */ l(ut, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3852
+ case x.Radio:
3853
+ return /* @__PURE__ */ l(ft, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3854
+ case x.CheckboxGroup:
3855
+ return /* @__PURE__ */ l(St, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3856
+ case x.SearchSelect:
3857
+ return /* @__PURE__ */ l(xt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3858
+ case x.SearchSelectApollo:
3859
+ return /* @__PURE__ */ l(kt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3860
+ case x.SearchSelectMulti:
3861
+ return /* @__PURE__ */ l(Tt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3862
+ case x.SearchSelectMultiApollo:
3863
+ return /* @__PURE__ */ l(wt, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3864
+ case x.Content:
3865
+ return /* @__PURE__ */ l(Pt, { field: e });
3866
+ case x.Custom:
3867
+ return /* @__PURE__ */ l(ve, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3868
+ case x.CustomCheckbox:
3869
+ return /* @__PURE__ */ l(Ot, { form: t, field: e, hasError: s, formReadOnly: o, formReadOnlyStyle: a });
3858
3870
  default:
3859
3871
  return null;
3860
3872
  }
3861
3873
  }
3862
- function Tt({
3874
+ function It({
3863
3875
  field: t,
3864
3876
  formReadOnly: e = !1,
3865
3877
  formReadOnlyStyle: o = "value",
3866
- style: i,
3878
+ style: a,
3867
3879
  className: s
3868
3880
  }) {
3869
- const l = ze(), { labelDisplay: a } = Ie(), p = v(), h = l.watch(), c = W(() => {
3870
- const { showWhen: P, requiredWhen: M, disabledWhen: te } = t.options;
3881
+ const n = Ie(), { labelDisplay: i } = Re(), h = T(), b = n.watch(), c = W(() => {
3882
+ const { showWhen: B, requiredWhen: N, disabledWhen: ae } = t.options;
3871
3883
  try {
3872
- const j = P ? P(h) : !0, Te = M ? M(h) : !1, we = te ? te(h) : !1;
3873
- return { isVisible: j, isDynamicallyRequired: Te, isDynamicallyDisabled: we };
3874
- } catch (j) {
3875
- return console.warn(`Error evaluating conditional logic for field ${t.key}:`, j), { isVisible: !0, isDynamicallyRequired: !1, isDynamicallyDisabled: !1 };
3876
- }
3877
- }, [h, t.options, t.key]), b = Oe(void 0);
3878
- if (E(() => {
3879
- const P = t.options.required || c.isDynamicallyRequired;
3880
- if (b.current !== P) {
3881
- b.current = P;
3884
+ const ee = B ? B(b) : !0, Te = N ? N(b) : !1, we = ae ? ae(b) : !1;
3885
+ return { isVisible: ee, isDynamicallyRequired: Te, isDynamicallyDisabled: we };
3886
+ } catch (ee) {
3887
+ return console.warn(`Error evaluating conditional logic for field ${t.key}:`, ee), { isVisible: !0, isDynamicallyRequired: !1, isDynamicallyDisabled: !1 };
3888
+ }
3889
+ }, [b, t.options, t.key]), p = Ve(void 0);
3890
+ if (q(() => {
3891
+ const B = t.options.required || c.isDynamicallyRequired;
3892
+ if (p.current !== B) {
3893
+ p.current = B;
3882
3894
  try {
3883
- l.register(t.key, {
3884
- required: P ? X : !1
3895
+ n.register(t.key, {
3896
+ required: B ? J : !1
3885
3897
  });
3886
- } catch (M) {
3887
- console.warn(`Error updating field registration for ${t.key}:`, M);
3898
+ } catch (N) {
3899
+ console.warn(`Error updating field registration for ${t.key}:`, N);
3888
3900
  }
3889
3901
  }
3890
- }, [c.isDynamicallyRequired, t.options.required, t.key, l]), !c.isVisible)
3902
+ }, [c.isDynamicallyRequired, t.options.required, t.key, n]), !c.isVisible)
3891
3903
  return null;
3892
- const d = l.formState.errors[t.key], y = d?.message ?? (d ? X : null), S = !!t.options.label;
3893
- let m = !1;
3894
- if (S)
3895
- switch (a) {
3896
- case "all":
3897
- m = !0;
3898
- break;
3899
- case "none":
3900
- m = !1;
3901
- break;
3902
- case "default":
3903
- default:
3904
- m = t.type !== C.Checkbox;
3905
- break;
3906
- }
3907
- const g = t.options.required || c.isDynamicallyRequired, k = t.options.disabled || c.isDynamicallyDisabled, T = {
3904
+ const d = n.formState.errors[t.key], f = d?.message ?? (d ? J : null), g = !!t.options.label;
3905
+ let k;
3906
+ g ? i === "all" ? k = !0 : i === "none" ? k = !1 : k = t.type !== x.Checkbox : k = !1;
3907
+ const m = t.options.required || c.isDynamicallyRequired, C = t.options.disabled || c.isDynamicallyDisabled, v = {
3908
3908
  ...t,
3909
3909
  options: {
3910
3910
  ...t.options,
3911
- disabled: k,
3912
- required: g
3913
- }
3914
- }, I = vt(l, T, e, o), O = m && /* @__PURE__ */ n(kt, { fieldKey: t.key, label: t.options.label ?? "", required: g }), R = (t.options.layout || "vertical") === "horizontal" ? /* @__PURE__ */ x(f, { style: { flexDirection: "row", alignItems: "center", gap: 12 }, children: [
3915
- O,
3916
- /* @__PURE__ */ x(f, { style: { flex: 1 }, children: [
3917
- I,
3918
- d && t.type !== C.Checkbox && /* @__PURE__ */ n(u, { style: p.global.errorText, children: y })
3911
+ disabled: C,
3912
+ required: m
3913
+ }
3914
+ }, V = zt(n, v, e, o), F = k && /* @__PURE__ */ l(Dt, { fieldKey: t.key, label: t.options.label ?? "", required: m }), A = (t.options.layout || "vertical") === "horizontal" ? /* @__PURE__ */ S(y, { style: { flexDirection: "row", alignItems: "center", gap: 12 }, children: [
3915
+ F,
3916
+ /* @__PURE__ */ S(y, { style: { flex: 1 }, children: [
3917
+ V,
3918
+ d && t.type !== x.Checkbox && /* @__PURE__ */ l(u, { style: h.global.errorText, children: f })
3919
3919
  ] })
3920
- ] }) : /* @__PURE__ */ x(F, { children: [
3921
- O,
3922
- I,
3923
- d && t.type !== C.Checkbox && /* @__PURE__ */ n(u, { style: p.global.errorText, children: y })
3920
+ ] }) : /* @__PURE__ */ S(O, { children: [
3921
+ F,
3922
+ V,
3923
+ d && t.type !== x.Checkbox && /* @__PURE__ */ l(u, { style: h.global.errorText, children: f })
3924
3924
  ] });
3925
- return t.options.customWrapper ? t.options.customWrapper(R) : /* @__PURE__ */ n(
3926
- f,
3925
+ return t.options.customWrapper ? t.options.customWrapper(A) : /* @__PURE__ */ l(
3926
+ y,
3927
3927
  {
3928
- style: [{ gap: 4 }, i],
3928
+ style: [{ gap: 4 }, a],
3929
3929
  ...s ? { className: s } : {},
3930
- children: R
3930
+ children: A
3931
3931
  }
3932
3932
  );
3933
3933
  }
3934
- function Gt({
3934
+ function rr({
3935
3935
  id: t,
3936
3936
  fields: e,
3937
3937
  children: o,
3938
- submit: i,
3938
+ submit: a,
3939
3939
  defaultValues: s,
3940
- style: l,
3941
- className: a,
3942
- readOnly: p = !1,
3943
- readOnlyStyle: h = "value",
3940
+ style: n,
3941
+ className: i,
3942
+ readOnly: h = !1,
3943
+ readOnlyStyle: b = "value",
3944
3944
  nativeTheme: c = {},
3945
- labelDisplay: b = "default",
3945
+ labelDisplay: p = "default",
3946
3946
  schema: d,
3947
- validationGroup: y,
3948
- validationGroups: S
3947
+ validationGroup: f,
3948
+ validationGroups: g
3949
3949
  }) {
3950
- const m = W(() => {
3951
- if (d || e?.some((V) => {
3952
- if (V?.type === C.Button) return !1;
3953
- const R = V?.options;
3954
- return R?.schema || R?.validateWithForm || R?.validate;
3950
+ const k = W(() => {
3951
+ if (d || e?.some((D) => {
3952
+ if (D?.type === x.Button) return !1;
3953
+ const A = D?.options;
3954
+ return A?.schema || A?.validateWithForm || A?.validate;
3955
3955
  }))
3956
- return Ae(
3956
+ return Ne(
3957
3957
  d,
3958
- e?.filter((V) => V !== null).filter((V) => V.type !== C.Button).map((V) => ({
3959
- key: V.key,
3960
- options: V.options
3958
+ e?.filter((D) => D !== null).filter((D) => D.type !== x.Button).map((D) => ({
3959
+ key: D.key,
3960
+ options: D.options
3961
3961
  }))
3962
3962
  );
3963
- }, [d, e, y, S]), g = De({
3963
+ }, [d, e, f, g]), m = ze({
3964
3964
  defaultValues: s,
3965
- resolver: m,
3965
+ resolver: k,
3966
3966
  mode: "onBlur",
3967
3967
  reValidateMode: "onChange"
3968
3968
  });
3969
- E(() => {
3970
- s && typeof s != "function" && g.reset(s);
3971
- }, [s, g]);
3972
- const k = W(() => he.parse({}), []), T = W(() => Ee(c), [c]), I = { labelDisplay: b };
3973
- return W(() => (O) => {
3974
- const V = {};
3975
- for (const [P, M] of Object.entries(O))
3976
- e?.some(
3977
- (j) => j && j.key === P && j.type === C.Button
3978
- ) || (V[P] = M);
3979
- if (!e)
3980
- return i(V);
3981
- const R = { ...V };
3982
- return e.filter((P) => P !== null).filter((P) => P.type !== C.Button).forEach((P) => {
3983
- P.options.submitTransform && P.key in R && (R[P.key] = P.options.submitTransform(R[P.key]));
3984
- }), i(R);
3985
- }, [e, i]), /* @__PURE__ */ n(ye.Provider, { value: I, children: /* @__PURE__ */ n(fe.Provider, { value: k, children: /* @__PURE__ */ n(me.Provider, { value: T, children: /* @__PURE__ */ n(be.Provider, { value: g, children: /* @__PURE__ */ x(
3986
- f,
3969
+ q(() => {
3970
+ s && typeof s != "function" && m.reset(s);
3971
+ }, [s, m]);
3972
+ const C = W(() => he.parse({}), []), v = W(() => Ze(c), [c]), V = W(() => ({ labelDisplay: p }), [p]);
3973
+ return /* @__PURE__ */ l(ye.Provider, { value: V, children: /* @__PURE__ */ l(fe.Provider, { value: C, children: /* @__PURE__ */ l(me.Provider, { value: v, children: /* @__PURE__ */ l(be.Provider, { value: m, children: /* @__PURE__ */ S(
3974
+ y,
3987
3975
  {
3988
3976
  nativeID: t,
3989
- style: [{ gap: 16 }, l],
3990
- ...a ? { className: a } : {},
3977
+ style: [{ gap: 16 }, n],
3978
+ ...i ? { className: i } : {},
3991
3979
  children: [
3992
- e?.filter((O) => O !== null).map((O) => /* @__PURE__ */ n(
3993
- Tt,
3980
+ e?.filter((F) => F !== null).map((F) => /* @__PURE__ */ l(
3981
+ It,
3994
3982
  {
3995
- field: O,
3996
- formReadOnly: p,
3997
- formReadOnlyStyle: h
3983
+ field: F,
3984
+ formReadOnly: h,
3985
+ formReadOnlyStyle: b
3998
3986
  },
3999
- O.key
3987
+ F.key
4000
3988
  )),
4001
3989
  o
4002
3990
  ]
@@ -4004,74 +3992,74 @@ function Gt({
4004
3992
  ) }) }) }) });
4005
3993
  }
4006
3994
  export {
4007
- et as Button,
4008
- tt as ButtonField,
4009
- A as CURRENCY_CONFIGS,
4010
- Xe as CheckboxField,
4011
- ut as CheckboxGroupField,
4012
- Ct as ContentField,
4013
- mt as CustomCheckboxField,
3995
+ it as Button,
3996
+ st as ButtonField,
3997
+ H as CURRENCY_CONFIGS,
3998
+ ot as CheckboxField,
3999
+ St as CheckboxGroupField,
4000
+ Pt as ContentField,
4001
+ Ot as CustomCheckboxField,
4014
4002
  ve as CustomField,
4015
- X as DEFAULT_REQUIRED_ERROR_MESSAGE,
4016
- rt as DatePickerField,
4017
- lt as DateTimePickerField,
4018
- Ue as EmailField,
4003
+ J as DEFAULT_REQUIRED_ERROR_MESSAGE,
4004
+ dt as DatePickerField,
4005
+ ct as DateTimePickerField,
4006
+ Xe as EmailField,
4019
4007
  ye as FormConfigContext,
4020
4008
  be as FormContext,
4021
- It as FormFieldClass,
4022
- C as FormFieldType,
4023
- kt as FormLabel,
4009
+ qt as FormFieldClass,
4010
+ x as FormFieldType,
4011
+ Dt as FormLabel,
4024
4012
  he as FormThemeSchema,
4025
- xt as MarkdownEditor,
4026
- _e as MoneyField,
4027
- Gt as NativeForm,
4013
+ Ft as MarkdownEditor,
4014
+ nt as MoneyField,
4015
+ rr as NativeForm,
4028
4016
  me as NativeThemeContext,
4029
- Ze as NumberField,
4030
- Ke as PasswordField,
4031
- Ye as PhoneField,
4032
- st as RadioField,
4033
- Tt as RenderFormField,
4017
+ rt as NumberField,
4018
+ Qe as PasswordField,
4019
+ tt as PhoneField,
4020
+ ft as RadioField,
4021
+ It as RenderFormField,
4034
4022
  xe as SelectField,
4035
- ot as SelectFieldEnum,
4036
- it as SelectFieldMulti,
4037
- ft as SelectFieldMultiSearch,
4038
- gt as SelectFieldMultiSearchApollo,
4039
- pt as SelectFieldSearch,
4040
- bt as SelectFieldSearchApollo,
4041
- Qe as SwitchField,
4042
- $e as TextAreaField,
4043
- Ne as TextField,
4023
+ pt as SelectFieldEnum,
4024
+ yt as SelectFieldMulti,
4025
+ Tt as SelectFieldMultiSearch,
4026
+ wt as SelectFieldMultiSearchApollo,
4027
+ xt as SelectFieldSearch,
4028
+ kt as SelectFieldSearchApollo,
4029
+ at as SwitchField,
4030
+ Je as TextAreaField,
4031
+ _e as TextField,
4044
4032
  fe as ThemeContext,
4045
- nt as TimePickerField,
4046
- Ge as UrlField,
4047
- Kt as apolloMultiSelectSubmitTransform,
4048
- $t as convertCurrency,
4049
- We as createFieldValidation,
4050
- Ee as createFinalNativeTheme,
4051
- Ae as createFormResolver,
4052
- $ as defaultNativeTheme,
4053
- q as formatCurrency,
4054
- Ut as formatCurrencyForDisplay,
4033
+ ut as TimePickerField,
4034
+ et as UrlField,
4035
+ tr as apolloMultiSelectSubmitTransform,
4036
+ Qt as convertCurrency,
4037
+ Le as createFieldValidation,
4038
+ Ze as createFinalNativeTheme,
4039
+ Ne as createFormResolver,
4040
+ E as defaultNativeTheme,
4041
+ M as formatCurrency,
4042
+ er as formatCurrencyForDisplay,
4055
4043
  re as formatDateFromDateTime,
4056
- le as formatDateTimeFromValue,
4057
- je as getCurrencyConfig,
4058
- Mt as getCurrencyOptions,
4059
- Et as getCurrencyStep,
4044
+ ne as formatDateTimeFromValue,
4045
+ Ee as getCurrencyConfig,
4046
+ Yt as getCurrencyOptions,
4047
+ Jt as getCurrencyStep,
4060
4048
  ge as getDateFromDateTime,
4061
- Le as getDateTimeFromValue,
4062
- Wt as getFieldsInGroup,
4063
- qt as getPopularCurrencyOptions,
4064
- Ht as getValidationGroups,
4065
- Nt as isSupportedCurrency,
4049
+ Ge as getDateTimeFromValue,
4050
+ $t as getFieldsInGroup,
4051
+ Zt as getPopularCurrencyOptions,
4052
+ Et as getValidationGroups,
4053
+ Xt as isSupportedCurrency,
4066
4054
  ke as multiSelectSubmitTransform,
4067
- Lt as parseCurrency,
4068
- qe as resolveCurrencyConfig,
4069
- At as shouldValidateField,
4070
- jt as useDebounce,
4071
- ae as useFieldValidation,
4072
- Ie as useFormConfig,
4073
- ze as useFormContext,
4074
- Rt as useFormTheme,
4075
- v as useNativeTheme,
4076
- Bt as validateGroup
4055
+ _t as parseCurrency,
4056
+ Ue as resolveCurrencyConfig,
4057
+ Ut as shouldValidateField,
4058
+ Kt as useDebounce,
4059
+ Gt as useFieldValidation,
4060
+ Re as useFormConfig,
4061
+ Ie as useFormContext,
4062
+ Lt as useFormTheme,
4063
+ T as useNativeTheme,
4064
+ Nt as validateGroup
4077
4065
  };