@abduljebar/text-editor 1.1.2 → 1.1.3

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,6 +1,6 @@
1
- import Lt, { useState as ze, useEffect as ut, useRef as Mt, useCallback as V } from "react";
2
- import { Save as Vt, FileDown as Wt, Trash2 as Bt, Bold as Yt, Italic as Jt, Underline as Gt, Strikethrough as qt, List as Ht, ListOrdered as Xt, Heading1 as Kt, Heading2 as Qt, Type as en, AlignLeft as tn, AlignCenter as nn, AlignRight as rn, Link as on } from "lucide-react";
3
- var K = { exports: {} }, Y = {};
1
+ import Q, { useEffect as Ie, useRef as vt, useState as bt, useCallback as F } from "react";
2
+ import { Save as Jt, FileDown as Gt, Trash2 as qt, Bold as Xt, Italic as Kt, Underline as Qt, Strikethrough as en, List as tn, ListOrdered as nn, Heading1 as rn, Heading2 as on, Type as sn, AlignLeft as cn, AlignCenter as an, AlignRight as un, Link as ln } from "lucide-react";
3
+ var oe = { exports: {} }, X = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.js
@@ -10,29 +10,29 @@ var K = { exports: {} }, Y = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var Ne;
14
- function cn() {
15
- if (Ne) return Y;
16
- Ne = 1;
13
+ var We;
14
+ function dn() {
15
+ if (We) return X;
16
+ We = 1;
17
17
  var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
18
18
  function n(r, o, i) {
19
- var c = null;
20
- if (i !== void 0 && (c = "" + i), o.key !== void 0 && (c = "" + o.key), "key" in o) {
19
+ var s = null;
20
+ if (i !== void 0 && (s = "" + i), o.key !== void 0 && (s = "" + o.key), "key" in o) {
21
21
  i = {};
22
- for (var a in o)
23
- a !== "key" && (i[a] = o[a]);
22
+ for (var c in o)
23
+ c !== "key" && (i[c] = o[c]);
24
24
  } else i = o;
25
25
  return o = i.ref, {
26
26
  $$typeof: e,
27
27
  type: r,
28
- key: c,
28
+ key: s,
29
29
  ref: o !== void 0 ? o : null,
30
30
  props: i
31
31
  };
32
32
  }
33
- return Y.Fragment = t, Y.jsx = n, Y.jsxs = n, Y;
33
+ return X.Fragment = t, X.jsx = n, X.jsxs = n, X;
34
34
  }
35
- var J = {};
35
+ var K = {};
36
36
  /**
37
37
  * @license React
38
38
  * react-jsx-runtime.development.js
@@ -42,47 +42,47 @@ var J = {};
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
44
  */
45
- var De;
46
- function sn() {
47
- return De || (De = 1, process.env.NODE_ENV !== "production" && (function() {
45
+ var Be;
46
+ function fn() {
47
+ return Be || (Be = 1, process.env.NODE_ENV !== "production" && (function() {
48
48
  function e(u) {
49
49
  if (u == null) return null;
50
50
  if (typeof u == "function")
51
- return u.$$typeof === Dt ? null : u.displayName || u.name || null;
51
+ return u.$$typeof === D ? null : u.displayName || u.name || null;
52
52
  if (typeof u == "string") return u;
53
53
  switch (u) {
54
- case y:
54
+ case C:
55
55
  return "Fragment";
56
- case L:
56
+ case k:
57
57
  return "Profiler";
58
- case P:
58
+ case N:
59
59
  return "StrictMode";
60
- case Rt:
60
+ case _e:
61
61
  return "Suspense";
62
- case Pt:
62
+ case ve:
63
63
  return "SuspenseList";
64
- case Nt:
64
+ case E:
65
65
  return "Activity";
66
66
  }
67
67
  if (typeof u == "object")
68
68
  switch (typeof u.tag == "number" && console.error(
69
69
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
70
70
  ), u.$$typeof) {
71
- case R:
71
+ case b:
72
72
  return "Portal";
73
- case I:
73
+ case z:
74
74
  return u.displayName || "Context";
75
- case A:
75
+ case $:
76
76
  return (u._context.displayName || "Context") + ".Consumer";
77
- case C:
78
- var _ = u.render;
79
- return u = u.displayName, u || (u = _.displayName || _.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
80
- case Ct:
81
- return _ = u.displayName || null, _ !== null ? _ : e(u.type) || "Memo";
82
- case de:
83
- _ = u._payload, u = u._init;
77
+ case P:
78
+ var v = u.render;
79
+ return u = u.displayName, u || (u = v.displayName || v.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
80
+ case be:
81
+ return v = u.displayName || null, v !== null ? v : e(u.type) || "Memo";
82
+ case q:
83
+ v = u._payload, u = u._init;
84
84
  try {
85
- return e(u(_));
85
+ return e(u(v));
86
86
  } catch {
87
87
  }
88
88
  }
@@ -94,74 +94,74 @@ function sn() {
94
94
  function n(u) {
95
95
  try {
96
96
  t(u);
97
- var _ = !1;
97
+ var v = !1;
98
98
  } catch {
99
- _ = !0;
99
+ v = !0;
100
100
  }
101
- if (_) {
102
- _ = console;
103
- var z = _.error, E = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
104
- return z.call(
105
- _,
101
+ if (v) {
102
+ v = console;
103
+ var x = v.error, j = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
104
+ return x.call(
105
+ v,
106
106
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
107
- E
107
+ j
108
108
  ), t(u);
109
109
  }
110
110
  }
111
111
  function r(u) {
112
- if (u === y) return "<>";
113
- if (typeof u == "object" && u !== null && u.$$typeof === de)
112
+ if (u === C) return "<>";
113
+ if (typeof u == "object" && u !== null && u.$$typeof === q)
114
114
  return "<...>";
115
115
  try {
116
- var _ = e(u);
117
- return _ ? "<" + _ + ">" : "<...>";
116
+ var v = e(u);
117
+ return v ? "<" + v + ">" : "<...>";
118
118
  } catch {
119
119
  return "<...>";
120
120
  }
121
121
  }
122
122
  function o() {
123
- var u = fe.A;
123
+ var u = Y.A;
124
124
  return u === null ? null : u.getOwner();
125
125
  }
126
126
  function i() {
127
127
  return Error("react-stack-top-frame");
128
128
  }
129
- function c(u) {
130
- if (Ie.call(u, "key")) {
131
- var _ = Object.getOwnPropertyDescriptor(u, "key").get;
132
- if (_ && _.isReactWarning) return !1;
129
+ function s(u) {
130
+ if (U.call(u, "key")) {
131
+ var v = Object.getOwnPropertyDescriptor(u, "key").get;
132
+ if (v && v.isReactWarning) return !1;
133
133
  }
134
134
  return u.key !== void 0;
135
135
  }
136
- function a(u, _) {
137
- function z() {
138
- Se || (Se = !0, console.error(
136
+ function c(u, v) {
137
+ function x() {
138
+ Ue || (Ue = !0, console.error(
139
139
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
140
- _
140
+ v
141
141
  ));
142
142
  }
143
- z.isReactWarning = !0, Object.defineProperty(u, "key", {
144
- get: z,
143
+ x.isReactWarning = !0, Object.defineProperty(u, "key", {
144
+ get: x,
145
145
  configurable: !0
146
146
  });
147
147
  }
148
- function f() {
148
+ function d() {
149
149
  var u = e(this.type);
150
- return Oe[u] || (Oe[u] = !0, console.error(
150
+ return Fe[u] || (Fe[u] = !0, console.error(
151
151
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
152
152
  )), u = this.props.ref, u !== void 0 ? u : null;
153
153
  }
154
- function d(u, _, z, E, X, pe) {
155
- var x = z.ref;
154
+ function l(u, v, x, j, re, ke) {
155
+ var A = x.ref;
156
156
  return u = {
157
157
  $$typeof: T,
158
158
  type: u,
159
- key: _,
160
- props: z,
161
- _owner: E
162
- }, (x !== void 0 ? x : null) !== null ? Object.defineProperty(u, "ref", {
159
+ key: v,
160
+ props: x,
161
+ _owner: j
162
+ }, (A !== void 0 ? A : null) !== null ? Object.defineProperty(u, "ref", {
163
163
  enumerable: !1,
164
- get: f
164
+ get: d
165
165
  }) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
@@ -176,277 +176,315 @@ function sn() {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
- value: X
179
+ value: re
180
180
  }), Object.defineProperty(u, "_debugTask", {
181
181
  configurable: !1,
182
182
  enumerable: !1,
183
183
  writable: !0,
184
- value: pe
184
+ value: ke
185
185
  }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
186
186
  }
187
- function l(u, _, z, E, X, pe) {
188
- var x = _.children;
189
- if (x !== void 0)
190
- if (E)
191
- if (Ut(x)) {
192
- for (E = 0; E < x.length; E++)
193
- g(x[E]);
194
- Object.freeze && Object.freeze(x);
187
+ function f(u, v, x, j, re, ke) {
188
+ var A = v.children;
189
+ if (A !== void 0)
190
+ if (j)
191
+ if (Yt(A)) {
192
+ for (j = 0; j < A.length; j++)
193
+ h(A[j]);
194
+ Object.freeze && Object.freeze(A);
195
195
  } else
196
196
  console.error(
197
197
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
198
198
  );
199
- else g(x);
200
- if (Ie.call(_, "key")) {
201
- x = e(u);
202
- var M = Object.keys(_).filter(function(Ft) {
203
- return Ft !== "key";
199
+ else h(A);
200
+ if (U.call(v, "key")) {
201
+ A = e(u);
202
+ var H = Object.keys(v).filter(function(Ht) {
203
+ return Ht !== "key";
204
204
  });
205
- E = 0 < M.length ? "{key: someKey, " + M.join(": ..., ") + ": ...}" : "{key: someKey}", Ce[x + E] || (M = 0 < M.length ? "{" + M.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ j = 0 < H.length ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}", Ve[A + j] || (H = 0 < H.length ? "{" + H.join(": ..., ") + ": ...}" : "{}", console.error(
206
206
  `A props object containing a "key" prop is being spread into JSX:
207
207
  let props = %s;
208
208
  <%s {...props} />
209
209
  React keys must be passed directly to JSX without using spread:
210
210
  let props = %s;
211
211
  <%s key={someKey} {...props} />`,
212
- E,
213
- x,
214
- M,
215
- x
216
- ), Ce[x + E] = !0);
212
+ j,
213
+ A,
214
+ H,
215
+ A
216
+ ), Ve[A + j] = !0);
217
217
  }
218
- if (x = null, z !== void 0 && (n(z), x = "" + z), c(_) && (n(_.key), x = "" + _.key), "key" in _) {
219
- z = {};
220
- for (var me in _)
221
- me !== "key" && (z[me] = _[me]);
222
- } else z = _;
223
- return x && a(
224
- z,
218
+ if (A = null, x !== void 0 && (n(x), A = "" + x), s(v) && (n(v.key), A = "" + v.key), "key" in v) {
219
+ x = {};
220
+ for (var ze in v)
221
+ ze !== "key" && (x[ze] = v[ze]);
222
+ } else x = v;
223
+ return A && c(
224
+ x,
225
225
  typeof u == "function" ? u.displayName || u.name || "Unknown" : u
226
- ), d(
226
+ ), l(
227
227
  u,
228
+ A,
228
229
  x,
229
- z,
230
230
  o(),
231
- X,
232
- pe
231
+ re,
232
+ ke
233
233
  );
234
234
  }
235
- function g(u) {
236
- p(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === de && (u._payload.status === "fulfilled" ? p(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
235
+ function h(u) {
236
+ p(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === q && (u._payload.status === "fulfilled" ? p(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
237
237
  }
238
238
  function p(u) {
239
239
  return typeof u == "object" && u !== null && u.$$typeof === T;
240
240
  }
241
- var v = Lt, T = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), I = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), Rt = Symbol.for("react.suspense"), Pt = Symbol.for("react.suspense_list"), Ct = Symbol.for("react.memo"), de = Symbol.for("react.lazy"), Nt = Symbol.for("react.activity"), Dt = Symbol.for("react.client.reference"), fe = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Ie = Object.prototype.hasOwnProperty, Ut = Array.isArray, he = console.createTask ? console.createTask : function() {
241
+ var g = Q, T = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), C = Symbol.for("react.fragment"), N = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), z = Symbol.for("react.context"), P = Symbol.for("react.forward_ref"), _e = Symbol.for("react.suspense"), ve = Symbol.for("react.suspense_list"), be = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), E = Symbol.for("react.activity"), D = Symbol.for("react.client.reference"), Y = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, Yt = Array.isArray, we = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- v = {
244
+ g = {
245
245
  react_stack_bottom_frame: function(u) {
246
246
  return u();
247
247
  }
248
248
  };
249
- var Se, Oe = {}, Re = v.react_stack_bottom_frame.bind(
250
- v,
249
+ var Ue, Fe = {}, Le = g.react_stack_bottom_frame.bind(
250
+ g,
251
251
  i
252
- )(), Pe = he(r(i)), Ce = {};
253
- J.Fragment = y, J.jsx = function(u, _, z) {
254
- var E = 1e4 > fe.recentlyCreatedOwnerStacks++;
255
- return l(
252
+ )(), Me = we(r(i)), Ve = {};
253
+ K.Fragment = C, K.jsx = function(u, v, x) {
254
+ var j = 1e4 > Y.recentlyCreatedOwnerStacks++;
255
+ return f(
256
256
  u,
257
- _,
258
- z,
257
+ v,
258
+ x,
259
259
  !1,
260
- E ? Error("react-stack-top-frame") : Re,
261
- E ? he(r(u)) : Pe
260
+ j ? Error("react-stack-top-frame") : Le,
261
+ j ? we(r(u)) : Me
262
262
  );
263
- }, J.jsxs = function(u, _, z) {
264
- var E = 1e4 > fe.recentlyCreatedOwnerStacks++;
265
- return l(
263
+ }, K.jsxs = function(u, v, x) {
264
+ var j = 1e4 > Y.recentlyCreatedOwnerStacks++;
265
+ return f(
266
266
  u,
267
- _,
268
- z,
267
+ v,
268
+ x,
269
269
  !0,
270
- E ? Error("react-stack-top-frame") : Re,
271
- E ? he(r(u)) : Pe
270
+ j ? Error("react-stack-top-frame") : Le,
271
+ j ? we(r(u)) : Me
272
272
  );
273
273
  };
274
- })()), J;
275
- }
276
- var Ue;
277
- function an() {
278
- return Ue || (Ue = 1, process.env.NODE_ENV === "production" ? K.exports = cn() : K.exports = sn()), K.exports;
279
- }
280
- var m = an();
281
- const un = ({
282
- onCommand: e,
283
- onSave: t,
284
- onExport: n,
285
- onClear: r,
286
- hasUnsavedChanges: o
287
- }) => {
288
- const [i, c] = ze([]), a = () => {
289
- const l = [
290
- "bold",
291
- "italic",
292
- "underline",
293
- "strikeThrough",
294
- "justifyLeft",
295
- "justifyCenter",
296
- "justifyRight"
297
- ], g = [];
298
- l.forEach((p) => {
299
- document.queryCommandState(p) && g.push(p);
300
- }), c(g);
274
+ })()), K;
275
+ }
276
+ var Ye;
277
+ function hn() {
278
+ return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? oe.exports = dn() : oe.exports = fn()), oe.exports;
279
+ }
280
+ var _ = hn();
281
+ const He = (e) => {
282
+ let t;
283
+ const n = /* @__PURE__ */ new Set(), r = (l, f) => {
284
+ const h = typeof l == "function" ? l(t) : l;
285
+ if (!Object.is(h, t)) {
286
+ const p = t;
287
+ t = f ?? (typeof h != "object" || h === null) ? h : Object.assign({}, t, h), n.forEach((g) => g(t, p));
288
+ }
289
+ }, o = () => t, c = { setState: r, getState: o, getInitialState: () => d, subscribe: (l) => (n.add(l), () => n.delete(l)) }, d = t = e(r, o, c);
290
+ return c;
291
+ }, mn = ((e) => e ? He(e) : He), pn = (e) => e;
292
+ function gn(e, t = pn) {
293
+ const n = Q.useSyncExternalStore(
294
+ e.subscribe,
295
+ Q.useCallback(() => t(e.getState()), [e, t]),
296
+ Q.useCallback(() => t(e.getInitialState()), [e, t])
297
+ );
298
+ return Q.useDebugValue(n), n;
299
+ }
300
+ const _n = (e) => {
301
+ const t = mn(e), n = (r) => gn(t, r);
302
+ return Object.assign(n, t), n;
303
+ }, vn = ((e) => _n);
304
+ function bn(e, t) {
305
+ let n;
306
+ try {
307
+ n = e();
308
+ } catch {
309
+ return;
310
+ }
311
+ return {
312
+ getItem: (o) => {
313
+ var i;
314
+ const s = (d) => d === null ? null : JSON.parse(d, void 0), c = (i = n.getItem(o)) != null ? i : null;
315
+ return c instanceof Promise ? c.then(s) : s(c);
316
+ },
317
+ setItem: (o, i) => n.setItem(o, JSON.stringify(i, void 0)),
318
+ removeItem: (o) => n.removeItem(o)
301
319
  };
302
- ut(() => (document.addEventListener("selectionchange", a), () => document.removeEventListener("selectionchange", a)), []);
320
+ }
321
+ const Ze = (e) => (t) => {
322
+ try {
323
+ const n = e(t);
324
+ return n instanceof Promise ? n : {
325
+ then(r) {
326
+ return Ze(r)(n);
327
+ },
328
+ catch(r) {
329
+ return this;
330
+ }
331
+ };
332
+ } catch (n) {
333
+ return {
334
+ then(r) {
335
+ return this;
336
+ },
337
+ catch(r) {
338
+ return Ze(r)(n);
339
+ }
340
+ };
341
+ }
342
+ }, wn = (e, t) => (n, r, o) => {
343
+ let i = {
344
+ storage: bn(() => localStorage),
345
+ partialize: (b) => b,
346
+ version: 0,
347
+ merge: (b, C) => ({
348
+ ...C,
349
+ ...b
350
+ }),
351
+ ...t
352
+ }, s = !1;
353
+ const c = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
354
+ let l = i.storage;
355
+ if (!l)
356
+ return e(
357
+ (...b) => {
358
+ console.warn(
359
+ `[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`
360
+ ), n(...b);
361
+ },
362
+ r,
363
+ o
364
+ );
303
365
  const f = () => {
304
- const l = prompt("Enter URL:");
305
- l && e("createLink", l);
306
- }, d = [
307
- { command: "bold", icon: /* @__PURE__ */ m.jsx(Yt, { size: 18 }), title: "Bold" },
308
- { command: "italic", icon: /* @__PURE__ */ m.jsx(Jt, { size: 18 }), title: "Italic" },
309
- { command: "underline", icon: /* @__PURE__ */ m.jsx(Gt, { size: 18 }), title: "Underline" },
310
- { command: "strikeThrough", icon: /* @__PURE__ */ m.jsx(qt, { size: 18 }), title: "Strikethrough" },
311
- { separator: !0 },
312
- { command: "insertUnorderedList", icon: /* @__PURE__ */ m.jsx(Ht, { size: 18 }), title: "Bullet List" },
313
- { command: "insertOrderedList", icon: /* @__PURE__ */ m.jsx(Xt, { size: 18 }), title: "Numbered List" },
314
- { separator: !0 },
315
- { command: "formatBlock", value: "h1", icon: /* @__PURE__ */ m.jsx(Kt, { size: 18 }), title: "Heading 1" },
316
- { command: "formatBlock", value: "h2", icon: /* @__PURE__ */ m.jsx(Qt, { size: 18 }), title: "Heading 2" },
317
- { command: "formatBlock", value: "p", icon: /* @__PURE__ */ m.jsx(en, { size: 18 }), title: "Paragraph" },
318
- { separator: !0 },
319
- { command: "justifyLeft", icon: /* @__PURE__ */ m.jsx(tn, { size: 18 }), title: "Align Left" },
320
- { command: "justifyCenter", icon: /* @__PURE__ */ m.jsx(nn, { size: 18 }), title: "Center" },
321
- { command: "justifyRight", icon: /* @__PURE__ */ m.jsx(rn, { size: 18 }), title: "Align Right" },
322
- { separator: !0 },
323
- { command: "createLink", icon: /* @__PURE__ */ m.jsx(on, { size: 18 }), title: "Insert Link" }
324
- ];
325
- return /* @__PURE__ */ m.jsxs("div", { className: "flex flex-wrap justify-between items-center p-3 bg-gray-50 border-b border-gray-200", children: [
326
- /* @__PURE__ */ m.jsx("div", { className: "flex flex-wrap items-center gap-1", children: d.map((l, g) => {
327
- if ("separator" in l)
328
- return /* @__PURE__ */ m.jsx("div", { className: "w-px h-6 bg-gray-300 mx-2 inline" }, g);
329
- const p = i.includes(l.command);
330
- return /* @__PURE__ */ m.jsx(
331
- "button",
332
- {
333
- onClick: () => l.command === "createLink" ? f() : e(l.command, l.value),
334
- title: l.title,
335
- type: "button",
336
- className: `w-9 h-9 flex items-center justify-center rounded-md border border-gray-300 text-gray-700 hover:bg-gray-100 active:bg-gray-200 transition
337
- ${p ? "bg-blue-100 text-blue-600 border-blue-300" : "bg-white"}`,
338
- children: l.icon
339
- },
340
- g
341
- );
342
- }) }),
343
- /* @__PURE__ */ m.jsxs("div", { className: "flex items-center gap-2 mt-2 sm:mt-0", children: [
344
- /* @__PURE__ */ m.jsxs(
345
- "button",
346
- {
347
- onClick: t,
348
- disabled: !o,
349
- title: "Save Document",
350
- className: "flex items-center gap-1 px-3 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed transition",
351
- children: [
352
- /* @__PURE__ */ m.jsx(Vt, { size: 16 }),
353
- " Save"
354
- ]
355
- }
356
- ),
357
- /* @__PURE__ */ m.jsxs(
358
- "button",
359
- {
360
- onClick: n,
361
- title: "Export as HTML",
362
- className: "flex items-center gap-1 px-3 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 transition",
363
- children: [
364
- /* @__PURE__ */ m.jsx(Wt, { size: 16 }),
365
- " Export"
366
- ]
367
- }
368
- ),
369
- /* @__PURE__ */ m.jsxs(
370
- "button",
371
- {
372
- onClick: r,
373
- title: "Clear Editor",
374
- className: "flex items-center gap-1 px-3 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 transition",
375
- children: [
376
- /* @__PURE__ */ m.jsx(Bt, { size: 16 }),
377
- " Clear"
378
- ]
379
- }
380
- )
381
- ] })
382
- ] });
383
- }, ln = ({
384
- wordCount: e,
385
- characterCount: t,
386
- hasUnsavedChanges: n
387
- }) => /* @__PURE__ */ m.jsx("div", { className: "flex justify-between items-center px-5 py-3 bg-gray-50 border-t border-gray-200 text-sm text-gray-600", children: /* @__PURE__ */ m.jsxs("div", { className: "flex items-center gap-6", children: [
388
- /* @__PURE__ */ m.jsxs("div", { children: [
389
- "Words: ",
390
- /* @__PURE__ */ m.jsx("strong", { className: "text-gray-800", children: e })
391
- ] }),
392
- /* @__PURE__ */ m.jsxs("div", { children: [
393
- "Characters: ",
394
- /* @__PURE__ */ m.jsx("strong", { className: "text-gray-800", children: t })
395
- ] }),
396
- /* @__PURE__ */ m.jsxs("div", { children: [
397
- "Status: ",
398
- /* @__PURE__ */ m.jsx("strong", { className: n ? "text-orange-600" : "text-green-600", children: n ? "Unsaved Changes" : "Saved" })
399
- ] })
400
- ] }) });
401
- function s(e, t, n) {
402
- function r(a, f) {
403
- var d;
404
- Object.defineProperty(a, "_zod", {
405
- value: a._zod ?? {},
366
+ const b = i.partialize({ ...r() });
367
+ return l.setItem(i.name, {
368
+ state: b,
369
+ version: i.version
370
+ });
371
+ }, h = o.setState;
372
+ o.setState = (b, C) => (h(b, C), f());
373
+ const p = e(
374
+ (...b) => (n(...b), f()),
375
+ r,
376
+ o
377
+ );
378
+ o.getInitialState = () => p;
379
+ let g;
380
+ const T = () => {
381
+ var b, C;
382
+ if (!l) return;
383
+ s = !1, c.forEach((k) => {
384
+ var $;
385
+ return k(($ = r()) != null ? $ : p);
386
+ });
387
+ const N = ((C = i.onRehydrateStorage) == null ? void 0 : C.call(i, (b = r()) != null ? b : p)) || void 0;
388
+ return Ze(l.getItem.bind(l))(i.name).then((k) => {
389
+ if (k)
390
+ if (typeof k.version == "number" && k.version !== i.version) {
391
+ if (i.migrate) {
392
+ const $ = i.migrate(
393
+ k.state,
394
+ k.version
395
+ );
396
+ return $ instanceof Promise ? $.then((z) => [!0, z]) : [!0, $];
397
+ }
398
+ console.error(
399
+ "State loaded from storage couldn't be migrated since no migrate function was provided"
400
+ );
401
+ } else
402
+ return [!1, k.state];
403
+ return [!1, void 0];
404
+ }).then((k) => {
405
+ var $;
406
+ const [z, P] = k;
407
+ if (g = i.merge(
408
+ P,
409
+ ($ = r()) != null ? $ : p
410
+ ), n(g, !0), z)
411
+ return f();
412
+ }).then(() => {
413
+ N?.(g, void 0), g = r(), s = !0, d.forEach((k) => k(g));
414
+ }).catch((k) => {
415
+ N?.(void 0, k);
416
+ });
417
+ };
418
+ return o.persist = {
419
+ setOptions: (b) => {
420
+ i = {
421
+ ...i,
422
+ ...b
423
+ }, b.storage && (l = b.storage);
424
+ },
425
+ clearStorage: () => {
426
+ l?.removeItem(i.name);
427
+ },
428
+ getOptions: () => i,
429
+ rehydrate: () => T(),
430
+ hasHydrated: () => s,
431
+ onHydrate: (b) => (c.add(b), () => {
432
+ c.delete(b);
433
+ }),
434
+ onFinishHydration: (b) => (d.add(b), () => {
435
+ d.delete(b);
436
+ })
437
+ }, i.skipHydration || T(), g || p;
438
+ }, kn = wn;
439
+ function a(e, t, n) {
440
+ function r(c, d) {
441
+ var l;
442
+ Object.defineProperty(c, "_zod", {
443
+ value: c._zod ?? {},
406
444
  enumerable: !1
407
- }), (d = a._zod).traits ?? (d.traits = /* @__PURE__ */ new Set()), a._zod.traits.add(e), t(a, f);
408
- for (const l in c.prototype)
409
- l in a || Object.defineProperty(a, l, { value: c.prototype[l].bind(a) });
410
- a._zod.constr = c, a._zod.def = f;
445
+ }), (l = c._zod).traits ?? (l.traits = /* @__PURE__ */ new Set()), c._zod.traits.add(e), t(c, d);
446
+ for (const f in s.prototype)
447
+ f in c || Object.defineProperty(c, f, { value: s.prototype[f].bind(c) });
448
+ c._zod.constr = s, c._zod.def = d;
411
449
  }
412
450
  const o = n?.Parent ?? Object;
413
451
  class i extends o {
414
452
  }
415
453
  Object.defineProperty(i, "name", { value: e });
416
- function c(a) {
417
- var f;
418
- const d = n?.Parent ? new i() : this;
419
- r(d, a), (f = d._zod).deferred ?? (f.deferred = []);
420
- for (const l of d._zod.deferred)
421
- l();
422
- return d;
454
+ function s(c) {
455
+ var d;
456
+ const l = n?.Parent ? new i() : this;
457
+ r(l, c), (d = l._zod).deferred ?? (d.deferred = []);
458
+ for (const f of l._zod.deferred)
459
+ f();
460
+ return l;
423
461
  }
424
- return Object.defineProperty(c, "init", { value: r }), Object.defineProperty(c, Symbol.hasInstance, {
425
- value: (a) => n?.Parent && a instanceof n.Parent ? !0 : a?._zod?.traits?.has(e)
426
- }), Object.defineProperty(c, "name", { value: e }), c;
462
+ return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
463
+ value: (c) => n?.Parent && c instanceof n.Parent ? !0 : c?._zod?.traits?.has(e)
464
+ }), Object.defineProperty(s, "name", { value: e }), s;
427
465
  }
428
- class B extends Error {
466
+ class G extends Error {
429
467
  constructor() {
430
468
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
431
469
  }
432
470
  }
433
- class lt extends Error {
471
+ class wt extends Error {
434
472
  constructor(t) {
435
473
  super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
436
474
  }
437
475
  }
438
- const dt = {};
439
- function N(e) {
440
- return dt;
476
+ const kt = {};
477
+ function M(e) {
478
+ return kt;
441
479
  }
442
- function dn(e) {
480
+ function zn(e) {
443
481
  const t = Object.values(e).filter((r) => typeof r == "number");
444
482
  return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
445
483
  }
446
- function ve(e, t) {
484
+ function Ee(e, t) {
447
485
  return typeof t == "bigint" ? t.toString() : t;
448
486
  }
449
- function ye(e) {
487
+ function je(e) {
450
488
  return {
451
489
  get value() {
452
490
  {
@@ -456,30 +494,30 @@ function ye(e) {
456
494
  }
457
495
  };
458
496
  }
459
- function $e(e) {
497
+ function Ae(e) {
460
498
  return e == null;
461
499
  }
462
- function Ze(e) {
500
+ function Ce(e) {
463
501
  const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
464
502
  return e.slice(t, n);
465
503
  }
466
- function fn(e, t) {
504
+ function yn(e, t) {
467
505
  const n = (e.toString().split(".")[1] || "").length, r = t.toString();
468
506
  let o = (r.split(".")[1] || "").length;
469
507
  if (o === 0 && /\d?e-\d?/.test(r)) {
470
- const f = r.match(/\d?e-(\d?)/);
471
- f?.[1] && (o = Number.parseInt(f[1]));
508
+ const d = r.match(/\d?e-(\d?)/);
509
+ d?.[1] && (o = Number.parseInt(d[1]));
472
510
  }
473
- const i = n > o ? n : o, c = Number.parseInt(e.toFixed(i).replace(".", "")), a = Number.parseInt(t.toFixed(i).replace(".", ""));
474
- return c % a / 10 ** i;
511
+ const i = n > o ? n : o, s = Number.parseInt(e.toFixed(i).replace(".", "")), c = Number.parseInt(t.toFixed(i).replace(".", ""));
512
+ return s % c / 10 ** i;
475
513
  }
476
- const Fe = Symbol("evaluating");
477
- function b(e, t, n) {
514
+ const Je = Symbol("evaluating");
515
+ function w(e, t, n) {
478
516
  let r;
479
517
  Object.defineProperty(e, t, {
480
518
  get() {
481
- if (r !== Fe)
482
- return r === void 0 && (r = Fe, r = n()), r;
519
+ if (r !== Je)
520
+ return r === void 0 && (r = Je, r = n()), r;
483
521
  },
484
522
  set(o) {
485
523
  Object.defineProperty(e, t, {
@@ -490,7 +528,7 @@ function b(e, t, n) {
490
528
  configurable: !0
491
529
  });
492
530
  }
493
- function U(e, t, n) {
531
+ function W(e, t, n) {
494
532
  Object.defineProperty(e, t, {
495
533
  value: n,
496
534
  writable: !0,
@@ -498,7 +536,7 @@ function U(e, t, n) {
498
536
  configurable: !0
499
537
  });
500
538
  }
501
- function F(...e) {
539
+ function B(...e) {
502
540
  const t = {};
503
541
  for (const n of e) {
504
542
  const r = Object.getOwnPropertyDescriptors(n);
@@ -506,15 +544,15 @@ function F(...e) {
506
544
  }
507
545
  return Object.defineProperties({}, t);
508
546
  }
509
- function Le(e) {
547
+ function Ge(e) {
510
548
  return JSON.stringify(e);
511
549
  }
512
- const ft = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
550
+ const zt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
513
551
  };
514
- function oe(e) {
552
+ function le(e) {
515
553
  return typeof e == "object" && e !== null && !Array.isArray(e);
516
554
  }
517
- const hn = ye(() => {
555
+ const $n = je(() => {
518
556
  if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
519
557
  return !1;
520
558
  try {
@@ -524,27 +562,27 @@ const hn = ye(() => {
524
562
  return !1;
525
563
  }
526
564
  });
527
- function G(e) {
528
- if (oe(e) === !1)
565
+ function ee(e) {
566
+ if (le(e) === !1)
529
567
  return !1;
530
568
  const t = e.constructor;
531
569
  if (t === void 0)
532
570
  return !0;
533
571
  const n = t.prototype;
534
- return !(oe(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
572
+ return !(le(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
535
573
  }
536
- function ht(e) {
537
- return G(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
574
+ function yt(e) {
575
+ return ee(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
538
576
  }
539
- const pn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
540
- function se(e) {
577
+ const Zn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
578
+ function he(e) {
541
579
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
542
580
  }
543
- function O(e, t, n) {
581
+ function L(e, t, n) {
544
582
  const r = new e._zod.constr(t ?? e._zod.def);
545
583
  return (!t || n?.parent) && (r._zod.parent = e), r;
546
584
  }
547
- function h(e) {
585
+ function m(e) {
548
586
  const t = e;
549
587
  if (!t)
550
588
  return {};
@@ -557,18 +595,18 @@ function h(e) {
557
595
  }
558
596
  return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
559
597
  }
560
- function mn(e) {
598
+ function En(e) {
561
599
  return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
562
600
  }
563
- const _n = {
601
+ const xn = {
564
602
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
565
603
  int32: [-2147483648, 2147483647],
566
604
  uint32: [0, 4294967295],
567
605
  float32: [-34028234663852886e22, 34028234663852886e22],
568
606
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
569
607
  };
570
- function gn(e, t) {
571
- const n = e._zod.def, r = F(e._zod.def, {
608
+ function Tn(e, t) {
609
+ const n = e._zod.def, r = B(e._zod.def, {
572
610
  get shape() {
573
611
  const o = {};
574
612
  for (const i in t) {
@@ -576,14 +614,14 @@ function gn(e, t) {
576
614
  throw new Error(`Unrecognized key: "${i}"`);
577
615
  t[i] && (o[i] = n.shape[i]);
578
616
  }
579
- return U(this, "shape", o), o;
617
+ return W(this, "shape", o), o;
580
618
  },
581
619
  checks: []
582
620
  });
583
- return O(e, r);
621
+ return L(e, r);
584
622
  }
585
- function vn(e, t) {
586
- const n = e._zod.def, r = F(e._zod.def, {
623
+ function Sn(e, t) {
624
+ const n = e._zod.def, r = B(e._zod.def, {
587
625
  get shape() {
588
626
  const o = { ...e._zod.def.shape };
589
627
  for (const i in t) {
@@ -591,45 +629,45 @@ function vn(e, t) {
591
629
  throw new Error(`Unrecognized key: "${i}"`);
592
630
  t[i] && delete o[i];
593
631
  }
594
- return U(this, "shape", o), o;
632
+ return W(this, "shape", o), o;
595
633
  },
596
634
  checks: []
597
635
  });
598
- return O(e, r);
636
+ return L(e, r);
599
637
  }
600
- function bn(e, t) {
601
- if (!G(t))
638
+ function In(e, t) {
639
+ if (!ee(t))
602
640
  throw new Error("Invalid input to extend: expected a plain object");
603
641
  const n = e._zod.def.checks;
604
642
  if (n && n.length > 0)
605
643
  throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
606
- const o = F(e._zod.def, {
644
+ const o = B(e._zod.def, {
607
645
  get shape() {
608
646
  const i = { ...e._zod.def.shape, ...t };
609
- return U(this, "shape", i), i;
647
+ return W(this, "shape", i), i;
610
648
  },
611
649
  checks: []
612
650
  });
613
- return O(e, o);
651
+ return L(e, o);
614
652
  }
615
- function wn(e, t) {
616
- if (!G(t))
653
+ function jn(e, t) {
654
+ if (!ee(t))
617
655
  throw new Error("Invalid input to safeExtend: expected a plain object");
618
656
  const n = {
619
657
  ...e._zod.def,
620
658
  get shape() {
621
659
  const r = { ...e._zod.def.shape, ...t };
622
- return U(this, "shape", r), r;
660
+ return W(this, "shape", r), r;
623
661
  },
624
662
  checks: e._zod.def.checks
625
663
  };
626
- return O(e, n);
664
+ return L(e, n);
627
665
  }
628
- function kn(e, t) {
629
- const n = F(e._zod.def, {
666
+ function An(e, t) {
667
+ const n = B(e._zod.def, {
630
668
  get shape() {
631
669
  const r = { ...e._zod.def.shape, ...t._zod.def.shape };
632
- return U(this, "shape", r), r;
670
+ return W(this, "shape", r), r;
633
671
  },
634
672
  get catchall() {
635
673
  return t._zod.def.catchall;
@@ -637,59 +675,59 @@ function kn(e, t) {
637
675
  checks: []
638
676
  // delete existing checks
639
677
  });
640
- return O(e, n);
678
+ return L(e, n);
641
679
  }
642
- function zn(e, t, n) {
643
- const r = F(t._zod.def, {
680
+ function Cn(e, t, n) {
681
+ const r = B(t._zod.def, {
644
682
  get shape() {
645
683
  const o = t._zod.def.shape, i = { ...o };
646
684
  if (n)
647
- for (const c in n) {
648
- if (!(c in o))
649
- throw new Error(`Unrecognized key: "${c}"`);
650
- n[c] && (i[c] = e ? new e({
685
+ for (const s in n) {
686
+ if (!(s in o))
687
+ throw new Error(`Unrecognized key: "${s}"`);
688
+ n[s] && (i[s] = e ? new e({
651
689
  type: "optional",
652
- innerType: o[c]
653
- }) : o[c]);
690
+ innerType: o[s]
691
+ }) : o[s]);
654
692
  }
655
693
  else
656
- for (const c in o)
657
- i[c] = e ? new e({
694
+ for (const s in o)
695
+ i[s] = e ? new e({
658
696
  type: "optional",
659
- innerType: o[c]
660
- }) : o[c];
661
- return U(this, "shape", i), i;
697
+ innerType: o[s]
698
+ }) : o[s];
699
+ return W(this, "shape", i), i;
662
700
  },
663
701
  checks: []
664
702
  });
665
- return O(t, r);
703
+ return L(t, r);
666
704
  }
667
- function yn(e, t, n) {
668
- const r = F(t._zod.def, {
705
+ function On(e, t, n) {
706
+ const r = B(t._zod.def, {
669
707
  get shape() {
670
708
  const o = t._zod.def.shape, i = { ...o };
671
709
  if (n)
672
- for (const c in n) {
673
- if (!(c in i))
674
- throw new Error(`Unrecognized key: "${c}"`);
675
- n[c] && (i[c] = new e({
710
+ for (const s in n) {
711
+ if (!(s in i))
712
+ throw new Error(`Unrecognized key: "${s}"`);
713
+ n[s] && (i[s] = new e({
676
714
  type: "nonoptional",
677
- innerType: o[c]
715
+ innerType: o[s]
678
716
  }));
679
717
  }
680
718
  else
681
- for (const c in o)
682
- i[c] = new e({
719
+ for (const s in o)
720
+ i[s] = new e({
683
721
  type: "nonoptional",
684
- innerType: o[c]
722
+ innerType: o[s]
685
723
  });
686
- return U(this, "shape", i), i;
724
+ return W(this, "shape", i), i;
687
725
  },
688
726
  checks: []
689
727
  });
690
- return O(t, r);
728
+ return L(t, r);
691
729
  }
692
- function W(e, t = 0) {
730
+ function J(e, t = 0) {
693
731
  if (e.aborted === !0)
694
732
  return !0;
695
733
  for (let n = t; n < e.issues.length; n++)
@@ -697,27 +735,27 @@ function W(e, t = 0) {
697
735
  return !0;
698
736
  return !1;
699
737
  }
700
- function pt(e, t) {
738
+ function $t(e, t) {
701
739
  return t.map((n) => {
702
740
  var r;
703
741
  return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
704
742
  });
705
743
  }
706
- function Q(e) {
744
+ function ie(e) {
707
745
  return typeof e == "string" ? e : e?.message;
708
746
  }
709
- function D(e, t, n) {
747
+ function V(e, t, n) {
710
748
  const r = { ...e, path: e.path ?? [] };
711
749
  if (!e.message) {
712
- const o = Q(e.inst?._zod.def?.error?.(e)) ?? Q(t?.error?.(e)) ?? Q(n.customError?.(e)) ?? Q(n.localeError?.(e)) ?? "Invalid input";
750
+ const o = ie(e.inst?._zod.def?.error?.(e)) ?? ie(t?.error?.(e)) ?? ie(n.customError?.(e)) ?? ie(n.localeError?.(e)) ?? "Invalid input";
713
751
  r.message = o;
714
752
  }
715
753
  return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
716
754
  }
717
- function Ee(e) {
755
+ function Oe(e) {
718
756
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
719
757
  }
720
- function q(...e) {
758
+ function te(...e) {
721
759
  const [t, n, r] = e;
722
760
  return typeof t == "string" ? {
723
761
  message: t,
@@ -726,122 +764,122 @@ function q(...e) {
726
764
  inst: r
727
765
  } : { ...t };
728
766
  }
729
- const mt = (e, t) => {
767
+ const Zt = (e, t) => {
730
768
  e.name = "$ZodError", Object.defineProperty(e, "_zod", {
731
769
  value: e._zod,
732
770
  enumerable: !1
733
771
  }), Object.defineProperty(e, "issues", {
734
772
  value: t,
735
773
  enumerable: !1
736
- }), e.message = JSON.stringify(t, ve, 2), Object.defineProperty(e, "toString", {
774
+ }), e.message = JSON.stringify(t, Ee, 2), Object.defineProperty(e, "toString", {
737
775
  value: () => e.message,
738
776
  enumerable: !1
739
777
  });
740
- }, _t = s("$ZodError", mt), gt = s("$ZodError", mt, { Parent: Error });
741
- function $n(e, t = (n) => n.message) {
778
+ }, Et = a("$ZodError", Zt), xt = a("$ZodError", Zt, { Parent: Error });
779
+ function Rn(e, t = (n) => n.message) {
742
780
  const n = {}, r = [];
743
781
  for (const o of e.issues)
744
782
  o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
745
783
  return { formErrors: r, fieldErrors: n };
746
784
  }
747
- function Zn(e, t) {
785
+ function Pn(e, t) {
748
786
  const n = t || function(i) {
749
787
  return i.message;
750
788
  }, r = { _errors: [] }, o = (i) => {
751
- for (const c of i.issues)
752
- if (c.code === "invalid_union" && c.errors.length)
753
- c.errors.map((a) => o({ issues: a }));
754
- else if (c.code === "invalid_key")
755
- o({ issues: c.issues });
756
- else if (c.code === "invalid_element")
757
- o({ issues: c.issues });
758
- else if (c.path.length === 0)
759
- r._errors.push(n(c));
789
+ for (const s of i.issues)
790
+ if (s.code === "invalid_union" && s.errors.length)
791
+ s.errors.map((c) => o({ issues: c }));
792
+ else if (s.code === "invalid_key")
793
+ o({ issues: s.issues });
794
+ else if (s.code === "invalid_element")
795
+ o({ issues: s.issues });
796
+ else if (s.path.length === 0)
797
+ r._errors.push(n(s));
760
798
  else {
761
- let a = r, f = 0;
762
- for (; f < c.path.length; ) {
763
- const d = c.path[f];
764
- f === c.path.length - 1 ? (a[d] = a[d] || { _errors: [] }, a[d]._errors.push(n(c))) : a[d] = a[d] || { _errors: [] }, a = a[d], f++;
799
+ let c = r, d = 0;
800
+ for (; d < s.path.length; ) {
801
+ const l = s.path[d];
802
+ d === s.path.length - 1 ? (c[l] = c[l] || { _errors: [] }, c[l]._errors.push(n(s))) : c[l] = c[l] || { _errors: [] }, c = c[l], d++;
765
803
  }
766
804
  }
767
805
  };
768
806
  return o(e), r;
769
807
  }
770
- const xe = (e) => (t, n, r, o) => {
771
- const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, c = t._zod.run({ value: n, issues: [] }, i);
772
- if (c instanceof Promise)
773
- throw new B();
774
- if (c.issues.length) {
775
- const a = new (o?.Err ?? e)(c.issues.map((f) => D(f, i, N())));
776
- throw ft(a, o?.callee), a;
808
+ const Re = (e) => (t, n, r, o) => {
809
+ const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, i);
810
+ if (s instanceof Promise)
811
+ throw new G();
812
+ if (s.issues.length) {
813
+ const c = new (o?.Err ?? e)(s.issues.map((d) => V(d, i, M())));
814
+ throw zt(c, o?.callee), c;
777
815
  }
778
- return c.value;
779
- }, Te = (e) => async (t, n, r, o) => {
816
+ return s.value;
817
+ }, Pe = (e) => async (t, n, r, o) => {
780
818
  const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
781
- let c = t._zod.run({ value: n, issues: [] }, i);
782
- if (c instanceof Promise && (c = await c), c.issues.length) {
783
- const a = new (o?.Err ?? e)(c.issues.map((f) => D(f, i, N())));
784
- throw ft(a, o?.callee), a;
819
+ let s = t._zod.run({ value: n, issues: [] }, i);
820
+ if (s instanceof Promise && (s = await s), s.issues.length) {
821
+ const c = new (o?.Err ?? e)(s.issues.map((d) => V(d, i, M())));
822
+ throw zt(c, o?.callee), c;
785
823
  }
786
- return c.value;
787
- }, ae = (e) => (t, n, r) => {
824
+ return s.value;
825
+ }, me = (e) => (t, n, r) => {
788
826
  const o = r ? { ...r, async: !1 } : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, o);
789
827
  if (i instanceof Promise)
790
- throw new B();
828
+ throw new G();
791
829
  return i.issues.length ? {
792
830
  success: !1,
793
- error: new (e ?? _t)(i.issues.map((c) => D(c, o, N())))
831
+ error: new (e ?? Et)(i.issues.map((s) => V(s, o, M())))
794
832
  } : { success: !0, data: i.value };
795
- }, En = /* @__PURE__ */ ae(gt), ue = (e) => async (t, n, r) => {
833
+ }, Nn = /* @__PURE__ */ me(xt), pe = (e) => async (t, n, r) => {
796
834
  const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
797
835
  let i = t._zod.run({ value: n, issues: [] }, o);
798
836
  return i instanceof Promise && (i = await i), i.issues.length ? {
799
837
  success: !1,
800
- error: new e(i.issues.map((c) => D(c, o, N())))
838
+ error: new e(i.issues.map((s) => V(s, o, M())))
801
839
  } : { success: !0, data: i.value };
802
- }, xn = /* @__PURE__ */ ue(gt), Tn = (e) => (t, n, r) => {
840
+ }, Dn = /* @__PURE__ */ pe(xt), Un = (e) => (t, n, r) => {
803
841
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
804
- return xe(e)(t, n, o);
805
- }, An = (e) => (t, n, r) => xe(e)(t, n, r), jn = (e) => async (t, n, r) => {
842
+ return Re(e)(t, n, o);
843
+ }, Fn = (e) => (t, n, r) => Re(e)(t, n, r), Ln = (e) => async (t, n, r) => {
806
844
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
807
- return Te(e)(t, n, o);
808
- }, In = (e) => async (t, n, r) => Te(e)(t, n, r), Sn = (e) => (t, n, r) => {
845
+ return Pe(e)(t, n, o);
846
+ }, Mn = (e) => async (t, n, r) => Pe(e)(t, n, r), Vn = (e) => (t, n, r) => {
809
847
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
810
- return ae(e)(t, n, o);
811
- }, On = (e) => (t, n, r) => ae(e)(t, n, r), Rn = (e) => async (t, n, r) => {
848
+ return me(e)(t, n, o);
849
+ }, Wn = (e) => (t, n, r) => me(e)(t, n, r), Bn = (e) => async (t, n, r) => {
812
850
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
813
- return ue(e)(t, n, o);
814
- }, Pn = (e) => async (t, n, r) => ue(e)(t, n, r), Cn = /^[cC][^\s-]{8,}$/, Nn = /^[0-9a-z]+$/, Dn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Un = /^[0-9a-vA-V]{20}$/, Fn = /^[A-Za-z0-9]{27}$/, Ln = /^[a-zA-Z0-9_-]{21}$/, Mn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Vn = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Me = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Wn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Bn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
815
- function Yn() {
816
- return new RegExp(Bn, "u");
851
+ return pe(e)(t, n, o);
852
+ }, Yn = (e) => async (t, n, r) => pe(e)(t, n, r), Hn = /^[cC][^\s-]{8,}$/, Jn = /^[0-9a-z]+$/, Gn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, qn = /^[0-9a-vA-V]{20}$/, Xn = /^[A-Za-z0-9]{27}$/, Kn = /^[a-zA-Z0-9_-]{21}$/, Qn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, er = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, qe = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, tr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, nr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
853
+ function rr() {
854
+ return new RegExp(nr, "u");
817
855
  }
818
- const Jn = /^(?:(?: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])$/, Gn = /^(([0-9a-fA-F]{1,4}:){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}|:))$/, qn = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/, Hn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Xn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, vt = /^[A-Za-z0-9_-]*$/, Kn = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, Qn = /^\+(?:[0-9]){6,14}[0-9]$/, bt = "(?:(?:\\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])))", er = /* @__PURE__ */ new RegExp(`^${bt}$`);
819
- function wt(e) {
856
+ const or = /^(?:(?: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])$/, ir = /^(([0-9a-fA-F]{1,4}:){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}|:))$/, sr = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/, cr = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, ar = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Tt = /^[A-Za-z0-9_-]*$/, ur = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, lr = /^\+(?:[0-9]){6,14}[0-9]$/, St = "(?:(?:\\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])))", dr = /* @__PURE__ */ new RegExp(`^${St}$`);
857
+ function It(e) {
820
858
  const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
821
859
  return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
822
860
  }
823
- function tr(e) {
824
- return new RegExp(`^${wt(e)}$`);
861
+ function fr(e) {
862
+ return new RegExp(`^${It(e)}$`);
825
863
  }
826
- function nr(e) {
827
- const t = wt({ precision: e.precision }), n = ["Z"];
864
+ function hr(e) {
865
+ const t = It({ precision: e.precision }), n = ["Z"];
828
866
  e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
829
867
  const r = `${t}(?:${n.join("|")})`;
830
- return new RegExp(`^${bt}T(?:${r})$`);
868
+ return new RegExp(`^${St}T(?:${r})$`);
831
869
  }
832
- const rr = (e) => {
870
+ const mr = (e) => {
833
871
  const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
834
872
  return new RegExp(`^${t}$`);
835
- }, or = /^-?\d+$/, ir = /^-?\d+(?:\.\d+)?/, cr = /^(?:true|false)$/i, sr = /^[^A-Z]*$/, ar = /^[^a-z]*$/, j = /* @__PURE__ */ s("$ZodCheck", (e, t) => {
873
+ }, pr = /^-?\d+$/, gr = /^-?\d+(?:\.\d+)?/, _r = /^(?:true|false)$/i, vr = /^[^A-Z]*$/, br = /^[^a-z]*$/, O = /* @__PURE__ */ a("$ZodCheck", (e, t) => {
836
874
  var n;
837
875
  e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
838
- }), kt = {
876
+ }), jt = {
839
877
  number: "number",
840
878
  bigint: "bigint",
841
879
  object: "date"
842
- }, zt = /* @__PURE__ */ s("$ZodCheckLessThan", (e, t) => {
843
- j.init(e, t);
844
- const n = kt[typeof t.value];
880
+ }, At = /* @__PURE__ */ a("$ZodCheckLessThan", (e, t) => {
881
+ O.init(e, t);
882
+ const n = jt[typeof t.value];
845
883
  e._zod.onattach.push((r) => {
846
884
  const o = r._zod.bag, i = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
847
885
  t.value < i && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
@@ -856,9 +894,9 @@ const rr = (e) => {
856
894
  continue: !t.abort
857
895
  });
858
896
  };
859
- }), yt = /* @__PURE__ */ s("$ZodCheckGreaterThan", (e, t) => {
860
- j.init(e, t);
861
- const n = kt[typeof t.value];
897
+ }), Ct = /* @__PURE__ */ a("$ZodCheckGreaterThan", (e, t) => {
898
+ O.init(e, t);
899
+ const n = jt[typeof t.value];
862
900
  e._zod.onattach.push((r) => {
863
901
  const o = r._zod.bag, i = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
864
902
  t.value > i && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
@@ -873,14 +911,14 @@ const rr = (e) => {
873
911
  continue: !t.abort
874
912
  });
875
913
  };
876
- }), ur = /* @__PURE__ */ s("$ZodCheckMultipleOf", (e, t) => {
877
- j.init(e, t), e._zod.onattach.push((n) => {
914
+ }), wr = /* @__PURE__ */ a("$ZodCheckMultipleOf", (e, t) => {
915
+ O.init(e, t), e._zod.onattach.push((n) => {
878
916
  var r;
879
917
  (r = n._zod.bag).multipleOf ?? (r.multipleOf = t.value);
880
918
  }), e._zod.check = (n) => {
881
919
  if (typeof n.value != typeof t.value)
882
920
  throw new Error("Cannot mix number and bigint in multiple_of check.");
883
- (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : fn(n.value, t.value) === 0) || n.issues.push({
921
+ (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : yn(n.value, t.value) === 0) || n.issues.push({
884
922
  origin: typeof n.value,
885
923
  code: "not_multiple_of",
886
924
  divisor: t.value,
@@ -889,37 +927,37 @@ const rr = (e) => {
889
927
  continue: !t.abort
890
928
  });
891
929
  };
892
- }), lr = /* @__PURE__ */ s("$ZodCheckNumberFormat", (e, t) => {
893
- j.init(e, t), t.format = t.format || "float64";
894
- const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] = _n[t.format];
895
- e._zod.onattach.push((c) => {
896
- const a = c._zod.bag;
897
- a.format = t.format, a.minimum = o, a.maximum = i, n && (a.pattern = or);
898
- }), e._zod.check = (c) => {
899
- const a = c.value;
930
+ }), kr = /* @__PURE__ */ a("$ZodCheckNumberFormat", (e, t) => {
931
+ O.init(e, t), t.format = t.format || "float64";
932
+ const n = t.format?.includes("int"), r = n ? "int" : "number", [o, i] = xn[t.format];
933
+ e._zod.onattach.push((s) => {
934
+ const c = s._zod.bag;
935
+ c.format = t.format, c.minimum = o, c.maximum = i, n && (c.pattern = pr);
936
+ }), e._zod.check = (s) => {
937
+ const c = s.value;
900
938
  if (n) {
901
- if (!Number.isInteger(a)) {
902
- c.issues.push({
939
+ if (!Number.isInteger(c)) {
940
+ s.issues.push({
903
941
  expected: r,
904
942
  format: t.format,
905
943
  code: "invalid_type",
906
944
  continue: !1,
907
- input: a,
945
+ input: c,
908
946
  inst: e
909
947
  });
910
948
  return;
911
949
  }
912
- if (!Number.isSafeInteger(a)) {
913
- a > 0 ? c.issues.push({
914
- input: a,
950
+ if (!Number.isSafeInteger(c)) {
951
+ c > 0 ? s.issues.push({
952
+ input: c,
915
953
  code: "too_big",
916
954
  maximum: Number.MAX_SAFE_INTEGER,
917
955
  note: "Integers must be within the safe integer range.",
918
956
  inst: e,
919
957
  origin: r,
920
958
  continue: !t.abort
921
- }) : c.issues.push({
922
- input: a,
959
+ }) : s.issues.push({
960
+ input: c,
923
961
  code: "too_small",
924
962
  minimum: Number.MIN_SAFE_INTEGER,
925
963
  note: "Integers must be within the safe integer range.",
@@ -930,27 +968,27 @@ const rr = (e) => {
930
968
  return;
931
969
  }
932
970
  }
933
- a < o && c.issues.push({
971
+ c < o && s.issues.push({
934
972
  origin: "number",
935
- input: a,
973
+ input: c,
936
974
  code: "too_small",
937
975
  minimum: o,
938
976
  inclusive: !0,
939
977
  inst: e,
940
978
  continue: !t.abort
941
- }), a > i && c.issues.push({
979
+ }), c > i && s.issues.push({
942
980
  origin: "number",
943
- input: a,
981
+ input: c,
944
982
  code: "too_big",
945
983
  maximum: i,
946
984
  inst: e
947
985
  });
948
986
  };
949
- }), dr = /* @__PURE__ */ s("$ZodCheckMaxLength", (e, t) => {
987
+ }), zr = /* @__PURE__ */ a("$ZodCheckMaxLength", (e, t) => {
950
988
  var n;
951
- j.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
989
+ O.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
952
990
  const o = r.value;
953
- return !$e(o) && o.length !== void 0;
991
+ return !Ae(o) && o.length !== void 0;
954
992
  }), e._zod.onattach.push((r) => {
955
993
  const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
956
994
  t.maximum < o && (r._zod.bag.maximum = t.maximum);
@@ -958,9 +996,9 @@ const rr = (e) => {
958
996
  const o = r.value;
959
997
  if (o.length <= t.maximum)
960
998
  return;
961
- const c = Ee(o);
999
+ const s = Oe(o);
962
1000
  r.issues.push({
963
- origin: c,
1001
+ origin: s,
964
1002
  code: "too_big",
965
1003
  maximum: t.maximum,
966
1004
  inclusive: !0,
@@ -969,11 +1007,11 @@ const rr = (e) => {
969
1007
  continue: !t.abort
970
1008
  });
971
1009
  };
972
- }), fr = /* @__PURE__ */ s("$ZodCheckMinLength", (e, t) => {
1010
+ }), yr = /* @__PURE__ */ a("$ZodCheckMinLength", (e, t) => {
973
1011
  var n;
974
- j.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
1012
+ O.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
975
1013
  const o = r.value;
976
- return !$e(o) && o.length !== void 0;
1014
+ return !Ae(o) && o.length !== void 0;
977
1015
  }), e._zod.onattach.push((r) => {
978
1016
  const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
979
1017
  t.minimum > o && (r._zod.bag.minimum = t.minimum);
@@ -981,9 +1019,9 @@ const rr = (e) => {
981
1019
  const o = r.value;
982
1020
  if (o.length >= t.minimum)
983
1021
  return;
984
- const c = Ee(o);
1022
+ const s = Oe(o);
985
1023
  r.issues.push({
986
- origin: c,
1024
+ origin: s,
987
1025
  code: "too_small",
988
1026
  minimum: t.minimum,
989
1027
  inclusive: !0,
@@ -992,11 +1030,11 @@ const rr = (e) => {
992
1030
  continue: !t.abort
993
1031
  });
994
1032
  };
995
- }), hr = /* @__PURE__ */ s("$ZodCheckLengthEquals", (e, t) => {
1033
+ }), $r = /* @__PURE__ */ a("$ZodCheckLengthEquals", (e, t) => {
996
1034
  var n;
997
- j.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
1035
+ O.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
998
1036
  const o = r.value;
999
- return !$e(o) && o.length !== void 0;
1037
+ return !Ae(o) && o.length !== void 0;
1000
1038
  }), e._zod.onattach.push((r) => {
1001
1039
  const o = r._zod.bag;
1002
1040
  o.minimum = t.length, o.maximum = t.length, o.length = t.length;
@@ -1004,10 +1042,10 @@ const rr = (e) => {
1004
1042
  const o = r.value, i = o.length;
1005
1043
  if (i === t.length)
1006
1044
  return;
1007
- const c = Ee(o), a = i > t.length;
1045
+ const s = Oe(o), c = i > t.length;
1008
1046
  r.issues.push({
1009
- origin: c,
1010
- ...a ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
1047
+ origin: s,
1048
+ ...c ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
1011
1049
  inclusive: !0,
1012
1050
  exact: !0,
1013
1051
  input: r.value,
@@ -1015,9 +1053,9 @@ const rr = (e) => {
1015
1053
  continue: !t.abort
1016
1054
  });
1017
1055
  };
1018
- }), le = /* @__PURE__ */ s("$ZodCheckStringFormat", (e, t) => {
1056
+ }), ge = /* @__PURE__ */ a("$ZodCheckStringFormat", (e, t) => {
1019
1057
  var n, r;
1020
- j.init(e, t), e._zod.onattach.push((o) => {
1058
+ O.init(e, t), e._zod.onattach.push((o) => {
1021
1059
  const i = o._zod.bag;
1022
1060
  i.format = t.format, t.pattern && (i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t.pattern));
1023
1061
  }), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
@@ -1032,8 +1070,8 @@ const rr = (e) => {
1032
1070
  });
1033
1071
  }) : (r = e._zod).check ?? (r.check = () => {
1034
1072
  });
1035
- }), pr = /* @__PURE__ */ s("$ZodCheckRegex", (e, t) => {
1036
- le.init(e, t), e._zod.check = (n) => {
1073
+ }), Zr = /* @__PURE__ */ a("$ZodCheckRegex", (e, t) => {
1074
+ ge.init(e, t), e._zod.check = (n) => {
1037
1075
  t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
1038
1076
  origin: "string",
1039
1077
  code: "invalid_format",
@@ -1044,13 +1082,13 @@ const rr = (e) => {
1044
1082
  continue: !t.abort
1045
1083
  });
1046
1084
  };
1047
- }), mr = /* @__PURE__ */ s("$ZodCheckLowerCase", (e, t) => {
1048
- t.pattern ?? (t.pattern = sr), le.init(e, t);
1049
- }), _r = /* @__PURE__ */ s("$ZodCheckUpperCase", (e, t) => {
1050
- t.pattern ?? (t.pattern = ar), le.init(e, t);
1051
- }), gr = /* @__PURE__ */ s("$ZodCheckIncludes", (e, t) => {
1052
- j.init(e, t);
1053
- const n = se(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
1085
+ }), Er = /* @__PURE__ */ a("$ZodCheckLowerCase", (e, t) => {
1086
+ t.pattern ?? (t.pattern = vr), ge.init(e, t);
1087
+ }), xr = /* @__PURE__ */ a("$ZodCheckUpperCase", (e, t) => {
1088
+ t.pattern ?? (t.pattern = br), ge.init(e, t);
1089
+ }), Tr = /* @__PURE__ */ a("$ZodCheckIncludes", (e, t) => {
1090
+ O.init(e, t);
1091
+ const n = he(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
1054
1092
  t.pattern = r, e._zod.onattach.push((o) => {
1055
1093
  const i = o._zod.bag;
1056
1094
  i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(r);
@@ -1065,9 +1103,9 @@ const rr = (e) => {
1065
1103
  continue: !t.abort
1066
1104
  });
1067
1105
  };
1068
- }), vr = /* @__PURE__ */ s("$ZodCheckStartsWith", (e, t) => {
1069
- j.init(e, t);
1070
- const n = new RegExp(`^${se(t.prefix)}.*`);
1106
+ }), Sr = /* @__PURE__ */ a("$ZodCheckStartsWith", (e, t) => {
1107
+ O.init(e, t);
1108
+ const n = new RegExp(`^${he(t.prefix)}.*`);
1071
1109
  t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
1072
1110
  const o = r._zod.bag;
1073
1111
  o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
@@ -1082,9 +1120,9 @@ const rr = (e) => {
1082
1120
  continue: !t.abort
1083
1121
  });
1084
1122
  };
1085
- }), br = /* @__PURE__ */ s("$ZodCheckEndsWith", (e, t) => {
1086
- j.init(e, t);
1087
- const n = new RegExp(`.*${se(t.suffix)}$`);
1123
+ }), Ir = /* @__PURE__ */ a("$ZodCheckEndsWith", (e, t) => {
1124
+ O.init(e, t);
1125
+ const n = new RegExp(`.*${he(t.suffix)}$`);
1088
1126
  t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
1089
1127
  const o = r._zod.bag;
1090
1128
  o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
@@ -1099,12 +1137,12 @@ const rr = (e) => {
1099
1137
  continue: !t.abort
1100
1138
  });
1101
1139
  };
1102
- }), wr = /* @__PURE__ */ s("$ZodCheckOverwrite", (e, t) => {
1103
- j.init(e, t), e._zod.check = (n) => {
1140
+ }), jr = /* @__PURE__ */ a("$ZodCheckOverwrite", (e, t) => {
1141
+ O.init(e, t), e._zod.check = (n) => {
1104
1142
  n.value = t.tx(n.value);
1105
1143
  };
1106
1144
  });
1107
- class kr {
1145
+ class Ar {
1108
1146
  constructor(t = []) {
1109
1147
  this.content = [], this.indent = 0, this && (this.args = t);
1110
1148
  }
@@ -1117,9 +1155,9 @@ class kr {
1117
1155
  return;
1118
1156
  }
1119
1157
  const r = t.split(`
1120
- `).filter((c) => c), o = Math.min(...r.map((c) => c.length - c.trimStart().length)), i = r.map((c) => c.slice(o)).map((c) => " ".repeat(this.indent * 2) + c);
1121
- for (const c of i)
1122
- this.content.push(c);
1158
+ `).filter((s) => s), o = Math.min(...r.map((s) => s.length - s.trimStart().length)), i = r.map((s) => s.slice(o)).map((s) => " ".repeat(this.indent * 2) + s);
1159
+ for (const s of i)
1160
+ this.content.push(s);
1123
1161
  }
1124
1162
  compile() {
1125
1163
  const t = Function, n = this?.args, o = [...(this?.content ?? [""]).map((i) => ` ${i}`)];
@@ -1127,13 +1165,13 @@ class kr {
1127
1165
  `));
1128
1166
  }
1129
1167
  }
1130
- const zr = {
1168
+ const Cr = {
1131
1169
  major: 4,
1132
1170
  minor: 1,
1133
1171
  patch: 11
1134
- }, $ = /* @__PURE__ */ s("$ZodType", (e, t) => {
1172
+ }, S = /* @__PURE__ */ a("$ZodType", (e, t) => {
1135
1173
  var n;
1136
- e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = zr;
1174
+ e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Cr;
1137
1175
  const r = [...e._zod.def.checks ?? []];
1138
1176
  e._zod.traits.has("$ZodCheck") && r.unshift(e);
1139
1177
  for (const o of r)
@@ -1144,69 +1182,69 @@ const zr = {
1144
1182
  e._zod.run = e._zod.parse;
1145
1183
  });
1146
1184
  else {
1147
- const o = (c, a, f) => {
1148
- let d = W(c), l;
1149
- for (const g of a) {
1150
- if (g._zod.def.when) {
1151
- if (!g._zod.def.when(c))
1185
+ const o = (s, c, d) => {
1186
+ let l = J(s), f;
1187
+ for (const h of c) {
1188
+ if (h._zod.def.when) {
1189
+ if (!h._zod.def.when(s))
1152
1190
  continue;
1153
- } else if (d)
1191
+ } else if (l)
1154
1192
  continue;
1155
- const p = c.issues.length, v = g._zod.check(c);
1156
- if (v instanceof Promise && f?.async === !1)
1157
- throw new B();
1158
- if (l || v instanceof Promise)
1159
- l = (l ?? Promise.resolve()).then(async () => {
1160
- await v, c.issues.length !== p && (d || (d = W(c, p)));
1193
+ const p = s.issues.length, g = h._zod.check(s);
1194
+ if (g instanceof Promise && d?.async === !1)
1195
+ throw new G();
1196
+ if (f || g instanceof Promise)
1197
+ f = (f ?? Promise.resolve()).then(async () => {
1198
+ await g, s.issues.length !== p && (l || (l = J(s, p)));
1161
1199
  });
1162
1200
  else {
1163
- if (c.issues.length === p)
1201
+ if (s.issues.length === p)
1164
1202
  continue;
1165
- d || (d = W(c, p));
1203
+ l || (l = J(s, p));
1166
1204
  }
1167
1205
  }
1168
- return l ? l.then(() => c) : c;
1169
- }, i = (c, a, f) => {
1170
- if (W(c))
1171
- return c.aborted = !0, c;
1172
- const d = o(a, r, f);
1173
- if (d instanceof Promise) {
1174
- if (f.async === !1)
1175
- throw new B();
1176
- return d.then((l) => e._zod.parse(l, f));
1206
+ return f ? f.then(() => s) : s;
1207
+ }, i = (s, c, d) => {
1208
+ if (J(s))
1209
+ return s.aborted = !0, s;
1210
+ const l = o(c, r, d);
1211
+ if (l instanceof Promise) {
1212
+ if (d.async === !1)
1213
+ throw new G();
1214
+ return l.then((f) => e._zod.parse(f, d));
1177
1215
  }
1178
- return e._zod.parse(d, f);
1216
+ return e._zod.parse(l, d);
1179
1217
  };
1180
- e._zod.run = (c, a) => {
1181
- if (a.skipChecks)
1182
- return e._zod.parse(c, a);
1183
- if (a.direction === "backward") {
1184
- const d = e._zod.parse({ value: c.value, issues: [] }, { ...a, skipChecks: !0 });
1185
- return d instanceof Promise ? d.then((l) => i(l, c, a)) : i(d, c, a);
1218
+ e._zod.run = (s, c) => {
1219
+ if (c.skipChecks)
1220
+ return e._zod.parse(s, c);
1221
+ if (c.direction === "backward") {
1222
+ const l = e._zod.parse({ value: s.value, issues: [] }, { ...c, skipChecks: !0 });
1223
+ return l instanceof Promise ? l.then((f) => i(f, s, c)) : i(l, s, c);
1186
1224
  }
1187
- const f = e._zod.parse(c, a);
1188
- if (f instanceof Promise) {
1189
- if (a.async === !1)
1190
- throw new B();
1191
- return f.then((d) => o(d, r, a));
1225
+ const d = e._zod.parse(s, c);
1226
+ if (d instanceof Promise) {
1227
+ if (c.async === !1)
1228
+ throw new G();
1229
+ return d.then((l) => o(l, r, c));
1192
1230
  }
1193
- return o(f, r, a);
1231
+ return o(d, r, c);
1194
1232
  };
1195
1233
  }
1196
1234
  e["~standard"] = {
1197
1235
  validate: (o) => {
1198
1236
  try {
1199
- const i = En(e, o);
1237
+ const i = Nn(e, o);
1200
1238
  return i.success ? { value: i.data } : { issues: i.error?.issues };
1201
1239
  } catch {
1202
- return xn(e, o).then((c) => c.success ? { value: c.data } : { issues: c.error?.issues });
1240
+ return Dn(e, o).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
1203
1241
  }
1204
1242
  },
1205
1243
  vendor: "zod",
1206
1244
  version: 1
1207
1245
  };
1208
- }), Ae = /* @__PURE__ */ s("$ZodString", (e, t) => {
1209
- $.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? rr(e._zod.bag), e._zod.parse = (n, r) => {
1246
+ }), Ne = /* @__PURE__ */ a("$ZodString", (e, t) => {
1247
+ S.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? mr(e._zod.bag), e._zod.parse = (n, r) => {
1210
1248
  if (t.coerce)
1211
1249
  try {
1212
1250
  n.value = String(n.value);
@@ -1219,11 +1257,11 @@ const zr = {
1219
1257
  inst: e
1220
1258
  }), n;
1221
1259
  };
1222
- }), w = /* @__PURE__ */ s("$ZodStringFormat", (e, t) => {
1223
- le.init(e, t), Ae.init(e, t);
1224
- }), yr = /* @__PURE__ */ s("$ZodGUID", (e, t) => {
1225
- t.pattern ?? (t.pattern = Vn), w.init(e, t);
1226
- }), $r = /* @__PURE__ */ s("$ZodUUID", (e, t) => {
1260
+ }), y = /* @__PURE__ */ a("$ZodStringFormat", (e, t) => {
1261
+ ge.init(e, t), Ne.init(e, t);
1262
+ }), Or = /* @__PURE__ */ a("$ZodGUID", (e, t) => {
1263
+ t.pattern ?? (t.pattern = er), y.init(e, t);
1264
+ }), Rr = /* @__PURE__ */ a("$ZodUUID", (e, t) => {
1227
1265
  if (t.version) {
1228
1266
  const r = {
1229
1267
  v1: 1,
@@ -1237,21 +1275,21 @@ const zr = {
1237
1275
  }[t.version];
1238
1276
  if (r === void 0)
1239
1277
  throw new Error(`Invalid UUID version: "${t.version}"`);
1240
- t.pattern ?? (t.pattern = Me(r));
1278
+ t.pattern ?? (t.pattern = qe(r));
1241
1279
  } else
1242
- t.pattern ?? (t.pattern = Me());
1243
- w.init(e, t);
1244
- }), Zr = /* @__PURE__ */ s("$ZodEmail", (e, t) => {
1245
- t.pattern ?? (t.pattern = Wn), w.init(e, t);
1246
- }), Er = /* @__PURE__ */ s("$ZodURL", (e, t) => {
1247
- w.init(e, t), e._zod.check = (n) => {
1280
+ t.pattern ?? (t.pattern = qe());
1281
+ y.init(e, t);
1282
+ }), Pr = /* @__PURE__ */ a("$ZodEmail", (e, t) => {
1283
+ t.pattern ?? (t.pattern = tr), y.init(e, t);
1284
+ }), Nr = /* @__PURE__ */ a("$ZodURL", (e, t) => {
1285
+ y.init(e, t), e._zod.check = (n) => {
1248
1286
  try {
1249
1287
  const r = n.value.trim(), o = new URL(r);
1250
1288
  t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
1251
1289
  code: "invalid_format",
1252
1290
  format: "url",
1253
1291
  note: "Invalid hostname",
1254
- pattern: Kn.source,
1292
+ pattern: ur.source,
1255
1293
  input: n.value,
1256
1294
  inst: e,
1257
1295
  continue: !t.abort
@@ -1275,35 +1313,35 @@ const zr = {
1275
1313
  });
1276
1314
  }
1277
1315
  };
1278
- }), xr = /* @__PURE__ */ s("$ZodEmoji", (e, t) => {
1279
- t.pattern ?? (t.pattern = Yn()), w.init(e, t);
1280
- }), Tr = /* @__PURE__ */ s("$ZodNanoID", (e, t) => {
1281
- t.pattern ?? (t.pattern = Ln), w.init(e, t);
1282
- }), Ar = /* @__PURE__ */ s("$ZodCUID", (e, t) => {
1283
- t.pattern ?? (t.pattern = Cn), w.init(e, t);
1284
- }), jr = /* @__PURE__ */ s("$ZodCUID2", (e, t) => {
1285
- t.pattern ?? (t.pattern = Nn), w.init(e, t);
1286
- }), Ir = /* @__PURE__ */ s("$ZodULID", (e, t) => {
1287
- t.pattern ?? (t.pattern = Dn), w.init(e, t);
1288
- }), Sr = /* @__PURE__ */ s("$ZodXID", (e, t) => {
1289
- t.pattern ?? (t.pattern = Un), w.init(e, t);
1290
- }), Or = /* @__PURE__ */ s("$ZodKSUID", (e, t) => {
1291
- t.pattern ?? (t.pattern = Fn), w.init(e, t);
1292
- }), Rr = /* @__PURE__ */ s("$ZodISODateTime", (e, t) => {
1293
- t.pattern ?? (t.pattern = nr(t)), w.init(e, t);
1294
- }), Pr = /* @__PURE__ */ s("$ZodISODate", (e, t) => {
1295
- t.pattern ?? (t.pattern = er), w.init(e, t);
1296
- }), Cr = /* @__PURE__ */ s("$ZodISOTime", (e, t) => {
1297
- t.pattern ?? (t.pattern = tr(t)), w.init(e, t);
1298
- }), Nr = /* @__PURE__ */ s("$ZodISODuration", (e, t) => {
1299
- t.pattern ?? (t.pattern = Mn), w.init(e, t);
1300
- }), Dr = /* @__PURE__ */ s("$ZodIPv4", (e, t) => {
1301
- t.pattern ?? (t.pattern = Jn), w.init(e, t), e._zod.onattach.push((n) => {
1316
+ }), Dr = /* @__PURE__ */ a("$ZodEmoji", (e, t) => {
1317
+ t.pattern ?? (t.pattern = rr()), y.init(e, t);
1318
+ }), Ur = /* @__PURE__ */ a("$ZodNanoID", (e, t) => {
1319
+ t.pattern ?? (t.pattern = Kn), y.init(e, t);
1320
+ }), Fr = /* @__PURE__ */ a("$ZodCUID", (e, t) => {
1321
+ t.pattern ?? (t.pattern = Hn), y.init(e, t);
1322
+ }), Lr = /* @__PURE__ */ a("$ZodCUID2", (e, t) => {
1323
+ t.pattern ?? (t.pattern = Jn), y.init(e, t);
1324
+ }), Mr = /* @__PURE__ */ a("$ZodULID", (e, t) => {
1325
+ t.pattern ?? (t.pattern = Gn), y.init(e, t);
1326
+ }), Vr = /* @__PURE__ */ a("$ZodXID", (e, t) => {
1327
+ t.pattern ?? (t.pattern = qn), y.init(e, t);
1328
+ }), Wr = /* @__PURE__ */ a("$ZodKSUID", (e, t) => {
1329
+ t.pattern ?? (t.pattern = Xn), y.init(e, t);
1330
+ }), Br = /* @__PURE__ */ a("$ZodISODateTime", (e, t) => {
1331
+ t.pattern ?? (t.pattern = hr(t)), y.init(e, t);
1332
+ }), Yr = /* @__PURE__ */ a("$ZodISODate", (e, t) => {
1333
+ t.pattern ?? (t.pattern = dr), y.init(e, t);
1334
+ }), Hr = /* @__PURE__ */ a("$ZodISOTime", (e, t) => {
1335
+ t.pattern ?? (t.pattern = fr(t)), y.init(e, t);
1336
+ }), Jr = /* @__PURE__ */ a("$ZodISODuration", (e, t) => {
1337
+ t.pattern ?? (t.pattern = Qn), y.init(e, t);
1338
+ }), Gr = /* @__PURE__ */ a("$ZodIPv4", (e, t) => {
1339
+ t.pattern ?? (t.pattern = or), y.init(e, t), e._zod.onattach.push((n) => {
1302
1340
  const r = n._zod.bag;
1303
1341
  r.format = "ipv4";
1304
1342
  });
1305
- }), Ur = /* @__PURE__ */ s("$ZodIPv6", (e, t) => {
1306
- t.pattern ?? (t.pattern = Gn), w.init(e, t), e._zod.onattach.push((n) => {
1343
+ }), qr = /* @__PURE__ */ a("$ZodIPv6", (e, t) => {
1344
+ t.pattern ?? (t.pattern = ir), y.init(e, t), e._zod.onattach.push((n) => {
1307
1345
  const r = n._zod.bag;
1308
1346
  r.format = "ipv6";
1309
1347
  }), e._zod.check = (n) => {
@@ -1319,10 +1357,10 @@ const zr = {
1319
1357
  });
1320
1358
  }
1321
1359
  };
1322
- }), Fr = /* @__PURE__ */ s("$ZodCIDRv4", (e, t) => {
1323
- t.pattern ?? (t.pattern = qn), w.init(e, t);
1324
- }), Lr = /* @__PURE__ */ s("$ZodCIDRv6", (e, t) => {
1325
- t.pattern ?? (t.pattern = Hn), w.init(e, t), e._zod.check = (n) => {
1360
+ }), Xr = /* @__PURE__ */ a("$ZodCIDRv4", (e, t) => {
1361
+ t.pattern ?? (t.pattern = sr), y.init(e, t);
1362
+ }), Kr = /* @__PURE__ */ a("$ZodCIDRv6", (e, t) => {
1363
+ t.pattern ?? (t.pattern = cr), y.init(e, t), e._zod.check = (n) => {
1326
1364
  const r = n.value.split("/");
1327
1365
  try {
1328
1366
  if (r.length !== 2)
@@ -1330,10 +1368,10 @@ const zr = {
1330
1368
  const [o, i] = r;
1331
1369
  if (!i)
1332
1370
  throw new Error();
1333
- const c = Number(i);
1334
- if (`${c}` !== i)
1371
+ const s = Number(i);
1372
+ if (`${s}` !== i)
1335
1373
  throw new Error();
1336
- if (c < 0 || c > 128)
1374
+ if (s < 0 || s > 128)
1337
1375
  throw new Error();
1338
1376
  new URL(`http://[${o}]`);
1339
1377
  } catch {
@@ -1347,7 +1385,7 @@ const zr = {
1347
1385
  }
1348
1386
  };
1349
1387
  });
1350
- function $t(e) {
1388
+ function Ot(e) {
1351
1389
  if (e === "")
1352
1390
  return !0;
1353
1391
  if (e.length % 4 !== 0)
@@ -1358,11 +1396,11 @@ function $t(e) {
1358
1396
  return !1;
1359
1397
  }
1360
1398
  }
1361
- const Mr = /* @__PURE__ */ s("$ZodBase64", (e, t) => {
1362
- t.pattern ?? (t.pattern = Xn), w.init(e, t), e._zod.onattach.push((n) => {
1399
+ const Qr = /* @__PURE__ */ a("$ZodBase64", (e, t) => {
1400
+ t.pattern ?? (t.pattern = ar), y.init(e, t), e._zod.onattach.push((n) => {
1363
1401
  n._zod.bag.contentEncoding = "base64";
1364
1402
  }), e._zod.check = (n) => {
1365
- $t(n.value) || n.issues.push({
1403
+ Ot(n.value) || n.issues.push({
1366
1404
  code: "invalid_format",
1367
1405
  format: "base64",
1368
1406
  input: n.value,
@@ -1371,17 +1409,17 @@ const Mr = /* @__PURE__ */ s("$ZodBase64", (e, t) => {
1371
1409
  });
1372
1410
  };
1373
1411
  });
1374
- function Vr(e) {
1375
- if (!vt.test(e))
1412
+ function eo(e) {
1413
+ if (!Tt.test(e))
1376
1414
  return !1;
1377
1415
  const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
1378
- return $t(n);
1416
+ return Ot(n);
1379
1417
  }
1380
- const Wr = /* @__PURE__ */ s("$ZodBase64URL", (e, t) => {
1381
- t.pattern ?? (t.pattern = vt), w.init(e, t), e._zod.onattach.push((n) => {
1418
+ const to = /* @__PURE__ */ a("$ZodBase64URL", (e, t) => {
1419
+ t.pattern ?? (t.pattern = Tt), y.init(e, t), e._zod.onattach.push((n) => {
1382
1420
  n._zod.bag.contentEncoding = "base64url";
1383
1421
  }), e._zod.check = (n) => {
1384
- Vr(n.value) || n.issues.push({
1422
+ eo(n.value) || n.issues.push({
1385
1423
  code: "invalid_format",
1386
1424
  format: "base64url",
1387
1425
  input: n.value,
@@ -1389,10 +1427,10 @@ const Wr = /* @__PURE__ */ s("$ZodBase64URL", (e, t) => {
1389
1427
  continue: !t.abort
1390
1428
  });
1391
1429
  };
1392
- }), Br = /* @__PURE__ */ s("$ZodE164", (e, t) => {
1393
- t.pattern ?? (t.pattern = Qn), w.init(e, t);
1430
+ }), no = /* @__PURE__ */ a("$ZodE164", (e, t) => {
1431
+ t.pattern ?? (t.pattern = lr), y.init(e, t);
1394
1432
  });
1395
- function Yr(e, t = null) {
1433
+ function ro(e, t = null) {
1396
1434
  try {
1397
1435
  const n = e.split(".");
1398
1436
  if (n.length !== 3)
@@ -1406,9 +1444,9 @@ function Yr(e, t = null) {
1406
1444
  return !1;
1407
1445
  }
1408
1446
  }
1409
- const Jr = /* @__PURE__ */ s("$ZodJWT", (e, t) => {
1410
- w.init(e, t), e._zod.check = (n) => {
1411
- Yr(n.value, t.alg) || n.issues.push({
1447
+ const oo = /* @__PURE__ */ a("$ZodJWT", (e, t) => {
1448
+ y.init(e, t), e._zod.check = (n) => {
1449
+ ro(n.value, t.alg) || n.issues.push({
1412
1450
  code: "invalid_format",
1413
1451
  format: "jwt",
1414
1452
  input: n.value,
@@ -1416,8 +1454,8 @@ const Jr = /* @__PURE__ */ s("$ZodJWT", (e, t) => {
1416
1454
  continue: !t.abort
1417
1455
  });
1418
1456
  };
1419
- }), Zt = /* @__PURE__ */ s("$ZodNumber", (e, t) => {
1420
- $.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? ir, e._zod.parse = (n, r) => {
1457
+ }), Rt = /* @__PURE__ */ a("$ZodNumber", (e, t) => {
1458
+ S.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? gr, e._zod.parse = (n, r) => {
1421
1459
  if (t.coerce)
1422
1460
  try {
1423
1461
  n.value = Number(n.value);
@@ -1435,10 +1473,10 @@ const Jr = /* @__PURE__ */ s("$ZodJWT", (e, t) => {
1435
1473
  ...i ? { received: i } : {}
1436
1474
  }), n;
1437
1475
  };
1438
- }), Gr = /* @__PURE__ */ s("$ZodNumber", (e, t) => {
1439
- lr.init(e, t), Zt.init(e, t);
1440
- }), qr = /* @__PURE__ */ s("$ZodBoolean", (e, t) => {
1441
- $.init(e, t), e._zod.pattern = cr, e._zod.parse = (n, r) => {
1476
+ }), io = /* @__PURE__ */ a("$ZodNumber", (e, t) => {
1477
+ kr.init(e, t), Rt.init(e, t);
1478
+ }), so = /* @__PURE__ */ a("$ZodBoolean", (e, t) => {
1479
+ S.init(e, t), e._zod.pattern = _r, e._zod.parse = (n, r) => {
1442
1480
  if (t.coerce)
1443
1481
  try {
1444
1482
  n.value = !!n.value;
@@ -1452,21 +1490,21 @@ const Jr = /* @__PURE__ */ s("$ZodJWT", (e, t) => {
1452
1490
  inst: e
1453
1491
  }), n;
1454
1492
  };
1455
- }), Hr = /* @__PURE__ */ s("$ZodUnknown", (e, t) => {
1456
- $.init(e, t), e._zod.parse = (n) => n;
1457
- }), Xr = /* @__PURE__ */ s("$ZodNever", (e, t) => {
1458
- $.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
1493
+ }), co = /* @__PURE__ */ a("$ZodUnknown", (e, t) => {
1494
+ S.init(e, t), e._zod.parse = (n) => n;
1495
+ }), ao = /* @__PURE__ */ a("$ZodNever", (e, t) => {
1496
+ S.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
1459
1497
  expected: "never",
1460
1498
  code: "invalid_type",
1461
1499
  input: n.value,
1462
1500
  inst: e
1463
1501
  }), n);
1464
1502
  });
1465
- function Ve(e, t, n) {
1466
- e.issues.length && t.issues.push(...pt(n, e.issues)), t.value[n] = e.value;
1503
+ function Xe(e, t, n) {
1504
+ e.issues.length && t.issues.push(...$t(n, e.issues)), t.value[n] = e.value;
1467
1505
  }
1468
- const Kr = /* @__PURE__ */ s("$ZodArray", (e, t) => {
1469
- $.init(e, t), e._zod.parse = (n, r) => {
1506
+ const uo = /* @__PURE__ */ a("$ZodArray", (e, t) => {
1507
+ S.init(e, t), e._zod.parse = (n, r) => {
1470
1508
  const o = n.value;
1471
1509
  if (!Array.isArray(o))
1472
1510
  return n.issues.push({
@@ -1477,25 +1515,25 @@ const Kr = /* @__PURE__ */ s("$ZodArray", (e, t) => {
1477
1515
  }), n;
1478
1516
  n.value = Array(o.length);
1479
1517
  const i = [];
1480
- for (let c = 0; c < o.length; c++) {
1481
- const a = o[c], f = t.element._zod.run({
1482
- value: a,
1518
+ for (let s = 0; s < o.length; s++) {
1519
+ const c = o[s], d = t.element._zod.run({
1520
+ value: c,
1483
1521
  issues: []
1484
1522
  }, r);
1485
- f instanceof Promise ? i.push(f.then((d) => Ve(d, n, c))) : Ve(f, n, c);
1523
+ d instanceof Promise ? i.push(d.then((l) => Xe(l, n, s))) : Xe(d, n, s);
1486
1524
  }
1487
1525
  return i.length ? Promise.all(i).then(() => n) : n;
1488
1526
  };
1489
1527
  });
1490
- function ie(e, t, n, r) {
1491
- e.issues.length && t.issues.push(...pt(n, e.issues)), e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
1528
+ function de(e, t, n, r) {
1529
+ e.issues.length && t.issues.push(...$t(n, e.issues)), e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
1492
1530
  }
1493
- function Et(e) {
1531
+ function Pt(e) {
1494
1532
  const t = Object.keys(e.shape);
1495
1533
  for (const r of t)
1496
1534
  if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
1497
1535
  throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
1498
- const n = mn(e.shape);
1536
+ const n = En(e.shape);
1499
1537
  return {
1500
1538
  ...e,
1501
1539
  keys: t,
@@ -1504,115 +1542,115 @@ function Et(e) {
1504
1542
  optionalKeys: new Set(n)
1505
1543
  };
1506
1544
  }
1507
- function xt(e, t, n, r, o, i) {
1508
- const c = [], a = o.keySet, f = o.catchall._zod, d = f.def.type;
1509
- for (const l of Object.keys(t)) {
1510
- if (a.has(l))
1545
+ function Nt(e, t, n, r, o, i) {
1546
+ const s = [], c = o.keySet, d = o.catchall._zod, l = d.def.type;
1547
+ for (const f of Object.keys(t)) {
1548
+ if (c.has(f))
1511
1549
  continue;
1512
- if (d === "never") {
1513
- c.push(l);
1550
+ if (l === "never") {
1551
+ s.push(f);
1514
1552
  continue;
1515
1553
  }
1516
- const g = f.run({ value: t[l], issues: [] }, r);
1517
- g instanceof Promise ? e.push(g.then((p) => ie(p, n, l, t))) : ie(g, n, l, t);
1554
+ const h = d.run({ value: t[f], issues: [] }, r);
1555
+ h instanceof Promise ? e.push(h.then((p) => de(p, n, f, t))) : de(h, n, f, t);
1518
1556
  }
1519
- return c.length && n.issues.push({
1557
+ return s.length && n.issues.push({
1520
1558
  code: "unrecognized_keys",
1521
- keys: c,
1559
+ keys: s,
1522
1560
  input: t,
1523
1561
  inst: i
1524
1562
  }), e.length ? Promise.all(e).then(() => n) : n;
1525
1563
  }
1526
- const Qr = /* @__PURE__ */ s("$ZodObject", (e, t) => {
1527
- if ($.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1528
- const a = t.shape;
1564
+ const lo = /* @__PURE__ */ a("$ZodObject", (e, t) => {
1565
+ if (S.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1566
+ const c = t.shape;
1529
1567
  Object.defineProperty(t, "shape", {
1530
1568
  get: () => {
1531
- const f = { ...a };
1569
+ const d = { ...c };
1532
1570
  return Object.defineProperty(t, "shape", {
1533
- value: f
1534
- }), f;
1571
+ value: d
1572
+ }), d;
1535
1573
  }
1536
1574
  });
1537
1575
  }
1538
- const r = ye(() => Et(t));
1539
- b(e._zod, "propValues", () => {
1540
- const a = t.shape, f = {};
1541
- for (const d in a) {
1542
- const l = a[d]._zod;
1543
- if (l.values) {
1544
- f[d] ?? (f[d] = /* @__PURE__ */ new Set());
1545
- for (const g of l.values)
1546
- f[d].add(g);
1576
+ const r = je(() => Pt(t));
1577
+ w(e._zod, "propValues", () => {
1578
+ const c = t.shape, d = {};
1579
+ for (const l in c) {
1580
+ const f = c[l]._zod;
1581
+ if (f.values) {
1582
+ d[l] ?? (d[l] = /* @__PURE__ */ new Set());
1583
+ for (const h of f.values)
1584
+ d[l].add(h);
1547
1585
  }
1548
1586
  }
1549
- return f;
1550
- });
1551
- const o = oe, i = t.catchall;
1552
- let c;
1553
- e._zod.parse = (a, f) => {
1554
- c ?? (c = r.value);
1555
- const d = a.value;
1556
- if (!o(d))
1557
- return a.issues.push({
1587
+ return d;
1588
+ });
1589
+ const o = le, i = t.catchall;
1590
+ let s;
1591
+ e._zod.parse = (c, d) => {
1592
+ s ?? (s = r.value);
1593
+ const l = c.value;
1594
+ if (!o(l))
1595
+ return c.issues.push({
1558
1596
  expected: "object",
1559
1597
  code: "invalid_type",
1560
- input: d,
1598
+ input: l,
1561
1599
  inst: e
1562
- }), a;
1563
- a.value = {};
1564
- const l = [], g = c.shape;
1565
- for (const p of c.keys) {
1566
- const T = g[p]._zod.run({ value: d[p], issues: [] }, f);
1567
- T instanceof Promise ? l.push(T.then((R) => ie(R, a, p, d))) : ie(T, a, p, d);
1600
+ }), c;
1601
+ c.value = {};
1602
+ const f = [], h = s.shape;
1603
+ for (const p of s.keys) {
1604
+ const T = h[p]._zod.run({ value: l[p], issues: [] }, d);
1605
+ T instanceof Promise ? f.push(T.then((b) => de(b, c, p, l))) : de(T, c, p, l);
1568
1606
  }
1569
- return i ? xt(l, d, a, f, r.value, e) : l.length ? Promise.all(l).then(() => a) : a;
1607
+ return i ? Nt(f, l, c, d, r.value, e) : f.length ? Promise.all(f).then(() => c) : c;
1570
1608
  };
1571
- }), eo = /* @__PURE__ */ s("$ZodObjectJIT", (e, t) => {
1572
- Qr.init(e, t);
1573
- const n = e._zod.parse, r = ye(() => Et(t)), o = (p) => {
1574
- const v = new kr(["shape", "payload", "ctx"]), T = r.value, R = (A) => {
1575
- const I = Le(A);
1576
- return `shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`;
1609
+ }), fo = /* @__PURE__ */ a("$ZodObjectJIT", (e, t) => {
1610
+ lo.init(e, t);
1611
+ const n = e._zod.parse, r = je(() => Pt(t)), o = (p) => {
1612
+ const g = new Ar(["shape", "payload", "ctx"]), T = r.value, b = ($) => {
1613
+ const z = Ge($);
1614
+ return `shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`;
1577
1615
  };
1578
- v.write("const input = payload.value;");
1579
- const y = /* @__PURE__ */ Object.create(null);
1580
- let P = 0;
1581
- for (const A of T.keys)
1582
- y[A] = `key_${P++}`;
1583
- v.write("const newResult = {};");
1584
- for (const A of T.keys) {
1585
- const I = y[A], C = Le(A);
1586
- v.write(`const ${I} = ${R(A)};`), v.write(`
1587
- if (${I}.issues.length) {
1588
- payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
1616
+ g.write("const input = payload.value;");
1617
+ const C = /* @__PURE__ */ Object.create(null);
1618
+ let N = 0;
1619
+ for (const $ of T.keys)
1620
+ C[$] = `key_${N++}`;
1621
+ g.write("const newResult = {};");
1622
+ for (const $ of T.keys) {
1623
+ const z = C[$], P = Ge($);
1624
+ g.write(`const ${z} = ${b($)};`), g.write(`
1625
+ if (${z}.issues.length) {
1626
+ payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
1589
1627
  ...iss,
1590
- path: iss.path ? [${C}, ...iss.path] : [${C}]
1628
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
1591
1629
  })));
1592
1630
  }
1593
1631
 
1594
1632
 
1595
- if (${I}.value === undefined) {
1596
- if (${C} in input) {
1597
- newResult[${C}] = undefined;
1633
+ if (${z}.value === undefined) {
1634
+ if (${P} in input) {
1635
+ newResult[${P}] = undefined;
1598
1636
  }
1599
1637
  } else {
1600
- newResult[${C}] = ${I}.value;
1638
+ newResult[${P}] = ${z}.value;
1601
1639
  }
1602
1640
 
1603
1641
  `);
1604
1642
  }
1605
- v.write("payload.value = newResult;"), v.write("return payload;");
1606
- const L = v.compile();
1607
- return (A, I) => L(p, A, I);
1643
+ g.write("payload.value = newResult;"), g.write("return payload;");
1644
+ const k = g.compile();
1645
+ return ($, z) => k(p, $, z);
1608
1646
  };
1609
1647
  let i;
1610
- const c = oe, a = !dt.jitless, d = a && hn.value, l = t.catchall;
1611
- let g;
1612
- e._zod.parse = (p, v) => {
1613
- g ?? (g = r.value);
1648
+ const s = le, c = !kt.jitless, l = c && $n.value, f = t.catchall;
1649
+ let h;
1650
+ e._zod.parse = (p, g) => {
1651
+ h ?? (h = r.value);
1614
1652
  const T = p.value;
1615
- return c(T) ? a && d && v?.async === !1 && v.jitless !== !0 ? (i || (i = o(t.shape)), p = i(p, v), l ? xt([], T, p, v, g, e) : p) : n(p, v) : (p.issues.push({
1653
+ return s(T) ? c && l && g?.async === !1 && g.jitless !== !0 ? (i || (i = o(t.shape)), p = i(p, g), f ? Nt([], T, p, g, h, e) : p) : n(p, g) : (p.issues.push({
1616
1654
  expected: "object",
1617
1655
  code: "invalid_type",
1618
1656
  input: T,
@@ -1620,70 +1658,70 @@ const Qr = /* @__PURE__ */ s("$ZodObject", (e, t) => {
1620
1658
  }), p);
1621
1659
  };
1622
1660
  });
1623
- function We(e, t, n, r) {
1661
+ function Ke(e, t, n, r) {
1624
1662
  for (const i of e)
1625
1663
  if (i.issues.length === 0)
1626
1664
  return t.value = i.value, t;
1627
- const o = e.filter((i) => !W(i));
1665
+ const o = e.filter((i) => !J(i));
1628
1666
  return o.length === 1 ? (t.value = o[0].value, o[0]) : (t.issues.push({
1629
1667
  code: "invalid_union",
1630
1668
  input: t.value,
1631
1669
  inst: n,
1632
- errors: e.map((i) => i.issues.map((c) => D(c, r, N())))
1670
+ errors: e.map((i) => i.issues.map((s) => V(s, r, M())))
1633
1671
  }), t);
1634
1672
  }
1635
- const to = /* @__PURE__ */ s("$ZodUnion", (e, t) => {
1636
- $.init(e, t), b(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), b(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), b(e._zod, "values", () => {
1673
+ const ho = /* @__PURE__ */ a("$ZodUnion", (e, t) => {
1674
+ S.init(e, t), w(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), w(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), w(e._zod, "values", () => {
1637
1675
  if (t.options.every((o) => o._zod.values))
1638
1676
  return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
1639
- }), b(e._zod, "pattern", () => {
1677
+ }), w(e._zod, "pattern", () => {
1640
1678
  if (t.options.every((o) => o._zod.pattern)) {
1641
1679
  const o = t.options.map((i) => i._zod.pattern);
1642
- return new RegExp(`^(${o.map((i) => Ze(i.source)).join("|")})$`);
1680
+ return new RegExp(`^(${o.map((i) => Ce(i.source)).join("|")})$`);
1643
1681
  }
1644
1682
  });
1645
1683
  const n = t.options.length === 1, r = t.options[0]._zod.run;
1646
1684
  e._zod.parse = (o, i) => {
1647
1685
  if (n)
1648
1686
  return r(o, i);
1649
- let c = !1;
1650
- const a = [];
1651
- for (const f of t.options) {
1652
- const d = f._zod.run({
1687
+ let s = !1;
1688
+ const c = [];
1689
+ for (const d of t.options) {
1690
+ const l = d._zod.run({
1653
1691
  value: o.value,
1654
1692
  issues: []
1655
1693
  }, i);
1656
- if (d instanceof Promise)
1657
- a.push(d), c = !0;
1694
+ if (l instanceof Promise)
1695
+ c.push(l), s = !0;
1658
1696
  else {
1659
- if (d.issues.length === 0)
1660
- return d;
1661
- a.push(d);
1697
+ if (l.issues.length === 0)
1698
+ return l;
1699
+ c.push(l);
1662
1700
  }
1663
1701
  }
1664
- return c ? Promise.all(a).then((f) => We(f, o, e, i)) : We(a, o, e, i);
1702
+ return s ? Promise.all(c).then((d) => Ke(d, o, e, i)) : Ke(c, o, e, i);
1665
1703
  };
1666
- }), no = /* @__PURE__ */ s("$ZodIntersection", (e, t) => {
1667
- $.init(e, t), e._zod.parse = (n, r) => {
1668
- const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), c = t.right._zod.run({ value: o, issues: [] }, r);
1669
- return i instanceof Promise || c instanceof Promise ? Promise.all([i, c]).then(([f, d]) => Be(n, f, d)) : Be(n, i, c);
1704
+ }), mo = /* @__PURE__ */ a("$ZodIntersection", (e, t) => {
1705
+ S.init(e, t), e._zod.parse = (n, r) => {
1706
+ const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), s = t.right._zod.run({ value: o, issues: [] }, r);
1707
+ return i instanceof Promise || s instanceof Promise ? Promise.all([i, s]).then(([d, l]) => Qe(n, d, l)) : Qe(n, i, s);
1670
1708
  };
1671
1709
  });
1672
- function be(e, t) {
1710
+ function xe(e, t) {
1673
1711
  if (e === t)
1674
1712
  return { valid: !0, data: e };
1675
1713
  if (e instanceof Date && t instanceof Date && +e == +t)
1676
1714
  return { valid: !0, data: e };
1677
- if (G(e) && G(t)) {
1715
+ if (ee(e) && ee(t)) {
1678
1716
  const n = Object.keys(t), r = Object.keys(e).filter((i) => n.indexOf(i) !== -1), o = { ...e, ...t };
1679
1717
  for (const i of r) {
1680
- const c = be(e[i], t[i]);
1681
- if (!c.valid)
1718
+ const s = xe(e[i], t[i]);
1719
+ if (!s.valid)
1682
1720
  return {
1683
1721
  valid: !1,
1684
- mergeErrorPath: [i, ...c.mergeErrorPath]
1722
+ mergeErrorPath: [i, ...s.mergeErrorPath]
1685
1723
  };
1686
- o[i] = c.data;
1724
+ o[i] = s.data;
1687
1725
  }
1688
1726
  return { valid: !0, data: o };
1689
1727
  }
@@ -1692,94 +1730,94 @@ function be(e, t) {
1692
1730
  return { valid: !1, mergeErrorPath: [] };
1693
1731
  const n = [];
1694
1732
  for (let r = 0; r < e.length; r++) {
1695
- const o = e[r], i = t[r], c = be(o, i);
1696
- if (!c.valid)
1733
+ const o = e[r], i = t[r], s = xe(o, i);
1734
+ if (!s.valid)
1697
1735
  return {
1698
1736
  valid: !1,
1699
- mergeErrorPath: [r, ...c.mergeErrorPath]
1737
+ mergeErrorPath: [r, ...s.mergeErrorPath]
1700
1738
  };
1701
- n.push(c.data);
1739
+ n.push(s.data);
1702
1740
  }
1703
1741
  return { valid: !0, data: n };
1704
1742
  }
1705
1743
  return { valid: !1, mergeErrorPath: [] };
1706
1744
  }
1707
- function Be(e, t, n) {
1708
- if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), W(e))
1745
+ function Qe(e, t, n) {
1746
+ if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), J(e))
1709
1747
  return e;
1710
- const r = be(t.value, n.value);
1748
+ const r = xe(t.value, n.value);
1711
1749
  if (!r.valid)
1712
1750
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
1713
1751
  return e.value = r.data, e;
1714
1752
  }
1715
- const ro = /* @__PURE__ */ s("$ZodEnum", (e, t) => {
1716
- $.init(e, t);
1717
- const n = dn(t.entries), r = new Set(n);
1718
- e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => pn.has(typeof o)).map((o) => typeof o == "string" ? se(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
1719
- const c = o.value;
1720
- return r.has(c) || o.issues.push({
1753
+ const po = /* @__PURE__ */ a("$ZodEnum", (e, t) => {
1754
+ S.init(e, t);
1755
+ const n = zn(t.entries), r = new Set(n);
1756
+ e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => Zn.has(typeof o)).map((o) => typeof o == "string" ? he(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
1757
+ const s = o.value;
1758
+ return r.has(s) || o.issues.push({
1721
1759
  code: "invalid_value",
1722
1760
  values: n,
1723
- input: c,
1761
+ input: s,
1724
1762
  inst: e
1725
1763
  }), o;
1726
1764
  };
1727
- }), oo = /* @__PURE__ */ s("$ZodTransform", (e, t) => {
1728
- $.init(e, t), e._zod.parse = (n, r) => {
1765
+ }), go = /* @__PURE__ */ a("$ZodTransform", (e, t) => {
1766
+ S.init(e, t), e._zod.parse = (n, r) => {
1729
1767
  if (r.direction === "backward")
1730
- throw new lt(e.constructor.name);
1768
+ throw new wt(e.constructor.name);
1731
1769
  const o = t.transform(n.value, n);
1732
1770
  if (r.async)
1733
- return (o instanceof Promise ? o : Promise.resolve(o)).then((c) => (n.value = c, n));
1771
+ return (o instanceof Promise ? o : Promise.resolve(o)).then((s) => (n.value = s, n));
1734
1772
  if (o instanceof Promise)
1735
- throw new B();
1773
+ throw new G();
1736
1774
  return n.value = o, n;
1737
1775
  };
1738
1776
  });
1739
- function Ye(e, t) {
1777
+ function et(e, t) {
1740
1778
  return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
1741
1779
  }
1742
- const io = /* @__PURE__ */ s("$ZodOptional", (e, t) => {
1743
- $.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", b(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), b(e._zod, "pattern", () => {
1780
+ const _o = /* @__PURE__ */ a("$ZodOptional", (e, t) => {
1781
+ S.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", w(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), w(e._zod, "pattern", () => {
1744
1782
  const n = t.innerType._zod.pattern;
1745
- return n ? new RegExp(`^(${Ze(n.source)})?$`) : void 0;
1783
+ return n ? new RegExp(`^(${Ce(n.source)})?$`) : void 0;
1746
1784
  }), e._zod.parse = (n, r) => {
1747
1785
  if (t.innerType._zod.optin === "optional") {
1748
1786
  const o = t.innerType._zod.run(n, r);
1749
- return o instanceof Promise ? o.then((i) => Ye(i, n.value)) : Ye(o, n.value);
1787
+ return o instanceof Promise ? o.then((i) => et(i, n.value)) : et(o, n.value);
1750
1788
  }
1751
1789
  return n.value === void 0 ? n : t.innerType._zod.run(n, r);
1752
1790
  };
1753
- }), co = /* @__PURE__ */ s("$ZodNullable", (e, t) => {
1754
- $.init(e, t), b(e._zod, "optin", () => t.innerType._zod.optin), b(e._zod, "optout", () => t.innerType._zod.optout), b(e._zod, "pattern", () => {
1791
+ }), vo = /* @__PURE__ */ a("$ZodNullable", (e, t) => {
1792
+ S.init(e, t), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), w(e._zod, "pattern", () => {
1755
1793
  const n = t.innerType._zod.pattern;
1756
- return n ? new RegExp(`^(${Ze(n.source)}|null)$`) : void 0;
1757
- }), b(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
1758
- }), so = /* @__PURE__ */ s("$ZodDefault", (e, t) => {
1759
- $.init(e, t), e._zod.optin = "optional", b(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1794
+ return n ? new RegExp(`^(${Ce(n.source)}|null)$`) : void 0;
1795
+ }), w(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
1796
+ }), bo = /* @__PURE__ */ a("$ZodDefault", (e, t) => {
1797
+ S.init(e, t), e._zod.optin = "optional", w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1760
1798
  if (r.direction === "backward")
1761
1799
  return t.innerType._zod.run(n, r);
1762
1800
  if (n.value === void 0)
1763
1801
  return n.value = t.defaultValue, n;
1764
1802
  const o = t.innerType._zod.run(n, r);
1765
- return o instanceof Promise ? o.then((i) => Je(i, t)) : Je(o, t);
1803
+ return o instanceof Promise ? o.then((i) => tt(i, t)) : tt(o, t);
1766
1804
  };
1767
1805
  });
1768
- function Je(e, t) {
1806
+ function tt(e, t) {
1769
1807
  return e.value === void 0 && (e.value = t.defaultValue), e;
1770
1808
  }
1771
- const ao = /* @__PURE__ */ s("$ZodPrefault", (e, t) => {
1772
- $.init(e, t), e._zod.optin = "optional", b(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
1773
- }), uo = /* @__PURE__ */ s("$ZodNonOptional", (e, t) => {
1774
- $.init(e, t), b(e._zod, "values", () => {
1809
+ const wo = /* @__PURE__ */ a("$ZodPrefault", (e, t) => {
1810
+ S.init(e, t), e._zod.optin = "optional", w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
1811
+ }), ko = /* @__PURE__ */ a("$ZodNonOptional", (e, t) => {
1812
+ S.init(e, t), w(e._zod, "values", () => {
1775
1813
  const n = t.innerType._zod.values;
1776
1814
  return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
1777
1815
  }), e._zod.parse = (n, r) => {
1778
1816
  const o = t.innerType._zod.run(n, r);
1779
- return o instanceof Promise ? o.then((i) => Ge(i, e)) : Ge(o, e);
1817
+ return o instanceof Promise ? o.then((i) => nt(i, e)) : nt(o, e);
1780
1818
  };
1781
1819
  });
1782
- function Ge(e, t) {
1820
+ function nt(e, t) {
1783
1821
  return !e.issues.length && e.value === void 0 && e.issues.push({
1784
1822
  code: "invalid_type",
1785
1823
  expected: "nonoptional",
@@ -1787,58 +1825,58 @@ function Ge(e, t) {
1787
1825
  inst: t
1788
1826
  }), e;
1789
1827
  }
1790
- const lo = /* @__PURE__ */ s("$ZodCatch", (e, t) => {
1791
- $.init(e, t), b(e._zod, "optin", () => t.innerType._zod.optin), b(e._zod, "optout", () => t.innerType._zod.optout), b(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1828
+ const zo = /* @__PURE__ */ a("$ZodCatch", (e, t) => {
1829
+ S.init(e, t), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1792
1830
  if (r.direction === "backward")
1793
1831
  return t.innerType._zod.run(n, r);
1794
1832
  const o = t.innerType._zod.run(n, r);
1795
1833
  return o instanceof Promise ? o.then((i) => (n.value = i.value, i.issues.length && (n.value = t.catchValue({
1796
1834
  ...n,
1797
1835
  error: {
1798
- issues: i.issues.map((c) => D(c, r, N()))
1836
+ issues: i.issues.map((s) => V(s, r, M()))
1799
1837
  },
1800
1838
  input: n.value
1801
1839
  }), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
1802
1840
  ...n,
1803
1841
  error: {
1804
- issues: o.issues.map((i) => D(i, r, N()))
1842
+ issues: o.issues.map((i) => V(i, r, M()))
1805
1843
  },
1806
1844
  input: n.value
1807
1845
  }), n.issues = []), n);
1808
1846
  };
1809
- }), fo = /* @__PURE__ */ s("$ZodPipe", (e, t) => {
1810
- $.init(e, t), b(e._zod, "values", () => t.in._zod.values), b(e._zod, "optin", () => t.in._zod.optin), b(e._zod, "optout", () => t.out._zod.optout), b(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
1847
+ }), yo = /* @__PURE__ */ a("$ZodPipe", (e, t) => {
1848
+ S.init(e, t), w(e._zod, "values", () => t.in._zod.values), w(e._zod, "optin", () => t.in._zod.optin), w(e._zod, "optout", () => t.out._zod.optout), w(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
1811
1849
  if (r.direction === "backward") {
1812
1850
  const i = t.out._zod.run(n, r);
1813
- return i instanceof Promise ? i.then((c) => ee(c, t.in, r)) : ee(i, t.in, r);
1851
+ return i instanceof Promise ? i.then((s) => se(s, t.in, r)) : se(i, t.in, r);
1814
1852
  }
1815
1853
  const o = t.in._zod.run(n, r);
1816
- return o instanceof Promise ? o.then((i) => ee(i, t.out, r)) : ee(o, t.out, r);
1854
+ return o instanceof Promise ? o.then((i) => se(i, t.out, r)) : se(o, t.out, r);
1817
1855
  };
1818
1856
  });
1819
- function ee(e, t, n) {
1857
+ function se(e, t, n) {
1820
1858
  return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
1821
1859
  }
1822
- const ho = /* @__PURE__ */ s("$ZodReadonly", (e, t) => {
1823
- $.init(e, t), b(e._zod, "propValues", () => t.innerType._zod.propValues), b(e._zod, "values", () => t.innerType._zod.values), b(e._zod, "optin", () => t.innerType._zod.optin), b(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (n, r) => {
1860
+ const $o = /* @__PURE__ */ a("$ZodReadonly", (e, t) => {
1861
+ S.init(e, t), w(e._zod, "propValues", () => t.innerType._zod.propValues), w(e._zod, "values", () => t.innerType._zod.values), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (n, r) => {
1824
1862
  if (r.direction === "backward")
1825
1863
  return t.innerType._zod.run(n, r);
1826
1864
  const o = t.innerType._zod.run(n, r);
1827
- return o instanceof Promise ? o.then(qe) : qe(o);
1865
+ return o instanceof Promise ? o.then(rt) : rt(o);
1828
1866
  };
1829
1867
  });
1830
- function qe(e) {
1868
+ function rt(e) {
1831
1869
  return e.value = Object.freeze(e.value), e;
1832
1870
  }
1833
- const po = /* @__PURE__ */ s("$ZodCustom", (e, t) => {
1834
- j.init(e, t), $.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
1871
+ const Zo = /* @__PURE__ */ a("$ZodCustom", (e, t) => {
1872
+ O.init(e, t), S.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
1835
1873
  const r = n.value, o = t.fn(r);
1836
1874
  if (o instanceof Promise)
1837
- return o.then((i) => He(i, n, r, e));
1838
- He(o, n, r, e);
1875
+ return o.then((i) => ot(i, n, r, e));
1876
+ ot(o, n, r, e);
1839
1877
  };
1840
1878
  });
1841
- function He(e, t, n, r) {
1879
+ function ot(e, t, n, r) {
1842
1880
  if (!e) {
1843
1881
  const o = {
1844
1882
  code: "custom",
@@ -1850,10 +1888,10 @@ function He(e, t, n, r) {
1850
1888
  continue: !r._zod.def.abort
1851
1889
  // params: inst._zod.def.params,
1852
1890
  };
1853
- r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(q(o));
1891
+ r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(te(o));
1854
1892
  }
1855
1893
  }
1856
- class mo {
1894
+ class Eo {
1857
1895
  constructor() {
1858
1896
  this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1859
1897
  }
@@ -1887,218 +1925,218 @@ class mo {
1887
1925
  return this._map.has(t);
1888
1926
  }
1889
1927
  }
1890
- function _o() {
1891
- return new mo();
1928
+ function xo() {
1929
+ return new Eo();
1892
1930
  }
1893
- const te = /* @__PURE__ */ _o();
1894
- function go(e, t) {
1931
+ const ce = /* @__PURE__ */ xo();
1932
+ function To(e, t) {
1895
1933
  return new e({
1896
1934
  type: "string",
1897
- ...h(t)
1935
+ ...m(t)
1898
1936
  });
1899
1937
  }
1900
- function vo(e, t) {
1938
+ function So(e, t) {
1901
1939
  return new e({
1902
1940
  type: "string",
1903
1941
  format: "email",
1904
1942
  check: "string_format",
1905
1943
  abort: !1,
1906
- ...h(t)
1944
+ ...m(t)
1907
1945
  });
1908
1946
  }
1909
- function Xe(e, t) {
1947
+ function it(e, t) {
1910
1948
  return new e({
1911
1949
  type: "string",
1912
1950
  format: "guid",
1913
1951
  check: "string_format",
1914
1952
  abort: !1,
1915
- ...h(t)
1953
+ ...m(t)
1916
1954
  });
1917
1955
  }
1918
- function bo(e, t) {
1956
+ function Io(e, t) {
1919
1957
  return new e({
1920
1958
  type: "string",
1921
1959
  format: "uuid",
1922
1960
  check: "string_format",
1923
1961
  abort: !1,
1924
- ...h(t)
1962
+ ...m(t)
1925
1963
  });
1926
1964
  }
1927
- function wo(e, t) {
1965
+ function jo(e, t) {
1928
1966
  return new e({
1929
1967
  type: "string",
1930
1968
  format: "uuid",
1931
1969
  check: "string_format",
1932
1970
  abort: !1,
1933
1971
  version: "v4",
1934
- ...h(t)
1972
+ ...m(t)
1935
1973
  });
1936
1974
  }
1937
- function ko(e, t) {
1975
+ function Ao(e, t) {
1938
1976
  return new e({
1939
1977
  type: "string",
1940
1978
  format: "uuid",
1941
1979
  check: "string_format",
1942
1980
  abort: !1,
1943
1981
  version: "v6",
1944
- ...h(t)
1982
+ ...m(t)
1945
1983
  });
1946
1984
  }
1947
- function zo(e, t) {
1985
+ function Co(e, t) {
1948
1986
  return new e({
1949
1987
  type: "string",
1950
1988
  format: "uuid",
1951
1989
  check: "string_format",
1952
1990
  abort: !1,
1953
1991
  version: "v7",
1954
- ...h(t)
1992
+ ...m(t)
1955
1993
  });
1956
1994
  }
1957
- function yo(e, t) {
1995
+ function Oo(e, t) {
1958
1996
  return new e({
1959
1997
  type: "string",
1960
1998
  format: "url",
1961
1999
  check: "string_format",
1962
2000
  abort: !1,
1963
- ...h(t)
2001
+ ...m(t)
1964
2002
  });
1965
2003
  }
1966
- function $o(e, t) {
2004
+ function Ro(e, t) {
1967
2005
  return new e({
1968
2006
  type: "string",
1969
2007
  format: "emoji",
1970
2008
  check: "string_format",
1971
2009
  abort: !1,
1972
- ...h(t)
2010
+ ...m(t)
1973
2011
  });
1974
2012
  }
1975
- function Zo(e, t) {
2013
+ function Po(e, t) {
1976
2014
  return new e({
1977
2015
  type: "string",
1978
2016
  format: "nanoid",
1979
2017
  check: "string_format",
1980
2018
  abort: !1,
1981
- ...h(t)
2019
+ ...m(t)
1982
2020
  });
1983
2021
  }
1984
- function Eo(e, t) {
2022
+ function No(e, t) {
1985
2023
  return new e({
1986
2024
  type: "string",
1987
2025
  format: "cuid",
1988
2026
  check: "string_format",
1989
2027
  abort: !1,
1990
- ...h(t)
2028
+ ...m(t)
1991
2029
  });
1992
2030
  }
1993
- function xo(e, t) {
2031
+ function Do(e, t) {
1994
2032
  return new e({
1995
2033
  type: "string",
1996
2034
  format: "cuid2",
1997
2035
  check: "string_format",
1998
2036
  abort: !1,
1999
- ...h(t)
2037
+ ...m(t)
2000
2038
  });
2001
2039
  }
2002
- function To(e, t) {
2040
+ function Uo(e, t) {
2003
2041
  return new e({
2004
2042
  type: "string",
2005
2043
  format: "ulid",
2006
2044
  check: "string_format",
2007
2045
  abort: !1,
2008
- ...h(t)
2046
+ ...m(t)
2009
2047
  });
2010
2048
  }
2011
- function Ao(e, t) {
2049
+ function Fo(e, t) {
2012
2050
  return new e({
2013
2051
  type: "string",
2014
2052
  format: "xid",
2015
2053
  check: "string_format",
2016
2054
  abort: !1,
2017
- ...h(t)
2055
+ ...m(t)
2018
2056
  });
2019
2057
  }
2020
- function jo(e, t) {
2058
+ function Lo(e, t) {
2021
2059
  return new e({
2022
2060
  type: "string",
2023
2061
  format: "ksuid",
2024
2062
  check: "string_format",
2025
2063
  abort: !1,
2026
- ...h(t)
2064
+ ...m(t)
2027
2065
  });
2028
2066
  }
2029
- function Io(e, t) {
2067
+ function Mo(e, t) {
2030
2068
  return new e({
2031
2069
  type: "string",
2032
2070
  format: "ipv4",
2033
2071
  check: "string_format",
2034
2072
  abort: !1,
2035
- ...h(t)
2073
+ ...m(t)
2036
2074
  });
2037
2075
  }
2038
- function So(e, t) {
2076
+ function Vo(e, t) {
2039
2077
  return new e({
2040
2078
  type: "string",
2041
2079
  format: "ipv6",
2042
2080
  check: "string_format",
2043
2081
  abort: !1,
2044
- ...h(t)
2082
+ ...m(t)
2045
2083
  });
2046
2084
  }
2047
- function Oo(e, t) {
2085
+ function Wo(e, t) {
2048
2086
  return new e({
2049
2087
  type: "string",
2050
2088
  format: "cidrv4",
2051
2089
  check: "string_format",
2052
2090
  abort: !1,
2053
- ...h(t)
2091
+ ...m(t)
2054
2092
  });
2055
2093
  }
2056
- function Ro(e, t) {
2094
+ function Bo(e, t) {
2057
2095
  return new e({
2058
2096
  type: "string",
2059
2097
  format: "cidrv6",
2060
2098
  check: "string_format",
2061
2099
  abort: !1,
2062
- ...h(t)
2100
+ ...m(t)
2063
2101
  });
2064
2102
  }
2065
- function Po(e, t) {
2103
+ function Yo(e, t) {
2066
2104
  return new e({
2067
2105
  type: "string",
2068
2106
  format: "base64",
2069
2107
  check: "string_format",
2070
2108
  abort: !1,
2071
- ...h(t)
2109
+ ...m(t)
2072
2110
  });
2073
2111
  }
2074
- function Co(e, t) {
2112
+ function Ho(e, t) {
2075
2113
  return new e({
2076
2114
  type: "string",
2077
2115
  format: "base64url",
2078
2116
  check: "string_format",
2079
2117
  abort: !1,
2080
- ...h(t)
2118
+ ...m(t)
2081
2119
  });
2082
2120
  }
2083
- function No(e, t) {
2121
+ function Jo(e, t) {
2084
2122
  return new e({
2085
2123
  type: "string",
2086
2124
  format: "e164",
2087
2125
  check: "string_format",
2088
2126
  abort: !1,
2089
- ...h(t)
2127
+ ...m(t)
2090
2128
  });
2091
2129
  }
2092
- function Do(e, t) {
2130
+ function Go(e, t) {
2093
2131
  return new e({
2094
2132
  type: "string",
2095
2133
  format: "jwt",
2096
2134
  check: "string_format",
2097
2135
  abort: !1,
2098
- ...h(t)
2136
+ ...m(t)
2099
2137
  });
2100
2138
  }
2101
- function Uo(e, t) {
2139
+ function qo(e, t) {
2102
2140
  return new e({
2103
2141
  type: "string",
2104
2142
  format: "datetime",
@@ -2106,270 +2144,270 @@ function Uo(e, t) {
2106
2144
  offset: !1,
2107
2145
  local: !1,
2108
2146
  precision: null,
2109
- ...h(t)
2147
+ ...m(t)
2110
2148
  });
2111
2149
  }
2112
- function Fo(e, t) {
2150
+ function Xo(e, t) {
2113
2151
  return new e({
2114
2152
  type: "string",
2115
2153
  format: "date",
2116
2154
  check: "string_format",
2117
- ...h(t)
2155
+ ...m(t)
2118
2156
  });
2119
2157
  }
2120
- function Lo(e, t) {
2158
+ function Ko(e, t) {
2121
2159
  return new e({
2122
2160
  type: "string",
2123
2161
  format: "time",
2124
2162
  check: "string_format",
2125
2163
  precision: null,
2126
- ...h(t)
2164
+ ...m(t)
2127
2165
  });
2128
2166
  }
2129
- function Mo(e, t) {
2167
+ function Qo(e, t) {
2130
2168
  return new e({
2131
2169
  type: "string",
2132
2170
  format: "duration",
2133
2171
  check: "string_format",
2134
- ...h(t)
2172
+ ...m(t)
2135
2173
  });
2136
2174
  }
2137
- function Vo(e, t) {
2175
+ function ei(e, t) {
2138
2176
  return new e({
2139
2177
  type: "number",
2140
2178
  checks: [],
2141
- ...h(t)
2179
+ ...m(t)
2142
2180
  });
2143
2181
  }
2144
- function Wo(e, t) {
2182
+ function ti(e, t) {
2145
2183
  return new e({
2146
2184
  type: "number",
2147
2185
  check: "number_format",
2148
2186
  abort: !1,
2149
2187
  format: "safeint",
2150
- ...h(t)
2188
+ ...m(t)
2151
2189
  });
2152
2190
  }
2153
- function Bo(e, t) {
2191
+ function ni(e, t) {
2154
2192
  return new e({
2155
2193
  type: "boolean",
2156
- ...h(t)
2194
+ ...m(t)
2157
2195
  });
2158
2196
  }
2159
- function Yo(e) {
2197
+ function ri(e) {
2160
2198
  return new e({
2161
2199
  type: "unknown"
2162
2200
  });
2163
2201
  }
2164
- function Jo(e, t) {
2202
+ function oi(e, t) {
2165
2203
  return new e({
2166
2204
  type: "never",
2167
- ...h(t)
2205
+ ...m(t)
2168
2206
  });
2169
2207
  }
2170
- function Ke(e, t) {
2171
- return new zt({
2208
+ function st(e, t) {
2209
+ return new At({
2172
2210
  check: "less_than",
2173
- ...h(t),
2211
+ ...m(t),
2174
2212
  value: e,
2175
2213
  inclusive: !1
2176
2214
  });
2177
2215
  }
2178
- function _e(e, t) {
2179
- return new zt({
2216
+ function ye(e, t) {
2217
+ return new At({
2180
2218
  check: "less_than",
2181
- ...h(t),
2219
+ ...m(t),
2182
2220
  value: e,
2183
2221
  inclusive: !0
2184
2222
  });
2185
2223
  }
2186
- function Qe(e, t) {
2187
- return new yt({
2224
+ function ct(e, t) {
2225
+ return new Ct({
2188
2226
  check: "greater_than",
2189
- ...h(t),
2227
+ ...m(t),
2190
2228
  value: e,
2191
2229
  inclusive: !1
2192
2230
  });
2193
2231
  }
2194
- function ge(e, t) {
2195
- return new yt({
2232
+ function $e(e, t) {
2233
+ return new Ct({
2196
2234
  check: "greater_than",
2197
- ...h(t),
2235
+ ...m(t),
2198
2236
  value: e,
2199
2237
  inclusive: !0
2200
2238
  });
2201
2239
  }
2202
- function et(e, t) {
2203
- return new ur({
2240
+ function at(e, t) {
2241
+ return new wr({
2204
2242
  check: "multiple_of",
2205
- ...h(t),
2243
+ ...m(t),
2206
2244
  value: e
2207
2245
  });
2208
2246
  }
2209
- function Tt(e, t) {
2210
- return new dr({
2247
+ function Dt(e, t) {
2248
+ return new zr({
2211
2249
  check: "max_length",
2212
- ...h(t),
2250
+ ...m(t),
2213
2251
  maximum: e
2214
2252
  });
2215
2253
  }
2216
- function ce(e, t) {
2217
- return new fr({
2254
+ function fe(e, t) {
2255
+ return new yr({
2218
2256
  check: "min_length",
2219
- ...h(t),
2257
+ ...m(t),
2220
2258
  minimum: e
2221
2259
  });
2222
2260
  }
2223
- function At(e, t) {
2224
- return new hr({
2261
+ function Ut(e, t) {
2262
+ return new $r({
2225
2263
  check: "length_equals",
2226
- ...h(t),
2264
+ ...m(t),
2227
2265
  length: e
2228
2266
  });
2229
2267
  }
2230
- function Go(e, t) {
2231
- return new pr({
2268
+ function ii(e, t) {
2269
+ return new Zr({
2232
2270
  check: "string_format",
2233
2271
  format: "regex",
2234
- ...h(t),
2272
+ ...m(t),
2235
2273
  pattern: e
2236
2274
  });
2237
2275
  }
2238
- function qo(e) {
2239
- return new mr({
2276
+ function si(e) {
2277
+ return new Er({
2240
2278
  check: "string_format",
2241
2279
  format: "lowercase",
2242
- ...h(e)
2280
+ ...m(e)
2243
2281
  });
2244
2282
  }
2245
- function Ho(e) {
2246
- return new _r({
2283
+ function ci(e) {
2284
+ return new xr({
2247
2285
  check: "string_format",
2248
2286
  format: "uppercase",
2249
- ...h(e)
2287
+ ...m(e)
2250
2288
  });
2251
2289
  }
2252
- function Xo(e, t) {
2253
- return new gr({
2290
+ function ai(e, t) {
2291
+ return new Tr({
2254
2292
  check: "string_format",
2255
2293
  format: "includes",
2256
- ...h(t),
2294
+ ...m(t),
2257
2295
  includes: e
2258
2296
  });
2259
2297
  }
2260
- function Ko(e, t) {
2261
- return new vr({
2298
+ function ui(e, t) {
2299
+ return new Sr({
2262
2300
  check: "string_format",
2263
2301
  format: "starts_with",
2264
- ...h(t),
2302
+ ...m(t),
2265
2303
  prefix: e
2266
2304
  });
2267
2305
  }
2268
- function Qo(e, t) {
2269
- return new br({
2306
+ function li(e, t) {
2307
+ return new Ir({
2270
2308
  check: "string_format",
2271
2309
  format: "ends_with",
2272
- ...h(t),
2310
+ ...m(t),
2273
2311
  suffix: e
2274
2312
  });
2275
2313
  }
2276
- function H(e) {
2277
- return new wr({
2314
+ function ne(e) {
2315
+ return new jr({
2278
2316
  check: "overwrite",
2279
2317
  tx: e
2280
2318
  });
2281
2319
  }
2282
- function ei(e) {
2283
- return H((t) => t.normalize(e));
2320
+ function di(e) {
2321
+ return ne((t) => t.normalize(e));
2284
2322
  }
2285
- function ti() {
2286
- return H((e) => e.trim());
2323
+ function fi() {
2324
+ return ne((e) => e.trim());
2287
2325
  }
2288
- function ni() {
2289
- return H((e) => e.toLowerCase());
2326
+ function hi() {
2327
+ return ne((e) => e.toLowerCase());
2290
2328
  }
2291
- function ri() {
2292
- return H((e) => e.toUpperCase());
2329
+ function mi() {
2330
+ return ne((e) => e.toUpperCase());
2293
2331
  }
2294
- function oi(e, t, n) {
2332
+ function pi(e, t, n) {
2295
2333
  return new e({
2296
2334
  type: "array",
2297
2335
  element: t,
2298
2336
  // get element() {
2299
2337
  // return element;
2300
2338
  // },
2301
- ...h(n)
2339
+ ...m(n)
2302
2340
  });
2303
2341
  }
2304
- function ii(e, t, n) {
2342
+ function gi(e, t, n) {
2305
2343
  return new e({
2306
2344
  type: "custom",
2307
2345
  check: "custom",
2308
2346
  fn: t,
2309
- ...h(n)
2347
+ ...m(n)
2310
2348
  });
2311
2349
  }
2312
- function ci(e) {
2313
- const t = si((n) => (n.addIssue = (r) => {
2350
+ function _i(e) {
2351
+ const t = vi((n) => (n.addIssue = (r) => {
2314
2352
  if (typeof r == "string")
2315
- n.issues.push(q(r, n.value, t._zod.def));
2353
+ n.issues.push(te(r, n.value, t._zod.def));
2316
2354
  else {
2317
2355
  const o = r;
2318
- o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(q(o));
2356
+ o.fatal && (o.continue = !1), o.code ?? (o.code = "custom"), o.input ?? (o.input = n.value), o.inst ?? (o.inst = t), o.continue ?? (o.continue = !t._zod.def.abort), n.issues.push(te(o));
2319
2357
  }
2320
2358
  }, e(n.value, n)));
2321
2359
  return t;
2322
2360
  }
2323
- function si(e, t) {
2324
- const n = new j({
2361
+ function vi(e, t) {
2362
+ const n = new O({
2325
2363
  check: "custom",
2326
- ...h(t)
2364
+ ...m(t)
2327
2365
  });
2328
2366
  return n._zod.check = e, n;
2329
2367
  }
2330
- const ai = /* @__PURE__ */ s("ZodISODateTime", (e, t) => {
2331
- Rr.init(e, t), k.init(e, t);
2368
+ const bi = /* @__PURE__ */ a("ZodISODateTime", (e, t) => {
2369
+ Br.init(e, t), Z.init(e, t);
2332
2370
  });
2333
- function ui(e) {
2334
- return Uo(ai, e);
2371
+ function wi(e) {
2372
+ return qo(bi, e);
2335
2373
  }
2336
- const li = /* @__PURE__ */ s("ZodISODate", (e, t) => {
2337
- Pr.init(e, t), k.init(e, t);
2374
+ const ki = /* @__PURE__ */ a("ZodISODate", (e, t) => {
2375
+ Yr.init(e, t), Z.init(e, t);
2338
2376
  });
2339
- function di(e) {
2340
- return Fo(li, e);
2377
+ function zi(e) {
2378
+ return Xo(ki, e);
2341
2379
  }
2342
- const fi = /* @__PURE__ */ s("ZodISOTime", (e, t) => {
2343
- Cr.init(e, t), k.init(e, t);
2380
+ const yi = /* @__PURE__ */ a("ZodISOTime", (e, t) => {
2381
+ Hr.init(e, t), Z.init(e, t);
2344
2382
  });
2345
- function hi(e) {
2346
- return Lo(fi, e);
2383
+ function $i(e) {
2384
+ return Ko(yi, e);
2347
2385
  }
2348
- const pi = /* @__PURE__ */ s("ZodISODuration", (e, t) => {
2349
- Nr.init(e, t), k.init(e, t);
2386
+ const Zi = /* @__PURE__ */ a("ZodISODuration", (e, t) => {
2387
+ Jr.init(e, t), Z.init(e, t);
2350
2388
  });
2351
- function mi(e) {
2352
- return Mo(pi, e);
2389
+ function Ei(e) {
2390
+ return Qo(Zi, e);
2353
2391
  }
2354
- const _i = (e, t) => {
2355
- _t.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2392
+ const xi = (e, t) => {
2393
+ Et.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2356
2394
  format: {
2357
- value: (n) => Zn(e, n)
2395
+ value: (n) => Pn(e, n)
2358
2396
  // enumerable: false,
2359
2397
  },
2360
2398
  flatten: {
2361
- value: (n) => $n(e, n)
2399
+ value: (n) => Rn(e, n)
2362
2400
  // enumerable: false,
2363
2401
  },
2364
2402
  addIssue: {
2365
2403
  value: (n) => {
2366
- e.issues.push(n), e.message = JSON.stringify(e.issues, ve, 2);
2404
+ e.issues.push(n), e.message = JSON.stringify(e.issues, Ee, 2);
2367
2405
  }
2368
2406
  // enumerable: false,
2369
2407
  },
2370
2408
  addIssues: {
2371
2409
  value: (n) => {
2372
- e.issues.push(...n), e.message = JSON.stringify(e.issues, ve, 2);
2410
+ e.issues.push(...n), e.message = JSON.stringify(e.issues, Ee, 2);
2373
2411
  }
2374
2412
  // enumerable: false,
2375
2413
  },
@@ -2380,349 +2418,788 @@ const _i = (e, t) => {
2380
2418
  // enumerable: false,
2381
2419
  }
2382
2420
  });
2383
- }, S = s("ZodError", _i, {
2421
+ }, R = a("ZodError", xi, {
2384
2422
  Parent: Error
2385
- }), gi = /* @__PURE__ */ xe(S), vi = /* @__PURE__ */ Te(S), bi = /* @__PURE__ */ ae(S), wi = /* @__PURE__ */ ue(S), ki = /* @__PURE__ */ Tn(S), zi = /* @__PURE__ */ An(S), yi = /* @__PURE__ */ jn(S), $i = /* @__PURE__ */ In(S), Zi = /* @__PURE__ */ Sn(S), Ei = /* @__PURE__ */ On(S), xi = /* @__PURE__ */ Rn(S), Ti = /* @__PURE__ */ Pn(S), Z = /* @__PURE__ */ s("ZodType", (e, t) => ($.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(F(t, {
2423
+ }), Ti = /* @__PURE__ */ Re(R), Si = /* @__PURE__ */ Pe(R), Ii = /* @__PURE__ */ me(R), ji = /* @__PURE__ */ pe(R), Ai = /* @__PURE__ */ Un(R), Ci = /* @__PURE__ */ Fn(R), Oi = /* @__PURE__ */ Ln(R), Ri = /* @__PURE__ */ Mn(R), Pi = /* @__PURE__ */ Vn(R), Ni = /* @__PURE__ */ Wn(R), Di = /* @__PURE__ */ Bn(R), Ui = /* @__PURE__ */ Yn(R), I = /* @__PURE__ */ a("ZodType", (e, t) => (S.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(B(t, {
2386
2424
  checks: [
2387
2425
  ...t.checks ?? [],
2388
2426
  ...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
2389
2427
  ]
2390
- })), e.clone = (n, r) => O(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => gi(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => bi(e, n, r), e.parseAsync = async (n, r) => vi(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => wi(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => ki(e, n, r), e.decode = (n, r) => zi(e, n, r), e.encodeAsync = async (n, r) => yi(e, n, r), e.decodeAsync = async (n, r) => $i(e, n, r), e.safeEncode = (n, r) => Zi(e, n, r), e.safeDecode = (n, r) => Ei(e, n, r), e.safeEncodeAsync = async (n, r) => xi(e, n, r), e.safeDecodeAsync = async (n, r) => Ti(e, n, r), e.refine = (n, r) => e.check(bc(n, r)), e.superRefine = (n) => e.check(wc(n)), e.overwrite = (n) => e.check(H(n)), e.optional = () => ct(e), e.nullable = () => st(e), e.nullish = () => ct(st(e)), e.nonoptional = (n) => fc(e, n), e.array = () => Qi(e), e.or = (n) => nc([e, n]), e.and = (n) => oc(e, n), e.transform = (n) => at(e, cc(n)), e.default = (n) => uc(e, n), e.prefault = (n) => dc(e, n), e.catch = (n) => pc(e, n), e.pipe = (n) => at(e, n), e.readonly = () => gc(e), e.describe = (n) => {
2428
+ })), e.clone = (n, r) => L(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => Ti(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => Ii(e, n, r), e.parseAsync = async (n, r) => Si(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => ji(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => Ai(e, n, r), e.decode = (n, r) => Ci(e, n, r), e.encodeAsync = async (n, r) => Oi(e, n, r), e.decodeAsync = async (n, r) => Ri(e, n, r), e.safeEncode = (n, r) => Pi(e, n, r), e.safeDecode = (n, r) => Ni(e, n, r), e.safeEncodeAsync = async (n, r) => Di(e, n, r), e.safeDecodeAsync = async (n, r) => Ui(e, n, r), e.refine = (n, r) => e.check(Is(n, r)), e.superRefine = (n) => e.check(js(n)), e.overwrite = (n) => e.check(ne(n)), e.optional = () => mt(e), e.nullable = () => pt(e), e.nullish = () => mt(pt(e)), e.nonoptional = (n) => ys(e, n), e.array = () => ls(e), e.or = (n) => hs([e, n]), e.and = (n) => ps(e, n), e.transform = (n) => gt(e, _s(n)), e.default = (n) => ws(e, n), e.prefault = (n) => zs(e, n), e.catch = (n) => Zs(e, n), e.pipe = (n) => gt(e, n), e.readonly = () => Ts(e), e.describe = (n) => {
2391
2429
  const r = e.clone();
2392
- return te.add(r, { description: n }), r;
2430
+ return ce.add(r, { description: n }), r;
2393
2431
  }, Object.defineProperty(e, "description", {
2394
2432
  get() {
2395
- return te.get(e)?.description;
2433
+ return ce.get(e)?.description;
2396
2434
  },
2397
2435
  configurable: !0
2398
2436
  }), e.meta = (...n) => {
2399
2437
  if (n.length === 0)
2400
- return te.get(e);
2438
+ return ce.get(e);
2401
2439
  const r = e.clone();
2402
- return te.add(r, n[0]), r;
2403
- }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), jt = /* @__PURE__ */ s("_ZodString", (e, t) => {
2404
- Ae.init(e, t), Z.init(e, t);
2440
+ return ce.add(r, n[0]), r;
2441
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Ft = /* @__PURE__ */ a("_ZodString", (e, t) => {
2442
+ Ne.init(e, t), I.init(e, t);
2405
2443
  const n = e._zod.bag;
2406
- e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(Go(...r)), e.includes = (...r) => e.check(Xo(...r)), e.startsWith = (...r) => e.check(Ko(...r)), e.endsWith = (...r) => e.check(Qo(...r)), e.min = (...r) => e.check(ce(...r)), e.max = (...r) => e.check(Tt(...r)), e.length = (...r) => e.check(At(...r)), e.nonempty = (...r) => e.check(ce(1, ...r)), e.lowercase = (r) => e.check(qo(r)), e.uppercase = (r) => e.check(Ho(r)), e.trim = () => e.check(ti()), e.normalize = (...r) => e.check(ei(...r)), e.toLowerCase = () => e.check(ni()), e.toUpperCase = () => e.check(ri());
2407
- }), Ai = /* @__PURE__ */ s("ZodString", (e, t) => {
2408
- Ae.init(e, t), jt.init(e, t), e.email = (n) => e.check(vo(ji, n)), e.url = (n) => e.check(yo(Ii, n)), e.jwt = (n) => e.check(Do(Yi, n)), e.emoji = (n) => e.check($o(Si, n)), e.guid = (n) => e.check(Xe(tt, n)), e.uuid = (n) => e.check(bo(re, n)), e.uuidv4 = (n) => e.check(wo(re, n)), e.uuidv6 = (n) => e.check(ko(re, n)), e.uuidv7 = (n) => e.check(zo(re, n)), e.nanoid = (n) => e.check(Zo(Oi, n)), e.guid = (n) => e.check(Xe(tt, n)), e.cuid = (n) => e.check(Eo(Ri, n)), e.cuid2 = (n) => e.check(xo(Pi, n)), e.ulid = (n) => e.check(To(Ci, n)), e.base64 = (n) => e.check(Po(Vi, n)), e.base64url = (n) => e.check(Co(Wi, n)), e.xid = (n) => e.check(Ao(Ni, n)), e.ksuid = (n) => e.check(jo(Di, n)), e.ipv4 = (n) => e.check(Io(Ui, n)), e.ipv6 = (n) => e.check(So(Fi, n)), e.cidrv4 = (n) => e.check(Oo(Li, n)), e.cidrv6 = (n) => e.check(Ro(Mi, n)), e.e164 = (n) => e.check(No(Bi, n)), e.datetime = (n) => e.check(ui(n)), e.date = (n) => e.check(di(n)), e.time = (n) => e.check(hi(n)), e.duration = (n) => e.check(mi(n));
2444
+ e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(ii(...r)), e.includes = (...r) => e.check(ai(...r)), e.startsWith = (...r) => e.check(ui(...r)), e.endsWith = (...r) => e.check(li(...r)), e.min = (...r) => e.check(fe(...r)), e.max = (...r) => e.check(Dt(...r)), e.length = (...r) => e.check(Ut(...r)), e.nonempty = (...r) => e.check(fe(1, ...r)), e.lowercase = (r) => e.check(si(r)), e.uppercase = (r) => e.check(ci(r)), e.trim = () => e.check(fi()), e.normalize = (...r) => e.check(di(...r)), e.toLowerCase = () => e.check(hi()), e.toUpperCase = () => e.check(mi());
2445
+ }), Fi = /* @__PURE__ */ a("ZodString", (e, t) => {
2446
+ Ne.init(e, t), Ft.init(e, t), e.email = (n) => e.check(So(Li, n)), e.url = (n) => e.check(Oo(Mi, n)), e.jwt = (n) => e.check(Go(rs, n)), e.emoji = (n) => e.check(Ro(Vi, n)), e.guid = (n) => e.check(it(ut, n)), e.uuid = (n) => e.check(Io(ue, n)), e.uuidv4 = (n) => e.check(jo(ue, n)), e.uuidv6 = (n) => e.check(Ao(ue, n)), e.uuidv7 = (n) => e.check(Co(ue, n)), e.nanoid = (n) => e.check(Po(Wi, n)), e.guid = (n) => e.check(it(ut, n)), e.cuid = (n) => e.check(No(Bi, n)), e.cuid2 = (n) => e.check(Do(Yi, n)), e.ulid = (n) => e.check(Uo(Hi, n)), e.base64 = (n) => e.check(Yo(es, n)), e.base64url = (n) => e.check(Ho(ts, n)), e.xid = (n) => e.check(Fo(Ji, n)), e.ksuid = (n) => e.check(Lo(Gi, n)), e.ipv4 = (n) => e.check(Mo(qi, n)), e.ipv6 = (n) => e.check(Vo(Xi, n)), e.cidrv4 = (n) => e.check(Wo(Ki, n)), e.cidrv6 = (n) => e.check(Bo(Qi, n)), e.e164 = (n) => e.check(Jo(ns, n)), e.datetime = (n) => e.check(wi(n)), e.date = (n) => e.check(zi(n)), e.time = (n) => e.check($i(n)), e.duration = (n) => e.check(Ei(n));
2409
2447
  });
2410
- function ne(e) {
2411
- return go(Ai, e);
2412
- }
2413
- const k = /* @__PURE__ */ s("ZodStringFormat", (e, t) => {
2414
- w.init(e, t), jt.init(e, t);
2415
- }), ji = /* @__PURE__ */ s("ZodEmail", (e, t) => {
2416
- Zr.init(e, t), k.init(e, t);
2417
- }), tt = /* @__PURE__ */ s("ZodGUID", (e, t) => {
2418
- yr.init(e, t), k.init(e, t);
2419
- }), re = /* @__PURE__ */ s("ZodUUID", (e, t) => {
2420
- $r.init(e, t), k.init(e, t);
2421
- }), Ii = /* @__PURE__ */ s("ZodURL", (e, t) => {
2422
- Er.init(e, t), k.init(e, t);
2423
- }), Si = /* @__PURE__ */ s("ZodEmoji", (e, t) => {
2424
- xr.init(e, t), k.init(e, t);
2425
- }), Oi = /* @__PURE__ */ s("ZodNanoID", (e, t) => {
2426
- Tr.init(e, t), k.init(e, t);
2427
- }), Ri = /* @__PURE__ */ s("ZodCUID", (e, t) => {
2428
- Ar.init(e, t), k.init(e, t);
2429
- }), Pi = /* @__PURE__ */ s("ZodCUID2", (e, t) => {
2430
- jr.init(e, t), k.init(e, t);
2431
- }), Ci = /* @__PURE__ */ s("ZodULID", (e, t) => {
2432
- Ir.init(e, t), k.init(e, t);
2433
- }), Ni = /* @__PURE__ */ s("ZodXID", (e, t) => {
2434
- Sr.init(e, t), k.init(e, t);
2435
- }), Di = /* @__PURE__ */ s("ZodKSUID", (e, t) => {
2436
- Or.init(e, t), k.init(e, t);
2437
- }), Ui = /* @__PURE__ */ s("ZodIPv4", (e, t) => {
2438
- Dr.init(e, t), k.init(e, t);
2439
- }), Fi = /* @__PURE__ */ s("ZodIPv6", (e, t) => {
2440
- Ur.init(e, t), k.init(e, t);
2441
- }), Li = /* @__PURE__ */ s("ZodCIDRv4", (e, t) => {
2442
- Fr.init(e, t), k.init(e, t);
2443
- }), Mi = /* @__PURE__ */ s("ZodCIDRv6", (e, t) => {
2444
- Lr.init(e, t), k.init(e, t);
2445
- }), Vi = /* @__PURE__ */ s("ZodBase64", (e, t) => {
2446
- Mr.init(e, t), k.init(e, t);
2447
- }), Wi = /* @__PURE__ */ s("ZodBase64URL", (e, t) => {
2448
- Wr.init(e, t), k.init(e, t);
2449
- }), Bi = /* @__PURE__ */ s("ZodE164", (e, t) => {
2450
- Br.init(e, t), k.init(e, t);
2451
- }), Yi = /* @__PURE__ */ s("ZodJWT", (e, t) => {
2452
- Jr.init(e, t), k.init(e, t);
2453
- }), It = /* @__PURE__ */ s("ZodNumber", (e, t) => {
2454
- Zt.init(e, t), Z.init(e, t), e.gt = (r, o) => e.check(Qe(r, o)), e.gte = (r, o) => e.check(ge(r, o)), e.min = (r, o) => e.check(ge(r, o)), e.lt = (r, o) => e.check(Ke(r, o)), e.lte = (r, o) => e.check(_e(r, o)), e.max = (r, o) => e.check(_e(r, o)), e.int = (r) => e.check(rt(r)), e.safe = (r) => e.check(rt(r)), e.positive = (r) => e.check(Qe(0, r)), e.nonnegative = (r) => e.check(ge(0, r)), e.negative = (r) => e.check(Ke(0, r)), e.nonpositive = (r) => e.check(_e(0, r)), e.multipleOf = (r, o) => e.check(et(r, o)), e.step = (r, o) => e.check(et(r, o)), e.finite = () => e;
2448
+ function ae(e) {
2449
+ return To(Fi, e);
2450
+ }
2451
+ const Z = /* @__PURE__ */ a("ZodStringFormat", (e, t) => {
2452
+ y.init(e, t), Ft.init(e, t);
2453
+ }), Li = /* @__PURE__ */ a("ZodEmail", (e, t) => {
2454
+ Pr.init(e, t), Z.init(e, t);
2455
+ }), ut = /* @__PURE__ */ a("ZodGUID", (e, t) => {
2456
+ Or.init(e, t), Z.init(e, t);
2457
+ }), ue = /* @__PURE__ */ a("ZodUUID", (e, t) => {
2458
+ Rr.init(e, t), Z.init(e, t);
2459
+ }), Mi = /* @__PURE__ */ a("ZodURL", (e, t) => {
2460
+ Nr.init(e, t), Z.init(e, t);
2461
+ }), Vi = /* @__PURE__ */ a("ZodEmoji", (e, t) => {
2462
+ Dr.init(e, t), Z.init(e, t);
2463
+ }), Wi = /* @__PURE__ */ a("ZodNanoID", (e, t) => {
2464
+ Ur.init(e, t), Z.init(e, t);
2465
+ }), Bi = /* @__PURE__ */ a("ZodCUID", (e, t) => {
2466
+ Fr.init(e, t), Z.init(e, t);
2467
+ }), Yi = /* @__PURE__ */ a("ZodCUID2", (e, t) => {
2468
+ Lr.init(e, t), Z.init(e, t);
2469
+ }), Hi = /* @__PURE__ */ a("ZodULID", (e, t) => {
2470
+ Mr.init(e, t), Z.init(e, t);
2471
+ }), Ji = /* @__PURE__ */ a("ZodXID", (e, t) => {
2472
+ Vr.init(e, t), Z.init(e, t);
2473
+ }), Gi = /* @__PURE__ */ a("ZodKSUID", (e, t) => {
2474
+ Wr.init(e, t), Z.init(e, t);
2475
+ }), qi = /* @__PURE__ */ a("ZodIPv4", (e, t) => {
2476
+ Gr.init(e, t), Z.init(e, t);
2477
+ }), Xi = /* @__PURE__ */ a("ZodIPv6", (e, t) => {
2478
+ qr.init(e, t), Z.init(e, t);
2479
+ }), Ki = /* @__PURE__ */ a("ZodCIDRv4", (e, t) => {
2480
+ Xr.init(e, t), Z.init(e, t);
2481
+ }), Qi = /* @__PURE__ */ a("ZodCIDRv6", (e, t) => {
2482
+ Kr.init(e, t), Z.init(e, t);
2483
+ }), es = /* @__PURE__ */ a("ZodBase64", (e, t) => {
2484
+ Qr.init(e, t), Z.init(e, t);
2485
+ }), ts = /* @__PURE__ */ a("ZodBase64URL", (e, t) => {
2486
+ to.init(e, t), Z.init(e, t);
2487
+ }), ns = /* @__PURE__ */ a("ZodE164", (e, t) => {
2488
+ no.init(e, t), Z.init(e, t);
2489
+ }), rs = /* @__PURE__ */ a("ZodJWT", (e, t) => {
2490
+ oo.init(e, t), Z.init(e, t);
2491
+ }), Lt = /* @__PURE__ */ a("ZodNumber", (e, t) => {
2492
+ Rt.init(e, t), I.init(e, t), e.gt = (r, o) => e.check(ct(r, o)), e.gte = (r, o) => e.check($e(r, o)), e.min = (r, o) => e.check($e(r, o)), e.lt = (r, o) => e.check(st(r, o)), e.lte = (r, o) => e.check(ye(r, o)), e.max = (r, o) => e.check(ye(r, o)), e.int = (r) => e.check(dt(r)), e.safe = (r) => e.check(dt(r)), e.positive = (r) => e.check(ct(0, r)), e.nonnegative = (r) => e.check($e(0, r)), e.negative = (r) => e.check(st(0, r)), e.nonpositive = (r) => e.check(ye(0, r)), e.multipleOf = (r, o) => e.check(at(r, o)), e.step = (r, o) => e.check(at(r, o)), e.finite = () => e;
2455
2493
  const n = e._zod.bag;
2456
2494
  e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
2457
2495
  });
2458
- function nt(e) {
2459
- return Vo(It, e);
2496
+ function lt(e) {
2497
+ return ei(Lt, e);
2460
2498
  }
2461
- const Ji = /* @__PURE__ */ s("ZodNumberFormat", (e, t) => {
2462
- Gr.init(e, t), It.init(e, t);
2499
+ const os = /* @__PURE__ */ a("ZodNumberFormat", (e, t) => {
2500
+ io.init(e, t), Lt.init(e, t);
2463
2501
  });
2464
- function rt(e) {
2465
- return Wo(Ji, e);
2502
+ function dt(e) {
2503
+ return ti(os, e);
2466
2504
  }
2467
- const Gi = /* @__PURE__ */ s("ZodBoolean", (e, t) => {
2468
- qr.init(e, t), Z.init(e, t);
2505
+ const is = /* @__PURE__ */ a("ZodBoolean", (e, t) => {
2506
+ so.init(e, t), I.init(e, t);
2469
2507
  });
2470
- function ot(e) {
2471
- return Bo(Gi, e);
2508
+ function ft(e) {
2509
+ return ni(is, e);
2472
2510
  }
2473
- const qi = /* @__PURE__ */ s("ZodUnknown", (e, t) => {
2474
- Hr.init(e, t), Z.init(e, t);
2511
+ const ss = /* @__PURE__ */ a("ZodUnknown", (e, t) => {
2512
+ co.init(e, t), I.init(e, t);
2475
2513
  });
2476
- function it() {
2477
- return Yo(qi);
2514
+ function ht() {
2515
+ return ri(ss);
2478
2516
  }
2479
- const Hi = /* @__PURE__ */ s("ZodNever", (e, t) => {
2480
- Xr.init(e, t), Z.init(e, t);
2517
+ const cs = /* @__PURE__ */ a("ZodNever", (e, t) => {
2518
+ ao.init(e, t), I.init(e, t);
2481
2519
  });
2482
- function Xi(e) {
2483
- return Jo(Hi, e);
2520
+ function as(e) {
2521
+ return oi(cs, e);
2484
2522
  }
2485
- const Ki = /* @__PURE__ */ s("ZodArray", (e, t) => {
2486
- Kr.init(e, t), Z.init(e, t), e.element = t.element, e.min = (n, r) => e.check(ce(n, r)), e.nonempty = (n) => e.check(ce(1, n)), e.max = (n, r) => e.check(Tt(n, r)), e.length = (n, r) => e.check(At(n, r)), e.unwrap = () => e.element;
2523
+ const us = /* @__PURE__ */ a("ZodArray", (e, t) => {
2524
+ uo.init(e, t), I.init(e, t), e.element = t.element, e.min = (n, r) => e.check(fe(n, r)), e.nonempty = (n) => e.check(fe(1, n)), e.max = (n, r) => e.check(Dt(n, r)), e.length = (n, r) => e.check(Ut(n, r)), e.unwrap = () => e.element;
2487
2525
  });
2488
- function Qi(e, t) {
2489
- return oi(Ki, e, t);
2526
+ function ls(e, t) {
2527
+ return pi(us, e, t);
2490
2528
  }
2491
- const ec = /* @__PURE__ */ s("ZodObject", (e, t) => {
2492
- eo.init(e, t), Z.init(e, t), b(e, "shape", () => t.shape), e.keyof = () => je(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: it() }), e.loose = () => e.clone({ ...e._zod.def, catchall: it() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Xi() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => bn(e, n), e.safeExtend = (n) => wn(e, n), e.merge = (n) => kn(e, n), e.pick = (n) => gn(e, n), e.omit = (n) => vn(e, n), e.partial = (...n) => zn(St, e, n[0]), e.required = (...n) => yn(Ot, e, n[0]);
2529
+ const ds = /* @__PURE__ */ a("ZodObject", (e, t) => {
2530
+ fo.init(e, t), I.init(e, t), w(e, "shape", () => t.shape), e.keyof = () => De(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ht() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ht() }), e.strict = () => e.clone({ ...e._zod.def, catchall: as() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => In(e, n), e.safeExtend = (n) => jn(e, n), e.merge = (n) => An(e, n), e.pick = (n) => Tn(e, n), e.omit = (n) => Sn(e, n), e.partial = (...n) => Cn(Mt, e, n[0]), e.required = (...n) => On(Vt, e, n[0]);
2493
2531
  });
2494
- function we(e, t) {
2532
+ function Te(e, t) {
2495
2533
  const n = {
2496
2534
  type: "object",
2497
2535
  shape: e ?? {},
2498
- ...h(t)
2536
+ ...m(t)
2499
2537
  };
2500
- return new ec(n);
2538
+ return new ds(n);
2501
2539
  }
2502
- const tc = /* @__PURE__ */ s("ZodUnion", (e, t) => {
2503
- to.init(e, t), Z.init(e, t), e.options = t.options;
2540
+ const fs = /* @__PURE__ */ a("ZodUnion", (e, t) => {
2541
+ ho.init(e, t), I.init(e, t), e.options = t.options;
2504
2542
  });
2505
- function nc(e, t) {
2506
- return new tc({
2543
+ function hs(e, t) {
2544
+ return new fs({
2507
2545
  type: "union",
2508
2546
  options: e,
2509
- ...h(t)
2547
+ ...m(t)
2510
2548
  });
2511
2549
  }
2512
- const rc = /* @__PURE__ */ s("ZodIntersection", (e, t) => {
2513
- no.init(e, t), Z.init(e, t);
2550
+ const ms = /* @__PURE__ */ a("ZodIntersection", (e, t) => {
2551
+ mo.init(e, t), I.init(e, t);
2514
2552
  });
2515
- function oc(e, t) {
2516
- return new rc({
2553
+ function ps(e, t) {
2554
+ return new ms({
2517
2555
  type: "intersection",
2518
2556
  left: e,
2519
2557
  right: t
2520
2558
  });
2521
2559
  }
2522
- const ke = /* @__PURE__ */ s("ZodEnum", (e, t) => {
2523
- ro.init(e, t), Z.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
2560
+ const Se = /* @__PURE__ */ a("ZodEnum", (e, t) => {
2561
+ po.init(e, t), I.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
2524
2562
  const n = new Set(Object.keys(t.entries));
2525
2563
  e.extract = (r, o) => {
2526
2564
  const i = {};
2527
- for (const c of r)
2528
- if (n.has(c))
2529
- i[c] = t.entries[c];
2565
+ for (const s of r)
2566
+ if (n.has(s))
2567
+ i[s] = t.entries[s];
2530
2568
  else
2531
- throw new Error(`Key ${c} not found in enum`);
2532
- return new ke({
2569
+ throw new Error(`Key ${s} not found in enum`);
2570
+ return new Se({
2533
2571
  ...t,
2534
2572
  checks: [],
2535
- ...h(o),
2573
+ ...m(o),
2536
2574
  entries: i
2537
2575
  });
2538
2576
  }, e.exclude = (r, o) => {
2539
2577
  const i = { ...t.entries };
2540
- for (const c of r)
2541
- if (n.has(c))
2542
- delete i[c];
2578
+ for (const s of r)
2579
+ if (n.has(s))
2580
+ delete i[s];
2543
2581
  else
2544
- throw new Error(`Key ${c} not found in enum`);
2545
- return new ke({
2582
+ throw new Error(`Key ${s} not found in enum`);
2583
+ return new Se({
2546
2584
  ...t,
2547
2585
  checks: [],
2548
- ...h(o),
2586
+ ...m(o),
2549
2587
  entries: i
2550
2588
  });
2551
2589
  };
2552
2590
  });
2553
- function je(e, t) {
2591
+ function De(e, t) {
2554
2592
  const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
2555
- return new ke({
2593
+ return new Se({
2556
2594
  type: "enum",
2557
2595
  entries: n,
2558
- ...h(t)
2596
+ ...m(t)
2559
2597
  });
2560
2598
  }
2561
- const ic = /* @__PURE__ */ s("ZodTransform", (e, t) => {
2562
- oo.init(e, t), Z.init(e, t), e._zod.parse = (n, r) => {
2599
+ const gs = /* @__PURE__ */ a("ZodTransform", (e, t) => {
2600
+ go.init(e, t), I.init(e, t), e._zod.parse = (n, r) => {
2563
2601
  if (r.direction === "backward")
2564
- throw new lt(e.constructor.name);
2602
+ throw new wt(e.constructor.name);
2565
2603
  n.addIssue = (i) => {
2566
2604
  if (typeof i == "string")
2567
- n.issues.push(q(i, n.value, t));
2605
+ n.issues.push(te(i, n.value, t));
2568
2606
  else {
2569
- const c = i;
2570
- c.fatal && (c.continue = !1), c.code ?? (c.code = "custom"), c.input ?? (c.input = n.value), c.inst ?? (c.inst = e), n.issues.push(q(c));
2607
+ const s = i;
2608
+ s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(te(s));
2571
2609
  }
2572
2610
  };
2573
2611
  const o = t.transform(n.value, n);
2574
2612
  return o instanceof Promise ? o.then((i) => (n.value = i, n)) : (n.value = o, n);
2575
2613
  };
2576
2614
  });
2577
- function cc(e) {
2578
- return new ic({
2615
+ function _s(e) {
2616
+ return new gs({
2579
2617
  type: "transform",
2580
2618
  transform: e
2581
2619
  });
2582
2620
  }
2583
- const St = /* @__PURE__ */ s("ZodOptional", (e, t) => {
2584
- io.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
2621
+ const Mt = /* @__PURE__ */ a("ZodOptional", (e, t) => {
2622
+ _o.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
2585
2623
  });
2586
- function ct(e) {
2587
- return new St({
2624
+ function mt(e) {
2625
+ return new Mt({
2588
2626
  type: "optional",
2589
2627
  innerType: e
2590
2628
  });
2591
2629
  }
2592
- const sc = /* @__PURE__ */ s("ZodNullable", (e, t) => {
2593
- co.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
2630
+ const vs = /* @__PURE__ */ a("ZodNullable", (e, t) => {
2631
+ vo.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
2594
2632
  });
2595
- function st(e) {
2596
- return new sc({
2633
+ function pt(e) {
2634
+ return new vs({
2597
2635
  type: "nullable",
2598
2636
  innerType: e
2599
2637
  });
2600
2638
  }
2601
- const ac = /* @__PURE__ */ s("ZodDefault", (e, t) => {
2602
- so.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2639
+ const bs = /* @__PURE__ */ a("ZodDefault", (e, t) => {
2640
+ bo.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2603
2641
  });
2604
- function uc(e, t) {
2605
- return new ac({
2642
+ function ws(e, t) {
2643
+ return new bs({
2606
2644
  type: "default",
2607
2645
  innerType: e,
2608
2646
  get defaultValue() {
2609
- return typeof t == "function" ? t() : ht(t);
2647
+ return typeof t == "function" ? t() : yt(t);
2610
2648
  }
2611
2649
  });
2612
2650
  }
2613
- const lc = /* @__PURE__ */ s("ZodPrefault", (e, t) => {
2614
- ao.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
2651
+ const ks = /* @__PURE__ */ a("ZodPrefault", (e, t) => {
2652
+ wo.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
2615
2653
  });
2616
- function dc(e, t) {
2617
- return new lc({
2654
+ function zs(e, t) {
2655
+ return new ks({
2618
2656
  type: "prefault",
2619
2657
  innerType: e,
2620
2658
  get defaultValue() {
2621
- return typeof t == "function" ? t() : ht(t);
2659
+ return typeof t == "function" ? t() : yt(t);
2622
2660
  }
2623
2661
  });
2624
2662
  }
2625
- const Ot = /* @__PURE__ */ s("ZodNonOptional", (e, t) => {
2626
- uo.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
2663
+ const Vt = /* @__PURE__ */ a("ZodNonOptional", (e, t) => {
2664
+ ko.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
2627
2665
  });
2628
- function fc(e, t) {
2629
- return new Ot({
2666
+ function ys(e, t) {
2667
+ return new Vt({
2630
2668
  type: "nonoptional",
2631
2669
  innerType: e,
2632
- ...h(t)
2670
+ ...m(t)
2633
2671
  });
2634
2672
  }
2635
- const hc = /* @__PURE__ */ s("ZodCatch", (e, t) => {
2636
- lo.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2673
+ const $s = /* @__PURE__ */ a("ZodCatch", (e, t) => {
2674
+ zo.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2637
2675
  });
2638
- function pc(e, t) {
2639
- return new hc({
2676
+ function Zs(e, t) {
2677
+ return new $s({
2640
2678
  type: "catch",
2641
2679
  innerType: e,
2642
2680
  catchValue: typeof t == "function" ? t : () => t
2643
2681
  });
2644
2682
  }
2645
- const mc = /* @__PURE__ */ s("ZodPipe", (e, t) => {
2646
- fo.init(e, t), Z.init(e, t), e.in = t.in, e.out = t.out;
2683
+ const Es = /* @__PURE__ */ a("ZodPipe", (e, t) => {
2684
+ yo.init(e, t), I.init(e, t), e.in = t.in, e.out = t.out;
2647
2685
  });
2648
- function at(e, t) {
2649
- return new mc({
2686
+ function gt(e, t) {
2687
+ return new Es({
2650
2688
  type: "pipe",
2651
2689
  in: e,
2652
2690
  out: t
2653
2691
  // ...util.normalizeParams(params),
2654
2692
  });
2655
2693
  }
2656
- const _c = /* @__PURE__ */ s("ZodReadonly", (e, t) => {
2657
- ho.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
2694
+ const xs = /* @__PURE__ */ a("ZodReadonly", (e, t) => {
2695
+ $o.init(e, t), I.init(e, t), e.unwrap = () => e._zod.def.innerType;
2658
2696
  });
2659
- function gc(e) {
2660
- return new _c({
2697
+ function Ts(e) {
2698
+ return new xs({
2661
2699
  type: "readonly",
2662
2700
  innerType: e
2663
2701
  });
2664
2702
  }
2665
- const vc = /* @__PURE__ */ s("ZodCustom", (e, t) => {
2666
- po.init(e, t), Z.init(e, t);
2703
+ const Ss = /* @__PURE__ */ a("ZodCustom", (e, t) => {
2704
+ Zo.init(e, t), I.init(e, t);
2667
2705
  });
2668
- function bc(e, t = {}) {
2669
- return ii(vc, e, t);
2670
- }
2671
- function wc(e) {
2672
- return ci(e);
2673
- }
2674
- const kc = we({
2675
- title: ne().min(1, "Title is required").max(200, "Title too long"),
2676
- content: ne().min(1, "Content is required"),
2677
- format: je(["html", "markdown"]).default("html"),
2678
- metadata: we({
2679
- createdAt: ne().datetime(),
2680
- updatedAt: ne().datetime(),
2681
- wordCount: nt().min(0),
2682
- characterCount: nt().min(0)
2706
+ function Is(e, t = {}) {
2707
+ return gi(Ss, e, t);
2708
+ }
2709
+ function js(e) {
2710
+ return _i(e);
2711
+ }
2712
+ const Wt = Te({
2713
+ title: ae().min(1, "Title is required").max(200, "Title too long"),
2714
+ content: ae().min(1, "Content is required"),
2715
+ format: De(["html", "markdown"]).default("html"),
2716
+ metadata: Te({
2717
+ createdAt: ae().datetime(),
2718
+ updatedAt: ae().datetime(),
2719
+ wordCount: lt().min(0),
2720
+ characterCount: lt().min(0)
2683
2721
  }).optional()
2684
2722
  });
2685
- we({
2686
- includeStyles: ot().default(!0),
2687
- includeMeta: ot().default(!0),
2688
- format: je(["html", "txt"]).default("html")
2723
+ Te({
2724
+ includeStyles: ft().default(!0),
2725
+ includeMeta: ft().default(!0),
2726
+ format: De(["html", "txt"]).default("html")
2689
2727
  });
2690
- const zc = (e = "") => {
2691
- const [t, n] = ze({
2728
+ const _t = {
2729
+ content: "",
2730
+ title: "Untitled Document",
2731
+ wordCount: 0,
2732
+ characterCount: 0,
2733
+ hasUnsavedChanges: !1,
2734
+ activeFormats: []
2735
+ }, As = (e) => ({
2736
+ wordCount: e.trim() ? e.trim().split(/\s+/).length : 0,
2737
+ characterCount: e.length
2738
+ }), Bt = vn()(
2739
+ kn(
2740
+ (e, t) => ({
2741
+ ..._t,
2742
+ updateContent: (n) => {
2743
+ const r = As(n);
2744
+ e({
2745
+ content: n,
2746
+ ...r,
2747
+ hasUnsavedChanges: !0
2748
+ });
2749
+ },
2750
+ updateTitle: (n) => {
2751
+ e({
2752
+ title: n,
2753
+ hasUnsavedChanges: !0
2754
+ });
2755
+ },
2756
+ setActiveFormats: (n) => {
2757
+ e({ activeFormats: n });
2758
+ },
2759
+ clearEditor: () => {
2760
+ e({
2761
+ ..._t,
2762
+ content: "",
2763
+ title: "Untitled Document"
2764
+ });
2765
+ },
2766
+ setHasUnsavedChanges: (n) => {
2767
+ e({ hasUnsavedChanges: n });
2768
+ },
2769
+ executeCommand: (n, r) => {
2770
+ document.execCommand(n, !1, r);
2771
+ const o = document.querySelector('[contenteditable="true"]');
2772
+ o && o.focus(), setTimeout(() => {
2773
+ t().updateActiveFormats();
2774
+ }, 10);
2775
+ },
2776
+ updateActiveFormats: () => {
2777
+ const n = [
2778
+ "bold",
2779
+ "italic",
2780
+ "underline",
2781
+ "strikeThrough",
2782
+ "justifyLeft",
2783
+ "justifyCenter",
2784
+ "justifyRight"
2785
+ ], r = [];
2786
+ n.forEach((o) => {
2787
+ document.queryCommandState(o) && r.push(o);
2788
+ }), e({ activeFormats: r });
2789
+ },
2790
+ getValidationResult: () => {
2791
+ const n = t();
2792
+ try {
2793
+ return { success: !0, data: Wt.parse({
2794
+ title: n.title,
2795
+ content: n.content,
2796
+ metadata: {
2797
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
2798
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2799
+ wordCount: n.wordCount,
2800
+ characterCount: n.characterCount
2801
+ }
2802
+ }) };
2803
+ } catch (r) {
2804
+ return { success: !1, error: r instanceof Error ? r.message : "Validation failed" };
2805
+ }
2806
+ },
2807
+ exportToHTML: (n = { includeStyles: !0, includeMeta: !0 }) => {
2808
+ const o = t().getValidationResult();
2809
+ if (!o.success)
2810
+ throw new Error(o.error);
2811
+ const { data: i } = o;
2812
+ let s = `<!DOCTYPE html>
2813
+ <html>
2814
+ <head>
2815
+ <meta charset="UTF-8">
2816
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
2817
+ <title>${i?.title}</title>`;
2818
+ return n.includeStyles && (s += `
2819
+ <style>
2820
+ body {
2821
+ font-family: Arial, sans-serif;
2822
+ line-height: 1.6;
2823
+ margin: 40px;
2824
+ max-width: 800px;
2825
+ }
2826
+ .editor-content {
2827
+ border: 1px solid #ddd;
2828
+ padding: 20px;
2829
+ border-radius: 8px;
2830
+ background: white;
2831
+ }
2832
+ </style>`), s += `
2833
+ </head>
2834
+ <body>`, n.includeMeta && (s += `
2835
+ <div class="document-meta">
2836
+ <h1>${i?.title}</h1>
2837
+ <p><small>Created: ${new Date(i?.metadata.createdAt ?? "").toLocaleString()} |
2838
+ Words: ${i?.metadata.wordCount} |
2839
+ Characters: ${i?.metadata.characterCount}</small></p>
2840
+ <hr>
2841
+ </div>`), s += `
2842
+ <div class="editor-content">
2843
+ ${i?.content}
2844
+ </div>
2845
+ </body>
2846
+ </html>`, s;
2847
+ }
2848
+ }),
2849
+ {
2850
+ name: "editor-storage",
2851
+ partialize: (e) => ({
2852
+ content: e.content,
2853
+ title: e.title,
2854
+ wordCount: e.wordCount,
2855
+ characterCount: e.characterCount
2856
+ })
2857
+ }
2858
+ )
2859
+ ), Cs = ({
2860
+ onSave: e,
2861
+ onExport: t,
2862
+ onClear: n,
2863
+ showButtons: r = !1
2864
+ }) => {
2865
+ const {
2866
+ activeFormats: o,
2867
+ hasUnsavedChanges: i,
2868
+ executeCommand: s,
2869
+ updateActiveFormats: c
2870
+ } = Bt();
2871
+ Ie(() => {
2872
+ const h = () => {
2873
+ c();
2874
+ };
2875
+ return document.addEventListener("selectionchange", h), () => document.removeEventListener("selectionchange", h);
2876
+ }, [c]);
2877
+ const d = () => {
2878
+ const h = prompt("Enter URL:");
2879
+ h && s("createLink", h);
2880
+ }, l = (h) => {
2881
+ s("formatBlock", h);
2882
+ }, f = [
2883
+ {
2884
+ id: "bold",
2885
+ command: "bold",
2886
+ icon: /* @__PURE__ */ _.jsx(Xt, { size: 18 }),
2887
+ title: "Bold",
2888
+ onClick: () => s("bold")
2889
+ },
2890
+ {
2891
+ id: "italic",
2892
+ command: "italic",
2893
+ icon: /* @__PURE__ */ _.jsx(Kt, { size: 18 }),
2894
+ title: "Italic",
2895
+ onClick: () => s("italic")
2896
+ },
2897
+ {
2898
+ id: "underline",
2899
+ command: "underline",
2900
+ icon: /* @__PURE__ */ _.jsx(Qt, { size: 18 }),
2901
+ title: "Underline",
2902
+ onClick: () => s("underline")
2903
+ },
2904
+ {
2905
+ id: "strikeThrough",
2906
+ command: "strikeThrough",
2907
+ icon: /* @__PURE__ */ _.jsx(en, { size: 18 }),
2908
+ title: "Strikethrough",
2909
+ onClick: () => s("strikeThrough")
2910
+ },
2911
+ { id: "separator-1", separator: !0 },
2912
+ {
2913
+ id: "unordered-list",
2914
+ command: "insertUnorderedList",
2915
+ icon: /* @__PURE__ */ _.jsx(tn, { size: 18 }),
2916
+ title: "Bullet List",
2917
+ onClick: () => s("insertUnorderedList")
2918
+ },
2919
+ {
2920
+ id: "ordered-list",
2921
+ command: "insertOrderedList",
2922
+ icon: /* @__PURE__ */ _.jsx(nn, { size: 18 }),
2923
+ title: "Numbered List",
2924
+ onClick: () => s("insertOrderedList")
2925
+ },
2926
+ { id: "separator-2", separator: !0 },
2927
+ {
2928
+ id: "heading-1",
2929
+ command: "formatBlock",
2930
+ value: "h1",
2931
+ icon: /* @__PURE__ */ _.jsx(rn, { size: 18 }),
2932
+ title: "Heading 1",
2933
+ onClick: () => l("<h1>")
2934
+ },
2935
+ {
2936
+ id: "heading-2",
2937
+ command: "formatBlock",
2938
+ value: "h2",
2939
+ icon: /* @__PURE__ */ _.jsx(on, { size: 18 }),
2940
+ title: "Heading 2",
2941
+ onClick: () => l("<h2>")
2942
+ },
2943
+ {
2944
+ id: "paragraph",
2945
+ command: "formatBlock",
2946
+ value: "p",
2947
+ icon: /* @__PURE__ */ _.jsx(sn, { size: 18 }),
2948
+ title: "Paragraph",
2949
+ onClick: () => l("<p>")
2950
+ },
2951
+ { id: "separator-3", separator: !0 },
2952
+ {
2953
+ id: "align-left",
2954
+ command: "justifyLeft",
2955
+ icon: /* @__PURE__ */ _.jsx(cn, { size: 18 }),
2956
+ title: "Align Left",
2957
+ onClick: () => s("justifyLeft")
2958
+ },
2959
+ {
2960
+ id: "align-center",
2961
+ command: "justifyCenter",
2962
+ icon: /* @__PURE__ */ _.jsx(an, { size: 18 }),
2963
+ title: "Center",
2964
+ onClick: () => s("justifyCenter")
2965
+ },
2966
+ {
2967
+ id: "align-right",
2968
+ command: "justifyRight",
2969
+ icon: /* @__PURE__ */ _.jsx(un, { size: 18 }),
2970
+ title: "Align Right",
2971
+ onClick: () => s("justifyRight")
2972
+ },
2973
+ { id: "separator-4", separator: !0 },
2974
+ {
2975
+ id: "link",
2976
+ command: "createLink",
2977
+ icon: /* @__PURE__ */ _.jsx(ln, { size: 18 }),
2978
+ title: "Insert Link",
2979
+ onClick: d
2980
+ }
2981
+ ];
2982
+ return /* @__PURE__ */ _.jsxs("div", { className: "flex flex-wrap justify-between items-center p-3 bg-gray-50 border-b border-gray-200", children: [
2983
+ /* @__PURE__ */ _.jsx("div", { className: "flex flex-wrap items-center gap-1", children: f.map((h) => {
2984
+ if ("separator" in h)
2985
+ return /* @__PURE__ */ _.jsx("div", { className: "w-px h-6 bg-gray-300 mx-2" }, h.id);
2986
+ const p = o.includes(h.command);
2987
+ return /* @__PURE__ */ _.jsx(
2988
+ "button",
2989
+ {
2990
+ onClick: h.onClick,
2991
+ title: h.title,
2992
+ type: "button",
2993
+ className: `w-9 h-9 flex items-center justify-center rounded-md border transition-colors duration-200
2994
+ ${p ? "bg-blue-100 text-blue-600 border-blue-300 hover:bg-blue-200" : "bg-white border-gray-300 text-gray-700 hover:bg-gray-100"}`,
2995
+ children: h.icon
2996
+ },
2997
+ h.id
2998
+ );
2999
+ }) }),
3000
+ r && /* @__PURE__ */ _.jsxs("div", { className: "flex items-center gap-2 mt-2 sm:mt-0", children: [
3001
+ /* @__PURE__ */ _.jsxs(
3002
+ "button",
3003
+ {
3004
+ onClick: e,
3005
+ disabled: !i,
3006
+ title: "Save Document",
3007
+ className: "flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed transition-colors duration-200",
3008
+ children: [
3009
+ /* @__PURE__ */ _.jsx(Jt, { size: 16 }),
3010
+ /* @__PURE__ */ _.jsx("span", { children: "Save" })
3011
+ ]
3012
+ }
3013
+ ),
3014
+ /* @__PURE__ */ _.jsxs(
3015
+ "button",
3016
+ {
3017
+ onClick: t,
3018
+ title: "Export as HTML",
3019
+ className: "flex items-center gap-2 px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 transition-colors duration-200",
3020
+ children: [
3021
+ /* @__PURE__ */ _.jsx(Gt, { size: 16 }),
3022
+ /* @__PURE__ */ _.jsx("span", { children: "Export" })
3023
+ ]
3024
+ }
3025
+ ),
3026
+ /* @__PURE__ */ _.jsxs(
3027
+ "button",
3028
+ {
3029
+ onClick: n,
3030
+ title: "Clear Editor",
3031
+ className: "flex items-center gap-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 transition-colors duration-200",
3032
+ children: [
3033
+ /* @__PURE__ */ _.jsx(qt, { size: 16 }),
3034
+ /* @__PURE__ */ _.jsx("span", { children: "Clear" })
3035
+ ]
3036
+ }
3037
+ )
3038
+ ] })
3039
+ ] });
3040
+ }, Os = ({
3041
+ wordCount: e,
3042
+ characterCount: t,
3043
+ hasUnsavedChanges: n
3044
+ }) => /* @__PURE__ */ _.jsx("div", { className: "flex justify-between items-center px-5 py-3 bg-gray-50 border-t border-gray-200 text-sm text-gray-600", children: /* @__PURE__ */ _.jsxs("div", { className: "flex items-center gap-6", children: [
3045
+ /* @__PURE__ */ _.jsxs("div", { children: [
3046
+ "Words: ",
3047
+ /* @__PURE__ */ _.jsx("strong", { className: "text-gray-800", children: e })
3048
+ ] }),
3049
+ /* @__PURE__ */ _.jsxs("div", { children: [
3050
+ "Characters: ",
3051
+ /* @__PURE__ */ _.jsx("strong", { className: "text-gray-800", children: t })
3052
+ ] }),
3053
+ /* @__PURE__ */ _.jsxs("div", { children: [
3054
+ "Status: ",
3055
+ /* @__PURE__ */ _.jsx("strong", { className: n ? "text-orange-600" : "text-green-600", children: n ? "Unsaved Changes" : "Saved" })
3056
+ ] })
3057
+ ] }) }), Ns = ({
3058
+ initialContent: e = "",
3059
+ onSave: t,
3060
+ onExport: n,
3061
+ onChange: r,
3062
+ // Add onChange prop
3063
+ showButtons: o = !1,
3064
+ // Add option to hide toolbar
3065
+ showSaveTitle: i = !1,
3066
+ // Add option to hide title section
3067
+ showStatusBar: s = !1
3068
+ // Add option to hide status bar
3069
+ }) => {
3070
+ const c = vt(null), [d, l] = bt(!1), {
3071
+ content: f,
3072
+ title: h,
3073
+ wordCount: p,
3074
+ characterCount: g,
3075
+ hasUnsavedChanges: T,
3076
+ updateContent: b,
3077
+ updateTitle: C,
3078
+ getValidationResult: N,
3079
+ exportToHTML: k,
3080
+ clearEditor: $,
3081
+ setHasUnsavedChanges: z
3082
+ } = Bt();
3083
+ Ie(() => {
3084
+ c.current && e && e !== f && (c.current.innerHTML = e, b(e), z(!1));
3085
+ }, [e, f, b, z]);
3086
+ const P = F(
3087
+ (E) => {
3088
+ if (b(E), z(!0), r) {
3089
+ const D = k();
3090
+ r(E, D);
3091
+ }
3092
+ },
3093
+ [b, z, r, k]
3094
+ ), _e = F(
3095
+ (E) => {
3096
+ if (C(E), z(!0), r) {
3097
+ const D = k();
3098
+ r(f, D, E);
3099
+ }
3100
+ },
3101
+ [C, z, r, k, f]
3102
+ ), ve = () => {
3103
+ if (N().success) {
3104
+ const D = k();
3105
+ t?.(f, D), z(!1);
3106
+ } else
3107
+ l(!0), setTimeout(() => l(!1), 3e3);
3108
+ }, be = () => {
3109
+ try {
3110
+ const E = k();
3111
+ n?.(E);
3112
+ const D = new Blob([E], { type: "text/html" }), Y = URL.createObjectURL(D), U = document.createElement("a");
3113
+ U.href = Y, U.download = `${h.replace(/\s+/g, "_")}.html`, document.body.appendChild(U), U.click(), document.body.removeChild(U), URL.revokeObjectURL(Y);
3114
+ } catch (E) {
3115
+ alert(
3116
+ "Export failed: " + (E instanceof Error ? E.message : "Unknown error")
3117
+ );
3118
+ }
3119
+ }, q = () => {
3120
+ confirm(
3121
+ "Are you sure you want to clear the editor? All unsaved changes will be lost."
3122
+ ) && ($(), c.current && (c.current.innerHTML = ""), r && r("", ""));
3123
+ };
3124
+ return /* @__PURE__ */ _.jsxs("div", { className: "w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden", children: [
3125
+ i && /* @__PURE__ */ _.jsxs("div", { className: "p-6 border-b border-gray-200 bg-gray-50 rounded-t-xl", children: [
3126
+ /* @__PURE__ */ _.jsx(
3127
+ "input",
3128
+ {
3129
+ type: "text",
3130
+ className: "w-full bg-transparent text-2xl font-bold text-gray-800 placeholder-gray-500 outline-none border-none focus:ring-0",
3131
+ value: h,
3132
+ onChange: (E) => _e(E.target.value),
3133
+ placeholder: "Document Title"
3134
+ }
3135
+ ),
3136
+ d && /* @__PURE__ */ _.jsx("div", { className: "mt-2 px-3 py-2 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm animate-pulse", children: "Please add content before saving" })
3137
+ ] }),
3138
+ /* @__PURE__ */ _.jsx(
3139
+ Cs,
3140
+ {
3141
+ onSave: ve,
3142
+ onExport: be,
3143
+ onClear: q,
3144
+ showButtons: o
3145
+ }
3146
+ ),
3147
+ /* @__PURE__ */ _.jsx(
3148
+ "div",
3149
+ {
3150
+ ref: c,
3151
+ className: `min-h-[500px] p-8 prose max-w-none border-none outline-none resize-none text-gray-700 leading-relaxed bg-white focus:bg-gray-50 transition-colors duration-200 ${i ? "rounded-t-xl" : ""} ${o ? "border-t-0" : ""}`,
3152
+ contentEditable: !0,
3153
+ onInput: (E) => P(E.currentTarget.innerHTML),
3154
+ onFocus: (E) => E.currentTarget.classList.add("bg-gray-50"),
3155
+ onBlur: (E) => E.currentTarget.classList.remove("bg-gray-50")
3156
+ }
3157
+ ),
3158
+ s && /* @__PURE__ */ _.jsx(
3159
+ Os,
3160
+ {
3161
+ wordCount: p,
3162
+ characterCount: g,
3163
+ hasUnsavedChanges: T
3164
+ }
3165
+ )
3166
+ ] });
3167
+ }, Ds = (e = "") => {
3168
+ const [t, n] = bt({
2692
3169
  content: e,
2693
3170
  title: "Untitled Document",
2694
3171
  wordCount: e.trim() ? e.trim().split(/\s+/).length : 0,
2695
3172
  characterCount: e.length,
2696
3173
  hasUnsavedChanges: !1
2697
- }), r = Mt(null);
2698
- ut(() => {
2699
- r.current && e !== t.content && (r.current.innerHTML = e, n((l) => ({
2700
- ...l,
3174
+ }), r = vt(null);
3175
+ Ie(() => {
3176
+ r.current && e !== t.content && (r.current.innerHTML = e, n((f) => ({
3177
+ ...f,
2701
3178
  content: e,
2702
3179
  wordCount: e.trim() ? e.trim().split(/\s+/).length : 0,
2703
3180
  characterCount: e.length
2704
3181
  })));
2705
3182
  }, [e]);
2706
- const o = V((l) => {
2707
- const g = l.trim() ? l.trim().split(/\s+/).length : 0, p = l.length;
2708
- n((v) => ({
2709
- ...v,
2710
- content: l,
2711
- wordCount: g,
3183
+ const o = F((f) => {
3184
+ const h = f.trim() ? f.trim().split(/\s+/).length : 0, p = f.length;
3185
+ n((g) => ({
3186
+ ...g,
3187
+ content: f,
3188
+ wordCount: h,
2712
3189
  characterCount: p,
2713
3190
  hasUnsavedChanges: !0
2714
3191
  }));
2715
- }, []), i = V((l) => {
2716
- n((g) => ({
2717
- ...g,
2718
- title: l,
3192
+ }, []), i = F((f) => {
3193
+ n((h) => ({
3194
+ ...h,
3195
+ title: f,
2719
3196
  hasUnsavedChanges: !0
2720
3197
  }));
2721
- }, []), c = V((l, g) => {
2722
- document.execCommand(l, !1, g), r.current?.focus();
2723
- }, []), a = V(() => {
3198
+ }, []), s = F((f, h) => {
3199
+ document.execCommand(f, !1, h), r.current?.focus();
3200
+ }, []), c = F(() => {
2724
3201
  try {
2725
- return { success: !0, data: kc.parse({
3202
+ return { success: !0, data: Wt.parse({
2726
3203
  title: t.title,
2727
3204
  content: t.content,
2728
3205
  metadata: {
@@ -2732,22 +3209,22 @@ const zc = (e = "") => {
2732
3209
  characterCount: t.characterCount
2733
3210
  }
2734
3211
  }) };
2735
- } catch (l) {
2736
- return { success: !1, error: l instanceof Error ? l.message : "Validation failed" };
3212
+ } catch (f) {
3213
+ return { success: !1, error: f instanceof Error ? f.message : "Validation failed" };
2737
3214
  }
2738
- }, [t]), f = V(
2739
- (l = { includeStyles: !0, includeMeta: !0 }) => {
2740
- const g = a();
2741
- if (!g.success)
2742
- throw new Error(g.error);
2743
- const { data: p } = g;
2744
- let v = `<!DOCTYPE html>
3215
+ }, [t]), d = F(
3216
+ (f = { includeStyles: !0, includeMeta: !0 }) => {
3217
+ const h = c();
3218
+ if (!h.success)
3219
+ throw new Error(h.error);
3220
+ const { data: p } = h;
3221
+ let g = `<!DOCTYPE html>
2745
3222
  <html>
2746
3223
  <head>
2747
3224
  <meta charset="UTF-8">
2748
3225
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
2749
3226
  <title>${p?.title}</title>`;
2750
- return l.includeStyles && (v += `
3227
+ return f.includeStyles && (g += `
2751
3228
  <style>
2752
3229
  body {
2753
3230
  font-family: Arial, sans-serif;
@@ -2761,24 +3238,24 @@ const zc = (e = "") => {
2761
3238
  border-radius: 8px;
2762
3239
  background: white;
2763
3240
  }
2764
- </style>`), v += `
3241
+ </style>`), g += `
2765
3242
  </head>
2766
- <body>`, l.includeMeta && (v += `
3243
+ <body>`, f.includeMeta && (g += `
2767
3244
  <div class="document-meta">
2768
3245
  <h1>${p?.title}</h1>
2769
3246
  <p><small>Created: ${new Date(p?.metadata.createdAt ?? "").toLocaleString()} |
2770
3247
  Words: ${p?.metadata.wordCount} |
2771
3248
  Characters: ${p?.metadata.characterCount}</small></p>
2772
3249
  <hr>
2773
- </div>`), v += `
3250
+ </div>`), g += `
2774
3251
  <div class="editor-content">
2775
3252
  ${p?.content}
2776
3253
  </div>
2777
3254
  </body>
2778
- </html>`, v;
3255
+ </html>`, g;
2779
3256
  },
2780
- [a]
2781
- ), d = V(() => {
3257
+ [c]
3258
+ ), l = F(() => {
2782
3259
  n({
2783
3260
  content: "",
2784
3261
  title: "Untitled Document",
@@ -2792,89 +3269,13 @@ const zc = (e = "") => {
2792
3269
  editorRef: r,
2793
3270
  updateContent: o,
2794
3271
  updateTitle: i,
2795
- executeCommand: c,
2796
- getValidationResult: a,
2797
- exportToHTML: f,
2798
- clearEditor: d
2799
- };
2800
- }, Zc = ({
2801
- initialContent: e = "",
2802
- onSave: t,
2803
- onExport: n
2804
- }) => {
2805
- const {
2806
- editorState: r,
2807
- editorRef: o,
2808
- updateContent: i,
2809
- updateTitle: c,
2810
- executeCommand: a,
2811
- getValidationResult: f,
3272
+ executeCommand: s,
3273
+ getValidationResult: c,
2812
3274
  exportToHTML: d,
2813
3275
  clearEditor: l
2814
- } = zc(e), [g, p] = ze(!1), v = () => {
2815
- if (f().success) {
2816
- const P = d();
2817
- t?.(r.content, P);
2818
- } else
2819
- p(!0), setTimeout(() => p(!1), 3e3);
2820
- }, T = () => {
2821
- try {
2822
- const y = d();
2823
- n?.(y);
2824
- const P = new Blob([y], { type: "text/html" }), L = URL.createObjectURL(P), A = document.createElement("a");
2825
- A.href = L, A.download = `${r.title.replace(/\s+/g, "_")}.html`, document.body.appendChild(A), A.click(), document.body.removeChild(A), URL.revokeObjectURL(L);
2826
- } catch (y) {
2827
- alert("Export failed: " + (y instanceof Error ? y.message : "Unknown error"));
2828
- }
2829
- }, R = () => {
2830
- confirm("Are you sure you want to clear the editor? All unsaved changes will be lost.") && l();
2831
3276
  };
2832
- return /* @__PURE__ */ m.jsxs("div", { className: "w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden", children: [
2833
- /* @__PURE__ */ m.jsxs("div", { className: "p-6 border-b border-gray-200 bg-gray-50 rounded-t-xl", children: [
2834
- /* @__PURE__ */ m.jsx(
2835
- "input",
2836
- {
2837
- type: "text",
2838
- className: "w-full bg-transparent text-2xl font-bold text-gray-800 placeholder-gray-500 outline-none border-none focus:ring-0",
2839
- value: r.title,
2840
- onChange: (y) => c(y.target.value),
2841
- placeholder: "Document Title"
2842
- }
2843
- ),
2844
- g && /* @__PURE__ */ m.jsx("div", { className: "mt-2 px-3 py-2 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm animate-pulse", children: "Please add content before saving" })
2845
- ] }),
2846
- /* @__PURE__ */ m.jsx(
2847
- un,
2848
- {
2849
- onCommand: a,
2850
- onSave: v,
2851
- onExport: T,
2852
- onClear: R,
2853
- hasUnsavedChanges: r.hasUnsavedChanges
2854
- }
2855
- ),
2856
- /* @__PURE__ */ m.jsx(
2857
- "div",
2858
- {
2859
- ref: o,
2860
- className: "min-h-[500px] p-8 prose max-w-none border-none outline-none resize-none text-gray-700 leading-relaxed bg-white focus:bg-gray-50 transition-colors duration-200",
2861
- contentEditable: !0,
2862
- onInput: (y) => i(y.currentTarget.innerHTML),
2863
- onFocus: (y) => y.currentTarget.classList.add("bg-gray-50"),
2864
- onBlur: (y) => y.currentTarget.classList.remove("bg-gray-50")
2865
- }
2866
- ),
2867
- /* @__PURE__ */ m.jsx(
2868
- ln,
2869
- {
2870
- wordCount: r.wordCount,
2871
- characterCount: r.characterCount,
2872
- hasUnsavedChanges: r.hasUnsavedChanges
2873
- }
2874
- )
2875
- ] });
2876
3277
  };
2877
3278
  export {
2878
- Zc as TextEditor,
2879
- zc as useTextEditor
3279
+ Ns as TextEditor,
3280
+ Ds as useTextEditor
2880
3281
  };