@tasktimepro/agent-bridge 0.1.1 → 0.1.2

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.
@@ -1,27 +1,28 @@
1
1
  #!/usr/bin/env node
2
- import { pathToFileURL as Jn } from "node:url";
3
- import { randomUUID as Ce, randomBytes as Vn, createHmac as Wn, randomInt as Kn, createHash as Jt } from "node:crypto";
2
+ import { realpathSync as ct } from "node:fs";
3
+ import { fileURLToPath as Vn, pathToFileURL as Wn } from "node:url";
4
+ import { randomUUID as Ce, randomBytes as Kn, createHmac as Hn, randomInt as Xn, createHash as Vt } from "node:crypto";
4
5
  import { Buffer as H } from "node:buffer";
5
- import { createServer as Hn } from "node:http";
6
+ import { createServer as Yn } from "node:http";
6
7
  class D extends Error {
7
8
  constructor(t, n, r) {
8
9
  super(n), this.name = "AgentCommandError", this.code = t, this.details = r;
9
10
  }
10
11
  }
11
- const Xn = 500;
12
- function Yn(e) {
12
+ const Qn = 500;
13
+ function er(e) {
13
14
  return e.startsWith("export_") || e === "create_drive_backup" || e === "download_drive_backup_json" ? "export" : e.startsWith("open_") || e.startsWith("focus_") ? "navigation" : e.includes("invoice") || e.includes("billed") || e.includes("billing") ? e.includes("email") ? "email" : "billing" : e.startsWith("list_") || e.startsWith("get_") || e.startsWith("find_") || e.startsWith("preview_") ? "read" : e.startsWith("create_") || e.startsWith("update_") || e.startsWith("complete_") || e.startsWith("archive_") || e.startsWith("unarchive_") || e.startsWith("start_") || e.startsWith("pause_") || e.startsWith("stop_") || e.startsWith("add_") || e.startsWith("mark_") || e.startsWith("finalize_") || e.startsWith("restore_") || e.startsWith("delete_") ? "write" : "unknown";
14
15
  }
15
- class Vt {
16
+ class Wt {
16
17
  constructor(t = {}) {
17
- this.events = [], this.nextId = 0, this.maxEvents = t.maxEvents ?? Xn, this.now = t.now ?? Date.now, this.idFactory = t.idFactory ?? (() => `bridge-audit-${this.nextId++}`);
18
+ this.events = [], this.nextId = 0, this.maxEvents = t.maxEvents ?? Qn, this.now = t.now ?? Date.now, this.idFactory = t.idFactory ?? (() => `bridge-audit-${this.nextId++}`);
18
19
  }
19
20
  append(t) {
20
21
  const n = {
21
22
  id: this.idFactory(),
22
23
  timestamp: this.now(),
23
24
  action: t.action
24
- }, r = t.commandCategory ?? (t.command ? Yn(t.command) : void 0);
25
+ }, r = t.commandCategory ?? (t.command ? er(t.command) : void 0);
25
26
  for (t.clientId && (n.clientId = t.clientId), t.requestId && (n.requestId = t.requestId), t.command && (n.command = t.command), r && (n.commandCategory = r), typeof t.ok == "boolean" && (n.ok = t.ok), t.errorCode && (n.errorCode = t.errorCode), t.details && (n.details = t.details), this.events.push(n); this.events.length > this.maxEvents; )
26
27
  this.events.shift();
27
28
  return n;
@@ -36,8 +37,8 @@ class Vt {
36
37
  this.events.length = 0;
37
38
  }
38
39
  }
39
- const Qn = "tasktime-hmac-sha256-v1", er = 6e4;
40
- function Wt(e) {
40
+ const tr = "tasktime-hmac-sha256-v1", nr = 6e4;
41
+ function Kt(e) {
41
42
  return [...new Set(e)].sort();
42
43
  }
43
44
  function Ze(e) {
@@ -45,27 +46,27 @@ function Ze(e) {
45
46
  Object.entries(e).filter(([, t]) => t !== void 0 && typeof t != "function" && typeof t != "symbol").sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => [t, Ze(n)])
46
47
  ) : null;
47
48
  }
48
- function tr(e) {
49
+ function rr(e) {
49
50
  return JSON.stringify(Ze({
50
51
  ...e,
51
- scopes: Wt(e.scopes)
52
+ scopes: Kt(e.scopes)
52
53
  }));
53
54
  }
54
- function nr(e) {
55
+ function or(e) {
55
56
  const t = e.replace(/-/g, "+").replace(/_/g, "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
56
57
  return Buffer.from(n, "base64");
57
58
  }
58
- function rr(e, t) {
59
- return Wn("sha256", nr(t)).update(tr(e)).digest("base64url");
59
+ function ir(e, t) {
60
+ return Hn("sha256", or(t)).update(rr(e)).digest("base64url");
60
61
  }
61
- function or(e) {
62
- const t = e.now ? e.now() : Date.now(), n = t + (e.ttlMs ?? er), r = e.nonce ?? (typeof Ce == "function" ? Ce() : Vn(16).toString("base64url")), o = {
63
- format: Qn,
62
+ function ar(e) {
63
+ const t = e.now ? e.now() : Date.now(), n = t + (e.ttlMs ?? nr), r = e.nonce ?? (typeof Ce == "function" ? Ce() : Kn(16).toString("base64url")), o = {
64
+ format: tr,
64
65
  grantId: e.grant.id,
65
66
  command: e.command,
66
67
  inputHash: e.inputHash,
67
68
  category: e.category,
68
- scopes: Wt(e.scopes),
69
+ scopes: Kt(e.scopes),
69
70
  nonce: r,
70
71
  issuedAt: t,
71
72
  expiresAt: n
@@ -73,7 +74,7 @@ function or(e) {
73
74
  return {
74
75
  format: o.format,
75
76
  grantId: o.grantId,
76
- token: rr(o, e.grant.secretKeyBase64Url),
77
+ token: ir(o, e.grant.secretKeyBase64Url),
77
78
  issuedAt: o.issuedAt,
78
79
  expiresAt: o.expiresAt,
79
80
  nonce: o.nonce,
@@ -83,33 +84,33 @@ function or(e) {
83
84
  category: o.category
84
85
  };
85
86
  }
86
- const ir = 300 * 1e3, ar = 6;
87
- function sr(e) {
87
+ const sr = 300 * 1e3, cr = 6;
88
+ function lr(e) {
88
89
  let t = "";
89
90
  for (let n = 0; n < e; n += 1)
90
- t += String(Kn(0, 10));
91
+ t += String(Xn(0, 10));
91
92
  return t;
92
93
  }
93
- function cr(e) {
94
- const t = e.now ? e.now() : Date.now(), n = e.ttlMs ?? ir, r = e.codeLength ?? ar;
94
+ function pr(e) {
95
+ const t = e.now ? e.now() : Date.now(), n = e.ttlMs ?? sr, r = e.codeLength ?? cr;
95
96
  return {
96
97
  id: e.idFactory ? e.idFactory() : Ce(),
97
- code: e.codeFactory ? e.codeFactory(r) : sr(r),
98
+ code: e.codeFactory ? e.codeFactory(r) : lr(r),
98
99
  endpoint: e.endpoint,
99
100
  scopes: [...e.scopes],
100
101
  createdAt: t,
101
102
  expiresAt: t + n
102
103
  };
103
104
  }
104
- function lr(e, t = Date.now()) {
105
+ function ur(e, t = Date.now()) {
105
106
  return t >= e.expiresAt;
106
107
  }
107
- class pr {
108
+ class dr {
108
109
  constructor() {
109
110
  this.challenges = /* @__PURE__ */ new Map();
110
111
  }
111
112
  create(t) {
112
- const n = cr(t);
113
+ const n = pr(t);
113
114
  return this.challenges.set(n.id, n), n;
114
115
  }
115
116
  get(t) {
@@ -119,7 +120,7 @@ class pr {
119
120
  const o = this.challenges.get(t);
120
121
  if (!o)
121
122
  throw new D("NOT_FOUND", "Pairing challenge not found.", { id: t });
122
- if (lr(o, r))
123
+ if (ur(o, r))
123
124
  throw this.challenges.delete(t), new D("PERMISSION_DENIED", "Pairing challenge expired.", { id: t });
124
125
  if (o.code !== n)
125
126
  throw new D("PERMISSION_DENIED", "Pairing code is invalid.", { id: t });
@@ -129,27 +130,27 @@ class pr {
129
130
  this.challenges.delete(t);
130
131
  }
131
132
  }
132
- const ur = 1800 * 1e3, dr = 32;
133
- function mr() {
133
+ const mr = 1800 * 1e3, fr = 32;
134
+ function hr() {
134
135
  if (!globalThis.crypto?.getRandomValues)
135
136
  throw new Error("Secure random token generation is unavailable.");
136
137
  return globalThis.crypto;
137
138
  }
138
- function fr(e = dr) {
139
+ function gr(e = fr) {
139
140
  const t = new Uint8Array(e);
140
- return mr().getRandomValues(t), Array.from(t).map((n) => n.toString(16).padStart(2, "0")).join("");
141
+ return hr().getRandomValues(t), Array.from(t).map((n) => n.toString(16).padStart(2, "0")).join("");
141
142
  }
142
- function hr(e) {
143
- const t = e.now ? e.now() : Date.now(), n = e.ttlMs ?? ur;
143
+ function yr(e) {
144
+ const t = e.now ? e.now() : Date.now(), n = e.ttlMs ?? mr;
144
145
  return {
145
- sessionToken: e.tokenFactory ? e.tokenFactory(e.tokenBytes) : fr(e.tokenBytes),
146
+ sessionToken: e.tokenFactory ? e.tokenFactory(e.tokenBytes) : gr(e.tokenBytes),
146
147
  scopes: new Set(e.scopes),
147
148
  createdAt: t,
148
149
  expiresAt: t + n
149
150
  };
150
151
  }
151
- const gr = "1.4";
152
- Array.from(/* @__PURE__ */ new Set(["1.0", "1.1", "1.3", gr]));
152
+ const _r = "1.4";
153
+ Array.from(/* @__PURE__ */ new Set(["1.0", "1.1", "1.3", _r]));
153
154
  function u(e, t, n) {
154
155
  function r(c, l) {
155
156
  if (c._zod || Object.defineProperty(c, "_zod", {
@@ -189,7 +190,7 @@ class ie extends Error {
189
190
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
190
191
  }
191
192
  }
192
- class Kt extends Error {
193
+ class Ht extends Error {
193
194
  constructor(t) {
194
195
  super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
195
196
  }
@@ -198,7 +199,7 @@ const Me = {};
198
199
  function K(e) {
199
200
  return e && Object.assign(Me, e), Me;
200
201
  }
201
- function Ht(e) {
202
+ function Xt(e) {
202
203
  const t = Object.values(e).filter((r) => typeof r == "number");
203
204
  return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
204
205
  }
@@ -222,7 +223,7 @@ function tt(e) {
222
223
  const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
223
224
  return e.slice(t, n);
224
225
  }
225
- function yr(e, t) {
226
+ function br(e, t) {
226
227
  const n = (e.toString().split(".")[1] || "").length, r = t.toString();
227
228
  let o = (r.split(".")[1] || "").length;
228
229
  if (o === 0 && /\d?e-\d?/.test(r)) {
@@ -232,13 +233,13 @@ function yr(e, t) {
232
233
  const a = n > o ? n : o, i = Number.parseInt(e.toFixed(a).replace(".", "")), c = Number.parseInt(t.toFixed(a).replace(".", ""));
233
234
  return i % c / 10 ** a;
234
235
  }
235
- const ct = /* @__PURE__ */ Symbol("evaluating");
236
+ const lt = /* @__PURE__ */ Symbol("evaluating");
236
237
  function T(e, t, n) {
237
238
  let r;
238
239
  Object.defineProperty(e, t, {
239
240
  get() {
240
- if (r !== ct)
241
- return r === void 0 && (r = ct, r = n()), r;
241
+ if (r !== lt)
242
+ return r === void 0 && (r = lt, r = n()), r;
242
243
  },
243
244
  set(o) {
244
245
  Object.defineProperty(e, t, {
@@ -265,18 +266,18 @@ function ee(...e) {
265
266
  }
266
267
  return Object.defineProperties({}, t);
267
268
  }
268
- function lt(e) {
269
+ function pt(e) {
269
270
  return JSON.stringify(e);
270
271
  }
271
- function _r(e) {
272
+ function vr(e) {
272
273
  return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
273
274
  }
274
- const Xt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
275
+ const Yt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
275
276
  };
276
277
  function _e(e) {
277
278
  return typeof e == "object" && e !== null && !Array.isArray(e);
278
279
  }
279
- const br = Qe(() => {
280
+ const wr = Qe(() => {
280
281
  if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
281
282
  return !1;
282
283
  try {
@@ -295,10 +296,10 @@ function se(e) {
295
296
  const n = t.prototype;
296
297
  return !(_e(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
297
298
  }
298
- function Yt(e) {
299
+ function Qt(e) {
299
300
  return se(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
300
301
  }
301
- const vr = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
302
+ const kr = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
302
303
  function ce(e) {
303
304
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
304
305
  }
@@ -319,17 +320,17 @@ function _(e) {
319
320
  }
320
321
  return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
321
322
  }
322
- function wr(e) {
323
+ function Ir(e) {
323
324
  return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
324
325
  }
325
- const kr = {
326
+ const Tr = {
326
327
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
327
328
  int32: [-2147483648, 2147483647],
328
329
  uint32: [0, 4294967295],
329
330
  float32: [-34028234663852886e22, 34028234663852886e22],
330
331
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
331
332
  };
332
- function Ir(e, t) {
333
+ function Sr(e, t) {
333
334
  const n = e._zod.def, r = n.checks;
334
335
  if (r && r.length > 0)
335
336
  throw new Error(".pick() cannot be used on object schemas containing refinements");
@@ -347,7 +348,7 @@ function Ir(e, t) {
347
348
  });
348
349
  return te(e, a);
349
350
  }
350
- function Tr(e, t) {
351
+ function Pr(e, t) {
351
352
  const n = e._zod.def, r = n.checks;
352
353
  if (r && r.length > 0)
353
354
  throw new Error(".omit() cannot be used on object schemas containing refinements");
@@ -365,7 +366,7 @@ function Tr(e, t) {
365
366
  });
366
367
  return te(e, a);
367
368
  }
368
- function Sr(e, t) {
369
+ function Ar(e, t) {
369
370
  if (!se(t))
370
371
  throw new Error("Invalid input to extend: expected a plain object");
371
372
  const n = e._zod.def.checks;
@@ -383,7 +384,7 @@ function Sr(e, t) {
383
384
  });
384
385
  return te(e, o);
385
386
  }
386
- function Pr(e, t) {
387
+ function xr(e, t) {
387
388
  if (!se(t))
388
389
  throw new Error("Invalid input to safeExtend: expected a plain object");
389
390
  const n = ee(e._zod.def, {
@@ -394,7 +395,7 @@ function Pr(e, t) {
394
395
  });
395
396
  return te(e, n);
396
397
  }
397
- function Ar(e, t) {
398
+ function jr(e, t) {
398
399
  const n = ee(e._zod.def, {
399
400
  get shape() {
400
401
  const r = { ...e._zod.def.shape, ...t._zod.def.shape };
@@ -408,7 +409,7 @@ function Ar(e, t) {
408
409
  });
409
410
  return te(e, n);
410
411
  }
411
- function xr(e, t, n) {
412
+ function Er(e, t, n) {
412
413
  const o = t._zod.def.checks;
413
414
  if (o && o.length > 0)
414
415
  throw new Error(".partial() cannot be used on object schemas containing refinements");
@@ -436,7 +437,7 @@ function xr(e, t, n) {
436
437
  });
437
438
  return te(t, i);
438
439
  }
439
- function jr(e, t, n) {
440
+ function zr(e, t, n) {
440
441
  const r = ee(t._zod.def, {
441
442
  get shape() {
442
443
  const o = t._zod.def.shape, a = { ...o };
@@ -497,7 +498,7 @@ function me(...e) {
497
498
  inst: r
498
499
  } : { ...t };
499
500
  }
500
- const Qt = (e, t) => {
501
+ const en = (e, t) => {
501
502
  e.name = "$ZodError", Object.defineProperty(e, "_zod", {
502
503
  value: e._zod,
503
504
  enumerable: !1
@@ -508,14 +509,14 @@ const Qt = (e, t) => {
508
509
  value: () => e.message,
509
510
  enumerable: !1
510
511
  });
511
- }, en = u("$ZodError", Qt), tn = u("$ZodError", Qt, { Parent: Error });
512
- function Er(e, t = (n) => n.message) {
512
+ }, tn = u("$ZodError", en), nn = u("$ZodError", en, { Parent: Error });
513
+ function Or(e, t = (n) => n.message) {
513
514
  const n = {}, r = [];
514
515
  for (const o of e.issues)
515
516
  o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
516
517
  return { formErrors: r, fieldErrors: n };
517
518
  }
518
- function zr(e, t = (n) => n.message) {
519
+ function Dr(e, t = (n) => n.message) {
519
520
  const n = { _errors: [] }, r = (o) => {
520
521
  for (const a of o.issues)
521
522
  if (a.code === "invalid_union" && a.errors.length)
@@ -542,7 +543,7 @@ const rt = (e) => (t, n, r, o) => {
542
543
  throw new ie();
543
544
  if (i.issues.length) {
544
545
  const c = new (o?.Err ?? e)(i.issues.map((l) => X(l, a, K())));
545
- throw Xt(c, o?.callee), c;
546
+ throw Yt(c, o?.callee), c;
546
547
  }
547
548
  return i.value;
548
549
  }, ot = (e) => async (t, n, r, o) => {
@@ -550,7 +551,7 @@ const rt = (e) => (t, n, r, o) => {
550
551
  let i = t._zod.run({ value: n, issues: [] }, a);
551
552
  if (i instanceof Promise && (i = await i), i.issues.length) {
552
553
  const c = new (o?.Err ?? e)(i.issues.map((l) => X(l, a, K())));
553
- throw Xt(c, o?.callee), c;
554
+ throw Yt(c, o?.callee), c;
554
555
  }
555
556
  return i.value;
556
557
  }, xe = (e) => (t, n, r) => {
@@ -559,58 +560,58 @@ const rt = (e) => (t, n, r, o) => {
559
560
  throw new ie();
560
561
  return a.issues.length ? {
561
562
  success: !1,
562
- error: new (e ?? en)(a.issues.map((i) => X(i, o, K())))
563
+ error: new (e ?? tn)(a.issues.map((i) => X(i, o, K())))
563
564
  } : { success: !0, data: a.value };
564
- }, Or = /* @__PURE__ */ xe(tn), je = (e) => async (t, n, r) => {
565
+ }, Nr = /* @__PURE__ */ xe(nn), je = (e) => async (t, n, r) => {
565
566
  const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
566
567
  let a = t._zod.run({ value: n, issues: [] }, o);
567
568
  return a instanceof Promise && (a = await a), a.issues.length ? {
568
569
  success: !1,
569
570
  error: new e(a.issues.map((i) => X(i, o, K())))
570
571
  } : { success: !0, data: a.value };
571
- }, Dr = /* @__PURE__ */ je(tn), Nr = (e) => (t, n, r) => {
572
+ }, $r = /* @__PURE__ */ je(nn), Rr = (e) => (t, n, r) => {
572
573
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
573
574
  return rt(e)(t, n, o);
574
- }, $r = (e) => (t, n, r) => rt(e)(t, n, r), Rr = (e) => async (t, n, r) => {
575
+ }, Cr = (e) => (t, n, r) => rt(e)(t, n, r), Zr = (e) => async (t, n, r) => {
575
576
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
576
577
  return ot(e)(t, n, o);
577
- }, Cr = (e) => async (t, n, r) => ot(e)(t, n, r), Zr = (e) => (t, n, r) => {
578
+ }, Mr = (e) => async (t, n, r) => ot(e)(t, n, r), Lr = (e) => (t, n, r) => {
578
579
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
579
580
  return xe(e)(t, n, o);
580
- }, Mr = (e) => (t, n, r) => xe(e)(t, n, r), Lr = (e) => async (t, n, r) => {
581
+ }, qr = (e) => (t, n, r) => xe(e)(t, n, r), Ur = (e) => async (t, n, r) => {
581
582
  const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
582
583
  return je(e)(t, n, o);
583
- }, qr = (e) => async (t, n, r) => je(e)(t, n, r), Ur = /^[cC][^\s-]{8,}$/, Br = /^[0-9a-z]+$/, Fr = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Gr = /^[0-9a-vA-V]{20}$/, Jr = /^[A-Za-z0-9]{27}$/, Vr = /^[a-zA-Z0-9_-]{21}$/, Wr = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Kr = /^([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})$/, pt = (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)$/, Hr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Xr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
584
- function Yr() {
585
- return new RegExp(Xr, "u");
584
+ }, Br = (e) => async (t, n, r) => je(e)(t, n, r), Fr = /^[cC][^\s-]{8,}$/, Gr = /^[0-9a-z]+$/, Jr = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Vr = /^[0-9a-vA-V]{20}$/, Wr = /^[A-Za-z0-9]{27}$/, Kr = /^[a-zA-Z0-9_-]{21}$/, Hr = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Xr = /^([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})$/, ut = (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)$/, Yr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Qr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
585
+ function eo() {
586
+ return new RegExp(Qr, "u");
586
587
  }
587
- const Qr = /^(?:(?: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])$/, eo = /^(([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}|:))$/, to = /^((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])$/, no = /^(([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])$/, ro = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, nn = /^[A-Za-z0-9_-]*$/, oo = /^\+[1-9]\d{6,14}$/, rn = "(?:(?:\\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])))", io = /* @__PURE__ */ new RegExp(`^${rn}$`);
588
- function on(e) {
588
+ const to = /^(?:(?: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])$/, no = /^(([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}|:))$/, ro = /^((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])$/, oo = /^(([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])$/, io = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, rn = /^[A-Za-z0-9_-]*$/, ao = /^\+[1-9]\d{6,14}$/, on = "(?:(?:\\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])))", so = /* @__PURE__ */ new RegExp(`^${on}$`);
589
+ function an(e) {
589
590
  const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
590
591
  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+)?)?`;
591
592
  }
592
- function ao(e) {
593
- return new RegExp(`^${on(e)}$`);
593
+ function co(e) {
594
+ return new RegExp(`^${an(e)}$`);
594
595
  }
595
- function so(e) {
596
- const t = on({ precision: e.precision }), n = ["Z"];
596
+ function lo(e) {
597
+ const t = an({ precision: e.precision }), n = ["Z"];
597
598
  e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
598
599
  const r = `${t}(?:${n.join("|")})`;
599
- return new RegExp(`^${rn}T(?:${r})$`);
600
+ return new RegExp(`^${on}T(?:${r})$`);
600
601
  }
601
- const co = (e) => {
602
+ const po = (e) => {
602
603
  const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
603
604
  return new RegExp(`^${t}$`);
604
- }, lo = /^-?\d+$/, an = /^-?\d+(?:\.\d+)?$/, po = /^(?:true|false)$/i, uo = /^null$/i, mo = /^[^A-Z]*$/, fo = /^[^a-z]*$/, q = /* @__PURE__ */ u("$ZodCheck", (e, t) => {
605
+ }, uo = /^-?\d+$/, sn = /^-?\d+(?:\.\d+)?$/, mo = /^(?:true|false)$/i, fo = /^null$/i, ho = /^[^A-Z]*$/, go = /^[^a-z]*$/, q = /* @__PURE__ */ u("$ZodCheck", (e, t) => {
605
606
  var n;
606
607
  e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
607
- }), sn = {
608
+ }), cn = {
608
609
  number: "number",
609
610
  bigint: "bigint",
610
611
  object: "date"
611
- }, cn = /* @__PURE__ */ u("$ZodCheckLessThan", (e, t) => {
612
+ }, ln = /* @__PURE__ */ u("$ZodCheckLessThan", (e, t) => {
612
613
  q.init(e, t);
613
- const n = sn[typeof t.value];
614
+ const n = cn[typeof t.value];
614
615
  e._zod.onattach.push((r) => {
615
616
  const o = r._zod.bag, a = (t.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
616
617
  t.value < a && (t.inclusive ? o.maximum = t.value : o.exclusiveMaximum = t.value);
@@ -625,9 +626,9 @@ const co = (e) => {
625
626
  continue: !t.abort
626
627
  });
627
628
  };
628
- }), ln = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, t) => {
629
+ }), pn = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, t) => {
629
630
  q.init(e, t);
630
- const n = sn[typeof t.value];
631
+ const n = cn[typeof t.value];
631
632
  e._zod.onattach.push((r) => {
632
633
  const o = r._zod.bag, a = (t.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
633
634
  t.value > a && (t.inclusive ? o.minimum = t.value : o.exclusiveMinimum = t.value);
@@ -642,14 +643,14 @@ const co = (e) => {
642
643
  continue: !t.abort
643
644
  });
644
645
  };
645
- }), ho = /* @__PURE__ */ u("$ZodCheckMultipleOf", (e, t) => {
646
+ }), yo = /* @__PURE__ */ u("$ZodCheckMultipleOf", (e, t) => {
646
647
  q.init(e, t), e._zod.onattach.push((n) => {
647
648
  var r;
648
649
  (r = n._zod.bag).multipleOf ?? (r.multipleOf = t.value);
649
650
  }), e._zod.check = (n) => {
650
651
  if (typeof n.value != typeof t.value)
651
652
  throw new Error("Cannot mix number and bigint in multiple_of check.");
652
- (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : yr(n.value, t.value) === 0) || n.issues.push({
653
+ (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : br(n.value, t.value) === 0) || n.issues.push({
653
654
  origin: typeof n.value,
654
655
  code: "not_multiple_of",
655
656
  divisor: t.value,
@@ -658,12 +659,12 @@ const co = (e) => {
658
659
  continue: !t.abort
659
660
  });
660
661
  };
661
- }), go = /* @__PURE__ */ u("$ZodCheckNumberFormat", (e, t) => {
662
+ }), _o = /* @__PURE__ */ u("$ZodCheckNumberFormat", (e, t) => {
662
663
  q.init(e, t), t.format = t.format || "float64";
663
- const n = t.format?.includes("int"), r = n ? "int" : "number", [o, a] = kr[t.format];
664
+ const n = t.format?.includes("int"), r = n ? "int" : "number", [o, a] = Tr[t.format];
664
665
  e._zod.onattach.push((i) => {
665
666
  const c = i._zod.bag;
666
- c.format = t.format, c.minimum = o, c.maximum = a, n && (c.pattern = lo);
667
+ c.format = t.format, c.minimum = o, c.maximum = a, n && (c.pattern = uo);
667
668
  }), e._zod.check = (i) => {
668
669
  const c = i.value;
669
670
  if (n) {
@@ -719,7 +720,7 @@ const co = (e) => {
719
720
  continue: !t.abort
720
721
  });
721
722
  };
722
- }), yo = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, t) => {
723
+ }), bo = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, t) => {
723
724
  var n;
724
725
  q.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
725
726
  const o = r.value;
@@ -742,7 +743,7 @@ const co = (e) => {
742
743
  continue: !t.abort
743
744
  });
744
745
  };
745
- }), _o = /* @__PURE__ */ u("$ZodCheckMinLength", (e, t) => {
746
+ }), vo = /* @__PURE__ */ u("$ZodCheckMinLength", (e, t) => {
746
747
  var n;
747
748
  q.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
748
749
  const o = r.value;
@@ -765,7 +766,7 @@ const co = (e) => {
765
766
  continue: !t.abort
766
767
  });
767
768
  };
768
- }), bo = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, t) => {
769
+ }), wo = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, t) => {
769
770
  var n;
770
771
  q.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
771
772
  const o = r.value;
@@ -805,7 +806,7 @@ const co = (e) => {
805
806
  });
806
807
  }) : (r = e._zod).check ?? (r.check = () => {
807
808
  });
808
- }), vo = /* @__PURE__ */ u("$ZodCheckRegex", (e, t) => {
809
+ }), ko = /* @__PURE__ */ u("$ZodCheckRegex", (e, t) => {
809
810
  Ee.init(e, t), e._zod.check = (n) => {
810
811
  t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
811
812
  origin: "string",
@@ -817,11 +818,11 @@ const co = (e) => {
817
818
  continue: !t.abort
818
819
  });
819
820
  };
820
- }), wo = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, t) => {
821
- t.pattern ?? (t.pattern = mo), Ee.init(e, t);
822
- }), ko = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
823
- t.pattern ?? (t.pattern = fo), Ee.init(e, t);
824
- }), Io = /* @__PURE__ */ u("$ZodCheckIncludes", (e, t) => {
821
+ }), Io = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, t) => {
822
+ t.pattern ?? (t.pattern = ho), Ee.init(e, t);
823
+ }), To = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, t) => {
824
+ t.pattern ?? (t.pattern = go), Ee.init(e, t);
825
+ }), So = /* @__PURE__ */ u("$ZodCheckIncludes", (e, t) => {
825
826
  q.init(e, t);
826
827
  const n = ce(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
827
828
  t.pattern = r, e._zod.onattach.push((o) => {
@@ -838,7 +839,7 @@ const co = (e) => {
838
839
  continue: !t.abort
839
840
  });
840
841
  };
841
- }), To = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, t) => {
842
+ }), Po = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, t) => {
842
843
  q.init(e, t);
843
844
  const n = new RegExp(`^${ce(t.prefix)}.*`);
844
845
  t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
@@ -855,7 +856,7 @@ const co = (e) => {
855
856
  continue: !t.abort
856
857
  });
857
858
  };
858
- }), So = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, t) => {
859
+ }), Ao = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, t) => {
859
860
  q.init(e, t);
860
861
  const n = new RegExp(`.*${ce(t.suffix)}$`);
861
862
  t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
@@ -872,12 +873,12 @@ const co = (e) => {
872
873
  continue: !t.abort
873
874
  });
874
875
  };
875
- }), Po = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, t) => {
876
+ }), xo = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, t) => {
876
877
  q.init(e, t), e._zod.check = (n) => {
877
878
  n.value = t.tx(n.value);
878
879
  };
879
880
  });
880
- class Ao {
881
+ class jo {
881
882
  constructor(t = []) {
882
883
  this.content = [], this.indent = 0, this && (this.args = t);
883
884
  }
@@ -900,13 +901,13 @@ class Ao {
900
901
  `));
901
902
  }
902
903
  }
903
- const xo = {
904
+ const Eo = {
904
905
  major: 4,
905
906
  minor: 3,
906
907
  patch: 6
907
908
  }, A = /* @__PURE__ */ u("$ZodType", (e, t) => {
908
909
  var n;
909
- e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = xo;
910
+ e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Eo;
910
911
  const r = [...e._zod.def.checks ?? []];
911
912
  e._zod.traits.has("$ZodCheck") && r.unshift(e);
912
913
  for (const o of r)
@@ -969,17 +970,17 @@ const xo = {
969
970
  T(e, "~standard", () => ({
970
971
  validate: (o) => {
971
972
  try {
972
- const a = Or(e, o);
973
+ const a = Nr(e, o);
973
974
  return a.success ? { value: a.data } : { issues: a.error?.issues };
974
975
  } catch {
975
- return Dr(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
976
+ return $r(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
976
977
  }
977
978
  },
978
979
  vendor: "zod",
979
980
  version: 1
980
981
  }));
981
982
  }), it = /* @__PURE__ */ u("$ZodString", (e, t) => {
982
- A.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? co(e._zod.bag), e._zod.parse = (n, r) => {
983
+ A.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? po(e._zod.bag), e._zod.parse = (n, r) => {
983
984
  if (t.coerce)
984
985
  try {
985
986
  n.value = String(n.value);
@@ -994,9 +995,9 @@ const xo = {
994
995
  };
995
996
  }), j = /* @__PURE__ */ u("$ZodStringFormat", (e, t) => {
996
997
  Ee.init(e, t), it.init(e, t);
997
- }), jo = /* @__PURE__ */ u("$ZodGUID", (e, t) => {
998
- t.pattern ?? (t.pattern = Kr), j.init(e, t);
999
- }), Eo = /* @__PURE__ */ u("$ZodUUID", (e, t) => {
998
+ }), zo = /* @__PURE__ */ u("$ZodGUID", (e, t) => {
999
+ t.pattern ?? (t.pattern = Xr), j.init(e, t);
1000
+ }), Oo = /* @__PURE__ */ u("$ZodUUID", (e, t) => {
1000
1001
  if (t.version) {
1001
1002
  const r = {
1002
1003
  v1: 1,
@@ -1010,13 +1011,13 @@ const xo = {
1010
1011
  }[t.version];
1011
1012
  if (r === void 0)
1012
1013
  throw new Error(`Invalid UUID version: "${t.version}"`);
1013
- t.pattern ?? (t.pattern = pt(r));
1014
+ t.pattern ?? (t.pattern = ut(r));
1014
1015
  } else
1015
- t.pattern ?? (t.pattern = pt());
1016
+ t.pattern ?? (t.pattern = ut());
1016
1017
  j.init(e, t);
1017
- }), zo = /* @__PURE__ */ u("$ZodEmail", (e, t) => {
1018
- t.pattern ?? (t.pattern = Hr), j.init(e, t);
1019
- }), Oo = /* @__PURE__ */ u("$ZodURL", (e, t) => {
1018
+ }), Do = /* @__PURE__ */ u("$ZodEmail", (e, t) => {
1019
+ t.pattern ?? (t.pattern = Yr), j.init(e, t);
1020
+ }), No = /* @__PURE__ */ u("$ZodURL", (e, t) => {
1020
1021
  j.init(e, t), e._zod.check = (n) => {
1021
1022
  try {
1022
1023
  const r = n.value.trim(), o = new URL(r);
@@ -1048,32 +1049,32 @@ const xo = {
1048
1049
  });
1049
1050
  }
1050
1051
  };
1051
- }), Do = /* @__PURE__ */ u("$ZodEmoji", (e, t) => {
1052
- t.pattern ?? (t.pattern = Yr()), j.init(e, t);
1053
- }), No = /* @__PURE__ */ u("$ZodNanoID", (e, t) => {
1054
- t.pattern ?? (t.pattern = Vr), j.init(e, t);
1055
- }), $o = /* @__PURE__ */ u("$ZodCUID", (e, t) => {
1056
- t.pattern ?? (t.pattern = Ur), j.init(e, t);
1057
- }), Ro = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
1058
- t.pattern ?? (t.pattern = Br), j.init(e, t);
1059
- }), Co = /* @__PURE__ */ u("$ZodULID", (e, t) => {
1052
+ }), $o = /* @__PURE__ */ u("$ZodEmoji", (e, t) => {
1053
+ t.pattern ?? (t.pattern = eo()), j.init(e, t);
1054
+ }), Ro = /* @__PURE__ */ u("$ZodNanoID", (e, t) => {
1055
+ t.pattern ?? (t.pattern = Kr), j.init(e, t);
1056
+ }), Co = /* @__PURE__ */ u("$ZodCUID", (e, t) => {
1060
1057
  t.pattern ?? (t.pattern = Fr), j.init(e, t);
1061
- }), Zo = /* @__PURE__ */ u("$ZodXID", (e, t) => {
1058
+ }), Zo = /* @__PURE__ */ u("$ZodCUID2", (e, t) => {
1062
1059
  t.pattern ?? (t.pattern = Gr), j.init(e, t);
1063
- }), Mo = /* @__PURE__ */ u("$ZodKSUID", (e, t) => {
1060
+ }), Mo = /* @__PURE__ */ u("$ZodULID", (e, t) => {
1064
1061
  t.pattern ?? (t.pattern = Jr), j.init(e, t);
1065
- }), Lo = /* @__PURE__ */ u("$ZodISODateTime", (e, t) => {
1066
- t.pattern ?? (t.pattern = so(t)), j.init(e, t);
1067
- }), qo = /* @__PURE__ */ u("$ZodISODate", (e, t) => {
1068
- t.pattern ?? (t.pattern = io), j.init(e, t);
1069
- }), Uo = /* @__PURE__ */ u("$ZodISOTime", (e, t) => {
1070
- t.pattern ?? (t.pattern = ao(t)), j.init(e, t);
1071
- }), Bo = /* @__PURE__ */ u("$ZodISODuration", (e, t) => {
1062
+ }), Lo = /* @__PURE__ */ u("$ZodXID", (e, t) => {
1063
+ t.pattern ?? (t.pattern = Vr), j.init(e, t);
1064
+ }), qo = /* @__PURE__ */ u("$ZodKSUID", (e, t) => {
1072
1065
  t.pattern ?? (t.pattern = Wr), j.init(e, t);
1073
- }), Fo = /* @__PURE__ */ u("$ZodIPv4", (e, t) => {
1074
- t.pattern ?? (t.pattern = Qr), j.init(e, t), e._zod.bag.format = "ipv4";
1075
- }), Go = /* @__PURE__ */ u("$ZodIPv6", (e, t) => {
1076
- t.pattern ?? (t.pattern = eo), j.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
1066
+ }), Uo = /* @__PURE__ */ u("$ZodISODateTime", (e, t) => {
1067
+ t.pattern ?? (t.pattern = lo(t)), j.init(e, t);
1068
+ }), Bo = /* @__PURE__ */ u("$ZodISODate", (e, t) => {
1069
+ t.pattern ?? (t.pattern = so), j.init(e, t);
1070
+ }), Fo = /* @__PURE__ */ u("$ZodISOTime", (e, t) => {
1071
+ t.pattern ?? (t.pattern = co(t)), j.init(e, t);
1072
+ }), Go = /* @__PURE__ */ u("$ZodISODuration", (e, t) => {
1073
+ t.pattern ?? (t.pattern = Hr), j.init(e, t);
1074
+ }), Jo = /* @__PURE__ */ u("$ZodIPv4", (e, t) => {
1075
+ t.pattern ?? (t.pattern = to), j.init(e, t), e._zod.bag.format = "ipv4";
1076
+ }), Vo = /* @__PURE__ */ u("$ZodIPv6", (e, t) => {
1077
+ t.pattern ?? (t.pattern = no), j.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
1077
1078
  try {
1078
1079
  new URL(`http://[${n.value}]`);
1079
1080
  } catch {
@@ -1086,10 +1087,10 @@ const xo = {
1086
1087
  });
1087
1088
  }
1088
1089
  };
1089
- }), Jo = /* @__PURE__ */ u("$ZodCIDRv4", (e, t) => {
1090
- t.pattern ?? (t.pattern = to), j.init(e, t);
1091
- }), Vo = /* @__PURE__ */ u("$ZodCIDRv6", (e, t) => {
1092
- t.pattern ?? (t.pattern = no), j.init(e, t), e._zod.check = (n) => {
1090
+ }), Wo = /* @__PURE__ */ u("$ZodCIDRv4", (e, t) => {
1091
+ t.pattern ?? (t.pattern = ro), j.init(e, t);
1092
+ }), Ko = /* @__PURE__ */ u("$ZodCIDRv6", (e, t) => {
1093
+ t.pattern ?? (t.pattern = oo), j.init(e, t), e._zod.check = (n) => {
1093
1094
  const r = n.value.split("/");
1094
1095
  try {
1095
1096
  if (r.length !== 2)
@@ -1114,7 +1115,7 @@ const xo = {
1114
1115
  }
1115
1116
  };
1116
1117
  });
1117
- function pn(e) {
1118
+ function un(e) {
1118
1119
  if (e === "")
1119
1120
  return !0;
1120
1121
  if (e.length % 4 !== 0)
@@ -1125,9 +1126,9 @@ function pn(e) {
1125
1126
  return !1;
1126
1127
  }
1127
1128
  }
1128
- const Wo = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
1129
- t.pattern ?? (t.pattern = ro), j.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
1130
- pn(n.value) || n.issues.push({
1129
+ const Ho = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
1130
+ t.pattern ?? (t.pattern = io), j.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
1131
+ un(n.value) || n.issues.push({
1131
1132
  code: "invalid_format",
1132
1133
  format: "base64",
1133
1134
  input: n.value,
@@ -1136,15 +1137,15 @@ const Wo = /* @__PURE__ */ u("$ZodBase64", (e, t) => {
1136
1137
  });
1137
1138
  };
1138
1139
  });
1139
- function Ko(e) {
1140
- if (!nn.test(e))
1140
+ function Xo(e) {
1141
+ if (!rn.test(e))
1141
1142
  return !1;
1142
1143
  const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
1143
- return pn(n);
1144
+ return un(n);
1144
1145
  }
1145
- const Ho = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
1146
- t.pattern ?? (t.pattern = nn), j.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
1147
- Ko(n.value) || n.issues.push({
1146
+ const Yo = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
1147
+ t.pattern ?? (t.pattern = rn), j.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
1148
+ Xo(n.value) || n.issues.push({
1148
1149
  code: "invalid_format",
1149
1150
  format: "base64url",
1150
1151
  input: n.value,
@@ -1152,10 +1153,10 @@ const Ho = /* @__PURE__ */ u("$ZodBase64URL", (e, t) => {
1152
1153
  continue: !t.abort
1153
1154
  });
1154
1155
  };
1155
- }), Xo = /* @__PURE__ */ u("$ZodE164", (e, t) => {
1156
- t.pattern ?? (t.pattern = oo), j.init(e, t);
1156
+ }), Qo = /* @__PURE__ */ u("$ZodE164", (e, t) => {
1157
+ t.pattern ?? (t.pattern = ao), j.init(e, t);
1157
1158
  });
1158
- function Yo(e, t = null) {
1159
+ function ei(e, t = null) {
1159
1160
  try {
1160
1161
  const n = e.split(".");
1161
1162
  if (n.length !== 3)
@@ -1169,9 +1170,9 @@ function Yo(e, t = null) {
1169
1170
  return !1;
1170
1171
  }
1171
1172
  }
1172
- const Qo = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
1173
+ const ti = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
1173
1174
  j.init(e, t), e._zod.check = (n) => {
1174
- Yo(n.value, t.alg) || n.issues.push({
1175
+ ei(n.value, t.alg) || n.issues.push({
1175
1176
  code: "invalid_format",
1176
1177
  format: "jwt",
1177
1178
  input: n.value,
@@ -1179,8 +1180,8 @@ const Qo = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
1179
1180
  continue: !t.abort
1180
1181
  });
1181
1182
  };
1182
- }), un = /* @__PURE__ */ u("$ZodNumber", (e, t) => {
1183
- A.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? an, e._zod.parse = (n, r) => {
1183
+ }), dn = /* @__PURE__ */ u("$ZodNumber", (e, t) => {
1184
+ A.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? sn, e._zod.parse = (n, r) => {
1184
1185
  if (t.coerce)
1185
1186
  try {
1186
1187
  n.value = Number(n.value);
@@ -1198,10 +1199,10 @@ const Qo = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
1198
1199
  ...a ? { received: a } : {}
1199
1200
  }), n;
1200
1201
  };
1201
- }), ei = /* @__PURE__ */ u("$ZodNumberFormat", (e, t) => {
1202
- go.init(e, t), un.init(e, t);
1203
- }), ti = /* @__PURE__ */ u("$ZodBoolean", (e, t) => {
1204
- A.init(e, t), e._zod.pattern = po, e._zod.parse = (n, r) => {
1202
+ }), ni = /* @__PURE__ */ u("$ZodNumberFormat", (e, t) => {
1203
+ _o.init(e, t), dn.init(e, t);
1204
+ }), ri = /* @__PURE__ */ u("$ZodBoolean", (e, t) => {
1205
+ A.init(e, t), e._zod.pattern = mo, e._zod.parse = (n, r) => {
1205
1206
  if (t.coerce)
1206
1207
  try {
1207
1208
  n.value = !!n.value;
@@ -1215,8 +1216,8 @@ const Qo = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
1215
1216
  inst: e
1216
1217
  }), n;
1217
1218
  };
1218
- }), ni = /* @__PURE__ */ u("$ZodNull", (e, t) => {
1219
- A.init(e, t), e._zod.pattern = uo, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (n, r) => {
1219
+ }), oi = /* @__PURE__ */ u("$ZodNull", (e, t) => {
1220
+ A.init(e, t), e._zod.pattern = fo, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (n, r) => {
1220
1221
  const o = n.value;
1221
1222
  return o === null || n.issues.push({
1222
1223
  expected: "null",
@@ -1225,9 +1226,9 @@ const Qo = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
1225
1226
  inst: e
1226
1227
  }), n;
1227
1228
  };
1228
- }), ri = /* @__PURE__ */ u("$ZodUnknown", (e, t) => {
1229
+ }), ii = /* @__PURE__ */ u("$ZodUnknown", (e, t) => {
1229
1230
  A.init(e, t), e._zod.parse = (n) => n;
1230
- }), oi = /* @__PURE__ */ u("$ZodNever", (e, t) => {
1231
+ }), ai = /* @__PURE__ */ u("$ZodNever", (e, t) => {
1231
1232
  A.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
1232
1233
  expected: "never",
1233
1234
  code: "invalid_type",
@@ -1235,10 +1236,10 @@ const Qo = /* @__PURE__ */ u("$ZodJWT", (e, t) => {
1235
1236
  inst: e
1236
1237
  }), n);
1237
1238
  });
1238
- function ut(e, t, n) {
1239
+ function dt(e, t, n) {
1239
1240
  e.issues.length && t.issues.push(...oe(n, e.issues)), t.value[n] = e.value;
1240
1241
  }
1241
- const ii = /* @__PURE__ */ u("$ZodArray", (e, t) => {
1242
+ const si = /* @__PURE__ */ u("$ZodArray", (e, t) => {
1242
1243
  A.init(e, t), e._zod.parse = (n, r) => {
1243
1244
  const o = n.value;
1244
1245
  if (!Array.isArray(o))
@@ -1255,7 +1256,7 @@ const ii = /* @__PURE__ */ u("$ZodArray", (e, t) => {
1255
1256
  value: c,
1256
1257
  issues: []
1257
1258
  }, r);
1258
- l instanceof Promise ? a.push(l.then((p) => ut(p, n, i))) : ut(l, n, i);
1259
+ l instanceof Promise ? a.push(l.then((p) => dt(p, n, i))) : dt(l, n, i);
1259
1260
  }
1260
1261
  return a.length ? Promise.all(a).then(() => n) : n;
1261
1262
  };
@@ -1268,12 +1269,12 @@ function be(e, t, n, r, o) {
1268
1269
  }
1269
1270
  e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
1270
1271
  }
1271
- function dn(e) {
1272
+ function mn(e) {
1272
1273
  const t = Object.keys(e.shape);
1273
1274
  for (const r of t)
1274
1275
  if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
1275
1276
  throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
1276
- const n = wr(e.shape);
1277
+ const n = Ir(e.shape);
1277
1278
  return {
1278
1279
  ...e,
1279
1280
  keys: t,
@@ -1282,7 +1283,7 @@ function dn(e) {
1282
1283
  optionalKeys: new Set(n)
1283
1284
  };
1284
1285
  }
1285
- function mn(e, t, n, r, o, a) {
1286
+ function fn(e, t, n, r, o, a) {
1286
1287
  const i = [], c = o.keySet, l = o.catchall._zod, p = l.def.type, h = l.optout === "optional";
1287
1288
  for (const y in t) {
1288
1289
  if (c.has(y))
@@ -1301,7 +1302,7 @@ function mn(e, t, n, r, o, a) {
1301
1302
  inst: a
1302
1303
  }), e.length ? Promise.all(e).then(() => n) : n;
1303
1304
  }
1304
- const ai = /* @__PURE__ */ u("$ZodObject", (e, t) => {
1305
+ const ci = /* @__PURE__ */ u("$ZodObject", (e, t) => {
1305
1306
  if (A.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1306
1307
  const c = t.shape;
1307
1308
  Object.defineProperty(t, "shape", {
@@ -1313,7 +1314,7 @@ const ai = /* @__PURE__ */ u("$ZodObject", (e, t) => {
1313
1314
  }
1314
1315
  });
1315
1316
  }
1316
- const r = Qe(() => dn(t));
1317
+ const r = Qe(() => mn(t));
1317
1318
  T(e._zod, "propValues", () => {
1318
1319
  const c = t.shape, l = {};
1319
1320
  for (const p in c) {
@@ -1344,24 +1345,24 @@ const ai = /* @__PURE__ */ u("$ZodObject", (e, t) => {
1344
1345
  const I = y[v], R = I._zod.optout === "optional", $ = I._zod.run({ value: p[v], issues: [] }, l);
1345
1346
  $ instanceof Promise ? h.push($.then((fe) => be(fe, c, v, p, R))) : be($, c, v, p, R);
1346
1347
  }
1347
- return a ? mn(h, p, c, l, r.value, e) : h.length ? Promise.all(h).then(() => c) : c;
1348
+ return a ? fn(h, p, c, l, r.value, e) : h.length ? Promise.all(h).then(() => c) : c;
1348
1349
  };
1349
- }), si = /* @__PURE__ */ u("$ZodObjectJIT", (e, t) => {
1350
- ai.init(e, t);
1351
- const n = e._zod.parse, r = Qe(() => dn(t)), o = (v) => {
1352
- const I = new Ao(["shape", "payload", "ctx"]), R = r.value, $ = (W) => {
1353
- const M = lt(W);
1350
+ }), li = /* @__PURE__ */ u("$ZodObjectJIT", (e, t) => {
1351
+ ci.init(e, t);
1352
+ const n = e._zod.parse, r = Qe(() => mn(t)), o = (v) => {
1353
+ const I = new jo(["shape", "payload", "ctx"]), R = r.value, $ = (W) => {
1354
+ const M = pt(W);
1354
1355
  return `shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`;
1355
1356
  };
1356
1357
  I.write("const input = payload.value;");
1357
1358
  const fe = /* @__PURE__ */ Object.create(null);
1358
- let Bn = 0;
1359
+ let Fn = 0;
1359
1360
  for (const W of R.keys)
1360
- fe[W] = `key_${Bn++}`;
1361
+ fe[W] = `key_${Fn++}`;
1361
1362
  I.write("const newResult = {};");
1362
1363
  for (const W of R.keys) {
1363
- const M = fe[W], J = lt(W), Gn = v[W]?._zod?.optout === "optional";
1364
- I.write(`const ${M} = ${$(W)};`), Gn ? I.write(`
1364
+ const M = fe[W], J = pt(W), Jn = v[W]?._zod?.optout === "optional";
1365
+ I.write(`const ${M} = ${$(W)};`), Jn ? I.write(`
1365
1366
  if (${M}.issues.length) {
1366
1367
  if (${J} in input) {
1367
1368
  payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
@@ -1398,16 +1399,16 @@ const ai = /* @__PURE__ */ u("$ZodObject", (e, t) => {
1398
1399
  `);
1399
1400
  }
1400
1401
  I.write("payload.value = newResult;"), I.write("return payload;");
1401
- const Fn = I.compile();
1402
- return (W, M) => Fn(v, W, M);
1402
+ const Gn = I.compile();
1403
+ return (W, M) => Gn(v, W, M);
1403
1404
  };
1404
1405
  let a;
1405
- const i = _e, c = !Me.jitless, p = c && br.value, h = t.catchall;
1406
+ const i = _e, c = !Me.jitless, p = c && wr.value, h = t.catchall;
1406
1407
  let y;
1407
1408
  e._zod.parse = (v, I) => {
1408
1409
  y ?? (y = r.value);
1409
1410
  const R = v.value;
1410
- return i(R) ? c && p && I?.async === !1 && I.jitless !== !0 ? (a || (a = o(t.shape)), v = a(v, I), h ? mn([], R, v, I, y, e) : v) : n(v, I) : (v.issues.push({
1411
+ return i(R) ? c && p && I?.async === !1 && I.jitless !== !0 ? (a || (a = o(t.shape)), v = a(v, I), h ? fn([], R, v, I, y, e) : v) : n(v, I) : (v.issues.push({
1411
1412
  expected: "object",
1412
1413
  code: "invalid_type",
1413
1414
  input: R,
@@ -1415,7 +1416,7 @@ const ai = /* @__PURE__ */ u("$ZodObject", (e, t) => {
1415
1416
  }), v);
1416
1417
  };
1417
1418
  });
1418
- function dt(e, t, n, r) {
1419
+ function mt(e, t, n, r) {
1419
1420
  for (const a of e)
1420
1421
  if (a.issues.length === 0)
1421
1422
  return t.value = a.value, t;
@@ -1427,7 +1428,7 @@ function dt(e, t, n, r) {
1427
1428
  errors: e.map((a) => a.issues.map((i) => X(i, r, K())))
1428
1429
  }), t);
1429
1430
  }
1430
- const ci = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
1431
+ const pi = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
1431
1432
  A.init(e, t), T(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), T(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), T(e._zod, "values", () => {
1432
1433
  if (t.options.every((o) => o._zod.values))
1433
1434
  return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
@@ -1456,12 +1457,12 @@ const ci = /* @__PURE__ */ u("$ZodUnion", (e, t) => {
1456
1457
  c.push(p);
1457
1458
  }
1458
1459
  }
1459
- return i ? Promise.all(c).then((l) => dt(l, o, e, a)) : dt(c, o, e, a);
1460
+ return i ? Promise.all(c).then((l) => mt(l, o, e, a)) : mt(c, o, e, a);
1460
1461
  };
1461
- }), li = /* @__PURE__ */ u("$ZodIntersection", (e, t) => {
1462
+ }), ui = /* @__PURE__ */ u("$ZodIntersection", (e, t) => {
1462
1463
  A.init(e, t), e._zod.parse = (n, r) => {
1463
1464
  const o = n.value, a = t.left._zod.run({ value: o, issues: [] }, r), i = t.right._zod.run({ value: o, issues: [] }, r);
1464
- return a instanceof Promise || i instanceof Promise ? Promise.all([a, i]).then(([l, p]) => mt(n, l, p)) : mt(n, a, i);
1465
+ return a instanceof Promise || i instanceof Promise ? Promise.all([a, i]).then(([l, p]) => ft(n, l, p)) : ft(n, a, i);
1465
1466
  };
1466
1467
  });
1467
1468
  function qe(e, t) {
@@ -1499,7 +1500,7 @@ function qe(e, t) {
1499
1500
  }
1500
1501
  return { valid: !1, mergeErrorPath: [] };
1501
1502
  }
1502
- function mt(e, t, n) {
1503
+ function ft(e, t, n) {
1503
1504
  const r = /* @__PURE__ */ new Map();
1504
1505
  let o;
1505
1506
  for (const c of t.issues)
@@ -1523,7 +1524,7 @@ function mt(e, t, n) {
1523
1524
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
1524
1525
  return e.value = i.data, e;
1525
1526
  }
1526
- const pi = /* @__PURE__ */ u("$ZodRecord", (e, t) => {
1527
+ const di = /* @__PURE__ */ u("$ZodRecord", (e, t) => {
1527
1528
  A.init(e, t), e._zod.parse = (n, r) => {
1528
1529
  const o = n.value;
1529
1530
  if (!se(o))
@@ -1562,7 +1563,7 @@ const pi = /* @__PURE__ */ u("$ZodRecord", (e, t) => {
1562
1563
  let l = t.keyType._zod.run({ value: c, issues: [] }, r);
1563
1564
  if (l instanceof Promise)
1564
1565
  throw new Error("Async schemas not supported in object keys currently");
1565
- if (typeof c == "string" && an.test(c) && l.issues.length) {
1566
+ if (typeof c == "string" && sn.test(c) && l.issues.length) {
1566
1567
  const y = t.keyType._zod.run({ value: Number(c), issues: [] }, r);
1567
1568
  if (y instanceof Promise)
1568
1569
  throw new Error("Async schemas not supported in object keys currently");
@@ -1587,10 +1588,10 @@ const pi = /* @__PURE__ */ u("$ZodRecord", (e, t) => {
1587
1588
  }
1588
1589
  return a.length ? Promise.all(a).then(() => n) : n;
1589
1590
  };
1590
- }), ui = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
1591
+ }), mi = /* @__PURE__ */ u("$ZodEnum", (e, t) => {
1591
1592
  A.init(e, t);
1592
- const n = Ht(t.entries), r = new Set(n);
1593
- e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => vr.has(typeof o)).map((o) => typeof o == "string" ? ce(o) : o.toString()).join("|")})$`), e._zod.parse = (o, a) => {
1593
+ const n = Xt(t.entries), r = new Set(n);
1594
+ e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => kr.has(typeof o)).map((o) => typeof o == "string" ? ce(o) : o.toString()).join("|")})$`), e._zod.parse = (o, a) => {
1594
1595
  const i = o.value;
1595
1596
  return r.has(i) || o.issues.push({
1596
1597
  code: "invalid_value",
@@ -1599,7 +1600,7 @@ const pi = /* @__PURE__ */ u("$ZodRecord", (e, t) => {
1599
1600
  inst: e
1600
1601
  }), o;
1601
1602
  };
1602
- }), di = /* @__PURE__ */ u("$ZodLiteral", (e, t) => {
1603
+ }), fi = /* @__PURE__ */ u("$ZodLiteral", (e, t) => {
1603
1604
  if (A.init(e, t), t.values.length === 0)
1604
1605
  throw new Error("Cannot create literal schema with no valid values");
1605
1606
  const n = new Set(t.values);
@@ -1612,10 +1613,10 @@ const pi = /* @__PURE__ */ u("$ZodRecord", (e, t) => {
1612
1613
  inst: e
1613
1614
  }), r;
1614
1615
  };
1615
- }), mi = /* @__PURE__ */ u("$ZodTransform", (e, t) => {
1616
+ }), hi = /* @__PURE__ */ u("$ZodTransform", (e, t) => {
1616
1617
  A.init(e, t), e._zod.parse = (n, r) => {
1617
1618
  if (r.direction === "backward")
1618
- throw new Kt(e.constructor.name);
1619
+ throw new Ht(e.constructor.name);
1619
1620
  const o = t.transform(n.value, n);
1620
1621
  if (r.async)
1621
1622
  return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (n.value = i, n));
@@ -1624,52 +1625,52 @@ const pi = /* @__PURE__ */ u("$ZodRecord", (e, t) => {
1624
1625
  return n.value = o, n;
1625
1626
  };
1626
1627
  });
1627
- function ft(e, t) {
1628
+ function ht(e, t) {
1628
1629
  return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
1629
1630
  }
1630
- const fn = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
1631
+ const hn = /* @__PURE__ */ u("$ZodOptional", (e, t) => {
1631
1632
  A.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", T(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), T(e._zod, "pattern", () => {
1632
1633
  const n = t.innerType._zod.pattern;
1633
1634
  return n ? new RegExp(`^(${tt(n.source)})?$`) : void 0;
1634
1635
  }), e._zod.parse = (n, r) => {
1635
1636
  if (t.innerType._zod.optin === "optional") {
1636
1637
  const o = t.innerType._zod.run(n, r);
1637
- return o instanceof Promise ? o.then((a) => ft(a, n.value)) : ft(o, n.value);
1638
+ return o instanceof Promise ? o.then((a) => ht(a, n.value)) : ht(o, n.value);
1638
1639
  }
1639
1640
  return n.value === void 0 ? n : t.innerType._zod.run(n, r);
1640
1641
  };
1641
- }), fi = /* @__PURE__ */ u("$ZodExactOptional", (e, t) => {
1642
- fn.init(e, t), T(e._zod, "values", () => t.innerType._zod.values), T(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
1643
- }), hi = /* @__PURE__ */ u("$ZodNullable", (e, t) => {
1642
+ }), gi = /* @__PURE__ */ u("$ZodExactOptional", (e, t) => {
1643
+ hn.init(e, t), T(e._zod, "values", () => t.innerType._zod.values), T(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
1644
+ }), yi = /* @__PURE__ */ u("$ZodNullable", (e, t) => {
1644
1645
  A.init(e, t), T(e._zod, "optin", () => t.innerType._zod.optin), T(e._zod, "optout", () => t.innerType._zod.optout), T(e._zod, "pattern", () => {
1645
1646
  const n = t.innerType._zod.pattern;
1646
1647
  return n ? new RegExp(`^(${tt(n.source)}|null)$`) : void 0;
1647
1648
  }), T(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);
1648
- }), gi = /* @__PURE__ */ u("$ZodDefault", (e, t) => {
1649
+ }), _i = /* @__PURE__ */ u("$ZodDefault", (e, t) => {
1649
1650
  A.init(e, t), e._zod.optin = "optional", T(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1650
1651
  if (r.direction === "backward")
1651
1652
  return t.innerType._zod.run(n, r);
1652
1653
  if (n.value === void 0)
1653
1654
  return n.value = t.defaultValue, n;
1654
1655
  const o = t.innerType._zod.run(n, r);
1655
- return o instanceof Promise ? o.then((a) => ht(a, t)) : ht(o, t);
1656
+ return o instanceof Promise ? o.then((a) => gt(a, t)) : gt(o, t);
1656
1657
  };
1657
1658
  });
1658
- function ht(e, t) {
1659
+ function gt(e, t) {
1659
1660
  return e.value === void 0 && (e.value = t.defaultValue), e;
1660
1661
  }
1661
- const yi = /* @__PURE__ */ u("$ZodPrefault", (e, t) => {
1662
+ const bi = /* @__PURE__ */ u("$ZodPrefault", (e, t) => {
1662
1663
  A.init(e, t), e._zod.optin = "optional", T(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));
1663
- }), _i = /* @__PURE__ */ u("$ZodNonOptional", (e, t) => {
1664
+ }), vi = /* @__PURE__ */ u("$ZodNonOptional", (e, t) => {
1664
1665
  A.init(e, t), T(e._zod, "values", () => {
1665
1666
  const n = t.innerType._zod.values;
1666
1667
  return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
1667
1668
  }), e._zod.parse = (n, r) => {
1668
1669
  const o = t.innerType._zod.run(n, r);
1669
- return o instanceof Promise ? o.then((a) => gt(a, e)) : gt(o, e);
1670
+ return o instanceof Promise ? o.then((a) => yt(a, e)) : yt(o, e);
1670
1671
  };
1671
1672
  });
1672
- function gt(e, t) {
1673
+ function yt(e, t) {
1673
1674
  return !e.issues.length && e.value === void 0 && e.issues.push({
1674
1675
  code: "invalid_type",
1675
1676
  expected: "nonoptional",
@@ -1677,7 +1678,7 @@ function gt(e, t) {
1677
1678
  inst: t
1678
1679
  }), e;
1679
1680
  }
1680
- const bi = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
1681
+ const wi = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
1681
1682
  A.init(e, t), T(e._zod, "optin", () => t.innerType._zod.optin), T(e._zod, "optout", () => t.innerType._zod.optout), T(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1682
1683
  if (r.direction === "backward")
1683
1684
  return t.innerType._zod.run(n, r);
@@ -1696,7 +1697,7 @@ const bi = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
1696
1697
  input: n.value
1697
1698
  }), n.issues = []), n);
1698
1699
  };
1699
- }), vi = /* @__PURE__ */ u("$ZodPipe", (e, t) => {
1700
+ }), ki = /* @__PURE__ */ u("$ZodPipe", (e, t) => {
1700
1701
  A.init(e, t), T(e._zod, "values", () => t.in._zod.values), T(e._zod, "optin", () => t.in._zod.optin), T(e._zod, "optout", () => t.out._zod.optout), T(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
1701
1702
  if (r.direction === "backward") {
1702
1703
  const a = t.out._zod.run(n, r);
@@ -1709,28 +1710,28 @@ const bi = /* @__PURE__ */ u("$ZodCatch", (e, t) => {
1709
1710
  function ge(e, t, n) {
1710
1711
  return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
1711
1712
  }
1712
- const wi = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
1713
+ const Ii = /* @__PURE__ */ u("$ZodReadonly", (e, t) => {
1713
1714
  A.init(e, t), T(e._zod, "propValues", () => t.innerType._zod.propValues), T(e._zod, "values", () => t.innerType._zod.values), T(e._zod, "optin", () => t.innerType?._zod?.optin), T(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
1714
1715
  if (r.direction === "backward")
1715
1716
  return t.innerType._zod.run(n, r);
1716
1717
  const o = t.innerType._zod.run(n, r);
1717
- return o instanceof Promise ? o.then(yt) : yt(o);
1718
+ return o instanceof Promise ? o.then(_t) : _t(o);
1718
1719
  };
1719
1720
  });
1720
- function yt(e) {
1721
+ function _t(e) {
1721
1722
  return e.value = Object.freeze(e.value), e;
1722
1723
  }
1723
- const ki = /* @__PURE__ */ u("$ZodLazy", (e, t) => {
1724
+ const Ti = /* @__PURE__ */ u("$ZodLazy", (e, t) => {
1724
1725
  A.init(e, t), T(e._zod, "innerType", () => t.getter()), T(e._zod, "pattern", () => e._zod.innerType?._zod?.pattern), T(e._zod, "propValues", () => e._zod.innerType?._zod?.propValues), T(e._zod, "optin", () => e._zod.innerType?._zod?.optin ?? void 0), T(e._zod, "optout", () => e._zod.innerType?._zod?.optout ?? void 0), e._zod.parse = (n, r) => e._zod.innerType._zod.run(n, r);
1725
- }), Ii = /* @__PURE__ */ u("$ZodCustom", (e, t) => {
1726
+ }), Si = /* @__PURE__ */ u("$ZodCustom", (e, t) => {
1726
1727
  q.init(e, t), A.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
1727
1728
  const r = n.value, o = t.fn(r);
1728
1729
  if (o instanceof Promise)
1729
- return o.then((a) => _t(a, n, r, e));
1730
- _t(o, n, r, e);
1730
+ return o.then((a) => bt(a, n, r, e));
1731
+ bt(o, n, r, e);
1731
1732
  };
1732
1733
  });
1733
- function _t(e, t, n, r) {
1734
+ function bt(e, t, n, r) {
1734
1735
  if (!e) {
1735
1736
  const o = {
1736
1737
  code: "custom",
@@ -1745,8 +1746,8 @@ function _t(e, t, n, r) {
1745
1746
  r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(me(o));
1746
1747
  }
1747
1748
  }
1748
- var bt;
1749
- class Ti {
1749
+ var vt;
1750
+ class Pi {
1750
1751
  constructor() {
1751
1752
  this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1752
1753
  }
@@ -1775,20 +1776,20 @@ class Ti {
1775
1776
  return this._map.has(t);
1776
1777
  }
1777
1778
  }
1778
- function Si() {
1779
- return new Ti();
1779
+ function Ai() {
1780
+ return new Pi();
1780
1781
  }
1781
- (bt = globalThis).__zod_globalRegistry ?? (bt.__zod_globalRegistry = Si());
1782
+ (vt = globalThis).__zod_globalRegistry ?? (vt.__zod_globalRegistry = Ai());
1782
1783
  const de = globalThis.__zod_globalRegistry;
1783
1784
  // @__NO_SIDE_EFFECTS__
1784
- function Pi(e, t) {
1785
+ function xi(e, t) {
1785
1786
  return new e({
1786
1787
  type: "string",
1787
1788
  ..._(t)
1788
1789
  });
1789
1790
  }
1790
1791
  // @__NO_SIDE_EFFECTS__
1791
- function Ai(e, t) {
1792
+ function ji(e, t) {
1792
1793
  return new e({
1793
1794
  type: "string",
1794
1795
  format: "email",
@@ -1798,7 +1799,7 @@ function Ai(e, t) {
1798
1799
  });
1799
1800
  }
1800
1801
  // @__NO_SIDE_EFFECTS__
1801
- function vt(e, t) {
1802
+ function wt(e, t) {
1802
1803
  return new e({
1803
1804
  type: "string",
1804
1805
  format: "guid",
@@ -1808,7 +1809,7 @@ function vt(e, t) {
1808
1809
  });
1809
1810
  }
1810
1811
  // @__NO_SIDE_EFFECTS__
1811
- function xi(e, t) {
1812
+ function Ei(e, t) {
1812
1813
  return new e({
1813
1814
  type: "string",
1814
1815
  format: "uuid",
@@ -1818,7 +1819,7 @@ function xi(e, t) {
1818
1819
  });
1819
1820
  }
1820
1821
  // @__NO_SIDE_EFFECTS__
1821
- function ji(e, t) {
1822
+ function zi(e, t) {
1822
1823
  return new e({
1823
1824
  type: "string",
1824
1825
  format: "uuid",
@@ -1829,7 +1830,7 @@ function ji(e, t) {
1829
1830
  });
1830
1831
  }
1831
1832
  // @__NO_SIDE_EFFECTS__
1832
- function Ei(e, t) {
1833
+ function Oi(e, t) {
1833
1834
  return new e({
1834
1835
  type: "string",
1835
1836
  format: "uuid",
@@ -1840,7 +1841,7 @@ function Ei(e, t) {
1840
1841
  });
1841
1842
  }
1842
1843
  // @__NO_SIDE_EFFECTS__
1843
- function zi(e, t) {
1844
+ function Di(e, t) {
1844
1845
  return new e({
1845
1846
  type: "string",
1846
1847
  format: "uuid",
@@ -1851,7 +1852,7 @@ function zi(e, t) {
1851
1852
  });
1852
1853
  }
1853
1854
  // @__NO_SIDE_EFFECTS__
1854
- function Oi(e, t) {
1855
+ function Ni(e, t) {
1855
1856
  return new e({
1856
1857
  type: "string",
1857
1858
  format: "url",
@@ -1861,7 +1862,7 @@ function Oi(e, t) {
1861
1862
  });
1862
1863
  }
1863
1864
  // @__NO_SIDE_EFFECTS__
1864
- function Di(e, t) {
1865
+ function $i(e, t) {
1865
1866
  return new e({
1866
1867
  type: "string",
1867
1868
  format: "emoji",
@@ -1871,7 +1872,7 @@ function Di(e, t) {
1871
1872
  });
1872
1873
  }
1873
1874
  // @__NO_SIDE_EFFECTS__
1874
- function Ni(e, t) {
1875
+ function Ri(e, t) {
1875
1876
  return new e({
1876
1877
  type: "string",
1877
1878
  format: "nanoid",
@@ -1881,7 +1882,7 @@ function Ni(e, t) {
1881
1882
  });
1882
1883
  }
1883
1884
  // @__NO_SIDE_EFFECTS__
1884
- function $i(e, t) {
1885
+ function Ci(e, t) {
1885
1886
  return new e({
1886
1887
  type: "string",
1887
1888
  format: "cuid",
@@ -1891,7 +1892,7 @@ function $i(e, t) {
1891
1892
  });
1892
1893
  }
1893
1894
  // @__NO_SIDE_EFFECTS__
1894
- function Ri(e, t) {
1895
+ function Zi(e, t) {
1895
1896
  return new e({
1896
1897
  type: "string",
1897
1898
  format: "cuid2",
@@ -1901,7 +1902,7 @@ function Ri(e, t) {
1901
1902
  });
1902
1903
  }
1903
1904
  // @__NO_SIDE_EFFECTS__
1904
- function Ci(e, t) {
1905
+ function Mi(e, t) {
1905
1906
  return new e({
1906
1907
  type: "string",
1907
1908
  format: "ulid",
@@ -1911,7 +1912,7 @@ function Ci(e, t) {
1911
1912
  });
1912
1913
  }
1913
1914
  // @__NO_SIDE_EFFECTS__
1914
- function Zi(e, t) {
1915
+ function Li(e, t) {
1915
1916
  return new e({
1916
1917
  type: "string",
1917
1918
  format: "xid",
@@ -1921,7 +1922,7 @@ function Zi(e, t) {
1921
1922
  });
1922
1923
  }
1923
1924
  // @__NO_SIDE_EFFECTS__
1924
- function Mi(e, t) {
1925
+ function qi(e, t) {
1925
1926
  return new e({
1926
1927
  type: "string",
1927
1928
  format: "ksuid",
@@ -1931,7 +1932,7 @@ function Mi(e, t) {
1931
1932
  });
1932
1933
  }
1933
1934
  // @__NO_SIDE_EFFECTS__
1934
- function Li(e, t) {
1935
+ function Ui(e, t) {
1935
1936
  return new e({
1936
1937
  type: "string",
1937
1938
  format: "ipv4",
@@ -1941,7 +1942,7 @@ function Li(e, t) {
1941
1942
  });
1942
1943
  }
1943
1944
  // @__NO_SIDE_EFFECTS__
1944
- function qi(e, t) {
1945
+ function Bi(e, t) {
1945
1946
  return new e({
1946
1947
  type: "string",
1947
1948
  format: "ipv6",
@@ -1951,7 +1952,7 @@ function qi(e, t) {
1951
1952
  });
1952
1953
  }
1953
1954
  // @__NO_SIDE_EFFECTS__
1954
- function Ui(e, t) {
1955
+ function Fi(e, t) {
1955
1956
  return new e({
1956
1957
  type: "string",
1957
1958
  format: "cidrv4",
@@ -1961,7 +1962,7 @@ function Ui(e, t) {
1961
1962
  });
1962
1963
  }
1963
1964
  // @__NO_SIDE_EFFECTS__
1964
- function Bi(e, t) {
1965
+ function Gi(e, t) {
1965
1966
  return new e({
1966
1967
  type: "string",
1967
1968
  format: "cidrv6",
@@ -1971,7 +1972,7 @@ function Bi(e, t) {
1971
1972
  });
1972
1973
  }
1973
1974
  // @__NO_SIDE_EFFECTS__
1974
- function Fi(e, t) {
1975
+ function Ji(e, t) {
1975
1976
  return new e({
1976
1977
  type: "string",
1977
1978
  format: "base64",
@@ -1981,7 +1982,7 @@ function Fi(e, t) {
1981
1982
  });
1982
1983
  }
1983
1984
  // @__NO_SIDE_EFFECTS__
1984
- function Gi(e, t) {
1985
+ function Vi(e, t) {
1985
1986
  return new e({
1986
1987
  type: "string",
1987
1988
  format: "base64url",
@@ -1991,7 +1992,7 @@ function Gi(e, t) {
1991
1992
  });
1992
1993
  }
1993
1994
  // @__NO_SIDE_EFFECTS__
1994
- function Ji(e, t) {
1995
+ function Wi(e, t) {
1995
1996
  return new e({
1996
1997
  type: "string",
1997
1998
  format: "e164",
@@ -2001,7 +2002,7 @@ function Ji(e, t) {
2001
2002
  });
2002
2003
  }
2003
2004
  // @__NO_SIDE_EFFECTS__
2004
- function Vi(e, t) {
2005
+ function Ki(e, t) {
2005
2006
  return new e({
2006
2007
  type: "string",
2007
2008
  format: "jwt",
@@ -2011,7 +2012,7 @@ function Vi(e, t) {
2011
2012
  });
2012
2013
  }
2013
2014
  // @__NO_SIDE_EFFECTS__
2014
- function Wi(e, t) {
2015
+ function Hi(e, t) {
2015
2016
  return new e({
2016
2017
  type: "string",
2017
2018
  format: "datetime",
@@ -2023,7 +2024,7 @@ function Wi(e, t) {
2023
2024
  });
2024
2025
  }
2025
2026
  // @__NO_SIDE_EFFECTS__
2026
- function Ki(e, t) {
2027
+ function Xi(e, t) {
2027
2028
  return new e({
2028
2029
  type: "string",
2029
2030
  format: "date",
@@ -2032,7 +2033,7 @@ function Ki(e, t) {
2032
2033
  });
2033
2034
  }
2034
2035
  // @__NO_SIDE_EFFECTS__
2035
- function Hi(e, t) {
2036
+ function Yi(e, t) {
2036
2037
  return new e({
2037
2038
  type: "string",
2038
2039
  format: "time",
@@ -2042,7 +2043,7 @@ function Hi(e, t) {
2042
2043
  });
2043
2044
  }
2044
2045
  // @__NO_SIDE_EFFECTS__
2045
- function Xi(e, t) {
2046
+ function Qi(e, t) {
2046
2047
  return new e({
2047
2048
  type: "string",
2048
2049
  format: "duration",
@@ -2051,7 +2052,7 @@ function Xi(e, t) {
2051
2052
  });
2052
2053
  }
2053
2054
  // @__NO_SIDE_EFFECTS__
2054
- function Yi(e, t) {
2055
+ function ea(e, t) {
2055
2056
  return new e({
2056
2057
  type: "number",
2057
2058
  checks: [],
@@ -2059,7 +2060,7 @@ function Yi(e, t) {
2059
2060
  });
2060
2061
  }
2061
2062
  // @__NO_SIDE_EFFECTS__
2062
- function Qi(e, t) {
2063
+ function ta(e, t) {
2063
2064
  return new e({
2064
2065
  type: "number",
2065
2066
  check: "number_format",
@@ -2069,35 +2070,35 @@ function Qi(e, t) {
2069
2070
  });
2070
2071
  }
2071
2072
  // @__NO_SIDE_EFFECTS__
2072
- function ea(e, t) {
2073
+ function na(e, t) {
2073
2074
  return new e({
2074
2075
  type: "boolean",
2075
2076
  ..._(t)
2076
2077
  });
2077
2078
  }
2078
2079
  // @__NO_SIDE_EFFECTS__
2079
- function ta(e, t) {
2080
+ function ra(e, t) {
2080
2081
  return new e({
2081
2082
  type: "null",
2082
2083
  ..._(t)
2083
2084
  });
2084
2085
  }
2085
2086
  // @__NO_SIDE_EFFECTS__
2086
- function na(e) {
2087
+ function oa(e) {
2087
2088
  return new e({
2088
2089
  type: "unknown"
2089
2090
  });
2090
2091
  }
2091
2092
  // @__NO_SIDE_EFFECTS__
2092
- function ra(e, t) {
2093
+ function ia(e, t) {
2093
2094
  return new e({
2094
2095
  type: "never",
2095
2096
  ..._(t)
2096
2097
  });
2097
2098
  }
2098
2099
  // @__NO_SIDE_EFFECTS__
2099
- function wt(e, t) {
2100
- return new cn({
2100
+ function kt(e, t) {
2101
+ return new ln({
2101
2102
  check: "less_than",
2102
2103
  ..._(t),
2103
2104
  value: e,
@@ -2106,7 +2107,7 @@ function wt(e, t) {
2106
2107
  }
2107
2108
  // @__NO_SIDE_EFFECTS__
2108
2109
  function Oe(e, t) {
2109
- return new cn({
2110
+ return new ln({
2110
2111
  check: "less_than",
2111
2112
  ..._(t),
2112
2113
  value: e,
@@ -2114,8 +2115,8 @@ function Oe(e, t) {
2114
2115
  });
2115
2116
  }
2116
2117
  // @__NO_SIDE_EFFECTS__
2117
- function kt(e, t) {
2118
- return new ln({
2118
+ function It(e, t) {
2119
+ return new pn({
2119
2120
  check: "greater_than",
2120
2121
  ..._(t),
2121
2122
  value: e,
@@ -2124,7 +2125,7 @@ function kt(e, t) {
2124
2125
  }
2125
2126
  // @__NO_SIDE_EFFECTS__
2126
2127
  function De(e, t) {
2127
- return new ln({
2128
+ return new pn({
2128
2129
  check: "greater_than",
2129
2130
  ..._(t),
2130
2131
  value: e,
@@ -2132,16 +2133,16 @@ function De(e, t) {
2132
2133
  });
2133
2134
  }
2134
2135
  // @__NO_SIDE_EFFECTS__
2135
- function It(e, t) {
2136
- return new ho({
2136
+ function Tt(e, t) {
2137
+ return new yo({
2137
2138
  check: "multiple_of",
2138
2139
  ..._(t),
2139
2140
  value: e
2140
2141
  });
2141
2142
  }
2142
2143
  // @__NO_SIDE_EFFECTS__
2143
- function hn(e, t) {
2144
- return new yo({
2144
+ function gn(e, t) {
2145
+ return new bo({
2145
2146
  check: "max_length",
2146
2147
  ..._(t),
2147
2148
  maximum: e
@@ -2149,23 +2150,23 @@ function hn(e, t) {
2149
2150
  }
2150
2151
  // @__NO_SIDE_EFFECTS__
2151
2152
  function ve(e, t) {
2152
- return new _o({
2153
+ return new vo({
2153
2154
  check: "min_length",
2154
2155
  ..._(t),
2155
2156
  minimum: e
2156
2157
  });
2157
2158
  }
2158
2159
  // @__NO_SIDE_EFFECTS__
2159
- function gn(e, t) {
2160
- return new bo({
2160
+ function yn(e, t) {
2161
+ return new wo({
2161
2162
  check: "length_equals",
2162
2163
  ..._(t),
2163
2164
  length: e
2164
2165
  });
2165
2166
  }
2166
2167
  // @__NO_SIDE_EFFECTS__
2167
- function oa(e, t) {
2168
- return new vo({
2168
+ function aa(e, t) {
2169
+ return new ko({
2169
2170
  check: "string_format",
2170
2171
  format: "regex",
2171
2172
  ..._(t),
@@ -2173,24 +2174,24 @@ function oa(e, t) {
2173
2174
  });
2174
2175
  }
2175
2176
  // @__NO_SIDE_EFFECTS__
2176
- function ia(e) {
2177
- return new wo({
2177
+ function sa(e) {
2178
+ return new Io({
2178
2179
  check: "string_format",
2179
2180
  format: "lowercase",
2180
2181
  ..._(e)
2181
2182
  });
2182
2183
  }
2183
2184
  // @__NO_SIDE_EFFECTS__
2184
- function aa(e) {
2185
- return new ko({
2185
+ function ca(e) {
2186
+ return new To({
2186
2187
  check: "string_format",
2187
2188
  format: "uppercase",
2188
2189
  ..._(e)
2189
2190
  });
2190
2191
  }
2191
2192
  // @__NO_SIDE_EFFECTS__
2192
- function sa(e, t) {
2193
- return new Io({
2193
+ function la(e, t) {
2194
+ return new So({
2194
2195
  check: "string_format",
2195
2196
  format: "includes",
2196
2197
  ..._(t),
@@ -2198,8 +2199,8 @@ function sa(e, t) {
2198
2199
  });
2199
2200
  }
2200
2201
  // @__NO_SIDE_EFFECTS__
2201
- function ca(e, t) {
2202
- return new To({
2202
+ function pa(e, t) {
2203
+ return new Po({
2203
2204
  check: "string_format",
2204
2205
  format: "starts_with",
2205
2206
  ..._(t),
@@ -2207,8 +2208,8 @@ function ca(e, t) {
2207
2208
  });
2208
2209
  }
2209
2210
  // @__NO_SIDE_EFFECTS__
2210
- function la(e, t) {
2211
- return new So({
2211
+ function ua(e, t) {
2212
+ return new Ao({
2212
2213
  check: "string_format",
2213
2214
  format: "ends_with",
2214
2215
  ..._(t),
@@ -2217,33 +2218,33 @@ function la(e, t) {
2217
2218
  }
2218
2219
  // @__NO_SIDE_EFFECTS__
2219
2220
  function ue(e) {
2220
- return new Po({
2221
+ return new xo({
2221
2222
  check: "overwrite",
2222
2223
  tx: e
2223
2224
  });
2224
2225
  }
2225
2226
  // @__NO_SIDE_EFFECTS__
2226
- function pa(e) {
2227
+ function da(e) {
2227
2228
  return /* @__PURE__ */ ue((t) => t.normalize(e));
2228
2229
  }
2229
2230
  // @__NO_SIDE_EFFECTS__
2230
- function ua() {
2231
+ function ma() {
2231
2232
  return /* @__PURE__ */ ue((e) => e.trim());
2232
2233
  }
2233
2234
  // @__NO_SIDE_EFFECTS__
2234
- function da() {
2235
+ function fa() {
2235
2236
  return /* @__PURE__ */ ue((e) => e.toLowerCase());
2236
2237
  }
2237
2238
  // @__NO_SIDE_EFFECTS__
2238
- function ma() {
2239
+ function ha() {
2239
2240
  return /* @__PURE__ */ ue((e) => e.toUpperCase());
2240
2241
  }
2241
2242
  // @__NO_SIDE_EFFECTS__
2242
- function fa() {
2243
- return /* @__PURE__ */ ue((e) => _r(e));
2243
+ function ga() {
2244
+ return /* @__PURE__ */ ue((e) => vr(e));
2244
2245
  }
2245
2246
  // @__NO_SIDE_EFFECTS__
2246
- function ha(e, t, n) {
2247
+ function ya(e, t, n) {
2247
2248
  return new e({
2248
2249
  type: "array",
2249
2250
  element: t,
@@ -2254,7 +2255,7 @@ function ha(e, t, n) {
2254
2255
  });
2255
2256
  }
2256
2257
  // @__NO_SIDE_EFFECTS__
2257
- function ga(e, t, n) {
2258
+ function _a(e, t, n) {
2258
2259
  return new e({
2259
2260
  type: "custom",
2260
2261
  check: "custom",
@@ -2263,8 +2264,8 @@ function ga(e, t, n) {
2263
2264
  });
2264
2265
  }
2265
2266
  // @__NO_SIDE_EFFECTS__
2266
- function ya(e) {
2267
- const t = /* @__PURE__ */ _a((n) => (n.addIssue = (r) => {
2267
+ function ba(e) {
2268
+ const t = /* @__PURE__ */ va((n) => (n.addIssue = (r) => {
2268
2269
  if (typeof r == "string")
2269
2270
  n.issues.push(me(r, n.value, t._zod.def));
2270
2271
  else {
@@ -2275,14 +2276,14 @@ function ya(e) {
2275
2276
  return t;
2276
2277
  }
2277
2278
  // @__NO_SIDE_EFFECTS__
2278
- function _a(e, t) {
2279
+ function va(e, t) {
2279
2280
  const n = new q({
2280
2281
  check: "custom",
2281
2282
  ..._(t)
2282
2283
  });
2283
2284
  return n._zod.check = e, n;
2284
2285
  }
2285
- function yn(e) {
2286
+ function _n(e) {
2286
2287
  let t = e?.target ?? "draft-2020-12";
2287
2288
  return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
2288
2289
  processors: e.processors ?? {},
@@ -2329,7 +2330,7 @@ function O(e, t, n = { path: [], schemaPath: [] }) {
2329
2330
  const l = t.metadataRegistry.get(e);
2330
2331
  return l && Object.assign(i.schema, l), t.io === "input" && C(e) && (delete i.schema.examples, delete i.schema.default), t.io === "input" && i.schema._prefault && ((r = i.schema).default ?? (r.default = i.schema._prefault)), delete i.schema._prefault, t.seen.get(e).schema;
2331
2332
  }
2332
- function _n(e, t) {
2333
+ function bn(e, t) {
2333
2334
  const n = e.seen.get(t);
2334
2335
  if (!n)
2335
2336
  throw new Error("Unprocessed schema. This is a bug in Zod.");
@@ -2401,7 +2402,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2401
2402
  }
2402
2403
  }
2403
2404
  }
2404
- function bn(e, t) {
2405
+ function vn(e, t) {
2405
2406
  const n = e.seen.get(t);
2406
2407
  if (!n)
2407
2408
  throw new Error("Unprocessed schema. This is a bug in Zod.");
@@ -2509,24 +2510,24 @@ function C(e, t) {
2509
2510
  }
2510
2511
  return !1;
2511
2512
  }
2512
- const ba = (e, t = {}) => (n) => {
2513
- const r = yn({ ...n, processors: t });
2514
- return O(e, r), _n(r, e), bn(r, e);
2513
+ const wa = (e, t = {}) => (n) => {
2514
+ const r = _n({ ...n, processors: t });
2515
+ return O(e, r), bn(r, e), vn(r, e);
2515
2516
  }, we = (e, t, n = {}) => (r) => {
2516
- const { libraryOptions: o, target: a } = r ?? {}, i = yn({ ...o ?? {}, target: a, io: t, processors: n });
2517
- return O(e, i), _n(i, e), bn(i, e);
2518
- }, va = {
2517
+ const { libraryOptions: o, target: a } = r ?? {}, i = _n({ ...o ?? {}, target: a, io: t, processors: n });
2518
+ return O(e, i), bn(i, e), vn(i, e);
2519
+ }, ka = {
2519
2520
  guid: "uuid",
2520
2521
  url: "uri",
2521
2522
  datetime: "date-time",
2522
2523
  json_string: "json-string",
2523
2524
  regex: ""
2524
2525
  // do not set
2525
- }, wa = (e, t, n, r) => {
2526
+ }, Ia = (e, t, n, r) => {
2526
2527
  const o = n;
2527
2528
  o.type = "string";
2528
2529
  const { minimum: a, maximum: i, format: c, patterns: l, contentEncoding: p } = e._zod.bag;
2529
- if (typeof a == "number" && (o.minLength = a), typeof i == "number" && (o.maxLength = i), c && (o.format = va[c] ?? c, o.format === "" && delete o.format, c === "time" && delete o.format), p && (o.contentEncoding = p), l && l.size > 0) {
2530
+ if (typeof a == "number" && (o.minLength = a), typeof i == "number" && (o.maxLength = i), c && (o.format = ka[c] ?? c, o.format === "" && delete o.format, c === "time" && delete o.format), p && (o.contentEncoding = p), l && l.size > 0) {
2530
2531
  const h = [...l];
2531
2532
  h.length === 1 ? o.pattern = h[0].source : h.length > 1 && (o.allOf = [
2532
2533
  ...h.map((y) => ({
@@ -2535,20 +2536,20 @@ const ba = (e, t = {}) => (n) => {
2535
2536
  }))
2536
2537
  ]);
2537
2538
  }
2538
- }, ka = (e, t, n, r) => {
2539
+ }, Ta = (e, t, n, r) => {
2539
2540
  const o = n, { minimum: a, maximum: i, format: c, multipleOf: l, exclusiveMaximum: p, exclusiveMinimum: h } = e._zod.bag;
2540
2541
  typeof c == "string" && c.includes("int") ? o.type = "integer" : o.type = "number", typeof h == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.minimum = h, o.exclusiveMinimum = !0) : o.exclusiveMinimum = h), typeof a == "number" && (o.minimum = a, typeof h == "number" && t.target !== "draft-04" && (h >= a ? delete o.minimum : delete o.exclusiveMinimum)), typeof p == "number" && (t.target === "draft-04" || t.target === "openapi-3.0" ? (o.maximum = p, o.exclusiveMaximum = !0) : o.exclusiveMaximum = p), typeof i == "number" && (o.maximum = i, typeof p == "number" && t.target !== "draft-04" && (p <= i ? delete o.maximum : delete o.exclusiveMaximum)), typeof l == "number" && (o.multipleOf = l);
2541
- }, Ia = (e, t, n, r) => {
2542
- n.type = "boolean";
2543
- }, Ta = (e, t, n, r) => {
2544
- t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
2545
2542
  }, Sa = (e, t, n, r) => {
2546
- n.not = {};
2543
+ n.type = "boolean";
2547
2544
  }, Pa = (e, t, n, r) => {
2545
+ t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
2548
2546
  }, Aa = (e, t, n, r) => {
2549
- const o = e._zod.def, a = Ht(o.entries);
2550
- a.every((i) => typeof i == "number") && (n.type = "number"), a.every((i) => typeof i == "string") && (n.type = "string"), n.enum = a;
2547
+ n.not = {};
2551
2548
  }, xa = (e, t, n, r) => {
2549
+ }, ja = (e, t, n, r) => {
2550
+ const o = e._zod.def, a = Xt(o.entries);
2551
+ a.every((i) => typeof i == "number") && (n.type = "number"), a.every((i) => typeof i == "string") && (n.type = "string"), n.enum = a;
2552
+ }, Ea = (e, t, n, r) => {
2552
2553
  const o = e._zod.def, a = [];
2553
2554
  for (const i of o.values)
2554
2555
  if (i === void 0) {
@@ -2565,16 +2566,16 @@ const ba = (e, t = {}) => (n) => {
2565
2566
  n.type = i === null ? "null" : typeof i, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [i] : n.const = i;
2566
2567
  } else
2567
2568
  a.every((i) => typeof i == "number") && (n.type = "number"), a.every((i) => typeof i == "string") && (n.type = "string"), a.every((i) => typeof i == "boolean") && (n.type = "boolean"), a.every((i) => i === null) && (n.type = "null"), n.enum = a;
2568
- }, ja = (e, t, n, r) => {
2569
+ }, za = (e, t, n, r) => {
2569
2570
  if (t.unrepresentable === "throw")
2570
2571
  throw new Error("Custom types cannot be represented in JSON Schema");
2571
- }, Ea = (e, t, n, r) => {
2572
+ }, Oa = (e, t, n, r) => {
2572
2573
  if (t.unrepresentable === "throw")
2573
2574
  throw new Error("Transforms cannot be represented in JSON Schema");
2574
- }, za = (e, t, n, r) => {
2575
+ }, Da = (e, t, n, r) => {
2575
2576
  const o = n, a = e._zod.def, { minimum: i, maximum: c } = e._zod.bag;
2576
2577
  typeof i == "number" && (o.minItems = i), typeof c == "number" && (o.maxItems = c), o.type = "array", o.items = O(a.element, t, { ...r, path: [...r.path, "items"] });
2577
- }, Oa = (e, t, n, r) => {
2578
+ }, Na = (e, t, n, r) => {
2578
2579
  const o = n, a = e._zod.def;
2579
2580
  o.type = "object", o.properties = {};
2580
2581
  const i = a.shape;
@@ -2591,13 +2592,13 @@ const ba = (e, t = {}) => (n) => {
2591
2592
  ...r,
2592
2593
  path: [...r.path, "additionalProperties"]
2593
2594
  })) : t.io === "output" && (o.additionalProperties = !1);
2594
- }, Da = (e, t, n, r) => {
2595
+ }, $a = (e, t, n, r) => {
2595
2596
  const o = e._zod.def, a = o.inclusive === !1, i = o.options.map((c, l) => O(c, t, {
2596
2597
  ...r,
2597
2598
  path: [...r.path, a ? "oneOf" : "anyOf", l]
2598
2599
  }));
2599
2600
  a ? n.oneOf = i : n.anyOf = i;
2600
- }, Na = (e, t, n, r) => {
2601
+ }, Ra = (e, t, n, r) => {
2601
2602
  const o = e._zod.def, a = O(o.left, t, {
2602
2603
  ...r,
2603
2604
  path: [...r.path, "allOf", 0]
@@ -2609,7 +2610,7 @@ const ba = (e, t = {}) => (n) => {
2609
2610
  ...c(i) ? i.allOf : [i]
2610
2611
  ];
2611
2612
  n.allOf = l;
2612
- }, $a = (e, t, n, r) => {
2613
+ }, Ca = (e, t, n, r) => {
2613
2614
  const o = n, a = e._zod.def;
2614
2615
  o.type = "object";
2615
2616
  const i = a.keyType, l = i._zod.bag?.patterns;
@@ -2634,25 +2635,25 @@ const ba = (e, t = {}) => (n) => {
2634
2635
  const h = [...p].filter((y) => typeof y == "string" || typeof y == "number");
2635
2636
  h.length > 0 && (o.required = h);
2636
2637
  }
2637
- }, Ra = (e, t, n, r) => {
2638
+ }, Za = (e, t, n, r) => {
2638
2639
  const o = e._zod.def, a = O(o.innerType, t, r), i = t.seen.get(e);
2639
2640
  t.target === "openapi-3.0" ? (i.ref = o.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
2640
- }, Ca = (e, t, n, r) => {
2641
+ }, Ma = (e, t, n, r) => {
2641
2642
  const o = e._zod.def;
2642
2643
  O(o.innerType, t, r);
2643
2644
  const a = t.seen.get(e);
2644
2645
  a.ref = o.innerType;
2645
- }, Za = (e, t, n, r) => {
2646
+ }, La = (e, t, n, r) => {
2646
2647
  const o = e._zod.def;
2647
2648
  O(o.innerType, t, r);
2648
2649
  const a = t.seen.get(e);
2649
2650
  a.ref = o.innerType, n.default = JSON.parse(JSON.stringify(o.defaultValue));
2650
- }, Ma = (e, t, n, r) => {
2651
+ }, qa = (e, t, n, r) => {
2651
2652
  const o = e._zod.def;
2652
2653
  O(o.innerType, t, r);
2653
2654
  const a = t.seen.get(e);
2654
2655
  a.ref = o.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(o.defaultValue)));
2655
- }, La = (e, t, n, r) => {
2656
+ }, Ua = (e, t, n, r) => {
2656
2657
  const o = e._zod.def;
2657
2658
  O(o.innerType, t, r);
2658
2659
  const a = t.seen.get(e);
@@ -2664,58 +2665,58 @@ const ba = (e, t = {}) => (n) => {
2664
2665
  throw new Error("Dynamic catch values are not supported in JSON Schema");
2665
2666
  }
2666
2667
  n.default = i;
2667
- }, qa = (e, t, n, r) => {
2668
+ }, Ba = (e, t, n, r) => {
2668
2669
  const o = e._zod.def, a = t.io === "input" ? o.in._zod.def.type === "transform" ? o.out : o.in : o.out;
2669
2670
  O(a, t, r);
2670
2671
  const i = t.seen.get(e);
2671
2672
  i.ref = a;
2672
- }, Ua = (e, t, n, r) => {
2673
+ }, Fa = (e, t, n, r) => {
2673
2674
  const o = e._zod.def;
2674
2675
  O(o.innerType, t, r);
2675
2676
  const a = t.seen.get(e);
2676
2677
  a.ref = o.innerType, n.readOnly = !0;
2677
- }, vn = (e, t, n, r) => {
2678
+ }, wn = (e, t, n, r) => {
2678
2679
  const o = e._zod.def;
2679
2680
  O(o.innerType, t, r);
2680
2681
  const a = t.seen.get(e);
2681
2682
  a.ref = o.innerType;
2682
- }, Ba = (e, t, n, r) => {
2683
+ }, Ga = (e, t, n, r) => {
2683
2684
  const o = e._zod.innerType;
2684
2685
  O(o, t, r);
2685
2686
  const a = t.seen.get(e);
2686
2687
  a.ref = o;
2687
- }, Fa = /* @__PURE__ */ u("ZodISODateTime", (e, t) => {
2688
- Lo.init(e, t), E.init(e, t);
2689
- });
2690
- function Ga(e) {
2691
- return /* @__PURE__ */ Wi(Fa, e);
2692
- }
2693
- const Ja = /* @__PURE__ */ u("ZodISODate", (e, t) => {
2694
- qo.init(e, t), E.init(e, t);
2688
+ }, Ja = /* @__PURE__ */ u("ZodISODateTime", (e, t) => {
2689
+ Uo.init(e, t), E.init(e, t);
2695
2690
  });
2696
2691
  function Va(e) {
2697
- return /* @__PURE__ */ Ki(Ja, e);
2692
+ return /* @__PURE__ */ Hi(Ja, e);
2698
2693
  }
2699
- const Wa = /* @__PURE__ */ u("ZodISOTime", (e, t) => {
2700
- Uo.init(e, t), E.init(e, t);
2694
+ const Wa = /* @__PURE__ */ u("ZodISODate", (e, t) => {
2695
+ Bo.init(e, t), E.init(e, t);
2701
2696
  });
2702
2697
  function Ka(e) {
2703
- return /* @__PURE__ */ Hi(Wa, e);
2698
+ return /* @__PURE__ */ Xi(Wa, e);
2704
2699
  }
2705
- const Ha = /* @__PURE__ */ u("ZodISODuration", (e, t) => {
2706
- Bo.init(e, t), E.init(e, t);
2700
+ const Ha = /* @__PURE__ */ u("ZodISOTime", (e, t) => {
2701
+ Fo.init(e, t), E.init(e, t);
2707
2702
  });
2708
2703
  function Xa(e) {
2709
- return /* @__PURE__ */ Xi(Ha, e);
2704
+ return /* @__PURE__ */ Yi(Ha, e);
2710
2705
  }
2711
- const Ya = (e, t) => {
2712
- en.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2706
+ const Ya = /* @__PURE__ */ u("ZodISODuration", (e, t) => {
2707
+ Go.init(e, t), E.init(e, t);
2708
+ });
2709
+ function Qa(e) {
2710
+ return /* @__PURE__ */ Qi(Ya, e);
2711
+ }
2712
+ const es = (e, t) => {
2713
+ tn.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2713
2714
  format: {
2714
- value: (n) => zr(e, n)
2715
+ value: (n) => Dr(e, n)
2715
2716
  // enumerable: false,
2716
2717
  },
2717
2718
  flatten: {
2718
- value: (n) => Er(e, n)
2719
+ value: (n) => Or(e, n)
2719
2720
  // enumerable: false,
2720
2721
  },
2721
2722
  addIssue: {
@@ -2737,21 +2738,21 @@ const Ya = (e, t) => {
2737
2738
  // enumerable: false,
2738
2739
  }
2739
2740
  });
2740
- }, G = u("ZodError", Ya, {
2741
+ }, G = u("ZodError", es, {
2741
2742
  Parent: Error
2742
- }), Qa = /* @__PURE__ */ rt(G), es = /* @__PURE__ */ ot(G), ts = /* @__PURE__ */ xe(G), ns = /* @__PURE__ */ je(G), rs = /* @__PURE__ */ Nr(G), os = /* @__PURE__ */ $r(G), is = /* @__PURE__ */ Rr(G), as = /* @__PURE__ */ Cr(G), ss = /* @__PURE__ */ Zr(G), cs = /* @__PURE__ */ Mr(G), ls = /* @__PURE__ */ Lr(G), ps = /* @__PURE__ */ qr(G), x = /* @__PURE__ */ u("ZodType", (e, t) => (A.init(e, t), Object.assign(e["~standard"], {
2743
+ }), ts = /* @__PURE__ */ rt(G), ns = /* @__PURE__ */ ot(G), rs = /* @__PURE__ */ xe(G), os = /* @__PURE__ */ je(G), is = /* @__PURE__ */ Rr(G), as = /* @__PURE__ */ Cr(G), ss = /* @__PURE__ */ Zr(G), cs = /* @__PURE__ */ Mr(G), ls = /* @__PURE__ */ Lr(G), ps = /* @__PURE__ */ qr(G), us = /* @__PURE__ */ Ur(G), ds = /* @__PURE__ */ Br(G), x = /* @__PURE__ */ u("ZodType", (e, t) => (A.init(e, t), Object.assign(e["~standard"], {
2743
2744
  jsonSchema: {
2744
2745
  input: we(e, "input"),
2745
2746
  output: we(e, "output")
2746
2747
  }
2747
- }), e.toJSONSchema = ba(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(ee(t, {
2748
+ }), e.toJSONSchema = wa(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(ee(t, {
2748
2749
  checks: [
2749
2750
  ...t.checks ?? [],
2750
2751
  ...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
2751
2752
  ]
2752
2753
  }), {
2753
2754
  parent: !0
2754
- }), e.with = e.check, e.clone = (n, r) => te(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => Qa(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => ts(e, n, r), e.parseAsync = async (n, r) => es(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => ns(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => rs(e, n, r), e.decode = (n, r) => os(e, n, r), e.encodeAsync = async (n, r) => is(e, n, r), e.decodeAsync = async (n, r) => as(e, n, r), e.safeEncode = (n, r) => ss(e, n, r), e.safeDecode = (n, r) => cs(e, n, r), e.safeEncodeAsync = async (n, r) => ls(e, n, r), e.safeDecodeAsync = async (n, r) => ps(e, n, r), e.refine = (n, r) => e.check(ic(n, r)), e.superRefine = (n) => e.check(ac(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ ue(n)), e.optional = () => Pt(e), e.exactOptional = () => Gs(e), e.nullable = () => At(e), e.nullish = () => Pt(At(e)), e.nonoptional = (n) => Xs(e, n), e.array = () => Z(e), e.or = (n) => In([e, n]), e.and = (n) => Ls(e, n), e.transform = (n) => Be(e, Tn(n)), e.default = (n) => Ws(e, n), e.prefault = (n) => Hs(e, n), e.catch = (n) => Qs(e, n), e.pipe = (n) => Be(e, n), e.readonly = () => nc(e), e.describe = (n) => {
2755
+ }), e.with = e.check, e.clone = (n, r) => te(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => ts(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => rs(e, n, r), e.parseAsync = async (n, r) => ns(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => os(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => is(e, n, r), e.decode = (n, r) => as(e, n, r), e.encodeAsync = async (n, r) => ss(e, n, r), e.decodeAsync = async (n, r) => cs(e, n, r), e.safeEncode = (n, r) => ls(e, n, r), e.safeDecode = (n, r) => ps(e, n, r), e.safeEncodeAsync = async (n, r) => us(e, n, r), e.safeDecodeAsync = async (n, r) => ds(e, n, r), e.refine = (n, r) => e.check(sc(n, r)), e.superRefine = (n) => e.check(cc(n)), e.overwrite = (n) => e.check(/* @__PURE__ */ ue(n)), e.optional = () => At(e), e.exactOptional = () => Vs(e), e.nullable = () => xt(e), e.nullish = () => At(xt(e)), e.nonoptional = (n) => Qs(e, n), e.array = () => Z(e), e.or = (n) => Tn([e, n]), e.and = (n) => Us(e, n), e.transform = (n) => Be(e, Sn(n)), e.default = (n) => Hs(e, n), e.prefault = (n) => Ys(e, n), e.catch = (n) => tc(e, n), e.pipe = (n) => Be(e, n), e.readonly = () => oc(e), e.describe = (n) => {
2755
2756
  const r = e.clone();
2756
2757
  return de.add(r, { description: n }), r;
2757
2758
  }, Object.defineProperty(e, "description", {
@@ -2764,102 +2765,102 @@ const Ya = (e, t) => {
2764
2765
  return de.get(e);
2765
2766
  const r = e.clone();
2766
2767
  return de.add(r, n[0]), r;
2767
- }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), wn = /* @__PURE__ */ u("_ZodString", (e, t) => {
2768
- it.init(e, t), x.init(e, t), e._zod.processJSONSchema = (r, o, a) => wa(e, r, o);
2768
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e.apply = (n) => n(e), e)), kn = /* @__PURE__ */ u("_ZodString", (e, t) => {
2769
+ it.init(e, t), x.init(e, t), e._zod.processJSONSchema = (r, o, a) => Ia(e, r, o);
2769
2770
  const n = e._zod.bag;
2770
- e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ oa(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ sa(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ ca(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ la(...r)), e.min = (...r) => e.check(/* @__PURE__ */ ve(...r)), e.max = (...r) => e.check(/* @__PURE__ */ hn(...r)), e.length = (...r) => e.check(/* @__PURE__ */ gn(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ ve(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ ia(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ aa(r)), e.trim = () => e.check(/* @__PURE__ */ ua()), e.normalize = (...r) => e.check(/* @__PURE__ */ pa(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ da()), e.toUpperCase = () => e.check(/* @__PURE__ */ ma()), e.slugify = () => e.check(/* @__PURE__ */ fa());
2771
- }), us = /* @__PURE__ */ u("ZodString", (e, t) => {
2772
- it.init(e, t), wn.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ Ai(ds, n)), e.url = (n) => e.check(/* @__PURE__ */ Oi(ms, n)), e.jwt = (n) => e.check(/* @__PURE__ */ Vi(xs, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Di(fs, n)), e.guid = (n) => e.check(/* @__PURE__ */ vt(Tt, n)), e.uuid = (n) => e.check(/* @__PURE__ */ xi(ye, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ ji(ye, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ Ei(ye, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ zi(ye, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Ni(hs, n)), e.guid = (n) => e.check(/* @__PURE__ */ vt(Tt, n)), e.cuid = (n) => e.check(/* @__PURE__ */ $i(gs, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Ri(ys, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Ci(_s, n)), e.base64 = (n) => e.check(/* @__PURE__ */ Fi(Ss, n)), e.base64url = (n) => e.check(/* @__PURE__ */ Gi(Ps, n)), e.xid = (n) => e.check(/* @__PURE__ */ Zi(bs, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ Mi(vs, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ Li(ws, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ qi(ks, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ Ui(Is, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ Bi(Ts, n)), e.e164 = (n) => e.check(/* @__PURE__ */ Ji(As, n)), e.datetime = (n) => e.check(Ga(n)), e.date = (n) => e.check(Va(n)), e.time = (n) => e.check(Ka(n)), e.duration = (n) => e.check(Xa(n));
2771
+ e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(/* @__PURE__ */ aa(...r)), e.includes = (...r) => e.check(/* @__PURE__ */ la(...r)), e.startsWith = (...r) => e.check(/* @__PURE__ */ pa(...r)), e.endsWith = (...r) => e.check(/* @__PURE__ */ ua(...r)), e.min = (...r) => e.check(/* @__PURE__ */ ve(...r)), e.max = (...r) => e.check(/* @__PURE__ */ gn(...r)), e.length = (...r) => e.check(/* @__PURE__ */ yn(...r)), e.nonempty = (...r) => e.check(/* @__PURE__ */ ve(1, ...r)), e.lowercase = (r) => e.check(/* @__PURE__ */ sa(r)), e.uppercase = (r) => e.check(/* @__PURE__ */ ca(r)), e.trim = () => e.check(/* @__PURE__ */ ma()), e.normalize = (...r) => e.check(/* @__PURE__ */ da(...r)), e.toLowerCase = () => e.check(/* @__PURE__ */ fa()), e.toUpperCase = () => e.check(/* @__PURE__ */ ha()), e.slugify = () => e.check(/* @__PURE__ */ ga());
2772
+ }), ms = /* @__PURE__ */ u("ZodString", (e, t) => {
2773
+ it.init(e, t), kn.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ ji(fs, n)), e.url = (n) => e.check(/* @__PURE__ */ Ni(hs, n)), e.jwt = (n) => e.check(/* @__PURE__ */ Ki(Es, n)), e.emoji = (n) => e.check(/* @__PURE__ */ $i(gs, n)), e.guid = (n) => e.check(/* @__PURE__ */ wt(St, n)), e.uuid = (n) => e.check(/* @__PURE__ */ Ei(ye, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ zi(ye, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ Oi(ye, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Di(ye, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Ri(ys, n)), e.guid = (n) => e.check(/* @__PURE__ */ wt(St, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Ci(_s, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Zi(bs, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Mi(vs, n)), e.base64 = (n) => e.check(/* @__PURE__ */ Ji(As, n)), e.base64url = (n) => e.check(/* @__PURE__ */ Vi(xs, n)), e.xid = (n) => e.check(/* @__PURE__ */ Li(ws, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ qi(ks, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ Ui(Is, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ Bi(Ts, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ Fi(Ss, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ Gi(Ps, n)), e.e164 = (n) => e.check(/* @__PURE__ */ Wi(js, n)), e.datetime = (n) => e.check(Va(n)), e.date = (n) => e.check(Ka(n)), e.time = (n) => e.check(Xa(n)), e.duration = (n) => e.check(Qa(n));
2773
2774
  });
2774
2775
  function d(e) {
2775
- return /* @__PURE__ */ Pi(us, e);
2776
+ return /* @__PURE__ */ xi(ms, e);
2776
2777
  }
2777
2778
  const E = /* @__PURE__ */ u("ZodStringFormat", (e, t) => {
2778
- j.init(e, t), wn.init(e, t);
2779
- }), ds = /* @__PURE__ */ u("ZodEmail", (e, t) => {
2779
+ j.init(e, t), kn.init(e, t);
2780
+ }), fs = /* @__PURE__ */ u("ZodEmail", (e, t) => {
2781
+ Do.init(e, t), E.init(e, t);
2782
+ }), St = /* @__PURE__ */ u("ZodGUID", (e, t) => {
2780
2783
  zo.init(e, t), E.init(e, t);
2781
- }), Tt = /* @__PURE__ */ u("ZodGUID", (e, t) => {
2782
- jo.init(e, t), E.init(e, t);
2783
2784
  }), ye = /* @__PURE__ */ u("ZodUUID", (e, t) => {
2784
- Eo.init(e, t), E.init(e, t);
2785
- }), ms = /* @__PURE__ */ u("ZodURL", (e, t) => {
2786
2785
  Oo.init(e, t), E.init(e, t);
2787
- }), fs = /* @__PURE__ */ u("ZodEmoji", (e, t) => {
2788
- Do.init(e, t), E.init(e, t);
2789
- }), hs = /* @__PURE__ */ u("ZodNanoID", (e, t) => {
2786
+ }), hs = /* @__PURE__ */ u("ZodURL", (e, t) => {
2790
2787
  No.init(e, t), E.init(e, t);
2791
- }), gs = /* @__PURE__ */ u("ZodCUID", (e, t) => {
2788
+ }), gs = /* @__PURE__ */ u("ZodEmoji", (e, t) => {
2792
2789
  $o.init(e, t), E.init(e, t);
2793
- }), ys = /* @__PURE__ */ u("ZodCUID2", (e, t) => {
2790
+ }), ys = /* @__PURE__ */ u("ZodNanoID", (e, t) => {
2794
2791
  Ro.init(e, t), E.init(e, t);
2795
- }), _s = /* @__PURE__ */ u("ZodULID", (e, t) => {
2792
+ }), _s = /* @__PURE__ */ u("ZodCUID", (e, t) => {
2796
2793
  Co.init(e, t), E.init(e, t);
2797
- }), bs = /* @__PURE__ */ u("ZodXID", (e, t) => {
2794
+ }), bs = /* @__PURE__ */ u("ZodCUID2", (e, t) => {
2798
2795
  Zo.init(e, t), E.init(e, t);
2799
- }), vs = /* @__PURE__ */ u("ZodKSUID", (e, t) => {
2796
+ }), vs = /* @__PURE__ */ u("ZodULID", (e, t) => {
2800
2797
  Mo.init(e, t), E.init(e, t);
2801
- }), ws = /* @__PURE__ */ u("ZodIPv4", (e, t) => {
2802
- Fo.init(e, t), E.init(e, t);
2803
- }), ks = /* @__PURE__ */ u("ZodIPv6", (e, t) => {
2804
- Go.init(e, t), E.init(e, t);
2805
- }), Is = /* @__PURE__ */ u("ZodCIDRv4", (e, t) => {
2798
+ }), ws = /* @__PURE__ */ u("ZodXID", (e, t) => {
2799
+ Lo.init(e, t), E.init(e, t);
2800
+ }), ks = /* @__PURE__ */ u("ZodKSUID", (e, t) => {
2801
+ qo.init(e, t), E.init(e, t);
2802
+ }), Is = /* @__PURE__ */ u("ZodIPv4", (e, t) => {
2806
2803
  Jo.init(e, t), E.init(e, t);
2807
- }), Ts = /* @__PURE__ */ u("ZodCIDRv6", (e, t) => {
2804
+ }), Ts = /* @__PURE__ */ u("ZodIPv6", (e, t) => {
2808
2805
  Vo.init(e, t), E.init(e, t);
2809
- }), Ss = /* @__PURE__ */ u("ZodBase64", (e, t) => {
2806
+ }), Ss = /* @__PURE__ */ u("ZodCIDRv4", (e, t) => {
2810
2807
  Wo.init(e, t), E.init(e, t);
2811
- }), Ps = /* @__PURE__ */ u("ZodBase64URL", (e, t) => {
2808
+ }), Ps = /* @__PURE__ */ u("ZodCIDRv6", (e, t) => {
2809
+ Ko.init(e, t), E.init(e, t);
2810
+ }), As = /* @__PURE__ */ u("ZodBase64", (e, t) => {
2812
2811
  Ho.init(e, t), E.init(e, t);
2813
- }), As = /* @__PURE__ */ u("ZodE164", (e, t) => {
2814
- Xo.init(e, t), E.init(e, t);
2815
- }), xs = /* @__PURE__ */ u("ZodJWT", (e, t) => {
2812
+ }), xs = /* @__PURE__ */ u("ZodBase64URL", (e, t) => {
2813
+ Yo.init(e, t), E.init(e, t);
2814
+ }), js = /* @__PURE__ */ u("ZodE164", (e, t) => {
2816
2815
  Qo.init(e, t), E.init(e, t);
2817
- }), kn = /* @__PURE__ */ u("ZodNumber", (e, t) => {
2818
- un.init(e, t), x.init(e, t), e._zod.processJSONSchema = (r, o, a) => ka(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */ kt(r, o)), e.gte = (r, o) => e.check(/* @__PURE__ */ De(r, o)), e.min = (r, o) => e.check(/* @__PURE__ */ De(r, o)), e.lt = (r, o) => e.check(/* @__PURE__ */ wt(r, o)), e.lte = (r, o) => e.check(/* @__PURE__ */ Oe(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ Oe(r, o)), e.int = (r) => e.check(St(r)), e.safe = (r) => e.check(St(r)), e.positive = (r) => e.check(/* @__PURE__ */ kt(0, r)), e.nonnegative = (r) => e.check(/* @__PURE__ */ De(0, r)), e.negative = (r) => e.check(/* @__PURE__ */ wt(0, r)), e.nonpositive = (r) => e.check(/* @__PURE__ */ Oe(0, r)), e.multipleOf = (r, o) => e.check(/* @__PURE__ */ It(r, o)), e.step = (r, o) => e.check(/* @__PURE__ */ It(r, o)), e.finite = () => e;
2816
+ }), Es = /* @__PURE__ */ u("ZodJWT", (e, t) => {
2817
+ ti.init(e, t), E.init(e, t);
2818
+ }), In = /* @__PURE__ */ u("ZodNumber", (e, t) => {
2819
+ dn.init(e, t), x.init(e, t), e._zod.processJSONSchema = (r, o, a) => Ta(e, r, o), e.gt = (r, o) => e.check(/* @__PURE__ */ It(r, o)), e.gte = (r, o) => e.check(/* @__PURE__ */ De(r, o)), e.min = (r, o) => e.check(/* @__PURE__ */ De(r, o)), e.lt = (r, o) => e.check(/* @__PURE__ */ kt(r, o)), e.lte = (r, o) => e.check(/* @__PURE__ */ Oe(r, o)), e.max = (r, o) => e.check(/* @__PURE__ */ Oe(r, o)), e.int = (r) => e.check(Pt(r)), e.safe = (r) => e.check(Pt(r)), e.positive = (r) => e.check(/* @__PURE__ */ It(0, r)), e.nonnegative = (r) => e.check(/* @__PURE__ */ De(0, r)), e.negative = (r) => e.check(/* @__PURE__ */ kt(0, r)), e.nonpositive = (r) => e.check(/* @__PURE__ */ Oe(0, r)), e.multipleOf = (r, o) => e.check(/* @__PURE__ */ Tt(r, o)), e.step = (r, o) => e.check(/* @__PURE__ */ Tt(r, o)), e.finite = () => e;
2819
2820
  const n = e._zod.bag;
2820
2821
  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;
2821
2822
  });
2822
2823
  function Y(e) {
2823
- return /* @__PURE__ */ Yi(kn, e);
2824
+ return /* @__PURE__ */ ea(In, e);
2824
2825
  }
2825
- const js = /* @__PURE__ */ u("ZodNumberFormat", (e, t) => {
2826
- ei.init(e, t), kn.init(e, t);
2826
+ const zs = /* @__PURE__ */ u("ZodNumberFormat", (e, t) => {
2827
+ ni.init(e, t), In.init(e, t);
2827
2828
  });
2828
- function St(e) {
2829
- return /* @__PURE__ */ Qi(js, e);
2829
+ function Pt(e) {
2830
+ return /* @__PURE__ */ ta(zs, e);
2830
2831
  }
2831
- const Es = /* @__PURE__ */ u("ZodBoolean", (e, t) => {
2832
- ti.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ia(e, n, r);
2832
+ const Os = /* @__PURE__ */ u("ZodBoolean", (e, t) => {
2833
+ ri.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Sa(e, n, r);
2833
2834
  });
2834
2835
  function k(e) {
2835
- return /* @__PURE__ */ ea(Es, e);
2836
+ return /* @__PURE__ */ na(Os, e);
2836
2837
  }
2837
- const zs = /* @__PURE__ */ u("ZodNull", (e, t) => {
2838
- ni.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ta(e, n, r);
2838
+ const Ds = /* @__PURE__ */ u("ZodNull", (e, t) => {
2839
+ oi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Pa(e, n, r);
2839
2840
  });
2840
- function Os(e) {
2841
- return /* @__PURE__ */ ta(zs, e);
2841
+ function Ns(e) {
2842
+ return /* @__PURE__ */ ra(Ds, e);
2842
2843
  }
2843
- const Ds = /* @__PURE__ */ u("ZodUnknown", (e, t) => {
2844
- ri.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Pa();
2844
+ const $s = /* @__PURE__ */ u("ZodUnknown", (e, t) => {
2845
+ ii.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => xa();
2845
2846
  });
2846
2847
  function ke() {
2847
- return /* @__PURE__ */ na(Ds);
2848
+ return /* @__PURE__ */ oa($s);
2848
2849
  }
2849
- const Ns = /* @__PURE__ */ u("ZodNever", (e, t) => {
2850
- oi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Sa(e, n, r);
2850
+ const Rs = /* @__PURE__ */ u("ZodNever", (e, t) => {
2851
+ ai.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Aa(e, n, r);
2851
2852
  });
2852
- function $s(e) {
2853
- return /* @__PURE__ */ ra(Ns, e);
2853
+ function Cs(e) {
2854
+ return /* @__PURE__ */ ia(Rs, e);
2854
2855
  }
2855
- const Rs = /* @__PURE__ */ u("ZodArray", (e, t) => {
2856
- ii.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => za(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ ve(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ ve(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ hn(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ gn(n, r)), e.unwrap = () => e.element;
2856
+ const Zs = /* @__PURE__ */ u("ZodArray", (e, t) => {
2857
+ si.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Da(e, n, r, o), e.element = t.element, e.min = (n, r) => e.check(/* @__PURE__ */ ve(n, r)), e.nonempty = (n) => e.check(/* @__PURE__ */ ve(1, n)), e.max = (n, r) => e.check(/* @__PURE__ */ gn(n, r)), e.length = (n, r) => e.check(/* @__PURE__ */ yn(n, r)), e.unwrap = () => e.element;
2857
2858
  });
2858
2859
  function Z(e, t) {
2859
- return /* @__PURE__ */ ha(Rs, e, t);
2860
+ return /* @__PURE__ */ ya(Zs, e, t);
2860
2861
  }
2861
- const Cs = /* @__PURE__ */ u("ZodObject", (e, t) => {
2862
- si.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Oa(e, n, r, o), T(e, "shape", () => t.shape), e.keyof = () => P(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ke() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ke() }), e.strict = () => e.clone({ ...e._zod.def, catchall: $s() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Sr(e, n), e.safeExtend = (n) => Pr(e, n), e.merge = (n) => Ar(e, n), e.pick = (n) => Ir(e, n), e.omit = (n) => Tr(e, n), e.partial = (...n) => xr(Sn, e, n[0]), e.required = (...n) => jr(Pn, e, n[0]);
2862
+ const Ms = /* @__PURE__ */ u("ZodObject", (e, t) => {
2863
+ li.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Na(e, n, r, o), T(e, "shape", () => t.shape), e.keyof = () => P(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: ke() }), e.loose = () => e.clone({ ...e._zod.def, catchall: ke() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Cs() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => Ar(e, n), e.safeExtend = (n) => xr(e, n), e.merge = (n) => jr(e, n), e.pick = (n) => Sr(e, n), e.omit = (n) => Pr(e, n), e.partial = (...n) => Er(Pn, e, n[0]), e.required = (...n) => zr(An, e, n[0]);
2863
2864
  });
2864
2865
  function S(e, t) {
2865
2866
  const n = {
@@ -2867,33 +2868,33 @@ function S(e, t) {
2867
2868
  shape: e ?? {},
2868
2869
  ..._(t)
2869
2870
  };
2870
- return new Cs(n);
2871
+ return new Ms(n);
2871
2872
  }
2872
- const Zs = /* @__PURE__ */ u("ZodUnion", (e, t) => {
2873
- ci.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Da(e, n, r, o), e.options = t.options;
2873
+ const Ls = /* @__PURE__ */ u("ZodUnion", (e, t) => {
2874
+ pi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => $a(e, n, r, o), e.options = t.options;
2874
2875
  });
2875
- function In(e, t) {
2876
- return new Zs({
2876
+ function Tn(e, t) {
2877
+ return new Ls({
2877
2878
  type: "union",
2878
2879
  options: e,
2879
2880
  ..._(t)
2880
2881
  });
2881
2882
  }
2882
- const Ms = /* @__PURE__ */ u("ZodIntersection", (e, t) => {
2883
- li.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Na(e, n, r, o);
2883
+ const qs = /* @__PURE__ */ u("ZodIntersection", (e, t) => {
2884
+ ui.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ra(e, n, r, o);
2884
2885
  });
2885
- function Ls(e, t) {
2886
- return new Ms({
2886
+ function Us(e, t) {
2887
+ return new qs({
2887
2888
  type: "intersection",
2888
2889
  left: e,
2889
2890
  right: t
2890
2891
  });
2891
2892
  }
2892
- const qs = /* @__PURE__ */ u("ZodRecord", (e, t) => {
2893
- pi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => $a(e, n, r, o), e.keyType = t.keyType, e.valueType = t.valueType;
2893
+ const Bs = /* @__PURE__ */ u("ZodRecord", (e, t) => {
2894
+ di.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ca(e, n, r, o), e.keyType = t.keyType, e.valueType = t.valueType;
2894
2895
  });
2895
2896
  function Q(e, t, n) {
2896
- return new qs({
2897
+ return new Bs({
2897
2898
  type: "record",
2898
2899
  keyType: e,
2899
2900
  valueType: t,
@@ -2901,7 +2902,7 @@ function Q(e, t, n) {
2901
2902
  });
2902
2903
  }
2903
2904
  const Ue = /* @__PURE__ */ u("ZodEnum", (e, t) => {
2904
- ui.init(e, t), x.init(e, t), e._zod.processJSONSchema = (r, o, a) => Aa(e, r, o), e.enum = t.entries, e.options = Object.values(t.entries);
2905
+ mi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (r, o, a) => ja(e, r, o), e.enum = t.entries, e.options = Object.values(t.entries);
2905
2906
  const n = new Set(Object.keys(t.entries));
2906
2907
  e.extract = (r, o) => {
2907
2908
  const a = {};
@@ -2939,8 +2940,8 @@ function P(e, t) {
2939
2940
  ..._(t)
2940
2941
  });
2941
2942
  }
2942
- const Us = /* @__PURE__ */ u("ZodLiteral", (e, t) => {
2943
- di.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => xa(e, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", {
2943
+ const Fs = /* @__PURE__ */ u("ZodLiteral", (e, t) => {
2944
+ fi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ea(e, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", {
2944
2945
  get() {
2945
2946
  if (t.values.length > 1)
2946
2947
  throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
@@ -2949,16 +2950,16 @@ const Us = /* @__PURE__ */ u("ZodLiteral", (e, t) => {
2949
2950
  });
2950
2951
  });
2951
2952
  function Ie(e, t) {
2952
- return new Us({
2953
+ return new Fs({
2953
2954
  type: "literal",
2954
2955
  values: Array.isArray(e) ? e : [e],
2955
2956
  ..._(t)
2956
2957
  });
2957
2958
  }
2958
- const Bs = /* @__PURE__ */ u("ZodTransform", (e, t) => {
2959
- mi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ea(e, n), e._zod.parse = (n, r) => {
2959
+ const Gs = /* @__PURE__ */ u("ZodTransform", (e, t) => {
2960
+ hi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Oa(e, n), e._zod.parse = (n, r) => {
2960
2961
  if (r.direction === "backward")
2961
- throw new Kt(e.constructor.name);
2962
+ throw new Ht(e.constructor.name);
2962
2963
  n.addIssue = (a) => {
2963
2964
  if (typeof a == "string")
2964
2965
  n.issues.push(me(a, n.value, t));
@@ -2971,170 +2972,170 @@ const Bs = /* @__PURE__ */ u("ZodTransform", (e, t) => {
2971
2972
  return o instanceof Promise ? o.then((a) => (n.value = a, n)) : (n.value = o, n);
2972
2973
  };
2973
2974
  });
2974
- function Tn(e) {
2975
- return new Bs({
2975
+ function Sn(e) {
2976
+ return new Gs({
2976
2977
  type: "transform",
2977
2978
  transform: e
2978
2979
  });
2979
2980
  }
2980
- const Sn = /* @__PURE__ */ u("ZodOptional", (e, t) => {
2981
- fn.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => vn(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
2981
+ const Pn = /* @__PURE__ */ u("ZodOptional", (e, t) => {
2982
+ hn.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => wn(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
2982
2983
  });
2983
- function Pt(e) {
2984
- return new Sn({
2984
+ function At(e) {
2985
+ return new Pn({
2985
2986
  type: "optional",
2986
2987
  innerType: e
2987
2988
  });
2988
2989
  }
2989
- const Fs = /* @__PURE__ */ u("ZodExactOptional", (e, t) => {
2990
- fi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => vn(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
2990
+ const Js = /* @__PURE__ */ u("ZodExactOptional", (e, t) => {
2991
+ gi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => wn(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
2991
2992
  });
2992
- function Gs(e) {
2993
- return new Fs({
2993
+ function Vs(e) {
2994
+ return new Js({
2994
2995
  type: "optional",
2995
2996
  innerType: e
2996
2997
  });
2997
2998
  }
2998
- const Js = /* @__PURE__ */ u("ZodNullable", (e, t) => {
2999
- hi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ra(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
2999
+ const Ws = /* @__PURE__ */ u("ZodNullable", (e, t) => {
3000
+ yi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Za(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3000
3001
  });
3001
- function At(e) {
3002
- return new Js({
3002
+ function xt(e) {
3003
+ return new Ws({
3003
3004
  type: "nullable",
3004
3005
  innerType: e
3005
3006
  });
3006
3007
  }
3007
- const Vs = /* @__PURE__ */ u("ZodDefault", (e, t) => {
3008
- gi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Za(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
3008
+ const Ks = /* @__PURE__ */ u("ZodDefault", (e, t) => {
3009
+ _i.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => La(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
3009
3010
  });
3010
- function Ws(e, t) {
3011
- return new Vs({
3011
+ function Hs(e, t) {
3012
+ return new Ks({
3012
3013
  type: "default",
3013
3014
  innerType: e,
3014
3015
  get defaultValue() {
3015
- return typeof t == "function" ? t() : Yt(t);
3016
+ return typeof t == "function" ? t() : Qt(t);
3016
3017
  }
3017
3018
  });
3018
3019
  }
3019
- const Ks = /* @__PURE__ */ u("ZodPrefault", (e, t) => {
3020
- yi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ma(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3020
+ const Xs = /* @__PURE__ */ u("ZodPrefault", (e, t) => {
3021
+ bi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => qa(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3021
3022
  });
3022
- function Hs(e, t) {
3023
- return new Ks({
3023
+ function Ys(e, t) {
3024
+ return new Xs({
3024
3025
  type: "prefault",
3025
3026
  innerType: e,
3026
3027
  get defaultValue() {
3027
- return typeof t == "function" ? t() : Yt(t);
3028
+ return typeof t == "function" ? t() : Qt(t);
3028
3029
  }
3029
3030
  });
3030
3031
  }
3031
- const Pn = /* @__PURE__ */ u("ZodNonOptional", (e, t) => {
3032
- _i.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ca(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3032
+ const An = /* @__PURE__ */ u("ZodNonOptional", (e, t) => {
3033
+ vi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ma(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3033
3034
  });
3034
- function Xs(e, t) {
3035
- return new Pn({
3035
+ function Qs(e, t) {
3036
+ return new An({
3036
3037
  type: "nonoptional",
3037
3038
  innerType: e,
3038
3039
  ..._(t)
3039
3040
  });
3040
3041
  }
3041
- const Ys = /* @__PURE__ */ u("ZodCatch", (e, t) => {
3042
- bi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => La(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
3042
+ const ec = /* @__PURE__ */ u("ZodCatch", (e, t) => {
3043
+ wi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ua(e, n, r, o), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
3043
3044
  });
3044
- function Qs(e, t) {
3045
- return new Ys({
3045
+ function tc(e, t) {
3046
+ return new ec({
3046
3047
  type: "catch",
3047
3048
  innerType: e,
3048
3049
  catchValue: typeof t == "function" ? t : () => t
3049
3050
  });
3050
3051
  }
3051
- const ec = /* @__PURE__ */ u("ZodPipe", (e, t) => {
3052
- vi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => qa(e, n, r, o), e.in = t.in, e.out = t.out;
3052
+ const nc = /* @__PURE__ */ u("ZodPipe", (e, t) => {
3053
+ ki.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ba(e, n, r, o), e.in = t.in, e.out = t.out;
3053
3054
  });
3054
3055
  function Be(e, t) {
3055
- return new ec({
3056
+ return new nc({
3056
3057
  type: "pipe",
3057
3058
  in: e,
3058
3059
  out: t
3059
3060
  // ...util.normalizeParams(params),
3060
3061
  });
3061
3062
  }
3062
- const tc = /* @__PURE__ */ u("ZodReadonly", (e, t) => {
3063
- wi.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ua(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3063
+ const rc = /* @__PURE__ */ u("ZodReadonly", (e, t) => {
3064
+ Ii.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Fa(e, n, r, o), e.unwrap = () => e._zod.def.innerType;
3064
3065
  });
3065
- function nc(e) {
3066
- return new tc({
3066
+ function oc(e) {
3067
+ return new rc({
3067
3068
  type: "readonly",
3068
3069
  innerType: e
3069
3070
  });
3070
3071
  }
3071
- const rc = /* @__PURE__ */ u("ZodLazy", (e, t) => {
3072
- ki.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ba(e, n, r, o), e.unwrap = () => e._zod.def.getter();
3072
+ const ic = /* @__PURE__ */ u("ZodLazy", (e, t) => {
3073
+ Ti.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => Ga(e, n, r, o), e.unwrap = () => e._zod.def.getter();
3073
3074
  });
3074
- function An(e) {
3075
- return new rc({
3075
+ function xn(e) {
3076
+ return new ic({
3076
3077
  type: "lazy",
3077
3078
  getter: e
3078
3079
  });
3079
3080
  }
3080
- const oc = /* @__PURE__ */ u("ZodCustom", (e, t) => {
3081
- Ii.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => ja(e, n);
3081
+ const ac = /* @__PURE__ */ u("ZodCustom", (e, t) => {
3082
+ Si.init(e, t), x.init(e, t), e._zod.processJSONSchema = (n, r, o) => za(e, n);
3082
3083
  });
3083
- function ic(e, t = {}) {
3084
- return /* @__PURE__ */ ga(oc, e, t);
3084
+ function sc(e, t = {}) {
3085
+ return /* @__PURE__ */ _a(ac, e, t);
3085
3086
  }
3086
- function ac(e) {
3087
- return /* @__PURE__ */ ya(e);
3087
+ function cc(e) {
3088
+ return /* @__PURE__ */ ba(e);
3088
3089
  }
3089
3090
  function at(e, t) {
3090
- return Be(Tn(e), t);
3091
+ return Be(Sn(e), t);
3091
3092
  }
3092
3093
  const le = {
3093
3094
  custom: "custom"
3094
3095
  };
3095
3096
  K({ jitless: !0 });
3096
- const sc = /^\d{4}-\d{2}-\d{2}$/, cc = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, lc = /^data:image\/(svg\+xml|png|jpeg|webp)(;charset=[^;,]+)?(;base64)?,/i, N = d().regex(sc), pc = at(
3097
+ const lc = /^\d{4}-\d{2}-\d{2}$/, pc = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/, uc = /^data:image\/(svg\+xml|png|jpeg|webp)(;charset=[^;,]+)?(;base64)?,/i, N = d().regex(lc), dc = at(
3097
3098
  (e) => e === "" ? null : e,
3098
3099
  N.nullable().optional()
3099
- ), f = Y().finite(), B = Y().int(), ae = Y().finite().min(0), b = d().trim().min(1), uc = d().trim().min(1).nullable(), z = d().trim().min(1).nullable().optional(), dc = at(
3100
+ ), f = Y().finite(), B = Y().int(), ae = Y().finite().min(0), b = d().trim().min(1), mc = d().trim().min(1).nullable(), z = d().trim().min(1).nullable().optional(), fc = at(
3100
3101
  (e) => e === void 0 ? null : e,
3101
- uc
3102
- ), xn = d().regex(cc), mc = d().regex(lc), jn = P(["image/svg+xml", "image/png", "image/jpeg", "image/webp"]), En = P([
3102
+ mc
3103
+ ), jn = d().regex(pc), hc = d().regex(uc), En = P(["image/svg+xml", "image/png", "image/jpeg", "image/webp"]), zn = P([
3103
3104
  "classic",
3104
3105
  "neutral"
3105
- ]), zn = P([
3106
+ ]), On = P([
3106
3107
  "invoice-left-logo-right",
3107
3108
  "invoice-center-logo-center",
3108
3109
  "invoice-right-logo-left"
3109
- ]), Te = An(() => In([
3110
+ ]), Te = xn(() => Tn([
3110
3111
  d(),
3111
3112
  f,
3112
3113
  k(),
3113
- Os(),
3114
+ Ns(),
3114
3115
  Z(Te),
3115
3116
  Q(d(), Te)
3116
- ])), On = An(() => S({
3117
+ ])), Dn = xn(() => S({
3117
3118
  type: b,
3118
3119
  attrs: Q(d(), Te).nullable().optional(),
3119
- content: Z(On).optional(),
3120
+ content: Z(Dn).optional(),
3120
3121
  marks: Z(S({
3121
3122
  type: b,
3122
3123
  attrs: Q(d(), Te).nullable().optional()
3123
3124
  }).passthrough()).optional(),
3124
3125
  text: d().optional()
3125
- }).passthrough()), xt = S({
3126
+ }).passthrough()), jt = S({
3126
3127
  version: Ie(1),
3127
3128
  type: Ie("tiptap-json"),
3128
- content: On,
3129
+ content: Dn,
3129
3130
  plainTextPreview: d().optional(),
3130
3131
  updatedAt: f
3131
- }).passthrough(), fc = at((e) => {
3132
+ }).passthrough(), gc = at((e) => {
3132
3133
  if (e == null)
3133
3134
  return e;
3134
- const t = xt.safeParse(e);
3135
+ const t = jt.safeParse(e);
3135
3136
  if (t.success)
3136
3137
  return t.data;
3137
- }, xt.nullable().optional()), hc = S({
3138
+ }, jt.nullable().optional()), yc = S({
3138
3139
  type: P(["weekly", "monthly", "yearly"]),
3139
3140
  weeklyDays: Z(Y().int().min(0).max(6)).optional(),
3140
3141
  monthlyType: P(["first", "last", "specific"]).optional(),
@@ -3147,7 +3148,7 @@ S({
3147
3148
  createdAt: f.optional(),
3148
3149
  updatedAt: f.optional(),
3149
3150
  description: d().optional(),
3150
- notes: fc,
3151
+ notes: gc,
3151
3152
  hourlyRate: f.nullable().optional(),
3152
3153
  flatRate: k().optional(),
3153
3154
  preferredClientId: z,
@@ -3182,7 +3183,7 @@ S({
3182
3183
  createdAt: f.optional(),
3183
3184
  lastBilledAt: f.nullable().optional(),
3184
3185
  startDate: N.nullable().optional(),
3185
- recurring: hc.nullable().optional(),
3186
+ recurring: yc.nullable().optional(),
3186
3187
  promptTimeEntry: k().optional(),
3187
3188
  skipUntilNextRecurring: k().optional(),
3188
3189
  skippedOccurrenceDate: N.nullable().optional(),
@@ -3270,7 +3271,7 @@ S({
3270
3271
  taxLabel: d().optional(),
3271
3272
  taxRate: f.optional(),
3272
3273
  branding: S({
3273
- primaryColor: xn.nullable().optional(),
3274
+ primaryColor: jn.nullable().optional(),
3274
3275
  logoAssetId: z
3275
3276
  }).passthrough().optional()
3276
3277
  }).superRefine((e, t) => {
@@ -3288,8 +3289,8 @@ S({
3288
3289
  id: b,
3289
3290
  businessInfoId: b,
3290
3291
  kind: Ie("logo"),
3291
- dataUrl: mc,
3292
- mimeType: jn,
3292
+ dataUrl: hc,
3293
+ mimeType: En,
3293
3294
  fileName: d().nullable().optional(),
3294
3295
  width: B.positive(),
3295
3296
  height: B.positive(),
@@ -3299,7 +3300,7 @@ S({
3299
3300
  updatedAt: f.nullable().optional(),
3300
3301
  archivedAt: f.nullable().optional()
3301
3302
  }).passthrough();
3302
- const gc = S({
3303
+ const _c = S({
3303
3304
  description: d(),
3304
3305
  quantity: f,
3305
3306
  rate: f,
@@ -3315,13 +3316,13 @@ const gc = S({
3315
3316
  rateLabel: d().optional(),
3316
3317
  quantityLabel: d().optional(),
3317
3318
  pricingMode: P(["hourly", "flat", "mixed"]).optional()
3318
- }).passthrough(), Dn = S({
3319
+ }).passthrough(), Nn = S({
3319
3320
  capturedAt: f,
3320
3321
  sourceCurrency: b,
3321
3322
  sourceAmount: f,
3322
3323
  preferredCurrencyAtPayment: b,
3323
3324
  preferredCurrencyAmount: f
3324
- }).passthrough(), yc = S({
3325
+ }).passthrough(), bc = S({
3325
3326
  projectId: b,
3326
3327
  projectTitle: b,
3327
3328
  clientId: b,
@@ -3334,16 +3335,16 @@ const gc = S({
3334
3335
  allocatedShipping: f.optional(),
3335
3336
  allocatedTax: f.optional(),
3336
3337
  allocatedTotal: f.optional()
3337
- }).passthrough(), _c = S({
3338
+ }).passthrough(), vc = S({
3338
3339
  version: Ie(1),
3339
3340
  capturedAt: f,
3340
3341
  taskLastBilledAt: Q(d(), f.nullable())
3341
3342
  }).passthrough();
3342
3343
  S({
3343
3344
  id: b,
3344
- projectId: dc,
3345
+ projectId: fc,
3345
3346
  projectIds: Z(b).optional(),
3346
- projectBreakdowns: Z(yc).optional(),
3347
+ projectBreakdowns: Z(bc).optional(),
3347
3348
  clientId: b,
3348
3349
  createdAt: f.optional(),
3349
3350
  updatedAt: f.optional(),
@@ -3352,7 +3353,7 @@ S({
3352
3353
  date: N,
3353
3354
  dueDate: N.nullable().optional(),
3354
3355
  status: P(["draft", "sent", "paid", "overdue"]),
3355
- items: Z(gc),
3356
+ items: Z(_c),
3356
3357
  subtotal: f,
3357
3358
  tax: f.optional(),
3358
3359
  taxRate: f.optional(),
@@ -3364,21 +3365,21 @@ S({
3364
3365
  billingPeriodEnd: N.nullable().optional(),
3365
3366
  currency: d().optional(),
3366
3367
  paidAt: f.nullable().optional(),
3367
- paymentCurrencySnapshot: Dn.nullable().optional(),
3368
+ paymentCurrencySnapshot: Nn.nullable().optional(),
3368
3369
  sentAt: f.nullable().optional(),
3369
3370
  sentToEmail: d().nullable().optional(),
3370
- billingStateSnapshot: _c.nullable().optional(),
3371
+ billingStateSnapshot: vc.nullable().optional(),
3371
3372
  brandingSnapshot: S({
3372
3373
  businessInfoId: z,
3373
3374
  templateId: z,
3374
- layoutStyle: En.optional(),
3375
- logoPlacement: zn,
3375
+ layoutStyle: zn.optional(),
3376
+ logoPlacement: On,
3376
3377
  showBusinessLogo: k(),
3377
3378
  useBusinessPrimaryColor: k(),
3378
- primaryColor: xn.nullable().optional(),
3379
+ primaryColor: jn.nullable().optional(),
3379
3380
  logoAssetId: z,
3380
3381
  logoAssetMeta: S({
3381
- mimeType: jn,
3382
+ mimeType: En,
3382
3383
  width: B.positive(),
3383
3384
  height: B.positive(),
3384
3385
  byteSize: B.positive(),
@@ -3400,8 +3401,8 @@ S({
3400
3401
  showBusinessLogo: k().optional(),
3401
3402
  useBusinessPrimaryColor: k().optional()
3402
3403
  }).passthrough().optional(),
3403
- layoutStyle: En.optional(),
3404
- logoPlacement: zn.optional(),
3404
+ layoutStyle: zn.optional(),
3405
+ logoPlacement: On.optional(),
3405
3406
  showBillingPeriod: k().optional(),
3406
3407
  showProjectTitle: k().optional()
3407
3408
  }).passthrough();
@@ -3444,7 +3445,7 @@ S({
3444
3445
  receiptNumber: d().nullable().optional(),
3445
3446
  currency: b,
3446
3447
  amount: f,
3447
- paidOn: pc,
3448
+ paidOn: dc,
3448
3449
  paidBy: d().nullable().optional(),
3449
3450
  paymentStatus: P(["unpaid", "paid"]),
3450
3451
  paymentMode: P(["manual", "auto"]).optional().default("manual"),
@@ -3468,7 +3469,7 @@ S({
3468
3469
  taxClaimStatus: P(["unclaimed", "claimed", "excluded"]).nullable().optional(),
3469
3470
  taxClaimPeriodId: z,
3470
3471
  taxClaimedAt: f.nullable().optional(),
3471
- paymentCurrencySnapshot: Dn.nullable().optional().catch(null),
3472
+ paymentCurrencySnapshot: Nn.nullable().optional().catch(null),
3472
3473
  isPreview: k().optional(),
3473
3474
  createdAt: f.optional(),
3474
3475
  updatedAt: f.optional()
@@ -3594,9 +3595,9 @@ S({
3594
3595
  lastActive: f.optional()
3595
3596
  }).passthrough();
3596
3597
  const Fe = (e, t) => t.some((n) => e instanceof n);
3597
- let jt, Et;
3598
- function bc() {
3599
- return jt || (jt = [
3598
+ let Et, zt;
3599
+ function wc() {
3600
+ return Et || (Et = [
3600
3601
  IDBDatabase,
3601
3602
  IDBObjectStore,
3602
3603
  IDBIndex,
@@ -3604,15 +3605,15 @@ function bc() {
3604
3605
  IDBTransaction
3605
3606
  ]);
3606
3607
  }
3607
- function vc() {
3608
- return Et || (Et = [
3608
+ function kc() {
3609
+ return zt || (zt = [
3609
3610
  IDBCursor.prototype.advance,
3610
3611
  IDBCursor.prototype.continue,
3611
3612
  IDBCursor.prototype.continuePrimaryKey
3612
3613
  ]);
3613
3614
  }
3614
3615
  const Ge = /* @__PURE__ */ new WeakMap(), Ne = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap();
3615
- function wc(e) {
3616
+ function Ic(e) {
3616
3617
  const t = new Promise((n, r) => {
3617
3618
  const o = () => {
3618
3619
  e.removeEventListener("success", a), e.removeEventListener("error", i);
@@ -3625,7 +3626,7 @@ function wc(e) {
3625
3626
  });
3626
3627
  return ze.set(t, e), t;
3627
3628
  }
3628
- function kc(e) {
3629
+ function Tc(e) {
3629
3630
  if (Ge.has(e))
3630
3631
  return;
3631
3632
  const t = new Promise((n, r) => {
@@ -3657,37 +3658,37 @@ let Je = {
3657
3658
  return e instanceof IDBTransaction && (t === "done" || t === "store") ? !0 : t in e;
3658
3659
  }
3659
3660
  };
3660
- function Nn(e) {
3661
+ function $n(e) {
3661
3662
  Je = e(Je);
3662
3663
  }
3663
- function Ic(e) {
3664
- return vc().includes(e) ? function(...t) {
3664
+ function Sc(e) {
3665
+ return kc().includes(e) ? function(...t) {
3665
3666
  return e.apply(Ve(this), t), Se(this.request);
3666
3667
  } : function(...t) {
3667
3668
  return Se(e.apply(Ve(this), t));
3668
3669
  };
3669
3670
  }
3670
- function Tc(e) {
3671
- return typeof e == "function" ? Ic(e) : (e instanceof IDBTransaction && kc(e), Fe(e, bc()) ? new Proxy(e, Je) : e);
3671
+ function Pc(e) {
3672
+ return typeof e == "function" ? Sc(e) : (e instanceof IDBTransaction && Tc(e), Fe(e, wc()) ? new Proxy(e, Je) : e);
3672
3673
  }
3673
3674
  function Se(e) {
3674
3675
  if (e instanceof IDBRequest)
3675
- return wc(e);
3676
+ return Ic(e);
3676
3677
  if (Ne.has(e))
3677
3678
  return Ne.get(e);
3678
- const t = Tc(e);
3679
+ const t = Pc(e);
3679
3680
  return t !== e && (Ne.set(e, t), ze.set(t, e)), t;
3680
3681
  }
3681
- const Ve = (e) => ze.get(e), Sc = ["get", "getKey", "getAll", "getAllKeys", "count"], Pc = ["put", "add", "delete", "clear"], $e = /* @__PURE__ */ new Map();
3682
- function zt(e, t) {
3682
+ const Ve = (e) => ze.get(e), Ac = ["get", "getKey", "getAll", "getAllKeys", "count"], xc = ["put", "add", "delete", "clear"], $e = /* @__PURE__ */ new Map();
3683
+ function Ot(e, t) {
3683
3684
  if (!(e instanceof IDBDatabase && !(t in e) && typeof t == "string"))
3684
3685
  return;
3685
3686
  if ($e.get(t))
3686
3687
  return $e.get(t);
3687
- const n = t.replace(/FromIndex$/, ""), r = t !== n, o = Pc.includes(n);
3688
+ const n = t.replace(/FromIndex$/, ""), r = t !== n, o = xc.includes(n);
3688
3689
  if (
3689
3690
  // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
3690
- !(n in (r ? IDBIndex : IDBObjectStore).prototype) || !(o || Sc.includes(n))
3691
+ !(n in (r ? IDBIndex : IDBObjectStore).prototype) || !(o || Ac.includes(n))
3691
3692
  )
3692
3693
  return;
3693
3694
  const a = async function(i, ...c) {
@@ -3700,53 +3701,53 @@ function zt(e, t) {
3700
3701
  };
3701
3702
  return $e.set(t, a), a;
3702
3703
  }
3703
- Nn((e) => ({
3704
+ $n((e) => ({
3704
3705
  ...e,
3705
- get: (t, n, r) => zt(t, n) || e.get(t, n, r),
3706
- has: (t, n) => !!zt(t, n) || e.has(t, n)
3706
+ get: (t, n, r) => Ot(t, n) || e.get(t, n, r),
3707
+ has: (t, n) => !!Ot(t, n) || e.has(t, n)
3707
3708
  }));
3708
- const Ac = ["continue", "continuePrimaryKey", "advance"], Ot = {}, We = /* @__PURE__ */ new WeakMap(), $n = /* @__PURE__ */ new WeakMap(), xc = {
3709
+ const jc = ["continue", "continuePrimaryKey", "advance"], Dt = {}, We = /* @__PURE__ */ new WeakMap(), Rn = /* @__PURE__ */ new WeakMap(), Ec = {
3709
3710
  get(e, t) {
3710
- if (!Ac.includes(t))
3711
+ if (!jc.includes(t))
3711
3712
  return e[t];
3712
- let n = Ot[t];
3713
- return n || (n = Ot[t] = function(...r) {
3714
- We.set(this, $n.get(this)[t](...r));
3713
+ let n = Dt[t];
3714
+ return n || (n = Dt[t] = function(...r) {
3715
+ We.set(this, Rn.get(this)[t](...r));
3715
3716
  }), n;
3716
3717
  }
3717
3718
  };
3718
- async function* jc(...e) {
3719
+ async function* zc(...e) {
3719
3720
  let t = this;
3720
3721
  if (t instanceof IDBCursor || (t = await t.openCursor(...e)), !t)
3721
3722
  return;
3722
3723
  t = t;
3723
- const n = new Proxy(t, xc);
3724
- for ($n.set(n, t), ze.set(n, Ve(t)); t; )
3724
+ const n = new Proxy(t, Ec);
3725
+ for (Rn.set(n, t), ze.set(n, Ve(t)); t; )
3725
3726
  yield n, t = await (We.get(n) || t.continue()), We.delete(n);
3726
3727
  }
3727
- function Dt(e, t) {
3728
+ function Nt(e, t) {
3728
3729
  return t === Symbol.asyncIterator && Fe(e, [IDBIndex, IDBObjectStore, IDBCursor]) || t === "iterate" && Fe(e, [IDBIndex, IDBObjectStore]);
3729
3730
  }
3730
- Nn((e) => ({
3731
+ $n((e) => ({
3731
3732
  ...e,
3732
3733
  get(t, n, r) {
3733
- return Dt(t, n) ? jc : e.get(t, n, r);
3734
+ return Nt(t, n) ? zc : e.get(t, n, r);
3734
3735
  },
3735
3736
  has(t, n) {
3736
- return Dt(t, n) || e.has(t, n);
3737
+ return Nt(t, n) || e.has(t, n);
3737
3738
  }
3738
3739
  }));
3739
3740
  Promise.resolve(void 0);
3740
- const Ec = [
3741
+ const Oc = [
3741
3742
  { value: "last-month", label: "Last Month" },
3742
3743
  { value: "month", label: "This Month" },
3743
3744
  { value: "all-time", label: "All Time" },
3744
3745
  { value: "custom", label: "Custom Range" }
3745
3746
  ];
3746
3747
  new Set(
3747
- Ec.map((e) => e.value)
3748
+ Oc.map((e) => e.value)
3748
3749
  );
3749
- const zc = [
3750
+ const Dc = [
3750
3751
  "Needs review",
3751
3752
  "Not due",
3752
3753
  "1-30 days",
@@ -3754,45 +3755,45 @@ const zc = [
3754
3755
  "61-90 days",
3755
3756
  "90+ days"
3756
3757
  ];
3757
- zc.reduce((e, t, n) => (e.set(t, n), e), /* @__PURE__ */ new Map());
3758
+ Dc.reduce((e, t, n) => (e.set(t, n), e), /* @__PURE__ */ new Map());
3758
3759
  const pe = 1;
3759
- function Oc(e) {
3760
+ function Nc(e) {
3760
3761
  if (!e || typeof e != "object")
3761
3762
  return !1;
3762
3763
  const t = e;
3763
3764
  return t.type === "agent_bridge_control" && t.protocolVersion === pe && typeof t.sessionToken == "string" && t.sessionToken.trim().length > 0 && t.action === "revoke";
3764
3765
  }
3765
- function Dc(e) {
3766
+ function $c(e) {
3766
3767
  if (!e || typeof e != "object")
3767
3768
  return !1;
3768
3769
  const t = e, n = t.grant;
3769
3770
  return t.type === "agent_bridge_approval_grant" && t.protocolVersion === pe && typeof t.sessionToken == "string" && t.sessionToken.trim().length > 0 && !!n && typeof n == "object" && typeof n.id == "string" && n.id.trim().length > 0 && typeof n.clientId == "string" && n.clientId.trim().length > 0 && (n.label === void 0 || typeof n.label == "string") && Array.isArray(n.scopes) && n.scopes.every((r) => typeof r == "string") && typeof n.secretKeyBase64Url == "string" && n.secretKeyBase64Url.trim().length > 0 && typeof n.createdAt == "number" && Number.isFinite(n.createdAt) && (n.expiresAt === void 0 || n.expiresAt === null || typeof n.expiresAt == "number" && Number.isFinite(n.expiresAt));
3770
3771
  }
3771
- function Nc(e) {
3772
+ function Rc(e) {
3772
3773
  if (!e || typeof e != "object")
3773
3774
  return !1;
3774
3775
  const t = e;
3775
3776
  return t.type === "agent_bridge_approval_grant_revoke" && t.protocolVersion === pe && typeof t.sessionToken == "string" && t.sessionToken.trim().length > 0 && typeof t.grantId == "string" && t.grantId.trim().length > 0 && typeof t.revokedAt == "number" && Number.isFinite(t.revokedAt);
3776
3777
  }
3777
- const Rn = [
3778
+ const Cn = [
3778
3779
  "https://tasktime.pro",
3779
3780
  "https://www.tasktime.pro",
3780
3781
  "http://localhost:3101",
3781
3782
  "http://127.0.0.1:3101",
3782
3783
  "http://localhost:5173",
3783
3784
  "http://127.0.0.1:5173"
3784
- ], $c = /* @__PURE__ */ new Set([
3785
+ ], Cc = /* @__PURE__ */ new Set([
3785
3786
  "localhost",
3786
3787
  "127.0.0.1",
3787
3788
  "::1",
3788
3789
  "[::1]"
3789
3790
  ]);
3790
- function Rc(e) {
3791
+ function Zc(e) {
3791
3792
  return e.trim().toLowerCase();
3792
3793
  }
3793
- function Cc(e) {
3794
- const t = Rc(e);
3795
- if ($c.has(t))
3794
+ function Mc(e) {
3795
+ const t = Zc(e);
3796
+ if (Cc.has(t))
3796
3797
  return !0;
3797
3798
  const n = t.split(".");
3798
3799
  return n.length !== 4 || n[0] !== "127" ? !1 : n.every((r) => {
@@ -3802,45 +3803,45 @@ function Cc(e) {
3802
3803
  return o >= 0 && o <= 255;
3803
3804
  });
3804
3805
  }
3805
- function Zc(e) {
3806
- if (!Cc(e))
3806
+ function Lc(e) {
3807
+ if (!Mc(e))
3807
3808
  throw new D("INVALID_INPUT", "Agent bridge server must bind to a loopback host.", { host: e });
3808
3809
  }
3809
- function Nt(e) {
3810
+ function $t(e) {
3810
3811
  try {
3811
3812
  return new URL(e).origin;
3812
3813
  } catch {
3813
3814
  return null;
3814
3815
  }
3815
3816
  }
3816
- function Mc(e, t = Rn) {
3817
+ function qc(e, t = Cn) {
3817
3818
  if (!e)
3818
3819
  return !1;
3819
- const n = Nt(e);
3820
- return n ? new Set(Array.from(t).map((r) => Nt(r)).filter(Boolean)).has(n) : !1;
3820
+ const n = $t(e);
3821
+ return n ? new Set(Array.from(t).map((r) => $t(r)).filter(Boolean)).has(n) : !1;
3821
3822
  }
3822
- function Lc(e, t) {
3823
- if (!Mc(e, t))
3823
+ function Uc(e, t) {
3824
+ if (!qc(e, t))
3824
3825
  throw new D("PERMISSION_DENIED", "Origin is not allowed to connect to the TaskTime Pro agent bridge.", {
3825
3826
  origin: e || null
3826
3827
  });
3827
3828
  }
3828
- const qc = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11", Uc = "/tasktime-agent", Bc = 12e4;
3829
- class Fc {
3829
+ const Bc = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11", Fc = "/tasktime-agent", Gc = 12e4;
3830
+ class Jc {
3830
3831
  constructor(t, n, r = null) {
3831
3832
  this.id = n, this.session = r, this.socket = t;
3832
3833
  }
3833
3834
  sendJson(t) {
3834
- this.socket.destroyed || this.socket.write(Jc(JSON.stringify(t)));
3835
+ this.socket.destroyed || this.socket.write(Wc(JSON.stringify(t)));
3835
3836
  }
3836
3837
  close() {
3837
3838
  this.socket.destroy();
3838
3839
  }
3839
3840
  }
3840
- function Gc(e) {
3841
- return Jt("sha1").update(`${e}${qc}`).digest("base64");
3841
+ function Vc(e) {
3842
+ return Vt("sha1").update(`${e}${Bc}`).digest("base64");
3842
3843
  }
3843
- function Jc(e) {
3844
+ function Wc(e) {
3844
3845
  const t = H.from(e), n = t.length;
3845
3846
  if (n < 126)
3846
3847
  return H.concat([
@@ -3854,7 +3855,7 @@ function Jc(e) {
3854
3855
  const r = H.alloc(10);
3855
3856
  return r[0] = 129, r[1] = 127, r.writeBigUInt64BE(BigInt(n), 2), H.concat([r, t]);
3856
3857
  }
3857
- function Vc(e) {
3858
+ function Kc(e) {
3858
3859
  const t = [];
3859
3860
  let n = 0;
3860
3861
  for (; n + 2 <= e.length; ) {
@@ -3883,24 +3884,24 @@ function Vc(e) {
3883
3884
  }
3884
3885
  return t;
3885
3886
  }
3886
- function Wc(e) {
3887
+ function Hc(e) {
3887
3888
  const t = e.headers.host || "127.0.0.1";
3888
3889
  return new URL(e.url || "/", `http://${t}`);
3889
3890
  }
3890
- function Kc(e) {
3891
+ function Xc(e) {
3891
3892
  if (!e || typeof e != "object")
3892
3893
  return !1;
3893
3894
  const t = e, n = t.response;
3894
3895
  return t.protocolVersion === pe && typeof t.requestId == "string" && !!n && typeof n == "object" && typeof n.command == "string" && typeof n.ok == "boolean";
3895
3896
  }
3896
- class Hc {
3897
+ class Yc {
3897
3898
  constructor(t) {
3898
- this.clients = /* @__PURE__ */ new Set(), this.pendingResponses = /* @__PURE__ */ new Map(), this.server = null, this.nextClientId = 0, this.authoritativeClientId = null, Zc(t.host), this.options = t, this.auditLog = t.auditLog ?? new Vt();
3899
+ this.clients = /* @__PURE__ */ new Set(), this.pendingResponses = /* @__PURE__ */ new Map(), this.server = null, this.nextClientId = 0, this.authoritativeClientId = null, Lc(t.host), this.options = t, this.auditLog = t.auditLog ?? new Wt();
3899
3900
  }
3900
3901
  async start() {
3901
3902
  if (this.server)
3902
3903
  return;
3903
- const t = Hn();
3904
+ const t = Yn();
3904
3905
  this.server = t, t.on("upgrade", (n, r) => {
3905
3906
  this.handleUpgrade(n, r);
3906
3907
  }), await new Promise((n) => {
@@ -3984,7 +3985,7 @@ class Hc {
3984
3985
  }), a(new D("UNAVAILABLE", "Agent app-session request timed out.", {
3985
3986
  requestId: t.requestId
3986
3987
  }));
3987
- }, n.timeoutMs ?? Bc);
3988
+ }, n.timeoutMs ?? Gc);
3988
3989
  this.pendingResponses.set(t.requestId, {
3989
3990
  client: r,
3990
3991
  timeoutId: i,
@@ -4062,7 +4063,7 @@ class Hc {
4062
4063
  return null;
4063
4064
  throw new D("PERMISSION_DENIED", "Pairing credentials are required for the TaskTime Pro agent bridge.");
4064
4065
  }
4065
- const a = n.now ? n.now() : Date.now(), i = n.store.consume(r, o, a), c = hr({
4066
+ const a = n.now ? n.now() : Date.now(), i = n.store.consume(r, o, a), c = yr({
4066
4067
  scopes: i.scopes,
4067
4068
  now: () => a,
4068
4069
  ttlMs: n.sessionTtlMs,
@@ -4086,9 +4087,9 @@ class Hc {
4086
4087
  }
4087
4088
  async handleUpgrade(t, n) {
4088
4089
  try {
4089
- Lc(t.headers.origin, this.options.allowedOrigins || Rn);
4090
- const r = Wc(t);
4091
- if (r.pathname !== (this.options.path || Uc))
4090
+ Uc(t.headers.origin, this.options.allowedOrigins || Cn);
4091
+ const r = Hc(t);
4092
+ if (r.pathname !== (this.options.path || Fc))
4092
4093
  throw new Error("Invalid agent bridge WebSocket path.");
4093
4094
  const o = t.headers["sec-websocket-key"];
4094
4095
  if (typeof o != "string" || !o.trim())
@@ -4098,12 +4099,12 @@ class Hc {
4098
4099
  "HTTP/1.1 101 Switching Protocols",
4099
4100
  "Upgrade: websocket",
4100
4101
  "Connection: Upgrade",
4101
- `Sec-WebSocket-Accept: ${Gc(o)}`,
4102
+ `Sec-WebSocket-Accept: ${Vc(o)}`,
4102
4103
  "",
4103
4104
  ""
4104
4105
  ].join(`\r
4105
4106
  `));
4106
- const i = new Fc(n, `client-${this.nextClientId++}`, a?.session ?? null);
4107
+ const i = new Jc(n, `client-${this.nextClientId++}`, a?.session ?? null);
4107
4108
  this.clients.add(i), this.authoritativeClientId || (this.authoritativeClientId = i.id), this.audit({
4108
4109
  action: "session_connected",
4109
4110
  clientId: i.id,
@@ -4120,14 +4121,14 @@ class Hc {
4120
4121
  expiresAt: a.session.expiresAt
4121
4122
  }
4122
4123
  }), this.options.onSessionCreated?.(a.session, i, a.challenge)), this.options.onClientConnected?.(i), n.on("data", (c) => {
4123
- for (const l of Vc(c)) {
4124
+ for (const l of Kc(c)) {
4124
4125
  let p;
4125
4126
  try {
4126
4127
  p = JSON.parse(l);
4127
4128
  } catch {
4128
4129
  p = l;
4129
4130
  }
4130
- Kc(p) && this.resolvePendingResponse(p, i) || Oc(p) && this.handleControlMessage(p, i) || Dc(p) && this.handleApprovalGrantMessage(p, i) || Nc(p) && this.handleApprovalGrantRevocationMessage(p, i) || this.options.onMessage?.(p, i);
4131
+ Xc(p) && this.resolvePendingResponse(p, i) || Nc(p) && this.handleControlMessage(p, i) || $c(p) && this.handleApprovalGrantMessage(p, i) || Rc(p) && this.handleApprovalGrantRevocationMessage(p, i) || this.options.onMessage?.(p, i);
4131
4132
  }
4132
4133
  }), n.on("end", () => {
4133
4134
  n.destroy();
@@ -4150,9 +4151,9 @@ Connection: close\r
4150
4151
  }
4151
4152
  }
4152
4153
  }
4153
- class Xc {
4154
+ class Qc {
4154
4155
  constructor(t) {
4155
- this.pairingStore = new pr(), this.approvalGrants = /* @__PURE__ */ new Map(), this.options = t, this.auditLog = t.auditLog ?? new Vt();
4156
+ this.pairingStore = new dr(), this.approvalGrants = /* @__PURE__ */ new Map(), this.options = t, this.auditLog = t.auditLog ?? new Wt();
4156
4157
  const n = {
4157
4158
  host: t.host,
4158
4159
  port: t.port,
@@ -4174,7 +4175,7 @@ class Xc {
4174
4175
  this.approvalGrants.delete(r);
4175
4176
  }
4176
4177
  };
4177
- this.server = new Hc(n);
4178
+ this.server = new Yc(n);
4178
4179
  }
4179
4180
  async start() {
4180
4181
  await this.server.start();
@@ -4212,19 +4213,19 @@ class Xc {
4212
4213
  return Array.from(this.approvalGrants.values());
4213
4214
  }
4214
4215
  createApprovalToken(t) {
4215
- const n = Yc(t.scopes), r = this.options.now ? this.options.now() : Date.now(), o = t.grantId ? this.approvalGrants.get(t.grantId) ?? null : Array.from(this.approvalGrants.values()).find((a) => $t(a.scopes, n)) ?? null;
4216
+ const n = el(t.scopes), r = this.options.now ? this.options.now() : Date.now(), o = t.grantId ? this.approvalGrants.get(t.grantId) ?? null : Array.from(this.approvalGrants.values()).find((a) => Rt(a.scopes, n)) ?? null;
4216
4217
  if (!o)
4217
4218
  throw new D("UNAVAILABLE", "No trusted TaskTime Pro approval grant is available for this bridge process.");
4218
4219
  if (o.expiresAt != null && o.expiresAt <= r)
4219
4220
  throw new D("PERMISSION_DENIED", "Trusted TaskTime Pro approval grant expired.");
4220
- if (!$t(o.scopes, n))
4221
+ if (!Rt(o.scopes, n))
4221
4222
  throw new D("PERMISSION_DENIED", "Trusted TaskTime Pro approval grant does not cover the requested scopes.");
4222
- return or({
4223
+ return ar({
4223
4224
  grant: o,
4224
4225
  command: t.command,
4225
4226
  inputHash: t.inputHash,
4226
4227
  scopes: n,
4227
- category: t.category ?? Qc(t.command, n),
4228
+ category: t.category ?? tl(t.command, n),
4228
4229
  now: () => r,
4229
4230
  ttlMs: t.ttlMs,
4230
4231
  nonce: t.nonce
@@ -4235,23 +4236,23 @@ class Xc {
4235
4236
  if (!t || typeof t == "string")
4236
4237
  throw new D("UNAVAILABLE", "Local agent bridge must be started before creating a pairing challenge.");
4237
4238
  const n = this.options.path ?? "/tasktime-agent";
4238
- return `ws://${el(this.options.host, t)}:${t.port}${n}`;
4239
+ return `ws://${nl(this.options.host, t)}:${t.port}${n}`;
4239
4240
  }
4240
4241
  }
4241
- function Yc(e) {
4242
+ function el(e) {
4242
4243
  return [...new Set(e)];
4243
4244
  }
4244
- function $t(e, t) {
4245
+ function Rt(e, t) {
4245
4246
  const n = new Set(e);
4246
4247
  return t.every((r) => n.has(r));
4247
4248
  }
4248
- function Qc(e, t) {
4249
+ function tl(e, t) {
4249
4250
  return t.includes("billing") ? "billing" : t.includes("email") ? "email" : t.includes("export") ? "export" : e.startsWith("delete_") || e.startsWith("cascade_delete_") || e.startsWith("restore_") || e === "undo_latest_invoice" ? "destructive" : "sensitive";
4250
4251
  }
4251
- function el(e, t) {
4252
+ function nl(e, t) {
4252
4253
  return e === "::1" || t.family === "IPv6" ? "[::1]" : e;
4253
4254
  }
4254
- const s = { type: "string" }, w = { type: "number" }, g = { type: "boolean" }, m = { type: ["string", "null"] }, Rt = {
4255
+ const s = { type: "string" }, w = { type: "number" }, g = { type: "boolean" }, m = { type: ["string", "null"] }, Ct = {
4255
4256
  type: "object",
4256
4257
  properties: {
4257
4258
  id: s,
@@ -4276,13 +4277,13 @@ const s = { type: "string" }, w = { type: "number" }, g = { type: "boolean" }, m
4276
4277
  quoteTimestamp: s,
4277
4278
  quoteTasks: {
4278
4279
  type: "array",
4279
- items: Rt
4280
+ items: Ct
4280
4281
  },
4281
4282
  additionalTasks: {
4282
4283
  type: "array",
4283
- items: Rt
4284
+ items: Ct
4284
4285
  }
4285
- }, Ct = {
4286
+ }, Zt = {
4286
4287
  ...Ke,
4287
4288
  emailTemplateId: m,
4288
4289
  to: m,
@@ -4296,7 +4297,7 @@ const s = { type: "string" }, w = { type: "number" }, g = { type: "boolean" }, m
4296
4297
  type: "object",
4297
4298
  properties: {},
4298
4299
  additionalProperties: !1
4299
- }, Cn = [
4300
+ }, Zn = [
4300
4301
  {
4301
4302
  name: "list_projects",
4302
4303
  description: "List active TaskTime Pro projects visible to the paired app session.",
@@ -6039,7 +6040,7 @@ const s = { type: "string" }, w = { type: "number" }, g = { type: "boolean" }, m
6039
6040
  scopes: ["read"],
6040
6041
  inputSchema: {
6041
6042
  type: "object",
6042
- properties: Ct,
6043
+ properties: Zt,
6043
6044
  required: ["projectId"],
6044
6045
  additionalProperties: !1
6045
6046
  }
@@ -6051,7 +6052,7 @@ const s = { type: "string" }, w = { type: "number" }, g = { type: "boolean" }, m
6051
6052
  inputSchema: {
6052
6053
  type: "object",
6053
6054
  properties: {
6054
- ...Ct,
6055
+ ...Zt,
6055
6056
  confirmSend: g,
6056
6057
  idempotencyKey: s
6057
6058
  },
@@ -6493,30 +6494,30 @@ const s = { type: "string" }, w = { type: "number" }, g = { type: "boolean" }, m
6493
6494
  }
6494
6495
  }
6495
6496
  ];
6496
- function tl(e) {
6497
- return Cn.filter((t) => t.scopes.every((n) => e.has(n))).sort((t, n) => t.name.localeCompare(n.name));
6497
+ function rl(e) {
6498
+ return Zn.filter((t) => t.scopes.every((n) => e.has(n))).sort((t, n) => t.name.localeCompare(n.name));
6498
6499
  }
6499
- function Zt(e) {
6500
- return Cn.find((t) => t.name === e) ?? null;
6500
+ function Mt(e) {
6501
+ return Zn.find((t) => t.name === e) ?? null;
6501
6502
  }
6502
- const nl = "2025-11-25", Pe = "2.0", rl = 120, ol = 6e4, il = 5 * 6e4;
6503
- class al {
6503
+ const ol = "2025-11-25", Pe = "2.0", il = 120, al = 6e4, sl = 5 * 6e4;
6504
+ class cl {
6504
6505
  constructor(t) {
6505
- if (this.toolCallCount = 0, this.nextRequestId = 0, this.bridge = t.bridge, this.scopes = new Set(t.scopes), this.commandTimeoutMs = t.commandTimeoutMs, this.requestIdFactory = t.requestIdFactory ?? (() => `mcp-request-${this.nextRequestId++}`), this.toolCallRateLimit = t.toolCallRateLimit ?? rl, this.toolCallRateWindowMs = t.toolCallRateWindowMs ?? ol, this.now = t.now ?? (() => Date.now()), !Number.isInteger(this.toolCallRateLimit) || this.toolCallRateLimit < 0)
6506
+ if (this.toolCallCount = 0, this.nextRequestId = 0, this.bridge = t.bridge, this.scopes = new Set(t.scopes), this.commandTimeoutMs = t.commandTimeoutMs, this.requestIdFactory = t.requestIdFactory ?? (() => `mcp-request-${this.nextRequestId++}`), this.toolCallRateLimit = t.toolCallRateLimit ?? il, this.toolCallRateWindowMs = t.toolCallRateWindowMs ?? al, this.now = t.now ?? (() => Date.now()), !Number.isInteger(this.toolCallRateLimit) || this.toolCallRateLimit < 0)
6506
6507
  throw new Error("toolCallRateLimit must be a non-negative integer.");
6507
6508
  if (!Number.isInteger(this.toolCallRateWindowMs) || this.toolCallRateWindowMs <= 0)
6508
6509
  throw new Error("toolCallRateWindowMs must be a positive integer.");
6509
6510
  this.toolCallWindowStartedAt = this.now();
6510
6511
  }
6511
6512
  async handleMessage(t) {
6512
- if (!ml(t))
6513
+ if (!hl(t))
6513
6514
  return this.error(null, -32600, "Invalid JSON-RPC request.");
6514
6515
  if (t.id === void 0)
6515
6516
  return null;
6516
6517
  switch (t.method) {
6517
6518
  case "initialize":
6518
6519
  return this.result(t.id, {
6519
- protocolVersion: nl,
6520
+ protocolVersion: ol,
6520
6521
  capabilities: {
6521
6522
  tools: {}
6522
6523
  },
@@ -6529,7 +6530,7 @@ class al {
6529
6530
  return this.result(t.id, {});
6530
6531
  case "tools/list":
6531
6532
  return this.result(t.id, {
6532
- tools: tl(this.scopes).map((n) => ({
6533
+ tools: rl(this.scopes).map((n) => ({
6533
6534
  name: n.name,
6534
6535
  description: n.description,
6535
6536
  inputSchema: n.inputSchema
@@ -6547,7 +6548,7 @@ class al {
6547
6548
  const n = t;
6548
6549
  if (!n || typeof n != "object" || typeof n.name != "string")
6549
6550
  return L("INVALID_INPUT", "tools/call requires a string tool name.");
6550
- const r = Zt(n.name);
6551
+ const r = Mt(n.name);
6551
6552
  if (!r)
6552
6553
  return L("INVALID_INPUT", `Unsupported TaskTime Pro tool: ${n.name}`);
6553
6554
  const o = r.scopes.find((c) => !this.scopes.has(c));
@@ -6565,13 +6566,13 @@ class al {
6565
6566
  r.name,
6566
6567
  n.arguments ?? {},
6567
6568
  this.commandTimeoutMs,
6568
- sl(n.approval)
6569
+ ll(n.approval)
6569
6570
  );
6570
6571
  } catch (c) {
6571
- return c instanceof D ? L(c.code, c.message, Mt(c)) : L(
6572
+ return c instanceof D ? L(c.code, c.message, Lt(c)) : L(
6572
6573
  "UNAVAILABLE",
6573
6574
  c instanceof Error ? c.message : "TaskTime Pro app session is unavailable.",
6574
- Zn()
6575
+ Mn()
6575
6576
  );
6576
6577
  }
6577
6578
  return {
@@ -6591,10 +6592,10 @@ class al {
6591
6592
  const n = t;
6592
6593
  if (!n || typeof n != "object" || typeof n.command != "string")
6593
6594
  return L("INVALID_INPUT", "tasktime/create_approval_token requires a string command.");
6594
- const r = Zt(n.command);
6595
+ const r = Mt(n.command);
6595
6596
  if (!r)
6596
6597
  return L("INVALID_INPUT", `Unsupported TaskTime Pro tool: ${n.command}`);
6597
- const o = cl(n.scopes, r.scopes);
6598
+ const o = pl(n.scopes, r.scopes);
6598
6599
  if (!o)
6599
6600
  return L("INVALID_INPUT", "Approval token scopes must be an array of strings.");
6600
6601
  const a = o.find((c) => !this.scopes.has(c));
@@ -6602,11 +6603,11 @@ class al {
6602
6603
  return L("PERMISSION_DENIED", `Missing ${a} permission.`, {
6603
6604
  scope: a
6604
6605
  });
6605
- const i = pl(n.ttlMs);
6606
+ const i = dl(n.ttlMs);
6606
6607
  if (i === null)
6607
6608
  return L("INVALID_INPUT", "Approval token ttlMs must be a positive integer no greater than 300000.");
6608
6609
  try {
6609
- const c = typeof n.inputHash == "string" ? n.inputHash : ll(n.arguments ?? {});
6610
+ const c = typeof n.inputHash == "string" ? n.inputHash : ul(n.arguments ?? {});
6610
6611
  return {
6611
6612
  approval: this.bridge.createApprovalToken({
6612
6613
  grantId: typeof n.grantId == "string" ? n.grantId : void 0,
@@ -6619,7 +6620,7 @@ class al {
6619
6620
  })
6620
6621
  };
6621
6622
  } catch (c) {
6622
- return c instanceof D ? L(c.code, c.message, Mt(c)) : L("UNAVAILABLE", c instanceof Error ? c.message : "TaskTime Pro approval-token signing failed.");
6623
+ return c instanceof D ? L(c.code, c.message, Lt(c)) : L("UNAVAILABLE", c instanceof Error ? c.message : "TaskTime Pro approval-token signing failed.");
6623
6624
  }
6624
6625
  }
6625
6626
  consumeToolCallBudget(t) {
@@ -6656,14 +6657,14 @@ class al {
6656
6657
  };
6657
6658
  }
6658
6659
  }
6659
- function sl(e) {
6660
+ function ll(e) {
6660
6661
  if (!e || typeof e != "object")
6661
6662
  return;
6662
6663
  const t = e;
6663
6664
  if (!(typeof t.token != "string" || t.token.trim().length === 0))
6664
6665
  return t;
6665
6666
  }
6666
- function cl(e, t) {
6667
+ function pl(e, t) {
6667
6668
  return e === void 0 ? t : !Array.isArray(e) || !e.every((n) => typeof n == "string") ? null : e;
6668
6669
  }
6669
6670
  function He(e) {
@@ -6671,21 +6672,21 @@ function He(e) {
6671
6672
  Object.entries(e).filter(([, t]) => t !== void 0 && typeof t != "function" && typeof t != "symbol").sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => [t, He(n)])
6672
6673
  ) : null;
6673
6674
  }
6674
- function ll(e) {
6675
+ function ul(e) {
6675
6676
  const t = JSON.stringify(He(e ?? {}));
6676
- return `sha256:${Jt("sha256").update(t).digest("hex")}`;
6677
+ return `sha256:${Vt("sha256").update(t).digest("hex")}`;
6677
6678
  }
6678
- function pl(e) {
6679
+ function dl(e) {
6679
6680
  if (e !== void 0)
6680
- return !Number.isInteger(e) || e <= 0 || e > il ? null : e;
6681
+ return !Number.isInteger(e) || e <= 0 || e > sl ? null : e;
6681
6682
  }
6682
- function Mt(e) {
6683
+ function Lt(e) {
6683
6684
  return e.code !== "UNAVAILABLE" ? e.details : {
6684
6685
  ...e.details,
6685
- ...Zn()
6686
+ ...Mn()
6686
6687
  };
6687
6688
  }
6688
- function Zn() {
6689
+ function Mn() {
6689
6690
  return {
6690
6691
  recovery: {
6691
6692
  action: "launch_tasktime",
@@ -6715,21 +6716,21 @@ function L(e, t, n) {
6715
6716
  isError: !0
6716
6717
  };
6717
6718
  }
6718
- function ul(e) {
6719
+ function ml(e) {
6719
6720
  let t = "";
6720
6721
  const n = (r) => {
6721
6722
  for (t += r.toString(); t.includes(`
6722
6723
  `); ) {
6723
6724
  const o = t.indexOf(`
6724
6725
  `), a = t.slice(0, o).trim();
6725
- t = t.slice(o + 1), a && dl(a, e);
6726
+ t = t.slice(o + 1), a && fl(a, e);
6726
6727
  }
6727
6728
  };
6728
6729
  return e.input.on("data", n), () => {
6729
6730
  e.input.off("data", n);
6730
6731
  };
6731
6732
  }
6732
- async function dl(e, t) {
6733
+ async function fl(e, t) {
6733
6734
  try {
6734
6735
  const n = await t.server.handleMessage(JSON.parse(e));
6735
6736
  n && t.output.write(`${JSON.stringify(n)}
@@ -6747,26 +6748,26 @@ async function dl(e, t) {
6747
6748
  `);
6748
6749
  }
6749
6750
  }
6750
- function ml(e) {
6751
+ function hl(e) {
6751
6752
  if (!e || typeof e != "object")
6752
6753
  return !1;
6753
6754
  const t = e;
6754
6755
  return t.jsonrpc === Pe && typeof t.method == "string";
6755
6756
  }
6756
- const fl = "127.0.0.1", Lt = 0, Mn = "/tasktime-agent", Xe = ["read", "write", "navigation"], Re = 300 * 1e3, qt = 12e4, Ut = 120, Bt = 6e4, Ae = ["read", "write", "billing", "export", "email", "navigation"];
6757
- function hl(e, t = process.env) {
6757
+ const gl = "127.0.0.1", qt = 0, Ln = "/tasktime-agent", Xe = ["read", "write", "navigation"], Re = 300 * 1e3, Ut = 12e4, Bt = 120, Ft = 6e4, Ae = ["read", "write", "billing", "export", "email", "navigation"];
6758
+ function yl(e, t = process.env) {
6758
6759
  const n = {
6759
- host: t.TASKTIME_AGENT_BRIDGE_HOST || fl,
6760
- port: V(t.TASKTIME_AGENT_BRIDGE_PORT, Lt, "TASKTIME_AGENT_BRIDGE_PORT"),
6761
- path: t.TASKTIME_AGENT_BRIDGE_PATH || Mn,
6762
- scopes: qn(t.TASKTIME_AGENT_BRIDGE_SCOPES) ?? Xe,
6763
- allowedOrigins: Ln(t.TASKTIME_AGENT_BRIDGE_ORIGINS),
6760
+ host: t.TASKTIME_AGENT_BRIDGE_HOST || gl,
6761
+ port: V(t.TASKTIME_AGENT_BRIDGE_PORT, qt, "TASKTIME_AGENT_BRIDGE_PORT"),
6762
+ path: t.TASKTIME_AGENT_BRIDGE_PATH || Ln,
6763
+ scopes: Un(t.TASKTIME_AGENT_BRIDGE_SCOPES) ?? Xe,
6764
+ allowedOrigins: qn(t.TASKTIME_AGENT_BRIDGE_ORIGINS),
6764
6765
  pairingTtlMs: V(t.TASKTIME_AGENT_BRIDGE_PAIRING_TTL_MS, Re, "TASKTIME_AGENT_BRIDGE_PAIRING_TTL_MS"),
6765
- sessionTtlMs: Il(t.TASKTIME_AGENT_BRIDGE_SESSION_TTL_MS, "TASKTIME_AGENT_BRIDGE_SESSION_TTL_MS"),
6766
- commandTimeoutMs: V(t.TASKTIME_AGENT_BRIDGE_COMMAND_TIMEOUT_MS, qt, "TASKTIME_AGENT_BRIDGE_COMMAND_TIMEOUT_MS"),
6767
- toolCallRateLimit: V(t.TASKTIME_AGENT_BRIDGE_TOOL_RATE_LIMIT, Ut, "TASKTIME_AGENT_BRIDGE_TOOL_RATE_LIMIT"),
6768
- toolCallRateWindowMs: Gt(t.TASKTIME_AGENT_BRIDGE_TOOL_RATE_WINDOW_MS, Bt, "TASKTIME_AGENT_BRIDGE_TOOL_RATE_WINDOW_MS"),
6769
- appUrl: Tl(t.TASKTIME_APP_URL, "TASKTIME_APP_URL"),
6766
+ sessionTtlMs: Sl(t.TASKTIME_AGENT_BRIDGE_SESSION_TTL_MS, "TASKTIME_AGENT_BRIDGE_SESSION_TTL_MS"),
6767
+ commandTimeoutMs: V(t.TASKTIME_AGENT_BRIDGE_COMMAND_TIMEOUT_MS, Ut, "TASKTIME_AGENT_BRIDGE_COMMAND_TIMEOUT_MS"),
6768
+ toolCallRateLimit: V(t.TASKTIME_AGENT_BRIDGE_TOOL_RATE_LIMIT, Bt, "TASKTIME_AGENT_BRIDGE_TOOL_RATE_LIMIT"),
6769
+ toolCallRateWindowMs: Jt(t.TASKTIME_AGENT_BRIDGE_TOOL_RATE_WINDOW_MS, Ft, "TASKTIME_AGENT_BRIDGE_TOOL_RATE_WINDOW_MS"),
6770
+ appUrl: Pl(t.TASKTIME_APP_URL, "TASKTIME_APP_URL"),
6770
6771
  help: !1,
6771
6772
  manifest: !1
6772
6773
  }, r = [], o = [];
@@ -6784,16 +6785,16 @@ function hl(e, t = process.env) {
6784
6785
  n.host = F(e, ++a, i);
6785
6786
  break;
6786
6787
  case "--port":
6787
- n.port = V(F(e, ++a, i), Lt, i);
6788
+ n.port = V(F(e, ++a, i), qt, i);
6788
6789
  break;
6789
6790
  case "--path":
6790
- n.path = Ft(F(e, ++a, i));
6791
+ n.path = Gt(F(e, ++a, i));
6791
6792
  break;
6792
6793
  case "--scopes":
6793
- n.scopes = kl(F(e, ++a, i), i);
6794
+ n.scopes = Tl(F(e, ++a, i), i);
6794
6795
  break;
6795
6796
  case "--scope":
6796
- r.push(Un(F(e, ++a, i), i));
6797
+ r.push(Bn(F(e, ++a, i), i));
6797
6798
  break;
6798
6799
  case "--origin":
6799
6800
  o.push(F(e, ++a, i));
@@ -6805,13 +6806,13 @@ function hl(e, t = process.env) {
6805
6806
  n.sessionTtlMs = V(F(e, ++a, i), Re, i);
6806
6807
  break;
6807
6808
  case "--command-timeout-ms":
6808
- n.commandTimeoutMs = V(F(e, ++a, i), qt, i);
6809
+ n.commandTimeoutMs = V(F(e, ++a, i), Ut, i);
6809
6810
  break;
6810
6811
  case "--tool-rate-limit":
6811
- n.toolCallRateLimit = V(F(e, ++a, i), Ut, i);
6812
+ n.toolCallRateLimit = V(F(e, ++a, i), Bt, i);
6812
6813
  break;
6813
6814
  case "--tool-rate-window-ms":
6814
- n.toolCallRateWindowMs = Gt(F(e, ++a, i), Bt, i);
6815
+ n.toolCallRateWindowMs = Jt(F(e, ++a, i), Ft, i);
6815
6816
  break;
6816
6817
  case "--app-url":
6817
6818
  n.appUrl = st(F(e, ++a, i), i);
@@ -6820,9 +6821,9 @@ function hl(e, t = process.env) {
6820
6821
  throw new Error(`Unsupported option: ${i}`);
6821
6822
  }
6822
6823
  }
6823
- return r.length > 0 && (n.scopes = Ye(r)), o.length > 0 && (n.allowedOrigins = o), n.path = Ft(n.path), n.scopes = Ye(n.scopes), n;
6824
+ return r.length > 0 && (n.scopes = Ye(r)), o.length > 0 && (n.allowedOrigins = o), n.path = Gt(n.path), n.scopes = Ye(n.scopes), n;
6824
6825
  }
6825
- function gl() {
6826
+ function _l() {
6826
6827
  return [
6827
6828
  "TaskTime Pro local agent bridge",
6828
6829
  "",
@@ -6850,7 +6851,7 @@ function gl() {
6850
6851
  ].join(`
6851
6852
  `);
6852
6853
  }
6853
- function yl() {
6854
+ function bl() {
6854
6855
  return {
6855
6856
  schemaVersion: 1,
6856
6857
  app: {
@@ -6880,7 +6881,7 @@ function yl() {
6880
6881
  },
6881
6882
  appSession: {
6882
6883
  protocol: "websocket",
6883
- defaultPath: Mn,
6884
+ defaultPath: Ln,
6884
6885
  allowedHosts: ["127.0.0.1", "localhost", "::1"],
6885
6886
  pairingRequired: !0
6886
6887
  },
@@ -6915,11 +6916,11 @@ function yl() {
6915
6916
  }
6916
6917
  };
6917
6918
  }
6918
- function _l(e, t) {
6919
+ function vl(e, t) {
6919
6920
  const n = new URL(st(t, "app URL"));
6920
6921
  return n.pathname = "/account", n.search = "", n.hash = "", n.searchParams.set("section", "agent"), n.searchParams.set("agentBridgeEndpoint", e.endpoint), n.searchParams.set("agentBridgePairingId", e.id), n.searchParams.set("agentBridgePairingCode", e.code), n.toString();
6921
6922
  }
6922
- function bl(e, t) {
6923
+ function wl(e, t) {
6923
6924
  const n = [
6924
6925
  "TaskTime Pro local agent bridge is running.",
6925
6926
  `App endpoint: ${e.endpoint}`,
@@ -6928,14 +6929,14 @@ function bl(e, t) {
6928
6929
  `Scopes: ${e.scopes.join(",")}`,
6929
6930
  `Pairing expires at: ${new Date(e.expiresAt).toISOString()}`
6930
6931
  ];
6931
- return t && n.push(`TaskTime Pro launch URL: ${_l(e, t)}`), n.push(
6932
+ return t && n.push(`TaskTime Pro launch URL: ${vl(e, t)}`), n.push(
6932
6933
  "",
6933
6934
  "Open TaskTime Pro and connect the agent bridge using the endpoint, pairing ID, and pairing code above."
6934
6935
  ), n.join(`
6935
6936
  `);
6936
6937
  }
6937
- async function vl(e, t) {
6938
- const n = new Xc({
6938
+ async function kl(e, t) {
6939
+ const n = new Qc({
6939
6940
  host: e.host,
6940
6941
  port: e.port,
6941
6942
  path: e.path,
@@ -6946,13 +6947,13 @@ async function vl(e, t) {
6946
6947
  const r = n.createPairingChallenge({
6947
6948
  scopes: e.scopes,
6948
6949
  ttlMs: e.pairingTtlMs
6949
- }), o = new al({
6950
+ }), o = new cl({
6950
6951
  bridge: n,
6951
6952
  scopes: e.scopes,
6952
6953
  commandTimeoutMs: e.commandTimeoutMs,
6953
6954
  toolCallRateLimit: e.toolCallRateLimit,
6954
6955
  toolCallRateWindowMs: e.toolCallRateWindowMs
6955
- }), a = ul({
6956
+ }), a = ml({
6956
6957
  input: t.stdin,
6957
6958
  output: t.stdout,
6958
6959
  server: o,
@@ -6961,7 +6962,7 @@ async function vl(e, t) {
6961
6962
  `);
6962
6963
  }
6963
6964
  });
6964
- return t.stderr.write(`${bl(r, e.appUrl)}
6965
+ return t.stderr.write(`${wl(r, e.appUrl)}
6965
6966
  `), {
6966
6967
  bridge: n,
6967
6968
  challenge: r,
@@ -6970,19 +6971,19 @@ async function vl(e, t) {
6970
6971
  }
6971
6972
  };
6972
6973
  }
6973
- async function wl(e = process.argv.slice(2), t = {
6974
+ async function Il(e = process.argv.slice(2), t = {
6974
6975
  stdin: process.stdin,
6975
6976
  stdout: process.stdout,
6976
6977
  stderr: process.stderr
6977
6978
  }, n = process.env) {
6978
- const r = hl(e, n);
6979
+ const r = yl(e, n);
6979
6980
  if (r.help)
6980
- return t.stderr.write(`${gl()}
6981
+ return t.stderr.write(`${_l()}
6981
6982
  `), null;
6982
6983
  if (r.manifest)
6983
- return t.stdout.write(`${JSON.stringify(yl(), null, 2)}
6984
+ return t.stdout.write(`${JSON.stringify(bl(), null, 2)}
6984
6985
  `), null;
6985
- const o = await vl(r, t), a = async () => {
6986
+ const o = await kl(r, t), a = async () => {
6986
6987
  await o.stop(), process.exit(0);
6987
6988
  };
6988
6989
  return process.once("SIGINT", () => {
@@ -6991,24 +6992,24 @@ async function wl(e = process.argv.slice(2), t = {
6991
6992
  a();
6992
6993
  }), o;
6993
6994
  }
6994
- function Ln(e) {
6995
+ function qn(e) {
6995
6996
  if (!e)
6996
6997
  return;
6997
6998
  const t = e.split(",").map((n) => n.trim()).filter(Boolean);
6998
6999
  return t.length > 0 ? t : void 0;
6999
7000
  }
7000
- function kl(e, t) {
7001
- const n = qn(e);
7001
+ function Tl(e, t) {
7002
+ const n = Un(e);
7002
7003
  if (!n || n.length === 0)
7003
7004
  throw new Error(`${t} must include at least one scope.`);
7004
7005
  return n;
7005
7006
  }
7006
- function qn(e) {
7007
- const t = Ln(e);
7007
+ function Un(e) {
7008
+ const t = qn(e);
7008
7009
  if (t)
7009
- return Ye(t.map((n) => Un(n, "scope")));
7010
+ return Ye(t.map((n) => Bn(n, "scope")));
7010
7011
  }
7011
- function Un(e, t) {
7012
+ function Bn(e, t) {
7012
7013
  if (Ae.includes(e))
7013
7014
  return e;
7014
7015
  throw new Error(`${t} must be one of: ${Ae.join(", ")}`);
@@ -7016,7 +7017,7 @@ function Un(e, t) {
7016
7017
  function Ye(e) {
7017
7018
  return Ae.filter((t) => e.includes(t));
7018
7019
  }
7019
- function Ft(e) {
7020
+ function Gt(e) {
7020
7021
  return e.startsWith("/") ? e : `/${e}`;
7021
7022
  }
7022
7023
  function F(e, t, n) {
@@ -7033,17 +7034,17 @@ function V(e, t, n) {
7033
7034
  throw new Error(`${n} must be a non-negative integer.`);
7034
7035
  return r;
7035
7036
  }
7036
- function Il(e, t) {
7037
+ function Sl(e, t) {
7037
7038
  if (!(e === void 0 || e === ""))
7038
7039
  return V(e, 0, t);
7039
7040
  }
7040
- function Gt(e, t, n) {
7041
+ function Jt(e, t, n) {
7041
7042
  const r = V(e, t, n);
7042
7043
  if (r <= 0)
7043
7044
  throw new Error(`${n} must be a positive integer.`);
7044
7045
  return r;
7045
7046
  }
7046
- function Tl(e, t) {
7047
+ function Pl(e, t) {
7047
7048
  if (e)
7048
7049
  return st(e, t);
7049
7050
  }
@@ -7058,20 +7059,26 @@ function st(e, t) {
7058
7059
  throw new Error(`${t} must be a valid http:// or https:// URL.`);
7059
7060
  return n.toString();
7060
7061
  }
7061
- function Sl() {
7062
+ function Al() {
7062
7063
  const e = process.argv[1];
7063
- return !!(e && import.meta.url === Jn(e).href);
7064
+ if (!e)
7065
+ return !1;
7066
+ try {
7067
+ return ct(e) === ct(Vn(import.meta.url));
7068
+ } catch {
7069
+ return import.meta.url === Wn(e).href;
7070
+ }
7064
7071
  }
7065
- Sl() && wl().catch((e) => {
7072
+ Al() && Il().catch((e) => {
7066
7073
  process.stderr.write(`TaskTime Pro local agent bridge failed: ${e instanceof Error ? e.message : String(e)}
7067
7074
  `), process.exitCode = 1;
7068
7075
  });
7069
7076
  export {
7070
- _l as buildTaskTimeAgentBridgeLaunchUrl,
7071
- bl as formatPairingInstructions,
7072
- gl as getTaskTimeAgentBridgeCliUsage,
7073
- yl as getTaskTimeAgentBridgeManifest,
7074
- hl as parseTaskTimeAgentBridgeCliOptions,
7075
- wl as runTaskTimeAgentBridgeCli,
7076
- vl as startTaskTimeAgentBridgeCli
7077
+ vl as buildTaskTimeAgentBridgeLaunchUrl,
7078
+ wl as formatPairingInstructions,
7079
+ _l as getTaskTimeAgentBridgeCliUsage,
7080
+ bl as getTaskTimeAgentBridgeManifest,
7081
+ yl as parseTaskTimeAgentBridgeCliOptions,
7082
+ Il as runTaskTimeAgentBridgeCli,
7083
+ kl as startTaskTimeAgentBridgeCli
7077
7084
  };