@abduljebar/text-editor 1.1.2 → 1.2.0

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