@reformer/core 7.0.0-beta.1 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/core/factories/node-factory.d.ts +2 -1
  2. package/dist/core/model/behaviors.d.ts +13 -1
  3. package/dist/core/model/validate-model.d.ts +22 -0
  4. package/dist/core/nodes/field-node.d.ts +3 -3
  5. package/dist/core/nodes/group-node.d.ts +3 -5
  6. package/dist/core/nodes/model-array-node.d.ts +38 -0
  7. package/dist/core/types/validation-schema.d.ts +8 -2
  8. package/dist/core/utils/create-form.d.ts +83 -18
  9. package/dist/core/utils/derived-registry.d.ts +41 -2
  10. package/dist/core/utils/index.d.ts +0 -4
  11. package/dist/core/utils/signal-node-registry.d.ts +38 -4
  12. package/dist/core/validation/validators/email.d.ts +14 -4
  13. package/dist/core/validation/validators/future-date.d.ts +14 -4
  14. package/dist/core/validation/validators/index.d.ts +2 -1
  15. package/dist/core/validation/validators/integer.d.ts +13 -4
  16. package/dist/core/validation/validators/is-date.d.ts +14 -4
  17. package/dist/core/validation/validators/is-number.d.ts +15 -5
  18. package/dist/core/validation/validators/max-age.d.ts +16 -4
  19. package/dist/core/validation/validators/max-date.d.ts +16 -4
  20. package/dist/core/validation/validators/max-length.d.ts +18 -4
  21. package/dist/core/validation/validators/max.d.ts +15 -6
  22. package/dist/core/validation/validators/min-age.d.ts +16 -4
  23. package/dist/core/validation/validators/min-date.d.ts +16 -4
  24. package/dist/core/validation/validators/min-length.d.ts +18 -4
  25. package/dist/core/validation/validators/min.d.ts +15 -6
  26. package/dist/core/validation/validators/multiple-of.d.ts +15 -4
  27. package/dist/core/validation/validators/non-negative.d.ts +13 -4
  28. package/dist/core/validation/validators/non-zero.d.ts +13 -4
  29. package/dist/core/validation/validators/past-date.d.ts +14 -3
  30. package/dist/core/validation/validators/pattern.d.ts +24 -4
  31. package/dist/core/validation/validators/phone.d.ts +28 -4
  32. package/dist/core/validation/validators/required.d.ts +16 -5
  33. package/dist/core/validation/validators/url.d.ts +30 -7
  34. package/dist/hooks/useFormControlValue.d.ts +15 -10
  35. package/dist/index.js +562 -896
  36. package/llms.txt +2567 -2854
  37. package/package.json +1 -1
  38. package/dist/core/utils/abstract-registry.d.ts +0 -74
  39. package/dist/core/utils/form-observer.d.ts +0 -176
  40. package/dist/core/utils/registry-stack.d.ts +0 -69
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { signal as g, computed as c, effect as m, batch as ge, Signal as ne } from "@preact/signals-core";
2
- import { i as U, d as be, g as X } from "./behaviors-O9a1Djj9.js";
3
- import { j as lt, c as ut, k as ht, e as ct, m as dt, a as ft, b as pt, r as vt, f as mt, h as yt, s as gt, t as bt, w as _t } from "./behaviors-O9a1Djj9.js";
4
- import ae, { useRef as H, useCallback as A } from "react";
5
- import { default as wt } from "./validators.js";
1
+ import { signal as y, computed as h, effect as _, batch as me, Signal as ie } from "@preact/signals-core";
2
+ import { i as B, d as ye, g as Y } from "./behaviors-O9a1Djj9.js";
3
+ import { j as rt, c as nt, k as at, e as ot, m as lt, a as ut, b as ct, r as ht, f as dt, h as ft, s as pt, t as vt, w as mt } from "./behaviors-O9a1Djj9.js";
4
+ import re, { useRef as q, useCallback as S } from "react";
5
+ import { default as gt } from "./validators.js";
6
6
  class I {
7
7
  // ============================================================================
8
8
  // Protected состояние (для Template Method паттерна)
@@ -11,17 +11,17 @@ class I {
11
11
  * Пользователь взаимодействовал с узлом (touched)
12
12
  * Protected: наследники могут читать/изменять через методы
13
13
  */
14
- _touched = g(!1);
14
+ _touched = y(!1);
15
15
  /**
16
16
  * Значение узла было изменено (dirty)
17
17
  * Protected: наследники могут читать/изменять через методы
18
18
  */
19
- _dirty = g(!1);
19
+ _dirty = y(!1);
20
20
  /**
21
21
  * Текущий статус узла
22
22
  * Protected: наследники могут читать/изменять через методы
23
23
  */
24
- _status = g("valid");
24
+ _status = y("valid");
25
25
  // ============================================================================
26
26
  // Публичные computed signals (readonly для внешнего мира)
27
27
  // ============================================================================
@@ -29,33 +29,33 @@ class I {
29
29
  * Пользователь взаимодействовал с узлом (touched)
30
30
  * Computed из _touched для предоставления readonly интерфейса
31
31
  */
32
- touched = c(() => this._touched.value);
32
+ touched = h(() => this._touched.value);
33
33
  /**
34
34
  * Пользователь не взаимодействовал с узлом (untouched)
35
35
  */
36
- untouched = c(() => !this._touched.value);
36
+ untouched = h(() => !this._touched.value);
37
37
  /**
38
38
  * Значение узла было изменено (dirty)
39
39
  * Computed из _dirty для предоставления readonly интерфейса
40
40
  */
41
- dirty = c(() => this._dirty.value);
41
+ dirty = h(() => this._dirty.value);
42
42
  /**
43
43
  * Значение узла не было изменено (pristine)
44
44
  */
45
- pristine = c(() => !this._dirty.value);
45
+ pristine = h(() => !this._dirty.value);
46
46
  /**
47
47
  * Текущий статус узла
48
48
  * Computed из _status для предоставления readonly интерфейса
49
49
  */
50
- status = c(() => this._status.value);
50
+ status = h(() => this._status.value);
51
51
  /**
52
52
  * Узел отключен (disabled)
53
53
  */
54
- disabled = c(() => this._status.value === "disabled");
54
+ disabled = h(() => this._status.value === "disabled");
55
55
  /**
56
56
  * Узел включен (enabled)
57
57
  */
58
- enabled = c(() => this._status.value !== "disabled");
58
+ enabled = h(() => this._status.value !== "disabled");
59
59
  /**
60
60
  * Получить ошибки валидации с фильтрацией
61
61
  *
@@ -97,17 +97,17 @@ class I {
97
97
  */
98
98
  getErrors(e) {
99
99
  const t = this.errors.value;
100
- return e ? t.filter((s) => {
101
- if (e.code !== void 0 && !(Array.isArray(e.code) ? e.code : [e.code]).includes(s.code) || e.message !== void 0 && !s.message.toLowerCase().includes(e.message.toLowerCase()))
100
+ return e ? t.filter((i) => {
101
+ if (e.code !== void 0 && !(Array.isArray(e.code) ? e.code : [e.code]).includes(i.code) || e.message !== void 0 && !i.message.toLowerCase().includes(e.message.toLowerCase()))
102
102
  return !1;
103
103
  if (e.params !== void 0) {
104
- if (!s.params)
104
+ if (!i.params)
105
105
  return !1;
106
106
  for (const [r, n] of Object.entries(e.params))
107
- if (s.params[r] !== n)
107
+ if (i.params[r] !== n)
108
108
  return !1;
109
109
  }
110
- return !(e.predicate !== void 0 && !e.predicate(s));
110
+ return !(e.predicate !== void 0 && !e.predicate(i));
111
111
  }) : t;
112
112
  }
113
113
  // ============================================================================
@@ -280,7 +280,7 @@ class I {
280
280
  onEnable() {
281
281
  }
282
282
  }
283
- class z {
283
+ class K {
284
284
  /**
285
285
  * Хранилище подписок
286
286
  * Ключ: уникальный идентификатор подписки
@@ -462,11 +462,11 @@ const O = {
462
462
  /** ArrayNode.watchLength() */
463
463
  WatchLength: "watchLength"
464
464
  };
465
- let _e = 0;
466
- function F(i) {
467
- return `${i}-${++_e}`;
465
+ let ge = 0;
466
+ function N(s) {
467
+ return `${s}-${++ge}`;
468
468
  }
469
- var S = /* @__PURE__ */ ((i) => (i.THROW = "throw", i.LOG = "log", i.CONVERT = "convert", i))(S || {});
469
+ var w = /* @__PURE__ */ ((s) => (s.THROW = "throw", s.LOG = "log", s.CONVERT = "convert", s))(w || {});
470
470
  class k {
471
471
  /**
472
472
  * Обработать ошибку согласно заданной стратегии
@@ -507,9 +507,9 @@ class k {
507
507
  * }
508
508
  * ```
509
509
  */
510
- static handle(e, t, s = "throw") {
510
+ static handle(e, t, i = "throw") {
511
511
  const r = this.extractMessage(e);
512
- switch (s) {
512
+ switch (i) {
513
513
  case "throw":
514
514
  throw e;
515
515
  case "log":
@@ -573,11 +573,11 @@ class k {
573
573
  * // { code: 'required', message: 'This field is required', field: 'email' }
574
574
  * ```
575
575
  */
576
- static createValidationError(e, t, s) {
576
+ static createValidationError(e, t, i) {
577
577
  return {
578
578
  code: e,
579
579
  message: t,
580
- params: s ? { field: s } : void 0
580
+ params: i ? { field: i } : void 0
581
581
  };
582
582
  }
583
583
  /**
@@ -599,7 +599,7 @@ class k {
599
599
  return typeof e == "object" && e !== null && "code" in e && "message" in e && typeof e.code == "string" && typeof e.message == "string";
600
600
  }
601
601
  }
602
- class Ee {
602
+ class be {
603
603
  /** Внутренний сигнал статуса */
604
604
  _status;
605
605
  /** Публичный read-only сигнал статуса */
@@ -616,7 +616,7 @@ class Ee {
616
616
  * @param initial - Начальный статус (по умолчанию 'valid')
617
617
  */
618
618
  constructor(e = "valid") {
619
- this._status = g(e), this.status = c(() => this._status.value), this.valid = c(() => this._status.value === "valid"), this.invalid = c(() => this._status.value === "invalid"), this.pending = c(() => this._status.value === "pending"), this.disabled = c(() => this._status.value === "disabled");
619
+ this._status = y(e), this.status = h(() => this._status.value), this.valid = h(() => this._status.value === "valid"), this.invalid = h(() => this._status.value === "invalid"), this.pending = h(() => this._status.value === "pending"), this.disabled = h(() => this._status.value === "disabled");
620
620
  }
621
621
  /**
622
622
  * Начать валидацию
@@ -744,7 +744,7 @@ class Ee {
744
744
  return this._status.value !== "disabled";
745
745
  }
746
746
  }
747
- class we extends I {
747
+ class _e extends I {
748
748
  // ============================================================================
749
749
  // Приватные сигналы
750
750
  // ============================================================================
@@ -798,13 +798,13 @@ class we extends I {
798
798
  * Менеджер подписок для централизованного cleanup
799
799
  * Использует SubscriptionManager вместо массива для управления подписками
800
800
  */
801
- disposers = new z();
801
+ disposers = new K();
802
802
  component;
803
803
  // ============================================================================
804
804
  // Конструктор
805
805
  // ============================================================================
806
806
  constructor(e) {
807
- super(), this.validators = e.validators || [], this.asyncValidators = e.asyncValidators || [], this.updateOn = e.updateOn || "blur", this.debounceMs = e.debounce || 0, this.component = e.component, this._value = e.valueSignal ?? g(e.value), this.initialValue = this._value.peek(), this._errors = g([]), this._componentProps = g(e.componentProps || {}), this.statusMachine = new Ee(e.disabled ? "disabled" : "valid"), this.value = c(() => this._value.value), this.valid = c(() => this.statusMachine.valid.value), this.invalid = c(() => this.statusMachine.invalid.value), this.pending = c(() => this.statusMachine.pending.value), this.status = c(() => this.statusMachine.status.value), this.disabled = c(() => this.statusMachine.disabled.value), this.errors = c(() => this._errors.value), this.componentProps = c(() => this._componentProps.value), this.shouldShowError = c(
807
+ super(), this.validators = e.validators || [], this.asyncValidators = e.asyncValidators || [], this.updateOn = e.updateOn || "blur", this.debounceMs = e.debounce || 0, this.component = e.component, this._value = e.valueSignal ?? y(e.value), this.initialValue = this._value.peek(), this._errors = y([]), this._componentProps = y(e.componentProps || {}), this.statusMachine = new be(e.disabled ? "disabled" : "valid"), this.value = h(() => this._value.value), this.valid = h(() => this.statusMachine.valid.value), this.invalid = h(() => this.statusMachine.invalid.value), this.pending = h(() => this.statusMachine.pending.value), this.status = h(() => this.statusMachine.status.value), this.disabled = h(() => this.statusMachine.disabled.value), this.errors = h(() => this._errors.value), this.componentProps = h(() => this._componentProps.value), this.shouldShowError = h(
808
808
  () => this.statusMachine.invalid.value && (this._touched.value || this._dirty.value)
809
809
  );
810
810
  }
@@ -817,12 +817,12 @@ class we extends I {
817
817
  setValue(e, t) {
818
818
  if (this._value.value = e, this._dirty.value = !0, t?.emitEvent === !1)
819
819
  return;
820
- const s = this.validators.length > 0 || this.asyncValidators.length > 0, r = this._errors.value.length > 0;
820
+ const i = this.validators.length > 0 || this.asyncValidators.length > 0, r = this._errors.value.length > 0;
821
821
  if (this.updateOn === "change") {
822
822
  this.validate();
823
823
  return;
824
824
  }
825
- r && s && this.validate();
825
+ r && i && this.validate();
826
826
  }
827
827
  patchValue(e) {
828
828
  this.setValue(e);
@@ -915,17 +915,17 @@ class we extends I {
915
915
  const t = e?.debounce ?? this.debounceMs;
916
916
  if (this.cancelPendingValidation(), t <= 0 || this.asyncValidators.length === 0)
917
917
  return this.validateImmediate();
918
- const s = new AbortController();
918
+ const i = new AbortController();
919
919
  return new Promise((r) => {
920
- this.pendingValidation = { resolve: r, abortController: s }, this.validateDebounceTimer = setTimeout(async () => {
921
- if (this.validateDebounceTimer = void 0, s.signal.aborted) {
920
+ this.pendingValidation = { resolve: r, abortController: i }, this.validateDebounceTimer = setTimeout(async () => {
921
+ if (this.validateDebounceTimer = void 0, i.signal.aborted) {
922
922
  r(!1);
923
923
  return;
924
924
  }
925
925
  this.pendingValidation = void 0;
926
- const n = await this.validateImmediate(s);
926
+ const n = await this.validateImmediate(i);
927
927
  r(n);
928
- }, t), s.signal.addEventListener(
928
+ }, t), i.signal.addEventListener(
929
929
  "abort",
930
930
  () => {
931
931
  this.validateDebounceTimer && (clearTimeout(this.validateDebounceTimer), this.validateDebounceTimer = void 0), r(!1);
@@ -947,12 +947,12 @@ class we extends I {
947
947
  async validateImmediate(e) {
948
948
  const t = e ?? new AbortController();
949
949
  e || this.currentAbortController?.abort(), this.currentAbortController = t;
950
- const { signal: s } = t, r = [];
950
+ const { signal: i } = t, r = [];
951
951
  for (const a of this.validators) {
952
952
  const o = a(this._value.value);
953
953
  o && r.push(o);
954
954
  }
955
- if (s.aborted)
955
+ if (i.aborted)
956
956
  return !1;
957
957
  if (r.length > 0) {
958
958
  this._errors.value = r;
@@ -961,17 +961,17 @@ class we extends I {
961
961
  return !1;
962
962
  }
963
963
  if (this.asyncValidators.length > 0) {
964
- if (s.aborted)
964
+ if (i.aborted)
965
965
  return !1;
966
966
  this.statusMachine.startValidation();
967
967
  try {
968
968
  const a = await Promise.all(
969
969
  this.asyncValidators.map(async (l) => {
970
- if (s.aborted)
970
+ if (i.aborted)
971
971
  throw new DOMException("Validation aborted", "AbortError");
972
972
  try {
973
- const u = await l(this._value.value, { signal: s });
974
- if (s.aborted)
973
+ const u = await l(this._value.value, { signal: i });
974
+ if (i.aborted)
975
975
  throw new DOMException("Validation aborted", "AbortError");
976
976
  return u;
977
977
  } catch (u) {
@@ -980,12 +980,12 @@ class we extends I {
980
980
  return k.handle(
981
981
  u,
982
982
  "FieldNode AsyncValidator",
983
- S.CONVERT
983
+ w.CONVERT
984
984
  );
985
985
  }
986
986
  })
987
987
  );
988
- if (s.aborted)
988
+ if (i.aborted)
989
989
  return !1;
990
990
  const o = a.filter(Boolean);
991
991
  if (o.length > 0) {
@@ -1000,11 +1000,11 @@ class we extends I {
1000
1000
  throw a;
1001
1001
  }
1002
1002
  }
1003
- return s.aborted ? !1 : ((this.validators.length > 0 || this.asyncValidators.length > 0) && (this._errors.value = [], this.statusMachine.completeValidation(!1)), !this._errors.value.some((a) => a.severity !== "warning"));
1003
+ return i.aborted ? !1 : ((this.validators.length > 0 || this.asyncValidators.length > 0) && (this._errors.value = [], this.statusMachine.completeValidation(!1)), !this._errors.value.some((a) => a.severity !== "warning"));
1004
1004
  }
1005
1005
  setErrors(e) {
1006
1006
  this._errors.value = e;
1007
- const t = e.some((s) => s.severity !== "warning");
1007
+ const t = e.some((i) => i.severity !== "warning");
1008
1008
  this.statusMachine.setErrors(t);
1009
1009
  }
1010
1010
  clearErrors() {
@@ -1064,13 +1064,13 @@ class we extends I {
1064
1064
  * @example
1065
1065
  * ```typescript
1066
1066
  * // Сценарий 1: Instant feedback после submit
1067
- * const form = new GroupNode({
1067
+ * const form = createForm({
1068
1068
  * email: {
1069
1069
  * value: '',
1070
1070
  * component: Input,
1071
1071
  * updateOn: 'submit', // Изначально валидация только при submit
1072
- * validators: [required, email]
1073
- * }
1072
+ * validators: [required, email],
1073
+ * },
1074
1074
  * });
1075
1075
  *
1076
1076
  * await form.submit(async (values) => {
@@ -1122,12 +1122,12 @@ class we extends I {
1122
1122
  * ```
1123
1123
  */
1124
1124
  watch(e) {
1125
- const t = new AbortController(), s = m(() => {
1125
+ const t = new AbortController(), i = _(() => {
1126
1126
  const n = this.value.value;
1127
1127
  e(n, t.signal);
1128
- }), r = F(O.Watch);
1128
+ }), r = N(O.Watch);
1129
1129
  return this.disposers.add(r, () => {
1130
- t.abort(), s();
1130
+ t.abort(), i();
1131
1131
  });
1132
1132
  }
1133
1133
  /**
@@ -1153,11 +1153,11 @@ class we extends I {
1153
1153
  * ```
1154
1154
  */
1155
1155
  computeFrom(e, t) {
1156
- const s = m(() => {
1156
+ const i = _(() => {
1157
1157
  const n = e.map((o) => o.value), a = t(...n);
1158
1158
  this.setValue(a, { emitEvent: !1 });
1159
- }), r = F(O.ComputeFrom);
1160
- return this.disposers.add(r, s);
1159
+ }), r = N(O.ComputeFrom);
1160
+ return this.disposers.add(r, i);
1161
1161
  }
1162
1162
  /**
1163
1163
  * Очистить все ресурсы и таймеры
@@ -1187,13 +1187,13 @@ class we extends I {
1187
1187
  }
1188
1188
  }
1189
1189
  }
1190
- function J(i) {
1191
- const { getChildren: e, ownErrors: t, disabled: s } = i, r = c(() => t.value.length > 0 ? !1 : e().every((h) => h.disabled.value || h.valid.value)), n = c(() => !r.value), a = c(() => e().some((h) => h.pending.value)), o = c(() => e().some((h) => h.touched.value)), l = c(() => e().some((h) => h.dirty.value)), u = c(() => {
1192
- const h = [...t.value];
1190
+ function H(s) {
1191
+ const { getChildren: e, ownErrors: t, disabled: i } = s, r = h(() => t.value.length > 0 ? !1 : e().every((c) => c.disabled.value || c.valid.value)), n = h(() => !r.value), a = h(() => e().some((c) => c.pending.value)), o = h(() => e().some((c) => c.touched.value)), l = h(() => e().some((c) => c.dirty.value)), u = h(() => {
1192
+ const c = [...t.value];
1193
1193
  for (const f of e())
1194
- h.push(...f.errors.value);
1195
- return h;
1196
- }), y = c(() => s?.value ? "disabled" : a.value ? "pending" : n.value ? "invalid" : "valid");
1194
+ c.push(...f.errors.value);
1195
+ return c;
1196
+ }), m = h(() => i?.value ? "disabled" : a.value ? "pending" : n.value ? "invalid" : "valid");
1197
1197
  return {
1198
1198
  valid: r,
1199
1199
  invalid: n,
@@ -1201,32 +1201,32 @@ function J(i) {
1201
1201
  touched: o,
1202
1202
  dirty: l,
1203
1203
  errors: u,
1204
- status: y
1204
+ status: m
1205
1205
  };
1206
1206
  }
1207
- function Ae(i) {
1208
- return typeof i == "object" && i !== null && "getProxy" in i && typeof i.getProxy == "function";
1207
+ function Ee(s) {
1208
+ return typeof s == "object" && s !== null && "getProxy" in s && typeof s.getProxy == "function";
1209
1209
  }
1210
- function Se(i, e) {
1211
- return new Proxy(i, {
1212
- get: (t, s) => {
1213
- if (s in t)
1214
- return t[s];
1215
- if (typeof s == "string" && e.has(s)) {
1216
- const r = e.get(s);
1217
- return r && Ae(r) ? r.getProxy() : r;
1210
+ function Ae(s, e) {
1211
+ return new Proxy(s, {
1212
+ get: (t, i) => {
1213
+ if (i in t)
1214
+ return t[i];
1215
+ if (typeof i == "string" && e.has(i)) {
1216
+ const r = e.get(i);
1217
+ return r && Ee(r) ? r.getProxy() : r;
1218
1218
  }
1219
1219
  },
1220
- set: (t, s, r) => typeof s == "string" && e.has(s) ? !1 : (t[s] = r, !0),
1221
- has: (t, s) => typeof s == "string" && e.has(s) ? !0 : s in t,
1220
+ set: (t, i, r) => typeof i == "string" && e.has(i) ? !1 : (t[i] = r, !0),
1221
+ has: (t, i) => typeof i == "string" && e.has(i) ? !0 : i in t,
1222
1222
  ownKeys: (t) => {
1223
- const s = Reflect.ownKeys(t), r = Array.from(e.keys());
1224
- return [.../* @__PURE__ */ new Set([...s, ...r])];
1223
+ const i = Reflect.ownKeys(t), r = Array.from(e.keys());
1224
+ return [.../* @__PURE__ */ new Set([...i, ...r])];
1225
1225
  },
1226
- getOwnPropertyDescriptor: (t, s) => typeof s == "string" && e.has(s) ? { enumerable: !0, configurable: !0 } : Reflect.getOwnPropertyDescriptor(t, s)
1226
+ getOwnPropertyDescriptor: (t, i) => typeof i == "string" && e.has(i) ? { enumerable: !0, configurable: !0 } : Reflect.getOwnPropertyDescriptor(t, i)
1227
1227
  });
1228
1228
  }
1229
- class ke {
1229
+ class Se {
1230
1230
  /**
1231
1231
  * @param form - Форма для отправки
1232
1232
  */
@@ -1234,9 +1234,9 @@ class ke {
1234
1234
  this.form = e;
1235
1235
  }
1236
1236
  /** Внутренний сигнал состояния отправки */
1237
- _submitting = g(!1);
1237
+ _submitting = y(!1);
1238
1238
  /** Публичный read-only сигнал состояния отправки */
1239
- submitting = c(() => this._submitting.value);
1239
+ submitting = h(() => this._submitting.value);
1240
1240
  /**
1241
1241
  * Отправить форму
1242
1242
  *
@@ -1266,8 +1266,8 @@ class ke {
1266
1266
  * ```
1267
1267
  */
1268
1268
  async submit(e, t) {
1269
- const { skipValidation: s = !1, skipTouch: r = !1 } = t || {};
1270
- if (r || this.form.markAsTouched(), !s && !await this.form.validate())
1269
+ const { skipValidation: i = !1, skipTouch: r = !1 } = t || {};
1270
+ if (r || this.form.markAsTouched(), !i && !await this.form.validate())
1271
1271
  return null;
1272
1272
  this._submitting.value = !0;
1273
1273
  try {
@@ -1301,8 +1301,8 @@ class ke {
1301
1301
  * ```
1302
1302
  */
1303
1303
  async submitWithResult(e, t) {
1304
- const { skipValidation: s = !1, skipTouch: r = !1 } = t || {};
1305
- if (r || this.form.markAsTouched(), !s && !await this.form.validate())
1304
+ const { skipValidation: i = !1, skipTouch: r = !1 } = t || {};
1305
+ if (r || this.form.markAsTouched(), !i && !await this.form.validate())
1306
1306
  return { success: !1, data: null };
1307
1307
  this._submitting.value = !0;
1308
1308
  try {
@@ -1324,16 +1324,16 @@ class ke {
1324
1324
  return this._submitting.value;
1325
1325
  }
1326
1326
  }
1327
- function Ve(i) {
1327
+ function we(s) {
1328
1328
  const e = [];
1329
- for (const t of i.split(".")) {
1330
- const s = /^([^[\]]+)(?:\[(\d+)\])?$/.exec(t);
1331
- if (!s) return [];
1332
- e.push(s[2] !== void 0 ? { key: s[1], index: Number(s[2]) } : { key: s[1] });
1329
+ for (const t of s.split(".")) {
1330
+ const i = /^([^[\]]+)(?:\[(\d+)\])?$/.exec(t);
1331
+ if (!i) return [];
1332
+ e.push(i[2] !== void 0 ? { key: i[1], index: Number(i[2]) } : { key: i[1] });
1333
1333
  }
1334
1334
  return e;
1335
1335
  }
1336
- let T = class oe extends I {
1336
+ let x = class ne extends I {
1337
1337
  // ============================================================================
1338
1338
  // Приватные поля
1339
1339
  // ============================================================================
@@ -1346,7 +1346,7 @@ let T = class oe extends I {
1346
1346
  /**
1347
1347
  * Менеджер подписок для централизованного cleanup
1348
1348
  */
1349
- disposers = new z();
1349
+ disposers = new K();
1350
1350
  /**
1351
1351
  * Ссылка на Proxy-инстанс
1352
1352
  */
@@ -1358,7 +1358,7 @@ let T = class oe extends I {
1358
1358
  /**
1359
1359
  * Фабрика для создания узлов формы
1360
1360
  */
1361
- nodeFactory = new Oe();
1361
+ nodeFactory = new ke();
1362
1362
  // ============================================================================
1363
1363
  // Приватные сигналы состояния (inline из StateManager)
1364
1364
  // ============================================================================
@@ -1366,9 +1366,9 @@ let T = class oe extends I {
1366
1366
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1367
1367
  formSubmitter;
1368
1368
  /** Флаг disabled состояния */
1369
- _disabled = g(!1);
1369
+ _disabled = y(!1);
1370
1370
  /** Form-level validation errors */
1371
- _formErrors = g([]);
1371
+ _formErrors = y([]);
1372
1372
  // ============================================================================
1373
1373
  // Публичные computed signals
1374
1374
  // ============================================================================
@@ -1382,19 +1382,19 @@ let T = class oe extends I {
1382
1382
  status;
1383
1383
  submitting;
1384
1384
  constructor(e) {
1385
- super(), this.formSubmitter = new ke(this);
1386
- const s = "form" in e ? e.form : e;
1387
- for (const [n, a] of Object.entries(s)) {
1385
+ super(), this.formSubmitter = new Se(this);
1386
+ const i = "form" in e ? e.form : e;
1387
+ for (const [n, a] of Object.entries(i)) {
1388
1388
  const o = this.createNode(a);
1389
1389
  this._fields.set(n, o);
1390
1390
  }
1391
- this.value = c(() => {
1391
+ this.value = h(() => {
1392
1392
  const n = {};
1393
1393
  return this._fields.forEach((a, o) => {
1394
1394
  n[o] = a.value.value;
1395
1395
  }), n;
1396
1396
  });
1397
- const r = J({
1397
+ const r = H({
1398
1398
  getChildren: () => Array.from(this._fields.values()),
1399
1399
  ownErrors: this._formErrors,
1400
1400
  disabled: this._disabled
@@ -1409,33 +1409,33 @@ let T = class oe extends I {
1409
1409
  * @see buildFormProxy
1410
1410
  */
1411
1411
  buildProxy() {
1412
- return Se(this, this._fields);
1412
+ return Ae(this, this._fields);
1413
1413
  }
1414
1414
  // ============================================================================
1415
1415
  // Реализация абстрактных методов FormNode
1416
1416
  // ============================================================================
1417
1417
  getValue() {
1418
1418
  const e = {};
1419
- return this._fields.forEach((t, s) => {
1420
- e[s] = t.getValue();
1419
+ return this._fields.forEach((t, i) => {
1420
+ e[i] = t.getValue();
1421
1421
  }), e;
1422
1422
  }
1423
1423
  setValue(e, t) {
1424
- for (const [s, r] of Object.entries(e)) {
1425
- const n = this._fields.get(s);
1424
+ for (const [i, r] of Object.entries(e)) {
1425
+ const n = this._fields.get(i);
1426
1426
  if (n) {
1427
- if (U(n.value)) continue;
1427
+ if (B(n.value)) continue;
1428
1428
  n.setValue(r, t);
1429
1429
  }
1430
1430
  }
1431
1431
  }
1432
1432
  patchValue(e) {
1433
- ge(() => {
1434
- for (const [t, s] of Object.entries(e)) {
1433
+ me(() => {
1434
+ for (const [t, i] of Object.entries(e)) {
1435
1435
  const r = this._fields.get(t);
1436
- if (r && s !== void 0) {
1437
- if (U(r.value)) continue;
1438
- r.setValue(s, { emitEvent: !1 });
1436
+ if (r && i !== void 0) {
1437
+ if (B(r.value)) continue;
1438
+ r.setValue(i, { emitEvent: !1 });
1439
1439
  }
1440
1440
  }
1441
1441
  });
@@ -1458,8 +1458,8 @@ let T = class oe extends I {
1458
1458
  * ```
1459
1459
  */
1460
1460
  reset(e) {
1461
- this._fields.forEach((t, s) => {
1462
- const r = e?.[s];
1461
+ this._fields.forEach((t, i) => {
1462
+ const r = e?.[i];
1463
1463
  t.reset(r);
1464
1464
  });
1465
1465
  }
@@ -1516,14 +1516,12 @@ let T = class oe extends I {
1516
1516
  * @example
1517
1517
  * ```typescript
1518
1518
  * const form = new GroupNode({
1519
- * controls: {
1520
- * email: new FieldNode({ value: '' }),
1521
- * name: new FieldNode({ value: '' })
1522
- * }
1519
+ * email: { value: '', component: Input },
1520
+ * name: { value: '', component: Input },
1523
1521
  * });
1524
1522
  *
1525
1523
  * const proxy = form.getProxy();
1526
- * console.log(proxy.email.value); // Прямой доступ к полю
1524
+ * console.log(proxy.email.value.value); // Прямой доступ к полю
1527
1525
  * ```
1528
1526
  */
1529
1527
  getProxy() {
@@ -1605,21 +1603,21 @@ let T = class oe extends I {
1605
1603
  getFieldByPath(e) {
1606
1604
  if (e.startsWith(".") || e.endsWith("."))
1607
1605
  return;
1608
- const t = Ve(e);
1606
+ const t = we(e);
1609
1607
  if (t.length === 0)
1610
1608
  return;
1611
- let s = this;
1609
+ let i = this;
1612
1610
  for (const r of t) {
1613
- if (!(s instanceof oe) || (s = s.getField(r.key), !s)) return;
1611
+ if (!(i instanceof ne) || (i = i.getField(r.key), !i)) return;
1614
1612
  if (r.index !== void 0)
1615
- if ("at" in s && "length" in s && typeof s.at == "function") {
1616
- const n = s.at(r.index);
1613
+ if ("at" in i && "length" in i && typeof i.at == "function") {
1614
+ const n = i.at(r.index);
1617
1615
  if (!n) return;
1618
- s = n;
1616
+ i = n;
1619
1617
  } else
1620
1618
  return;
1621
1619
  }
1622
- return s;
1620
+ return i;
1623
1621
  }
1624
1622
  // ============================================================================
1625
1623
  // Private методы для создания узлов
@@ -1648,16 +1646,16 @@ let T = class oe extends I {
1648
1646
  /**
1649
1647
  * Связывает два поля: при изменении source автоматически обновляется target
1650
1648
  */
1651
- linkFields(e, t, s) {
1649
+ linkFields(e, t, i) {
1652
1650
  const r = this._fields.get(e), n = this._fields.get(t);
1653
1651
  if (!r || !n) {
1654
1652
  const l = r ? t : e;
1655
1653
  throw new Error(`GroupNode.linkFields: field "${String(l)}" not found`);
1656
1654
  }
1657
- const a = m(() => {
1658
- const l = r.value.value, u = s ? s(l) : l;
1655
+ const a = _(() => {
1656
+ const l = r.value.value, u = i ? i(l) : l;
1659
1657
  n.setValue(u, { emitEvent: !1 });
1660
- }), o = F(O.LinkFields);
1658
+ }), o = N(O.LinkFields);
1661
1659
  return this.disposers.add(o, a);
1662
1660
  }
1663
1661
  /**
@@ -1688,13 +1686,13 @@ let T = class oe extends I {
1688
1686
  * ```
1689
1687
  */
1690
1688
  watchField(e, t) {
1691
- const s = this.getFieldByPath(e);
1692
- if (!s)
1689
+ const i = this.getFieldByPath(e);
1690
+ if (!i)
1693
1691
  throw new Error(`GroupNode.watchField: field "${e}" not found`);
1694
- const r = m(() => {
1695
- const a = s.value.value;
1692
+ const r = _(() => {
1693
+ const a = i.value.value;
1696
1694
  t(a);
1697
- }), n = F(O.WatchField);
1695
+ }), n = N(O.WatchField);
1698
1696
  return this.disposers.add(n, r);
1699
1697
  }
1700
1698
  /**
@@ -1724,7 +1722,7 @@ let T = class oe extends I {
1724
1722
  "dispose" in e && typeof e.dispose == "function" && e.dispose();
1725
1723
  });
1726
1724
  }
1727
- }, Z = class extends I {
1725
+ }, Q = class extends I {
1728
1726
  // ============================================================================
1729
1727
  // Приватные поля
1730
1728
  // ============================================================================
@@ -1735,9 +1733,9 @@ let T = class oe extends I {
1735
1733
  * Менеджер подписок для централизованного cleanup
1736
1734
  * Использует SubscriptionManager вместо массива для управления подписками
1737
1735
  */
1738
- disposers = new z();
1736
+ disposers = new K();
1739
1737
  /** Array-level validation errors (e.g., "минимум 1 элемент") */
1740
- _arrayErrors = g([]);
1738
+ _arrayErrors = y([]);
1741
1739
  // ============================================================================
1742
1740
  // Приватные поля для сохранения схем
1743
1741
  // ============================================================================
@@ -1759,15 +1757,15 @@ let T = class oe extends I {
1759
1757
  // Конструктор
1760
1758
  // ============================================================================
1761
1759
  constructor(e, t = []) {
1762
- super(), this.itemSchema = e, this.initialItems = t, this.items = g([]);
1760
+ super(), this.itemSchema = e, this.initialItems = t, this.items = y([]);
1763
1761
  for (const r of t)
1764
1762
  this.push(r);
1765
- this.length = c(() => this.items.value.length), this.value = c(() => this.items.value.map((r) => r.value.value));
1766
- const s = J({
1763
+ this.length = h(() => this.items.value.length), this.value = h(() => this.items.value.map((r) => r.value.value));
1764
+ const i = H({
1767
1765
  getChildren: () => this.items.value,
1768
1766
  ownErrors: this._arrayErrors
1769
1767
  });
1770
- this.valid = s.valid, this.invalid = s.invalid, this.pending = s.pending, this.touched = s.touched, this.dirty = s.dirty, this.errors = s.errors, this.status = s.status;
1768
+ this.valid = i.valid, this.invalid = i.invalid, this.pending = i.pending, this.touched = i.touched, this.dirty = i.dirty, this.errors = i.errors, this.status = i.status;
1771
1769
  }
1772
1770
  // ============================================================================
1773
1771
  // CRUD операции
@@ -1794,12 +1792,12 @@ let T = class oe extends I {
1794
1792
  `ArrayNode.removeAt: index ${e} out of bounds (length: ${this.items.value.length})`
1795
1793
  ),
1796
1794
  "ArrayNode.removeAt",
1797
- S.LOG
1795
+ w.LOG
1798
1796
  );
1799
1797
  return;
1800
1798
  }
1801
1799
  const t = this.items.value[e];
1802
- this.items.value = this.items.value.filter((s, r) => r !== e), t && "dispose" in t && typeof t.dispose == "function" && t.dispose();
1800
+ this.items.value = this.items.value.filter((i, r) => r !== e), t && "dispose" in t && typeof t.dispose == "function" && t.dispose();
1803
1801
  }
1804
1802
  /**
1805
1803
  * Вставить элемент в массив
@@ -1813,12 +1811,12 @@ let T = class oe extends I {
1813
1811
  `ArrayNode.insert: index ${e} out of bounds (length: ${this.items.value.length})`
1814
1812
  ),
1815
1813
  "ArrayNode.insert",
1816
- S.LOG
1814
+ w.LOG
1817
1815
  );
1818
1816
  return;
1819
1817
  }
1820
- const s = this.createItem(t), r = [...this.items.value];
1821
- r.splice(e, 0, s), this.items.value = r;
1818
+ const i = this.createItem(t), r = [...this.items.value];
1819
+ r.splice(e, 0, i), this.items.value = r;
1822
1820
  }
1823
1821
  /**
1824
1822
  * Переместить элемент массива с позиции `from` на позицию `to`
@@ -1837,12 +1835,12 @@ let T = class oe extends I {
1837
1835
  * ```
1838
1836
  */
1839
1837
  move(e, t) {
1840
- const s = this.items.value.length;
1841
- if (e < 0 || e >= s || t < 0 || t >= s) {
1838
+ const i = this.items.value.length;
1839
+ if (e < 0 || e >= i || t < 0 || t >= i) {
1842
1840
  k.handle(
1843
- new Error(`ArrayNode.move: index out of bounds (from=${e}, to=${t}, length=${s})`),
1841
+ new Error(`ArrayNode.move: index out of bounds (from=${e}, to=${t}, length=${i})`),
1844
1842
  "ArrayNode.move",
1845
- S.LOG
1843
+ w.LOG
1846
1844
  );
1847
1845
  return;
1848
1846
  }
@@ -1865,12 +1863,12 @@ let T = class oe extends I {
1865
1863
  * ```
1866
1864
  */
1867
1865
  swap(e, t) {
1868
- const s = this.items.value.length;
1869
- if (e < 0 || e >= s || t < 0 || t >= s) {
1866
+ const i = this.items.value.length;
1867
+ if (e < 0 || e >= i || t < 0 || t >= i) {
1870
1868
  k.handle(
1871
- new Error(`ArrayNode.swap: index out of bounds (a=${e}, b=${t}, length=${s})`),
1869
+ new Error(`ArrayNode.swap: index out of bounds (a=${e}, b=${t}, length=${i})`),
1872
1870
  "ArrayNode.swap",
1873
- S.LOG
1871
+ w.LOG
1874
1872
  );
1875
1873
  return;
1876
1874
  }
@@ -1907,13 +1905,13 @@ let T = class oe extends I {
1907
1905
  return this.items.value.map((e) => e.getValue());
1908
1906
  }
1909
1907
  setValue(e, t) {
1910
- this.clear(), e.forEach((s) => this.push(s)), t?.emitEvent !== !1 && this.validate().catch((s) => {
1911
- k.handle(s, "ArrayNode.setValue", S.LOG);
1908
+ this.clear(), e.forEach((i) => this.push(i)), t?.emitEvent !== !1 && this.validate().catch((i) => {
1909
+ k.handle(i, "ArrayNode.setValue", w.LOG);
1912
1910
  });
1913
1911
  }
1914
1912
  patchValue(e) {
1915
- e.forEach((t, s) => {
1916
- this.items.value[s] && t !== void 0 && this.items.value[s].patchValue(t);
1913
+ e.forEach((t, i) => {
1914
+ this.items.value[i] && t !== void 0 && this.items.value[i].patchValue(t);
1917
1915
  });
1918
1916
  }
1919
1917
  /**
@@ -2041,9 +2039,9 @@ let T = class oe extends I {
2041
2039
  * @param callback - Функция, вызываемая для каждого элемента с типизированным GroupNode proxy
2042
2040
  */
2043
2041
  forEach(e) {
2044
- this.items.value.forEach((t, s) => {
2042
+ this.items.value.forEach((t, i) => {
2045
2043
  const r = t.getProxy();
2046
- e(r, s);
2044
+ e(r, i);
2047
2045
  });
2048
2046
  }
2049
2047
  /**
@@ -2052,9 +2050,9 @@ let T = class oe extends I {
2052
2050
  * @returns Новый массив результатов
2053
2051
  */
2054
2052
  map(e) {
2055
- return this.items.value.map((t, s) => {
2053
+ return this.items.value.map((t, i) => {
2056
2054
  const r = t.getProxy();
2057
- return e(r, s);
2055
+ return e(r, i);
2058
2056
  });
2059
2057
  }
2060
2058
  // ============================================================================
@@ -2066,7 +2064,7 @@ let T = class oe extends I {
2066
2064
  */
2067
2065
  createItem(e) {
2068
2066
  if (this.isGroupSchema(this.itemSchema)) {
2069
- const t = new T(this.itemSchema);
2067
+ const t = new x(this.itemSchema);
2070
2068
  return e && t.patchValue(e), this.validationSchemaFn && "applyValidationSchema" in t && t.applyValidationSchema(this.validationSchemaFn), this.behaviorSchemaFn && "applyBehaviorSchema" in t && t.applyBehaviorSchema(this.behaviorSchemaFn), t;
2071
2069
  }
2072
2070
  throw new Error(
@@ -2153,14 +2151,14 @@ let T = class oe extends I {
2153
2151
  * ```
2154
2152
  */
2155
2153
  watchItems(e, t) {
2156
- const s = m(() => {
2154
+ const i = _(() => {
2157
2155
  const n = this.items.value.map((a) => {
2158
- if (a instanceof T)
2156
+ if (a instanceof x)
2159
2157
  return a.getFieldByPath(e)?.value.value;
2160
2158
  });
2161
2159
  t(n);
2162
- }), r = F(O.WatchItems);
2163
- return this.disposers.add(r, s);
2160
+ }), r = N(O.WatchItems);
2161
+ return this.disposers.add(r, i);
2164
2162
  }
2165
2163
  /**
2166
2164
  * Подписка на изменение длины массива
@@ -2185,11 +2183,11 @@ let T = class oe extends I {
2185
2183
  * ```
2186
2184
  */
2187
2185
  watchLength(e) {
2188
- const t = m(() => {
2186
+ const t = _(() => {
2189
2187
  const r = this.length.value;
2190
2188
  e(r);
2191
- }), s = F(O.WatchLength);
2192
- return this.disposers.add(s, t);
2189
+ }), i = N(O.WatchLength);
2190
+ return this.disposers.add(i, t);
2193
2191
  }
2194
2192
  /**
2195
2193
  * Очистить все ресурсы узла
@@ -2252,7 +2250,7 @@ let T = class oe extends I {
2252
2250
  });
2253
2251
  }
2254
2252
  };
2255
- class Oe {
2253
+ class ke {
2256
2254
  /**
2257
2255
  * Создает узел формы на основе конфигурации
2258
2256
  *
@@ -2302,16 +2300,16 @@ class Oe {
2302
2300
  if (Array.isArray(e) && e.length >= 1)
2303
2301
  return this.createArrayNodeFromArray(e);
2304
2302
  if (this.isFieldConfig(e))
2305
- return new we(e);
2303
+ return new _e(e);
2306
2304
  if (this.isArrayConfig(e)) {
2307
2305
  const t = e;
2308
- return new Z(
2306
+ return new Q(
2309
2307
  t.schema,
2310
2308
  t.initialItems
2311
2309
  );
2312
2310
  }
2313
2311
  if (this.isGroupConfig(e))
2314
- return new T(e);
2312
+ return new x(e);
2315
2313
  throw new Error(
2316
2314
  `NodeFactory: Unknown node config. Expected FieldConfig, GroupConfig, or ArrayConfig, but got: ${JSON.stringify(
2317
2315
  e
@@ -2345,11 +2343,11 @@ class Oe {
2345
2343
  */
2346
2344
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2347
2345
  createArrayNodeFromArray(e) {
2348
- const [t, ...s] = e, r = [];
2346
+ const [t, ...i] = e, r = [];
2349
2347
  this.isGroupConfig(t) && r.push(this.extractValues(t));
2350
- for (const n of s)
2348
+ for (const n of i)
2351
2349
  this.isGroupConfig(n) ? r.push(this.extractValues(n)) : r.push(n);
2352
- return new Z(t, r);
2350
+ return new Q(t, r);
2353
2351
  }
2354
2352
  /**
2355
2353
  * Извлечь значения из схемы (рекурсивно)
@@ -2387,8 +2385,8 @@ class Oe {
2387
2385
  return e.map((t) => this.extractValues(t));
2388
2386
  if (this.isGroupConfig(e)) {
2389
2387
  const t = {};
2390
- for (const [s, r] of Object.entries(e))
2391
- t[s] = this.extractValues(r);
2388
+ for (const [i, r] of Object.entries(e))
2389
+ t[i] = this.extractValues(r);
2392
2390
  return t;
2393
2391
  }
2394
2392
  return e;
@@ -2468,89 +2466,35 @@ class Oe {
2468
2466
  return e != null && typeof e == "object" && !this.isFieldConfig(e) && !this.isArrayConfig(e);
2469
2467
  }
2470
2468
  }
2471
- class Fe {
2472
- stack = [];
2473
- /**
2474
- * Добавить элемент в стек
2475
- * @param item - Элемент для добавления
2476
- */
2477
- push(e) {
2478
- this.stack.push(e);
2479
- }
2480
- /**
2481
- * Извлечь элемент из стека
2482
- * @returns Извлеченный элемент или undefined если стек пуст
2483
- */
2484
- pop() {
2485
- return this.stack.pop();
2486
- }
2487
- /**
2488
- * Получить текущий элемент (вершину стека) без извлечения
2489
- * @returns Текущий элемент или null если стек пуст
2490
- */
2491
- getCurrent() {
2492
- return this.stack.length > 0 ? this.stack[this.stack.length - 1] : null;
2493
- }
2494
- /**
2495
- * Извлечь элемент из стека с проверкой
2496
- * Выводит предупреждение в DEV режиме если извлеченный элемент не совпадает с ожидаемым
2497
- *
2498
- * @param expected - Ожидаемый элемент
2499
- * @param name - Имя реестра для отладки (например, 'ValidationRegistry')
2500
- */
2501
- verify(e, t) {
2502
- this.pop();
2503
- }
2504
- /**
2505
- * Получить длину стека
2506
- * @returns Количество элементов в стеке
2507
- */
2508
- get length() {
2509
- return this.stack.length;
2510
- }
2511
- /**
2512
- * Проверить, пуст ли стек
2513
- * @returns true если стек пуст
2514
- */
2515
- isEmpty() {
2516
- return this.stack.length === 0;
2517
- }
2518
- /**
2519
- * Очистить стек
2520
- */
2521
- clear() {
2522
- this.stack = [];
2523
- }
2469
+ function D(s) {
2470
+ return s == null ? !1 : typeof s == "object" && "value" in s && "setValue" in s && "getValue" in s && "validate" in s;
2524
2471
  }
2525
- function L(i) {
2526
- return i == null ? !1 : typeof i == "object" && "value" in i && "setValue" in i && "getValue" in i && "validate" in i;
2527
- }
2528
- function Ne(i) {
2529
- return i == null ? !1 : L(i) && "validators" in i && "asyncValidators" in i && // FieldNode имеет markAsTouched метод
2472
+ function Ve(s) {
2473
+ return s == null ? !1 : D(s) && "validators" in s && "asyncValidators" in s && // FieldNode имеет markAsTouched метод
2530
2474
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2531
- typeof i.markAsTouched == "function" && // У FieldNode нет fields или items
2532
- !("fields" in i) && !("items" in i);
2475
+ typeof s.markAsTouched == "function" && // У FieldNode нет fields или items
2476
+ !("fields" in s) && !("items" in s);
2533
2477
  }
2534
- function Te(i) {
2535
- return i == null ? !1 : L(i) && "getFieldByPath" in i && "fields" in i && // GroupNode НЕ имеет items/push/removeAt (это ArrayNode/ModelArrayNode)
2536
- !("items" in i) && !("push" in i) && !("removeAt" in i);
2478
+ function Oe(s) {
2479
+ return s == null ? !1 : D(s) && "getFieldByPath" in s && "fields" in s && // GroupNode НЕ имеет items/push/removeAt (это ArrayNode/ModelArrayNode)
2480
+ !("items" in s) && !("push" in s) && !("removeAt" in s);
2537
2481
  }
2538
- function xe(i) {
2539
- return i == null ? !1 : L(i) && "items" in i && "length" in i && "push" in i && "removeAt" in i && "at" in i && // eslint-disable-next-line @typescript-eslint/no-explicit-any
2540
- typeof i.push == "function" && // eslint-disable-next-line @typescript-eslint/no-explicit-any
2541
- typeof i.removeAt == "function";
2482
+ function Ne(s) {
2483
+ return s == null ? !1 : D(s) && "items" in s && "length" in s && "push" in s && "removeAt" in s && "at" in s && // eslint-disable-next-line @typescript-eslint/no-explicit-any
2484
+ typeof s.push == "function" && // eslint-disable-next-line @typescript-eslint/no-explicit-any
2485
+ typeof s.removeAt == "function";
2542
2486
  }
2543
- function Ye(i) {
2544
- return Ne(i) ? "FieldNode" : Te(i) ? "GroupNode" : xe(i) ? "ArrayNode" : L(i) ? "FormNode" : "Unknown";
2487
+ function He(s) {
2488
+ return Ve(s) ? "FieldNode" : Oe(s) ? "GroupNode" : Ne(s) ? "ArrayNode" : D(s) ? "FormNode" : "Unknown";
2545
2489
  }
2546
- class Pe extends I {
2490
+ class Fe extends I {
2547
2491
  /**
2548
2492
  * @param control Реактивный массив модели (`model.<path>`).
2549
2493
  * @param buildItem Строитель формы элемента по его под-модели (инъекция, чтобы избежать цикла
2550
2494
  * импорта с `create-form`). Обычно `(item) => createForm({ model: item, schema: itemSchema(item) })`.
2551
2495
  */
2552
2496
  constructor(e, t) {
2553
- super(), this.control = e, this.buildItem = t, this.initial = e.toArray(), this.disposeSync = m(() => {
2497
+ super(), this.control = e, this.buildItem = t, this.initial = e.toArray(), this.disposeSync = _(() => {
2554
2498
  const r = e.length, n = [];
2555
2499
  for (let a = 0; a < r; a++) {
2556
2500
  const o = e.at(a);
@@ -2559,18 +2503,18 @@ class Pe extends I {
2559
2503
  l || (l = t(o), this.cache.set(o, l)), n.push(l);
2560
2504
  }
2561
2505
  this.itemNodes.value = n;
2562
- }), this.length = c(() => this.itemNodes.value.length), this.value = c(() => this.itemNodes.value.map((r) => r.value.value));
2563
- const s = J({
2506
+ }), this.length = h(() => this.itemNodes.value.length), this.value = h(() => this.itemNodes.value.map((r) => r.value.value));
2507
+ const i = H({
2564
2508
  getChildren: () => this.itemNodes.value,
2565
2509
  ownErrors: this._arrayErrors
2566
2510
  });
2567
- this.valid = s.valid, this.invalid = s.invalid, this.pending = s.pending, this.touched = s.touched, this.dirty = s.dirty, this.errors = s.errors, this.status = s.status;
2511
+ this.valid = i.valid, this.invalid = i.invalid, this.pending = i.pending, this.touched = i.touched, this.dirty = i.dirty, this.errors = i.errors, this.status = i.status;
2568
2512
  }
2569
- itemNodes = g([]);
2513
+ itemNodes = y([]);
2570
2514
  // Кэш per-item формы по идентичности фасада под-модели (фасады кэшируются в core).
2571
2515
  cache = /* @__PURE__ */ new WeakMap();
2572
2516
  initial;
2573
- _arrayErrors = g([]);
2517
+ _arrayErrors = y([]);
2574
2518
  disposeSync;
2575
2519
  /**
2576
2520
  * Сигнал per-item форм. Публичен в т.ч. чтобы `isArrayNode` распознавал узел как массив
@@ -2593,10 +2537,10 @@ class Pe extends I {
2593
2537
  return this.itemNodes.value[e];
2594
2538
  }
2595
2539
  map(e) {
2596
- return this.itemNodes.value.map((t, s) => e(t, s));
2540
+ return this.itemNodes.value.map((t, i) => e(t, i));
2597
2541
  }
2598
2542
  forEach(e) {
2599
- this.itemNodes.value.forEach((t, s) => e(t, s));
2543
+ this.itemNodes.value.forEach((t, i) => e(t, i));
2600
2544
  }
2601
2545
  // ── Мутации (делегируют массиву модели; effect пересоберёт itemNodes) ──────
2602
2546
  push(e) {
@@ -2664,374 +2608,99 @@ class Pe extends I {
2664
2608
  this.disposeSync();
2665
2609
  }
2666
2610
  }
2667
- const le = (i) => i !== null && typeof i == "object" && !Array.isArray(i) && !(i instanceof Date) && !(typeof Blob < "u" && i instanceof Blob) && !(typeof File < "u" && i instanceof File);
2668
- function W(i, e, t) {
2669
- if (i == null || typeof i != "object") return;
2670
- if (Array.isArray(i)) {
2671
- for (const n of i) W(n, e, t);
2611
+ const ae = (s) => s !== null && typeof s == "object" && !Array.isArray(s) && !(s instanceof Date) && !(typeof Blob < "u" && s instanceof Blob) && !(typeof File < "u" && s instanceof File);
2612
+ function G(s, e, t) {
2613
+ if (s == null || typeof s != "object") return;
2614
+ if (Array.isArray(s)) {
2615
+ for (const n of s) G(n, e, t);
2672
2616
  return;
2673
2617
  }
2674
- const s = i, r = s.array;
2675
- if (r && typeof r.__path == "string" && typeof s.item == "function") {
2676
- t.set(r.__path, s.item);
2618
+ const i = s, r = i.array;
2619
+ if (r && typeof r.__path == "string" && typeof i.item == "function") {
2620
+ t.set(r.__path, i.item);
2677
2621
  return;
2678
2622
  }
2679
- s.value instanceof ne && e.set(s.value, {
2680
- component: s.component,
2681
- componentProps: s.componentProps,
2682
- validators: s.validators,
2683
- asyncValidators: s.asyncValidators,
2684
- updateOn: s.updateOn,
2685
- disabled: s.disabled,
2686
- debounce: s.debounce
2623
+ i.value instanceof ie && e.set(i.value, {
2624
+ component: i.component,
2625
+ componentProps: i.componentProps,
2626
+ validators: i.validators,
2627
+ asyncValidators: i.asyncValidators,
2628
+ updateOn: i.updateOn,
2629
+ disabled: i.disabled,
2630
+ debounce: i.debounce
2687
2631
  });
2688
- for (const [n, a] of Object.entries(s))
2689
- n !== "value" && W(a, e, t);
2632
+ for (const [n, a] of Object.entries(i))
2633
+ n !== "value" && G(a, e, t);
2690
2634
  }
2691
- function ue(i, e, t, s) {
2635
+ function oe(s, e, t, i) {
2692
2636
  const r = {};
2693
2637
  for (const [n, a] of Object.entries(e)) {
2694
2638
  const o = t === "" ? n : `${t}.${n}`;
2695
2639
  if (Array.isArray(a))
2696
2640
  continue;
2697
- if (le(a)) {
2698
- r[n] = ue(i, a, o, s);
2641
+ if (ae(a)) {
2642
+ r[n] = oe(s, a, o, i);
2699
2643
  continue;
2700
2644
  }
2701
- const l = i.signalAt(o);
2645
+ const l = s.signalAt(o);
2702
2646
  if (!l) throw new Error(`createForm({ model }): не найден сигнал для пути "${o}"`);
2703
- const u = s.get(l) ?? {}, { validators: y, asyncValidators: h, ...f } = u;
2647
+ const u = i.get(l) ?? {}, { validators: m, asyncValidators: c, ...f } = u;
2704
2648
  r[n] = { ...f, valueSignal: l };
2705
2649
  }
2706
2650
  return r;
2707
2651
  }
2708
- function he(i, e, t) {
2709
- for (const [s, r] of Object.entries(i)) {
2710
- const n = e === "" ? s : `${e}.${s}`;
2711
- Array.isArray(r) || (le(r) ? he(r, n, t) : t.push(n));
2652
+ function le(s, e, t) {
2653
+ for (const [i, r] of Object.entries(s)) {
2654
+ const n = e === "" ? i : `${e}.${i}`;
2655
+ Array.isArray(r) || (ae(r) ? le(r, n, t) : t.push(n));
2712
2656
  }
2713
2657
  }
2714
- function ce(i) {
2715
- const { model: e, schema: t, behavior: s } = i, r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
2716
- t !== void 0 && W(t, r, n);
2717
- const a = ue(e, e.get(), "", r), o = new T(a), l = e.get();
2718
- for (const [h, f] of Object.entries(l)) {
2658
+ function ue(s) {
2659
+ const { model: e, schema: t, behavior: i } = s, r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
2660
+ t !== void 0 && G(t, r, n);
2661
+ const a = oe(e, e.get(), "", r), o = new x(a), l = e.get();
2662
+ for (const [c, f] of Object.entries(l)) {
2719
2663
  if (!Array.isArray(f)) continue;
2720
- const d = n.get(h);
2664
+ const d = n.get(c);
2721
2665
  if (!d) continue;
2722
- const p = e[h], v = (_) => ce({ model: _, schema: d(_) }), b = new Pe(p, v);
2723
- o.fields.set(h, b);
2724
- }
2725
- const u = o.getProxy(), y = [];
2726
- he(e.get(), "", y);
2727
- for (const h of y) {
2728
- const f = e.signalAt(h), d = o.getFieldByPath(h);
2729
- f && d && be(f, d);
2666
+ const p = e[c], v = (b) => ue({ model: b, schema: d(b) }), g = new Fe(p, v);
2667
+ o.fields.set(c, g);
2730
2668
  }
2731
- return s && o.attachBehaviorCleanup(s.__run(e, u)), u;
2732
- }
2733
- const Ce = (i) => i != null && typeof i == "object" && "model" in i && typeof i.model?.signalAt == "function";
2734
- function Qe(i) {
2735
- return Ce(i) ? ce(i) : new T(i).getProxy();
2736
- }
2737
- const j = /* @__PURE__ */ new Map();
2738
- class P {
2739
- /** Флаг активной регистрации */
2740
- isRegistering = !1;
2741
- /** Массив зарегистрированных элементов */
2742
- registrations = [];
2743
- /**
2744
- * Получить стек для конкретного класса реестра
2745
- * Создает новый стек если не существует
2746
- *
2747
- * @param ctor - Конструктор класса реестра
2748
- * @returns RegistryStack для данного класса
2749
- */
2750
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2751
- static getStack(e) {
2752
- return j.has(e) || j.set(e, new Fe()), j.get(e);
2753
- }
2754
- /**
2755
- * Получить текущий активный реестр из стека
2756
- * Должен быть переопределен в наследниках как static метод
2757
- *
2758
- * @param ctor - Конструктор класса реестра
2759
- * @returns Текущий активный реестр или null
2760
- */
2761
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2762
- static getCurrentFromStack(e) {
2763
- return this.getStack(e).getCurrent();
2764
- }
2765
- /**
2766
- * Начать регистрацию
2767
- *
2768
- * Помещает this в global stack для изоляции форм
2769
- * Вызывает hook onBeginRegistration()
2770
- */
2771
- beginRegistration() {
2772
- this.isRegistering = !0, this.registrations = [], P.getStack(this.constructor).push(this), this.onBeginRegistration();
2773
- }
2774
- /**
2775
- * Проверить, активна ли регистрация
2776
- */
2777
- isActive() {
2778
- return this.isRegistering;
2779
- }
2780
- /**
2781
- * Получить зарегистрированные элементы
2782
- */
2783
- getRegistrations() {
2784
- return this.registrations;
2785
- }
2786
- /**
2787
- * Hook: вызывается в начале регистрации
2788
- * Может быть переопределен в наследниках для инициализации
2789
- */
2790
- onBeginRegistration() {
2791
- }
2792
- /**
2793
- * Завершить регистрацию и извлечь из стека
2794
- *
2795
- * @param registryName - Имя реестра для отладки
2796
- */
2797
- completeRegistration(e) {
2798
- this.isRegistering = !1, P.getStack(this.constructor).verify(this, e);
2799
- }
2800
- /**
2801
- * Отменить регистрацию без применения
2802
- *
2803
- * @param registryName - Имя реестра для отладки
2804
- */
2805
- cancelRegistration(e) {
2806
- this.isRegistering = !1, this.registrations = [], P.getStack(this.constructor).verify(this, e);
2669
+ const u = o.getProxy(), m = [];
2670
+ le(e.get(), "", m);
2671
+ for (const c of m) {
2672
+ const f = e.signalAt(c), d = o.getFieldByPath(c);
2673
+ f && d && ye(f, d);
2807
2674
  }
2675
+ return i && o.attachBehaviorCleanup(i.__run(e, u)), u;
2808
2676
  }
2809
- class Xe {
2810
- /**
2811
- * @param form - Форма для наблюдения
2812
- * @param options - Опции observer
2813
- */
2814
- constructor(e, t) {
2815
- this.form = e, this.options = {
2816
- enableLogging: !1,
2817
- eventTypes: ["value", "status", "errors", "touched", "dirty"],
2818
- pathFilter: [],
2819
- ...t
2820
- };
2821
- }
2822
- listeners = /* @__PURE__ */ new Set();
2823
- disposers = [];
2824
- options;
2825
- /**
2826
- * Подписаться на события изменения
2827
- *
2828
- * @param callback - Функция обработки события
2829
- * @returns Функция отписки
2830
- *
2831
- * @example
2832
- * ```typescript
2833
- * const unsubscribe = observer.subscribe((event) => {
2834
- * // Отправить событие в analytics
2835
- * analytics.track('form_change', event);
2836
- * });
2837
- * ```
2838
- */
2839
- subscribe(e) {
2840
- return this.listeners.add(e), () => this.listeners.delete(e);
2841
- }
2842
- /**
2843
- * Включить трассировку формы
2844
- *
2845
- * Подписывается на изменения основных сигналов формы
2846
- * и вызывает listeners при каждом изменении
2847
- *
2848
- * @returns Функция для отключения трассировки
2849
- *
2850
- * @example
2851
- * ```typescript
2852
- * const dispose = observer.enableTracing();
2853
- *
2854
- * // Позже, для отключения
2855
- * dispose();
2856
- * ```
2857
- */
2858
- enableTracing() {
2859
- if (this.shouldTrack("value")) {
2860
- let e = this.form.value.value;
2861
- const t = m(() => {
2862
- const s = this.form.value.value;
2863
- s !== e && (this.emit({
2864
- type: "value",
2865
- path: "",
2866
- timestamp: Date.now(),
2867
- oldValue: e,
2868
- newValue: s
2869
- }), e = s);
2870
- });
2871
- this.disposers.push(t);
2872
- }
2873
- if (this.shouldTrack("status")) {
2874
- let e = this.form.status.value;
2875
- const t = m(() => {
2876
- const s = this.form.status.value;
2877
- s !== e && (this.emit({
2878
- type: "status",
2879
- path: "",
2880
- timestamp: Date.now(),
2881
- oldValue: e,
2882
- newValue: s
2883
- }), e = s);
2884
- });
2885
- this.disposers.push(t);
2886
- }
2887
- if (this.shouldTrack("errors")) {
2888
- let e = this.form.errors.value;
2889
- const t = m(() => {
2890
- const s = this.form.errors.value;
2891
- s !== e && (this.emit({
2892
- type: "errors",
2893
- path: "",
2894
- timestamp: Date.now(),
2895
- oldValue: e,
2896
- newValue: s
2897
- }), e = s);
2898
- });
2899
- this.disposers.push(t);
2900
- }
2901
- if (this.shouldTrack("touched")) {
2902
- let e = this.form.touched.value;
2903
- const t = m(() => {
2904
- const s = this.form.touched.value;
2905
- s !== e && (this.emit({
2906
- type: "touched",
2907
- path: "",
2908
- timestamp: Date.now(),
2909
- oldValue: e,
2910
- newValue: s
2911
- }), e = s);
2912
- });
2913
- this.disposers.push(t);
2914
- }
2915
- if (this.shouldTrack("dirty")) {
2916
- let e = this.form.dirty.value;
2917
- const t = m(() => {
2918
- const s = this.form.dirty.value;
2919
- s !== e && (this.emit({
2920
- type: "dirty",
2921
- path: "",
2922
- timestamp: Date.now(),
2923
- oldValue: e,
2924
- newValue: s
2925
- }), e = s);
2926
- });
2927
- this.disposers.push(t);
2928
- }
2929
- return () => {
2930
- this.disposers.forEach((e) => e()), this.disposers = [];
2931
- };
2932
- }
2933
- /**
2934
- * Наблюдать за конкретным полем
2935
- *
2936
- * @param path - Путь к полю
2937
- * @returns Функция для отключения наблюдения
2938
- *
2939
- * @example
2940
- * ```typescript
2941
- * // Наблюдать за полем email
2942
- * const dispose = observer.watchField('email');
2943
- * ```
2944
- */
2945
- watchField(e) {
2946
- const t = this.form.getFieldByPath(e);
2947
- if (!t)
2948
- return () => {
2949
- };
2950
- const s = [];
2951
- if (this.shouldTrack("value")) {
2952
- let r = t.value.value;
2953
- const n = m(() => {
2954
- const a = t.value.value;
2955
- a !== r && (this.emit({
2956
- type: "value",
2957
- path: e,
2958
- timestamp: Date.now(),
2959
- oldValue: r,
2960
- newValue: a
2961
- }), r = a);
2962
- });
2963
- s.push(n);
2964
- }
2965
- if (this.shouldTrack("status")) {
2966
- let r = t.status.value;
2967
- const n = m(() => {
2968
- const a = t.status.value;
2969
- a !== r && (this.emit({
2970
- type: "status",
2971
- path: e,
2972
- timestamp: Date.now(),
2973
- oldValue: r,
2974
- newValue: a
2975
- }), r = a);
2976
- });
2977
- s.push(n);
2978
- }
2979
- return () => s.forEach((r) => r());
2980
- }
2981
- /**
2982
- * Отправить событие всем listeners
2983
- */
2984
- emit(e) {
2985
- this.matchesPathFilter(e.path) && (this.options.enableLogging && console.log(`[FormObserver] ${e.type} at "${e.path || "root"}":`, e.newValue), this.listeners.forEach((t) => {
2986
- try {
2987
- t(e);
2988
- } catch {
2989
- }
2990
- }));
2991
- }
2992
- /**
2993
- * Проверить, нужно ли отслеживать тип события
2994
- */
2995
- shouldTrack(e) {
2996
- return this.options.eventTypes.includes(e);
2997
- }
2998
- /**
2999
- * Проверить, соответствует ли путь фильтру
3000
- */
3001
- matchesPathFilter(e) {
3002
- const { pathFilter: t } = this.options;
3003
- return !t || Array.isArray(t) && t.length === 0 ? !0 : t instanceof RegExp ? t.test(e) : t.includes(e);
3004
- }
3005
- /**
3006
- * Очистить все подписки и disposers
3007
- */
3008
- dispose() {
3009
- this.disposers.forEach((e) => e()), this.disposers = [], this.listeners.clear();
3010
- }
2677
+ const xe = (s) => s != null && typeof s == "object" && "model" in s && typeof s.model?.signalAt == "function";
2678
+ function ze(s) {
2679
+ return xe(s) ? ue(s) : new x(s).getProxy();
3011
2680
  }
3012
- const C = (i) => !(i === null || typeof i != "object" || Array.isArray(i) || i instanceof Date || typeof Blob < "u" && i instanceof Blob || typeof File < "u" && i instanceof File), E = (i, e) => i === "" ? String(e) : `${i}.${e}`, q = (i) => /^\d+$/.test(i), w = (i) => {
3013
- if (Array.isArray(i)) return i.map(w);
3014
- if (C(i)) {
2681
+ const P = (s) => !(s === null || typeof s != "object" || Array.isArray(s) || s instanceof Date || typeof Blob < "u" && s instanceof Blob || typeof File < "u" && s instanceof File), E = (s, e) => s === "" ? String(e) : `${s}.${e}`, U = (s) => /^\d+$/.test(s), A = (s) => {
2682
+ if (Array.isArray(s)) return s.map(A);
2683
+ if (P(s)) {
3015
2684
  const e = {};
3016
- for (const t of Object.keys(i)) e[t] = w(i[t]);
2685
+ for (const t of Object.keys(s)) e[t] = A(s[t]);
3017
2686
  return e;
3018
2687
  }
3019
- return i;
3020
- }, M = (i, e) => {
3021
- if (i === e) return !0;
3022
- if (Array.isArray(i) && Array.isArray(e))
3023
- return i.length !== e.length ? !1 : i.every((t, s) => M(t, e[s]));
3024
- if (C(i) && C(e)) {
3025
- const t = Object.keys(i), s = Object.keys(e);
3026
- return t.length !== s.length ? !1 : t.every((r) => M(i[r], e[r]));
2688
+ return s;
2689
+ }, C = (s, e) => {
2690
+ if (s === e) return !0;
2691
+ if (Array.isArray(s) && Array.isArray(e))
2692
+ return s.length !== e.length ? !1 : s.every((t, i) => C(t, e[i]));
2693
+ if (P(s) && P(e)) {
2694
+ const t = Object.keys(s), i = Object.keys(e);
2695
+ return t.length !== i.length ? !1 : t.every((r) => C(s[r], e[r]));
3027
2696
  }
3028
2697
  return !1;
3029
2698
  };
3030
2699
  class Me {
3031
2700
  constructor(e, t) {
3032
2701
  this.path = t;
3033
- const s = g(e);
3034
- s.__path = t, this.signal = s, this.initial = w(e);
2702
+ const i = y(e);
2703
+ i.__path = t, this.signal = i, this.initial = A(e);
3035
2704
  }
3036
2705
  kind = "leaf";
3037
2706
  signal;
@@ -3051,37 +2720,37 @@ class Me {
3051
2720
  this.signal.value = e;
3052
2721
  }
3053
2722
  resetToInitial() {
3054
- this.signal.value = w(this.initial);
2723
+ this.signal.value = A(this.initial);
3055
2724
  }
3056
2725
  captureInitial() {
3057
- this.initial = w(this.signal.peek());
2726
+ this.initial = A(this.signal.peek());
3058
2727
  }
3059
2728
  dirty() {
3060
- return !M(this.signal.peek(), this.initial);
2729
+ return !C(this.signal.peek(), this.initial);
3061
2730
  }
3062
2731
  }
3063
- class de {
2732
+ class ce {
3064
2733
  constructor(e, t) {
3065
2734
  this.path = t;
3066
- for (const s of Object.keys(e))
3067
- this.children.set(s, N(e[s], E(t, s)));
2735
+ for (const i of Object.keys(e))
2736
+ this.children.set(i, F(e[i], E(t, i)));
3068
2737
  }
3069
2738
  kind = "group";
3070
2739
  children = /* @__PURE__ */ new Map();
3071
2740
  rebase(e) {
3072
2741
  this.path = e;
3073
- for (const [t, s] of this.children) s.rebase(E(e, t));
2742
+ for (const [t, i] of this.children) i.rebase(E(e, t));
3074
2743
  }
3075
2744
  peek() {
3076
2745
  const e = {};
3077
- for (const [t, s] of this.children) e[t] = s.peek();
2746
+ for (const [t, i] of this.children) e[t] = i.peek();
3078
2747
  return e;
3079
2748
  }
3080
2749
  set(e) {
3081
2750
  if (e == null || typeof e != "object") return;
3082
2751
  const t = e;
3083
- for (const [s, r] of this.children)
3084
- s in t && (r.kind === "leaf" && U(r.signal) || r.set(t[s]));
2752
+ for (const [i, r] of this.children)
2753
+ i in t && (r.kind === "leaf" && B(r.signal) || r.set(t[i]));
3085
2754
  }
3086
2755
  resetToInitial() {
3087
2756
  for (const e of this.children.values()) e.resetToInitial();
@@ -3094,38 +2763,38 @@ class de {
3094
2763
  return !1;
3095
2764
  }
3096
2765
  }
3097
- class De {
2766
+ class Pe {
3098
2767
  constructor(e, t) {
3099
- this.path = t, this.items = g(e.map((s, r) => N(s, E(t, r)))), this.initial = w(e);
2768
+ this.path = t, this.items = y(e.map((i, r) => F(i, E(t, r)))), this.initial = A(e);
3100
2769
  }
3101
2770
  kind = "array";
3102
2771
  items;
3103
2772
  initial;
3104
2773
  rebase(e) {
3105
- this.path = e, this.items.peek().forEach((t, s) => t.rebase(E(e, s)));
2774
+ this.path = e, this.items.peek().forEach((t, i) => t.rebase(E(e, i)));
3106
2775
  }
3107
2776
  reindex() {
3108
2777
  this.items.peek().forEach((e, t) => e.rebase(E(this.path, t)));
3109
2778
  }
3110
2779
  push(e) {
3111
2780
  const t = this.items.peek();
3112
- this.items.value = [...t, N(e, E(this.path, t.length))];
2781
+ this.items.value = [...t, F(e, E(this.path, t.length))];
3113
2782
  }
3114
2783
  insertAt(e, t) {
3115
- const s = [...this.items.peek()];
3116
- s.splice(e, 0, N(t, E(this.path, e))), this.items.value = s, this.reindex();
2784
+ const i = [...this.items.peek()];
2785
+ i.splice(e, 0, F(t, E(this.path, e))), this.items.value = i, this.reindex();
3117
2786
  }
3118
2787
  removeAt(e) {
3119
2788
  const t = [...this.items.peek()];
3120
2789
  t.splice(e, 1), this.items.value = t, this.reindex();
3121
2790
  }
3122
2791
  move(e, t) {
3123
- const s = [...this.items.peek()], [r] = s.splice(e, 1);
3124
- r && s.splice(t, 0, r), this.items.value = s, this.reindex();
2792
+ const i = [...this.items.peek()], [r] = i.splice(e, 1);
2793
+ r && i.splice(t, 0, r), this.items.value = i, this.reindex();
3125
2794
  }
3126
2795
  swap(e, t) {
3127
- const s = [...this.items.peek()];
3128
- e < 0 || t < 0 || e >= s.length || t >= s.length || e === t || ([s[e], s[t]] = [s[t], s[e]], this.items.value = s, this.reindex());
2796
+ const i = [...this.items.peek()];
2797
+ e < 0 || t < 0 || e >= i.length || t >= i.length || e === t || ([i[e], i[t]] = [i[t], i[e]], this.items.value = i, this.reindex());
3129
2798
  }
3130
2799
  clear() {
3131
2800
  this.items.value = [];
@@ -3135,88 +2804,88 @@ class De {
3135
2804
  }
3136
2805
  set(e) {
3137
2806
  const t = Array.isArray(e) ? e : [];
3138
- this.items.value = t.map((s, r) => N(s, E(this.path, r)));
2807
+ this.items.value = t.map((i, r) => F(i, E(this.path, r)));
3139
2808
  }
3140
2809
  resetToInitial() {
3141
- this.set(w(this.initial));
2810
+ this.set(A(this.initial));
3142
2811
  }
3143
2812
  captureInitial() {
3144
- this.initial = w(this.peek());
2813
+ this.initial = A(this.peek());
3145
2814
  }
3146
2815
  dirty() {
3147
- return !M(this.peek(), this.initial);
2816
+ return !C(this.peek(), this.initial);
3148
2817
  }
3149
2818
  }
3150
- function N(i, e) {
3151
- return Array.isArray(i) ? new De(i, e) : C(i) ? new de(i, e) : new Me(i, e);
2819
+ function F(s, e) {
2820
+ return Array.isArray(s) ? new Pe(s, e) : P(s) ? new ce(s, e) : new Me(s, e);
3152
2821
  }
3153
- function D(i) {
3154
- if (i)
3155
- return i.kind === "leaf" ? i.read() : i.kind === "group" ? Ie(i) : fe(i);
2822
+ function T(s) {
2823
+ if (s)
2824
+ return s.kind === "leaf" ? s.read() : s.kind === "group" ? Ce(s) : he(s);
3156
2825
  }
3157
- function Ie(i) {
2826
+ function Ce(s) {
3158
2827
  return new Proxy(
3159
2828
  {},
3160
2829
  {
3161
- get: (e, t) => t === "__path" ? i.path : typeof t == "string" ? D(i.children.get(t)) : void 0,
3162
- set: (e, t, s) => {
2830
+ get: (e, t) => t === "__path" ? s.path : typeof t == "string" ? T(s.children.get(t)) : void 0,
2831
+ set: (e, t, i) => {
3163
2832
  if (typeof t != "string") return !1;
3164
- const r = i.children.get(t);
3165
- return r && r.set(s), !0;
2833
+ const r = s.children.get(t);
2834
+ return r && r.set(i), !0;
3166
2835
  },
3167
- has: (e, t) => typeof t == "string" && i.children.has(t),
3168
- ownKeys: () => [...i.children.keys()],
3169
- getOwnPropertyDescriptor: (e, t) => typeof t == "string" && i.children.has(t) ? { enumerable: !0, configurable: !0 } : void 0
2836
+ has: (e, t) => typeof t == "string" && s.children.has(t),
2837
+ ownKeys: () => [...s.children.keys()],
2838
+ getOwnPropertyDescriptor: (e, t) => typeof t == "string" && s.children.has(t) ? { enumerable: !0, configurable: !0 } : void 0
3170
2839
  }
3171
2840
  );
3172
2841
  }
3173
- function $(i) {
3174
- if (i)
3175
- return i.kind === "group" ? pe(i) : i.kind === "array" ? fe(i) : i.read();
2842
+ function j(s) {
2843
+ if (s)
2844
+ return s.kind === "group" ? de(s) : s.kind === "array" ? he(s) : s.read();
3176
2845
  }
3177
- function fe(i) {
2846
+ function he(s) {
3178
2847
  const e = {
3179
2848
  get length() {
3180
- return i.items.value.length;
2849
+ return s.items.value.length;
3181
2850
  },
3182
- push: (t) => i.push(t),
3183
- insertAt: (t, s) => i.insertAt(t, s),
3184
- removeAt: (t) => i.removeAt(t),
3185
- move: (t, s) => i.move(t, s),
3186
- swap: (t, s) => i.swap(t, s),
3187
- clear: () => i.clear(),
3188
- at: (t) => $(i.items.value[t]),
3189
- map: (t) => i.items.value.map((s, r) => t($(s), r)),
3190
- forEach: (t) => i.items.value.forEach((s, r) => t($(s), r)),
3191
- toArray: () => i.peek(),
2851
+ push: (t) => s.push(t),
2852
+ insertAt: (t, i) => s.insertAt(t, i),
2853
+ removeAt: (t) => s.removeAt(t),
2854
+ move: (t, i) => s.move(t, i),
2855
+ swap: (t, i) => s.swap(t, i),
2856
+ clear: () => s.clear(),
2857
+ at: (t) => j(s.items.value[t]),
2858
+ map: (t) => s.items.value.map((i, r) => t(j(i), r)),
2859
+ forEach: (t) => s.items.value.forEach((i, r) => t(j(i), r)),
2860
+ toArray: () => s.peek(),
3192
2861
  [Symbol.iterator]: function* () {
3193
- const t = i.items.value;
3194
- for (let s = 0; s < t.length; s++) yield D(t[s]);
2862
+ const t = s.items.value;
2863
+ for (let i = 0; i < t.length; i++) yield T(t[i]);
3195
2864
  }
3196
2865
  };
3197
2866
  return new Proxy(e, {
3198
- get: (t, s, r) => s === "__path" ? i.path : typeof s == "string" && q(s) ? D(i.items.value[Number(s)]) : Reflect.get(t, s, r),
3199
- has: (t, s) => typeof s == "string" && q(s) ? Number(s) < i.items.value.length : Reflect.has(t, s)
2867
+ get: (t, i, r) => i === "__path" ? s.path : typeof i == "string" && U(i) ? T(s.items.value[Number(i)]) : Reflect.get(t, i, r),
2868
+ has: (t, i) => typeof i == "string" && U(i) ? Number(i) < s.items.value.length : Reflect.has(t, i)
3200
2869
  });
3201
2870
  }
3202
- function K(i) {
3203
- if (i.kind === "leaf") return i.signal;
3204
- if (i.kind === "group")
2871
+ function W(s) {
2872
+ if (s.kind === "leaf") return s.signal;
2873
+ if (s.kind === "group")
3205
2874
  return new Proxy(
3206
2875
  {},
3207
2876
  {
3208
- get: (t, s) => {
3209
- if (s === "__path") return i.path;
3210
- if (typeof s != "string") return;
3211
- const r = i.children.get(s);
3212
- return r ? K(r) : void 0;
2877
+ get: (t, i) => {
2878
+ if (i === "__path") return s.path;
2879
+ if (typeof i != "string") return;
2880
+ const r = s.children.get(i);
2881
+ return r ? W(r) : void 0;
3213
2882
  },
3214
- has: (t, s) => typeof s == "string" && i.children.has(s),
3215
- ownKeys: () => [...i.children.keys()],
3216
- getOwnPropertyDescriptor: (t, s) => typeof s == "string" && i.children.has(s) ? { enumerable: !0, configurable: !0 } : void 0
2883
+ has: (t, i) => typeof i == "string" && s.children.has(i),
2884
+ ownKeys: () => [...s.children.keys()],
2885
+ getOwnPropertyDescriptor: (t, i) => typeof i == "string" && s.children.has(i) ? { enumerable: !0, configurable: !0 } : void 0
3217
2886
  }
3218
2887
  );
3219
- const e = i;
2888
+ const e = s;
3220
2889
  return new Proxy(
3221
2890
  {
3222
2891
  get length() {
@@ -3224,29 +2893,29 @@ function K(i) {
3224
2893
  }
3225
2894
  },
3226
2895
  {
3227
- get: (t, s, r) => {
3228
- if (s === "__path") return e.path;
3229
- if (typeof s == "string" && q(s)) {
3230
- const n = e.items.value[Number(s)];
3231
- return n ? K(n) : void 0;
2896
+ get: (t, i, r) => {
2897
+ if (i === "__path") return e.path;
2898
+ if (typeof i == "string" && U(i)) {
2899
+ const n = e.items.value[Number(i)];
2900
+ return n ? W(n) : void 0;
3232
2901
  }
3233
- return Reflect.get(t, s, r);
2902
+ return Reflect.get(t, i, r);
3234
2903
  }
3235
2904
  }
3236
2905
  );
3237
2906
  }
3238
- function Le(i, e) {
2907
+ function Te(s, e) {
3239
2908
  if (!e) return;
3240
- let t = i;
3241
- for (const s of e.split(".")) {
2909
+ let t = s;
2910
+ for (const i of e.split(".")) {
3242
2911
  if (!t) return;
3243
- if (t.kind === "group") t = t.children.get(s);
3244
- else if (t.kind === "array") t = t.items.peek()[Number(s)];
2912
+ if (t.kind === "group") t = t.children.get(i);
2913
+ else if (t.kind === "array") t = t.items.peek()[Number(i)];
3245
2914
  else return;
3246
2915
  }
3247
2916
  return t && t.kind === "leaf" ? t.signal : void 0;
3248
2917
  }
3249
- const ee = /* @__PURE__ */ new Set([
2918
+ const X = /* @__PURE__ */ new Set([
3250
2919
  "$",
3251
2920
  "get",
3252
2921
  "set",
@@ -3255,192 +2924,192 @@ const ee = /* @__PURE__ */ new Set([
3255
2924
  "reset",
3256
2925
  "captureInitial",
3257
2926
  "signalAt"
3258
- ]), te = /* @__PURE__ */ new WeakMap();
3259
- function pe(i) {
3260
- const e = te.get(i);
2927
+ ]), Z = /* @__PURE__ */ new WeakMap();
2928
+ function de(s) {
2929
+ const e = Z.get(s);
3261
2930
  if (e) return e;
3262
2931
  const t = {
3263
- $: K(i),
3264
- get: () => i.peek(),
3265
- set: (r) => i.set(r),
3266
- patch: (r) => i.set(r),
3267
- isDirty: () => i.dirty(),
3268
- reset: () => i.resetToInitial(),
3269
- captureInitial: () => i.captureInitial(),
3270
- signalAt: (r) => Le(i, r)
3271
- }, s = new Proxy(
2932
+ $: W(s),
2933
+ get: () => s.peek(),
2934
+ set: (r) => s.set(r),
2935
+ patch: (r) => s.set(r),
2936
+ isDirty: () => s.dirty(),
2937
+ reset: () => s.resetToInitial(),
2938
+ captureInitial: () => s.captureInitial(),
2939
+ signalAt: (r) => Te(s, r)
2940
+ }, i = new Proxy(
3272
2941
  {},
3273
2942
  {
3274
2943
  get: (r, n) => {
3275
2944
  if (typeof n != "string") return;
3276
- const a = i.children.get(n);
3277
- if (a) return D(a);
3278
- if (ee.has(n)) return t[n];
2945
+ const a = s.children.get(n);
2946
+ if (a) return T(a);
2947
+ if (X.has(n)) return t[n];
3279
2948
  },
3280
2949
  set: (r, n, a) => {
3281
2950
  if (typeof n != "string") return !1;
3282
- const o = i.children.get(n);
2951
+ const o = s.children.get(n);
3283
2952
  return o ? (o.set(a), !0) : !1;
3284
2953
  },
3285
- has: (r, n) => typeof n == "string" && (i.children.has(n) || ee.has(n)),
3286
- ownKeys: () => [...i.children.keys()],
3287
- getOwnPropertyDescriptor: (r, n) => typeof n == "string" && i.children.has(n) ? { enumerable: !0, configurable: !0 } : void 0
2954
+ has: (r, n) => typeof n == "string" && (s.children.has(n) || X.has(n)),
2955
+ ownKeys: () => [...s.children.keys()],
2956
+ getOwnPropertyDescriptor: (r, n) => typeof n == "string" && s.children.has(n) ? { enumerable: !0, configurable: !0 } : void 0
3288
2957
  }
3289
2958
  );
3290
- return te.set(i, s), s;
2959
+ return Z.set(s, i), i;
3291
2960
  }
3292
- function Ze(i) {
3293
- const e = new de(i, "");
3294
- return pe(e);
2961
+ function Je(s) {
2962
+ const e = new ce(s, "");
2963
+ return de(e);
3295
2964
  }
3296
- const Re = (i) => {
3297
- const e = i.componentProps;
2965
+ const Ie = (s) => {
2966
+ const e = s.componentProps;
3298
2967
  return e != null && typeof e == "object" && typeof e.itemComponent == "function" && e.control != null && typeof e.control.at == "function" && typeof e.control.length == "number";
3299
- }, je = (i) => typeof i.when == "function" && Array.isArray(i.children);
3300
- function V(i, e, t, s, r) {
3301
- if (i == null || typeof i != "object") return;
3302
- if (Array.isArray(i)) {
3303
- for (const a of i) V(a, e, t, s, r);
2968
+ }, De = (s) => typeof s.when == "function" && Array.isArray(s.children);
2969
+ function V(s, e, t, i, r) {
2970
+ if (s == null || typeof s != "object") return;
2971
+ if (Array.isArray(s)) {
2972
+ for (const a of s) V(a, e, t, i, r);
3304
2973
  return;
3305
2974
  }
3306
- const n = i;
3307
- if (je(n)) {
3308
- const a = s && !!n.when(e, t);
2975
+ const n = s;
2976
+ if (De(n)) {
2977
+ const a = i && !!n.when(e, t);
3309
2978
  for (const o of n.children) V(o, e, t, a, r);
3310
2979
  return;
3311
2980
  }
3312
- if (Re(n)) {
2981
+ if (Ie(n)) {
3313
2982
  const a = n.componentProps.control, o = n.componentProps.itemComponent, l = a.length;
3314
2983
  for (let u = 0; u < l; u++) {
3315
- const y = a.at(u);
3316
- V(o(y), y, t, s, r);
2984
+ const m = a.at(u);
2985
+ V(o(m), m, t, i, r);
3317
2986
  }
3318
2987
  return;
3319
2988
  }
3320
- if (n.value instanceof ne) {
2989
+ if (n.value instanceof ie) {
3321
2990
  const a = n.validators ?? [];
3322
- a.length > 0 && (s ? r.tasks.push({ signal: n.value, validators: a, scope: e }) : r.clearSignals.push(n.value));
2991
+ a.length > 0 && (i ? r.tasks.push({ signal: n.value, validators: a, scope: e }) : r.clearSignals.push(n.value));
3323
2992
  for (const [o, l] of Object.entries(n))
3324
- o === "value" || o === "validators" || V(l, e, t, s, r);
2993
+ o === "value" || o === "validators" || V(l, e, t, i, r);
3325
2994
  return;
3326
2995
  }
3327
- for (const a of Object.values(n)) V(a, e, t, s, r);
2996
+ for (const a of Object.values(n)) V(a, e, t, i, r);
3328
2997
  }
3329
- function Y(i, e) {
2998
+ function z(s, e) {
3330
2999
  const t = { tasks: [], clearSignals: [] };
3331
- return V(e, i, i, !0, t), t;
3000
+ return V(e, s, s, !0, t), t;
3332
3001
  }
3333
- const ve = (i, e, t) => {
3334
- (i[e] ??= []).push(t);
3002
+ const fe = (s, e, t) => {
3003
+ (s[e] ??= []).push(t);
3335
3004
  };
3336
- function et(i, e) {
3337
- const { tasks: t } = Y(i, e), s = {};
3005
+ function Ye(s, e) {
3006
+ const { tasks: t } = z(s, e), i = {};
3338
3007
  for (const { signal: r, validators: n, scope: a } of t) {
3339
3008
  const o = r.peek();
3340
3009
  for (const l of n) {
3341
- const u = l(o, a, i);
3342
- u && typeof u.then == "function" || u && ve(s, r.__path, u);
3010
+ const u = l(o, a, s);
3011
+ u && typeof u.then == "function" || u && fe(i, r.__path, u);
3343
3012
  }
3344
3013
  }
3345
- return { valid: Object.keys(s).length === 0, errors: s };
3014
+ return { valid: Object.keys(i).length === 0, errors: i };
3346
3015
  }
3347
- async function tt(i, e) {
3348
- const { tasks: t } = Y(i, e), s = await me(t, i);
3349
- return { valid: Object.keys(s).length === 0, errors: s };
3016
+ async function Qe(s, e) {
3017
+ const { tasks: t } = z(s, e), i = await pe(t, s);
3018
+ return { valid: Object.keys(i).length === 0, errors: i };
3350
3019
  }
3351
- async function me(i, e) {
3020
+ async function pe(s, e) {
3352
3021
  const t = {};
3353
3022
  return await Promise.all(
3354
- i.map(async ({ signal: s, validators: r, scope: n }) => {
3355
- const a = s.peek();
3023
+ s.map(async ({ signal: i, validators: r, scope: n }) => {
3024
+ const a = i.peek();
3356
3025
  for (const o of r) {
3357
3026
  const l = await o(a, n, e);
3358
- l && ve(t, s.__path, l);
3027
+ l && fe(t, i.__path, l);
3359
3028
  }
3360
3029
  })
3361
3030
  ), t;
3362
3031
  }
3363
- async function st(i, e) {
3364
- const { tasks: t, clearSignals: s } = Y(i, e), r = await me(t, i);
3032
+ async function Xe(s, e) {
3033
+ const { tasks: t, clearSignals: i } = z(s, e), r = await pe(t, s);
3365
3034
  for (const { signal: n } of t)
3366
- X(n)?.setErrors(r[n.__path] ?? []);
3367
- for (const n of s)
3368
- X(n)?.setErrors([]);
3035
+ Y(n)?.setErrors(r[n.__path] ?? []);
3036
+ for (const n of i)
3037
+ Y(n)?.setErrors([]);
3369
3038
  return { valid: Object.keys(r).length === 0, errors: r };
3370
3039
  }
3371
- var x = { exports: {} }, B = {};
3372
- var se;
3373
- function $e() {
3374
- if (se) return B;
3375
- se = 1;
3376
- var i = ae;
3377
- function e(h, f) {
3378
- return h === f && (h !== 0 || 1 / h === 1 / f) || h !== h && f !== f;
3379
- }
3380
- var t = typeof Object.is == "function" ? Object.is : e, s = i.useState, r = i.useEffect, n = i.useLayoutEffect, a = i.useDebugValue;
3381
- function o(h, f) {
3382
- var d = f(), p = s({ inst: { value: d, getSnapshot: f } }), v = p[0].inst, b = p[1];
3040
+ var M = { exports: {} }, R = {};
3041
+ var ee;
3042
+ function Le() {
3043
+ if (ee) return R;
3044
+ ee = 1;
3045
+ var s = re;
3046
+ function e(c, f) {
3047
+ return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f;
3048
+ }
3049
+ var t = typeof Object.is == "function" ? Object.is : e, i = s.useState, r = s.useEffect, n = s.useLayoutEffect, a = s.useDebugValue;
3050
+ function o(c, f) {
3051
+ var d = f(), p = i({ inst: { value: d, getSnapshot: f } }), v = p[0].inst, g = p[1];
3383
3052
  return n(
3384
3053
  function() {
3385
- v.value = d, v.getSnapshot = f, l(v) && b({ inst: v });
3054
+ v.value = d, v.getSnapshot = f, l(v) && g({ inst: v });
3386
3055
  },
3387
- [h, d, f]
3056
+ [c, d, f]
3388
3057
  ), r(
3389
3058
  function() {
3390
- return l(v) && b({ inst: v }), h(function() {
3391
- l(v) && b({ inst: v });
3059
+ return l(v) && g({ inst: v }), c(function() {
3060
+ l(v) && g({ inst: v });
3392
3061
  });
3393
3062
  },
3394
- [h]
3063
+ [c]
3395
3064
  ), a(d), d;
3396
3065
  }
3397
- function l(h) {
3398
- var f = h.getSnapshot;
3399
- h = h.value;
3066
+ function l(c) {
3067
+ var f = c.getSnapshot;
3068
+ c = c.value;
3400
3069
  try {
3401
3070
  var d = f();
3402
- return !t(h, d);
3071
+ return !t(c, d);
3403
3072
  } catch {
3404
3073
  return !0;
3405
3074
  }
3406
3075
  }
3407
- function u(h, f) {
3076
+ function u(c, f) {
3408
3077
  return f();
3409
3078
  }
3410
- var y = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? u : o;
3411
- return B.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : y, B;
3079
+ var m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? u : o;
3080
+ return R.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : m, R;
3412
3081
  }
3413
- var G = {};
3414
- var ie;
3415
- function Be() {
3416
- return ie || (ie = 1, process.env.NODE_ENV !== "production" && (function() {
3417
- function i(d, p) {
3082
+ var $ = {};
3083
+ var te;
3084
+ function je() {
3085
+ return te || (te = 1, process.env.NODE_ENV !== "production" && (function() {
3086
+ function s(d, p) {
3418
3087
  return d === p && (d !== 0 || 1 / d === 1 / p) || d !== d && p !== p;
3419
3088
  }
3420
3089
  function e(d, p) {
3421
- y || r.startTransition === void 0 || (y = !0, console.error(
3090
+ m || r.startTransition === void 0 || (m = !0, console.error(
3422
3091
  "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."
3423
3092
  ));
3424
3093
  var v = p();
3425
- if (!h) {
3426
- var b = p();
3427
- n(v, b) || (console.error(
3094
+ if (!c) {
3095
+ var g = p();
3096
+ n(v, g) || (console.error(
3428
3097
  "The result of getSnapshot should be cached to avoid an infinite loop"
3429
- ), h = !0);
3098
+ ), c = !0);
3430
3099
  }
3431
- b = a({
3100
+ g = a({
3432
3101
  inst: { value: v, getSnapshot: p }
3433
3102
  });
3434
- var _ = b[0].inst, R = b[1];
3103
+ var b = g[0].inst, L = g[1];
3435
3104
  return l(
3436
3105
  function() {
3437
- _.value = v, _.getSnapshot = p, t(_) && R({ inst: _ });
3106
+ b.value = v, b.getSnapshot = p, t(b) && L({ inst: b });
3438
3107
  },
3439
3108
  [d, v, p]
3440
3109
  ), o(
3441
3110
  function() {
3442
- return t(_) && R({ inst: _ }), d(function() {
3443
- t(_) && R({ inst: _ });
3111
+ return t(b) && L({ inst: b }), d(function() {
3112
+ t(b) && L({ inst: b });
3444
3113
  });
3445
3114
  },
3446
3115
  [d]
@@ -3456,40 +3125,40 @@ function Be() {
3456
3125
  return !0;
3457
3126
  }
3458
3127
  }
3459
- function s(d, p) {
3128
+ function i(d, p) {
3460
3129
  return p();
3461
3130
  }
3462
3131
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
3463
- var r = ae, n = typeof Object.is == "function" ? Object.is : i, a = r.useState, o = r.useEffect, l = r.useLayoutEffect, u = r.useDebugValue, y = !1, h = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? s : e;
3464
- G.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());
3465
- })()), G;
3132
+ var r = re, n = typeof Object.is == "function" ? Object.is : s, a = r.useState, o = r.useEffect, l = r.useLayoutEffect, u = r.useDebugValue, m = !1, c = !1, f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? i : e;
3133
+ $.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());
3134
+ })()), $;
3466
3135
  }
3467
- var re;
3468
- function Ge() {
3469
- return re || (re = 1, process.env.NODE_ENV === "production" ? x.exports = $e() : x.exports = Be()), x.exports;
3136
+ var se;
3137
+ function Re() {
3138
+ return se || (se = 1, process.env.NODE_ENV === "production" ? M.exports = Le() : M.exports = je()), M.exports;
3470
3139
  }
3471
- var Q = Ge();
3472
- function Ue(i, e) {
3473
- if (i === e) return !0;
3474
- if (i.length !== e.length) return !1;
3475
- for (let t = 0; t < i.length; t++)
3476
- if (i[t] !== e[t]) return !1;
3140
+ var J = Re();
3141
+ function $e(s, e) {
3142
+ if (s === e) return !0;
3143
+ if (s.length !== e.length) return !1;
3144
+ for (let t = 0; t < s.length; t++)
3145
+ if (s[t] !== e[t]) return !1;
3477
3146
  return !0;
3478
3147
  }
3479
- function ye(i, e, t) {
3480
- const s = H(null);
3481
- if (s.current === null) {
3148
+ function ve(s, e, t) {
3149
+ const i = q(null);
3150
+ if (i.current === null) {
3482
3151
  const a = {};
3483
- for (const o in i)
3484
- a[o] = i[o].value;
3485
- s.current = { ...a, __snapshot: null };
3152
+ for (const o in s)
3153
+ a[o] = s[o].value;
3154
+ i.current = { ...a, __snapshot: null };
3486
3155
  }
3487
- const r = A(
3156
+ const r = S(
3488
3157
  (a) => {
3489
3158
  let o = !0;
3490
- return m(() => {
3491
- for (const u in i)
3492
- i[u].value;
3159
+ return _(() => {
3160
+ for (const u in s)
3161
+ s[u].value;
3493
3162
  if (o) {
3494
3163
  o = !1;
3495
3164
  return;
@@ -3497,16 +3166,16 @@ function ye(i, e, t) {
3497
3166
  a();
3498
3167
  });
3499
3168
  },
3500
- [i]
3501
- ), n = A(() => {
3502
- const a = s.current, o = {};
3503
- for (const u in i)
3504
- o[u] = i[u].value;
3169
+ [s]
3170
+ ), n = S(() => {
3171
+ const a = i.current, o = {};
3172
+ for (const u in s)
3173
+ o[u] = s[u].value;
3505
3174
  let l = !1;
3506
3175
  for (const u of e) {
3507
- const { key: y, useShallowArrayEqual: h } = u, f = o[y], d = a[y];
3508
- if (h) {
3509
- if (!Ue(d, f)) {
3176
+ const { key: m, useShallowArrayEqual: c } = u, f = o[m], d = a[m];
3177
+ if (c) {
3178
+ if (!$e(d, f)) {
3510
3179
  l = !0;
3511
3180
  break;
3512
3181
  }
@@ -3517,23 +3186,23 @@ function ye(i, e, t) {
3517
3186
  }
3518
3187
  if (!l && a.__snapshot)
3519
3188
  return a.__snapshot;
3520
- for (const u in i)
3189
+ for (const u in s)
3521
3190
  a[u] = o[u];
3522
3191
  return a.__snapshot = t(o), a.__snapshot;
3523
- }, [i, t]);
3524
- return Q.useSyncExternalStore(r, n, n);
3192
+ }, [s, t]);
3193
+ return J.useSyncExternalStore(r, n, n);
3525
3194
  }
3526
- function We(i) {
3195
+ function Be(s) {
3527
3196
  const e = {
3528
- value: i.value,
3529
- disabled: i.disabled,
3530
- errors: i.errors,
3531
- pending: i.pending,
3532
- valid: i.valid,
3533
- invalid: i.invalid,
3534
- touched: i.touched,
3535
- shouldShowError: i.shouldShowError,
3536
- componentProps: i.componentProps
3197
+ value: s.value,
3198
+ disabled: s.disabled,
3199
+ errors: s.errors,
3200
+ pending: s.pending,
3201
+ valid: s.valid,
3202
+ invalid: s.invalid,
3203
+ touched: s.touched,
3204
+ shouldShowError: s.shouldShowError,
3205
+ componentProps: s.componentProps
3537
3206
  }, t = [
3538
3207
  { key: "value" },
3539
3208
  { key: "disabled" },
@@ -3544,7 +3213,7 @@ function We(i) {
3544
3213
  { key: "touched" },
3545
3214
  { key: "shouldShowError" },
3546
3215
  { key: "componentProps" }
3547
- ], s = A(
3216
+ ], i = S(
3548
3217
  (r) => ({
3549
3218
  value: r.value,
3550
3219
  pending: r.pending,
@@ -3558,18 +3227,18 @@ function We(i) {
3558
3227
  }),
3559
3228
  []
3560
3229
  );
3561
- return ye(e, t, s);
3230
+ return ve(e, t, i);
3562
3231
  }
3563
- function qe(i) {
3232
+ function Ge(s) {
3564
3233
  const e = {
3565
- value: i.value,
3566
- length: i.length,
3567
- errors: i.errors,
3568
- pending: i.pending,
3569
- valid: i.valid,
3570
- invalid: i.invalid,
3571
- touched: i.touched,
3572
- dirty: i.dirty
3234
+ value: s.value,
3235
+ length: s.length,
3236
+ errors: s.errors,
3237
+ pending: s.pending,
3238
+ valid: s.valid,
3239
+ invalid: s.invalid,
3240
+ touched: s.touched,
3241
+ dirty: s.dirty
3573
3242
  }, t = [
3574
3243
  { key: "value" },
3575
3244
  { key: "length" },
@@ -3579,7 +3248,7 @@ function qe(i) {
3579
3248
  { key: "invalid" },
3580
3249
  { key: "touched" },
3581
3250
  { key: "dirty" }
3582
- ], s = A(
3251
+ ], i = S(
3583
3252
  (r) => ({
3584
3253
  value: r.value,
3585
3254
  length: r.length,
@@ -3592,11 +3261,11 @@ function qe(i) {
3592
3261
  }),
3593
3262
  []
3594
3263
  );
3595
- return ye(e, t, s);
3264
+ return ve(e, t, i);
3596
3265
  }
3597
- function it(i) {
3598
- const e = i && "length" in i && "map" in i;
3599
- return i ? e ? qe(i) : We(i) : {
3266
+ function Ze(s) {
3267
+ const e = s && "length" in s && "map" in s;
3268
+ return s ? e ? Ge(s) : Be(s) : {
3600
3269
  value: [],
3601
3270
  length: 0,
3602
3271
  pending: !1,
@@ -3607,89 +3276,86 @@ function it(i) {
3607
3276
  dirty: !1
3608
3277
  };
3609
3278
  }
3610
- function rt(i) {
3611
- const e = H({ value: i.value.value }), t = A(
3279
+ function et(s) {
3280
+ const e = q({ value: s.value.value }), t = S(
3612
3281
  (r) => {
3613
3282
  let n = !0;
3614
- return m(() => {
3615
- if (i.value.value, n) {
3283
+ return _(() => {
3284
+ if (s.value.value, n) {
3616
3285
  n = !1;
3617
3286
  return;
3618
3287
  }
3619
3288
  r();
3620
3289
  });
3621
3290
  },
3622
- [i]
3623
- ), s = A(() => {
3624
- const r = i.value.value;
3291
+ [s]
3292
+ ), i = S(() => {
3293
+ const r = s.value.value;
3625
3294
  return e.current.value === r ? e.current.value : (e.current.value = r, r);
3626
- }, [i]);
3627
- return Q.useSyncExternalStore(t, s, s);
3295
+ }, [s]);
3296
+ return J.useSyncExternalStore(t, i, i);
3628
3297
  }
3629
- function nt(i) {
3630
- const e = H({ length: i.length.value }), t = A(
3298
+ function tt(s) {
3299
+ const e = q({ length: s.length.value }), t = S(
3631
3300
  (r) => {
3632
3301
  let n = !0;
3633
- return m(() => {
3634
- if (i.length.value, n) {
3302
+ return _(() => {
3303
+ if (s.length.value, n) {
3635
3304
  n = !1;
3636
3305
  return;
3637
3306
  }
3638
3307
  r();
3639
3308
  });
3640
3309
  },
3641
- [i]
3642
- ), s = A(() => {
3643
- const r = i.length.value;
3310
+ [s]
3311
+ ), i = S(() => {
3312
+ const r = s.length.value;
3644
3313
  return e.current.length === r ? e.current.length : (e.current.length = r, r);
3645
- }, [i]);
3646
- return Q.useSyncExternalStore(t, s, s);
3314
+ }, [s]);
3315
+ return J.useSyncExternalStore(t, i, i);
3647
3316
  }
3648
3317
  export {
3649
- P as AbstractRegistry,
3650
- Z as ArrayNode,
3651
- S as ErrorStrategy,
3652
- we as FieldNode,
3318
+ Q as ArrayNode,
3319
+ w as ErrorStrategy,
3320
+ _e as FieldNode,
3653
3321
  k as FormErrorHandler,
3654
3322
  I as FormNode,
3655
- Xe as FormObserver,
3656
- Ee as FormStatusMachine,
3657
- ke as FormSubmitter,
3658
- T as GroupNode,
3659
- Pe as ModelArrayNode,
3660
- Oe as NodeFactory,
3661
- Fe as RegistryStack,
3662
- z as SubscriptionManager,
3663
- lt as computeFrom,
3664
- ut as copyFrom,
3665
- Qe as createForm,
3666
- ce as createFormFromModel,
3667
- Ze as createModel,
3668
- ht as disableWhen,
3669
- ct as enableWhen,
3670
- X as getNodeForSignal,
3671
- Ye as getNodeType,
3672
- xe as isArrayNode,
3673
- U as isDerived,
3674
- Ne as isFieldNode,
3675
- L as isFormNode,
3676
- Te as isGroupNode,
3677
- dt as markDerived,
3678
- be as registerSignalNode,
3679
- ft as resetWhen,
3680
- pt as revalidateWhen,
3681
- vt as runOutsideEffect,
3682
- mt as safeCallback,
3683
- yt as safeDebouncedCallback,
3684
- gt as syncFields,
3685
- bt as transformValue,
3686
- F as uniqueId,
3687
- nt as useArrayLength,
3688
- it as useFormControl,
3689
- rt as useFormControlValue,
3690
- st as validateFormModel,
3691
- tt as validateModel,
3692
- et as validateModelSync,
3693
- wt as validators,
3694
- _t as watchField
3323
+ be as FormStatusMachine,
3324
+ Se as FormSubmitter,
3325
+ x as GroupNode,
3326
+ Fe as ModelArrayNode,
3327
+ ke as NodeFactory,
3328
+ K as SubscriptionManager,
3329
+ rt as computeFrom,
3330
+ nt as copyFrom,
3331
+ ze as createForm,
3332
+ ue as createFormFromModel,
3333
+ Je as createModel,
3334
+ at as disableWhen,
3335
+ ot as enableWhen,
3336
+ Y as getNodeForSignal,
3337
+ He as getNodeType,
3338
+ Ne as isArrayNode,
3339
+ B as isDerived,
3340
+ Ve as isFieldNode,
3341
+ D as isFormNode,
3342
+ Oe as isGroupNode,
3343
+ lt as markDerived,
3344
+ ye as registerSignalNode,
3345
+ ut as resetWhen,
3346
+ ct as revalidateWhen,
3347
+ ht as runOutsideEffect,
3348
+ dt as safeCallback,
3349
+ ft as safeDebouncedCallback,
3350
+ pt as syncFields,
3351
+ vt as transformValue,
3352
+ N as uniqueId,
3353
+ tt as useArrayLength,
3354
+ Ze as useFormControl,
3355
+ et as useFormControlValue,
3356
+ Xe as validateFormModel,
3357
+ Qe as validateModel,
3358
+ Ye as validateModelSync,
3359
+ gt as validators,
3360
+ mt as watchField
3695
3361
  };