@reformer/core 2.0.0-beta.5 → 2.0.0-beta.6

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/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { d as y, w as u, E, r as U } from "./behaviors-DzYL8kY_.js";
2
- import { i as Ee } from "./behaviors-DzYL8kY_.js";
3
- import { i as T, a as R, A as j, V as q, T as K } from "./validators-gXoHPdqM.js";
4
- import { g as be, c as Ve, d as we, v as Ae, b as ke } from "./validators-gXoHPdqM.js";
5
- import { V as H, B as W, c as I } from "./registry-helpers-BRxAr6nG.js";
6
- import { R as Fe, a as Oe, e as Pe, b as Te, g as Re, t as Ie } from "./registry-helpers-BRxAr6nG.js";
1
+ import { d as y, w as u, E, r as U } from "./behaviors-2HSqHPb4.js";
2
+ import { i as Ee } from "./behaviors-2HSqHPb4.js";
3
+ import { i as C, a as D, A as j, V as q, T as K } from "./validators-gXoHPdqM.js";
4
+ import { g as Se, c as we, d as Ae, v as Ve, b as ke } from "./validators-gXoHPdqM.js";
5
+ import { V as H, B as W, c as R } from "./registry-helpers-BRxAr6nG.js";
6
+ import { R as Oe, a as Fe, e as Pe, b as Ce, g as De, t as Re } from "./registry-helpers-BRxAr6nG.js";
7
7
  import { v4 as z } from "uuid";
