@harnessio/forms 1.0.1 → 1.2.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.
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
- var Dt = Object.defineProperty;
2
- var Lt = (r, e, t) => e in r ? Dt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var ye = (r, e, t) => Lt(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { isEmpty as Ce, set as M, get as E, forOwn as kt, isArray as J, isObject as wt, merge as oe, isUndefined as Oe, cloneDeep as le, unset as Tt, isPlainObject as qt, isNull as Ct, isString as zt, omitBy as Bt, isNil as Ut, capitalize as Wt } from "lodash-es";
5
- import Jt, { createContext as Ht, useContext as Yt, Component as Gt, memo as Qt, useMemo as ge, useRef as G, useEffect as Y, useCallback as Xt, forwardRef as Kt, Fragment as er } from "react";
6
- import { useFormContext as tr, get as rr, useForm as nr, FormProvider as sr, appendErrors as ar, useController as ir } from "react-hook-form";
7
- import { Controller as Pn, Form as $n, FormProvider as Mn, get as Fn, set as Dn, useFieldArray as Ln, useForm as qn, useFormContext as zn, useFormState as Bn, useWatch as Un } from "react-hook-form";
8
- import { toNestErrors as or } from "@hookform/resolvers";
9
- class ur extends Error {
1
+ var zt = Object.defineProperty;
2
+ var Bt = (r, e, t) => e in r ? zt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var ye = (r, e, t) => Bt(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { isEmpty as Ce, set as P, get as E, forOwn as St, isArray as J, isObject as Ot, merge as te, isUndefined as Se, cloneDeep as de, unset as Rt, isPlainObject as Ut, isNull as Et, isString as Wt, omitBy as Jt, isNil as Ht, capitalize as Yt } from "lodash-es";
5
+ import Gt, { createContext as Qt, useContext as Xt, Component as Kt, memo as er, useMemo as ge, useRef as G, useEffect as Y, useCallback as tr, forwardRef as rr, Fragment as nr } from "react";
6
+ import { useFormContext as sr, get as ar, useForm as ir, FormProvider as or, appendErrors as ur, useController as cr } from "react-hook-form";
7
+ import { Controller as Dn, Form as Ln, FormProvider as qn, get as zn, set as Bn, useFieldArray as Un, useForm as Wn, useFormContext as Jn, useFormState as Hn, useWatch as Yn } from "react-hook-form";
8
+ import { toNestErrors as dr } from "@hookform/resolvers";
9
+ class lr extends Error {
10
10
  constructor(e) {
11
11
  super(`Input component '${e}' is already registered.`);
12
12
  }
13
13
  }
14
- class Ot {
14
+ class At {
15
15
  constructor(e) {
16
16
  ye(this, "componentBank");
17
17
  ye(this, "allowOverride");
@@ -25,7 +25,7 @@ class Ot {
25
25
  */
26
26
  registerComponent(e) {
27
27
  if (!this.allowOverride && this.getComponent(e.internalType))
28
- throw new ur(e.internalType);
28
+ throw new lr(e.internalType);
29
29
  this.componentBank.set(e.internalType, e);
30
30
  }
31
31
  getComponent(e) {
@@ -46,7 +46,7 @@ class Ot {
46
46
  * @returns new input factory
47
47
  */
48
48
  clone() {
49
- const e = new Ot({
49
+ const e = new At({
50
50
  allowOverride: this.allowOverride
51
51
  });
52
52
  return this.listRegisteredComponents().forEach((t) => {
@@ -54,16 +54,16 @@ class Ot {
54
54
  }), e;
55
55
  }
56
56
  }
57
- var Se = { exports: {} }, K = {};
57
+ var Oe = { exports: {} }, ee = {};
58
58
  /*
59
59
  object-assign
60
60
  (c) Sindre Sorhus
61
61
  @license MIT
62
62
  */
63
- var Re, et;
64
- function cr() {
65
- if (et) return Re;
66
- et = 1;
63
+ var Re, nt;
64
+ function fr() {
65
+ if (nt) return Re;
66
+ nt = 1;
67
67
  var r = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
68
68
  function n(s) {
69
69
  if (s == null)
@@ -114,14 +114,14 @@ function cr() {
114
114
  * This source code is licensed under the MIT license found in the
115
115
  * LICENSE file in the root directory of this source tree.
116
116
  */
117
- var tt;
118
- function dr() {
119
- if (tt) return K;
120
- tt = 1, cr();
121
- var r = Jt, e = 60103;
122
- if (K.Fragment = 60107, typeof Symbol == "function" && Symbol.for) {
117
+ var st;
118
+ function hr() {
119
+ if (st) return ee;
120
+ st = 1, fr();
121
+ var r = Gt, e = 60103;
122
+ if (ee.Fragment = 60107, typeof Symbol == "function" && Symbol.for) {
123
123
  var t = Symbol.for;
124
- e = t("react.element"), K.Fragment = t("react.fragment");
124
+ e = t("react.element"), ee.Fragment = t("react.fragment");
125
125
  }
126
126
  var n = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = Object.prototype.hasOwnProperty, s = { key: !0, ref: !0, __self: !0, __source: !0 };
127
127
  function i(o, u, c) {
@@ -131,22 +131,22 @@ function dr() {
131
131
  if (o && o.defaultProps) for (d in u = o.defaultProps, u) y[d] === void 0 && (y[d] = u[d]);
132
132
  return { $$typeof: e, type: o, key: h, ref: v, props: y, _owner: n.current };
133
133
  }
134
- return K.jsx = i, K.jsxs = i, K;
134
+ return ee.jsx = i, ee.jsxs = i, ee;
135
135
  }
136
- var rt;
137
- function lr() {
138
- return rt || (rt = 1, Se.exports = dr()), Se.exports;
136
+ var at;
137
+ function mr() {
138
+ return at || (at = 1, Oe.exports = hr()), Oe.exports;
139
139
  }
140
- var O = lr();
141
- const St = Ht({});
142
- function fr({
140
+ var S = mr();
141
+ const It = Qt({});
142
+ function pr({
143
143
  children: r,
144
144
  metadata: e,
145
145
  inputErrorHandler: t,
146
146
  readonly: n
147
147
  }) {
148
- return /* @__PURE__ */ O.jsx(
149
- St.Provider,
148
+ return /* @__PURE__ */ S.jsx(
149
+ It.Provider,
150
150
  {
151
151
  value: {
152
152
  metadata: e,
@@ -157,11 +157,11 @@ function fr({
157
157
  }
158
158
  );
159
159
  }
160
- function hr() {
161
- const r = Yt(St);
160
+ function yr() {
161
+ const r = Xt(It);
162
162
  return r || console.warn("useRootFormContext must be used within RootFormProvider"), r;
163
163
  }
164
- class mr extends Gt {
164
+ class gr extends Kt {
165
165
  constructor() {
166
166
  super(...arguments);
167
167
  ye(this, "state", {
@@ -180,13 +180,13 @@ class mr extends Gt {
180
180
  (i = (s = this.props).inputErrorHandler) == null || i.call(s, a);
181
181
  }
182
182
  render() {
183
- return this.state.hasError ? /* @__PURE__ */ O.jsx(O.Fragment, {}) : this.props.children;
183
+ return this.state.hasError ? /* @__PURE__ */ S.jsx(S.Fragment, {}) : this.props.children;
184
184
  }
185
185
  }
186
- const nt = ({
186
+ const it = ({
187
187
  children: r,
188
188
  withoutWrapper: e = !1
189
- }) => e || !r ? r : /* @__PURE__ */ O.jsx("div", { children: r }), pr = Qt(function({
189
+ }) => e || !r ? r : /* @__PURE__ */ S.jsx("div", { children: r }), _r = er(function({
190
190
  path: e,
191
191
  factory: t,
192
192
  onUpdate: n,
@@ -195,20 +195,20 @@ const nt = ({
195
195
  input: i,
196
196
  withoutWrapper: o = !1
197
197
  }) {
198
- var We, Je, He, Ye, Ge;
199
- const u = tr(), { formState: c } = u, { fixedValues: d = {} } = {}, { metadata: y, readonly: h, inputErrorHandler: v } = hr(), S = t == null ? void 0 : t.getComponent(i.inputType), w = !!(i.isVisible || typeof i.disabled == "function" || typeof ((We = i.validation) == null ? void 0 : We.schema) == "function" || typeof ((Je = i.warning) == null ? void 0 : Je.schema) == "function"), R = !!((He = i.warning) != null && He.schema || (Ye = i.validation) != null && Ye.schema), T = w ? u.watch() : {}, V = R ? w ? rr(T, i.path) : u.watch(i.path) : void 0, Z = ge(() => {
198
+ var Ye, Ge, Qe, Xe, Ke;
199
+ const u = sr(), { formState: c } = u, { fixedValues: d = {} } = {}, { metadata: y, readonly: h, inputErrorHandler: v } = yr(), O = t == null ? void 0 : t.getComponent(i.inputType), w = !!(i.isVisible || typeof i.disabled == "function" || typeof ((Ye = i.validation) == null ? void 0 : Ye.schema) == "function" || typeof ((Ge = i.warning) == null ? void 0 : Ge.schema) == "function"), R = !!((Qe = i.warning) != null && Qe.schema || (Xe = i.validation) != null && Xe.schema), T = w ? u.watch() : {}, V = R ? w ? ar(T, i.path) : u.watch(i.path) : void 0, Z = ge(() => {
200
200
  if (!w) return {};
201
- let ae = T;
201
+ let ie = T;
202
202
  return d && Object.keys(d).forEach((pe) => {
203
- const ie = d[pe];
204
- ae = M(ae, pe, ie);
205
- }), ae;
206
- }, [w, T, d]), H = !i.isVisible || i.isVisible(Z, y), j = h || i.readonly, $ = typeof i.disabled == "function" ? i.disabled(Z, y) : i.disabled, I = (Ge = i.warning) == null ? void 0 : Ge.schema, Be = ge(() => {
207
- var Xe, Ke;
208
- if (!H || typeof I > "u") return;
209
- const ae = typeof I == "function" ? I(Z, y) : I, { success: pe, error: ie } = ae.safeParse(V), Qe = (Ke = (Xe = ie == null ? void 0 : ie.errors) == null ? void 0 : Xe[0]) == null ? void 0 : Ke.message;
210
- return !pe && Qe ? Qe : void 0;
211
- }, [i.path, V, I, H, y]), Ue = ge(
203
+ const oe = d[pe];
204
+ ie = P(ie, pe, oe);
205
+ }), ie;
206
+ }, [w, T, d]), H = !i.isVisible || i.isVisible(Z, y), A = h || i.readonly, M = typeof i.disabled == "function" ? i.disabled(Z, y) : i.disabled, j = (Ke = i.warning) == null ? void 0 : Ke.schema, Je = ge(() => {
207
+ var tt, rt;
208
+ if (!H || typeof j > "u") return;
209
+ const ie = typeof j == "function" ? j(Z, y) : j, { success: pe, error: oe } = ie.safeParse(V), et = (rt = (tt = oe == null ? void 0 : oe.errors) == null ? void 0 : tt[0]) == null ? void 0 : rt.message;
210
+ return !pe && et ? et : void 0;
211
+ }, [i.path, V, j, H, y]), He = ge(
212
212
  () => ({
213
213
  path: e,
214
214
  key: e,
@@ -216,29 +216,29 @@ const nt = ({
216
216
  onUpdate: n,
217
217
  onChange: a,
218
218
  factory: t,
219
- readonly: j,
219
+ readonly: A,
220
220
  input: i,
221
- disabled: $,
222
- warning: Be
221
+ disabled: M,
222
+ warning: Je
223
223
  }),
224
- [t, s, i, a, n, e, j, c.errors, $, Be]
225
- ), Ft = ge(() => H ? /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
224
+ [t, s, i, a, n, e, A, c.errors, M, Je]
225
+ ), qt = ge(() => H ? /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
226
226
  i.before ? i.before : null,
227
- /* @__PURE__ */ O.jsx(mr, { path: e, inputType: i.inputType, inputErrorHandler: v, children: S == null ? void 0 : S.renderComponent(Ue) }),
227
+ /* @__PURE__ */ S.jsx(gr, { path: e, inputType: i.inputType, inputErrorHandler: v, children: O == null ? void 0 : O.renderComponent(He) }),
228
228
  i.after ? i.after : null
229
- ] }) : null, [H, i.before, i.inputType, i.after, e, S, Ue, c.errors]);
230
- return S ? /* @__PURE__ */ O.jsx(nt, { withoutWrapper: o, children: Ft }) : /* @__PURE__ */ O.jsx(nt, { withoutWrapper: o, children: /* @__PURE__ */ O.jsxs("p", { children: [
229
+ ] }) : null, [H, i.before, i.inputType, i.after, e, O, He, c.errors]);
230
+ return O ? /* @__PURE__ */ S.jsx(it, { withoutWrapper: o, children: qt }) : /* @__PURE__ */ S.jsx(it, { withoutWrapper: o, children: /* @__PURE__ */ S.jsxs("p", { children: [
231
231
  "Input component not found (internal type: ",
232
232
  i.inputType,
233
233
  ")"
234
234
  ] }) });
235
235
  });
236
- class fn {
236
+ class yn {
237
237
  getType() {
238
238
  return this.internalType;
239
239
  }
240
240
  }
241
- function st() {
241
+ function ot() {
242
242
  return typeof window < "u" && "requestIdleCallback" in window ? window.requestIdleCallback : function(r, e) {
243
243
  const t = Date.now(), n = (e == null ? void 0 : e.timeout) || 1;
244
244
  return setTimeout(function() {
@@ -251,10 +251,10 @@ function st() {
251
251
  }, n);
252
252
  };
253
253
  }
254
- function at() {
254
+ function ut() {
255
255
  return typeof window < "u" && "cancelIdleCallback" in window ? window.cancelIdleCallback : clearTimeout;
256
256
  }
257
- function hn(r) {
257
+ function gn(r) {
258
258
  const {
259
259
  mode: e = "onSubmit",
260
260
  resolver: t,
@@ -273,17 +273,17 @@ function hn(r) {
273
273
  // fixedValues
274
274
  autoFocusPath: y,
275
275
  readonly: h
276
- } = r, v = nr({
276
+ } = r, v = ir({
277
277
  mode: e,
278
278
  reValidateMode: "onChange",
279
279
  defaultValues: n,
280
280
  shouldFocusError: a,
281
281
  resolver: t
282
- }), S = G(!1), w = G(JSON.stringify(n ?? {}));
282
+ }), O = G(!1), w = G(JSON.stringify(n ?? {}));
283
283
  Y(() => {
284
284
  w.current = JSON.stringify(n ?? {}), v.reset(n, {});
285
285
  }, [v.reset, n]), Y(() => {
286
- const j = st(), $ = at(), I = j(() => {
286
+ const A = ot(), M = ut(), j = A(() => {
287
287
  v.reset({}, {
288
288
  keepErrors: !0,
289
289
  keepDirty: !0,
@@ -297,7 +297,7 @@ function hn(r) {
297
297
  keepSubmitCount: !0
298
298
  });
299
299
  });
300
- return () => $(I);
300
+ return () => M(j);
301
301
  }, []);
302
302
  const { handleSubmit: R } = v, T = G(s);
303
303
  Y(() => {
@@ -309,64 +309,64 @@ function hn(r) {
309
309
  }, [i]);
310
310
  const Z = G(!1);
311
311
  Y(() => {
312
- const j = v.watch(($) => {
313
- var I;
314
- Z.current || JSON.stringify($ ?? {}) !== w.current && ((I = T.current) == null || I.call(T, { ...$ }), S.current === !0 && (Z.current = !0, v.trigger().finally(() => {
312
+ const A = v.watch((M) => {
313
+ var j;
314
+ Z.current || JSON.stringify(M ?? {}) !== w.current && ((j = T.current) == null || j.call(T, { ...M }), O.current === !0 && (Z.current = !0, v.trigger().finally(() => {
315
315
  Z.current = !1;
316
316
  })));
317
317
  });
318
318
  return () => {
319
- j.unsubscribe();
319
+ A.unsubscribe();
320
320
  };
321
321
  }, [v]);
322
322
  const H = G(!0);
323
323
  return Y(() => {
324
- var j;
324
+ var A;
325
325
  if (H.current) {
326
326
  H.current = !1;
327
327
  return;
328
328
  }
329
- (j = V.current) == null || j.call(V, { isValid: v.formState.isValid, isSubmitted: v.formState.isSubmitted });
329
+ (A = V.current) == null || A.call(V, { isValid: v.formState.isValid, isSubmitted: v.formState.isSubmitted });
330
330
  }, [v.formState.isValid, v.formState.isSubmitted]), Y(() => {
331
331
  if (y) {
332
- const j = st(), $ = at(), I = j(() => {
332
+ const A = ot(), M = ut(), j = A(() => {
333
333
  v.setFocus(y);
334
334
  });
335
- return () => $(I);
335
+ return () => M(j);
336
336
  }
337
- }, [v, y]), /* @__PURE__ */ O.jsx(fr, { metadata: c, readonly: h, inputErrorHandler: u, children: /* @__PURE__ */ O.jsx(sr, { ...v, children: typeof d == "function" ? d({
337
+ }, [v, y]), /* @__PURE__ */ S.jsx(pr, { metadata: c, readonly: h, inputErrorHandler: u, children: /* @__PURE__ */ S.jsx(or, { ...v, children: typeof d == "function" ? d({
338
338
  ...v,
339
339
  submitForm: async () => {
340
- o && (S.current = !0, R((j) => {
341
- o(j);
340
+ o && (O.current = !0, R((A) => {
341
+ o(A);
342
342
  })());
343
343
  }
344
344
  }) : d }) });
345
345
  }
346
- const mn = (r) => {
346
+ const _n = (r) => {
347
347
  const e = {}, t = (n) => {
348
348
  n.forEach((a) => {
349
349
  const { path: s, default: i, inputs: o } = a;
350
- Array.isArray(o) ? t(o) : E(e, s) === void 0 && M(e, s, i);
350
+ Array.isArray(o) ? t(o) : E(e, s) === void 0 && P(e, s, i);
351
351
  });
352
352
  };
353
353
  return Array.isArray(r.inputs) && t(r.inputs), e;
354
354
  };
355
- function pn(r, e) {
355
+ function vn(r, e) {
356
356
  const t = r.inputs.map((n) => {
357
- const a = yr(e, n.path);
357
+ const a = vr(e, n.path);
358
358
  return a || n;
359
359
  });
360
360
  return { ...r, inputs: t };
361
361
  }
362
- function yr(r, e) {
362
+ function vr(r, e) {
363
363
  return r.inputs.find((t) => t.path === e);
364
364
  }
365
- const Rt = "__temp_", yn = (r) => Rt + r.split(".").join("__");
366
- function gr(r) {
365
+ const jt = "__temp_", xn = (r) => jt + r.split(".").join("__");
366
+ function xr(r) {
367
367
  const e = { ...r };
368
- return kt(e, (t, n) => {
369
- n.startsWith(Rt) && delete e[n];
368
+ return St(e, (t, n) => {
369
+ n.startsWith(jt) && delete e[n];
370
370
  }), e;
371
371
  }
372
372
  var k;
@@ -406,14 +406,14 @@ var k;
406
406
  }
407
407
  r.joinValues = n, r.jsonStringifyReplacer = (a, s) => typeof s == "bigint" ? s.toString() : s;
408
408
  })(k || (k = {}));
409
- var it;
409
+ var ct;
410
410
  (function(r) {
411
411
  r.mergeShapes = (e, t) => ({
412
412
  ...e,
413
413
  ...t
414
414
  // second overwrites first
415
415
  });
416
- })(it || (it = {}));
416
+ })(ct || (ct = {}));
417
417
  const m = k.arrayToEnum([
418
418
  "string",
419
419
  "nan",
@@ -538,7 +538,7 @@ class F extends Error {
538
538
  }
539
539
  }
540
540
  F.create = (r) => new F(r);
541
- const Ie = (r, e) => {
541
+ const Ne = (r, e) => {
542
542
  let t;
543
543
  switch (r.code) {
544
544
  case l.invalid_type:
@@ -594,11 +594,11 @@ const Ie = (r, e) => {
594
594
  }
595
595
  return { message: t };
596
596
  };
597
- let _r = Ie;
598
- function vr() {
599
- return _r;
597
+ let br = Ne;
598
+ function kr() {
599
+ return br;
600
600
  }
601
- const xr = (r) => {
601
+ const wr = (r) => {
602
602
  const { data: e, path: t, errorMaps: n, issueData: a } = r, s = [...t, ...a.path || []], i = {
603
603
  ...a,
604
604
  path: s
@@ -620,7 +620,7 @@ const xr = (r) => {
620
620
  };
621
621
  };
622
622
  function f(r, e) {
623
- const t = vr(), n = xr({
623
+ const t = kr(), n = wr({
624
624
  issueData: e,
625
625
  data: r.data,
626
626
  path: r.path,
@@ -631,13 +631,13 @@ function f(r, e) {
631
631
  // then schema-bound map if available
632
632
  t,
633
633
  // then global override map
634
- t === Ie ? void 0 : Ie
634
+ t === Ne ? void 0 : Ne
635
635
  // then global default map
636
636
  ].filter((a) => !!a)
637
637
  });
638
638
  r.common.issues.push(n);
639
639
  }
640
- class A {
640
+ class I {
641
641
  constructor() {
642
642
  this.value = "valid";
643
643
  }
@@ -665,7 +665,7 @@ class A {
665
665
  value: i
666
666
  });
667
667
  }
668
- return A.mergeObjectSync(e, n);
668
+ return I.mergeObjectSync(e, n);
669
669
  }
670
670
  static mergeObjectSync(e, t) {
671
671
  const n = {};
@@ -680,7 +680,7 @@ class A {
680
680
  }
681
681
  const g = Object.freeze({
682
682
  status: "aborted"
683
- }), ue = (r) => ({ status: "dirty", value: r }), N = (r) => ({ status: "valid", value: r }), ot = (r) => r.status === "aborted", ut = (r) => r.status === "dirty", te = (r) => r.status === "valid", xe = (r) => typeof Promise < "u" && r instanceof Promise;
683
+ }), ue = (r) => ({ status: "dirty", value: r }), N = (r) => ({ status: "valid", value: r }), dt = (r) => r.status === "aborted", lt = (r) => r.status === "dirty", ne = (r) => r.status === "valid", xe = (r) => typeof Promise < "u" && r instanceof Promise;
684
684
  var p;
685
685
  (function(r) {
686
686
  r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
@@ -693,8 +693,8 @@ class U {
693
693
  return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
694
694
  }
695
695
  }
696
- const ct = (r, e) => {
697
- if (te(e))
696
+ const ft = (r, e) => {
697
+ if (ne(e))
698
698
  return { success: !0, data: e.value };
699
699
  if (!r.common.issues.length)
700
700
  throw new Error("Validation failed but no issues detected.");
@@ -738,7 +738,7 @@ class b {
738
738
  }
739
739
  _processInputParams(e) {
740
740
  return {
741
- status: new A(),
741
+ status: new I(),
742
742
  ctx: {
743
743
  common: e.parent.common,
744
744
  data: e.data,
@@ -778,7 +778,7 @@ class b {
778
778
  data: e,
779
779
  parsedType: L(e)
780
780
  }, a = this._parseSync({ data: e, path: n.path, parent: n });
781
- return ct(n, a);
781
+ return ft(n, a);
782
782
  }
783
783
  "~validate"(e) {
784
784
  var n, a;
@@ -796,7 +796,7 @@ class b {
796
796
  if (!this["~standard"].async)
797
797
  try {
798
798
  const s = this._parseSync({ data: e, path: [], parent: t });
799
- return te(s) ? {
799
+ return ne(s) ? {
800
800
  value: s.value
801
801
  } : {
802
802
  issues: t.common.issues
@@ -807,7 +807,7 @@ class b {
807
807
  async: !0
808
808
  };
809
809
  }
810
- return this._parseAsync({ data: e, path: [], parent: t }).then((s) => te(s) ? {
810
+ return this._parseAsync({ data: e, path: [], parent: t }).then((s) => ne(s) ? {
811
811
  value: s.value
812
812
  } : {
813
813
  issues: t.common.issues
@@ -832,7 +832,7 @@ class b {
832
832
  data: e,
833
833
  parsedType: L(e)
834
834
  }, a = this._parse({ data: e, path: n.path, parent: n }), s = await (xe(a) ? a : Promise.resolve(a));
835
- return ct(n, s);
835
+ return ft(n, s);
836
836
  }
837
837
  refine(e, t) {
838
838
  const n = (a) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(a) : t;
@@ -848,7 +848,7 @@ class b {
848
848
  return this._refinement((n, a) => e(n) ? !0 : (a.addIssue(typeof t == "function" ? t(n, a) : t), !1));
849
849
  }
850
850
  _refinement(e) {
851
- return new ne({
851
+ return new K({
852
852
  schema: this,
853
853
  typeName: _.ZodEffects,
854
854
  effect: { type: "refinement", refinement: e }
@@ -868,13 +868,13 @@ class b {
868
868
  return z.create(this, this._def);
869
869
  }
870
870
  nullable() {
871
- return se.create(this, this._def);
871
+ return ae.create(this, this._def);
872
872
  }
873
873
  nullish() {
874
874
  return this.nullable().optional();
875
875
  }
876
876
  array() {
877
- return P.create(this);
877
+ return $.create(this);
878
878
  }
879
879
  promise() {
880
880
  return Te.create(this, this._def);
@@ -886,7 +886,7 @@ class b {
886
886
  return we.create(this, e, this._def);
887
887
  }
888
888
  transform(e) {
889
- return new ne({
889
+ return new K({
890
890
  ...x(this._def),
891
891
  schema: this,
892
892
  typeName: _.ZodEffects,
@@ -895,7 +895,7 @@ class b {
895
895
  }
896
896
  default(e) {
897
897
  const t = typeof e == "function" ? e : () => e;
898
- return new Ze({
898
+ return new Pe({
899
899
  ...x(this._def),
900
900
  innerType: this,
901
901
  defaultValue: t,
@@ -903,7 +903,7 @@ class b {
903
903
  });
904
904
  }
905
905
  brand() {
906
- return new zr({
906
+ return new Wr({
907
907
  typeName: _.ZodBranded,
908
908
  type: this,
909
909
  ...x(this._def)
@@ -911,7 +911,7 @@ class b {
911
911
  }
912
912
  catch(e) {
913
913
  const t = typeof e == "function" ? e : () => e;
914
- return new Pe({
914
+ return new $e({
915
915
  ...x(this._def),
916
916
  innerType: this,
917
917
  catchValue: t,
@@ -929,7 +929,7 @@ class b {
929
929
  return Le.create(this, e);
930
930
  }
931
931
  readonly() {
932
- return $e.create(this);
932
+ return Me.create(this);
933
933
  }
934
934
  isOptional() {
935
935
  return this.safeParse(void 0).success;
@@ -938,28 +938,28 @@ class b {
938
938
  return this.safeParse(null).success;
939
939
  }
940
940
  }
941
- const br = /^c[^\s-]{8,}$/i, kr = /^[0-9a-z]+$/, wr = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Tr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Cr = /^[a-z0-9_-]{21}$/i, Or = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Sr = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Rr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Er = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
941
+ const Tr = /^c[^\s-]{8,}$/i, Cr = /^[0-9a-z]+$/, Sr = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Or = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Rr = /^[a-z0-9_-]{21}$/i, Er = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ar = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Ir = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, jr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
942
942
  let Ee;
943
- const jr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Ar = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ir = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Nr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Vr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Zr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Et = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Pr = new RegExp(`^${Et}$`);
944
- function jt(r) {
943
+ const Nr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Vr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Zr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Pr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, $r = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Mr = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Nt = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Fr = new RegExp(`^${Nt}$`);
944
+ function Vt(r) {
945
945
  let e = "[0-5]\\d";
946
946
  r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
947
947
  const t = r.precision ? "+" : "?";
948
948
  return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
949
949
  }
950
- function $r(r) {
951
- return new RegExp(`^${jt(r)}$`);
950
+ function Dr(r) {
951
+ return new RegExp(`^${Vt(r)}$`);
952
952
  }
953
- function Mr(r) {
954
- let e = `${Et}T${jt(r)}`;
953
+ function Lr(r) {
954
+ let e = `${Nt}T${Vt(r)}`;
955
955
  const t = [];
956
956
  return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
957
957
  }
958
- function Fr(r, e) {
959
- return !!((e === "v4" || !e) && jr.test(r) || (e === "v6" || !e) && Ir.test(r));
958
+ function qr(r, e) {
959
+ return !!((e === "v4" || !e) && Nr.test(r) || (e === "v6" || !e) && Zr.test(r));
960
960
  }
961
- function Dr(r, e) {
962
- if (!Or.test(r))
961
+ function zr(r, e) {
962
+ if (!Er.test(r))
963
963
  return !1;
964
964
  try {
965
965
  const [t] = r.split(".");
@@ -971,8 +971,8 @@ function Dr(r, e) {
971
971
  return !1;
972
972
  }
973
973
  }
974
- function Lr(r, e) {
975
- return !!((e === "v4" || !e) && Ar.test(r) || (e === "v6" || !e) && Nr.test(r));
974
+ function Br(r, e) {
975
+ return !!((e === "v4" || !e) && Vr.test(r) || (e === "v6" || !e) && Pr.test(r));
976
976
  }
977
977
  class q extends b {
978
978
  _parse(e) {
@@ -984,7 +984,7 @@ class q extends b {
984
984
  received: s.parsedType
985
985
  }), g;
986
986
  }
987
- const n = new A();
987
+ const n = new I();
988
988
  let a;
989
989
  for (const s of this._def.checks)
990
990
  if (s.kind === "min")
@@ -1023,43 +1023,43 @@ class q extends b {
1023
1023
  message: s.message
1024
1024
  }), n.dirty());
1025
1025
  } else if (s.kind === "email")
1026
- Rr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1026
+ Ir.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1027
1027
  validation: "email",
1028
1028
  code: l.invalid_string,
1029
1029
  message: s.message
1030
1030
  }), n.dirty());
1031
1031
  else if (s.kind === "emoji")
1032
- Ee || (Ee = new RegExp(Er, "u")), Ee.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1032
+ Ee || (Ee = new RegExp(jr, "u")), Ee.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1033
1033
  validation: "emoji",
1034
1034
  code: l.invalid_string,
1035
1035
  message: s.message
1036
1036
  }), n.dirty());
1037
1037
  else if (s.kind === "uuid")
1038
- Tr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1038
+ Or.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1039
1039
  validation: "uuid",
1040
1040
  code: l.invalid_string,
1041
1041
  message: s.message
1042
1042
  }), n.dirty());
1043
1043
  else if (s.kind === "nanoid")
1044
- Cr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1044
+ Rr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1045
1045
  validation: "nanoid",
1046
1046
  code: l.invalid_string,
1047
1047
  message: s.message
1048
1048
  }), n.dirty());
1049
1049
  else if (s.kind === "cuid")
1050
- br.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1050
+ Tr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1051
1051
  validation: "cuid",
1052
1052
  code: l.invalid_string,
1053
1053
  message: s.message
1054
1054
  }), n.dirty());
1055
1055
  else if (s.kind === "cuid2")
1056
- kr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1056
+ Cr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1057
1057
  validation: "cuid2",
1058
1058
  code: l.invalid_string,
1059
1059
  message: s.message
1060
1060
  }), n.dirty());
1061
1061
  else if (s.kind === "ulid")
1062
- wr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1062
+ Sr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1063
1063
  validation: "ulid",
1064
1064
  code: l.invalid_string,
1065
1065
  message: s.message
@@ -1090,39 +1090,39 @@ class q extends b {
1090
1090
  code: l.invalid_string,
1091
1091
  validation: { endsWith: s.value },
1092
1092
  message: s.message
1093
- }), n.dirty()) : s.kind === "datetime" ? Mr(s).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1093
+ }), n.dirty()) : s.kind === "datetime" ? Lr(s).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1094
1094
  code: l.invalid_string,
1095
1095
  validation: "datetime",
1096
1096
  message: s.message
1097
- }), n.dirty()) : s.kind === "date" ? Pr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1097
+ }), n.dirty()) : s.kind === "date" ? Fr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1098
1098
  code: l.invalid_string,
1099
1099
  validation: "date",
1100
1100
  message: s.message
1101
- }), n.dirty()) : s.kind === "time" ? $r(s).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1101
+ }), n.dirty()) : s.kind === "time" ? Dr(s).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1102
1102
  code: l.invalid_string,
1103
1103
  validation: "time",
1104
1104
  message: s.message
1105
- }), n.dirty()) : s.kind === "duration" ? Sr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1105
+ }), n.dirty()) : s.kind === "duration" ? Ar.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1106
1106
  validation: "duration",
1107
1107
  code: l.invalid_string,
1108
1108
  message: s.message
1109
- }), n.dirty()) : s.kind === "ip" ? Fr(e.data, s.version) || (a = this._getOrReturnCtx(e, a), f(a, {
1109
+ }), n.dirty()) : s.kind === "ip" ? qr(e.data, s.version) || (a = this._getOrReturnCtx(e, a), f(a, {
1110
1110
  validation: "ip",
1111
1111
  code: l.invalid_string,
1112
1112
  message: s.message
1113
- }), n.dirty()) : s.kind === "jwt" ? Dr(e.data, s.alg) || (a = this._getOrReturnCtx(e, a), f(a, {
1113
+ }), n.dirty()) : s.kind === "jwt" ? zr(e.data, s.alg) || (a = this._getOrReturnCtx(e, a), f(a, {
1114
1114
  validation: "jwt",
1115
1115
  code: l.invalid_string,
1116
1116
  message: s.message
1117
- }), n.dirty()) : s.kind === "cidr" ? Lr(e.data, s.version) || (a = this._getOrReturnCtx(e, a), f(a, {
1117
+ }), n.dirty()) : s.kind === "cidr" ? Br(e.data, s.version) || (a = this._getOrReturnCtx(e, a), f(a, {
1118
1118
  validation: "cidr",
1119
1119
  code: l.invalid_string,
1120
1120
  message: s.message
1121
- }), n.dirty()) : s.kind === "base64" ? Vr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1121
+ }), n.dirty()) : s.kind === "base64" ? $r.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1122
1122
  validation: "base64",
1123
1123
  code: l.invalid_string,
1124
1124
  message: s.message
1125
- }), n.dirty()) : s.kind === "base64url" ? Zr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1125
+ }), n.dirty()) : s.kind === "base64url" ? Mr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
1126
1126
  validation: "base64url",
1127
1127
  code: l.invalid_string,
1128
1128
  message: s.message
@@ -1357,11 +1357,11 @@ q.create = (r) => new q({
1357
1357
  coerce: (r == null ? void 0 : r.coerce) ?? !1,
1358
1358
  ...x(r)
1359
1359
  });
1360
- function qr(r, e) {
1360
+ function Ur(r, e) {
1361
1361
  const t = (r.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, a = t > n ? t : n, s = Number.parseInt(r.toFixed(a).replace(".", "")), i = Number.parseInt(e.toFixed(a).replace(".", ""));
1362
1362
  return s % i / 10 ** a;
1363
1363
  }
1364
- class fe extends b {
1364
+ class le extends b {
1365
1365
  constructor() {
1366
1366
  super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
1367
1367
  }
@@ -1375,7 +1375,7 @@ class fe extends b {
1375
1375
  }), g;
1376
1376
  }
1377
1377
  let n;
1378
- const a = new A();
1378
+ const a = new I();
1379
1379
  for (const s of this._def.checks)
1380
1380
  s.kind === "int" ? k.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), f(n, {
1381
1381
  code: l.invalid_type,
@@ -1396,7 +1396,7 @@ class fe extends b {
1396
1396
  inclusive: s.inclusive,
1397
1397
  exact: !1,
1398
1398
  message: s.message
1399
- }), a.dirty()) : s.kind === "multipleOf" ? qr(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
1399
+ }), a.dirty()) : s.kind === "multipleOf" ? Ur(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
1400
1400
  code: l.not_multiple_of,
1401
1401
  multipleOf: s.value,
1402
1402
  message: s.message
@@ -1419,7 +1419,7 @@ class fe extends b {
1419
1419
  return this.setLimit("max", e, !1, p.toString(t));
1420
1420
  }
1421
1421
  setLimit(e, t, n, a) {
1422
- return new fe({
1422
+ return new le({
1423
1423
  ...this._def,
1424
1424
  checks: [
1425
1425
  ...this._def.checks,
@@ -1433,7 +1433,7 @@ class fe extends b {
1433
1433
  });
1434
1434
  }
1435
1435
  _addCheck(e) {
1436
- return new fe({
1436
+ return new le({
1437
1437
  ...this._def,
1438
1438
  checks: [...this._def.checks, e]
1439
1439
  });
@@ -1527,13 +1527,13 @@ class fe extends b {
1527
1527
  return Number.isFinite(t) && Number.isFinite(e);
1528
1528
  }
1529
1529
  }
1530
- fe.create = (r) => new fe({
1530
+ le.create = (r) => new le({
1531
1531
  checks: [],
1532
1532
  typeName: _.ZodNumber,
1533
1533
  coerce: (r == null ? void 0 : r.coerce) || !1,
1534
1534
  ...x(r)
1535
1535
  });
1536
- class he extends b {
1536
+ class fe extends b {
1537
1537
  constructor() {
1538
1538
  super(...arguments), this.min = this.gte, this.max = this.lte;
1539
1539
  }
@@ -1547,7 +1547,7 @@ class he extends b {
1547
1547
  if (this._getType(e) !== m.bigint)
1548
1548
  return this._getInvalidInput(e);
1549
1549
  let n;
1550
- const a = new A();
1550
+ const a = new I();
1551
1551
  for (const s of this._def.checks)
1552
1552
  s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), f(n, {
1553
1553
  code: l.too_small,
@@ -1589,7 +1589,7 @@ class he extends b {
1589
1589
  return this.setLimit("max", e, !1, p.toString(t));
1590
1590
  }
1591
1591
  setLimit(e, t, n, a) {
1592
- return new he({
1592
+ return new fe({
1593
1593
  ...this._def,
1594
1594
  checks: [
1595
1595
  ...this._def.checks,
@@ -1603,7 +1603,7 @@ class he extends b {
1603
1603
  });
1604
1604
  }
1605
1605
  _addCheck(e) {
1606
- return new he({
1606
+ return new fe({
1607
1607
  ...this._def,
1608
1608
  checks: [...this._def.checks, e]
1609
1609
  });
@@ -1660,13 +1660,13 @@ class he extends b {
1660
1660
  return e;
1661
1661
  }
1662
1662
  }
1663
- he.create = (r) => new he({
1663
+ fe.create = (r) => new fe({
1664
1664
  checks: [],
1665
1665
  typeName: _.ZodBigInt,
1666
1666
  coerce: (r == null ? void 0 : r.coerce) ?? !1,
1667
1667
  ...x(r)
1668
1668
  });
1669
- class dt extends b {
1669
+ class ht extends b {
1670
1670
  _parse(e) {
1671
1671
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== m.boolean) {
1672
1672
  const n = this._getOrReturnCtx(e);
@@ -1679,7 +1679,7 @@ class dt extends b {
1679
1679
  return N(e.data);
1680
1680
  }
1681
1681
  }
1682
- dt.create = (r) => new dt({
1682
+ ht.create = (r) => new ht({
1683
1683
  typeName: _.ZodBoolean,
1684
1684
  coerce: (r == null ? void 0 : r.coerce) || !1,
1685
1685
  ...x(r)
@@ -1700,7 +1700,7 @@ class be extends b {
1700
1700
  code: l.invalid_date
1701
1701
  }), g;
1702
1702
  }
1703
- const n = new A();
1703
+ const n = new I();
1704
1704
  let a;
1705
1705
  for (const s of this._def.checks)
1706
1706
  s.kind === "min" ? e.data.getTime() < s.value && (a = this._getOrReturnCtx(e, a), f(a, {
@@ -1762,7 +1762,7 @@ be.create = (r) => new be({
1762
1762
  typeName: _.ZodDate,
1763
1763
  ...x(r)
1764
1764
  });
1765
- class lt extends b {
1765
+ class mt extends b {
1766
1766
  _parse(e) {
1767
1767
  if (this._getType(e) !== m.symbol) {
1768
1768
  const n = this._getOrReturnCtx(e);
@@ -1775,11 +1775,11 @@ class lt extends b {
1775
1775
  return N(e.data);
1776
1776
  }
1777
1777
  }
1778
- lt.create = (r) => new lt({
1778
+ mt.create = (r) => new mt({
1779
1779
  typeName: _.ZodSymbol,
1780
1780
  ...x(r)
1781
1781
  });
1782
- class ft extends b {
1782
+ class pt extends b {
1783
1783
  _parse(e) {
1784
1784
  if (this._getType(e) !== m.undefined) {
1785
1785
  const n = this._getOrReturnCtx(e);
@@ -1792,11 +1792,11 @@ class ft extends b {
1792
1792
  return N(e.data);
1793
1793
  }
1794
1794
  }
1795
- ft.create = (r) => new ft({
1795
+ pt.create = (r) => new pt({
1796
1796
  typeName: _.ZodUndefined,
1797
1797
  ...x(r)
1798
1798
  });
1799
- class ht extends b {
1799
+ class yt extends b {
1800
1800
  _parse(e) {
1801
1801
  if (this._getType(e) !== m.null) {
1802
1802
  const n = this._getOrReturnCtx(e);
@@ -1809,11 +1809,11 @@ class ht extends b {
1809
1809
  return N(e.data);
1810
1810
  }
1811
1811
  }
1812
- ht.create = (r) => new ht({
1812
+ yt.create = (r) => new yt({
1813
1813
  typeName: _.ZodNull,
1814
1814
  ...x(r)
1815
1815
  });
1816
- class Ne extends b {
1816
+ class Ve extends b {
1817
1817
  constructor() {
1818
1818
  super(...arguments), this._any = !0;
1819
1819
  }
@@ -1821,11 +1821,11 @@ class Ne extends b {
1821
1821
  return N(e.data);
1822
1822
  }
1823
1823
  }
1824
- Ne.create = (r) => new Ne({
1824
+ Ve.create = (r) => new Ve({
1825
1825
  typeName: _.ZodAny,
1826
1826
  ...x(r)
1827
1827
  });
1828
- class mt extends b {
1828
+ class gt extends b {
1829
1829
  constructor() {
1830
1830
  super(...arguments), this._unknown = !0;
1831
1831
  }
@@ -1833,7 +1833,7 @@ class mt extends b {
1833
1833
  return N(e.data);
1834
1834
  }
1835
1835
  }
1836
- mt.create = (r) => new mt({
1836
+ gt.create = (r) => new gt({
1837
1837
  typeName: _.ZodUnknown,
1838
1838
  ...x(r)
1839
1839
  });
@@ -1851,7 +1851,7 @@ W.create = (r) => new W({
1851
1851
  typeName: _.ZodNever,
1852
1852
  ...x(r)
1853
1853
  });
1854
- class pt extends b {
1854
+ class _t extends b {
1855
1855
  _parse(e) {
1856
1856
  if (this._getType(e) !== m.undefined) {
1857
1857
  const n = this._getOrReturnCtx(e);
@@ -1864,11 +1864,11 @@ class pt extends b {
1864
1864
  return N(e.data);
1865
1865
  }
1866
1866
  }
1867
- pt.create = (r) => new pt({
1867
+ _t.create = (r) => new _t({
1868
1868
  typeName: _.ZodVoid,
1869
1869
  ...x(r)
1870
1870
  });
1871
- class P extends b {
1871
+ class $ extends b {
1872
1872
  _parse(e) {
1873
1873
  const { ctx: t, status: n } = this._processInputParams(e), a = this._def;
1874
1874
  if (t.parsedType !== m.array)
@@ -1904,27 +1904,27 @@ class P extends b {
1904
1904
  exact: !1,
1905
1905
  message: a.maxLength.message
1906
1906
  }), n.dirty()), t.common.async)
1907
- return Promise.all([...t.data].map((i, o) => a.type._parseAsync(new U(t, i, t.path, o)))).then((i) => A.mergeArray(n, i));
1907
+ return Promise.all([...t.data].map((i, o) => a.type._parseAsync(new U(t, i, t.path, o)))).then((i) => I.mergeArray(n, i));
1908
1908
  const s = [...t.data].map((i, o) => a.type._parseSync(new U(t, i, t.path, o)));
1909
- return A.mergeArray(n, s);
1909
+ return I.mergeArray(n, s);
1910
1910
  }
1911
1911
  get element() {
1912
1912
  return this._def.type;
1913
1913
  }
1914
1914
  min(e, t) {
1915
- return new P({
1915
+ return new $({
1916
1916
  ...this._def,
1917
1917
  minLength: { value: e, message: p.toString(t) }
1918
1918
  });
1919
1919
  }
1920
1920
  max(e, t) {
1921
- return new P({
1921
+ return new $({
1922
1922
  ...this._def,
1923
1923
  maxLength: { value: e, message: p.toString(t) }
1924
1924
  });
1925
1925
  }
1926
1926
  length(e, t) {
1927
- return new P({
1927
+ return new $({
1928
1928
  ...this._def,
1929
1929
  exactLength: { value: e, message: p.toString(t) }
1930
1930
  });
@@ -1933,7 +1933,7 @@ class P extends b {
1933
1933
  return this.min(1, e);
1934
1934
  }
1935
1935
  }
1936
- P.create = (r, e) => new P({
1936
+ $.create = (r, e) => new $({
1937
1937
  type: r,
1938
1938
  minLength: null,
1939
1939
  maxLength: null,
@@ -1941,21 +1941,21 @@ P.create = (r, e) => new P({
1941
1941
  typeName: _.ZodArray,
1942
1942
  ...x(e)
1943
1943
  });
1944
- function ee(r) {
1944
+ function re(r) {
1945
1945
  if (r instanceof C) {
1946
1946
  const e = {};
1947
1947
  for (const t in r.shape) {
1948
1948
  const n = r.shape[t];
1949
- e[t] = z.create(ee(n));
1949
+ e[t] = z.create(re(n));
1950
1950
  }
1951
1951
  return new C({
1952
1952
  ...r._def,
1953
1953
  shape: () => e
1954
1954
  });
1955
- } else return r instanceof P ? new P({
1955
+ } else return r instanceof $ ? new $({
1956
1956
  ...r._def,
1957
- type: ee(r.element)
1958
- }) : r instanceof z ? z.create(ee(r.unwrap())) : r instanceof se ? se.create(ee(r.unwrap())) : r instanceof X ? X.create(r.items.map((e) => ee(e))) : r;
1957
+ type: re(r.element)
1958
+ }) : r instanceof z ? z.create(re(r.unwrap())) : r instanceof ae ? ae.create(re(r.unwrap())) : r instanceof X ? X.create(r.items.map((e) => re(e))) : r;
1959
1959
  }
1960
1960
  class C extends b {
1961
1961
  constructor() {
@@ -2028,7 +2028,7 @@ class C extends b {
2028
2028
  });
2029
2029
  }
2030
2030
  return c;
2031
- }).then((c) => A.mergeObjectSync(n, c)) : A.mergeObjectSync(n, u);
2031
+ }).then((c) => I.mergeObjectSync(n, c)) : I.mergeObjectSync(n, u);
2032
2032
  }
2033
2033
  get shape() {
2034
2034
  return this._def.shape();
@@ -2191,7 +2191,7 @@ class C extends b {
2191
2191
  * @deprecated
2192
2192
  */
2193
2193
  deepPartial() {
2194
- return ee(this);
2194
+ return re(this);
2195
2195
  }
2196
2196
  partial(e) {
2197
2197
  const t = {};
@@ -2221,7 +2221,7 @@ class C extends b {
2221
2221
  });
2222
2222
  }
2223
2223
  keyof() {
2224
- return At(k.objectKeys(this.shape));
2224
+ return Zt(k.objectKeys(this.shape));
2225
2225
  }
2226
2226
  }
2227
2227
  C.create = (r, e) => new C({
@@ -2318,14 +2318,14 @@ ke.create = (r, e) => new ke({
2318
2318
  typeName: _.ZodUnion,
2319
2319
  ...x(e)
2320
2320
  });
2321
- function Ve(r, e) {
2321
+ function Ze(r, e) {
2322
2322
  const t = L(r), n = L(e);
2323
2323
  if (r === e)
2324
2324
  return { valid: !0, data: r };
2325
2325
  if (t === m.object && n === m.object) {
2326
2326
  const a = k.objectKeys(e), s = k.objectKeys(r).filter((o) => a.indexOf(o) !== -1), i = { ...r, ...e };
2327
2327
  for (const o of s) {
2328
- const u = Ve(r[o], e[o]);
2328
+ const u = Ze(r[o], e[o]);
2329
2329
  if (!u.valid)
2330
2330
  return { valid: !1 };
2331
2331
  i[o] = u.data;
@@ -2336,7 +2336,7 @@ function Ve(r, e) {
2336
2336
  return { valid: !1 };
2337
2337
  const a = [];
2338
2338
  for (let s = 0; s < r.length; s++) {
2339
- const i = r[s], o = e[s], u = Ve(i, o);
2339
+ const i = r[s], o = e[s], u = Ze(i, o);
2340
2340
  if (!u.valid)
2341
2341
  return { valid: !1 };
2342
2342
  a.push(u.data);
@@ -2347,10 +2347,10 @@ function Ve(r, e) {
2347
2347
  class we extends b {
2348
2348
  _parse(e) {
2349
2349
  const { status: t, ctx: n } = this._processInputParams(e), a = (s, i) => {
2350
- if (ot(s) || ot(i))
2350
+ if (dt(s) || dt(i))
2351
2351
  return g;
2352
- const o = Ve(s.value, i.value);
2353
- return o.valid ? ((ut(s) || ut(i)) && t.dirty(), { status: t.value, value: o.data }) : (f(n, {
2352
+ const o = Ze(s.value, i.value);
2353
+ return o.valid ? ((lt(s) || lt(i)) && t.dirty(), { status: t.value, value: o.data }) : (f(n, {
2354
2354
  code: l.invalid_intersection_types
2355
2355
  }), g);
2356
2356
  };
@@ -2410,7 +2410,7 @@ class X extends b {
2410
2410
  const u = this._def.items[o] || this._def.rest;
2411
2411
  return u ? u._parse(new U(n, i, n.path, o)) : null;
2412
2412
  }).filter((i) => !!i);
2413
- return n.common.async ? Promise.all(s).then((i) => A.mergeArray(t, i)) : A.mergeArray(t, s);
2413
+ return n.common.async ? Promise.all(s).then((i) => I.mergeArray(t, i)) : I.mergeArray(t, s);
2414
2414
  }
2415
2415
  get items() {
2416
2416
  return this._def.items;
@@ -2432,7 +2432,7 @@ X.create = (r, e) => {
2432
2432
  ...x(e)
2433
2433
  });
2434
2434
  };
2435
- class yt extends b {
2435
+ class vt extends b {
2436
2436
  get keySchema() {
2437
2437
  return this._def.keyType;
2438
2438
  }
@@ -2474,13 +2474,13 @@ class yt extends b {
2474
2474
  }
2475
2475
  }
2476
2476
  }
2477
- yt.create = (r, e, t) => new yt({
2477
+ vt.create = (r, e, t) => new vt({
2478
2478
  valueType: e,
2479
2479
  keyType: r,
2480
2480
  typeName: _.ZodMap,
2481
2481
  ...x(t)
2482
2482
  });
2483
- class me extends b {
2483
+ class he extends b {
2484
2484
  _parse(e) {
2485
2485
  const { status: t, ctx: n } = this._processInputParams(e);
2486
2486
  if (n.parsedType !== m.set)
@@ -2519,13 +2519,13 @@ class me extends b {
2519
2519
  return n.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
2520
2520
  }
2521
2521
  min(e, t) {
2522
- return new me({
2522
+ return new he({
2523
2523
  ...this._def,
2524
2524
  minSize: { value: e, message: p.toString(t) }
2525
2525
  });
2526
2526
  }
2527
2527
  max(e, t) {
2528
- return new me({
2528
+ return new he({
2529
2529
  ...this._def,
2530
2530
  maxSize: { value: e, message: p.toString(t) }
2531
2531
  });
@@ -2537,14 +2537,14 @@ class me extends b {
2537
2537
  return this.min(1, e);
2538
2538
  }
2539
2539
  }
2540
- me.create = (r, e) => new me({
2540
+ he.create = (r, e) => new he({
2541
2541
  valueType: r,
2542
2542
  minSize: null,
2543
2543
  maxSize: null,
2544
2544
  typeName: _.ZodSet,
2545
2545
  ...x(e)
2546
2546
  });
2547
- class gt extends b {
2547
+ class xt extends b {
2548
2548
  get schema() {
2549
2549
  return this._def.getter();
2550
2550
  }
@@ -2553,12 +2553,12 @@ class gt extends b {
2553
2553
  return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
2554
2554
  }
2555
2555
  }
2556
- gt.create = (r, e) => new gt({
2556
+ xt.create = (r, e) => new xt({
2557
2557
  getter: r,
2558
2558
  typeName: _.ZodLazy,
2559
2559
  ...x(e)
2560
2560
  });
2561
- class _t extends b {
2561
+ class bt extends b {
2562
2562
  _parse(e) {
2563
2563
  if (e.data !== this._def.value) {
2564
2564
  const t = this._getOrReturnCtx(e);
@@ -2574,19 +2574,19 @@ class _t extends b {
2574
2574
  return this._def.value;
2575
2575
  }
2576
2576
  }
2577
- _t.create = (r, e) => new _t({
2577
+ bt.create = (r, e) => new bt({
2578
2578
  value: r,
2579
2579
  typeName: _.ZodLiteral,
2580
2580
  ...x(e)
2581
2581
  });
2582
- function At(r, e) {
2583
- return new re({
2582
+ function Zt(r, e) {
2583
+ return new se({
2584
2584
  values: r,
2585
2585
  typeName: _.ZodEnum,
2586
2586
  ...x(e)
2587
2587
  });
2588
2588
  }
2589
- class re extends b {
2589
+ class se extends b {
2590
2590
  _parse(e) {
2591
2591
  if (typeof e.data != "string") {
2592
2592
  const t = this._getOrReturnCtx(e), n = this._def.values;
@@ -2628,20 +2628,20 @@ class re extends b {
2628
2628
  return e;
2629
2629
  }
2630
2630
  extract(e, t = this._def) {
2631
- return re.create(e, {
2631
+ return se.create(e, {
2632
2632
  ...this._def,
2633
2633
  ...t
2634
2634
  });
2635
2635
  }
2636
2636
  exclude(e, t = this._def) {
2637
- return re.create(this.options.filter((n) => !e.includes(n)), {
2637
+ return se.create(this.options.filter((n) => !e.includes(n)), {
2638
2638
  ...this._def,
2639
2639
  ...t
2640
2640
  });
2641
2641
  }
2642
2642
  }
2643
- re.create = At;
2644
- class vt extends b {
2643
+ se.create = Zt;
2644
+ class kt extends b {
2645
2645
  _parse(e) {
2646
2646
  const t = k.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2647
2647
  if (n.parsedType !== m.string && n.parsedType !== m.number) {
@@ -2666,7 +2666,7 @@ class vt extends b {
2666
2666
  return this._def.values;
2667
2667
  }
2668
2668
  }
2669
- vt.create = (r, e) => new vt({
2669
+ kt.create = (r, e) => new kt({
2670
2670
  values: r,
2671
2671
  typeName: _.ZodNativeEnum,
2672
2672
  ...x(e)
@@ -2695,7 +2695,7 @@ Te.create = (r, e) => new Te({
2695
2695
  typeName: _.ZodPromise,
2696
2696
  ...x(e)
2697
2697
  });
2698
- class ne extends b {
2698
+ class K extends b {
2699
2699
  innerType() {
2700
2700
  return this._def.schema;
2701
2701
  }
@@ -2761,27 +2761,27 @@ class ne extends b {
2761
2761
  path: n.path,
2762
2762
  parent: n
2763
2763
  });
2764
- if (!te(i))
2764
+ if (!ne(i))
2765
2765
  return g;
2766
2766
  const o = a.transform(i.value, s);
2767
2767
  if (o instanceof Promise)
2768
2768
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2769
2769
  return { status: t.value, value: o };
2770
2770
  } else
2771
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => te(i) ? Promise.resolve(a.transform(i.value, s)).then((o) => ({
2771
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((i) => ne(i) ? Promise.resolve(a.transform(i.value, s)).then((o) => ({
2772
2772
  status: t.value,
2773
2773
  value: o
2774
2774
  })) : g);
2775
2775
  k.assertNever(a);
2776
2776
  }
2777
2777
  }
2778
- ne.create = (r, e, t) => new ne({
2778
+ K.create = (r, e, t) => new K({
2779
2779
  schema: r,
2780
2780
  typeName: _.ZodEffects,
2781
2781
  effect: e,
2782
2782
  ...x(t)
2783
2783
  });
2784
- ne.createWithPreprocess = (r, e, t) => new ne({
2784
+ K.createWithPreprocess = (r, e, t) => new K({
2785
2785
  schema: e,
2786
2786
  effect: { type: "preprocess", transform: r },
2787
2787
  typeName: _.ZodEffects,
@@ -2800,7 +2800,7 @@ z.create = (r, e) => new z({
2800
2800
  typeName: _.ZodOptional,
2801
2801
  ...x(e)
2802
2802
  });
2803
- class se extends b {
2803
+ class ae extends b {
2804
2804
  _parse(e) {
2805
2805
  return this._getType(e) === m.null ? N(null) : this._def.innerType._parse(e);
2806
2806
  }
@@ -2808,12 +2808,12 @@ class se extends b {
2808
2808
  return this._def.innerType;
2809
2809
  }
2810
2810
  }
2811
- se.create = (r, e) => new se({
2811
+ ae.create = (r, e) => new ae({
2812
2812
  innerType: r,
2813
2813
  typeName: _.ZodNullable,
2814
2814
  ...x(e)
2815
2815
  });
2816
- class Ze extends b {
2816
+ class Pe extends b {
2817
2817
  _parse(e) {
2818
2818
  const { ctx: t } = this._processInputParams(e);
2819
2819
  let n = t.data;
@@ -2827,13 +2827,13 @@ class Ze extends b {
2827
2827
  return this._def.innerType;
2828
2828
  }
2829
2829
  }
2830
- Ze.create = (r, e) => new Ze({
2830
+ Pe.create = (r, e) => new Pe({
2831
2831
  innerType: r,
2832
2832
  typeName: _.ZodDefault,
2833
2833
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2834
2834
  ...x(e)
2835
2835
  });
2836
- class Pe extends b {
2836
+ class $e extends b {
2837
2837
  _parse(e) {
2838
2838
  const { ctx: t } = this._processInputParams(e), n = {
2839
2839
  ...t,
@@ -2870,13 +2870,13 @@ class Pe extends b {
2870
2870
  return this._def.innerType;
2871
2871
  }
2872
2872
  }
2873
- Pe.create = (r, e) => new Pe({
2873
+ $e.create = (r, e) => new $e({
2874
2874
  innerType: r,
2875
2875
  typeName: _.ZodCatch,
2876
2876
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2877
2877
  ...x(e)
2878
2878
  });
2879
- class xt extends b {
2879
+ class wt extends b {
2880
2880
  _parse(e) {
2881
2881
  if (this._getType(e) !== m.nan) {
2882
2882
  const n = this._getOrReturnCtx(e);
@@ -2889,11 +2889,11 @@ class xt extends b {
2889
2889
  return { status: "valid", value: e.data };
2890
2890
  }
2891
2891
  }
2892
- xt.create = (r) => new xt({
2892
+ wt.create = (r) => new wt({
2893
2893
  typeName: _.ZodNaN,
2894
2894
  ...x(r)
2895
2895
  });
2896
- class zr extends b {
2896
+ class Wr extends b {
2897
2897
  _parse(e) {
2898
2898
  const { ctx: t } = this._processInputParams(e), n = t.data;
2899
2899
  return this._def.type._parse({
@@ -2946,16 +2946,16 @@ class Le extends b {
2946
2946
  });
2947
2947
  }
2948
2948
  }
2949
- class $e extends b {
2949
+ class Me extends b {
2950
2950
  _parse(e) {
2951
- const t = this._def.innerType._parse(e), n = (a) => (te(a) && (a.value = Object.freeze(a.value)), a);
2951
+ const t = this._def.innerType._parse(e), n = (a) => (ne(a) && (a.value = Object.freeze(a.value)), a);
2952
2952
  return xe(t) ? t.then((a) => n(a)) : n(t);
2953
2953
  }
2954
2954
  unwrap() {
2955
2955
  return this._def.innerType;
2956
2956
  }
2957
2957
  }
2958
- $e.create = (r, e) => new $e({
2958
+ Me.create = (r, e) => new Me({
2959
2959
  innerType: r,
2960
2960
  typeName: _.ZodReadonly,
2961
2961
  ...x(e)
@@ -2964,16 +2964,16 @@ var _;
2964
2964
  (function(r) {
2965
2965
  r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
2966
2966
  })(_ || (_ = {}));
2967
- const Br = q.create, B = Ne.create;
2967
+ const Jr = q.create, B = Ve.create;
2968
2968
  W.create;
2969
- const It = P.create, Me = C.create, Nt = ke.create;
2969
+ const Pt = $.create, qe = C.create, ze = ke.create;
2970
2970
  we.create;
2971
- const Ur = X.create;
2972
- re.create;
2971
+ const Hr = X.create;
2972
+ se.create;
2973
2973
  Te.create;
2974
2974
  z.create;
2975
- se.create;
2976
- const Q = g, Wr = "Required field";
2975
+ ae.create;
2976
+ const Yr = K.createWithPreprocess, Q = g, Gr = "Required field";
2977
2977
  function ce(r) {
2978
2978
  let e;
2979
2979
  if (typeof r == "string")
@@ -2989,31 +2989,42 @@ function ce(r) {
2989
2989
  if (J(e))
2990
2990
  return ce(e[0]);
2991
2991
  const t = e;
2992
- return wt(t) && (t != null && t.message) ? e == null ? void 0 : e.message : "Unknown error";
2992
+ return Ot(t) && (t != null && t.message) ? e == null ? void 0 : e.message : "Unknown error";
2993
2993
  }
2994
- function Jr(r, e, t) {
2994
+ function Qr(r, e, t) {
2995
2995
  let n = {};
2996
2996
  if (_e(n, r.inputs, e, t), t != null && t.prefix) {
2997
2997
  const s = t == null ? void 0 : t.prefix.replace(/.$/, "");
2998
- n = M({}, s, n);
2998
+ n = P({}, s, n);
2999
2999
  }
3000
- return Me(de(n, e, t));
3000
+ return qe(me(n, e, t));
3001
3001
  }
3002
- function Hr(r, e, t) {
3002
+ function Xr(r, e, t) {
3003
3003
  const n = Object.keys(r).filter((i) => /^\d+$/.test(i) && !i.startsWith("_")).map((i) => parseInt(i, 10)).sort((i, o) => i - o);
3004
3004
  if (n.length === 0) return null;
3005
3005
  const a = Math.max(...n), s = [];
3006
3006
  for (let i = 0; i <= a; i++)
3007
3007
  if (n.includes(i)) {
3008
- const o = r[i], u = de({ item: o }, e, t);
3008
+ const o = r[i], u = me({ item: o }, e, t);
3009
3009
  s.push(u.item || B().optional());
3010
3010
  } else
3011
3011
  s.push(B().optional());
3012
- return Ur(s).rest(B()).optional();
3013
- }
3014
- function de(r, e, t) {
3012
+ return Hr(s).rest(B()).optional();
3013
+ }
3014
+ const $t = /* @__PURE__ */ new Set([
3015
+ "_requiredOnly",
3016
+ "_schemaObj",
3017
+ "_input",
3018
+ "_isList",
3019
+ "_isArrayItem",
3020
+ "_isTuple",
3021
+ "_schema"
3022
+ ]);
3023
+ function me(r, e, t) {
3015
3024
  const n = {};
3016
3025
  return Object.keys(r).forEach((a) => {
3026
+ if ($t.has(a))
3027
+ return;
3017
3028
  const {
3018
3029
  _requiredOnly: s,
3019
3030
  _schemaObj: i,
@@ -3025,29 +3036,43 @@ function de(r, e, t) {
3025
3036
  /*...nestedSchemaObj*/
3026
3037
  } = r[a];
3027
3038
  if (d && !u && !c) {
3028
- const h = Hr(r[a], e, t);
3039
+ const h = Xr(r[a], e, t);
3029
3040
  if (h) {
3030
3041
  n[a] = h;
3031
3042
  return;
3032
3043
  }
3033
3044
  }
3034
3045
  if (u && i && o) {
3035
- const h = Me(de(i, e, t)), v = Nt([
3036
- It(h).optional(),
3037
- Vt(o, t)
3038
- ]), S = bt(y, o, e, t, v);
3039
- n[a] = S;
3046
+ const h = qe(me(i, e, t)), v = ze([
3047
+ Pt(h).optional(),
3048
+ Be(o, t)
3049
+ ]), O = Ct(y, o, e, t, v);
3050
+ n[a] = O;
3040
3051
  } else if (c && o) {
3041
- const h = i != null && i.___array ? de({ ___array: i.___array }, e, t) : { ___array: B() }, v = Yr(h, o, t), S = bt(y, o, e, t, v);
3042
- n[a] = S;
3052
+ const h = i != null && i.___array ? me({ ___array: i.___array }, e, t) : { ___array: B() }, v = Kr(h, o, t), O = Ct(y, o, e, t, v);
3053
+ n[a] = O;
3043
3054
  } else if (y && o) {
3044
- const h = Gr(y, o, e, t);
3045
- n[a] = h;
3046
- } else s && o ? n[a] = qe(o, t) : n[a] = Me(de(r[a], e, t)).optional();
3055
+ const h = en(y, o, e, t);
3056
+ n[a] = Tt(r[a]) ? h.pipe(Ae(r[a], e, t)) : h;
3057
+ } else if (s && o) {
3058
+ const h = Ue(o, t);
3059
+ n[a] = Tt(r[a]) ? h.pipe(Ae(r[a], e, t)) : h;
3060
+ } else
3061
+ n[a] = Ae(r[a], e, t);
3047
3062
  }), n;
3048
3063
  }
3049
- function Vt(r, e) {
3050
- return Br().superRefine((t, n) => {
3064
+ function Tt(r) {
3065
+ return Object.keys(r).some((e) => !$t.has(e));
3066
+ }
3067
+ function Ae(r, e, t) {
3068
+ const n = Yr(
3069
+ (a) => a ?? {},
3070
+ qe(me(r, e, t))
3071
+ );
3072
+ return r._input ? ze([n, Be(r._input, t)]) : n;
3073
+ }
3074
+ function Be(r, e) {
3075
+ return Jr().superRefine((t, n) => {
3051
3076
  var a;
3052
3077
  if ((a = e == null ? void 0 : e.validationConfig) != null && a.globalValidation) {
3053
3078
  const s = e.validationConfig.globalValidation(t, r, e.metadata);
@@ -3062,13 +3087,13 @@ function Vt(r, e) {
3062
3087
  return !0;
3063
3088
  });
3064
3089
  }
3065
- function Yr(r, e, t) {
3066
- return Nt([It(r.___array).optional(), Vt(e, t)]);
3090
+ function Kr(r, e, t) {
3091
+ return ze([Pt(r.___array).optional(), Be(e, t)]);
3067
3092
  }
3068
- function Gr(r, e, t, n) {
3093
+ function en(r, e, t, n) {
3069
3094
  return B().optional().superRefine(async (a, s) => {
3070
3095
  var o, u;
3071
- if (e.required && !(await qe(e, n).safeParseAsync(a)).success)
3096
+ if (e.required && !(await Ue(e, n).safeParseAsync(a)).success)
3072
3097
  return s.addIssue({
3073
3098
  code: l.custom,
3074
3099
  message: Fe(e, n)
@@ -3083,7 +3108,7 @@ function Gr(r, e, t, n) {
3083
3108
  if (!c.continue)
3084
3109
  return !0;
3085
3110
  }
3086
- const i = Zt(r, t);
3111
+ const i = Mt(r, t);
3087
3112
  if (i) {
3088
3113
  const c = await i.safeParseAsync(a);
3089
3114
  if (!c.success) {
@@ -3096,10 +3121,10 @@ function Gr(r, e, t, n) {
3096
3121
  }
3097
3122
  });
3098
3123
  }
3099
- function bt(r, e, t, n, a) {
3124
+ function Ct(r, e, t, n, a) {
3100
3125
  return B().optional().superRefine(async (s, i) => {
3101
3126
  var d, y;
3102
- const u = await qe(e, n).safeParseAsync(s);
3127
+ const u = await Ue(e, n).safeParseAsync(s);
3103
3128
  if (e.required && !u.success) {
3104
3129
  const h = ce(u.error.message);
3105
3130
  return i.addIssue({ code: l.custom, message: h, fatal: !0 }), Q;
@@ -3121,7 +3146,7 @@ function bt(r, e, t, n, a) {
3121
3146
  code: l.custom,
3122
3147
  message: "'Value is not array'"
3123
3148
  }), Q;
3124
- const c = Zt(r, t);
3149
+ const c = Mt(r, t);
3125
3150
  if (c) {
3126
3151
  const h = await c.safeParseAsync(s);
3127
3152
  if (!h.success)
@@ -3137,15 +3162,15 @@ function _e(r, e, t, n, a) {
3137
3162
  var o, u, c, d, y, h, v;
3138
3163
  const i = t;
3139
3164
  if (!s.isVisible || (o = s.isVisible) != null && o.call(s, i, n == null ? void 0 : n.metadata)) {
3140
- const S = E(r, s.path);
3141
- if ((u = s.validation) != null && u.schema ? M(
3165
+ const O = E(r, s.path);
3166
+ if ((u = s.validation) != null && u.schema ? P(
3142
3167
  r,
3143
3168
  s.path,
3144
- oe(S, {
3169
+ te(O, {
3145
3170
  _schema: (c = s.validation) == null ? void 0 : c.schema,
3146
3171
  _input: s
3147
3172
  })
3148
- ) : s.required && M(r, s.path, oe(S, { _requiredOnly: !0, _input: s })), s.inputs && _e(r, s.inputs, t, n), s.inputType === "list") {
3173
+ ) : s.required && P(r, s.path, te(O, { _requiredOnly: !0, _input: s })), s.inputs && (s.path && P(r, s.path, te(E(r, s.path), { _input: s })), _e(r, s.inputs, t, n)), s.inputType === "list") {
3149
3174
  const w = {};
3150
3175
  _e(
3151
3176
  w,
@@ -3157,7 +3182,7 @@ function _e(r, e, t, n, a) {
3157
3182
  n
3158
3183
  );
3159
3184
  const R = E(r, s.path);
3160
- M(r, s.path, oe(R, { _schemaObj: w, _isList: !0, _input: s }));
3185
+ P(r, s.path, te(R, { _schemaObj: w, _isList: !0, _input: s }));
3161
3186
  }
3162
3187
  if (!((h = s.validation) != null && h.schema) && s.inputType === "array") {
3163
3188
  const w = {};
@@ -3166,10 +3191,10 @@ function _e(r, e, t, n, a) {
3166
3191
  [{ ...s.inputConfig.input, path: "___array" }],
3167
3192
  t,
3168
3193
  n
3169
- ), M(
3194
+ ), P(
3170
3195
  r,
3171
3196
  s.path,
3172
- oe(S, {
3197
+ te(O, {
3173
3198
  _schemaObj: w,
3174
3199
  _schema: (v = s.validation) == null ? void 0 : v.schema,
3175
3200
  _isArrayItem: !0,
@@ -3194,9 +3219,9 @@ function _e(r, e, t, n, a) {
3194
3219
  }
3195
3220
  function Fe(r, e) {
3196
3221
  var t, n, a;
3197
- return ((n = (t = e == null ? void 0 : e.validationConfig) == null ? void 0 : t.requiredMessagePerInput) == null ? void 0 : n[r.inputType]) ?? ((a = e == null ? void 0 : e.validationConfig) == null ? void 0 : a.requiredMessage) ?? Wr;
3222
+ return ((n = (t = e == null ? void 0 : e.validationConfig) == null ? void 0 : t.requiredMessagePerInput) == null ? void 0 : n[r.inputType]) ?? ((a = e == null ? void 0 : e.validationConfig) == null ? void 0 : a.requiredMessage) ?? Gr;
3198
3223
  }
3199
- function qe(r, e) {
3224
+ function Ue(r, e) {
3200
3225
  var n, a, s, i, o, u;
3201
3226
  if ((a = (n = e == null ? void 0 : e.validationConfig) == null ? void 0 : n.requiredSchemaPerInput) != null && a[r.inputType])
3202
3227
  return (i = (s = e == null ? void 0 : e.validationConfig) == null ? void 0 : s.requiredSchemaPerInput) == null ? void 0 : i[r.inputType];
@@ -3207,19 +3232,19 @@ function qe(r, e) {
3207
3232
  typeof c == "object" && Ce(c) && d.addIssue({
3208
3233
  code: l.custom,
3209
3234
  message: t
3210
- }), (Oe(c) || c === "") && d.addIssue({
3235
+ }), (Se(c) || c === "") && d.addIssue({
3211
3236
  code: l.custom,
3212
3237
  message: t
3213
3238
  });
3214
3239
  });
3215
3240
  }
3216
- function Zt(r, e) {
3241
+ function Mt(r, e) {
3217
3242
  if (r instanceof b)
3218
3243
  return r;
3219
3244
  if (typeof r == "function")
3220
3245
  return r(e);
3221
3246
  }
3222
- const Qr = (r) => Array.isArray(r == null ? void 0 : r.errors), Xr = (r, e) => {
3247
+ const tn = (r) => Array.isArray(r == null ? void 0 : r.errors), rn = (r, e) => {
3223
3248
  const t = {};
3224
3249
  for (; r.length; ) {
3225
3250
  const n = r[0], { code: a, message: s, path: i } = n, o = i.join(".");
@@ -3235,7 +3260,7 @@ const Qr = (r) => Array.isArray(r == null ? void 0 : r.errors), Xr = (r, e) => {
3235
3260
  "unionErrors" in n && n.unionErrors.forEach((u) => u.errors.forEach((c) => r.push(c)));
3236
3261
  {
3237
3262
  const u = t[o].types, c = u && u[n.code];
3238
- t[o] = ar(
3263
+ t[o] = ur(
3239
3264
  o,
3240
3265
  e,
3241
3266
  t,
@@ -3247,19 +3272,19 @@ const Qr = (r) => Array.isArray(r == null ? void 0 : r.errors), Xr = (r, e) => {
3247
3272
  }
3248
3273
  return t;
3249
3274
  };
3250
- function gn(r, e) {
3251
- return Xt(
3275
+ function bn(r, e) {
3276
+ return tr(
3252
3277
  async (t, n, a) => {
3253
3278
  try {
3254
- return await Jr(r, t, e).parseAsync(t), {
3279
+ return await Qr(r, t, e).parseAsync(t), {
3255
3280
  values: t,
3256
3281
  errors: {}
3257
3282
  };
3258
3283
  } catch (s) {
3259
- if (Qr(s))
3284
+ if (tn(s))
3260
3285
  return {
3261
3286
  values: {},
3262
- errors: or(Xr(s.errors, !0), a)
3287
+ errors: dr(rn(s.errors, !0), a)
3263
3288
  };
3264
3289
  throw s;
3265
3290
  }
@@ -3267,13 +3292,13 @@ function gn(r, e) {
3267
3292
  [r, e]
3268
3293
  );
3269
3294
  }
3270
- const je = (r, e) => r.level !== e.level ? r.level - e.level : r.isPrimitive ? 1 : -1, Ae = (r, e) => r.level !== e.level ? e.level - r.level : r.isPrimitive ? -1 : 1;
3295
+ const Ie = (r, e) => r.level !== e.level ? r.level - e.level : r.isPrimitive ? 1 : -1, je = (r, e) => r.level !== e.level ? e.level - r.level : r.isPrimitive ? -1 : 1;
3271
3296
  function ve(r, e, t) {
3272
- E(r, e) === void 0 && t === void 0 || M(r, e, t);
3297
+ E(r, e) === void 0 && t === void 0 || P(r, e, t);
3273
3298
  }
3274
- function Kr(r, e) {
3275
- const t = le(r), n = e.filter((o) => o.inputPriority === "early"), a = e.filter((o) => o.inputPriority === "normal"), s = e.filter((o) => o.inputPriority === "late");
3276
- return n.sort(je), a.sort(je), s.sort(je), [...n, ...a, ...s].forEach((o) => {
3299
+ function nn(r, e) {
3300
+ const t = de(r), n = e.filter((o) => o.inputPriority === "early"), a = e.filter((o) => o.inputPriority === "normal"), s = e.filter((o) => o.inputPriority === "late");
3301
+ return n.sort(Ie), a.sort(Ie), s.sort(Ie), [...n, ...a, ...s].forEach((o) => {
3277
3302
  if (o.inputTransform) {
3278
3303
  const u = J(o.inputTransform) ? o.inputTransform : [o.inputTransform];
3279
3304
  let c;
@@ -3290,25 +3315,25 @@ function Kr(r, e) {
3290
3315
  }
3291
3316
  }), t;
3292
3317
  }
3293
- function en(r, e, t) {
3318
+ function sn(r, e, t) {
3294
3319
  const n = e.filter((d) => d.outputPriority === "early"), a = e.filter((d) => d.outputPriority === "normal"), s = e.filter((d) => d.outputPriority === "late");
3295
- n.sort(Ae), a.sort(Ae), s.sort(Ae);
3320
+ n.sort(je), a.sort(je), s.sort(je);
3296
3321
  const i = [...n, ...a, ...s], o = [];
3297
3322
  let u = {};
3298
- t || (u = le(r));
3299
- const c = le(r);
3323
+ t || (u = de(r));
3324
+ const c = de(r);
3300
3325
  return i.forEach((d) => {
3301
3326
  if (d.outputTransform) {
3302
3327
  const y = J(d.outputTransform) ? d.outputTransform : [d.outputTransform];
3303
3328
  let h = E(c, d.path);
3304
3329
  y.forEach((v) => {
3305
- const S = E(u, d.path), w = v(h, c, S, u);
3330
+ const O = E(u, d.path), w = v(h, c, O, u);
3306
3331
  if (w)
3307
3332
  if (h = w.value, w.path) {
3308
3333
  if (w.merge) {
3309
3334
  const R = E(u, w.path);
3310
3335
  let T;
3311
- R ? T = oe({}, R, w.value) : T = w.value, ve(u, w.path, T);
3336
+ R ? T = te({}, R, w.value) : T = w.value, ve(u, w.path, T);
3312
3337
  } else
3313
3338
  ve(u, w.path, w.value);
3314
3339
  w.unset && o.push(d.path);
@@ -3317,21 +3342,21 @@ function en(r, e, t) {
3317
3342
  });
3318
3343
  }
3319
3344
  }), o.forEach((d) => {
3320
- Tt(u, d);
3345
+ Rt(u, d);
3321
3346
  }), u;
3322
3347
  }
3323
- function ze(r) {
3324
- return r.reduce((t, n) => Array.isArray(n.inputs) ? [...t, n, ...ze(n.inputs)] : [...t, n], []);
3348
+ function We(r) {
3349
+ return r.reduce((t, n) => Array.isArray(n.inputs) ? [...t, n, ...We(n.inputs)] : [...t, n], []);
3325
3350
  }
3326
- const tn = (r) => {
3351
+ const an = (r) => {
3327
3352
  if (r !== void 0)
3328
3353
  return { value: r };
3329
- }, rn = (r) => {
3354
+ }, on = (r) => {
3330
3355
  if (r !== void 0)
3331
3356
  return { value: r };
3332
3357
  };
3333
- function Pt(r, e) {
3334
- return ze(r.inputs).reduce((a, s) => {
3358
+ function Ft(r, e) {
3359
+ return We(r.inputs).reduce((a, s) => {
3335
3360
  var h, v;
3336
3361
  const i = s.inputType === "text" || s.inputType === "boolean" || s.inputType === "number" || s.inputType === "textarea" || s.inputType === "select", o = !!s.inputTransform, u = !!s.outputTransform, c = Array.isArray(s.inputs) && s.inputs.length > 0, d = s.inputType === "list" || s.inputType === "array";
3337
3362
  return o || u ? a.push({
@@ -3344,8 +3369,8 @@ function Pt(r, e) {
3344
3369
  outputPriority: ((v = s.transformerPriority) == null ? void 0 : v.output) ?? "normal"
3345
3370
  }) : e && !(c || d) && a.push({
3346
3371
  path: s.path,
3347
- inputTransform: tn,
3348
- outputTransform: rn,
3372
+ inputTransform: an,
3373
+ outputTransform: on,
3349
3374
  level: s.path.split(".").length,
3350
3375
  isPrimitive: i,
3351
3376
  inputPriority: "normal",
@@ -3353,39 +3378,39 @@ function Pt(r, e) {
3353
3378
  }), a;
3354
3379
  }, []);
3355
3380
  }
3356
- function nn(r, e, t, n = {}) {
3357
- const { preserve: a } = n, s = ze(r.inputs), i = le(e);
3381
+ function un(r, e, t, n = {}) {
3382
+ const { preserve: a } = n, s = We(r.inputs), i = de(e);
3358
3383
  return s.forEach((o) => {
3359
- a && a.includes(o.path) || o.isVisible && !o.isVisible(e, t) && Tt(i, o.path);
3384
+ a && a.includes(o.path) || o.isVisible && !o.isVisible(e, t) && Rt(i, o.path);
3360
3385
  }), i;
3361
3386
  }
3362
- function _n(r, e) {
3363
- const t = Pt(e);
3364
- return Kr(r, t);
3387
+ function kn(r, e) {
3388
+ const t = Ft(e);
3389
+ return nn(r, t);
3365
3390
  }
3366
- function vn(r, e, t, n = {}) {
3367
- const a = n.cleanOutput, s = Pt(e, a);
3368
- let i = nn(e, r, t, n);
3369
- return i = en(i, s, n.cleanOutput), i = gr(i), i;
3391
+ function wn(r, e, t, n = {}) {
3392
+ const a = n.cleanOutput, s = Ft(e, a);
3393
+ let i = un(e, r, t, n);
3394
+ return i = sn(i, s, n.cleanOutput), i = xr(i), i;
3370
3395
  }
3371
- function xn(r) {
3396
+ function Tn(r) {
3372
3397
  const e = {}, t = (n) => {
3373
3398
  n.forEach((a) => {
3374
3399
  const { default: s, path: i, inputs: o } = a;
3375
- Array.isArray(o) ? t(o) : s !== void 0 && M(e, i, s);
3400
+ Array.isArray(o) ? t(o) : s !== void 0 && P(e, i, s);
3376
3401
  });
3377
3402
  };
3378
3403
  return Array.isArray(r.inputs) && t(r.inputs), e;
3379
3404
  }
3380
- function bn() {
3405
+ function Cn() {
3381
3406
  return function(r, e) {
3382
3407
  if (!(typeof r > "u"))
3383
- return !r || !qt(r) ? { value: r } : {
3408
+ return !r || !Ut(r) ? { value: r } : {
3384
3409
  value: Object.getOwnPropertyNames(r).map((t) => ({ key: t, value: r[t] }))
3385
3410
  };
3386
3411
  };
3387
3412
  }
3388
- function kn(r) {
3413
+ function Sn(r) {
3389
3414
  return function(e) {
3390
3415
  if (typeof e > "u") return;
3391
3416
  if (!e || !J(e)) return { value: e };
@@ -3398,32 +3423,32 @@ function kn(r) {
3398
3423
  return r != null && r.unsetIfEmpty && Object.getOwnPropertyNames(t.value).length === 0 ? { value: void 0 } : t;
3399
3424
  };
3400
3425
  }
3401
- function wn() {
3426
+ function On() {
3402
3427
  return function(r) {
3403
3428
  if (!(typeof r > "u"))
3404
3429
  return J(r) && Ce(r) ? { value: void 0 } : { value: r };
3405
3430
  };
3406
3431
  }
3407
- function Tn(r, e) {
3432
+ function Rn(r, e) {
3408
3433
  return function(t, n, a, s) {
3409
3434
  let i;
3410
3435
  if (r ? i = E(e && s ? s : n, r) : i = e ? a : t, !(typeof i > "u")) {
3411
- if (Ct(i)) return { value: void 0, path: r };
3412
- if (wt(i)) {
3413
- const o = Mt(le(i));
3436
+ if (Et(i)) return { value: void 0, path: r };
3437
+ if (Ot(i)) {
3438
+ const o = Lt(de(i));
3414
3439
  return Object.getOwnPropertyNames(o).length === 0 ? { value: void 0, path: r } : void 0;
3415
3440
  }
3416
3441
  return { value: i, path: r };
3417
3442
  }
3418
3443
  };
3419
3444
  }
3420
- function Cn() {
3445
+ function En() {
3421
3446
  return function(r) {
3422
3447
  if (!(typeof r > "u"))
3423
- return zt(r) && Ce(r) ? { value: void 0 } : { value: r };
3448
+ return Wt(r) && Ce(r) ? { value: void 0 } : { value: r };
3424
3449
  };
3425
3450
  }
3426
- function On(r) {
3451
+ function An(r) {
3427
3452
  return function(e, t) {
3428
3453
  const n = E(t, r);
3429
3454
  if (typeof n == "string")
@@ -3432,20 +3457,20 @@ function On(r) {
3432
3457
  return { value: e };
3433
3458
  };
3434
3459
  }
3435
- function Sn(r) {
3460
+ function In(r) {
3436
3461
  return function(e, t, n, a) {
3437
3462
  if (typeof e > "u") return;
3438
3463
  if (!e) return { value: e };
3439
3464
  const s = E(a || t, r);
3440
3465
  if (typeof s == "object") {
3441
- const i = Mt(s);
3466
+ const i = Lt(s);
3442
3467
  if (Object.getOwnPropertyNames(i).length === 1)
3443
3468
  return { value: e, path: r };
3444
3469
  }
3445
3470
  return { value: e };
3446
3471
  };
3447
3472
  }
3448
- function Rn(r) {
3473
+ function jn(r) {
3449
3474
  return function(e, t) {
3450
3475
  const n = E(t, r);
3451
3476
  if (typeof n == "string")
@@ -3454,7 +3479,7 @@ function Rn(r) {
3454
3479
  return { value: e };
3455
3480
  };
3456
3481
  }
3457
- function En(r, e) {
3482
+ function Nn(r, e) {
3458
3483
  return function(t, n) {
3459
3484
  if (typeof t > "u") return;
3460
3485
  if (!t) return { value: t };
@@ -3468,35 +3493,35 @@ function En(r, e) {
3468
3493
  return { value: t };
3469
3494
  };
3470
3495
  }
3471
- function $t(r) {
3472
- return Ut(r) ? !0 : J(r) ? r.length === 0 : typeof r == "object" ? !Object.getOwnPropertyNames(r).some((e) => !$t(r[e])) : Oe(r);
3496
+ function Dt(r) {
3497
+ return Ht(r) ? !0 : J(r) ? r.length === 0 : typeof r == "object" ? !Object.getOwnPropertyNames(r).some((e) => !Dt(r[e])) : Se(r);
3473
3498
  }
3474
- function Mt(r) {
3475
- return Bt(r, (e) => typeof e == "object" ? $t(e) : Oe(e));
3499
+ function Lt(r) {
3500
+ return Jt(r, (e) => typeof e == "object" ? Dt(e) : Se(e));
3476
3501
  }
3477
3502
  function De(r) {
3478
- const { items: e, className: t, withoutWrapper: n = !0, ...a } = r, s = e.map((i) => /* @__PURE__ */ O.jsx(pr, { input: i, path: i.path, ...a }, `${i.inputType}_${i.path}`));
3479
- return n ? /* @__PURE__ */ O.jsx(O.Fragment, { children: s }) : /* @__PURE__ */ O.jsx("div", { className: t, children: s });
3503
+ const { items: e, className: t, withoutWrapper: n = !0, ...a } = r, s = e.map((i) => /* @__PURE__ */ S.jsx(_r, { input: i, path: i.path, ...a }, `${i.inputType}_${i.path}`));
3504
+ return n ? /* @__PURE__ */ S.jsx(S.Fragment, { children: s }) : /* @__PURE__ */ S.jsx("div", { className: t, children: s });
3480
3505
  }
3481
3506
  De.displayName = "RenderInputs";
3482
- const sn = Kt((r, e) => {
3507
+ const cn = rr((r, e) => {
3483
3508
  const { inputs: t, className: n, factory: a, withoutWrapper: s } = r;
3484
- return s ? /* @__PURE__ */ O.jsxs(er, { children: [
3509
+ return s ? /* @__PURE__ */ S.jsxs(nr, { children: [
3485
3510
  t.hero,
3486
- /* @__PURE__ */ O.jsx(De, { items: t.inputs, factory: a })
3487
- ] }) : /* @__PURE__ */ O.jsxs("div", { className: n, ref: e, children: [
3511
+ /* @__PURE__ */ S.jsx(De, { items: t.inputs, factory: a })
3512
+ ] }) : /* @__PURE__ */ S.jsxs("div", { className: n, ref: e, children: [
3488
3513
  t.hero,
3489
- /* @__PURE__ */ O.jsx(De, { items: t.inputs, factory: a })
3514
+ /* @__PURE__ */ S.jsx(De, { items: t.inputs, factory: a })
3490
3515
  ] });
3491
3516
  });
3492
- sn.displayName = "RenderForm";
3493
- function jn(r) {
3517
+ cn.displayName = "RenderForm";
3518
+ function Vn(r) {
3494
3519
  let e = !0;
3495
- return kt(r, (t) => {
3496
- e = e && (t === "" || Ct(t) || Oe(t));
3520
+ return St(r, (t) => {
3521
+ e = e && (t === "" || Et(t) || Se(t));
3497
3522
  }), e;
3498
3523
  }
3499
- const An = (r = "") => Wt(r.split("_").join(" ")), an = (r, e = 2, t, n = 1e3) => {
3524
+ const Zn = (r = "") => Yt(r.split("_").join(" ")), dn = (r, e = 2, t, n = 1e3) => {
3500
3525
  let a = !1;
3501
3526
  const s = () => {
3502
3527
  requestAnimationFrame(() => {
@@ -3508,7 +3533,7 @@ const An = (r = "") => Wt(r.split("_").join(" ")), an = (r, e = 2, t, n = 1e3) =
3508
3533
  a = !0;
3509
3534
  });
3510
3535
  };
3511
- function In(r, e) {
3536
+ function Pn(r, e) {
3512
3537
  return {
3513
3538
  ...r,
3514
3539
  inputs: r.inputs.map((t) => D(t, e))
@@ -3521,7 +3546,7 @@ function D(r, e) {
3521
3546
  const y = ((u = n.inputConfig) == null ? void 0 : u.inputs) || [], h = (s == null ? void 0 : s.inputs) || [];
3522
3547
  if (y.length > 0 || h.length > 0) {
3523
3548
  const v = Math.max(y.length, h.length);
3524
- o.inputConfig.inputs = Array.from({ length: v }, (S, w) => {
3549
+ o.inputConfig.inputs = Array.from({ length: v }, (O, w) => {
3525
3550
  var V;
3526
3551
  const R = y[w], T = h[w];
3527
3552
  if (!R && T) return D(T, e);
@@ -3547,66 +3572,66 @@ function D(r, e) {
3547
3572
  }
3548
3573
  return o;
3549
3574
  }
3550
- function Nn(r) {
3575
+ function $n(r) {
3551
3576
  const {
3552
3577
  field: { onBlur: e, ...t },
3553
3578
  ...n
3554
- } = ir(r), a = G(Date.now());
3579
+ } = cr(r), a = G(Date.now());
3555
3580
  return {
3556
3581
  ...n,
3557
3582
  field: {
3558
3583
  ...t,
3559
- onBlur: an(e, 2, a.current)
3584
+ onBlur: dn(e, 2, a.current)
3560
3585
  }
3561
3586
  };
3562
3587
  }
3563
3588
  export {
3564
- Pn as Controller,
3565
- $n as Form,
3566
- Mn as FormProvider,
3567
- fn as InputComponent,
3568
- pr as InputComponentRenderer,
3569
- Ot as InputFactory,
3570
- ur as InputOverrideError,
3571
- sn as RenderForm,
3589
+ Dn as Controller,
3590
+ Ln as Form,
3591
+ qn as FormProvider,
3592
+ yn as InputComponent,
3593
+ _r as InputComponentRenderer,
3594
+ At as InputFactory,
3595
+ lr as InputOverrideError,
3596
+ cn as RenderForm,
3572
3597
  De as RenderInputs,
3573
- hn as RootForm,
3574
- an as afterFrames,
3575
- In as applyFormOverrides,
3598
+ gn as RootForm,
3599
+ dn as afterFrames,
3600
+ Pn as applyFormOverrides,
3576
3601
  D as applyInputOverride,
3577
- kn as arrayToObjectOutputTransformer,
3578
- xn as collectDefaultValues,
3579
- _n as convertDataToFormModel,
3580
- vn as convertFormModelToData,
3581
- An as generateReadableLabel,
3582
- Fn as get,
3583
- mn as getDefaultValuesFromFormDefinition,
3584
- yn as getTemporaryPath,
3585
- Pt as getTransformers,
3586
- Jr as getValidationSchema,
3587
- Kr as inputTransformValues,
3588
- jn as isChildrenEmpty,
3589
- bn as objectToArrayInputTransformer,
3590
- en as outputTransformValues,
3591
- pn as overrideFormDefinition,
3602
+ Sn as arrayToObjectOutputTransformer,
3603
+ Tn as collectDefaultValues,
3604
+ kn as convertDataToFormModel,
3605
+ wn as convertFormModelToData,
3606
+ Zn as generateReadableLabel,
3607
+ zn as get,
3608
+ _n as getDefaultValuesFromFormDefinition,
3609
+ xn as getTemporaryPath,
3610
+ Ft as getTransformers,
3611
+ Qr as getValidationSchema,
3612
+ nn as inputTransformValues,
3613
+ Vn as isChildrenEmpty,
3614
+ Cn as objectToArrayInputTransformer,
3615
+ sn as outputTransformValues,
3616
+ vn as overrideFormDefinition,
3592
3617
  ce as processValidationParseResponse,
3593
- gr as removeTemporaryFieldsValue,
3594
- Dn as set,
3595
- Rn as shorthandArrayInputTransformer,
3596
- En as shorthandArrayOutputTransformer,
3597
- On as shorthandObjectInputTransformer,
3598
- Sn as shorthandObjectOutputTransformer,
3599
- wn as unsetEmptyArrayOutputTransformer,
3600
- Tn as unsetEmptyObjectOutputTransformer,
3601
- Cn as unsetEmptyStringOutputTransformer,
3602
- nn as unsetHiddenInputsValues,
3603
- Nn as useController,
3604
- Ln as useFieldArray,
3605
- qn as useForm,
3606
- zn as useFormContext,
3607
- Bn as useFormState,
3608
- hr as useRootFormContext,
3609
- Un as useWatch,
3610
- gn as useZodValidationResolver
3618
+ xr as removeTemporaryFieldsValue,
3619
+ Bn as set,
3620
+ jn as shorthandArrayInputTransformer,
3621
+ Nn as shorthandArrayOutputTransformer,
3622
+ An as shorthandObjectInputTransformer,
3623
+ In as shorthandObjectOutputTransformer,
3624
+ On as unsetEmptyArrayOutputTransformer,
3625
+ Rn as unsetEmptyObjectOutputTransformer,
3626
+ En as unsetEmptyStringOutputTransformer,
3627
+ un as unsetHiddenInputsValues,
3628
+ $n as useController,
3629
+ Un as useFieldArray,
3630
+ Wn as useForm,
3631
+ Jn as useFormContext,
3632
+ Hn as useFormState,
3633
+ yr as useRootFormContext,
3634
+ Yn as useWatch,
3635
+ bn as useZodValidationResolver
3611
3636
  };
3612
3637
  //# sourceMappingURL=index.js.map