@polagram/core 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.
@@ -69,24 +69,46 @@ class Ye {
69
69
  constructor() {
70
70
  this.traverser = new Ke(this);
71
71
  }
72
+ visitParticipantGroup(e) {
73
+ }
72
74
  generate(e) {
73
75
  return this.lines = [], this.indentLevel = 0, this.traverser.traverse(e), this.lines.join(`
74
76
  `);
75
77
  }
76
78
  visitRoot(e) {
77
79
  this.lines.push("sequenceDiagram"), this.indentLevel++, e.meta?.title && this.add(`title ${e.meta.title}`);
78
- for (const n of e.participants)
79
- this.visitParticipant(n);
80
+ const n = /* @__PURE__ */ new Map();
81
+ for (const i of e.participants)
82
+ n.set(i.id, []);
83
+ for (const i of e.groups)
84
+ for (const s of i.participantIds) {
85
+ const o = n.get(s);
86
+ o && o.push(i);
87
+ }
88
+ const r = [];
89
+ for (const i of e.participants) {
90
+ const s = n.get(i.id) || [];
91
+ let o = 0;
92
+ const a = Math.min(r.length, s.length);
93
+ for (let c = 0; c < a && r[c] === s[c]; c++)
94
+ o++;
95
+ for (; r.length > o; )
96
+ this.indentLevel--, this.add("end"), r.pop();
97
+ for (let c = o; c < s.length; c++) {
98
+ const h = s[c];
99
+ let p = "box";
100
+ h.style?.backgroundColor && (p += ` ${h.style.backgroundColor}`), h.name && (p += ` ${h.name}`), this.add(p), this.indentLevel++, r.push(h);
101
+ }
102
+ this.visitParticipant(i);
103
+ }
104
+ for (; r.length > 0; )
105
+ this.indentLevel--, this.add("end"), r.pop();
80
106
  this.traverser.dispatchEvents(e.events);
81
107
  }
82
108
  visitParticipant(e) {
83
109
  const n = e.type === "actor" ? "actor" : "participant", r = e.name;
84
110
  e.id === e.name ? this.add(`${n} ${e.id}`) : this.add(`${n} ${e.id} as ${r}`);
85
111
  }
86
- visitParticipantGroup(e) {
87
- let n = "box";
88
- e.style?.backgroundColor && (n += ` ${e.style.backgroundColor}`), e.name && (n += ` ${e.name}`), this.add(n);
89
- }
90
112
  visitMessage(e) {
91
113
  const n = e.from ?? "[*]", r = e.to ?? "[*]", i = At(e.type, e.style);
92
114
  let s = "";
@@ -146,13 +168,31 @@ class Xe {
146
168
  }
147
169
  visitRoot(e) {
148
170
  this.add("@startuml"), e.meta.title && this.add(`title ${e.meta.title}`);
149
- const n = new Map(e.participants.map((i) => [i.id, i])), r = /* @__PURE__ */ new Set();
150
- for (const i of e.groups)
151
- this.visitGroup(i, n), i.participantIds.forEach((s) => {
152
- r.add(s);
153
- });
171
+ const n = /* @__PURE__ */ new Map();
154
172
  for (const i of e.participants)
155
- r.has(i.id) || this.visitParticipant(i);
173
+ n.set(i.id, []);
174
+ for (const i of e.groups)
175
+ for (const s of i.participantIds) {
176
+ const o = n.get(s);
177
+ o && o.push(i);
178
+ }
179
+ const r = [];
180
+ for (const i of e.participants) {
181
+ const s = n.get(i.id) || [];
182
+ let o = 0;
183
+ const a = Math.min(r.length, s.length);
184
+ for (let c = 0; c < a && r[c] === s[c]; c++)
185
+ o++;
186
+ for (; r.length > o; )
187
+ this.add("end box"), r.pop();
188
+ for (let c = o; c < s.length; c++) {
189
+ const h = s[c], p = h.style?.backgroundColor ? ` ${h.style.backgroundColor}` : "", d = h.name ? ` "${h.name}"` : "";
190
+ this.add(`box${d}${p}`), r.push(h);
191
+ }
192
+ this.visitParticipant(i);
193
+ }
194
+ for (; r.length > 0; )
195
+ this.add("end box"), r.pop();
156
196
  this.traverser.dispatchEvents(e.events), this.add("@enduml");
157
197
  }
158
198
  visitParticipant(e) {
@@ -160,16 +200,6 @@ class Xe {
160
200
  }
161
201
  visitParticipantGroup(e) {
162
202
  }
163
- // Internal method with context for group handling
164
- visitGroup(e, n) {
165
- const r = e.style?.backgroundColor ? ` ${e.style.backgroundColor}` : "", i = e.name ? ` "${e.name}"` : "";
166
- this.add(`box${i}${r}`);
167
- for (const s of e.participantIds) {
168
- const o = n.get(s);
169
- o && this.visitParticipant(o);
170
- }
171
- this.add("end box");
172
- }
173
203
  visitMessage(e) {
174
204
  const n = e.from || "[*]", r = e.to || "[*]";
175
205
  let i = "->";
@@ -542,8 +572,8 @@ let Ct = class extends Qe {
542
572
  e.groups.push(o);
543
573
  const a = this.currentGroup;
544
574
  this.currentGroup = o;
545
- const u = this.parseBlock(e, ["END"]);
546
- return this.currentGroup = a, this.isCurrentToken("END") && this.advance(), u;
575
+ const c = this.parseBlock(e, ["END"]);
576
+ return this.currentGroup = a, this.isCurrentToken("END") && this.advance(), c;
547
577
  }
548
578
  parseFragment(e) {
549
579
  const n = this.getCurrentTokenType();
@@ -559,28 +589,28 @@ let Ct = class extends Qe {
559
589
  events: a
560
590
  }); this.isCurrentToken("AND"); ) {
561
591
  this.advance();
562
- const u = this.readRestOfLine(), h = this.parseBlock(e, ["END", "AND"]);
592
+ const c = this.readRestOfLine(), h = this.parseBlock(e, ["END", "AND"]);
563
593
  s.push({
564
594
  id: this.generateId("br"),
565
- condition: u,
595
+ condition: c,
566
596
  events: h
567
597
  });
568
598
  }
569
599
  for (; this.isCurrentToken("OPTION"); ) {
570
600
  this.advance();
571
- const u = this.readRestOfLine(), h = this.parseBlock(e, ["END", "OPTION"]);
601
+ const c = this.readRestOfLine(), h = this.parseBlock(e, ["END", "OPTION"]);
572
602
  s.push({
573
603
  id: this.generateId("br"),
574
- condition: u,
604
+ condition: c,
575
605
  events: h
576
606
  });
577
607
  }
578
608
  for (; this.isCurrentToken("ELSE"); ) {
579
609
  this.advance();
580
- const u = this.readRestOfLine(), h = this.parseBlock(e, ["END", "ELSE"]);
610
+ const c = this.readRestOfLine(), h = this.parseBlock(e, ["END", "ELSE"]);
581
611
  s.push({
582
612
  id: this.generateId("br"),
583
- condition: u,
613
+ condition: c,
584
614
  events: h
585
615
  });
586
616
  }
@@ -647,14 +677,14 @@ let Ct = class extends Qe {
647
677
  this.ensureParticipant(e, o), this.advance();
648
678
  let a = "";
649
679
  this.isCurrentToken("COLON") && (this.advance(), a = this.readRestOfLine());
650
- const { type: u, style: h } = this.resolveArrow(r);
680
+ const { type: c, style: h } = this.resolveArrow(r);
651
681
  return {
652
682
  kind: "message",
653
683
  id: this.generateId("evt"),
654
684
  from: n,
655
685
  to: o,
656
686
  text: a,
657
- type: u,
687
+ type: c,
658
688
  style: h,
659
689
  lifecycle: i || s ? { activateTarget: i, deactivateSource: s } : void 0
660
690
  };
@@ -689,7 +719,7 @@ const Rt = {
689
719
  return new Ct(e).parse();
690
720
  }
691
721
  };
692
- class xt extends qe {
722
+ class Lt extends qe {
693
723
  nextToken() {
694
724
  this.skipWhitespace();
695
725
  const e = this.position, n = this.column;
@@ -805,7 +835,7 @@ class xt extends qe {
805
835
  return n ? n[1] : "";
806
836
  }
807
837
  }
808
- class Lt extends Qe {
838
+ class xt extends Qe {
809
839
  /**
810
840
  * Type-safe token type checker.
811
841
  * Helps TypeScript understand token type after advance() calls.
@@ -933,8 +963,8 @@ class Lt extends Qe {
933
963
  this.advance();
934
964
  continue;
935
965
  }
936
- const u = this.parseStatement(e);
937
- u && o.push(u);
966
+ const c = this.parseStatement(e);
967
+ c && o.push(c);
938
968
  }
939
969
  return {
940
970
  kind: n,
@@ -1055,8 +1085,8 @@ class Lt extends Qe {
1055
1085
  }
1056
1086
  const Dt = {
1057
1087
  parse: (t) => {
1058
- const e = new xt(t);
1059
- return new Lt(e).parse();
1088
+ const e = new Lt(t);
1089
+ return new xt(e).parse();
1060
1090
  }
1061
1091
  }, Ft = {
1062
1092
  ".puml": "plantuml",
@@ -1126,7 +1156,7 @@ const Dt = {
1126
1156
  }, X = /* @__PURE__ */ new Map();
1127
1157
  X.set("mermaid", Rt);
1128
1158
  X.set("plantuml", Dt);
1129
- const Ut = {
1159
+ const Mt = {
1130
1160
  register(t, e) {
1131
1161
  X.set(t, e);
1132
1162
  },
@@ -1167,7 +1197,7 @@ class ee {
1167
1197
  };
1168
1198
  }
1169
1199
  }
1170
- class Mt extends ee {
1200
+ class Ut extends ee {
1171
1201
  visitFragment(e) {
1172
1202
  const n = super.visitFragment(e);
1173
1203
  if (n.length === 0) return [];
@@ -1384,7 +1414,7 @@ class ae {
1384
1414
  const s = Kt.get(i);
1385
1415
  s ? r = s.transform(r) : console.warn(`Unknown action: ${i.action}`);
1386
1416
  }
1387
- return r = new Mt().transform(r), r = new Gt().transform(r), r;
1417
+ return r = new Ut().transform(r), r = new Gt().transform(r), r;
1388
1418
  }
1389
1419
  }
1390
1420
  class Fo {
@@ -1396,7 +1426,7 @@ class Fo {
1396
1426
  * @param format Input format ('mermaid' or 'plantuml')
1397
1427
  */
1398
1428
  static init(e, n = "mermaid") {
1399
- const i = Ut.getParser(n).parse(e);
1429
+ const i = Mt.getParser(n).parse(e);
1400
1430
  return new Yt(i, n);
1401
1431
  }
1402
1432
  }
@@ -1513,9 +1543,9 @@ class Yt {
1513
1543
  return typeof e == "string" || e instanceof RegExp || typeof e == "object" && e !== null && "pattern" in e && !("kind" in e);
1514
1544
  }
1515
1545
  }
1516
- const L = /* @__PURE__ */ new Map();
1517
- L.set("mermaid", () => new Ye());
1518
- L.set("plantuml", () => new Xe());
1546
+ const x = /* @__PURE__ */ new Map();
1547
+ x.set("mermaid", () => new Ye());
1548
+ x.set("plantuml", () => new Xe());
1519
1549
  const jo = {
1520
1550
  /**
1521
1551
  * Register a custom generator.
@@ -1523,7 +1553,7 @@ const jo = {
1523
1553
  * @param factory - Factory function that creates a generator instance
1524
1554
  */
1525
1555
  register(t, e) {
1526
- L.set(t, e);
1556
+ x.set(t, e);
1527
1557
  },
1528
1558
  /**
1529
1559
  * Get a generator for the specified language.
@@ -1532,7 +1562,7 @@ const jo = {
1532
1562
  * @throws Error if no generator is registered for the language
1533
1563
  */
1534
1564
  getGenerator(t) {
1535
- const e = L.get(t);
1565
+ const e = x.get(t);
1536
1566
  if (!e)
1537
1567
  throw new Error(`Generator for language '${t}' not found.`);
1538
1568
  return e();
@@ -1541,27 +1571,27 @@ const jo = {
1541
1571
  * Check if a generator is registered for the given language.
1542
1572
  */
1543
1573
  hasGenerator(t) {
1544
- return L.has(t);
1574
+ return x.has(t);
1545
1575
  },
1546
1576
  /**
1547
1577
  * Get list of registered languages.
1548
1578
  */
1549
1579
  getLanguages() {
1550
- return Array.from(L.keys());
1580
+ return Array.from(x.keys());
1551
1581
  }
1552
1582
  };
1553
- function c(t, e, n) {
1554
- function r(a, u) {
1583
+ function u(t, e, n) {
1584
+ function r(a, c) {
1555
1585
  if (a._zod || Object.defineProperty(a, "_zod", {
1556
1586
  value: {
1557
- def: u,
1587
+ def: c,
1558
1588
  constr: o,
1559
1589
  traits: /* @__PURE__ */ new Set()
1560
1590
  },
1561
1591
  enumerable: !1
1562
1592
  }), a._zod.traits.has(t))
1563
1593
  return;
1564
- a._zod.traits.add(t), e(a, u);
1594
+ a._zod.traits.add(t), e(a, c);
1565
1595
  const h = o.prototype, p = Object.keys(h);
1566
1596
  for (let d = 0; d < p.length; d++) {
1567
1597
  const f = p[d];
@@ -1573,9 +1603,9 @@ function c(t, e, n) {
1573
1603
  }
1574
1604
  Object.defineProperty(s, "name", { value: t });
1575
1605
  function o(a) {
1576
- var u;
1606
+ var c;
1577
1607
  const h = n?.Parent ? new s() : this;
1578
- r(h, a), (u = h._zod).deferred ?? (u.deferred = []);
1608
+ r(h, a), (c = h._zod).deferred ?? (c.deferred = []);
1579
1609
  for (const p of h._zod.deferred)
1580
1610
  p();
1581
1611
  return h;
@@ -1626,8 +1656,8 @@ function Xt(t, e) {
1626
1656
  const n = (t.toString().split(".")[1] || "").length, r = e.toString();
1627
1657
  let i = (r.split(".")[1] || "").length;
1628
1658
  if (i === 0 && /\d?e-\d?/.test(r)) {
1629
- const u = r.match(/\d?e-(\d?)/);
1630
- u?.[1] && (i = Number.parseInt(u[1]));
1659
+ const c = r.match(/\d?e-(\d?)/);
1660
+ c?.[1] && (i = Number.parseInt(c[1]));
1631
1661
  }
1632
1662
  const s = n > i ? n : i, o = Number.parseInt(t.toFixed(s).replace(".", "")), a = Number.parseInt(e.toFixed(s).replace(".", ""));
1633
1663
  return o % a / 10 ** s;
@@ -1657,7 +1687,7 @@ function R(t, e, n) {
1657
1687
  configurable: !0
1658
1688
  });
1659
1689
  }
1660
- function x(...t) {
1690
+ function L(...t) {
1661
1691
  const e = {};
1662
1692
  for (const n of t) {
1663
1693
  const r = Object.getOwnPropertyDescriptors(n);
@@ -1730,7 +1760,7 @@ const tn = {
1730
1760
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
1731
1761
  };
1732
1762
  function nn(t, e) {
1733
- const n = t._zod.def, r = x(t._zod.def, {
1763
+ const n = t._zod.def, r = L(t._zod.def, {
1734
1764
  get shape() {
1735
1765
  const i = {};
1736
1766
  for (const s in e) {
@@ -1745,7 +1775,7 @@ function nn(t, e) {
1745
1775
  return P(t, r);
1746
1776
  }
1747
1777
  function rn(t, e) {
1748
- const n = t._zod.def, r = x(t._zod.def, {
1778
+ const n = t._zod.def, r = L(t._zod.def, {
1749
1779
  get shape() {
1750
1780
  const i = { ...t._zod.def.shape };
1751
1781
  for (const s in e) {
@@ -1765,7 +1795,7 @@ function sn(t, e) {
1765
1795
  const n = t._zod.def.checks;
1766
1796
  if (n && n.length > 0)
1767
1797
  throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
1768
- const i = x(t._zod.def, {
1798
+ const i = L(t._zod.def, {
1769
1799
  get shape() {
1770
1800
  const s = { ...t._zod.def.shape, ...e };
1771
1801
  return R(this, "shape", s), s;
@@ -1788,7 +1818,7 @@ function on(t, e) {
1788
1818
  return P(t, n);
1789
1819
  }
1790
1820
  function an(t, e) {
1791
- const n = x(t._zod.def, {
1821
+ const n = L(t._zod.def, {
1792
1822
  get shape() {
1793
1823
  const r = { ...t._zod.def.shape, ...e._zod.def.shape };
1794
1824
  return R(this, "shape", r), r;
@@ -1802,7 +1832,7 @@ function an(t, e) {
1802
1832
  return P(t, n);
1803
1833
  }
1804
1834
  function cn(t, e, n) {
1805
- const r = x(e._zod.def, {
1835
+ const r = L(e._zod.def, {
1806
1836
  get shape() {
1807
1837
  const i = e._zod.def.shape, s = { ...i };
1808
1838
  if (n)
@@ -1827,7 +1857,7 @@ function cn(t, e, n) {
1827
1857
  return P(e, r);
1828
1858
  }
1829
1859
  function un(t, e, n) {
1830
- const r = x(e._zod.def, {
1860
+ const r = L(e._zod.def, {
1831
1861
  get shape() {
1832
1862
  const i = e._zod.def.shape, s = { ...i };
1833
1863
  if (n)
@@ -1899,7 +1929,7 @@ const st = (t, e) => {
1899
1929
  value: () => t.message,
1900
1930
  enumerable: !1
1901
1931
  });
1902
- }, ot = c("$ZodError", st), at = c("$ZodError", st, { Parent: Error });
1932
+ }, ot = u("$ZodError", st), at = u("$ZodError", st, { Parent: Error });
1903
1933
  function hn(t, e = (n) => n.message) {
1904
1934
  const n = {}, r = [];
1905
1935
  for (const i of t.issues)
@@ -1920,8 +1950,8 @@ function pn(t, e = (n) => n.message) {
1920
1950
  else {
1921
1951
  let o = n, a = 0;
1922
1952
  for (; a < s.path.length; ) {
1923
- const u = s.path[a];
1924
- a === s.path.length - 1 ? (o[u] = o[u] || { _errors: [] }, o[u]._errors.push(e(s))) : o[u] = o[u] || { _errors: [] }, o = o[u], a++;
1953
+ const c = s.path[a];
1954
+ a === s.path.length - 1 ? (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(e(s))) : o[c] = o[c] || { _errors: [] }, o = o[c], a++;
1925
1955
  }
1926
1956
  }
1927
1957
  };
@@ -1932,7 +1962,7 @@ const ve = (t) => (e, n, r, i) => {
1932
1962
  if (o instanceof Promise)
1933
1963
  throw new F();
1934
1964
  if (o.issues.length) {
1935
- const a = new (i?.Err ?? t)(o.issues.map((u) => C(u, s, Z())));
1965
+ const a = new (i?.Err ?? t)(o.issues.map((c) => C(c, s, Z())));
1936
1966
  throw nt(a, i?.callee), a;
1937
1967
  }
1938
1968
  return o.value;
@@ -1940,7 +1970,7 @@ const ve = (t) => (e, n, r, i) => {
1940
1970
  const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
1941
1971
  let o = e._zod.run({ value: n, issues: [] }, s);
1942
1972
  if (o instanceof Promise && (o = await o), o.issues.length) {
1943
- const a = new (i?.Err ?? t)(o.issues.map((u) => C(u, s, Z())));
1973
+ const a = new (i?.Err ?? t)(o.issues.map((c) => C(c, s, Z())));
1944
1974
  throw nt(a, i?.callee), a;
1945
1975
  }
1946
1976
  return o.value;
@@ -1975,7 +2005,7 @@ const ve = (t) => (e, n, r, i) => {
1975
2005
  function An() {
1976
2006
  return new RegExp(Pn, "u");
1977
2007
  }
1978
- const Zn = /^(?:(?: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])$/, Cn = /^(([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}|:))$/, Rn = /^((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])$/, xn = /^(([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])$/, Ln = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, ct = /^[A-Za-z0-9_-]*$/, Dn = /^\+(?:[0-9]){6,14}[0-9]$/, ut = "(?:(?:\\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])))", Fn = /* @__PURE__ */ new RegExp(`^${ut}$`);
2008
+ const Zn = /^(?:(?: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])$/, Cn = /^(([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}|:))$/, Rn = /^((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])$/, Ln = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, xn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, ct = /^[A-Za-z0-9_-]*$/, Dn = /^\+(?:[0-9]){6,14}[0-9]$/, ut = "(?:(?:\\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])))", Fn = /* @__PURE__ */ new RegExp(`^${ut}$`);
1979
2009
  function ht(t) {
1980
2010
  const e = "(?:[01]\\d|2[0-3]):[0-5]\\d";
1981
2011
  return typeof t.precision == "number" ? t.precision === -1 ? `${e}` : t.precision === 0 ? `${e}:[0-5]\\d` : `${e}:[0-5]\\d\\.\\d{${t.precision}}` : `${e}(?::[0-5]\\d(?:\\.\\d+)?)?`;
@@ -1983,23 +2013,23 @@ function ht(t) {
1983
2013
  function jn(t) {
1984
2014
  return new RegExp(`^${ht(t)}$`);
1985
2015
  }
1986
- function Un(t) {
2016
+ function Mn(t) {
1987
2017
  const e = ht({ precision: t.precision }), n = ["Z"];
1988
2018
  t.local && n.push(""), t.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
1989
2019
  const r = `${e}(?:${n.join("|")})`;
1990
2020
  return new RegExp(`^${ut}T(?:${r})$`);
1991
2021
  }
1992
- const Mn = (t) => {
2022
+ const Un = (t) => {
1993
2023
  const e = t ? `[\\s\\S]{${t?.minimum ?? 0},${t?.maximum ?? ""}}` : "[\\s\\S]*";
1994
2024
  return new RegExp(`^${e}$`);
1995
- }, Gn = /^-?\d+$/, Vn = /^-?\d+(?:\.\d+)?/, Bn = /^[^A-Z]*$/, Jn = /^[^a-z]*$/, b = /* @__PURE__ */ c("$ZodCheck", (t, e) => {
2025
+ }, Gn = /^-?\d+$/, Vn = /^-?\d+(?:\.\d+)?/, Bn = /^[^A-Z]*$/, Jn = /^[^a-z]*$/, b = /* @__PURE__ */ u("$ZodCheck", (t, e) => {
1996
2026
  var n;
1997
2027
  t._zod ?? (t._zod = {}), t._zod.def = e, (n = t._zod).onattach ?? (n.onattach = []);
1998
2028
  }), pt = {
1999
2029
  number: "number",
2000
2030
  bigint: "bigint",
2001
2031
  object: "date"
2002
- }, lt = /* @__PURE__ */ c("$ZodCheckLessThan", (t, e) => {
2032
+ }, lt = /* @__PURE__ */ u("$ZodCheckLessThan", (t, e) => {
2003
2033
  b.init(t, e);
2004
2034
  const n = pt[typeof e.value];
2005
2035
  t._zod.onattach.push((r) => {
@@ -2016,7 +2046,7 @@ const Mn = (t) => {
2016
2046
  continue: !e.abort
2017
2047
  });
2018
2048
  };
2019
- }), dt = /* @__PURE__ */ c("$ZodCheckGreaterThan", (t, e) => {
2049
+ }), dt = /* @__PURE__ */ u("$ZodCheckGreaterThan", (t, e) => {
2020
2050
  b.init(t, e);
2021
2051
  const n = pt[typeof e.value];
2022
2052
  t._zod.onattach.push((r) => {
@@ -2033,7 +2063,7 @@ const Mn = (t) => {
2033
2063
  continue: !e.abort
2034
2064
  });
2035
2065
  };
2036
- }), Wn = /* @__PURE__ */ c("$ZodCheckMultipleOf", (t, e) => {
2066
+ }), Wn = /* @__PURE__ */ u("$ZodCheckMultipleOf", (t, e) => {
2037
2067
  b.init(t, e), t._zod.onattach.push((n) => {
2038
2068
  var r;
2039
2069
  (r = n._zod.bag).multipleOf ?? (r.multipleOf = e.value);
@@ -2049,7 +2079,7 @@ const Mn = (t) => {
2049
2079
  continue: !e.abort
2050
2080
  });
2051
2081
  };
2052
- }), Kn = /* @__PURE__ */ c("$ZodCheckNumberFormat", (t, e) => {
2082
+ }), Kn = /* @__PURE__ */ u("$ZodCheckNumberFormat", (t, e) => {
2053
2083
  b.init(t, e), e.format = e.format || "float64";
2054
2084
  const n = e.format?.includes("int"), r = n ? "int" : "number", [i, s] = tn[e.format];
2055
2085
  t._zod.onattach.push((o) => {
@@ -2106,7 +2136,7 @@ const Mn = (t) => {
2106
2136
  inst: t
2107
2137
  });
2108
2138
  };
2109
- }), Yn = /* @__PURE__ */ c("$ZodCheckMaxLength", (t, e) => {
2139
+ }), Yn = /* @__PURE__ */ u("$ZodCheckMaxLength", (t, e) => {
2110
2140
  var n;
2111
2141
  b.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
2112
2142
  const i = r.value;
@@ -2129,7 +2159,7 @@ const Mn = (t) => {
2129
2159
  continue: !e.abort
2130
2160
  });
2131
2161
  };
2132
- }), Xn = /* @__PURE__ */ c("$ZodCheckMinLength", (t, e) => {
2162
+ }), Xn = /* @__PURE__ */ u("$ZodCheckMinLength", (t, e) => {
2133
2163
  var n;
2134
2164
  b.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
2135
2165
  const i = r.value;
@@ -2152,7 +2182,7 @@ const Mn = (t) => {
2152
2182
  continue: !e.abort
2153
2183
  });
2154
2184
  };
2155
- }), qn = /* @__PURE__ */ c("$ZodCheckLengthEquals", (t, e) => {
2185
+ }), qn = /* @__PURE__ */ u("$ZodCheckLengthEquals", (t, e) => {
2156
2186
  var n;
2157
2187
  b.init(t, e), (n = t._zod.def).when ?? (n.when = (r) => {
2158
2188
  const i = r.value;
@@ -2175,7 +2205,7 @@ const Mn = (t) => {
2175
2205
  continue: !e.abort
2176
2206
  });
2177
2207
  };
2178
- }), ie = /* @__PURE__ */ c("$ZodCheckStringFormat", (t, e) => {
2208
+ }), ie = /* @__PURE__ */ u("$ZodCheckStringFormat", (t, e) => {
2179
2209
  var n, r;
2180
2210
  b.init(t, e), t._zod.onattach.push((i) => {
2181
2211
  const s = i._zod.bag;
@@ -2192,7 +2222,7 @@ const Mn = (t) => {
2192
2222
  });
2193
2223
  }) : (r = t._zod).check ?? (r.check = () => {
2194
2224
  });
2195
- }), Qn = /* @__PURE__ */ c("$ZodCheckRegex", (t, e) => {
2225
+ }), Qn = /* @__PURE__ */ u("$ZodCheckRegex", (t, e) => {
2196
2226
  ie.init(t, e), t._zod.check = (n) => {
2197
2227
  e.pattern.lastIndex = 0, !e.pattern.test(n.value) && n.issues.push({
2198
2228
  origin: "string",
@@ -2204,11 +2234,11 @@ const Mn = (t) => {
2204
2234
  continue: !e.abort
2205
2235
  });
2206
2236
  };
2207
- }), Hn = /* @__PURE__ */ c("$ZodCheckLowerCase", (t, e) => {
2237
+ }), Hn = /* @__PURE__ */ u("$ZodCheckLowerCase", (t, e) => {
2208
2238
  e.pattern ?? (e.pattern = Bn), ie.init(t, e);
2209
- }), er = /* @__PURE__ */ c("$ZodCheckUpperCase", (t, e) => {
2239
+ }), er = /* @__PURE__ */ u("$ZodCheckUpperCase", (t, e) => {
2210
2240
  e.pattern ?? (e.pattern = Jn), ie.init(t, e);
2211
- }), tr = /* @__PURE__ */ c("$ZodCheckIncludes", (t, e) => {
2241
+ }), tr = /* @__PURE__ */ u("$ZodCheckIncludes", (t, e) => {
2212
2242
  b.init(t, e);
2213
2243
  const n = j(e.includes), r = new RegExp(typeof e.position == "number" ? `^.{${e.position}}${n}` : n);
2214
2244
  e.pattern = r, t._zod.onattach.push((i) => {
@@ -2225,7 +2255,7 @@ const Mn = (t) => {
2225
2255
  continue: !e.abort
2226
2256
  });
2227
2257
  };
2228
- }), nr = /* @__PURE__ */ c("$ZodCheckStartsWith", (t, e) => {
2258
+ }), nr = /* @__PURE__ */ u("$ZodCheckStartsWith", (t, e) => {
2229
2259
  b.init(t, e);
2230
2260
  const n = new RegExp(`^${j(e.prefix)}.*`);
2231
2261
  e.pattern ?? (e.pattern = n), t._zod.onattach.push((r) => {
@@ -2242,7 +2272,7 @@ const Mn = (t) => {
2242
2272
  continue: !e.abort
2243
2273
  });
2244
2274
  };
2245
- }), rr = /* @__PURE__ */ c("$ZodCheckEndsWith", (t, e) => {
2275
+ }), rr = /* @__PURE__ */ u("$ZodCheckEndsWith", (t, e) => {
2246
2276
  b.init(t, e);
2247
2277
  const n = new RegExp(`.*${j(e.suffix)}$`);
2248
2278
  e.pattern ?? (e.pattern = n), t._zod.onattach.push((r) => {
@@ -2259,7 +2289,7 @@ const Mn = (t) => {
2259
2289
  continue: !e.abort
2260
2290
  });
2261
2291
  };
2262
- }), ir = /* @__PURE__ */ c("$ZodCheckOverwrite", (t, e) => {
2292
+ }), ir = /* @__PURE__ */ u("$ZodCheckOverwrite", (t, e) => {
2263
2293
  b.init(t, e), t._zod.check = (n) => {
2264
2294
  n.value = e.tx(n.value);
2265
2295
  };
@@ -2291,7 +2321,7 @@ const or = {
2291
2321
  major: 4,
2292
2322
  minor: 2,
2293
2323
  patch: 1
2294
- }, k = /* @__PURE__ */ c("$ZodType", (t, e) => {
2324
+ }, k = /* @__PURE__ */ u("$ZodType", (t, e) => {
2295
2325
  var n;
2296
2326
  t ?? (t = {}), t._zod.def = e, t._zod.bag = t._zod.bag || {}, t._zod.version = or;
2297
2327
  const r = [...t._zod.def.checks ?? []];
@@ -2304,7 +2334,7 @@ const or = {
2304
2334
  t._zod.run = t._zod.parse;
2305
2335
  });
2306
2336
  else {
2307
- const i = (o, a, u) => {
2337
+ const i = (o, a, c) => {
2308
2338
  let h = D(o), p;
2309
2339
  for (const d of a) {
2310
2340
  if (d._zod.def.when) {
@@ -2313,7 +2343,7 @@ const or = {
2313
2343
  } else if (h)
2314
2344
  continue;
2315
2345
  const f = o.issues.length, v = d._zod.check(o);
2316
- if (v instanceof Promise && u?.async === !1)
2346
+ if (v instanceof Promise && c?.async === !1)
2317
2347
  throw new F();
2318
2348
  if (p || v instanceof Promise)
2319
2349
  p = (p ?? Promise.resolve()).then(async () => {
@@ -2326,16 +2356,16 @@ const or = {
2326
2356
  }
2327
2357
  }
2328
2358
  return p ? p.then(() => o) : o;
2329
- }, s = (o, a, u) => {
2359
+ }, s = (o, a, c) => {
2330
2360
  if (D(o))
2331
2361
  return o.aborted = !0, o;
2332
- const h = i(a, r, u);
2362
+ const h = i(a, r, c);
2333
2363
  if (h instanceof Promise) {
2334
- if (u.async === !1)
2364
+ if (c.async === !1)
2335
2365
  throw new F();
2336
- return h.then((p) => t._zod.parse(p, u));
2366
+ return h.then((p) => t._zod.parse(p, c));
2337
2367
  }
2338
- return t._zod.parse(h, u);
2368
+ return t._zod.parse(h, c);
2339
2369
  };
2340
2370
  t._zod.run = (o, a) => {
2341
2371
  if (a.skipChecks)
@@ -2344,13 +2374,13 @@ const or = {
2344
2374
  const h = t._zod.parse({ value: o.value, issues: [] }, { ...a, skipChecks: !0 });
2345
2375
  return h instanceof Promise ? h.then((p) => s(p, o, a)) : s(h, o, a);
2346
2376
  }
2347
- const u = t._zod.parse(o, a);
2348
- if (u instanceof Promise) {
2377
+ const c = t._zod.parse(o, a);
2378
+ if (c instanceof Promise) {
2349
2379
  if (a.async === !1)
2350
2380
  throw new F();
2351
- return u.then((h) => i(h, r, a));
2381
+ return c.then((h) => i(h, r, a));
2352
2382
  }
2353
- return i(u, r, a);
2383
+ return i(c, r, a);
2354
2384
  };
2355
2385
  }
2356
2386
  t["~standard"] = {
@@ -2365,8 +2395,8 @@ const or = {
2365
2395
  vendor: "zod",
2366
2396
  version: 1
2367
2397
  };
2368
- }), ke = /* @__PURE__ */ c("$ZodString", (t, e) => {
2369
- k.init(t, e), t._zod.pattern = [...t?._zod.bag?.patterns ?? []].pop() ?? Mn(t._zod.bag), t._zod.parse = (n, r) => {
2398
+ }), ke = /* @__PURE__ */ u("$ZodString", (t, e) => {
2399
+ k.init(t, e), t._zod.pattern = [...t?._zod.bag?.patterns ?? []].pop() ?? Un(t._zod.bag), t._zod.parse = (n, r) => {
2370
2400
  if (e.coerce)
2371
2401
  try {
2372
2402
  n.value = String(n.value);
@@ -2379,11 +2409,11 @@ const or = {
2379
2409
  inst: t
2380
2410
  }), n;
2381
2411
  };
2382
- }), g = /* @__PURE__ */ c("$ZodStringFormat", (t, e) => {
2412
+ }), g = /* @__PURE__ */ u("$ZodStringFormat", (t, e) => {
2383
2413
  ie.init(t, e), ke.init(t, e);
2384
- }), ar = /* @__PURE__ */ c("$ZodGUID", (t, e) => {
2414
+ }), ar = /* @__PURE__ */ u("$ZodGUID", (t, e) => {
2385
2415
  e.pattern ?? (e.pattern = Sn), g.init(t, e);
2386
- }), cr = /* @__PURE__ */ c("$ZodUUID", (t, e) => {
2416
+ }), cr = /* @__PURE__ */ u("$ZodUUID", (t, e) => {
2387
2417
  if (e.version) {
2388
2418
  const r = {
2389
2419
  v1: 1,
@@ -2401,9 +2431,9 @@ const or = {
2401
2431
  } else
2402
2432
  e.pattern ?? (e.pattern = Ie());
2403
2433
  g.init(t, e);
2404
- }), ur = /* @__PURE__ */ c("$ZodEmail", (t, e) => {
2434
+ }), ur = /* @__PURE__ */ u("$ZodEmail", (t, e) => {
2405
2435
  e.pattern ?? (e.pattern = Nn), g.init(t, e);
2406
- }), hr = /* @__PURE__ */ c("$ZodURL", (t, e) => {
2436
+ }), hr = /* @__PURE__ */ u("$ZodURL", (t, e) => {
2407
2437
  g.init(t, e), t._zod.check = (n) => {
2408
2438
  try {
2409
2439
  const r = n.value.trim(), i = new URL(r);
@@ -2435,31 +2465,31 @@ const or = {
2435
2465
  });
2436
2466
  }
2437
2467
  };
2438
- }), pr = /* @__PURE__ */ c("$ZodEmoji", (t, e) => {
2468
+ }), pr = /* @__PURE__ */ u("$ZodEmoji", (t, e) => {
2439
2469
  e.pattern ?? (e.pattern = An()), g.init(t, e);
2440
- }), lr = /* @__PURE__ */ c("$ZodNanoID", (t, e) => {
2470
+ }), lr = /* @__PURE__ */ u("$ZodNanoID", (t, e) => {
2441
2471
  e.pattern ?? (e.pattern = $n), g.init(t, e);
2442
- }), dr = /* @__PURE__ */ c("$ZodCUID", (t, e) => {
2472
+ }), dr = /* @__PURE__ */ u("$ZodCUID", (t, e) => {
2443
2473
  e.pattern ?? (e.pattern = wn), g.init(t, e);
2444
- }), fr = /* @__PURE__ */ c("$ZodCUID2", (t, e) => {
2474
+ }), fr = /* @__PURE__ */ u("$ZodCUID2", (t, e) => {
2445
2475
  e.pattern ?? (e.pattern = bn), g.init(t, e);
2446
- }), mr = /* @__PURE__ */ c("$ZodULID", (t, e) => {
2476
+ }), mr = /* @__PURE__ */ u("$ZodULID", (t, e) => {
2447
2477
  e.pattern ?? (e.pattern = En), g.init(t, e);
2448
- }), gr = /* @__PURE__ */ c("$ZodXID", (t, e) => {
2478
+ }), gr = /* @__PURE__ */ u("$ZodXID", (t, e) => {
2449
2479
  e.pattern ?? (e.pattern = zn), g.init(t, e);
2450
- }), vr = /* @__PURE__ */ c("$ZodKSUID", (t, e) => {
2480
+ }), vr = /* @__PURE__ */ u("$ZodKSUID", (t, e) => {
2451
2481
  e.pattern ?? (e.pattern = In), g.init(t, e);
2452
- }), _r = /* @__PURE__ */ c("$ZodISODateTime", (t, e) => {
2453
- e.pattern ?? (e.pattern = Un(e)), g.init(t, e);
2454
- }), kr = /* @__PURE__ */ c("$ZodISODate", (t, e) => {
2482
+ }), _r = /* @__PURE__ */ u("$ZodISODateTime", (t, e) => {
2483
+ e.pattern ?? (e.pattern = Mn(e)), g.init(t, e);
2484
+ }), kr = /* @__PURE__ */ u("$ZodISODate", (t, e) => {
2455
2485
  e.pattern ?? (e.pattern = Fn), g.init(t, e);
2456
- }), yr = /* @__PURE__ */ c("$ZodISOTime", (t, e) => {
2486
+ }), yr = /* @__PURE__ */ u("$ZodISOTime", (t, e) => {
2457
2487
  e.pattern ?? (e.pattern = jn(e)), g.init(t, e);
2458
- }), Tr = /* @__PURE__ */ c("$ZodISODuration", (t, e) => {
2488
+ }), Tr = /* @__PURE__ */ u("$ZodISODuration", (t, e) => {
2459
2489
  e.pattern ?? (e.pattern = On), g.init(t, e);
2460
- }), wr = /* @__PURE__ */ c("$ZodIPv4", (t, e) => {
2490
+ }), wr = /* @__PURE__ */ u("$ZodIPv4", (t, e) => {
2461
2491
  e.pattern ?? (e.pattern = Zn), g.init(t, e), t._zod.bag.format = "ipv4";
2462
- }), br = /* @__PURE__ */ c("$ZodIPv6", (t, e) => {
2492
+ }), br = /* @__PURE__ */ u("$ZodIPv6", (t, e) => {
2463
2493
  e.pattern ?? (e.pattern = Cn), g.init(t, e), t._zod.bag.format = "ipv6", t._zod.check = (n) => {
2464
2494
  try {
2465
2495
  new URL(`http://[${n.value}]`);
@@ -2473,10 +2503,10 @@ const or = {
2473
2503
  });
2474
2504
  }
2475
2505
  };
2476
- }), Er = /* @__PURE__ */ c("$ZodCIDRv4", (t, e) => {
2506
+ }), Er = /* @__PURE__ */ u("$ZodCIDRv4", (t, e) => {
2477
2507
  e.pattern ?? (e.pattern = Rn), g.init(t, e);
2478
- }), zr = /* @__PURE__ */ c("$ZodCIDRv6", (t, e) => {
2479
- e.pattern ?? (e.pattern = xn), g.init(t, e), t._zod.check = (n) => {
2508
+ }), zr = /* @__PURE__ */ u("$ZodCIDRv6", (t, e) => {
2509
+ e.pattern ?? (e.pattern = Ln), g.init(t, e), t._zod.check = (n) => {
2480
2510
  const r = n.value.split("/");
2481
2511
  try {
2482
2512
  if (r.length !== 2)
@@ -2512,8 +2542,8 @@ function ft(t) {
2512
2542
  return !1;
2513
2543
  }
2514
2544
  }
2515
- const Ir = /* @__PURE__ */ c("$ZodBase64", (t, e) => {
2516
- e.pattern ?? (e.pattern = Ln), g.init(t, e), t._zod.bag.contentEncoding = "base64", t._zod.check = (n) => {
2545
+ const Ir = /* @__PURE__ */ u("$ZodBase64", (t, e) => {
2546
+ e.pattern ?? (e.pattern = xn), g.init(t, e), t._zod.bag.contentEncoding = "base64", t._zod.check = (n) => {
2517
2547
  ft(n.value) || n.issues.push({
2518
2548
  code: "invalid_format",
2519
2549
  format: "base64",
@@ -2529,7 +2559,7 @@ function $r(t) {
2529
2559
  const e = t.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = e.padEnd(Math.ceil(e.length / 4) * 4, "=");
2530
2560
  return ft(n);
2531
2561
  }
2532
- const Or = /* @__PURE__ */ c("$ZodBase64URL", (t, e) => {
2562
+ const Or = /* @__PURE__ */ u("$ZodBase64URL", (t, e) => {
2533
2563
  e.pattern ?? (e.pattern = ct), g.init(t, e), t._zod.bag.contentEncoding = "base64url", t._zod.check = (n) => {
2534
2564
  $r(n.value) || n.issues.push({
2535
2565
  code: "invalid_format",
@@ -2539,7 +2569,7 @@ const Or = /* @__PURE__ */ c("$ZodBase64URL", (t, e) => {
2539
2569
  continue: !e.abort
2540
2570
  });
2541
2571
  };
2542
- }), Sr = /* @__PURE__ */ c("$ZodE164", (t, e) => {
2572
+ }), Sr = /* @__PURE__ */ u("$ZodE164", (t, e) => {
2543
2573
  e.pattern ?? (e.pattern = Dn), g.init(t, e);
2544
2574
  });
2545
2575
  function Nr(t, e = null) {
@@ -2556,7 +2586,7 @@ function Nr(t, e = null) {
2556
2586
  return !1;
2557
2587
  }
2558
2588
  }
2559
- const Pr = /* @__PURE__ */ c("$ZodJWT", (t, e) => {
2589
+ const Pr = /* @__PURE__ */ u("$ZodJWT", (t, e) => {
2560
2590
  g.init(t, e), t._zod.check = (n) => {
2561
2591
  Nr(n.value, e.alg) || n.issues.push({
2562
2592
  code: "invalid_format",
@@ -2566,7 +2596,7 @@ const Pr = /* @__PURE__ */ c("$ZodJWT", (t, e) => {
2566
2596
  continue: !e.abort
2567
2597
  });
2568
2598
  };
2569
- }), mt = /* @__PURE__ */ c("$ZodNumber", (t, e) => {
2599
+ }), mt = /* @__PURE__ */ u("$ZodNumber", (t, e) => {
2570
2600
  k.init(t, e), t._zod.pattern = t._zod.bag.pattern ?? Vn, t._zod.parse = (n, r) => {
2571
2601
  if (e.coerce)
2572
2602
  try {
@@ -2585,11 +2615,11 @@ const Pr = /* @__PURE__ */ c("$ZodJWT", (t, e) => {
2585
2615
  ...s ? { received: s } : {}
2586
2616
  }), n;
2587
2617
  };
2588
- }), Ar = /* @__PURE__ */ c("$ZodNumberFormat", (t, e) => {
2618
+ }), Ar = /* @__PURE__ */ u("$ZodNumberFormat", (t, e) => {
2589
2619
  Kn.init(t, e), mt.init(t, e);
2590
- }), Zr = /* @__PURE__ */ c("$ZodUnknown", (t, e) => {
2620
+ }), Zr = /* @__PURE__ */ u("$ZodUnknown", (t, e) => {
2591
2621
  k.init(t, e), t._zod.parse = (n) => n;
2592
- }), Cr = /* @__PURE__ */ c("$ZodNever", (t, e) => {
2622
+ }), Cr = /* @__PURE__ */ u("$ZodNever", (t, e) => {
2593
2623
  k.init(t, e), t._zod.parse = (n, r) => (n.issues.push({
2594
2624
  expected: "never",
2595
2625
  code: "invalid_type",
@@ -2600,7 +2630,7 @@ const Pr = /* @__PURE__ */ c("$ZodJWT", (t, e) => {
2600
2630
  function $e(t, e, n) {
2601
2631
  t.issues.length && e.issues.push(...it(n, t.issues)), e.value[n] = t.value;
2602
2632
  }
2603
- const Rr = /* @__PURE__ */ c("$ZodArray", (t, e) => {
2633
+ const Rr = /* @__PURE__ */ u("$ZodArray", (t, e) => {
2604
2634
  k.init(t, e), t._zod.parse = (n, r) => {
2605
2635
  const i = n.value;
2606
2636
  if (!Array.isArray(i))
@@ -2613,11 +2643,11 @@ const Rr = /* @__PURE__ */ c("$ZodArray", (t, e) => {
2613
2643
  n.value = Array(i.length);
2614
2644
  const s = [];
2615
2645
  for (let o = 0; o < i.length; o++) {
2616
- const a = i[o], u = e.element._zod.run({
2646
+ const a = i[o], c = e.element._zod.run({
2617
2647
  value: a,
2618
2648
  issues: []
2619
2649
  }, r);
2620
- u instanceof Promise ? s.push(u.then((h) => $e(h, n, o))) : $e(u, n, o);
2650
+ c instanceof Promise ? s.push(c.then((h) => $e(h, n, o))) : $e(c, n, o);
2621
2651
  }
2622
2652
  return s.length ? Promise.all(s).then(() => n) : n;
2623
2653
  };
@@ -2640,7 +2670,7 @@ function gt(t) {
2640
2670
  };
2641
2671
  }
2642
2672
  function vt(t, e, n, r, i, s) {
2643
- const o = [], a = i.keySet, u = i.catchall._zod, h = u.def.type;
2673
+ const o = [], a = i.keySet, c = i.catchall._zod, h = c.def.type;
2644
2674
  for (const p in e) {
2645
2675
  if (a.has(p))
2646
2676
  continue;
@@ -2648,7 +2678,7 @@ function vt(t, e, n, r, i, s) {
2648
2678
  o.push(p);
2649
2679
  continue;
2650
2680
  }
2651
- const d = u.run({ value: e[p], issues: [] }, r);
2681
+ const d = c.run({ value: e[p], issues: [] }, r);
2652
2682
  d instanceof Promise ? t.push(d.then((f) => q(f, n, p, e))) : q(d, n, p, e);
2653
2683
  }
2654
2684
  return o.length && n.issues.push({
@@ -2658,34 +2688,34 @@ function vt(t, e, n, r, i, s) {
2658
2688
  inst: s
2659
2689
  }), t.length ? Promise.all(t).then(() => n) : n;
2660
2690
  }
2661
- const xr = /* @__PURE__ */ c("$ZodObject", (t, e) => {
2691
+ const Lr = /* @__PURE__ */ u("$ZodObject", (t, e) => {
2662
2692
  if (k.init(t, e), !Object.getOwnPropertyDescriptor(e, "shape")?.get) {
2663
2693
  const a = e.shape;
2664
2694
  Object.defineProperty(e, "shape", {
2665
2695
  get: () => {
2666
- const u = { ...a };
2696
+ const c = { ...a };
2667
2697
  return Object.defineProperty(e, "shape", {
2668
- value: u
2669
- }), u;
2698
+ value: c
2699
+ }), c;
2670
2700
  }
2671
2701
  });
2672
2702
  }
2673
2703
  const r = te(() => gt(e));
2674
2704
  m(t._zod, "propValues", () => {
2675
- const a = e.shape, u = {};
2705
+ const a = e.shape, c = {};
2676
2706
  for (const h in a) {
2677
2707
  const p = a[h]._zod;
2678
2708
  if (p.values) {
2679
- u[h] ?? (u[h] = /* @__PURE__ */ new Set());
2709
+ c[h] ?? (c[h] = /* @__PURE__ */ new Set());
2680
2710
  for (const d of p.values)
2681
- u[h].add(d);
2711
+ c[h].add(d);
2682
2712
  }
2683
2713
  }
2684
- return u;
2714
+ return c;
2685
2715
  });
2686
2716
  const i = V, s = e.catchall;
2687
2717
  let o;
2688
- t._zod.parse = (a, u) => {
2718
+ t._zod.parse = (a, c) => {
2689
2719
  o ?? (o = r.value);
2690
2720
  const h = a.value;
2691
2721
  if (!i(h))
@@ -2698,13 +2728,13 @@ const xr = /* @__PURE__ */ c("$ZodObject", (t, e) => {
2698
2728
  a.value = {};
2699
2729
  const p = [], d = o.shape;
2700
2730
  for (const f of o.keys) {
2701
- const E = d[f]._zod.run({ value: h[f], issues: [] }, u);
2731
+ const E = d[f]._zod.run({ value: h[f], issues: [] }, c);
2702
2732
  E instanceof Promise ? p.push(E.then((oe) => q(oe, a, f, h))) : q(E, a, f, h);
2703
2733
  }
2704
- return s ? vt(p, h, a, u, r.value, t) : p.length ? Promise.all(p).then(() => a) : a;
2734
+ return s ? vt(p, h, a, c, r.value, t) : p.length ? Promise.all(p).then(() => a) : a;
2705
2735
  };
2706
- }), Lr = /* @__PURE__ */ c("$ZodObjectJIT", (t, e) => {
2707
- xr.init(t, e);
2736
+ }), xr = /* @__PURE__ */ u("$ZodObjectJIT", (t, e) => {
2737
+ Lr.init(t, e);
2708
2738
  const n = t._zod.parse, r = te(() => gt(e)), i = (f) => {
2709
2739
  const v = new sr(["shape", "payload", "ctx"]), E = r.value, oe = (O) => {
2710
2740
  const I = ze(O);
@@ -2717,22 +2747,22 @@ const xr = /* @__PURE__ */ c("$ZodObject", (t, e) => {
2717
2747
  we[O] = `key_${St++}`;
2718
2748
  v.write("const newResult = {};");
2719
2749
  for (const O of E.keys) {
2720
- const I = we[O], M = ze(O);
2750
+ const I = we[O], U = ze(O);
2721
2751
  v.write(`const ${I} = ${oe(O)};`), v.write(`
2722
2752
  if (${I}.issues.length) {
2723
2753
  payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
2724
2754
  ...iss,
2725
- path: iss.path ? [${M}, ...iss.path] : [${M}]
2755
+ path: iss.path ? [${U}, ...iss.path] : [${U}]
2726
2756
  })));
2727
2757
  }
2728
2758
 
2729
2759
 
2730
2760
  if (${I}.value === undefined) {
2731
- if (${M} in input) {
2732
- newResult[${M}] = undefined;
2761
+ if (${U} in input) {
2762
+ newResult[${U}] = undefined;
2733
2763
  }
2734
2764
  } else {
2735
- newResult[${M}] = ${I}.value;
2765
+ newResult[${U}] = ${I}.value;
2736
2766
  }
2737
2767
 
2738
2768
  `);
@@ -2767,7 +2797,7 @@ function Oe(t, e, n, r) {
2767
2797
  errors: t.map((s) => s.issues.map((o) => C(o, r, Z())))
2768
2798
  }), e);
2769
2799
  }
2770
- const _t = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
2800
+ const _t = /* @__PURE__ */ u("$ZodUnion", (t, e) => {
2771
2801
  k.init(t, e), m(t._zod, "optin", () => e.options.some((i) => i._zod.optin === "optional") ? "optional" : void 0), m(t._zod, "optout", () => e.options.some((i) => i._zod.optout === "optional") ? "optional" : void 0), m(t._zod, "values", () => {
2772
2802
  if (e.options.every((i) => i._zod.values))
2773
2803
  return new Set(e.options.flatMap((i) => Array.from(i._zod.values)));
@@ -2783,8 +2813,8 @@ const _t = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
2783
2813
  return r(i, s);
2784
2814
  let o = !1;
2785
2815
  const a = [];
2786
- for (const u of e.options) {
2787
- const h = u._zod.run({
2816
+ for (const c of e.options) {
2817
+ const h = c._zod.run({
2788
2818
  value: i.value,
2789
2819
  issues: []
2790
2820
  }, s);
@@ -2796,9 +2826,9 @@ const _t = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
2796
2826
  a.push(h);
2797
2827
  }
2798
2828
  }
2799
- return o ? Promise.all(a).then((u) => Oe(u, i, t, s)) : Oe(a, i, t, s);
2829
+ return o ? Promise.all(a).then((c) => Oe(c, i, t, s)) : Oe(a, i, t, s);
2800
2830
  };
2801
- }), Dr = /* @__PURE__ */ c("$ZodDiscriminatedUnion", (t, e) => {
2831
+ }), Dr = /* @__PURE__ */ u("$ZodDiscriminatedUnion", (t, e) => {
2802
2832
  e.inclusive = !1, _t.init(t, e);
2803
2833
  const n = t._zod.parse;
2804
2834
  m(t._zod, "propValues", () => {
@@ -2807,9 +2837,9 @@ const _t = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
2807
2837
  const o = s._zod.propValues;
2808
2838
  if (!o || Object.keys(o).length === 0)
2809
2839
  throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);
2810
- for (const [a, u] of Object.entries(o)) {
2840
+ for (const [a, c] of Object.entries(o)) {
2811
2841
  i[a] || (i[a] = /* @__PURE__ */ new Set());
2812
- for (const h of u)
2842
+ for (const h of c)
2813
2843
  i[a].add(h);
2814
2844
  }
2815
2845
  }
@@ -2821,10 +2851,10 @@ const _t = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
2821
2851
  const a = o._zod.propValues?.[e.discriminator];
2822
2852
  if (!a || a.size === 0)
2823
2853
  throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);
2824
- for (const u of a) {
2825
- if (s.has(u))
2826
- throw new Error(`Duplicate discriminator value "${String(u)}"`);
2827
- s.set(u, o);
2854
+ for (const c of a) {
2855
+ if (s.has(c))
2856
+ throw new Error(`Duplicate discriminator value "${String(c)}"`);
2857
+ s.set(c, o);
2828
2858
  }
2829
2859
  }
2830
2860
  return s;
@@ -2849,10 +2879,10 @@ const _t = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
2849
2879
  inst: t
2850
2880
  }), i);
2851
2881
  };
2852
- }), Fr = /* @__PURE__ */ c("$ZodIntersection", (t, e) => {
2882
+ }), Fr = /* @__PURE__ */ u("$ZodIntersection", (t, e) => {
2853
2883
  k.init(t, e), t._zod.parse = (n, r) => {
2854
2884
  const i = n.value, s = e.left._zod.run({ value: i, issues: [] }, r), o = e.right._zod.run({ value: i, issues: [] }, r);
2855
- return s instanceof Promise || o instanceof Promise ? Promise.all([s, o]).then(([u, h]) => Se(n, u, h)) : Se(n, s, o);
2885
+ return s instanceof Promise || o instanceof Promise ? Promise.all([s, o]).then(([c, h]) => Se(n, c, h)) : Se(n, s, o);
2856
2886
  };
2857
2887
  });
2858
2888
  function pe(t, e) {
@@ -2898,7 +2928,7 @@ function Se(t, e, n) {
2898
2928
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
2899
2929
  return t.value = r.data, t;
2900
2930
  }
2901
- const jr = /* @__PURE__ */ c("$ZodEnum", (t, e) => {
2931
+ const jr = /* @__PURE__ */ u("$ZodEnum", (t, e) => {
2902
2932
  k.init(t, e);
2903
2933
  const n = tt(e.entries), r = new Set(n);
2904
2934
  t._zod.values = r, t._zod.pattern = new RegExp(`^(${n.filter((i) => Ht.has(typeof i)).map((i) => typeof i == "string" ? j(i) : i.toString()).join("|")})$`), t._zod.parse = (i, s) => {
@@ -2910,7 +2940,7 @@ const jr = /* @__PURE__ */ c("$ZodEnum", (t, e) => {
2910
2940
  inst: t
2911
2941
  }), i;
2912
2942
  };
2913
- }), Ur = /* @__PURE__ */ c("$ZodLiteral", (t, e) => {
2943
+ }), Mr = /* @__PURE__ */ u("$ZodLiteral", (t, e) => {
2914
2944
  if (k.init(t, e), e.values.length === 0)
2915
2945
  throw new Error("Cannot create literal schema with no valid values");
2916
2946
  const n = new Set(e.values);
@@ -2923,7 +2953,7 @@ const jr = /* @__PURE__ */ c("$ZodEnum", (t, e) => {
2923
2953
  inst: t
2924
2954
  }), r;
2925
2955
  };
2926
- }), Mr = /* @__PURE__ */ c("$ZodTransform", (t, e) => {
2956
+ }), Ur = /* @__PURE__ */ u("$ZodTransform", (t, e) => {
2927
2957
  k.init(t, e), t._zod.parse = (n, r) => {
2928
2958
  if (r.direction === "backward")
2929
2959
  throw new He(t.constructor.name);
@@ -2938,7 +2968,7 @@ const jr = /* @__PURE__ */ c("$ZodEnum", (t, e) => {
2938
2968
  function Ne(t, e) {
2939
2969
  return t.issues.length && e === void 0 ? { issues: [], value: void 0 } : t;
2940
2970
  }
2941
- const Gr = /* @__PURE__ */ c("$ZodOptional", (t, e) => {
2971
+ const Gr = /* @__PURE__ */ u("$ZodOptional", (t, e) => {
2942
2972
  k.init(t, e), t._zod.optin = "optional", t._zod.optout = "optional", m(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([...e.innerType._zod.values, void 0]) : void 0), m(t._zod, "pattern", () => {
2943
2973
  const n = e.innerType._zod.pattern;
2944
2974
  return n ? new RegExp(`^(${me(n.source)})?$`) : void 0;
@@ -2949,12 +2979,12 @@ const Gr = /* @__PURE__ */ c("$ZodOptional", (t, e) => {
2949
2979
  }
2950
2980
  return n.value === void 0 ? n : e.innerType._zod.run(n, r);
2951
2981
  };
2952
- }), Vr = /* @__PURE__ */ c("$ZodNullable", (t, e) => {
2982
+ }), Vr = /* @__PURE__ */ u("$ZodNullable", (t, e) => {
2953
2983
  k.init(t, e), m(t._zod, "optin", () => e.innerType._zod.optin), m(t._zod, "optout", () => e.innerType._zod.optout), m(t._zod, "pattern", () => {
2954
2984
  const n = e.innerType._zod.pattern;
2955
2985
  return n ? new RegExp(`^(${me(n.source)}|null)$`) : void 0;
2956
2986
  }), m(t._zod, "values", () => e.innerType._zod.values ? /* @__PURE__ */ new Set([...e.innerType._zod.values, null]) : void 0), t._zod.parse = (n, r) => n.value === null ? n : e.innerType._zod.run(n, r);
2957
- }), Br = /* @__PURE__ */ c("$ZodDefault", (t, e) => {
2987
+ }), Br = /* @__PURE__ */ u("$ZodDefault", (t, e) => {
2958
2988
  k.init(t, e), t._zod.optin = "optional", m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => {
2959
2989
  if (r.direction === "backward")
2960
2990
  return e.innerType._zod.run(n, r);
@@ -2967,9 +2997,9 @@ const Gr = /* @__PURE__ */ c("$ZodOptional", (t, e) => {
2967
2997
  function Pe(t, e) {
2968
2998
  return t.value === void 0 && (t.value = e.defaultValue), t;
2969
2999
  }
2970
- const Jr = /* @__PURE__ */ c("$ZodPrefault", (t, e) => {
3000
+ const Jr = /* @__PURE__ */ u("$ZodPrefault", (t, e) => {
2971
3001
  k.init(t, e), t._zod.optin = "optional", m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = e.defaultValue), e.innerType._zod.run(n, r));
2972
- }), Wr = /* @__PURE__ */ c("$ZodNonOptional", (t, e) => {
3002
+ }), Wr = /* @__PURE__ */ u("$ZodNonOptional", (t, e) => {
2973
3003
  k.init(t, e), m(t._zod, "values", () => {
2974
3004
  const n = e.innerType._zod.values;
2975
3005
  return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
@@ -2986,7 +3016,7 @@ function Ae(t, e) {
2986
3016
  inst: e
2987
3017
  }), t;
2988
3018
  }
2989
- const Kr = /* @__PURE__ */ c("$ZodCatch", (t, e) => {
3019
+ const Kr = /* @__PURE__ */ u("$ZodCatch", (t, e) => {
2990
3020
  k.init(t, e), m(t._zod, "optin", () => e.innerType._zod.optin), m(t._zod, "optout", () => e.innerType._zod.optout), m(t._zod, "values", () => e.innerType._zod.values), t._zod.parse = (n, r) => {
2991
3021
  if (r.direction === "backward")
2992
3022
  return e.innerType._zod.run(n, r);
@@ -3005,7 +3035,7 @@ const Kr = /* @__PURE__ */ c("$ZodCatch", (t, e) => {
3005
3035
  input: n.value
3006
3036
  }), n.issues = []), n);
3007
3037
  };
3008
- }), Yr = /* @__PURE__ */ c("$ZodPipe", (t, e) => {
3038
+ }), Yr = /* @__PURE__ */ u("$ZodPipe", (t, e) => {
3009
3039
  k.init(t, e), m(t._zod, "values", () => e.in._zod.values), m(t._zod, "optin", () => e.in._zod.optin), m(t._zod, "optout", () => e.out._zod.optout), m(t._zod, "propValues", () => e.in._zod.propValues), t._zod.parse = (n, r) => {
3010
3040
  if (r.direction === "backward") {
3011
3041
  const s = e.out._zod.run(n, r);
@@ -3018,7 +3048,7 @@ const Kr = /* @__PURE__ */ c("$ZodCatch", (t, e) => {
3018
3048
  function K(t, e, n) {
3019
3049
  return t.issues.length ? (t.aborted = !0, t) : e._zod.run({ value: t.value, issues: t.issues }, n);
3020
3050
  }
3021
- const Xr = /* @__PURE__ */ c("$ZodReadonly", (t, e) => {
3051
+ const Xr = /* @__PURE__ */ u("$ZodReadonly", (t, e) => {
3022
3052
  k.init(t, e), m(t._zod, "propValues", () => e.innerType._zod.propValues), m(t._zod, "values", () => e.innerType._zod.values), m(t._zod, "optin", () => e.innerType?._zod?.optin), m(t._zod, "optout", () => e.innerType?._zod?.optout), t._zod.parse = (n, r) => {
3023
3053
  if (r.direction === "backward")
3024
3054
  return e.innerType._zod.run(n, r);
@@ -3029,7 +3059,7 @@ const Xr = /* @__PURE__ */ c("$ZodReadonly", (t, e) => {
3029
3059
  function Ze(t) {
3030
3060
  return t.value = Object.freeze(t.value), t;
3031
3061
  }
3032
- const qr = /* @__PURE__ */ c("$ZodCustom", (t, e) => {
3062
+ const qr = /* @__PURE__ */ u("$ZodCustom", (t, e) => {
3033
3063
  b.init(t, e), k.init(t, e), t._zod.parse = (n, r) => n, t._zod.check = (n) => {
3034
3064
  const r = n.value, i = e.fn(r);
3035
3065
  if (i instanceof Promise)
@@ -3107,7 +3137,7 @@ function ti(t, e) {
3107
3137
  ...l(e)
3108
3138
  });
3109
3139
  }
3110
- function xe(t, e) {
3140
+ function Le(t, e) {
3111
3141
  return new t({
3112
3142
  type: "string",
3113
3143
  format: "guid",
@@ -3362,7 +3392,7 @@ function Si(t, e) {
3362
3392
  ...l(e)
3363
3393
  });
3364
3394
  }
3365
- function Le(t, e) {
3395
+ function xe(t, e) {
3366
3396
  return new lt({
3367
3397
  check: "less_than",
3368
3398
  ...l(e),
@@ -3468,28 +3498,28 @@ function Ri(t, e) {
3468
3498
  suffix: t
3469
3499
  });
3470
3500
  }
3471
- function U(t) {
3501
+ function M(t) {
3472
3502
  return new ir({
3473
3503
  check: "overwrite",
3474
3504
  tx: t
3475
3505
  });
3476
3506
  }
3477
- function xi(t) {
3478
- return U((e) => e.normalize(t));
3507
+ function Li(t) {
3508
+ return M((e) => e.normalize(t));
3479
3509
  }
3480
- function Li() {
3481
- return U((t) => t.trim());
3510
+ function xi() {
3511
+ return M((t) => t.trim());
3482
3512
  }
3483
3513
  function Di() {
3484
- return U((t) => t.toLowerCase());
3514
+ return M((t) => t.toLowerCase());
3485
3515
  }
3486
3516
  function Fi() {
3487
- return U((t) => t.toUpperCase());
3517
+ return M((t) => t.toUpperCase());
3488
3518
  }
3489
3519
  function ji() {
3490
- return U((t) => qt(t));
3520
+ return M((t) => qt(t));
3491
3521
  }
3492
- function Ui(t, e, n) {
3522
+ function Mi(t, e, n) {
3493
3523
  return new t({
3494
3524
  type: "array",
3495
3525
  element: e,
@@ -3499,7 +3529,7 @@ function Ui(t, e, n) {
3499
3529
  ...l(n)
3500
3530
  });
3501
3531
  }
3502
- function Mi(t, e, n) {
3532
+ function Ui(t, e, n) {
3503
3533
  return new t({
3504
3534
  type: "custom",
3505
3535
  check: "custom",
@@ -3569,8 +3599,8 @@ function T(t, e, n = { path: [], schemaPath: [] }) {
3569
3599
  v(t, e, f, p);
3570
3600
  }
3571
3601
  }
3572
- const u = e.metadataRegistry.get(t);
3573
- return u && Object.assign(o.schema, u), e.io === "input" && w(t) && (delete o.schema.examples, delete o.schema.default), e.io === "input" && o.schema._prefault && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, e.seen.get(t).schema;
3602
+ const c = e.metadataRegistry.get(t);
3603
+ return c && Object.assign(o.schema, c), e.io === "input" && w(t) && (delete o.schema.examples, delete o.schema.default), e.io === "input" && o.schema._prefault && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, e.seen.get(t).schema;
3574
3604
  }
3575
3605
  function wt(t, e) {
3576
3606
  const n = t.seen.get(e);
@@ -3587,13 +3617,13 @@ function wt(t, e) {
3587
3617
  }
3588
3618
  if (s[1] === n)
3589
3619
  return { ref: "#" };
3590
- const u = `#/${o}/`, h = s[1].schema.id ?? `__schema${t.counter++}`;
3591
- return { defId: h, ref: u + h };
3620
+ const c = `#/${o}/`, h = s[1].schema.id ?? `__schema${t.counter++}`;
3621
+ return { defId: h, ref: c + h };
3592
3622
  }, i = (s) => {
3593
3623
  if (s[1].schema.$ref)
3594
3624
  return;
3595
- const o = s[1], { ref: a, defId: u } = r(s);
3596
- o.def = { ...o.schema }, u && (o.defId = u);
3625
+ const o = s[1], { ref: a, defId: c } = r(s);
3626
+ o.def = { ...o.schema }, c && (o.defId = c);
3597
3627
  const h = o.schema;
3598
3628
  for (const p in h)
3599
3629
  delete h[p];
@@ -3614,8 +3644,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3614
3644
  continue;
3615
3645
  }
3616
3646
  if (t.external) {
3617
- const u = t.external.registry.get(s[0])?.id;
3618
- if (e !== s[0] && u) {
3647
+ const c = t.external.registry.get(s[0])?.id;
3648
+ if (e !== s[0] && c) {
3619
3649
  i(s);
3620
3650
  continue;
3621
3651
  }
@@ -3639,18 +3669,18 @@ function bt(t, e) {
3639
3669
  if (!n)
3640
3670
  throw new Error("Unprocessed schema. This is a bug in Zod.");
3641
3671
  const r = (o) => {
3642
- const a = t.seen.get(o), u = a.def ?? a.schema, h = { ...u };
3672
+ const a = t.seen.get(o), c = a.def ?? a.schema, h = { ...c };
3643
3673
  if (a.ref === null)
3644
3674
  return;
3645
3675
  const p = a.ref;
3646
3676
  if (a.ref = null, p) {
3647
3677
  r(p);
3648
3678
  const d = t.seen.get(p).schema;
3649
- d.$ref && (t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0") ? (u.allOf = u.allOf ?? [], u.allOf.push(d)) : (Object.assign(u, d), Object.assign(u, h));
3679
+ d.$ref && (t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0") ? (c.allOf = c.allOf ?? [], c.allOf.push(d)) : (Object.assign(c, d), Object.assign(c, h));
3650
3680
  }
3651
3681
  a.isParent || t.override({
3652
3682
  zodSchema: o,
3653
- jsonSchema: u,
3683
+ jsonSchema: c,
3654
3684
  path: a.path ?? []
3655
3685
  });
3656
3686
  };
@@ -3745,9 +3775,9 @@ const Bi = (t, e = {}) => (n) => {
3745
3775
  }, Wi = (t, e, n, r) => {
3746
3776
  const i = n;
3747
3777
  i.type = "string";
3748
- const { minimum: s, maximum: o, format: a, patterns: u, contentEncoding: h } = t._zod.bag;
3749
- if (typeof s == "number" && (i.minLength = s), typeof o == "number" && (i.maxLength = o), a && (i.format = Ji[a] ?? a, i.format === "" && delete i.format), h && (i.contentEncoding = h), u && u.size > 0) {
3750
- const p = [...u];
3778
+ const { minimum: s, maximum: o, format: a, patterns: c, contentEncoding: h } = t._zod.bag;
3779
+ if (typeof s == "number" && (i.minLength = s), typeof o == "number" && (i.maxLength = o), a && (i.format = Ji[a] ?? a, i.format === "" && delete i.format), h && (i.contentEncoding = h), c && c.size > 0) {
3780
+ const p = [...c];
3751
3781
  p.length === 1 ? i.pattern = p[0].source : p.length > 1 && (i.allOf = [
3752
3782
  ...p.map((d) => ({
3753
3783
  ...e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0" ? { type: "string" } : {},
@@ -3756,8 +3786,8 @@ const Bi = (t, e = {}) => (n) => {
3756
3786
  ]);
3757
3787
  }
3758
3788
  }, Ki = (t, e, n, r) => {
3759
- const i = n, { minimum: s, maximum: o, format: a, multipleOf: u, exclusiveMaximum: h, exclusiveMinimum: p } = t._zod.bag;
3760
- typeof a == "string" && a.includes("int") ? i.type = "integer" : i.type = "number", typeof p == "number" && (e.target === "draft-04" || e.target === "openapi-3.0" ? (i.minimum = p, i.exclusiveMinimum = !0) : i.exclusiveMinimum = p), typeof s == "number" && (i.minimum = s, typeof p == "number" && e.target !== "draft-04" && (p >= s ? delete i.minimum : delete i.exclusiveMinimum)), typeof h == "number" && (e.target === "draft-04" || e.target === "openapi-3.0" ? (i.maximum = h, i.exclusiveMaximum = !0) : i.exclusiveMaximum = h), typeof o == "number" && (i.maximum = o, typeof h == "number" && e.target !== "draft-04" && (h <= o ? delete i.maximum : delete i.exclusiveMaximum)), typeof u == "number" && (i.multipleOf = u);
3789
+ const i = n, { minimum: s, maximum: o, format: a, multipleOf: c, exclusiveMaximum: h, exclusiveMinimum: p } = t._zod.bag;
3790
+ typeof a == "string" && a.includes("int") ? i.type = "integer" : i.type = "number", typeof p == "number" && (e.target === "draft-04" || e.target === "openapi-3.0" ? (i.minimum = p, i.exclusiveMinimum = !0) : i.exclusiveMinimum = p), typeof s == "number" && (i.minimum = s, typeof p == "number" && e.target !== "draft-04" && (p >= s ? delete i.minimum : delete i.exclusiveMinimum)), typeof h == "number" && (e.target === "draft-04" || e.target === "openapi-3.0" ? (i.maximum = h, i.exclusiveMaximum = !0) : i.exclusiveMaximum = h), typeof o == "number" && (i.maximum = o, typeof h == "number" && e.target !== "draft-04" && (h <= o ? delete i.maximum : delete i.exclusiveMaximum)), typeof c == "number" && (i.multipleOf = c);
3761
3791
  }, Yi = (t, e, n, r) => {
3762
3792
  n.not = {};
3763
3793
  }, Xi = (t, e, n, r) => {
@@ -3799,18 +3829,18 @@ const Bi = (t, e = {}) => (n) => {
3799
3829
  ...r,
3800
3830
  path: [...r.path, "properties", h]
3801
3831
  });
3802
- const a = new Set(Object.keys(o)), u = new Set([...a].filter((h) => {
3832
+ const a = new Set(Object.keys(o)), c = new Set([...a].filter((h) => {
3803
3833
  const p = s.shape[h]._zod;
3804
3834
  return e.io === "input" ? p.optin === void 0 : p.optout === void 0;
3805
3835
  }));
3806
- u.size > 0 && (i.required = Array.from(u)), s.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : s.catchall ? s.catchall && (i.additionalProperties = T(s.catchall, e, {
3836
+ c.size > 0 && (i.required = Array.from(c)), s.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : s.catchall ? s.catchall && (i.additionalProperties = T(s.catchall, e, {
3807
3837
  ...r,
3808
3838
  path: [...r.path, "additionalProperties"]
3809
3839
  })) : e.io === "output" && (i.additionalProperties = !1);
3810
3840
  }, rs = (t, e, n, r) => {
3811
- const i = t._zod.def, s = i.inclusive === !1, o = i.options.map((a, u) => T(a, e, {
3841
+ const i = t._zod.def, s = i.inclusive === !1, o = i.options.map((a, c) => T(a, e, {
3812
3842
  ...r,
3813
- path: [...r.path, s ? "oneOf" : "anyOf", u]
3843
+ path: [...r.path, s ? "oneOf" : "anyOf", c]
3814
3844
  }));
3815
3845
  s ? n.oneOf = o : n.anyOf = o;
3816
3846
  }, is = (t, e, n, r) => {
@@ -3820,11 +3850,11 @@ const Bi = (t, e = {}) => (n) => {
3820
3850
  }), o = T(i.right, e, {
3821
3851
  ...r,
3822
3852
  path: [...r.path, "allOf", 1]
3823
- }), a = (h) => "allOf" in h && Object.keys(h).length === 1, u = [
3853
+ }), a = (h) => "allOf" in h && Object.keys(h).length === 1, c = [
3824
3854
  ...a(s) ? s.allOf : [s],
3825
3855
  ...a(o) ? o.allOf : [o]
3826
3856
  ];
3827
- n.allOf = u;
3857
+ n.allOf = c;
3828
3858
  }, ss = (t, e, n, r) => {
3829
3859
  const i = t._zod.def, s = T(i.innerType, e, r), o = e.seen.get(t);
3830
3860
  e.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [s, { type: "null" }];
@@ -3870,25 +3900,25 @@ const Bi = (t, e = {}) => (n) => {
3870
3900
  T(i.innerType, e, r);
3871
3901
  const s = e.seen.get(t);
3872
3902
  s.ref = i.innerType;
3873
- }, ds = /* @__PURE__ */ c("ZodISODateTime", (t, e) => {
3903
+ }, ds = /* @__PURE__ */ u("ZodISODateTime", (t, e) => {
3874
3904
  _r.init(t, e), _.init(t, e);
3875
3905
  });
3876
3906
  function fs(t) {
3877
3907
  return wi(ds, t);
3878
3908
  }
3879
- const ms = /* @__PURE__ */ c("ZodISODate", (t, e) => {
3909
+ const ms = /* @__PURE__ */ u("ZodISODate", (t, e) => {
3880
3910
  kr.init(t, e), _.init(t, e);
3881
3911
  });
3882
3912
  function gs(t) {
3883
3913
  return bi(ms, t);
3884
3914
  }
3885
- const vs = /* @__PURE__ */ c("ZodISOTime", (t, e) => {
3915
+ const vs = /* @__PURE__ */ u("ZodISOTime", (t, e) => {
3886
3916
  yr.init(t, e), _.init(t, e);
3887
3917
  });
3888
3918
  function _s(t) {
3889
3919
  return Ei(vs, t);
3890
3920
  }
3891
- const ks = /* @__PURE__ */ c("ZodISODuration", (t, e) => {
3921
+ const ks = /* @__PURE__ */ u("ZodISODuration", (t, e) => {
3892
3922
  Tr.init(t, e), _.init(t, e);
3893
3923
  });
3894
3924
  function ys(t) {
@@ -3923,19 +3953,19 @@ const Ts = (t, e) => {
3923
3953
  // enumerable: false,
3924
3954
  }
3925
3955
  });
3926
- }, z = c("ZodError", Ts, {
3956
+ }, z = u("ZodError", Ts, {
3927
3957
  Parent: Error
3928
- }), ws = /* @__PURE__ */ ve(z), bs = /* @__PURE__ */ _e(z), Es = /* @__PURE__ */ ne(z), zs = /* @__PURE__ */ re(z), Is = /* @__PURE__ */ fn(z), $s = /* @__PURE__ */ mn(z), Os = /* @__PURE__ */ gn(z), Ss = /* @__PURE__ */ vn(z), Ns = /* @__PURE__ */ _n(z), Ps = /* @__PURE__ */ kn(z), As = /* @__PURE__ */ yn(z), Zs = /* @__PURE__ */ Tn(z), y = /* @__PURE__ */ c("ZodType", (t, e) => (k.init(t, e), Object.assign(t["~standard"], {
3958
+ }), ws = /* @__PURE__ */ ve(z), bs = /* @__PURE__ */ _e(z), Es = /* @__PURE__ */ ne(z), zs = /* @__PURE__ */ re(z), Is = /* @__PURE__ */ fn(z), $s = /* @__PURE__ */ mn(z), Os = /* @__PURE__ */ gn(z), Ss = /* @__PURE__ */ vn(z), Ns = /* @__PURE__ */ _n(z), Ps = /* @__PURE__ */ kn(z), As = /* @__PURE__ */ yn(z), Zs = /* @__PURE__ */ Tn(z), y = /* @__PURE__ */ u("ZodType", (t, e) => (k.init(t, e), Object.assign(t["~standard"], {
3929
3959
  jsonSchema: {
3930
3960
  input: H(t, "input"),
3931
3961
  output: H(t, "output")
3932
3962
  }
3933
- }), t.toJSONSchema = Bi(t, {}), t.def = e, t.type = e.type, Object.defineProperty(t, "_def", { value: e }), t.check = (...n) => t.clone(x(e, {
3963
+ }), t.toJSONSchema = Bi(t, {}), t.def = e, t.type = e.type, Object.defineProperty(t, "_def", { value: e }), t.check = (...n) => t.clone(L(e, {
3934
3964
  checks: [
3935
3965
  ...e.checks ?? [],
3936
3966
  ...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
3937
3967
  ]
3938
- })), t.clone = (n, r) => P(t, n, r), t.brand = () => t, t.register = ((n, r) => (n.add(t, r), t)), t.parse = (n, r) => ws(t, n, r, { callee: t.parse }), t.safeParse = (n, r) => Es(t, n, r), t.parseAsync = async (n, r) => bs(t, n, r, { callee: t.parseAsync }), t.safeParseAsync = async (n, r) => zs(t, n, r), t.spa = t.safeParseAsync, t.encode = (n, r) => Is(t, n, r), t.decode = (n, r) => $s(t, n, r), t.encodeAsync = async (n, r) => Os(t, n, r), t.decodeAsync = async (n, r) => Ss(t, n, r), t.safeEncode = (n, r) => Ns(t, n, r), t.safeDecode = (n, r) => Ps(t, n, r), t.safeEncodeAsync = async (n, r) => As(t, n, r), t.safeDecodeAsync = async (n, r) => Zs(t, n, r), t.refine = (n, r) => t.check(zo(n, r)), t.superRefine = (n) => t.check(Io(n)), t.overwrite = (n) => t.check(U(n)), t.optional = () => Ge(t), t.nullable = () => Ve(t), t.nullish = () => Ge(Ve(t)), t.nonoptional = (n) => _o(t, n), t.array = () => A(t), t.or = (n) => ye([t, n]), t.and = (n) => co(t, n), t.transform = (n) => Be(t, po(n)), t.default = (n) => mo(t, n), t.prefault = (n) => vo(t, n), t.catch = (n) => yo(t, n), t.pipe = (n) => Be(t, n), t.readonly = () => bo(t), t.describe = (n) => {
3968
+ })), t.clone = (n, r) => P(t, n, r), t.brand = () => t, t.register = ((n, r) => (n.add(t, r), t)), t.parse = (n, r) => ws(t, n, r, { callee: t.parse }), t.safeParse = (n, r) => Es(t, n, r), t.parseAsync = async (n, r) => bs(t, n, r, { callee: t.parseAsync }), t.safeParseAsync = async (n, r) => zs(t, n, r), t.spa = t.safeParseAsync, t.encode = (n, r) => Is(t, n, r), t.decode = (n, r) => $s(t, n, r), t.encodeAsync = async (n, r) => Os(t, n, r), t.decodeAsync = async (n, r) => Ss(t, n, r), t.safeEncode = (n, r) => Ns(t, n, r), t.safeDecode = (n, r) => Ps(t, n, r), t.safeEncodeAsync = async (n, r) => As(t, n, r), t.safeDecodeAsync = async (n, r) => Zs(t, n, r), t.refine = (n, r) => t.check(zo(n, r)), t.superRefine = (n) => t.check(Io(n)), t.overwrite = (n) => t.check(M(n)), t.optional = () => Ge(t), t.nullable = () => Ve(t), t.nullish = () => Ge(Ve(t)), t.nonoptional = (n) => _o(t, n), t.array = () => A(t), t.or = (n) => ye([t, n]), t.and = (n) => co(t, n), t.transform = (n) => Be(t, po(n)), t.default = (n) => mo(t, n), t.prefault = (n) => vo(t, n), t.catch = (n) => yo(t, n), t.pipe = (n) => Be(t, n), t.readonly = () => bo(t), t.describe = (n) => {
3939
3969
  const r = t.clone();
3940
3970
  return G.add(r, { description: n }), r;
3941
3971
  }, Object.defineProperty(t, "description", {
@@ -3948,90 +3978,90 @@ const Ts = (t, e) => {
3948
3978
  return G.get(t);
3949
3979
  const r = t.clone();
3950
3980
  return G.add(r, n[0]), r;
3951
- }, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), Et = /* @__PURE__ */ c("_ZodString", (t, e) => {
3981
+ }, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), Et = /* @__PURE__ */ u("_ZodString", (t, e) => {
3952
3982
  ke.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, i, s) => Wi(t, r, i);
3953
3983
  const n = t._zod.bag;
3954
- t.format = n.format ?? null, t.minLength = n.minimum ?? null, t.maxLength = n.maximum ?? null, t.regex = (...r) => t.check(Ni(...r)), t.includes = (...r) => t.check(Zi(...r)), t.startsWith = (...r) => t.check(Ci(...r)), t.endsWith = (...r) => t.check(Ri(...r)), t.min = (...r) => t.check(Q(...r)), t.max = (...r) => t.check(kt(...r)), t.length = (...r) => t.check(yt(...r)), t.nonempty = (...r) => t.check(Q(1, ...r)), t.lowercase = (r) => t.check(Pi(r)), t.uppercase = (r) => t.check(Ai(r)), t.trim = () => t.check(Li()), t.normalize = (...r) => t.check(xi(...r)), t.toLowerCase = () => t.check(Di()), t.toUpperCase = () => t.check(Fi()), t.slugify = () => t.check(ji());
3955
- }), Cs = /* @__PURE__ */ c("ZodString", (t, e) => {
3956
- ke.init(t, e), Et.init(t, e), t.email = (n) => t.check(ti(Rs, n)), t.url = (n) => t.check(oi(xs, n)), t.jwt = (n) => t.check(Ti(qs, n)), t.emoji = (n) => t.check(ai(Ls, n)), t.guid = (n) => t.check(xe(je, n)), t.uuid = (n) => t.check(ni(Y, n)), t.uuidv4 = (n) => t.check(ri(Y, n)), t.uuidv6 = (n) => t.check(ii(Y, n)), t.uuidv7 = (n) => t.check(si(Y, n)), t.nanoid = (n) => t.check(ci(Ds, n)), t.guid = (n) => t.check(xe(je, n)), t.cuid = (n) => t.check(ui(Fs, n)), t.cuid2 = (n) => t.check(hi(js, n)), t.ulid = (n) => t.check(pi(Us, n)), t.base64 = (n) => t.check(_i(Ks, n)), t.base64url = (n) => t.check(ki(Ys, n)), t.xid = (n) => t.check(li(Ms, n)), t.ksuid = (n) => t.check(di(Gs, n)), t.ipv4 = (n) => t.check(fi(Vs, n)), t.ipv6 = (n) => t.check(mi(Bs, n)), t.cidrv4 = (n) => t.check(gi(Js, n)), t.cidrv6 = (n) => t.check(vi(Ws, n)), t.e164 = (n) => t.check(yi(Xs, n)), t.datetime = (n) => t.check(fs(n)), t.date = (n) => t.check(gs(n)), t.time = (n) => t.check(_s(n)), t.duration = (n) => t.check(ys(n));
3984
+ t.format = n.format ?? null, t.minLength = n.minimum ?? null, t.maxLength = n.maximum ?? null, t.regex = (...r) => t.check(Ni(...r)), t.includes = (...r) => t.check(Zi(...r)), t.startsWith = (...r) => t.check(Ci(...r)), t.endsWith = (...r) => t.check(Ri(...r)), t.min = (...r) => t.check(Q(...r)), t.max = (...r) => t.check(kt(...r)), t.length = (...r) => t.check(yt(...r)), t.nonempty = (...r) => t.check(Q(1, ...r)), t.lowercase = (r) => t.check(Pi(r)), t.uppercase = (r) => t.check(Ai(r)), t.trim = () => t.check(xi()), t.normalize = (...r) => t.check(Li(...r)), t.toLowerCase = () => t.check(Di()), t.toUpperCase = () => t.check(Fi()), t.slugify = () => t.check(ji());
3985
+ }), Cs = /* @__PURE__ */ u("ZodString", (t, e) => {
3986
+ ke.init(t, e), Et.init(t, e), t.email = (n) => t.check(ti(Rs, n)), t.url = (n) => t.check(oi(Ls, n)), t.jwt = (n) => t.check(Ti(qs, n)), t.emoji = (n) => t.check(ai(xs, n)), t.guid = (n) => t.check(Le(je, n)), t.uuid = (n) => t.check(ni(Y, n)), t.uuidv4 = (n) => t.check(ri(Y, n)), t.uuidv6 = (n) => t.check(ii(Y, n)), t.uuidv7 = (n) => t.check(si(Y, n)), t.nanoid = (n) => t.check(ci(Ds, n)), t.guid = (n) => t.check(Le(je, n)), t.cuid = (n) => t.check(ui(Fs, n)), t.cuid2 = (n) => t.check(hi(js, n)), t.ulid = (n) => t.check(pi(Ms, n)), t.base64 = (n) => t.check(_i(Ks, n)), t.base64url = (n) => t.check(ki(Ys, n)), t.xid = (n) => t.check(li(Us, n)), t.ksuid = (n) => t.check(di(Gs, n)), t.ipv4 = (n) => t.check(fi(Vs, n)), t.ipv6 = (n) => t.check(mi(Bs, n)), t.cidrv4 = (n) => t.check(gi(Js, n)), t.cidrv6 = (n) => t.check(vi(Ws, n)), t.e164 = (n) => t.check(yi(Xs, n)), t.datetime = (n) => t.check(fs(n)), t.date = (n) => t.check(gs(n)), t.time = (n) => t.check(_s(n)), t.duration = (n) => t.check(ys(n));
3957
3987
  });
3958
3988
  function $(t) {
3959
3989
  return ei(Cs, t);
3960
3990
  }
3961
- const _ = /* @__PURE__ */ c("ZodStringFormat", (t, e) => {
3991
+ const _ = /* @__PURE__ */ u("ZodStringFormat", (t, e) => {
3962
3992
  g.init(t, e), Et.init(t, e);
3963
- }), Rs = /* @__PURE__ */ c("ZodEmail", (t, e) => {
3993
+ }), Rs = /* @__PURE__ */ u("ZodEmail", (t, e) => {
3964
3994
  ur.init(t, e), _.init(t, e);
3965
- }), je = /* @__PURE__ */ c("ZodGUID", (t, e) => {
3995
+ }), je = /* @__PURE__ */ u("ZodGUID", (t, e) => {
3966
3996
  ar.init(t, e), _.init(t, e);
3967
- }), Y = /* @__PURE__ */ c("ZodUUID", (t, e) => {
3997
+ }), Y = /* @__PURE__ */ u("ZodUUID", (t, e) => {
3968
3998
  cr.init(t, e), _.init(t, e);
3969
- }), xs = /* @__PURE__ */ c("ZodURL", (t, e) => {
3999
+ }), Ls = /* @__PURE__ */ u("ZodURL", (t, e) => {
3970
4000
  hr.init(t, e), _.init(t, e);
3971
- }), Ls = /* @__PURE__ */ c("ZodEmoji", (t, e) => {
4001
+ }), xs = /* @__PURE__ */ u("ZodEmoji", (t, e) => {
3972
4002
  pr.init(t, e), _.init(t, e);
3973
- }), Ds = /* @__PURE__ */ c("ZodNanoID", (t, e) => {
4003
+ }), Ds = /* @__PURE__ */ u("ZodNanoID", (t, e) => {
3974
4004
  lr.init(t, e), _.init(t, e);
3975
- }), Fs = /* @__PURE__ */ c("ZodCUID", (t, e) => {
4005
+ }), Fs = /* @__PURE__ */ u("ZodCUID", (t, e) => {
3976
4006
  dr.init(t, e), _.init(t, e);
3977
- }), js = /* @__PURE__ */ c("ZodCUID2", (t, e) => {
4007
+ }), js = /* @__PURE__ */ u("ZodCUID2", (t, e) => {
3978
4008
  fr.init(t, e), _.init(t, e);
3979
- }), Us = /* @__PURE__ */ c("ZodULID", (t, e) => {
4009
+ }), Ms = /* @__PURE__ */ u("ZodULID", (t, e) => {
3980
4010
  mr.init(t, e), _.init(t, e);
3981
- }), Ms = /* @__PURE__ */ c("ZodXID", (t, e) => {
4011
+ }), Us = /* @__PURE__ */ u("ZodXID", (t, e) => {
3982
4012
  gr.init(t, e), _.init(t, e);
3983
- }), Gs = /* @__PURE__ */ c("ZodKSUID", (t, e) => {
4013
+ }), Gs = /* @__PURE__ */ u("ZodKSUID", (t, e) => {
3984
4014
  vr.init(t, e), _.init(t, e);
3985
- }), Vs = /* @__PURE__ */ c("ZodIPv4", (t, e) => {
4015
+ }), Vs = /* @__PURE__ */ u("ZodIPv4", (t, e) => {
3986
4016
  wr.init(t, e), _.init(t, e);
3987
- }), Bs = /* @__PURE__ */ c("ZodIPv6", (t, e) => {
4017
+ }), Bs = /* @__PURE__ */ u("ZodIPv6", (t, e) => {
3988
4018
  br.init(t, e), _.init(t, e);
3989
- }), Js = /* @__PURE__ */ c("ZodCIDRv4", (t, e) => {
4019
+ }), Js = /* @__PURE__ */ u("ZodCIDRv4", (t, e) => {
3990
4020
  Er.init(t, e), _.init(t, e);
3991
- }), Ws = /* @__PURE__ */ c("ZodCIDRv6", (t, e) => {
4021
+ }), Ws = /* @__PURE__ */ u("ZodCIDRv6", (t, e) => {
3992
4022
  zr.init(t, e), _.init(t, e);
3993
- }), Ks = /* @__PURE__ */ c("ZodBase64", (t, e) => {
4023
+ }), Ks = /* @__PURE__ */ u("ZodBase64", (t, e) => {
3994
4024
  Ir.init(t, e), _.init(t, e);
3995
- }), Ys = /* @__PURE__ */ c("ZodBase64URL", (t, e) => {
4025
+ }), Ys = /* @__PURE__ */ u("ZodBase64URL", (t, e) => {
3996
4026
  Or.init(t, e), _.init(t, e);
3997
- }), Xs = /* @__PURE__ */ c("ZodE164", (t, e) => {
4027
+ }), Xs = /* @__PURE__ */ u("ZodE164", (t, e) => {
3998
4028
  Sr.init(t, e), _.init(t, e);
3999
- }), qs = /* @__PURE__ */ c("ZodJWT", (t, e) => {
4029
+ }), qs = /* @__PURE__ */ u("ZodJWT", (t, e) => {
4000
4030
  Pr.init(t, e), _.init(t, e);
4001
- }), zt = /* @__PURE__ */ c("ZodNumber", (t, e) => {
4002
- mt.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, i, s) => Ki(t, r, i), t.gt = (r, i) => t.check(De(r, i)), t.gte = (r, i) => t.check(ue(r, i)), t.min = (r, i) => t.check(ue(r, i)), t.lt = (r, i) => t.check(Le(r, i)), t.lte = (r, i) => t.check(ce(r, i)), t.max = (r, i) => t.check(ce(r, i)), t.int = (r) => t.check(Ue(r)), t.safe = (r) => t.check(Ue(r)), t.positive = (r) => t.check(De(0, r)), t.nonnegative = (r) => t.check(ue(0, r)), t.negative = (r) => t.check(Le(0, r)), t.nonpositive = (r) => t.check(ce(0, r)), t.multipleOf = (r, i) => t.check(Fe(r, i)), t.step = (r, i) => t.check(Fe(r, i)), t.finite = () => t;
4031
+ }), zt = /* @__PURE__ */ u("ZodNumber", (t, e) => {
4032
+ mt.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, i, s) => Ki(t, r, i), t.gt = (r, i) => t.check(De(r, i)), t.gte = (r, i) => t.check(ue(r, i)), t.min = (r, i) => t.check(ue(r, i)), t.lt = (r, i) => t.check(xe(r, i)), t.lte = (r, i) => t.check(ce(r, i)), t.max = (r, i) => t.check(ce(r, i)), t.int = (r) => t.check(Me(r)), t.safe = (r) => t.check(Me(r)), t.positive = (r) => t.check(De(0, r)), t.nonnegative = (r) => t.check(ue(0, r)), t.negative = (r) => t.check(xe(0, r)), t.nonpositive = (r) => t.check(ce(0, r)), t.multipleOf = (r, i) => t.check(Fe(r, i)), t.step = (r, i) => t.check(Fe(r, i)), t.finite = () => t;
4003
4033
  const n = t._zod.bag;
4004
4034
  t.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, t.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, t.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), t.isFinite = !0, t.format = n.format ?? null;
4005
4035
  });
4006
4036
  function Qs(t) {
4007
4037
  return Ii(zt, t);
4008
4038
  }
4009
- const Hs = /* @__PURE__ */ c("ZodNumberFormat", (t, e) => {
4039
+ const Hs = /* @__PURE__ */ u("ZodNumberFormat", (t, e) => {
4010
4040
  Ar.init(t, e), zt.init(t, e);
4011
4041
  });
4012
- function Ue(t) {
4042
+ function Me(t) {
4013
4043
  return $i(Hs, t);
4014
4044
  }
4015
- const eo = /* @__PURE__ */ c("ZodUnknown", (t, e) => {
4045
+ const eo = /* @__PURE__ */ u("ZodUnknown", (t, e) => {
4016
4046
  Zr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => Xi();
4017
4047
  });
4018
- function Me() {
4048
+ function Ue() {
4019
4049
  return Oi(eo);
4020
4050
  }
4021
- const to = /* @__PURE__ */ c("ZodNever", (t, e) => {
4051
+ const to = /* @__PURE__ */ u("ZodNever", (t, e) => {
4022
4052
  Cr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => Yi(t, n, r);
4023
4053
  });
4024
4054
  function no(t) {
4025
4055
  return Si(to, t);
4026
4056
  }
4027
- const ro = /* @__PURE__ */ c("ZodArray", (t, e) => {
4057
+ const ro = /* @__PURE__ */ u("ZodArray", (t, e) => {
4028
4058
  Rr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ts(t, n, r, i), t.element = e.element, t.min = (n, r) => t.check(Q(n, r)), t.nonempty = (n) => t.check(Q(1, n)), t.max = (n, r) => t.check(kt(n, r)), t.length = (n, r) => t.check(yt(n, r)), t.unwrap = () => t.element;
4029
4059
  });
4030
4060
  function A(t, e) {
4031
- return Ui(ro, t, e);
4061
+ return Mi(ro, t, e);
4032
4062
  }
4033
- const io = /* @__PURE__ */ c("ZodObject", (t, e) => {
4034
- Lr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ns(t, n, r, i), m(t, "shape", () => e.shape), t.keyof = () => Te(Object.keys(t._zod.def.shape)), t.catchall = (n) => t.clone({ ...t._zod.def, catchall: n }), t.passthrough = () => t.clone({ ...t._zod.def, catchall: Me() }), t.loose = () => t.clone({ ...t._zod.def, catchall: Me() }), t.strict = () => t.clone({ ...t._zod.def, catchall: no() }), t.strip = () => t.clone({ ...t._zod.def, catchall: void 0 }), t.extend = (n) => sn(t, n), t.safeExtend = (n) => on(t, n), t.merge = (n) => an(t, n), t.pick = (n) => nn(t, n), t.omit = (n) => rn(t, n), t.partial = (...n) => cn($t, t, n[0]), t.required = (...n) => un(Ot, t, n[0]);
4063
+ const io = /* @__PURE__ */ u("ZodObject", (t, e) => {
4064
+ xr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ns(t, n, r, i), m(t, "shape", () => e.shape), t.keyof = () => Te(Object.keys(t._zod.def.shape)), t.catchall = (n) => t.clone({ ...t._zod.def, catchall: n }), t.passthrough = () => t.clone({ ...t._zod.def, catchall: Ue() }), t.loose = () => t.clone({ ...t._zod.def, catchall: Ue() }), t.strict = () => t.clone({ ...t._zod.def, catchall: no() }), t.strip = () => t.clone({ ...t._zod.def, catchall: void 0 }), t.extend = (n) => sn(t, n), t.safeExtend = (n) => on(t, n), t.merge = (n) => an(t, n), t.pick = (n) => nn(t, n), t.omit = (n) => rn(t, n), t.partial = (...n) => cn($t, t, n[0]), t.required = (...n) => un(Ot, t, n[0]);
4035
4065
  });
4036
4066
  function S(t, e) {
4037
4067
  const n = {
@@ -4041,7 +4071,7 @@ function S(t, e) {
4041
4071
  };
4042
4072
  return new io(n);
4043
4073
  }
4044
- const It = /* @__PURE__ */ c("ZodUnion", (t, e) => {
4074
+ const It = /* @__PURE__ */ u("ZodUnion", (t, e) => {
4045
4075
  _t.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => rs(t, n, r, i), t.options = e.options;
4046
4076
  });
4047
4077
  function ye(t, e) {
@@ -4051,7 +4081,7 @@ function ye(t, e) {
4051
4081
  ...l(e)
4052
4082
  });
4053
4083
  }
4054
- const so = /* @__PURE__ */ c("ZodDiscriminatedUnion", (t, e) => {
4084
+ const so = /* @__PURE__ */ u("ZodDiscriminatedUnion", (t, e) => {
4055
4085
  It.init(t, e), Dr.init(t, e);
4056
4086
  });
4057
4087
  function oo(t, e, n) {
@@ -4062,7 +4092,7 @@ function oo(t, e, n) {
4062
4092
  ...l(n)
4063
4093
  });
4064
4094
  }
4065
- const ao = /* @__PURE__ */ c("ZodIntersection", (t, e) => {
4095
+ const ao = /* @__PURE__ */ u("ZodIntersection", (t, e) => {
4066
4096
  Fr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => is(t, n, r, i);
4067
4097
  });
4068
4098
  function co(t, e) {
@@ -4072,7 +4102,7 @@ function co(t, e) {
4072
4102
  right: e
4073
4103
  });
4074
4104
  }
4075
- const le = /* @__PURE__ */ c("ZodEnum", (t, e) => {
4105
+ const le = /* @__PURE__ */ u("ZodEnum", (t, e) => {
4076
4106
  jr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (r, i, s) => qi(t, r, i), t.enum = e.entries, t.options = Object.values(e.entries);
4077
4107
  const n = new Set(Object.keys(e.entries));
4078
4108
  t.extract = (r, i) => {
@@ -4111,8 +4141,8 @@ function Te(t, e) {
4111
4141
  ...l(e)
4112
4142
  });
4113
4143
  }
4114
- const uo = /* @__PURE__ */ c("ZodLiteral", (t, e) => {
4115
- Ur.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => Qi(t, n, r), t.values = new Set(e.values), Object.defineProperty(t, "value", {
4144
+ const uo = /* @__PURE__ */ u("ZodLiteral", (t, e) => {
4145
+ Mr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => Qi(t, n, r), t.values = new Set(e.values), Object.defineProperty(t, "value", {
4116
4146
  get() {
4117
4147
  if (e.values.length > 1)
4118
4148
  throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
@@ -4127,8 +4157,8 @@ function se(t, e) {
4127
4157
  ...l(e)
4128
4158
  });
4129
4159
  }
4130
- const ho = /* @__PURE__ */ c("ZodTransform", (t, e) => {
4131
- Mr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => es(t, n), t._zod.parse = (n, r) => {
4160
+ const ho = /* @__PURE__ */ u("ZodTransform", (t, e) => {
4161
+ Ur.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => es(t, n), t._zod.parse = (n, r) => {
4132
4162
  if (r.direction === "backward")
4133
4163
  throw new He(t.constructor.name);
4134
4164
  n.addIssue = (s) => {
@@ -4149,7 +4179,7 @@ function po(t) {
4149
4179
  transform: t
4150
4180
  });
4151
4181
  }
4152
- const $t = /* @__PURE__ */ c("ZodOptional", (t, e) => {
4182
+ const $t = /* @__PURE__ */ u("ZodOptional", (t, e) => {
4153
4183
  Gr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ls(t, n, r, i), t.unwrap = () => t._zod.def.innerType;
4154
4184
  });
4155
4185
  function Ge(t) {
@@ -4158,7 +4188,7 @@ function Ge(t) {
4158
4188
  innerType: t
4159
4189
  });
4160
4190
  }
4161
- const lo = /* @__PURE__ */ c("ZodNullable", (t, e) => {
4191
+ const lo = /* @__PURE__ */ u("ZodNullable", (t, e) => {
4162
4192
  Vr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ss(t, n, r, i), t.unwrap = () => t._zod.def.innerType;
4163
4193
  });
4164
4194
  function Ve(t) {
@@ -4167,7 +4197,7 @@ function Ve(t) {
4167
4197
  innerType: t
4168
4198
  });
4169
4199
  }
4170
- const fo = /* @__PURE__ */ c("ZodDefault", (t, e) => {
4200
+ const fo = /* @__PURE__ */ u("ZodDefault", (t, e) => {
4171
4201
  Br.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => as(t, n, r, i), t.unwrap = () => t._zod.def.innerType, t.removeDefault = t.unwrap;
4172
4202
  });
4173
4203
  function mo(t, e) {
@@ -4179,7 +4209,7 @@ function mo(t, e) {
4179
4209
  }
4180
4210
  });
4181
4211
  }
4182
- const go = /* @__PURE__ */ c("ZodPrefault", (t, e) => {
4212
+ const go = /* @__PURE__ */ u("ZodPrefault", (t, e) => {
4183
4213
  Jr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => cs(t, n, r, i), t.unwrap = () => t._zod.def.innerType;
4184
4214
  });
4185
4215
  function vo(t, e) {
@@ -4191,7 +4221,7 @@ function vo(t, e) {
4191
4221
  }
4192
4222
  });
4193
4223
  }
4194
- const Ot = /* @__PURE__ */ c("ZodNonOptional", (t, e) => {
4224
+ const Ot = /* @__PURE__ */ u("ZodNonOptional", (t, e) => {
4195
4225
  Wr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => os(t, n, r, i), t.unwrap = () => t._zod.def.innerType;
4196
4226
  });
4197
4227
  function _o(t, e) {
@@ -4201,7 +4231,7 @@ function _o(t, e) {
4201
4231
  ...l(e)
4202
4232
  });
4203
4233
  }
4204
- const ko = /* @__PURE__ */ c("ZodCatch", (t, e) => {
4234
+ const ko = /* @__PURE__ */ u("ZodCatch", (t, e) => {
4205
4235
  Kr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => us(t, n, r, i), t.unwrap = () => t._zod.def.innerType, t.removeCatch = t.unwrap;
4206
4236
  });
4207
4237
  function yo(t, e) {
@@ -4211,7 +4241,7 @@ function yo(t, e) {
4211
4241
  catchValue: typeof e == "function" ? e : () => e
4212
4242
  });
4213
4243
  }
4214
- const To = /* @__PURE__ */ c("ZodPipe", (t, e) => {
4244
+ const To = /* @__PURE__ */ u("ZodPipe", (t, e) => {
4215
4245
  Yr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => hs(t, n, r, i), t.in = e.in, t.out = e.out;
4216
4246
  });
4217
4247
  function Be(t, e) {
@@ -4222,7 +4252,7 @@ function Be(t, e) {
4222
4252
  // ...util.normalizeParams(params),
4223
4253
  });
4224
4254
  }
4225
- const wo = /* @__PURE__ */ c("ZodReadonly", (t, e) => {
4255
+ const wo = /* @__PURE__ */ u("ZodReadonly", (t, e) => {
4226
4256
  Xr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => ps(t, n, r, i), t.unwrap = () => t._zod.def.innerType;
4227
4257
  });
4228
4258
  function bo(t) {
@@ -4231,11 +4261,11 @@ function bo(t) {
4231
4261
  innerType: t
4232
4262
  });
4233
4263
  }
4234
- const Eo = /* @__PURE__ */ c("ZodCustom", (t, e) => {
4264
+ const Eo = /* @__PURE__ */ u("ZodCustom", (t, e) => {
4235
4265
  qr.init(t, e), y.init(t, e), t._zod.processJSONSchema = (n, r, i) => Hi(t, n);
4236
4266
  });
4237
4267
  function zo(t, e = {}) {
4238
- return Mi(Eo, t, e);
4268
+ return Ui(Eo, t, e);
4239
4269
  }
4240
4270
  function Io(t) {
4241
4271
  return Gi(t);
@@ -4287,12 +4317,12 @@ const N = ye([
4287
4317
  // Input format (auto-detected if omitted)
4288
4318
  outputFormat: Je.optional()
4289
4319
  // Output format (same as input if omitted)
4290
- }), xo = S({
4320
+ }), Lo = S({
4291
4321
  version: Qs(),
4292
4322
  targets: A(Ro)
4293
4323
  });
4294
- function Uo(t) {
4295
- const e = xo.safeParse(t);
4324
+ function Mo(t) {
4325
+ const e = Lo.safeParse(t);
4296
4326
  if (!e.success) {
4297
4327
  const n = e.error.issues.map((r) => `[${r.path.join(".")}]: ${r.message}`).join(`
4298
4328
  `);
@@ -4305,13 +4335,13 @@ export {
4305
4335
  be as FormatDetector,
4306
4336
  jo as GeneratorFactory,
4307
4337
  Ye as MermaidGeneratorVisitor,
4308
- Ut as ParserFactory,
4338
+ Mt as ParserFactory,
4309
4339
  Xe as PlantUMLGeneratorVisitor,
4310
4340
  Fo as Polagram,
4311
4341
  Yt as PolagramBuilder,
4312
- xo as PolagramConfigSchema,
4342
+ Lo as PolagramConfigSchema,
4313
4343
  ae as TransformationEngine,
4314
4344
  Ke as Traverser,
4315
4345
  Kt as transformerRegistry,
4316
- Uo as validateConfig
4346
+ Mo as validateConfig
4317
4347
  };