8
- import B, { useRef as L, useCallback as S } from "react";
9
- class O {
8
+ import B, { useRef as L, useCallback as b } from "react";
9
+ class F {
10
10
  // ============================================================================
11
11
  // Protected состояние (для Template Method паттерна)
12
12
  // ============================================================================
@@ -106,8 +106,8 @@ class O {
106
106
  if (e.params !== void 0) {
107
107
  if (!i.params)
108
108
  return !1;
109
- for (const [s, a] of Object.entries(e.params))
110
- if (i.params[s] !== a)
109
+ for (const [r, s] of Object.entries(e.params))
110
+ if (i.params[r] !== s)
111
111
  return !1;
112
112
  }
113
113
  return !(e.predicate !== void 0 && !e.predicate(i));
@@ -451,8 +451,8 @@ class P {
451
451
  this.clear();
452
452
  }
453
453
  }
454
- var w = /* @__PURE__ */ ((r) => (r.THROW = "throw", r.LOG = "log", r.CONVERT = "convert", r))(w || {});
455
- class F {
454
+ var A = /* @__PURE__ */ ((a) => (a.THROW = "throw", a.LOG = "log", a.CONVERT = "convert", a))(A || {});
455
+ class O {
456
456
  /**
457
457
  * Обработать ошибку согласно заданной стратегии
458
458
  *
@@ -493,7 +493,7 @@ class F {
493
493
  * ```
494
494
  */
495
495
  static handle(e, t, i = "throw") {
496
- const s = this.extractMessage(e);
496
+ const r = this.extractMessage(e);
497
497
  switch (i) {
498
498
  case "throw":
499
499
  throw e;
@@ -502,7 +502,7 @@ class F {
502
502
  case "convert":
503
503
  return {
504
504
  code: "validator_error",
505
- message: s,
505
+ message: r,
506
506
  params: { field: t }
507
507
  };
508
508
  }
@@ -584,7 +584,7 @@ class F {
584
584
  return typeof e == "object" && e !== null && "code" in e && "message" in e && typeof e.code == "string" && typeof e.message == "string";
585
585
  }
586
586
  }
587
- class J extends O {
587
+ class J extends F {
588
588
  // ============================================================================
589
589
  // Приватные сигналы
590
590
  // ============================================================================
@@ -618,6 +618,7 @@ class J extends O {
618
618
  updateOn;
619
619
  initialValue;
620
620
  currentValidationId = 0;
621
+ currentAbortController;
621
622
  debounceMs;
622
623
  validateDebounceTimer;
623
624
  validateDebounceResolve;
@@ -644,12 +645,12 @@ class J extends O {
644
645
  setValue(e, t) {
645
646
  if (this._value.value = e, this._dirty.value = !0, t?.emitEvent === !1)
646
647
  return;
647
- const i = this.validators.length > 0 || this.asyncValidators.length > 0, s = this._errors.value.length > 0;
648
+ const i = this.validators.length > 0 || this.asyncValidators.length > 0, r = this._errors.value.length > 0;
648
649
  if (this.updateOn === "change") {
649
650
  this.validate();
650
651
  return;
651
652
  }
652
- s && i && this.validate();
653
+ r && i && this.validate();
653
654
  }
654
655
  patchValue(e) {
655
656
  this.setValue(e);
@@ -729,14 +730,14 @@ class J extends O {
729
730
  async validate(e) {
730
731
  const t = e?.debounce ?? this.debounceMs;
731
732
  return t > 0 && this.asyncValidators.length > 0 ? new Promise((i) => {
732
- const s = this.currentValidationId;
733
+ const r = this.currentValidationId;
733
734
  this.validateDebounceResolve && this.validateDebounceResolve(!1), this.validateDebounceTimer && clearTimeout(this.validateDebounceTimer), this.validateDebounceResolve = i, this.validateDebounceTimer = setTimeout(async () => {
734
- if (this.validateDebounceResolve = void 0, s !== this.currentValidationId) {
735
+ if (this.validateDebounceResolve = void 0, r !== this.currentValidationId) {
735
736
  i(!1);
736
737
  return;
737
738
  }
738
- const a = await this.validateImmediate();
739
- i(a);
739
+ const s = await this.validateImmediate();
740
+ i(s);
740
741
  }, t);
741
742
  }) : this.validateImmediate();
742
743
  }
@@ -744,47 +745,64 @@ class J extends O {
744
745
  * Немедленная валидация без debounce
745
746
  * @private
746
747
  * @remarks
747
- * Защищена от race conditions:
748
- * - Проверка validationId после синхронной валидации
749
- * - Проверка перед установкой pending
750
- * - Проверка после Promise.all
751
- * - Проверка перед обработкой async результатов
752
- * - Проверка перед очисткой errors
748
+ * Защищена от race conditions через AbortController:
749
+ * - Отменяет предыдущую валидацию при запуске новой
750
+ * - Передаёт AbortSignal в async валидаторы для отмены операций (например, fetch)
751
+ * - Проверяет signal.aborted в ключевых точках
753
752
  */
754
753
  async validateImmediate() {
755
- const e = ++this.currentValidationId, t = [];
754
+ this.currentAbortController?.abort();
755
+ const e = new AbortController();
756
+ this.currentAbortController = e;
757
+ const { signal: t } = e;
758
+ ++this.currentValidationId;
759
+ const i = [];
756
760
  for (const s of this.validators) {
757
- const a = s(this._value.value);
758
- a && t.push(a);
761
+ const n = s(this._value.value);
762
+ n && i.push(n);
759
763
  }
760
- if (e !== this.currentValidationId)
764
+ if (t.aborted)
761
765
  return !1;
762
- if (t.length > 0)
763
- return this._errors.value = t, this._status.value = "invalid", !1;
766
+ if (i.length > 0)
767
+ return this._errors.value = i, this._status.value = "invalid", !1;
764
768
  if (this.asyncValidators.length > 0) {
765
- if (e !== this.currentValidationId)
769
+ if (t.aborted)
766
770
  return !1;
767
771
  this._pending.value = !0, this._status.value = "pending";
768
- const s = await Promise.all(
769
- this.asyncValidators.map(async (o) => {
770
- try {
771
- return await o(this._value.value);
772
- } catch (n) {
773
- return F.handle(
774
- n,
775
- "FieldNode AsyncValidator",
776
- w.CONVERT
777
- );
778
- }
779
- })
780
- );
781
- if (e !== this.currentValidationId || (this._pending.value = !1, e !== this.currentValidationId))
782
- return !1;
783
- const a = s.filter(Boolean);
784
- if (a.length > 0)
785
- return this._errors.value = a, this._status.value = "invalid", !1;
772
+ try {
773
+ const s = await Promise.all(
774
+ this.asyncValidators.map(async (o) => {
775
+ if (t.aborted)
776
+ throw new DOMException("Validation aborted", "AbortError");
777
+ try {
778
+ const l = await o(this._value.value, { signal: t });
779
+ if (t.aborted)
780
+ throw new DOMException("Validation aborted", "AbortError");
781
+ return l;
782
+ } catch (l) {
783
+ if (l instanceof DOMException && l.name === "AbortError")
784
+ throw l;
785
+ return O.handle(
786
+ l,
787
+ "FieldNode AsyncValidator",
788
+ A.CONVERT
789
+ );
790
+ }
791
+ })
792
+ );
793
+ if (t.aborted)
794
+ return !1;
795
+ this._pending.value = !1;
796
+ const n = s.filter(Boolean);
797
+ if (n.length > 0)
798
+ return this._errors.value = n, this._status.value = "invalid", !1;
799
+ } catch (s) {
800
+ if (s instanceof DOMException && s.name === "AbortError")
801
+ return !1;
802
+ throw s;
803
+ }
786
804
  }
787
- return e !== this.currentValidationId ? !1 : ((this.validators.length > 0 || this.asyncValidators.length > 0) && (this._errors.value = [], this._status.value = "valid"), this._errors.value.length === 0);
805
+ return t.aborted ? !1 : ((this.validators.length > 0 || this.asyncValidators.length > 0) && (this._errors.value = [], this._status.value = "valid"), this._errors.value.length === 0);
788
806
  }
789
807
  setErrors(e) {
790
808
  this._errors.value = e, this._status.value = e.length > 0 ? "invalid" : "valid";
@@ -897,8 +915,8 @@ class J extends O {
897
915
  */
898
916
  watch(e) {
899
917
  const t = E(() => {
900
- const s = this.value.value;
901
- e(s);
918
+ const r = this.value.value;
919
+ e(r);
902
920
  }), i = `watch-${Date.now()}-${Math.random()}`;
903
921
  return this.disposers.add(i, t);
904
922
  }
@@ -926,15 +944,22 @@ class J extends O {
926
944
  */
927
945
  computeFrom(e, t) {
928
946
  const i = E(() => {
929
- const a = e.map((n) => n.value), o = t(...a);
930
- this.setValue(o, { emitEvent: !1 });
931
- }), s = `computeFrom-${Date.now()}-${Math.random()}`;
932
- return this.disposers.add(s, i);
947
+ const s = e.map((o) => o.value), n = t(...s);
948
+ this.setValue(n, { emitEvent: !1 });
949
+ }), r = `computeFrom-${Date.now()}-${Math.random()}`;
950
+ return this.disposers.add(r, i);
933
951
  }
934
952
  /**
935
953
  * Очистить все ресурсы и таймеры
936
954
  * Должен вызываться при unmount компонента
937
955
  *
956
+ * @remarks
957
+ * Освобождает все ресурсы:
958
+ * - Отписывает все subscriptions через SubscriptionManager
959
+ * - Очищает debounce таймер
960
+ * - Resolve'ит висячий debounce промис (предотвращает утечку памяти)
961
+ * - Отменяет текущую async валидацию через AbortController
962
+ *
938
963
  * @example
939
964
  * ```typescript
940
965
  * useEffect(() => {
@@ -945,7 +970,7 @@ class J extends O {
945
970
  * ```
946
971
  */
947
972
  dispose() {
948
- this.disposers.dispose(), this.validateDebounceTimer && (clearTimeout(this.validateDebounceTimer), this.validateDebounceTimer = void 0);
973
+ this.disposers.dispose(), this.validateDebounceTimer && (clearTimeout(this.validateDebounceTimer), this.validateDebounceTimer = void 0), this.validateDebounceResolve && (this.validateDebounceResolve(!1), this.validateDebounceResolve = void 0), this.currentAbortController && (this.currentAbortController.abort(), this.currentAbortController = void 0);
949
974
  }
950
975
  }
951
976
  class Y {
@@ -979,12 +1004,12 @@ class Y {
979
1004
  */
980
1005
  groupValidators(e) {
981
1006
  const t = /* @__PURE__ */ new Map(), i = [];
982
- for (const s of e)
983
- if (s.type === "tree")
984
- i.push(s);
1007
+ for (const r of e)
1008
+ if (r.type === "tree")
1009
+ i.push(r);
985
1010
  else {
986
- const a = t.get(s.fieldPath) || [];
987
- a.push(s), t.set(s.fieldPath, a);
1011
+ const s = t.get(r.fieldPath) || [];
1012
+ s.push(r), t.set(r.fieldPath, s);
988
1013
  }
989
1014
  return { validatorsByField: t, treeValidators: i };
990
1015
  }
@@ -1001,36 +1026,36 @@ class Y {
1001
1026
  */
1002
1027
  async applyFieldValidators(e) {
1003
1028
  for (const [t, i] of e) {
1004
- const s = this.form.getFieldByPath(t);
1005
- if (!s) {
1029
+ const r = this.form.getFieldByPath(t);
1030
+ if (!r) {
1006
1031
  console.warn(`Field ${t} not found in GroupNode`);
1007
1032
  continue;
1008
1033
  }
1009
- if (!T(s) && !R(s)) {
1034
+ if (!C(r) && !D(r)) {
1010
1035
  process.env.NODE_ENV !== "production" && console.warn(`Validation can only run on FieldNode or ArrayNode, skipping ${t}`);
1011
1036
  continue;
1012
1037
  }
1013
- const a = [];
1014
- let o;
1015
- if (R(s)) {
1016
- const n = s.getValue();
1017
- o = new j(this.form, t, n);
1038
+ const s = [];
1039
+ let n;
1040
+ if (D(r)) {
1041
+ const o = r.getValue();
1042
+ n = new j(this.form, t, o);
1018
1043
  } else
1019
- o = new q(this.form, t, s);
1020
- for (const n of i)
1021
- if (!(n.condition && !this.checkCondition(n.condition)))
1044
+ n = new q(this.form, t, r);
1045
+ for (const o of i)
1046
+ if (!(o.condition && !this.checkCondition(o.condition)))
1022
1047
  try {
1023
1048
  let l = null;
1024
- const d = o.value(), m = n.validator;
1025
- n.type === "sync" ? l = m(d, o) : n.type === "async" && (l = await m(d, o)), l && a.push(l);
1049
+ const d = n.value(), m = o.validator;
1050
+ o.type === "sync" ? l = m(d, n) : o.type === "async" && (l = await m(d, n)), l && s.push(l);
1026
1051
  } catch (l) {
1027
- F.handle(
1052
+ O.handle(
1028
1053
  l,
1029
1054
  `ValidationApplicator: validator for ${t}`,
1030
- w.LOG
1055
+ A.LOG
1031
1056
  );
1032
1057
  }
1033
- a.length > 0 ? s.setErrors(a) : s.errors.value.length > 0 && !s.errors.value.some((n) => n.code !== "contextual") && s.clearErrors();
1058
+ s.length > 0 ? r.setErrors(s) : r.clearErrors();
1034
1059
  }
1035
1060
  }
1036
1061
  /**
@@ -1048,19 +1073,19 @@ class Y {
1048
1073
  try {
1049
1074
  if (t.type !== "tree")
1050
1075
  continue;
1051
- const s = t.validator(i);
1052
- if (s && t.options && "targetField" in t.options) {
1053
- const a = t.options.targetField;
1054
- if (a) {
1055
- const o = this.form.getFieldByPath(String(a));
1056
- if (o && T(o)) {
1057
- const n = o.errors.value;
1058
- o.setErrors([...n, s]);
1076
+ const r = t.validator(i);
1077
+ if (r && t.options && "targetField" in t.options) {
1078
+ const s = t.options.targetField;
1079
+ if (s) {
1080
+ const n = this.form.getFieldByPath(String(s));
1081
+ if (n && C(n)) {
1082
+ const o = n.errors.value;
1083
+ n.setErrors([...o, r]);
1059
1084
  }
1060
1085
  }
1061
1086
  }
1062
- } catch (s) {
1063
- F.handle(s, "ValidationApplicator: tree validator", w.LOG);
1087
+ } catch (r) {
1088
+ O.handle(r, "ValidationApplicator: tree validator", A.LOG);
1064
1089
  }
1065
1090
  }
1066
1091
  }
@@ -1108,10 +1133,10 @@ class Q {
1108
1133
  */
1109
1134
  parsePath(e) {
1110
1135
  const t = [];
1111
- let i = "", s = !1;
1112
- for (let a = 0; a < e.length; a++) {
1113
- const o = e[a];
1114
- o === "[" ? (s = !0, i += o) : o === "]" ? (s = !1, i += o) : o === "." && !s ? i && (this.addSegment(t, i), i = "") : i += o;
1136
+ let i = "", r = !1;
1137
+ for (let s = 0; s < e.length; s++) {
1138
+ const n = e[s];
1139
+ n === "[" ? (r = !0, i += n) : n === "]" ? (r = !1, i += n) : n === "." && !r ? i && (this.addSegment(t, i), i = "") : i += n;
1115
1140
  }
1116
1141
  return i && this.addSegment(t, i), t;
1117
1142
  }
@@ -1159,15 +1184,15 @@ class Q {
1159
1184
  */
1160
1185
  getValueByPath(e, t) {
1161
1186
  const i = this.parsePath(t);
1162
- let s = e;
1163
- for (const a of i) {
1164
- if (s == null) return;
1165
- if (s = s[a.key], a.index !== void 0) {
1166
- if (!Array.isArray(s)) return;
1167
- s = s[a.index];
1187
+ let r = e;
1188
+ for (const s of i) {
1189
+ if (r == null) return;
1190
+ if (r = r[s.key], s.index !== void 0) {
1191
+ if (!Array.isArray(r)) return;
1192
+ r = r[s.index];
1168
1193
  }
1169
1194
  }
1170
- return s;
1195
+ return r;
1171
1196
  }
1172
1197
  /**
1173
1198
  * Устанавливает значение по пути в объекте (мутирует объект)
@@ -1197,30 +1222,30 @@ class Q {
1197
1222
  * ```
1198
1223
  */
1199
1224
  setValueByPath(e, t, i) {
1200
- const s = this.parsePath(t);
1201
- if (s.length === 0)
1225
+ const r = this.parsePath(t);
1226
+ if (r.length === 0)
1202
1227
  throw new Error("Cannot set value: empty path");
1203
- let a = e;
1204
- for (let n = 0; n < s.length - 1; n++) {
1205
- const l = s[n];
1206
- let d = a[l.key];
1228
+ let s = e;
1229
+ for (let o = 0; o < r.length - 1; o++) {
1230
+ const l = r[o];
1231
+ let d = s[l.key];
1207
1232
  if (l.index !== void 0) {
1208
1233
  if (!Array.isArray(d))
1209
1234
  throw new Error(`Expected array at path segment: ${l.key}, but got ${typeof d}`);
1210
- a = d[l.index];
1235
+ s = d[l.index];
1211
1236
  } else
1212
- d == null && (a[l.key] = {}, d = a[l.key]), a = d;
1237
+ d == null && (s[l.key] = {}, d = s[l.key]), s = d;
1213
1238
  }
1214
- const o = s[s.length - 1];
1215
- if (o.index !== void 0) {
1216
- const n = a[o.key];
1217
- if (!Array.isArray(n))
1239
+ const n = r[r.length - 1];
1240
+ if (n.index !== void 0) {
1241
+ const o = s[n.key];
1242
+ if (!Array.isArray(o))
1218
1243
  throw new Error(
1219
- `Expected array at path segment: ${o.key}, but got ${typeof n}`
1244
+ `Expected array at path segment: ${n.key}, but got ${typeof o}`
1220
1245
  );
1221
- n[o.index] = i;
1246
+ o[n.index] = i;
1222
1247
  } else
1223
- a[o.key] = i;
1248
+ s[n.key] = i;
1224
1249
  }
1225
1250
  /**
1226
1251
  * Получить значение из FormNode по пути
@@ -1318,35 +1343,35 @@ class Q {
1318
1343
  */
1319
1344
  getNodeByPath(e, t) {
1320
1345
  const i = this.parsePath(t);
1321
- let s = e;
1322
- for (const a of i) {
1323
- if (s == null) return null;
1324
- const o = s;
1325
- if (o.fields && o.fields instanceof Map) {
1326
- if (s = o.fields.get(a.key), a.index === void 0) {
1327
- if (s == null) return null;
1346
+ let r = e;
1347
+ for (const s of i) {
1348
+ if (r == null) return null;
1349
+ const n = r;
1350
+ if (n.fields && n.fields instanceof Map) {
1351
+ if (r = n.fields.get(s.key), s.index === void 0) {
1352
+ if (r == null) return null;
1328
1353
  continue;
1329
1354
  }
1330
- } else if (a.index !== void 0 && o.items) {
1331
- const n = o.items.value || o.items;
1332
- if (!Array.isArray(n) || (s = n[a.index], s == null)) return null;
1355
+ } else if (s.index !== void 0 && n.items) {
1356
+ const o = n.items.value || n.items;
1357
+ if (!Array.isArray(o) || (r = o[s.index], r == null)) return null;
1333
1358
  continue;
1334
- } else if (a.index === void 0) {
1335
- if (s = o[a.key], s == null) return null;
1359
+ } else if (s.index === void 0) {
1360
+ if (r = n[s.key], r == null) return null;
1336
1361
  continue;
1337
1362
  }
1338
- if (s && a.index !== void 0 && s.items) {
1339
- const n = s.items.value || s.items;
1340
- if (!Array.isArray(n)) return null;
1341
- s = n[a.index];
1342
- } else if (s && a.index !== void 0 && !s.items)
1363
+ if (r && s.index !== void 0 && r.items) {
1364
+ const o = r.items.value || r.items;
1365
+ if (!Array.isArray(o)) return null;
1366
+ r = o[s.index];
1367
+ } else if (r && s.index !== void 0 && !r.items)
1343
1368
  return null;
1344
- if (s == null) return null;
1369
+ if (r == null) return null;
1345
1370
  }
1346
- return s;
1371
+ return r;
1347
1372
  }
1348
1373
  }
1349
- class b extends O {
1374
+ class S extends F {
1350
1375
  // ============================================================================
1351
1376
  // Приватные поля
1352
1377
  // ============================================================================
@@ -1407,30 +1432,30 @@ class b extends O {
1407
1432
  submitting;
1408
1433
  constructor(e) {
1409
1434
  super();
1410
- const t = "form" in e, i = t ? e.form : e, s = t ? e.behavior : void 0, a = t ? e.validation : void 0;
1411
- for (const [n, l] of Object.entries(i)) {
1435
+ const t = "form" in e, i = t ? e.form : e, r = t ? e.behavior : void 0, s = t ? e.validation : void 0;
1436
+ for (const [o, l] of Object.entries(i)) {
1412
1437
  const d = this.createNode(l);
1413
- this._fields.set(n, d);
1438
+ this._fields.set(o, d);
1414
1439
  }
1415
1440
  this.value = u(() => {
1416
- const n = {};
1441
+ const o = {};
1417
1442
  return this._fields.forEach((l, d) => {
1418
- n[d] = l.value.value;
1419
- }), n;
1420
- }), this.valid = u(() => this._formErrors.value.length > 0 ? !1 : Array.from(this._fields.values()).every((n) => n.valid.value)), this.invalid = u(() => !this.valid.value), this.pending = u(
1421
- () => Array.from(this._fields.values()).some((n) => n.pending.value)
1443
+ o[d] = l.value.value;
1444
+ }), o;
1445
+ }), this.valid = u(() => this._formErrors.value.length > 0 ? !1 : Array.from(this._fields.values()).every((o) => o.valid.value)), this.invalid = u(() => !this.valid.value), this.pending = u(
1446
+ () => Array.from(this._fields.values()).some((o) => o.pending.value)
1422
1447
  ), this.touched = u(
1423
- () => Array.from(this._fields.values()).some((n) => n.touched.value)
1448
+ () => Array.from(this._fields.values()).some((o) => o.touched.value)
1424
1449
  ), this.dirty = u(
1425
- () => Array.from(this._fields.values()).some((n) => n.dirty.value)
1450
+ () => Array.from(this._fields.values()).some((o) => o.dirty.value)
1426
1451
  ), this.errors = u(() => {
1427
- const n = [...this._formErrors.value];
1452
+ const o = [...this._formErrors.value];
1428
1453
  return this._fields.forEach((l) => {
1429
- n.push(...l.errors.value);
1430
- }), n;
1454
+ o.push(...l.errors.value);
1455
+ }), o;
1431
1456
  }), this.status = u(() => this._disabled.value ? "disabled" : this.pending.value ? "pending" : this.invalid.value ? "invalid" : "valid"), this.submitting = u(() => this._submitting.value);
1432
- const o = this.buildProxy();
1433
- return this._proxyInstance = o, s && this.applyBehaviorSchema(s), a && this.applyValidationSchema(a), o;
1457
+ const n = this.buildProxy();
1458
+ return this._proxyInstance = n, r && this.applyBehaviorSchema(r), s && this.applyValidationSchema(s), n;
1434
1459
  }
1435
1460
  // ============================================================================
1436
1461
  // Приватный метод для создания Proxy (inline из ProxyBuilder)
@@ -1447,11 +1472,11 @@ class b extends O {
1447
1472
  if (typeof i == "string" && e._fields.has(i))
1448
1473
  return e._fields.get(i);
1449
1474
  },
1450
- set: (t, i, s) => typeof i == "string" && e._fields.has(i) ? !1 : (t[i] = s, !0),
1475
+ set: (t, i, r) => typeof i == "string" && e._fields.has(i) ? !1 : (t[i] = r, !0),
1451
1476
  has: (t, i) => typeof i == "string" && e._fields.has(i) ? !0 : i in t,
1452
1477
  ownKeys: (t) => {
1453
- const i = Reflect.ownKeys(t), s = Array.from(e._fields.keys());
1454
- return [.../* @__PURE__ */ new Set([...i, ...s])];
1478
+ const i = Reflect.ownKeys(t), r = Array.from(e._fields.keys());
1479
+ return [.../* @__PURE__ */ new Set([...i, ...r])];
1455
1480
  },
1456
1481
  getOwnPropertyDescriptor: (t, i) => typeof i == "string" && e._fields.has(i) ? { enumerable: !0, configurable: !0 } : Reflect.getOwnPropertyDescriptor(t, i)
1457
1482
  });
@@ -1466,16 +1491,16 @@ class b extends O {
1466
1491
  }), e;
1467
1492
  }
1468
1493
  setValue(e, t) {
1469
- for (const [i, s] of Object.entries(e)) {
1470
- const a = this._fields.get(i);
1471
- a && a.setValue(s, t);
1494
+ for (const [i, r] of Object.entries(e)) {
1495
+ const s = this._fields.get(i);
1496
+ s && s.setValue(r, t);
1472
1497
  }
1473
1498
  }
1474
1499
  patchValue(e) {
1475
1500
  U(() => {
1476
1501
  for (const [t, i] of Object.entries(e)) {
1477
- const s = this._fields.get(t);
1478
- s && i !== void 0 && s.setValue(i);
1502
+ const r = this._fields.get(t);
1503
+ r && i !== void 0 && r.setValue(i);
1479
1504
  }
1480
1505
  });
1481
1506
  }
@@ -1498,8 +1523,8 @@ class b extends O {
1498
1523
  */
1499
1524
  reset(e) {
1500
1525
  this._fields.forEach((t, i) => {
1501
- const s = e?.[i];
1502
- t.reset(s);
1526
+ const r = e?.[i];
1527
+ t.reset(r);
1503
1528
  });
1504
1529
  }
1505
1530
  /**
@@ -1614,7 +1639,7 @@ class b extends O {
1614
1639
  applyValidationSchema(e) {
1615
1640
  this.validationRegistry.beginRegistration();
1616
1641
  try {
1617
- const t = I();
1642
+ const t = R();
1618
1643
  e(t);
1619
1644
  const i = this.getProxy();
1620
1645
  this.validationRegistry.endRegistration(i);
@@ -1629,7 +1654,7 @@ class b extends O {
1629
1654
  applyBehaviorSchema(e) {
1630
1655
  this.behaviorRegistry.beginRegistration();
1631
1656
  try {
1632
- const t = I();
1657
+ const t = R();
1633
1658
  return e(t), this.behaviorRegistry.endRegistration(this.getProxy()).cleanup;
1634
1659
  } catch (t) {
1635
1660
  throw console.error("Error applying behavior schema:", t), t;
@@ -1671,13 +1696,13 @@ class b extends O {
1671
1696
  if (t.length === 0)
1672
1697
  return;
1673
1698
  let i = this;
1674
- for (const s of t) {
1675
- if (!(i instanceof b) || (i = i.getField(s.key), !i)) return;
1676
- if (s.index !== void 0)
1699
+ for (const r of t) {
1700
+ if (!(i instanceof S) || (i = i.getField(r.key), !i)) return;
1701
+ if (r.index !== void 0)
1677
1702
  if ("at" in i && "length" in i && typeof i.at == "function") {
1678
- const a = i.at(s.index);
1679
- if (!a) return;
1680
- i = a;
1703
+ const s = i.at(r.index);
1704
+ if (!s) return;
1705
+ i = s;
1681
1706
  } else
1682
1707
  return;
1683
1708
  }
@@ -1726,15 +1751,15 @@ class b extends O {
1726
1751
  * Связывает два поля: при изменении source автоматически обновляется target
1727
1752
  */
1728
1753
  linkFields(e, t, i) {
1729
- const s = this._fields.get(e), a = this._fields.get(t);
1730
- if (!s || !a)
1754
+ const r = this._fields.get(e), s = this._fields.get(t);
1755
+ if (!r || !s)
1731
1756
  return () => {
1732
1757
  };
1733
- const o = E(() => {
1734
- const l = s.value.value, d = i ? i(l) : l;
1735
- a.setValue(d, { emitEvent: !1 });
1736
- }), n = `linkFields-${Date.now()}-${Math.random()}`;
1737
- return this.disposers.add(n, o);
1758
+ const n = E(() => {
1759
+ const l = r.value.value, d = i ? i(l) : l;
1760
+ s.setValue(d, { emitEvent: !1 });
1761
+ }), o = `linkFields-${Date.now()}-${Math.random()}`;
1762
+ return this.disposers.add(o, n);
1738
1763
  }
1739
1764
  /**
1740
1765
  * Подписка на изменения вложенного поля по строковому пути
@@ -1768,11 +1793,11 @@ class b extends O {
1768
1793
  if (!i)
1769
1794
  return () => {
1770
1795
  };
1771
- const s = E(() => {
1772
- const o = i.value.value;
1773
- t(o);
1774
- }), a = `watchField-${Date.now()}-${Math.random()}`;
1775
- return this.disposers.add(a, s);
1796
+ const r = E(() => {
1797
+ const n = i.value.value;
1798
+ t(n);
1799
+ }), s = `watchField-${Date.now()}-${Math.random()}`;
1800
+ return this.disposers.add(s, r);
1776
1801
  }
1777
1802
  /**
1778
1803
  * Hook: вызывается после disable()
@@ -1795,7 +1820,7 @@ class b extends O {
1795
1820
  });
1796
1821
  }
1797
1822
  }
1798
- class C extends O {
1823
+ class T extends F {
1799
1824
  // ============================================================================
1800
1825
  // Приватные поля
1801
1826
  // ============================================================================
@@ -1833,8 +1858,8 @@ class C extends O {
1833
1858
  this.push(i);
1834
1859
  this.length = u(() => this.items.value.length), this.value = u(() => this.items.value.map((i) => i.value.value)), this.valid = u(() => this.items.value.every((i) => i.valid.value)), this.invalid = u(() => !this.valid.value), this.pending = u(() => this.items.value.some((i) => i.pending.value)), this.touched = u(() => this.items.value.some((i) => i.touched.value)), this.dirty = u(() => this.items.value.some((i) => i.dirty.value)), this.errors = u(() => {
1835
1860
  const i = [];
1836
- return this.items.value.forEach((s) => {
1837
- i.push(...s.errors.value);
1861
+ return this.items.value.forEach((r) => {
1862
+ i.push(...r.errors.value);
1838
1863
  }), i;
1839
1864
  }), this.status = u(() => this.pending.value ? "pending" : this.invalid.value ? "invalid" : "valid");
1840
1865
  }
@@ -1864,8 +1889,8 @@ class C extends O {
1864
1889
  insert(e, t) {
1865
1890
  if (e < 0 || e > this.items.value.length)
1866
1891
  return;
1867
- const i = this.createItem(t), s = [...this.items.value];
1868
- s.splice(e, 0, i), this.items.value = s;
1892
+ const i = this.createItem(t), r = [...this.items.value];
1893
+ r.splice(e, 0, i), this.items.value = r;
1869
1894
  }
1870
1895
  /**
1871
1896
  * Удалить все элементы массива
@@ -2019,7 +2044,7 @@ class C extends O {
2019
2044
  */
2020
2045
  createItem(e) {
2021
2046
  if (this.isGroupSchema(this.itemSchema)) {
2022
- const t = new b(this.itemSchema);
2047
+ const t = new S(this.itemSchema);
2023
2048
  return e && t.patchValue(e), this.validationSchemaFn && "applyValidationSchema" in t && t.applyValidationSchema(this.validationSchemaFn), this.behaviorSchemaFn && "applyBehaviorSchema" in t && t.applyBehaviorSchema(this.behaviorSchemaFn), t;
2024
2049
  }
2025
2050
  throw new Error(
@@ -2107,13 +2132,13 @@ class C extends O {
2107
2132
  */
2108
2133
  watchItems(e, t) {
2109
2134
  const i = E(() => {
2110
- const a = this.items.value.map((o) => {
2111
- if (o instanceof b)
2112
- return o.getFieldByPath(e)?.value.value;
2135
+ const s = this.items.value.map((n) => {
2136
+ if (n instanceof S)
2137
+ return n.getFieldByPath(e)?.value.value;
2113
2138
  });
2114
- t(a);
2115
- }), s = `watchItems-${Date.now()}-${Math.random()}`;
2116
- return this.disposers.add(s, i);
2139
+ t(s);
2140
+ }), r = `watchItems-${Date.now()}-${Math.random()}`;
2141
+ return this.disposers.add(r, i);
2117
2142
  }
2118
2143
  /**
2119
2144
  * Подписка на изменение длины массива
@@ -2139,8 +2164,8 @@ class C extends O {
2139
2164
  */
2140
2165
  watchLength(e) {
2141
2166
  const t = E(() => {
2142
- const s = this.length.value;
2143
- e(s);
2167
+ const r = this.length.value;
2168
+ e(r);
2144
2169
  }), i = `watchLength-${Date.now()}-${Math.random()}`;
2145
2170
  return this.disposers.add(i, t);
2146
2171
  }
@@ -2258,13 +2283,13 @@ class X {
2258
2283
  return new J(e);
2259
2284
  if (this.isArrayConfig(e)) {
2260
2285
  const t = e;
2261
- return new C(
2286
+ return new T(
2262
2287
  t.schema,
2263
2288
  t.initialItems
2264
2289
  );
2265
2290
  }
2266
2291
  if (this.isGroupConfig(e))
2267
- return new b(e);
2292
+ return new S(e);
2268
2293
  throw new Error(
2269
2294
  `NodeFactory: Unknown node config. Expected FieldConfig, GroupConfig, or ArrayConfig, but got: ${JSON.stringify(
2270
2295
  e
@@ -2298,11 +2323,11 @@ class X {
2298
2323
  */
2299
2324
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2300
2325
  createArrayNodeFromArray(e) {
2301
- const [t, ...i] = e, s = [];
2302
- this.isGroupConfig(t) && s.push(this.extractValues(t));
2303
- for (const a of i)
2304
- this.isGroupConfig(a) ? s.push(this.extractValues(a)) : s.push(a);
2305
- return new C(t, s);
2326
+ const [t, ...i] = e, r = [];
2327
+ this.isGroupConfig(t) && r.push(this.extractValues(t));
2328
+ for (const s of i)
2329
+ this.isGroupConfig(s) ? r.push(this.extractValues(s)) : r.push(s);
2330
+ return new T(t, r);
2306
2331
  }
2307
2332
  /**
2308
2333
  * Извлечь значения из схемы (рекурсивно)
@@ -2340,8 +2365,8 @@ class X {
2340
2365
  return e.map((t) => this.extractValues(t));
2341
2366
  if (this.isGroupConfig(e)) {
2342
2367
  const t = {};
2343
- for (const [i, s] of Object.entries(e))
2344
- t[i] = this.extractValues(s);
2368
+ for (const [i, r] of Object.entries(e))
2369
+ t[i] = this.extractValues(r);
2345
2370
  return t;
2346
2371
  }
2347
2372
  return e;
@@ -2471,10 +2496,10 @@ class fe {
2471
2496
  }
2472
2497
  this.timer = setTimeout(async () => {
2473
2498
  try {
2474
- const s = await e();
2475
- t(s);
2476
- } catch (s) {
2477
- i(s);
2499
+ const r = await e();
2500
+ t(r);
2501
+ } catch (r) {
2502
+ i(r);
2478
2503
  }
2479
2504
  }, this.delay);
2480
2505
  });
@@ -2546,25 +2571,25 @@ class fe {
2546
2571
  return this.timer !== void 0;
2547
2572
  }
2548
2573
  }
2549
- function ve(r) {
2550
- return new b(r);
2574
+ function ve(a) {
2575
+ return new S(a);
2551
2576
  }
2552
- function Z(r) {
2577
+ function Z(a) {
2553
2578
  return {
2554
2579
  type: "static",
2555
2580
  load: async () => ({
2556
- items: r,
2557
- totalCount: r.length
2581
+ items: a,
2582
+ totalCount: a.length
2558
2583
  })
2559
2584
  };
2560
2585
  }
2561
- function ee(r) {
2586
+ function ee(a) {
2562
2587
  let e = null;
2563
2588
  return {
2564
2589
  type: "preload",
2565
2590
  load: async (t) => {
2566
2591
  if (!e) {
2567
- const i = await r(t);
2592
+ const i = await a(t);
2568
2593
  e = {
2569
2594
  items: i,
2570
2595
  totalCount: i.length
@@ -2574,11 +2599,11 @@ function ee(r) {
2574
2599
  }
2575
2600
  };
2576
2601
  }
2577
- function te(r) {
2602
+ function te(a) {
2578
2603
  return {
2579
2604
  type: "partial",
2580
2605
  load: async (e) => {
2581
- const t = await r(e);
2606
+ const t = await a(e);
2582
2607
  return {
2583
2608
  items: t,
2584
2609
  totalCount: t.length
@@ -2592,31 +2617,31 @@ const pe = {
2592
2617
  preload: ee,
2593
2618
  partial: te
2594
2619
  };
2595
- var V = { exports: {} }, k = {};
2596
- var D;
2620
+ var w = { exports: {} }, k = {};
2621
+ var M;
2597
2622
  function ie() {
2598
- if (D) return k;
2599
- D = 1;
2600
- var r = B;
2623
+ if (M) return k;
2624
+ M = 1;
2625
+ var a = B;
2601
2626
  function e(c, f) {
2602
2627
  return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f;
2603
2628
  }
2604
- var t = typeof Object.is == "function" ? Object.is : e, i = r.useState, s = r.useEffect, a = r.useLayoutEffect, o = r.useDebugValue;
2605
- function n(c, f) {
2629
+ var t = typeof Object.is == "function" ? Object.is : e, i = a.useState, r = a.useEffect, s = a.useLayoutEffect, n = a.useDebugValue;
2630
+ function o(c, f) {
2606
2631
  var h = f(), v = i({ inst: { value: h, getSnapshot: f } }), p = v[0].inst, g = v[1];
2607
- return a(
2632
+ return s(
2608
2633
  function() {
2609
2634
  p.value = h, p.getSnapshot = f, l(p) && g({ inst: p });
2610
2635
  },
2611
2636
  [c, h, f]
2612
- ), s(
2637
+ ), r(
2613
2638
  function() {
2614
2639
  return l(p) && g({ inst: p }), c(function() {
2615
2640
  l(p) && g({ inst: p });
2616
2641
  });
2617
2642
  },
2618
2643
  [c]
2619
- ), o(h), h;
2644
+ ), n(h), h;
2620
2645
  }
2621
2646
  function l(c) {
2622
2647
  var f = c.getSnapshot;
@@ -2631,40 +2656,40 @@ function ie() {
2631
2656
  function d(c, f) {
2632
2657
  return f();
2633
2658
  }
2634
- var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : n;
2635
- return k.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : m, k;
2659
+ var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : o;
2660
+ return k.useSyncExternalStore = a.useSyncExternalStore !== void 0 ? a.useSyncExternalStore : m, k;
2636
2661
  }
2637
2662
  var x = {};
2638
- var N;
2639
- function se() {
2640
- return N || (N = 1, process.env.NODE_ENV !== "production" && (function() {
2641
- function r(h, v) {
2663
+ var I;
2664
+ function re() {
2665
+ return I || (I = 1, process.env.NODE_ENV !== "production" && (function() {
2666
+ function a(h, v) {
2642
2667
  return h === v && (h !== 0 || 1 / h === 1 / v) || h !== h && v !== v;
2643
2668
  }
2644
2669
  function e(h, v) {
2645
- m || s.startTransition === void 0 || (m = !0, console.error(
2670
+ m || r.startTransition === void 0 || (m = !0, console.error(
2646
2671
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
2647
2672
  ));
2648
2673
  var p = v();
2649
2674
  if (!c) {
2650
2675
  var g = v();
2651
- a(p, g) || (console.error(
2676
+ s(p, g) || (console.error(
2652
2677
  "The result of getSnapshot should be cached to avoid an infinite loop"
2653
2678
  ), c = !0);
2654
2679
  }
2655
- g = o({
2680
+ g = n({
2656
2681
  inst: { value: p, getSnapshot: v }
2657
2682
  });
2658
- var _ = g[0].inst, A = g[1];
2683
+ var _ = g[0].inst, V = g[1];
2659
2684
  return l(
2660
2685
  function() {
2661
- _.value = p, _.getSnapshot = v, t(_) && A({ inst: _ });
2686
+ _.value = p, _.getSnapshot = v, t(_) && V({ inst: _ });
2662
2687
  },
2663
2688
  [h, p, v]
2664
- ), n(
2689
+ ), o(
2665
2690
  function() {
2666
- return t(_) && A({ inst: _ }), h(function() {
2667
- t(_) && A({ inst: _ });
2691
+ return t(_) && V({ inst: _ }), h(function() {
2692
+ t(_) && V({ inst: _ });
2668
2693
  });
2669
2694
  },
2670
2695
  [h]
@@ -2675,7 +2700,7 @@ function se() {
2675
2700
  h = h.value;
2676
2701
  try {
2677
2702
  var p = v();
2678
- return !a(h, p);
2703
+ return !s(h, p);
2679
2704
  } catch {
2680
2705
  return !0;
2681
2706
  }
@@ -2684,51 +2709,51 @@ function se() {
2684
2709
  return v();
2685
2710
  }
2686
2711
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
2687
- var s = B, a = typeof Object.is == "function" ? Object.is : r, o = s.useState, n = s.useEffect, l = s.useLayoutEffect, d = s.useDebugValue, m = !1, c = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? i : e;
2688
- x.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2712
+ var r = B, s = typeof Object.is == "function" ? Object.is : a, n = r.useState, o = r.useEffect, l = r.useLayoutEffect, d = r.useDebugValue, m = !1, c = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? i : e;
2713
+ x.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : f, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2689
2714
  })()), x;
2690
2715
  }
2691
- var M;
2692
- function re() {
2693
- return M || (M = 1, process.env.NODE_ENV === "production" ? V.exports = ie() : V.exports = se()), V.exports;
2716
+ var N;
2717
+ function se() {
2718
+ return N || (N = 1, process.env.NODE_ENV === "production" ? w.exports = ie() : w.exports = re()), w.exports;
2694
2719
  }
2695
- var $ = re();
2696
- function ae(r, e) {
2697
- if (r === e) return !0;
2698
- if (r.length !== e.length) return !1;
2699
- for (let t = 0; t < r.length; t++)
2700
- if (r[t] !== e[t]) return !1;
2720
+ var $ = se();
2721
+ function ae(a, e) {
2722
+ if (a === e) return !0;
2723
+ if (a.length !== e.length) return !1;
2724
+ for (let t = 0; t < a.length; t++)
2725
+ if (a[t] !== e[t]) return !1;
2701
2726
  return !0;
2702
2727
  }
2703
- function G(r, e, t) {
2728
+ function G(a, e, t) {
2704
2729
  const i = L(null);
2705
2730
  if (i.current === null) {
2706
- const o = {};
2707
- for (const n in r)
2708
- o[n] = r[n].value;
2709
- i.current = { ...o, __snapshot: null };
2710
- }
2711
- const s = S(
2712
- (o) => {
2713
- let n = !0;
2731
+ const n = {};
2732
+ for (const o in a)
2733
+ n[o] = a[o].value;
2734
+ i.current = { ...n, __snapshot: null };
2735
+ }
2736
+ const r = b(
2737
+ (n) => {
2738
+ let o = !0;
2714
2739
  return E(() => {
2715
- for (const d in r)
2716
- r[d].value;
2717
- if (n) {
2718
- n = !1;
2740
+ for (const d in a)
2741
+ a[d].value;
2742
+ if (o) {
2743
+ o = !1;
2719
2744
  return;
2720
2745
  }
2721
- o();
2746
+ n();
2722
2747
  });
2723
2748
  },
2724
- [r]
2725
- ), a = S(() => {
2726
- const o = i.current, n = {};
2727
- for (const d in r)
2728
- n[d] = r[d].value;
2749
+ [a]
2750
+ ), s = b(() => {
2751
+ const n = i.current, o = {};
2752
+ for (const d in a)
2753
+ o[d] = a[d].value;
2729
2754
  let l = !1;
2730
2755
  for (const d of e) {
2731
- const { key: m, useShallowArrayEqual: c } = d, f = n[m], h = o[m];
2756
+ const { key: m, useShallowArrayEqual: c } = d, f = o[m], h = n[m];
2732
2757
  if (c) {
2733
2758
  if (!ae(h, f)) {
2734
2759
  l = !0;
@@ -2739,25 +2764,25 @@ function G(r, e, t) {
2739
2764
  break;
2740
2765
  }
2741
2766
  }
2742
- if (!l && o.__snapshot)
2743
- return o.__snapshot;
2744
- for (const d in r)
2745
- o[d] = n[d];
2746
- return o.__snapshot = t(n), o.__snapshot;
2747
- }, [r, t]);
2748
- return $.useSyncExternalStore(s, a, a);
2767
+ if (!l && n.__snapshot)
2768
+ return n.__snapshot;
2769
+ for (const d in a)
2770
+ n[d] = o[d];
2771
+ return n.__snapshot = t(o), n.__snapshot;
2772
+ }, [a, t]);
2773
+ return $.useSyncExternalStore(r, s, s);
2749
2774
  }
2750
- function ne(r) {
2775
+ function ne(a) {
2751
2776
  const e = {
2752
- value: r.value,
2753
- disabled: r.disabled,
2754
- errors: r.errors,
2755
- pending: r.pending,
2756
- valid: r.valid,
2757
- invalid: r.invalid,
2758
- touched: r.touched,
2759
- shouldShowError: r.shouldShowError,
2760
- componentProps: r.componentProps
2777
+ value: a.value,
2778
+ disabled: a.disabled,
2779
+ errors: a.errors,
2780
+ pending: a.pending,
2781
+ valid: a.valid,
2782
+ invalid: a.invalid,
2783
+ touched: a.touched,
2784
+ shouldShowError: a.shouldShowError,
2785
+ componentProps: a.componentProps
2761
2786
  }, t = [
2762
2787
  { key: "value" },
2763
2788
  { key: "disabled" },
@@ -2768,32 +2793,32 @@ function ne(r) {
2768
2793
  { key: "touched" },
2769
2794
  { key: "shouldShowError" },
2770
2795
  { key: "componentProps" }
2771
- ], i = S(
2772
- (s) => ({
2773
- value: s.value,
2774
- pending: s.pending,
2775
- disabled: s.disabled,
2776
- errors: s.errors,
2777
- valid: s.valid,
2778
- invalid: s.invalid,
2779
- touched: s.touched,
2780
- shouldShowError: s.shouldShowError,
2781
- componentProps: s.componentProps
2796
+ ], i = b(
2797
+ (r) => ({
2798
+ value: r.value,
2799
+ pending: r.pending,
2800
+ disabled: r.disabled,
2801
+ errors: r.errors,
2802
+ valid: r.valid,
2803
+ invalid: r.invalid,
2804
+ touched: r.touched,
2805
+ shouldShowError: r.shouldShowError,
2806
+ componentProps: r.componentProps
2782
2807
  }),
2783
2808
  []
2784
2809
  );
2785
2810
  return G(e, t, i);
2786
2811
  }
2787
- function oe(r) {
2812
+ function oe(a) {
2788
2813
  const e = {
2789
- value: r.value,
2790
- length: r.length,
2791
- errors: r.errors,
2792
- pending: r.pending,
2793
- valid: r.valid,
2794
- invalid: r.invalid,
2795
- touched: r.touched,
2796
- dirty: r.dirty
2814
+ value: a.value,
2815
+ length: a.length,
2816
+ errors: a.errors,
2817
+ pending: a.pending,
2818
+ valid: a.valid,
2819
+ invalid: a.invalid,
2820
+ touched: a.touched,
2821
+ dirty: a.dirty
2797
2822
  }, t = [
2798
2823
  { key: "value" },
2799
2824
  { key: "length" },
@@ -2803,24 +2828,24 @@ function oe(r) {
2803
2828
  { key: "invalid" },
2804
2829
  { key: "touched" },
2805
2830
  { key: "dirty" }
2806
- ], i = S(
2807
- (s) => ({
2808
- value: s.value,
2809
- length: s.length,
2810
- pending: s.pending,
2811
- errors: s.errors,
2812
- valid: s.valid,
2813
- invalid: s.invalid,
2814
- touched: s.touched,
2815
- dirty: s.dirty
2831
+ ], i = b(
2832
+ (r) => ({
2833
+ value: r.value,
2834
+ length: r.length,
2835
+ pending: r.pending,
2836
+ errors: r.errors,
2837
+ valid: r.valid,
2838
+ invalid: r.invalid,
2839
+ touched: r.touched,
2840
+ dirty: r.dirty
2816
2841
  }),
2817
2842
  []
2818
2843
  );
2819
2844
  return G(e, t, i);
2820
2845
  }
2821
- function ye(r) {
2822
- const e = r && "length" in r && "map" in r;
2823
- return r ? e ? oe(r) : ne(r) : {
2846
+ function ye(a) {
2847
+ const e = a && "length" in a && "map" in a;
2848
+ return a ? e ? oe(a) : ne(a) : {
2824
2849
  value: [],
2825
2850
  length: 0,
2826
2851
  pending: !1,
@@ -2831,56 +2856,56 @@ function ye(r) {
2831
2856
  dirty: !1
2832
2857
  };
2833
2858
  }
2834
- function me(r) {
2835
- const e = L({ value: r.value.value }), t = S(
2836
- (s) => {
2837
- let a = !0;
2859
+ function me(a) {
2860
+ const e = L({ value: a.value.value }), t = b(
2861
+ (r) => {
2862
+ let s = !0;
2838
2863
  return E(() => {
2839
- if (r.value.value, a) {
2840
- a = !1;
2864
+ if (a.value.value, s) {
2865
+ s = !1;
2841
2866
  return;
2842
2867
  }
2843
- s();
2868
+ r();
2844
2869
  });
2845
2870
  },
2846
- [r]
2847
- ), i = S(() => {
2848
- const s = r.value.value;
2849
- return e.current.value === s ? e.current.value : (e.current.value = s, s);
2850
- }, [r]);
2871
+ [a]
2872
+ ), i = b(() => {
2873
+ const r = a.value.value;
2874
+ return e.current.value === r ? e.current.value : (e.current.value = r, r);
2875
+ }, [a]);
2851
2876
  return $.useSyncExternalStore(t, i, i);
2852
2877
  }
2853
2878
  export {
2854
- C as ArrayNode,
2879
+ T as ArrayNode,
2855
2880
  fe as Debouncer,
2856
- w as ErrorStrategy,
2881
+ A as ErrorStrategy,
2857
2882
  J as FieldNode,
2858
2883
  Q as FieldPathNavigator,
2859
- F as FormErrorHandler,
2860
- O as FormNode,
2861
- b as GroupNode,
2884
+ O as FormErrorHandler,
2885
+ F as FormNode,
2886
+ S as GroupNode,
2862
2887
  X as NodeFactory,
2863
- Fe as RegistryStack,
2888
+ Oe as RegistryStack,
2864
2889
  pe as Resources,
2865
2890
  P as SubscriptionManager,
2866
2891
  Ee as behaviors,
2867
- I as createFieldPath,
2892
+ R as createFieldPath,
2868
2893
  ve as createForm,
2869
- Oe as extractKey,
2894
+ Fe as extractKey,
2870
2895
  Pe as extractPath,
2871
- Te as getCurrentBehaviorRegistry,
2872
- Re as getCurrentValidationRegistry,
2873
- be as getNodeType,
2874
- R as isArrayNode,
2875
- T as isFieldNode,
2876
- Ve as isFormNode,
2877
- we as isGroupNode,
2896
+ Ce as getCurrentBehaviorRegistry,
2897
+ De as getCurrentValidationRegistry,
2898
+ Se as getNodeType,
2899
+ D as isArrayNode,
2900
+ C as isFieldNode,
2901
+ we as isFormNode,
2902
+ Ae as isGroupNode,
2878
2903
  te as partialResource,
2879
2904
  ee as preloadResource,
2880
2905
  Z as staticResource,
2881
- Ie as toFieldPath,
2906
+ Re as toFieldPath,
2882
2907
  ye as useFormControl,
2883
2908
  me as useFormControlValue,
2884
- Ae as validateForm,
2909
+ Ve as validateForm,
2885
2910
  ke as validators
2886
2911
  };