@synnaxlabs/drift 0.44.1 → 0.44.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.
@@ -418,7 +418,7 @@ function te(t, e) {
418
418
  function Ge(t) {
419
419
  return typeof t == "string" ? t : t?.message;
420
420
  }
421
- function re(t, e, r) {
421
+ function ie(t, e, r) {
422
422
  const o = { ...t, path: t.path ?? [] };
423
423
  if (!t.message) {
424
424
  const n = Ge(t.inst?._zod.def?.error?.(t)) ?? Ge(e?.error?.(t)) ?? Ge(r.customError?.(t)) ?? Ge(r.localeError?.(t)) ?? "Invalid input";
@@ -471,7 +471,7 @@ const yl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
471
471
  esc: De,
472
472
  escapeRegex: Ue,
473
473
  extend: ro,
474
- finalizeIssue: re,
474
+ finalizeIssue: ie,
475
475
  floatSafeRemainder: Ki,
476
476
  getElementAtPath: ll,
477
477
  getEnumValues: _n,
@@ -564,10 +564,10 @@ function so(t, e) {
564
564
  o.errors.push(r(f));
565
565
  continue;
566
566
  }
567
- let l = o, g = 0;
568
- for (; g < p.length; ) {
569
- const y = p[g], d = g === p.length - 1;
570
- typeof y == "string" ? (l.properties ?? (l.properties = {}), (u = l.properties)[y] ?? (u[y] = { errors: [] }), l = l.properties[y]) : (l.items ?? (l.items = []), (s = l.items)[y] ?? (s[y] = { errors: [] }), l = l.items[y]), d && l.errors.push(r(f)), g++;
567
+ let l = o, h = 0;
568
+ for (; h < p.length; ) {
569
+ const y = p[h], d = h === p.length - 1;
570
+ typeof y == "string" ? (l.properties ?? (l.properties = {}), (u = l.properties)[y] ?? (u[y] = { errors: [] }), l = l.properties[y]) : (l.items ?? (l.items = []), (s = l.items)[y] ?? (s[y] = { errors: [] }), l = l.items[y]), d && l.errors.push(r(f)), h++;
571
571
  }
572
572
  }
573
573
  };
@@ -591,7 +591,7 @@ const zn = (t) => (e, r, o, n) => {
591
591
  if (a instanceof Promise)
592
592
  throw new Me();
593
593
  if (a.issues.length) {
594
- const u = new (n?.Err ?? t)(a.issues.map((s) => re(s, i, Y())));
594
+ const u = new (n?.Err ?? t)(a.issues.map((s) => ie(s, i, Y())));
595
595
  throw In(u, n?.callee), u;
596
596
  }
597
597
  return a.value;
@@ -599,7 +599,7 @@ const zn = (t) => (e, r, o, n) => {
599
599
  const i = o ? Object.assign(o, { async: !0 }) : { async: !0 };
600
600
  let a = e._zod.run({ value: r, issues: [] }, i);
601
601
  if (a instanceof Promise && (a = await a), a.issues.length) {
602
- const u = new (n?.Err ?? t)(a.issues.map((s) => re(s, i, Y())));
602
+ const u = new (n?.Err ?? t)(a.issues.map((s) => ie(s, i, Y())));
603
603
  throw In(u, n?.callee), u;
604
604
  }
605
605
  return a.value;
@@ -609,14 +609,14 @@ const zn = (t) => (e, r, o, n) => {
609
609
  throw new Me();
610
610
  return i.issues.length ? {
611
611
  success: !1,
612
- error: new (t ?? kn)(i.issues.map((a) => re(a, n, Y())))
612
+ error: new (t ?? kn)(i.issues.map((a) => ie(a, n, Y())))
613
613
  } : { success: !0, data: i.value };
614
614
  }, fo = /* @__PURE__ */ Nn(ot), Tn = (t) => async (e, r, o) => {
615
615
  const n = o ? Object.assign(o, { async: !0 }) : { async: !0 };
616
616
  let i = e._zod.run({ value: r, issues: [] }, n);
617
617
  return i instanceof Promise && (i = await i), i.issues.length ? {
618
618
  success: !1,
619
- error: new t(i.issues.map((a) => re(a, n, Y())))
619
+ error: new t(i.issues.map((a) => ie(a, n, Y())))
620
620
  } : { success: !0, data: i.value };
621
621
  }, mo = /* @__PURE__ */ Tn(ot), po = /^[cC][^\s-]{8,}$/, go = /^[0-9a-z]+$/, ho = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, vo = /^[0-9a-vA-V]{20}$/, yo = /^[A-Za-z0-9]{27}$/, bo = /^[a-zA-Z0-9_-]{21}$/, $o = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, bl = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, wo = /^([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})$/, Re = (t) => t ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/, $l = /* @__PURE__ */ Re(4), wl = /* @__PURE__ */ Re(6), _l = /* @__PURE__ */ Re(7), _o = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Il = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, kl = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, Sl = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u, Ol = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, zl = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
622
622
  function Io() {
@@ -1112,12 +1112,12 @@ const fa = {
1112
1112
  continue;
1113
1113
  } else if (s)
1114
1114
  continue;
1115
- const l = i.issues.length, g = p._zod.check(i);
1116
- if (g instanceof Promise && u?.async === !1)
1115
+ const l = i.issues.length, h = p._zod.check(i);
1116
+ if (h instanceof Promise && u?.async === !1)
1117
1117
  throw new Me();
1118
- if (f || g instanceof Promise)
1118
+ if (f || h instanceof Promise)
1119
1119
  f = (f ?? Promise.resolve()).then(async () => {
1120
- await g, i.issues.length !== l && (s || (s = Ae(i, l)));
1120
+ await h, i.issues.length !== l && (s || (s = Ae(i, l)));
1121
1121
  });
1122
1122
  else {
1123
1123
  if (i.issues.length === l)
@@ -1525,44 +1525,44 @@ const qa = /* @__PURE__ */ c("$ZodObject", (t, e) => {
1525
1525
  for (const y of l)
1526
1526
  if (!(e.shape[y] instanceof k))
1527
1527
  throw new Error(`Invalid element at key "${y}": expected a Zod schema`);
1528
- const g = Hi(e.shape);
1528
+ const h = Hi(e.shape);
1529
1529
  return {
1530
1530
  shape: e.shape,
1531
1531
  keys: l,
1532
1532
  keySet: new Set(l),
1533
1533
  numKeys: l.length,
1534
- optionalKeys: new Set(g)
1534
+ optionalKeys: new Set(h)
1535
1535
  };
1536
1536
  });
1537
1537
  N(t._zod, "propValues", () => {
1538
- const l = e.shape, g = {};
1538
+ const l = e.shape, h = {};
1539
1539
  for (const y in l) {
1540
1540
  const d = l[y]._zod;
1541
1541
  if (d.values) {
1542
- g[y] ?? (g[y] = /* @__PURE__ */ new Set());
1542
+ h[y] ?? (h[y] = /* @__PURE__ */ new Set());
1543
1543
  for (const $ of d.values)
1544
- g[y].add($);
1544
+ h[y].add($);
1545
1545
  }
1546
1546
  }
1547
- return g;
1547
+ return h;
1548
1548
  });
1549
1549
  const o = (l) => {
1550
- const g = new da(["shape", "payload", "ctx"]), y = r.value, d = (I) => {
1550
+ const h = new da(["shape", "payload", "ctx"]), y = r.value, d = (I) => {
1551
1551
  const S = De(I);
1552
1552
  return `shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`;
1553
1553
  };
1554
- g.write("const input = payload.value;");
1554
+ h.write("const input = payload.value;");
1555
1555
  const $ = /* @__PURE__ */ Object.create(null);
1556
1556
  let w = 0;
1557
1557
  for (const I of y.keys)
1558
1558
  $[I] = `key_${w++}`;
1559
- g.write("const newResult = {}");
1559
+ h.write("const newResult = {}");
1560
1560
  for (const I of y.keys)
1561
1561
  if (y.optionalKeys.has(I)) {
1562
1562
  const S = $[I];
1563
- g.write(`const ${S} = ${d(I)};`);
1563
+ h.write(`const ${S} = ${d(I)};`);
1564
1564
  const T = De(I);
1565
- g.write(`
1565
+ h.write(`
1566
1566
  if (${S}.issues.length) {
1567
1567
  if (input[${T}] === undefined) {
1568
1568
  if (${T} in input) {
@@ -1584,20 +1584,20 @@ const qa = /* @__PURE__ */ c("$ZodObject", (t, e) => {
1584
1584
  `);
1585
1585
  } else {
1586
1586
  const S = $[I];
1587
- g.write(`const ${S} = ${d(I)};`), g.write(`
1587
+ h.write(`const ${S} = ${d(I)};`), h.write(`
1588
1588
  if (${S}.issues.length) payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
1589
1589
  ...iss,
1590
1590
  path: iss.path ? [${De(I)}, ...iss.path] : [${De(I)}]
1591
- })));`), g.write(`newResult[${De(I)}] = ${S}.value`);
1591
+ })));`), h.write(`newResult[${De(I)}] = ${S}.value`);
1592
1592
  }
1593
- g.write("payload.value = newResult;"), g.write("return payload;");
1594
- const E = g.compile();
1595
- return (I, S) => E(l, I, S);
1593
+ h.write("payload.value = newResult;"), h.write("return payload;");
1594
+ const P = h.compile();
1595
+ return (I, S) => P(l, I, S);
1596
1596
  };
1597
1597
  let n;
1598
1598
  const i = He, a = !wt.jitless, s = a && Yi.value, f = e.catchall;
1599
1599
  let p;
1600
- t._zod.parse = (l, g) => {
1600
+ t._zod.parse = (l, h) => {
1601
1601
  p ?? (p = r.value);
1602
1602
  const y = l.value;
1603
1603
  if (!i(y))
@@ -1608,19 +1608,19 @@ const qa = /* @__PURE__ */ c("$ZodObject", (t, e) => {
1608
1608
  inst: t
1609
1609
  }), l;
1610
1610
  const d = [];
1611
- if (a && s && g?.async === !1 && g.jitless !== !0)
1612
- n || (n = o(e.shape)), l = n(l, g);
1611
+ if (a && s && h?.async === !1 && h.jitless !== !0)
1612
+ n || (n = o(e.shape)), l = n(l, h);
1613
1613
  else {
1614
1614
  l.value = {};
1615
1615
  const S = p.shape;
1616
1616
  for (const T of p.keys) {
1617
- const _e = S[T], lt = _e._zod.run({ value: y[T], issues: [] }, g), vi = _e._zod.optin === "optional" && _e._zod.optout === "optional";
1617
+ const _e = S[T], lt = _e._zod.run({ value: y[T], issues: [] }, h), vi = _e._zod.optin === "optional" && _e._zod.optout === "optional";
1618
1618
  lt instanceof Promise ? d.push(lt.then((yi) => vi ? ki(yi, l, T, y) : ft(yi, l, T))) : vi ? ki(lt, l, T, y) : ft(lt, l, T);
1619
1619
  }
1620
1620
  }
1621
1621
  if (!f)
1622
1622
  return d.length ? Promise.all(d).then(() => l) : l;
1623
- const $ = [], w = p.keySet, E = f._zod, I = E.def.type;
1623
+ const $ = [], w = p.keySet, P = f._zod, I = P.def.type;
1624
1624
  for (const S of Object.keys(y)) {
1625
1625
  if (w.has(S))
1626
1626
  continue;
@@ -1628,7 +1628,7 @@ const qa = /* @__PURE__ */ c("$ZodObject", (t, e) => {
1628
1628
  $.push(S);
1629
1629
  continue;
1630
1630
  }
1631
- const T = E.run({ value: y[S], issues: [] }, g);
1631
+ const T = P.run({ value: y[S], issues: [] }, h);
1632
1632
  T instanceof Promise ? d.push(T.then((_e) => ft(_e, l, S))) : ft(T, l, S);
1633
1633
  }
1634
1634
  return $.length && l.issues.push({
@@ -1647,7 +1647,7 @@ function Si(t, e, r, o) {
1647
1647
  code: "invalid_union",
1648
1648
  input: e.value,
1649
1649
  inst: r,
1650
- errors: t.map((n) => n.issues.map((i) => re(i, o, Y())))
1650
+ errors: t.map((n) => n.issues.map((i) => ie(i, o, Y())))
1651
1651
  }), e;
1652
1652
  }
1653
1653
  const Cn = /* @__PURE__ */ c("$ZodUnion", (t, e) => {
@@ -1818,7 +1818,7 @@ const Pt = /* @__PURE__ */ c("$ZodTuple", (t, e) => {
1818
1818
  value: p,
1819
1819
  issues: []
1820
1820
  }, i);
1821
- l instanceof Promise ? u.push(l.then((g) => mt(g, n, s))) : mt(l, n, s);
1821
+ l instanceof Promise ? u.push(l.then((h) => mt(h, n, s))) : mt(l, n, s);
1822
1822
  }
1823
1823
  }
1824
1824
  return u.length ? Promise.all(u).then(() => n) : n;
@@ -1869,7 +1869,7 @@ const Xa = /* @__PURE__ */ c("$ZodRecord", (t, e) => {
1869
1869
  r.issues.push({
1870
1870
  origin: "record",
1871
1871
  code: "invalid_key",
1872
- issues: u.issues.map((f) => re(f, o, Y())),
1872
+ issues: u.issues.map((f) => ie(f, o, Y())),
1873
1873
  input: a,
1874
1874
  path: [a],
1875
1875
  inst: t
@@ -1911,14 +1911,14 @@ function zi(t, e, r, o, n, i, a) {
1911
1911
  code: "invalid_key",
1912
1912
  input: n,
1913
1913
  inst: i,
1914
- issues: t.issues.map((u) => re(u, a, Y()))
1914
+ issues: t.issues.map((u) => ie(u, a, Y()))
1915
1915
  })), e.issues.length && (_t.has(typeof o) ? r.issues.push(...te(o, e.issues)) : r.issues.push({
1916
1916
  origin: "map",
1917
1917
  code: "invalid_element",
1918
1918
  input: n,
1919
1919
  inst: i,
1920
1920
  key: o,
1921
- issues: e.issues.map((u) => re(u, a, Y()))
1921
+ issues: e.issues.map((u) => ie(u, a, Y()))
1922
1922
  })), r.value.set(t.value, e.value);
1923
1923
  }
1924
1924
  const Qa = /* @__PURE__ */ c("$ZodSet", (t, e) => {
@@ -2035,13 +2035,13 @@ const su = /* @__PURE__ */ c("$ZodSuccess", (t, e) => {
2035
2035
  return n instanceof Promise ? n.then((i) => (r.value = i.value, i.issues.length && (r.value = e.catchValue({
2036
2036
  ...r,
2037
2037
  error: {
2038
- issues: i.issues.map((a) => re(a, o, Y()))
2038
+ issues: i.issues.map((a) => ie(a, o, Y()))
2039
2039
  },
2040
2040
  input: r.value
2041
2041
  }), r.issues = []), r)) : (r.value = n.value, n.issues.length && (r.value = e.catchValue({
2042
2042
  ...r,
2043
2043
  error: {
2044
- issues: n.issues.map((i) => re(i, o, Y()))
2044
+ issues: n.issues.map((i) => ie(i, o, Y()))
2045
2045
  },
2046
2046
  input: r.value
2047
2047
  }), r.issues = []), r);
@@ -6364,7 +6364,7 @@ function ze(t, e) {
6364
6364
  inclusive: !1
6365
6365
  });
6366
6366
  }
6367
- function ne(t, e) {
6367
+ function re(t, e) {
6368
6368
  return new jn({
6369
6369
  check: "less_than",
6370
6370
  ...m(e),
@@ -6395,7 +6395,7 @@ function Yu(t) {
6395
6395
  return ze(0, t);
6396
6396
  }
6397
6397
  function Xu(t) {
6398
- return ne(0, t);
6398
+ return re(0, t);
6399
6399
  }
6400
6400
  function Hu(t) {
6401
6401
  return Q(0, t);
@@ -6733,7 +6733,7 @@ function is(t, e) {
6733
6733
  }), {});
6734
6734
  },
6735
6735
  error: r.error
6736
- }), g = new u({
6736
+ }), h = new u({
6737
6737
  type: "pipe",
6738
6738
  in: new f({ type: "string", error: r.error }),
6739
6739
  out: l,
@@ -6741,7 +6741,7 @@ function is(t, e) {
6741
6741
  });
6742
6742
  return new u({
6743
6743
  type: "pipe",
6744
- in: g,
6744
+ in: h,
6745
6745
  out: new s({
6746
6746
  type: "boolean",
6747
6747
  error: r.error
@@ -6847,17 +6847,17 @@ class dn {
6847
6847
  ...r,
6848
6848
  schemaPath: [...r.schemaPath, e],
6849
6849
  path: r.path
6850
- }, g = e._zod.parent;
6851
- if (g)
6852
- u.ref = g, this.process(g, l), this.seen.get(g).isParent = !0;
6850
+ }, h = e._zod.parent;
6851
+ if (h)
6852
+ u.ref = h, this.process(h, l), this.seen.get(h).isParent = !0;
6853
6853
  else {
6854
6854
  const y = u.schema;
6855
6855
  switch (n.type) {
6856
6856
  case "string": {
6857
6857
  const d = y;
6858
6858
  d.type = "string";
6859
- const { minimum: $, maximum: w, format: E, patterns: I, contentEncoding: S } = e._zod.bag;
6860
- if (typeof $ == "number" && (d.minLength = $), typeof w == "number" && (d.maxLength = w), E && (d.format = i[E] ?? E, d.format === "" && delete d.format), S && (d.contentEncoding = S), I && I.size > 0) {
6859
+ const { minimum: $, maximum: w, format: P, patterns: I, contentEncoding: S } = e._zod.bag;
6860
+ if (typeof $ == "number" && (d.minLength = $), typeof w == "number" && (d.maxLength = w), P && (d.format = i[P] ?? P, d.format === "" && delete d.format), S && (d.contentEncoding = S), I && I.size > 0) {
6861
6861
  const T = [...I];
6862
6862
  T.length === 1 ? d.pattern = T[0].source : T.length > 1 && (u.schema.allOf = [
6863
6863
  ...T.map((_e) => ({
@@ -6869,8 +6869,8 @@ class dn {
6869
6869
  break;
6870
6870
  }
6871
6871
  case "number": {
6872
- const d = y, { minimum: $, maximum: w, format: E, multipleOf: I, exclusiveMaximum: S, exclusiveMinimum: T } = e._zod.bag;
6873
- typeof E == "string" && E.includes("int") ? d.type = "integer" : d.type = "number", typeof T == "number" && (d.exclusiveMinimum = T), typeof $ == "number" && (d.minimum = $, typeof T == "number" && (T >= $ ? delete d.minimum : delete d.exclusiveMinimum)), typeof S == "number" && (d.exclusiveMaximum = S), typeof w == "number" && (d.maximum = w, typeof S == "number" && (S <= w ? delete d.maximum : delete d.exclusiveMaximum)), typeof I == "number" && (d.multipleOf = I);
6872
+ const d = y, { minimum: $, maximum: w, format: P, multipleOf: I, exclusiveMaximum: S, exclusiveMinimum: T } = e._zod.bag;
6873
+ typeof P == "string" && P.includes("int") ? d.type = "integer" : d.type = "number", typeof T == "number" && (d.exclusiveMinimum = T), typeof $ == "number" && (d.minimum = $, typeof T == "number" && (T >= $ ? delete d.minimum : delete d.exclusiveMinimum)), typeof S == "number" && (d.exclusiveMaximum = S), typeof w == "number" && (d.maximum = w, typeof S == "number" && (S <= w ? delete d.maximum : delete d.exclusiveMaximum)), typeof I == "number" && (d.multipleOf = I);
6874
6874
  break;
6875
6875
  }
6876
6876
  case "boolean": {
@@ -6929,11 +6929,11 @@ class dn {
6929
6929
  ...l,
6930
6930
  path: [...l.path, "properties", I]
6931
6931
  });
6932
- const w = new Set(Object.keys($)), E = new Set([...w].filter((I) => {
6932
+ const w = new Set(Object.keys($)), P = new Set([...w].filter((I) => {
6933
6933
  const S = n.shape[I]._zod;
6934
6934
  return this.io === "input" ? S.optin === void 0 : S.optout === void 0;
6935
6935
  }));
6936
- E.size > 0 && (d.required = Array.from(E)), n.catchall?._zod.def.type === "never" ? d.additionalProperties = !1 : n.catchall ? n.catchall && (d.additionalProperties = this.process(n.catchall, {
6936
+ P.size > 0 && (d.required = Array.from(P)), n.catchall?._zod.def.type === "never" ? d.additionalProperties = !1 : n.catchall ? n.catchall && (d.additionalProperties = this.process(n.catchall, {
6937
6937
  ...l,
6938
6938
  path: [...l.path, "additionalProperties"]
6939
6939
  })) : this.io === "output" && (d.additionalProperties = !1);
@@ -6954,9 +6954,9 @@ class dn {
6954
6954
  }), w = this.process(n.right, {
6955
6955
  ...l,
6956
6956
  path: [...l.path, "allOf", 1]
6957
- }), E = (S) => "allOf" in S && Object.keys(S).length === 1, I = [
6958
- ...E($) ? $.allOf : [$],
6959
- ...E(w) ? w.allOf : [w]
6957
+ }), P = (S) => "allOf" in S && Object.keys(S).length === 1, I = [
6958
+ ...P($) ? $.allOf : [$],
6959
+ ...P(w) ? w.allOf : [w]
6960
6960
  ];
6961
6961
  d.allOf = I;
6962
6962
  break;
@@ -6976,8 +6976,8 @@ class dn {
6976
6976
  ...l,
6977
6977
  path: [...l.path, "items"]
6978
6978
  }));
6979
- const { minimum: w, maximum: E } = e._zod.bag;
6980
- typeof w == "number" && (d.minItems = w), typeof E == "number" && (d.maxItems = E);
6979
+ const { minimum: w, maximum: P } = e._zod.bag;
6980
+ typeof w == "number" && (d.minItems = w), typeof P == "number" && (d.maxItems = P);
6981
6981
  break;
6982
6982
  }
6983
6983
  case "record": {
@@ -7027,8 +7027,8 @@ class dn {
7027
7027
  type: "string",
7028
7028
  format: "binary",
7029
7029
  contentEncoding: "binary"
7030
- }, { minimum: w, maximum: E, mime: I } = e._zod.bag;
7031
- w !== void 0 && ($.minLength = w), E !== void 0 && ($.maxLength = E), I ? I.length === 1 ? ($.contentMediaType = I[0], Object.assign(d, $)) : d.anyOf = I.map((S) => ({ ...$, contentMediaType: S })) : Object.assign(d, $);
7030
+ }, { minimum: w, maximum: P, mime: I } = e._zod.bag;
7031
+ w !== void 0 && ($.minLength = w), P !== void 0 && ($.maxLength = P), I ? I.length === 1 ? ($.contentMediaType = I[0], Object.assign(d, $)) : d.anyOf = I.map((S) => ({ ...$, contentMediaType: S })) : Object.assign(d, $);
7032
7032
  break;
7033
7033
  }
7034
7034
  case "transform": {
@@ -7113,7 +7113,7 @@ class dn {
7113
7113
  }
7114
7114
  }
7115
7115
  const f = this.metadataRegistry.get(e);
7116
- return f && Object.assign(u.schema, f), this.io === "input" && J(e) && (delete u.schema.examples, delete u.schema.default), this.io === "input" && u.schema._prefault && ((o = u.schema).default ?? (o.default = u.schema._prefault)), delete u.schema._prefault, this.seen.get(e).schema;
7116
+ return f && Object.assign(u.schema, f), this.io === "input" && V(e) && (delete u.schema.examples, delete u.schema.default), this.io === "input" && u.schema._prefault && ((o = u.schema).default ?? (o.default = u.schema._prefault)), delete u.schema._prefault, this.seen.get(e).schema;
7117
7117
  }
7118
7118
  emit(e, r) {
7119
7119
  const o = {
@@ -7131,8 +7131,8 @@ class dn {
7131
7131
  const $ = o.external.registry.get(p[0])?.id, w = o.external.uri ?? ((I) => I);
7132
7132
  if ($)
7133
7133
  return { ref: w($) };
7134
- const E = p[1].defId ?? p[1].schema.id ?? `schema${this.counter++}`;
7135
- return p[1].defId = E, { defId: E, ref: `${w("__shared")}#/${l}/${E}` };
7134
+ const P = p[1].defId ?? p[1].schema.id ?? `schema${this.counter++}`;
7135
+ return p[1].defId = P, { defId: P, ref: `${w("__shared")}#/${l}/${P}` };
7136
7136
  }
7137
7137
  if (p[1] === n)
7138
7138
  return { ref: "#" };
@@ -7141,12 +7141,12 @@ class dn {
7141
7141
  }, a = (p) => {
7142
7142
  if (p[1].schema.$ref)
7143
7143
  return;
7144
- const l = p[1], { ref: g, defId: y } = i(p);
7144
+ const l = p[1], { ref: h, defId: y } = i(p);
7145
7145
  l.def = { ...l.schema }, y && (l.defId = y);
7146
7146
  const d = l.schema;
7147
7147
  for (const $ in d)
7148
7148
  delete d[$];
7149
- d.$ref = g;
7149
+ d.$ref = h;
7150
7150
  };
7151
7151
  if (o.cycles === "throw")
7152
7152
  for (const p of this.seen.entries()) {
@@ -7183,19 +7183,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7183
7183
  }
7184
7184
  }
7185
7185
  const u = (p, l) => {
7186
- const g = this.seen.get(p), y = g.def ?? g.schema, d = { ...y };
7187
- if (g.ref === null)
7186
+ const h = this.seen.get(p), y = h.def ?? h.schema, d = { ...y };
7187
+ if (h.ref === null)
7188
7188
  return;
7189
- const $ = g.ref;
7190
- if (g.ref = null, $) {
7189
+ const $ = h.ref;
7190
+ if (h.ref = null, $) {
7191
7191
  u($, l);
7192
7192
  const w = this.seen.get($).schema;
7193
7193
  w.$ref && l.target === "draft-7" ? (y.allOf = y.allOf ?? [], y.allOf.push(w)) : (Object.assign(y, w), Object.assign(y, d));
7194
7194
  }
7195
- g.isParent || this.override({
7195
+ h.isParent || this.override({
7196
7196
  zodSchema: p,
7197
7197
  jsonSchema: y,
7198
- path: g.path ?? []
7198
+ path: h.path ?? []
7199
7199
  });
7200
7200
  };
7201
7201
  for (const p of [...this.seen.entries()].reverse())
@@ -7251,7 +7251,7 @@ function ss(t, e) {
7251
7251
  const r = new dn(e);
7252
7252
  return r.process(t), r.emit(t, e);
7253
7253
  }
7254
- function J(t, e) {
7254
+ function V(t, e) {
7255
7255
  const r = e ?? { seen: /* @__PURE__ */ new Set() };
7256
7256
  if (r.seen.has(t))
7257
7257
  return !1;
@@ -7277,52 +7277,52 @@ function J(t, e) {
7277
7277
  case "template_literal":
7278
7278
  return !1;
7279
7279
  case "array":
7280
- return J(n.element, r);
7280
+ return V(n.element, r);
7281
7281
  case "object": {
7282
7282
  for (const i in n.shape)
7283
- if (J(n.shape[i], r))
7283
+ if (V(n.shape[i], r))
7284
7284
  return !0;
7285
7285
  return !1;
7286
7286
  }
7287
7287
  case "union": {
7288
7288
  for (const i of n.options)
7289
- if (J(i, r))
7289
+ if (V(i, r))
7290
7290
  return !0;
7291
7291
  return !1;
7292
7292
  }
7293
7293
  case "intersection":
7294
- return J(n.left, r) || J(n.right, r);
7294
+ return V(n.left, r) || V(n.right, r);
7295
7295
  case "tuple": {
7296
7296
  for (const i of n.items)
7297
- if (J(i, r))
7297
+ if (V(i, r))
7298
7298
  return !0;
7299
- return !!(n.rest && J(n.rest, r));
7299
+ return !!(n.rest && V(n.rest, r));
7300
7300
  }
7301
7301
  case "record":
7302
- return J(n.keyType, r) || J(n.valueType, r);
7302
+ return V(n.keyType, r) || V(n.valueType, r);
7303
7303
  case "map":
7304
- return J(n.keyType, r) || J(n.valueType, r);
7304
+ return V(n.keyType, r) || V(n.valueType, r);
7305
7305
  case "set":
7306
- return J(n.valueType, r);
7306
+ return V(n.valueType, r);
7307
7307
  // inner types
7308
7308
  case "promise":
7309
7309
  case "optional":
7310
7310
  case "nonoptional":
7311
7311
  case "nullable":
7312
7312
  case "readonly":
7313
- return J(n.innerType, r);
7313
+ return V(n.innerType, r);
7314
7314
  case "lazy":
7315
- return J(n.getter(), r);
7315
+ return V(n.getter(), r);
7316
7316
  case "default":
7317
- return J(n.innerType, r);
7317
+ return V(n.innerType, r);
7318
7318
  case "prefault":
7319
- return J(n.innerType, r);
7319
+ return V(n.innerType, r);
7320
7320
  case "custom":
7321
7321
  return !1;
7322
7322
  case "transform":
7323
7323
  return !0;
7324
7324
  case "pipe":
7325
- return J(n.in, r) || J(n.out, r);
7325
+ return V(n.in, r) || V(n.out, r);
7326
7326
  case "success":
7327
7327
  return !1;
7328
7328
  case "catch":
@@ -7486,9 +7486,9 @@ const If = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7486
7486
  _literal: lf,
7487
7487
  _lowercase: mr,
7488
7488
  _lt: ze,
7489
- _lte: ne,
7489
+ _lte: re,
7490
7490
  _map: af,
7491
- _max: ne,
7491
+ _max: re,
7492
7492
  _maxLength: Zt,
7493
7493
  _maxSize: At,
7494
7494
  _mime: yr,
@@ -7663,7 +7663,7 @@ const Sf = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7663
7663
  }), Ct = /* @__PURE__ */ c("ZodString", (t, e) => {
7664
7664
  ut.init(t, e), xr.init(t, e), t.email = (r) => t.check(Fn(Nr, r)), t.url = (r) => t.check(Kn(Tr, r)), t.jwt = (r) => t.check(lr(Jr, r)), t.emoji = (r) => t.check(Yn(Ur, r)), t.guid = (r) => t.check(kt(Ot, r)), t.uuid = (r) => t.check(Jn(fe, r)), t.uuidv4 = (r) => t.check(Vn(fe, r)), t.uuidv6 = (r) => t.check(Gn(fe, r)), t.uuidv7 = (r) => t.check(qn(fe, r)), t.nanoid = (r) => t.check(Xn(jr, r)), t.guid = (r) => t.check(kt(Ot, r)), t.cuid = (r) => t.check(Hn(Dr, r)), t.cuid2 = (r) => t.check(Qn(Er, r)), t.ulid = (r) => t.check(er(Pr, r)), t.base64 = (r) => t.check(ur(Br, r)), t.base64url = (r) => t.check(sr(Wr, r)), t.xid = (r) => t.check(tr(Ar, r)), t.ksuid = (r) => t.check(nr(Zr, r)), t.ipv4 = (r) => t.check(rr(Mr, r)), t.ipv6 = (r) => t.check(ir(Cr, r)), t.cidrv4 = (r) => t.check(or(Rr, r)), t.cidrv6 = (r) => t.check(ar(Lr, r)), t.e164 = (r) => t.check(cr(Fr, r)), t.datetime = (r) => t.check(cs(r)), t.date = (r) => t.check(ls(r)), t.time = (r) => t.check(ds(r)), t.duration = (r) => t.check(fs(r));
7665
7665
  });
7666
- function P(t) {
7666
+ function A(t) {
7667
7667
  return $u(Ct, t);
7668
7668
  }
7669
7669
  const C = /* @__PURE__ */ c("ZodStringFormat", (t, e) => {
@@ -7798,7 +7798,7 @@ function Kf(t, e, r = {}) {
7798
7798
  return os(ys, t, e, r);
7799
7799
  }
7800
7800
  const Rt = /* @__PURE__ */ c("ZodNumber", (t, e) => {
7801
- Pn.init(t, e), z.init(t, e), t.gt = (o, n) => t.check(xe(o, n)), t.gte = (o, n) => t.check(Q(o, n)), t.min = (o, n) => t.check(Q(o, n)), t.lt = (o, n) => t.check(ze(o, n)), t.lte = (o, n) => t.check(ne(o, n)), t.max = (o, n) => t.check(ne(o, n)), t.int = (o) => t.check(ce(o)), t.safe = (o) => t.check(ce(o)), t.positive = (o) => t.check(xe(0, o)), t.nonnegative = (o) => t.check(Q(0, o)), t.negative = (o) => t.check(ze(0, o)), t.nonpositive = (o) => t.check(ne(0, o)), t.multipleOf = (o, n) => t.check(et(o, n)), t.step = (o, n) => t.check(et(o, n)), t.finite = () => t;
7801
+ Pn.init(t, e), z.init(t, e), t.gt = (o, n) => t.check(xe(o, n)), t.gte = (o, n) => t.check(Q(o, n)), t.min = (o, n) => t.check(Q(o, n)), t.lt = (o, n) => t.check(ze(o, n)), t.lte = (o, n) => t.check(re(o, n)), t.max = (o, n) => t.check(re(o, n)), t.int = (o) => t.check(ce(o)), t.safe = (o) => t.check(ce(o)), t.positive = (o) => t.check(xe(0, o)), t.nonnegative = (o) => t.check(Q(0, o)), t.negative = (o) => t.check(ze(0, o)), t.nonpositive = (o) => t.check(re(0, o)), t.multipleOf = (o, n) => t.check(et(o, n)), t.step = (o, n) => t.check(et(o, n)), t.finite = () => t;
7802
7802
  const r = t._zod.bag;
7803
7803
  t.minValue = Math.max(r.minimum ?? Number.NEGATIVE_INFINITY, r.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, t.maxValue = Math.min(r.maximum ?? Number.POSITIVE_INFINITY, r.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, t.isInt = (r.format ?? "").includes("int") || Number.isSafeInteger(r.multipleOf ?? 0.5), t.isFinite = !0, t.format = r.format ?? null;
7804
7804
  });
@@ -7830,7 +7830,7 @@ function K(t) {
7830
7830
  return Eu(Lt, t);
7831
7831
  }
7832
7832
  const Bt = /* @__PURE__ */ c("ZodBigInt", (t, e) => {
7833
- Zn.init(t, e), z.init(t, e), t.gte = (o, n) => t.check(Q(o, n)), t.min = (o, n) => t.check(Q(o, n)), t.gt = (o, n) => t.check(xe(o, n)), t.gte = (o, n) => t.check(Q(o, n)), t.min = (o, n) => t.check(Q(o, n)), t.lt = (o, n) => t.check(ze(o, n)), t.lte = (o, n) => t.check(ne(o, n)), t.max = (o, n) => t.check(ne(o, n)), t.positive = (o) => t.check(xe(BigInt(0), o)), t.negative = (o) => t.check(ze(BigInt(0), o)), t.nonpositive = (o) => t.check(ne(BigInt(0), o)), t.nonnegative = (o) => t.check(Q(BigInt(0), o)), t.multipleOf = (o, n) => t.check(et(o, n));
7833
+ Zn.init(t, e), z.init(t, e), t.gte = (o, n) => t.check(Q(o, n)), t.min = (o, n) => t.check(Q(o, n)), t.gt = (o, n) => t.check(xe(o, n)), t.gte = (o, n) => t.check(Q(o, n)), t.min = (o, n) => t.check(Q(o, n)), t.lt = (o, n) => t.check(ze(o, n)), t.lte = (o, n) => t.check(re(o, n)), t.max = (o, n) => t.check(re(o, n)), t.positive = (o) => t.check(xe(BigInt(0), o)), t.negative = (o) => t.check(ze(BigInt(0), o)), t.nonpositive = (o) => t.check(re(BigInt(0), o)), t.nonnegative = (o) => t.check(Q(BigInt(0), o)), t.multipleOf = (o, n) => t.check(et(o, n));
7834
7834
  const r = t._zod.bag;
7835
7835
  t.minValue = r.minimum ?? null, t.maxValue = r.maximum ?? null, t.format = r.format ?? null;
7836
7836
  });
@@ -7889,7 +7889,7 @@ function rm(t) {
7889
7889
  return Ju(zs, t);
7890
7890
  }
7891
7891
  const qr = /* @__PURE__ */ c("ZodDate", (t, e) => {
7892
- Ga.init(t, e), z.init(t, e), t.min = (o, n) => t.check(Q(o, n)), t.max = (o, n) => t.check(ne(o, n));
7892
+ Ga.init(t, e), z.init(t, e), t.min = (o, n) => t.check(Q(o, n)), t.max = (o, n) => t.check(re(o, n));
7893
7893
  const r = t._zod.bag;
7894
7894
  t.minDate = r.minimum ? new Date(r.minimum) : null, t.maxDate = r.maximum ? new Date(r.maximum) : null;
7895
7895
  });
@@ -7907,9 +7907,9 @@ function im(t) {
7907
7907
  return Zs(Object.keys(e));
7908
7908
  }
7909
7909
  const Ft = /* @__PURE__ */ c("ZodObject", (t, e) => {
7910
- qa.init(t, e), z.init(t, e), N(t, "shape", () => e.shape), t.keyof = () => V(Object.keys(t._zod.def.shape)), t.catchall = (r) => t.clone({ ...t._zod.def, catchall: r }), t.passthrough = () => t.clone({ ...t._zod.def, catchall: Be() }), t.loose = () => t.clone({ ...t._zod.def, catchall: Be() }), t.strict = () => t.clone({ ...t._zod.def, catchall: Wt() }), t.strip = () => t.clone({ ...t._zod.def, catchall: void 0 }), t.extend = (r) => ro(t, r), t.merge = (r) => io(t, r), t.pick = (r) => to(t, r), t.omit = (r) => no(t, r), t.partial = (...r) => oo(Qr, t, r[0]), t.required = (...r) => ao(ei, t, r[0]);
7910
+ qa.init(t, e), z.init(t, e), N(t, "shape", () => e.shape), t.keyof = () => J(Object.keys(t._zod.def.shape)), t.catchall = (r) => t.clone({ ...t._zod.def, catchall: r }), t.passthrough = () => t.clone({ ...t._zod.def, catchall: Be() }), t.loose = () => t.clone({ ...t._zod.def, catchall: Be() }), t.strict = () => t.clone({ ...t._zod.def, catchall: Wt() }), t.strip = () => t.clone({ ...t._zod.def, catchall: void 0 }), t.extend = (r) => ro(t, r), t.merge = (r) => io(t, r), t.pick = (r) => to(t, r), t.omit = (r) => no(t, r), t.partial = (...r) => oo(Qr, t, r[0]), t.required = (...r) => ao(ei, t, r[0]);
7911
7911
  });
7912
- function D(t, e) {
7912
+ function E(t, e) {
7913
7913
  const r = {
7914
7914
  type: "object",
7915
7915
  get shape() {
@@ -8056,7 +8056,7 @@ const nt = /* @__PURE__ */ c("ZodEnum", (t, e) => {
8056
8056
  });
8057
8057
  };
8058
8058
  });
8059
- function V(t, e) {
8059
+ function J(t, e) {
8060
8060
  const r = Array.isArray(t) ? Object.fromEntries(t.map((o) => [o, o])) : t;
8061
8061
  return new nt({
8062
8062
  type: "enum",
@@ -8287,7 +8287,7 @@ const ym = (...t) => is({
8287
8287
  Transform: Xr
8288
8288
  }, ...t);
8289
8289
  function bm(t) {
8290
- const e = Qs(() => L([P(t), x(), K(), Gr(), ct(e), Jt(P(), e)]));
8290
+ const e = Qs(() => L([A(t), x(), K(), Gr(), ct(e), Jt(A(), e)]));
8291
8291
  return e;
8292
8292
  }
8293
8293
  function $m(t, e) {
@@ -8440,7 +8440,7 @@ const W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8440
8440
  email: zf,
8441
8441
  emoji: Ef,
8442
8442
  endsWith: vr,
8443
- enum: V,
8443
+ enum: J,
8444
8444
  file: fm,
8445
8445
  flattenError: Sn,
8446
8446
  float32: Yf,
@@ -8472,7 +8472,7 @@ const W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8472
8472
  looseObject: am,
8473
8473
  lowercase: mr,
8474
8474
  lt: ze,
8475
- lte: ne,
8475
+ lte: re,
8476
8476
  map: cm,
8477
8477
  maxLength: Zt,
8478
8478
  maxSize: At,
@@ -8493,7 +8493,7 @@ const W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8493
8493
  nullable: xt,
8494
8494
  nullish: mm,
8495
8495
  number: x,
8496
- object: D,
8496
+ object: E,
8497
8497
  optional: zt,
8498
8498
  overwrite: je,
8499
8499
  parse: ps,
@@ -8519,7 +8519,7 @@ const W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8519
8519
  size: dr,
8520
8520
  startsWith: hr,
8521
8521
  strictObject: om,
8522
- string: P,
8522
+ string: A,
8523
8523
  stringFormat: Kf,
8524
8524
  stringbool: ym,
8525
8525
  success: pm,
@@ -8596,23 +8596,25 @@ const Nm = (t) => t != null && typeof t == "object" && "toString" in t, Tm = (t,
8596
8596
  return e ? Um(o) : o;
8597
8597
  }, Um = (t) => (e, r) => t(r, e), Gt = me([x(), x()]);
8598
8598
  me([pe(), pe()]);
8599
- const ri = D({ width: x(), height: x() }), jm = D({
8599
+ const ri = E({ width: x(), height: x() }), jm = E({
8600
8600
  signedWidth: x(),
8601
8601
  signedHeight: x()
8602
8602
  }), Dm = ["width", "height"];
8603
- V(Dm);
8603
+ J(Dm);
8604
8604
  const Em = ["start", "center", "end"], Pm = ["signedWidth", "signedHeight"];
8605
- V(Pm);
8606
- const rt = D({ x: x(), y: x() }), oc = D({ clientX: x(), clientY: x() }), ac = ["x", "y"], uc = V(ac), sc = ["top", "right", "bottom", "left"];
8607
- V(sc);
8608
- const ii = ["left", "right"], cc = V(ii), oi = ["top", "bottom"], lc = V(oi), dc = ["center"], Ai = V(dc), Am = [...sc, ...dc], fc = V(Am);
8609
- V(Em);
8605
+ J(Pm);
8606
+ const rt = E({ x: x(), y: x() }), oc = E({ clientX: x(), clientY: x() }), ac = ["x", "y"], uc = J(ac), sc = ["top", "right", "bottom", "left"];
8607
+ J(sc);
8608
+ const ii = ["left", "right"], cc = J(ii), oi = ["top", "bottom"], lc = J(oi), dc = ["center"], Ai = J(dc), Am = [...sc, ...dc], fc = J(Am);
8609
+ J(Em);
8610
8610
  const Zm = ["first", "last"];
8611
- V(Zm);
8612
- const Mm = D({ lower: x(), upper: x() }), Cm = D({ lower: pe(), upper: pe() });
8611
+ J(Zm);
8612
+ const Mm = E({ lower: x(), upper: x() }), Cm = E({ lower: pe(), upper: pe() });
8613
8613
  L([Mm, Gt]);
8614
8614
  L([Cm, Gt]);
8615
- V([...uc.options, ...fc.options]);
8615
+ J([...uc.options, ...fc.options]);
8616
+ J(["x", "left", "right"]);
8617
+ J(["y", "top", "bottom"]);
8616
8618
  L([uc, fc, B(String)]);
8617
8619
  const qt = (t) => (e, r) => {
8618
8620
  if (typeof e == "bigint") {
@@ -8636,70 +8638,80 @@ const qt = (t) => (e, r) => {
8636
8638
  const r = ke(t);
8637
8639
  return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
8638
8640
  }, ai = (t) => ac.includes(t) ? t : oi.includes(t) ? "y" : "x";
8639
- D({
8641
+ E({
8640
8642
  x: cc.or(Ai),
8641
8643
  y: lc.or(Ai)
8642
8644
  });
8643
- const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm = Object.freeze({ x: "right", y: "top" }), mc = Object.freeze({ x: "left", y: "bottom" }), Fm = Object.freeze({ x: "right", y: "bottom" }), Jm = Object.freeze({ x: "center", y: "top" }), Vm = Object.freeze({ x: "center", y: "bottom" }), Gm = Object.freeze({ x: "right", y: "center" }), qm = Object.freeze({ x: "left", y: "center" }), pc = (t, e) => t.x === e.x && t.y === e.y, Km = (t) => [t.x, t.y], fn = L([
8645
+ const Bm = E({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm = Object.freeze({ x: "right", y: "top" }), mc = Object.freeze({ x: "left", y: "bottom" }), Fm = Object.freeze({ x: "right", y: "bottom" }), Jm = Object.freeze({ x: "center", y: "top" }), Vm = Object.freeze({ x: "center", y: "bottom" }), Gm = Object.freeze({ x: "right", y: "center" }), qm = Object.freeze({ x: "left", y: "center" }), pc = (t, e) => t.x === e.x && t.y === e.y, Km = (t) => [t.x, t.y], fn = L([
8644
8646
  x(),
8645
8647
  rt,
8646
8648
  Gt,
8647
8649
  ri,
8648
8650
  jm,
8649
8651
  oc
8650
- ]), Z = (t, e) => {
8652
+ ]), D = (t, e) => {
8651
8653
  if (typeof t == "string") {
8652
8654
  if (e === void 0) throw new Error("The y coordinate must be given.");
8653
8655
  return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
8654
8656
  }
8655
8657
  return typeof t == "number" ? { x: t, y: e ?? t } : Array.isArray(t) ? { x: t[0], y: t[1] } : "signedWidth" in t ? { x: t.signedWidth, y: t.signedHeight } : "clientX" in t ? { x: t.clientX, y: t.clientY } : "width" in t ? { x: t.width, y: t.height } : { x: t.x, y: t.y };
8656
8658
  }, le = Object.freeze({ x: 0, y: 0 }), gc = Object.freeze({ x: 1, y: 1 }), Ym = Object.freeze({ x: 1 / 0, y: 1 / 0 }), Xm = Object.freeze({ x: NaN, y: NaN }), Tt = (t, e, r = 0) => {
8657
- const o = Z(t), n = Z(e);
8659
+ const o = D(t), n = D(e);
8658
8660
  return r === 0 ? o.x === n.x && o.y === n.y : Math.abs(o.x - n.x) <= r && Math.abs(o.y - n.y) <= r;
8659
8661
  }, Hm = (t) => Tt(t, le), si = (t, e, r) => {
8660
- const o = Z(t), n = Z(e, r);
8662
+ const o = D(t), n = D(e, r);
8661
8663
  return { x: o.x * n.x, y: o.y * n.y };
8662
8664
  }, hc = (t, e) => {
8663
- const r = Z(t);
8665
+ const r = D(t);
8664
8666
  return { x: r.x + e, y: r.y };
8665
8667
  }, vc = (t, e) => {
8666
- const r = Z(t);
8668
+ const r = D(t);
8667
8669
  return { x: r.x, y: r.y + e };
8668
- }, it = (t, e, r, ...o) => typeof e == "string" && typeof r == "number" ? e === "x" ? hc(t, r) : vc(t, r) : [t, e, r ?? le, ...o].reduce((n, i) => {
8669
- const a = Z(i);
8670
- return { x: n.x + a.x, y: n.y + a.y };
8671
- }, le), Qm = (t, e, r) => {
8672
- const o = Z(t);
8670
+ }, it = (t, e, r, ...o) => {
8671
+ if (typeof e == "string") {
8672
+ if (typeof r != "number") throw new Error("The value must be a number.");
8673
+ return e === "x" ? hc(t, r) : vc(t, r);
8674
+ }
8675
+ if (typeof e == "object" && "x" in e && typeof e.x == "string") {
8676
+ const n = D(r), i = D(t);
8677
+ return e.x === "left" ? n.x = -n.x : e.x === "center" && (n.x = 0), e.y === "top" ? n.y = -n.y : e.y === "center" && (n.y = 0), { x: i.x + n.x, y: i.y + n.y };
8678
+ }
8679
+ return [t, e, r ?? le, ...o].reduce((n, i) => {
8680
+ const a = D(i);
8681
+ return { x: n.x + a.x, y: n.y + a.y };
8682
+ }, le);
8683
+ }, Qm = (t, e, r) => {
8684
+ const o = D(t);
8673
8685
  return e === "x" ? { x: r, y: o.y } : { x: o.x, y: r };
8674
8686
  }, ep = (t, e) => {
8675
- const r = Z(t), o = Z(e);
8687
+ const r = D(t), o = D(e);
8676
8688
  return Math.sqrt((r.x - o.x) ** 2 + (r.y - o.y) ** 2);
8677
8689
  }, tp = (t, e) => {
8678
- const r = Z(t), o = Z(e);
8690
+ const r = D(t), o = D(e);
8679
8691
  return { x: o.x - r.x, y: o.y - r.y };
8680
8692
  }, np = (t) => {
8681
- const e = Z(t);
8693
+ const e = D(t);
8682
8694
  return Number.isNaN(e.x) || Number.isNaN(e.y);
8683
8695
  }, rp = (t) => {
8684
- const e = Z(t);
8696
+ const e = D(t);
8685
8697
  return Number.isFinite(e.x) && Number.isFinite(e.y);
8686
8698
  }, ip = (t) => {
8687
- const e = Z(t);
8699
+ const e = D(t);
8688
8700
  return [e.x, e.y];
8689
8701
  }, op = (t) => {
8690
- const e = Z(t);
8702
+ const e = D(t);
8691
8703
  return { left: e.x, top: e.y };
8692
8704
  }, mn = (t, e = 0) => {
8693
- const r = Z(t);
8705
+ const r = D(t);
8694
8706
  return { x: Number(r.x.toFixed(e)), y: Number(r.y.toFixed(e)) };
8695
8707
  }, qe = (t, e) => {
8696
- const r = Z(t), o = Z(e);
8708
+ const r = D(t), o = D(e);
8697
8709
  return { x: r.x - o.x, y: r.y - o.y };
8698
8710
  }, Ke = (t) => {
8699
- const e = Z(t), r = Math.hypot(e.x, e.y);
8711
+ const e = D(t), r = Math.hypot(e.x, e.y);
8700
8712
  return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
8701
8713
  }, yc = (t) => {
8702
- const e = Z(t), r = Math.hypot(e.x, e.y);
8714
+ const e = D(t), r = Math.hypot(e.x, e.y);
8703
8715
  return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
8704
8716
  }, bc = (...t) => {
8705
8717
  const e = t.reduce((r, o) => it(r, o), le);
@@ -8716,10 +8728,10 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8716
8728
  const f = t[o - 1], p = qe(n, f);
8717
8729
  i = Ke(p), u = i, s = e;
8718
8730
  } else {
8719
- const f = t[o - 1], p = t[o + 1], l = qe(n, f), g = qe(p, n);
8720
- i = Ke(l), a = Ke(g);
8731
+ const f = t[o - 1], p = t[o + 1], l = qe(n, f), h = qe(p, n);
8732
+ i = Ke(l), a = Ke(h);
8721
8733
  const y = Math.acos(
8722
- (l.x * g.x + l.y * g.y) / (Math.hypot(l.x, l.y) * Math.hypot(g.x, g.y))
8734
+ (l.x * h.x + l.y * h.y) / (Math.hypot(l.x, l.y) * Math.hypot(h.x, h.y))
8723
8735
  ), d = Math.sin(y / 2);
8724
8736
  d === 0 ? s = e : s = e / d, u = yc(bc(i, a));
8725
8737
  }
@@ -8727,10 +8739,10 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8727
8739
  }
8728
8740
  return r;
8729
8741
  }, up = (t) => {
8730
- const e = Z(t);
8742
+ const e = D(t);
8731
8743
  return { x: e.y, y: e.x };
8732
8744
  }, pn = (t) => {
8733
- const e = Z(t);
8745
+ const e = D(t);
8734
8746
  return { x: Math.round(e.x), y: Math.round(e.y) };
8735
8747
  }, gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8736
8748
  __proto__: null,
@@ -8741,7 +8753,7 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8741
8753
  average: bc,
8742
8754
  calculateMiters: ap,
8743
8755
  clientXY: oc,
8744
- construct: Z,
8756
+ construct: D,
8745
8757
  couple: ip,
8746
8758
  crudeZ: fn,
8747
8759
  css: op,
@@ -8763,17 +8775,17 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8763
8775
  translation: tp,
8764
8776
  truncate: mn,
8765
8777
  xy: rt
8766
- }, Symbol.toStringTag, { value: "Module" })), pt = L([x(), P()]), sp = D({
8778
+ }, Symbol.toStringTag, { value: "Module" })), pt = L([x(), A()]), sp = E({
8767
8779
  top: pt,
8768
8780
  left: pt,
8769
8781
  width: pt,
8770
8782
  height: pt
8771
- }), cp = D({
8783
+ }), cp = E({
8772
8784
  left: x(),
8773
8785
  top: x(),
8774
8786
  right: x(),
8775
8787
  bottom: x()
8776
- }), lp = D({
8788
+ }), lp = E({
8777
8789
  one: rt,
8778
8790
  two: rt,
8779
8791
  root: Bm
@@ -8781,7 +8793,7 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8781
8793
  one: t.one,
8782
8794
  two: t.two,
8783
8795
  root: e ?? t.root
8784
- }), A = (t, e, r = 0, o = 0, n) => {
8796
+ }), Z = (t, e, r = 0, o = 0, n) => {
8785
8797
  const i = {
8786
8798
  one: { ...le },
8787
8799
  two: { ...le },
@@ -8800,11 +8812,11 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8800
8812
  y: i.one.y + e.signedHeight
8801
8813
  } : i.two = e, i));
8802
8814
  }, fp = (t, e, r) => {
8803
- const o = A(t);
8815
+ const o = Z(t);
8804
8816
  if (typeof e == "string") {
8805
8817
  if (r == null) throw new Error("Invalid arguments for resize");
8806
8818
  const n = ai(e);
8807
- return A(
8819
+ return Z(
8808
8820
  o.one,
8809
8821
  void 0,
8810
8822
  n === "x" ? r : be(o),
@@ -8812,9 +8824,9 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8812
8824
  o.root
8813
8825
  );
8814
8826
  }
8815
- return A(o.one, e, void 0, void 0, o.root);
8827
+ return Z(o.one, e, void 0, void 0, o.root);
8816
8828
  }, mp = (t, e, r = !0) => {
8817
- const o = A(t);
8829
+ const o = Z(t);
8818
8830
  let n = (i, a) => i < a;
8819
8831
  return r && (n = (i, a) => i <= a), "one" in e ? n(ve(o), ve(e)) && n(Se(e), Se(o)) && n(ye(o), ye(e)) && n(Oe(e), Oe(o)) : n(ve(o), e.x) && n(e.x, Se(o)) && n(ye(o), e.y) && n(e.y, Oe(o));
8820
8832
  }, pp = (t, e) => Tt(t.one, e.one) && Tt(t.two, e.two) && pc(t.root, e.root), _c = (t) => ({
@@ -8832,51 +8844,51 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8832
8844
  const o = ai(e) === "y" ? Qt(t) : Ht(t);
8833
8845
  return r ? o : Math.abs(o);
8834
8846
  }, ge = (t, e) => {
8835
- const r = A(t);
8847
+ const r = Z(t);
8836
8848
  return {
8837
8849
  x: e.x === "center" ? hn(r).x : Ne(r, e.x),
8838
8850
  y: e.y === "center" ? hn(r).y : Ne(r, e.y)
8839
8851
  };
8840
8852
  }, Ne = (t, e) => {
8841
- const r = A(t), o = Km(r.root).includes(e) ? Math.min : Math.max;
8853
+ const r = Z(t), o = Km(r.root).includes(e) ? Math.min : Math.max;
8842
8854
  return ii.includes(e) ? o(r.one.x, r.two.x) : o(r.one.y, r.two.y);
8843
8855
  }, vp = (t) => t.one.x === t.two.x && t.one.y === t.two.y, be = (t) => ci(t, "x"), $e = (t) => ci(t, "y"), Ht = (t) => {
8844
- const e = A(t);
8856
+ const e = Z(t);
8845
8857
  return e.two.x - e.one.x;
8846
8858
  }, Qt = (t) => {
8847
- const e = A(t);
8859
+ const e = Z(t);
8848
8860
  return e.two.y - e.one.y;
8849
8861
  }, Ic = (t) => ge(t, ui), yp = (t) => ge(t, Jm), bp = (t) => ge(t, Wm), $p = (t) => ge(t, mc), wp = (t) => ge(t, Vm), _p = (t) => ge(t, Fm), Ip = (t) => ge(t, qm), kp = (t) => ge(t, Gm), Se = (t) => Ne(t, "right"), Oe = (t) => Ne(t, "bottom"), ve = (t) => Ne(t, "left"), ye = (t) => Ne(t, "top"), hn = (t) => it(Ic(t), {
8850
8862
  x: Ht(t) / 2,
8851
8863
  y: Qt(t) / 2
8852
8864
  }), li = (t) => {
8853
- const e = A(t);
8865
+ const e = Z(t);
8854
8866
  return e.root.x === "left" ? ve(e) : Se(e);
8855
8867
  }, di = (t) => {
8856
- const e = A(t);
8868
+ const e = Z(t);
8857
8869
  return e.root.y === "top" ? ye(e) : Oe(e);
8858
8870
  }, Sp = (t) => ({ x: li(t), y: di(t) }), vt = (t) => {
8859
- const e = A(t);
8871
+ const e = Z(t);
8860
8872
  return { lower: e.one.x, upper: e.two.x };
8861
8873
  }, yt = (t) => {
8862
- const e = A(t);
8874
+ const e = Z(t);
8863
8875
  return { lower: e.one.y, upper: e.two.y };
8864
8876
  }, Op = (t, e) => wc(t, e), zp = (t, e) => {
8865
- const r = A(t), o = ii.includes(e) ? "x" : oi.includes(e) ? "y" : null;
8877
+ const r = Z(t), o = ii.includes(e) ? "x" : oi.includes(e) ? "y" : null;
8866
8878
  if (o === null) throw new Error(`Invalid location: ${e}`);
8867
8879
  const n = e === "top" || e === "left" ? Math.min : Math.max, i = { ...r.one }, a = { ...r.two };
8868
8880
  return i[o] = n(r.one[o], r.two[o]), a[o] = n(r.one[o], r.two[o]), [i, a];
8869
8881
  }, xp = (t, e) => {
8870
- const r = A(t), o = A(e), n = li(o) + (be(o) - be(r)) / 2, i = di(o) + ($e(o) - $e(r)) / 2;
8871
- return A({ x: n, y: i }, _c(r));
8882
+ const r = Z(t), o = Z(e), n = li(o) + (be(o) - be(r)) / 2, i = di(o) + ($e(o) - $e(r)) / 2;
8883
+ return Z({ x: n, y: i }, _c(r));
8872
8884
  }, kc = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Np = (t) => be(t) / $e(t), Tp = (t, e, r) => {
8873
8885
  if (typeof e == "string") {
8874
8886
  if (r == null) throw new Error("Undefined amount passed into box.translate");
8875
8887
  const n = ai(e);
8876
- e = Z(n, r);
8888
+ e = D(n, r);
8877
8889
  }
8878
- const o = A(t);
8879
- return A(
8890
+ const o = Z(t);
8891
+ return Z(
8880
8892
  it(o.one, e),
8881
8893
  it(o.two, e),
8882
8894
  void 0,
@@ -8885,10 +8897,10 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8885
8897
  );
8886
8898
  }, Up = (t, e) => {
8887
8899
  const r = Math.max(ve(t), ve(e)), o = Math.max(ye(t), ye(e)), n = Math.min(Se(t), Se(e)), i = Math.min(Oe(t), Oe(e));
8888
- return r > n || o > i ? $c : A({ x: r, y: o }, { x: n, y: i }, void 0, void 0, t.root);
8900
+ return r > n || o > i ? $c : Z({ x: r, y: o }, { x: n, y: i }, void 0, void 0, t.root);
8889
8901
  }, jp = (t) => be(t) * $e(t), Dp = (t, e) => {
8890
- const r = A(t);
8891
- return A(
8902
+ const r = Z(t);
8903
+ return Z(
8892
8904
  mn(r.one, e),
8893
8905
  mn(r.two, e),
8894
8906
  void 0,
@@ -8897,10 +8909,10 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8897
8909
  );
8898
8910
  }, Ep = (t, e, r, o, n, i) => {
8899
8911
  const a = { x: t, y: e }, u = { x: t + r, y: e + o };
8900
- return n.x !== i.x && (n.x === "center" ? (a.x -= r / 2, u.x -= r / 2) : (a.x -= r, u.x -= r)), n.y !== i.y && (n.y === "center" ? (a.y -= o / 2, u.y -= o / 2) : (a.y -= o, u.y -= o)), A(a, u, void 0, void 0, i);
8912
+ return n.x !== i.x && (n.x === "center" ? (a.x -= r / 2, u.x -= r / 2) : (a.x -= r, u.x -= r)), n.y !== i.y && (n.y === "center" ? (a.y -= o / 2, u.y -= o / 2) : (a.y -= o, u.y -= o)), Z(a, u, void 0, void 0, i);
8901
8913
  }, Pp = (t) => {
8902
- const e = A(t);
8903
- return A(pn(e.one), pn(e.two), void 0, void 0, e.root);
8914
+ const e = Z(t);
8915
+ return Z(pn(e.one), pn(e.two), void 0, void 0, e.root);
8904
8916
  }, gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8905
8917
  __proto__: null,
8906
8918
  DECIMAL: dp,
@@ -8916,7 +8928,7 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8916
8928
  center: hn,
8917
8929
  centerLeft: Ip,
8918
8930
  centerRight: kp,
8919
- construct: A,
8931
+ construct: Z,
8920
8932
  constructWithAlternateRoot: Ep,
8921
8933
  contains: mp,
8922
8934
  copy: wc,
@@ -8953,33 +8965,33 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8953
8965
  xyLoc: ge,
8954
8966
  y: di,
8955
8967
  yBounds: yt
8956
- }, Symbol.toStringTag, { value: "Module" })), Sc = D({ signedWidth: x(), signedHeight: x() }), Ap = L([ri, Sc, rt, Gt]), Zp = { width: 0, height: 0 }, Mp = { width: 1, height: 1 }, ie = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, Cp = (t, e) => {
8968
+ }, Symbol.toStringTag, { value: "Module" })), Sc = E({ signedWidth: x(), signedHeight: x() }), Ap = L([ri, Sc, rt, Gt]), Zp = { width: 0, height: 0 }, Mp = { width: 1, height: 1 }, oe = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, Cp = (t, e) => {
8957
8969
  if (e == null) return !1;
8958
- const r = ie(t), o = ie(e);
8970
+ const r = oe(t), o = oe(e);
8959
8971
  return r.width === o.width && r.height === o.height;
8960
8972
  }, Rp = (t) => {
8961
- const e = ie(t);
8973
+ const e = oe(t);
8962
8974
  return { width: e.height, height: e.width };
8963
8975
  }, Lp = (t) => {
8964
- const e = ie(t);
8976
+ const e = oe(t);
8965
8977
  return `0 0 ${e.width} ${e.height}`;
8966
8978
  }, Bp = (t) => {
8967
- const e = ie(t);
8979
+ const e = oe(t);
8968
8980
  return [e.width, e.height];
8969
8981
  }, Wp = (t) => ({
8970
- width: Math.max(...t.map((e) => ie(e).width)),
8971
- height: Math.max(...t.map((e) => ie(e).height))
8982
+ width: Math.max(...t.map((e) => oe(e).width)),
8983
+ height: Math.max(...t.map((e) => oe(e).height))
8972
8984
  }), Fp = (t) => ({
8973
- width: Math.min(...t.map((e) => ie(e).width)),
8974
- height: Math.min(...t.map((e) => ie(e).height))
8985
+ width: Math.min(...t.map((e) => oe(e).width)),
8986
+ height: Math.min(...t.map((e) => oe(e).height))
8975
8987
  }), Jp = (t, e) => {
8976
- const r = ie(t);
8988
+ const r = oe(t);
8977
8989
  return { width: r.width * e, height: r.height * e };
8978
8990
  }, rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8979
8991
  __proto__: null,
8980
8992
  DECIMAL: Mp,
8981
8993
  ZERO: Zp,
8982
- construct: ie,
8994
+ construct: oe,
8983
8995
  couple: Bp,
8984
8996
  crude: Ap,
8985
8997
  dimensions: ri,
@@ -8991,8 +9003,8 @@ const Bm = D({ x: cc, y: lc }), ui = Object.freeze({ x: "left", y: "top" }), Wm
8991
9003
  svgViewBox: Lp,
8992
9004
  swap: Rp
8993
9005
  }, Symbol.toStringTag, { value: "Module" })), Vp = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t;
8994
- D({ offset: fn, scale: fn });
8995
- D({ offset: x(), scale: x() });
9006
+ E({ offset: fn, scale: fn });
9007
+ E({ offset: x(), scale: x() });
8996
9008
  const Gp = (t) => (e, r, o, n) => r === "dimension" ? [e, o] : [
8997
9009
  e,
8998
9010
  n ? o - t : o + t
@@ -9113,7 +9125,7 @@ let Mi = class Ee {
9113
9125
  return { scale: this.dim(1), offset: this.pos(0) };
9114
9126
  }
9115
9127
  static IDENTITY = new Ee();
9116
- }, Rh = class oe {
9128
+ }, Rh = class ae {
9117
9129
  x;
9118
9130
  y;
9119
9131
  currRoot;
@@ -9121,28 +9133,28 @@ let Mi = class Ee {
9121
9133
  this.x = e, this.y = r, this.currRoot = o;
9122
9134
  }
9123
9135
  static translate(e, r) {
9124
- return new oe().translate(e, r);
9136
+ return new ae().translate(e, r);
9125
9137
  }
9126
9138
  static translateX(e) {
9127
- return new oe().translateX(e);
9139
+ return new ae().translateX(e);
9128
9140
  }
9129
9141
  static translateY(e) {
9130
- return new oe().translateY(e);
9142
+ return new ae().translateY(e);
9131
9143
  }
9132
9144
  static clamp(e) {
9133
- return new oe().clamp(e);
9145
+ return new ae().clamp(e);
9134
9146
  }
9135
9147
  static magnify(e) {
9136
- return new oe().magnify(e);
9148
+ return new ae().magnify(e);
9137
9149
  }
9138
9150
  static scale(e) {
9139
- return new oe().scale(e);
9151
+ return new ae().scale(e);
9140
9152
  }
9141
9153
  static reBound(e) {
9142
- return new oe().reBound(e);
9154
+ return new ae().reBound(e);
9143
9155
  }
9144
9156
  translate(e, r) {
9145
- const o = Z(e, r), n = this.copy();
9157
+ const o = D(e, r), n = this.copy();
9146
9158
  return n.x = this.x.translate(o.x), n.y = this.y.translate(o.y), n;
9147
9159
  }
9148
9160
  translateX(e) {
@@ -9174,7 +9186,7 @@ let Mi = class Ee {
9174
9186
  return r.x = this.x.clamp(vt(e)), r.y = this.y.clamp(yt(e)), r;
9175
9187
  }
9176
9188
  copy() {
9177
- const e = new oe();
9189
+ const e = new ae();
9178
9190
  return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
9179
9191
  }
9180
9192
  reverse() {
@@ -9188,7 +9200,7 @@ let Mi = class Ee {
9188
9200
  return { x: this.x.dim(e.x), y: this.y.dim(e.y) };
9189
9201
  }
9190
9202
  box(e) {
9191
- return A(
9203
+ return Z(
9192
9204
  this.pos(e.one),
9193
9205
  this.pos(e.two),
9194
9206
  0,
@@ -9202,7 +9214,7 @@ let Mi = class Ee {
9202
9214
  offset: this.pos({ x: 0, y: 0 })
9203
9215
  };
9204
9216
  }
9205
- static IDENTITY = new oe();
9217
+ static IDENTITY = new ae();
9206
9218
  }, Oc = (t, e = 21) => (r = e) => {
9207
9219
  let o = "", n = r | 0;
9208
9220
  for (; n--; )
@@ -9213,12 +9225,12 @@ const zc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Qp = `0123456
9213
9225
  __proto__: null,
9214
9226
  LENGTH: xc,
9215
9227
  create: Nc
9216
- }, Symbol.toStringTag, { value: "Module" })), ng = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, rg = V(["static", "dynamic"]), ig = L([
9228
+ }, Symbol.toStringTag, { value: "Module" })), ng = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, rg = J(["static", "dynamic"]), ig = L([
9217
9229
  me([ce()]),
9218
9230
  me([ce(), ce().min(1).max(12)]),
9219
9231
  me([ce(), ce().min(1).max(12), ce().min(1).max(31)])
9220
9232
  ]), Tc = (t, e) => {
9221
- const r = new h(e);
9233
+ const r = new g(e);
9222
9234
  if (![
9223
9235
  j.DAY,
9224
9236
  j.HOUR,
@@ -9232,24 +9244,24 @@ const zc = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Qp = `0123456
9232
9244
  "Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
9233
9245
  );
9234
9246
  const o = t.valueOf() % r.valueOf();
9235
- return t instanceof h ? new h(o) : new j(o);
9247
+ return t instanceof g ? new g(o) : new j(o);
9236
9248
  };
9237
- class h extends Je {
9249
+ class g extends Je {
9238
9250
  constructor(e, r = "UTC") {
9239
- if (e == null) super(h.now().valueOf());
9251
+ if (e == null) super(g.now().valueOf());
9240
9252
  else if (e instanceof Date)
9241
- super(BigInt(e.getTime()) * h.MILLISECOND.valueOf());
9253
+ super(BigInt(e.getTime()) * g.MILLISECOND.valueOf());
9242
9254
  else if (typeof e == "string")
9243
- super(h.parseDateTimeString(e, r).valueOf());
9244
- else if (Array.isArray(e)) super(h.parseDate(e));
9255
+ super(g.parseDateTimeString(e, r).valueOf());
9256
+ else if (Array.isArray(e)) super(g.parseDate(e));
9245
9257
  else {
9246
9258
  let o = 0n;
9247
- e instanceof Number && (e = e.valueOf()), r === "local" && (o = h.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = h.MAX : e = h.MIN)), super(BigInt(e.valueOf()) + o);
9259
+ e instanceof Number && (e = e.valueOf()), r === "local" && (o = g.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = g.MAX : e = g.MIN)), super(BigInt(e.valueOf()) + o);
9248
9260
  }
9249
9261
  }
9250
9262
  static parseDate([e = 1970, r = 1, o = 1]) {
9251
9263
  const n = new Date(e, r - 1, o, 0, 0, 0, 0);
9252
- return new h(BigInt(n.getTime()) * h.MILLISECOND.valueOf()).truncate(h.DAY).valueOf();
9264
+ return new g(BigInt(n.getTime()) * g.MILLISECOND.valueOf()).truncate(g.DAY).valueOf();
9253
9265
  }
9254
9266
  /**
9255
9267
  * @returns the primitive value of the TimeStamp. Overrides standard JS valueOf()
@@ -9262,15 +9274,15 @@ class h extends Je {
9262
9274
  const [o, n, i] = e.split(":");
9263
9275
  let a = "00", u = "00";
9264
9276
  i != null && ([a, u] = i.split("."));
9265
- let s = h.hours(parseInt(o ?? "00")).add(h.minutes(parseInt(n ?? "00"))).add(h.seconds(parseInt(a ?? "00"))).add(h.milliseconds(parseInt(u ?? "00")));
9266
- return r === "local" && (s = s.add(h.utcOffset)), s.valueOf();
9277
+ let s = g.hours(parseInt(o ?? "00")).add(g.minutes(parseInt(n ?? "00"))).add(g.seconds(parseInt(a ?? "00"))).add(g.milliseconds(parseInt(u ?? "00")));
9278
+ return r === "local" && (s = s.add(g.utcOffset)), s.valueOf();
9267
9279
  }
9268
9280
  static parseDateTimeString(e, r = "UTC") {
9269
9281
  if (!e.includes("/") && !e.includes("-"))
9270
- return h.parseTimeString(e, r);
9282
+ return g.parseTimeString(e, r);
9271
9283
  const o = new Date(e);
9272
- return e.includes(":") || o.setUTCHours(0, 0, 0, 0), new h(
9273
- BigInt(o.getTime()) * h.MILLISECOND.valueOf(),
9284
+ return e.includes(":") || o.setUTCHours(0, 0, 0, 0), new g(
9285
+ BigInt(o.getTime()) * g.MILLISECOND.valueOf(),
9274
9286
  r
9275
9287
  ).valueOf();
9276
9288
  }
@@ -9302,7 +9314,7 @@ class h extends Je {
9302
9314
  }
9303
9315
  }
9304
9316
  toISOString(e = "UTC") {
9305
- return e === "UTC" ? this.date().toISOString() : this.sub(h.utcOffset).date().toISOString();
9317
+ return e === "UTC" ? this.date().toISOString() : this.sub(g.utcOffset).date().toISOString();
9306
9318
  }
9307
9319
  timeString(e = !1, r = "UTC") {
9308
9320
  const o = this.toISOString(r);
@@ -9315,7 +9327,7 @@ class h extends Je {
9315
9327
  /** @returns The UTC offset for the time zone of the machine. */
9316
9328
  static get utcOffset() {
9317
9329
  return new j(
9318
- BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) * h.MINUTE.valueOf()
9330
+ BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) * g.MINUTE.valueOf()
9319
9331
  );
9320
9332
  }
9321
9333
  /**
@@ -9324,7 +9336,7 @@ class h extends Je {
9324
9336
  * @param other - The other timestamp.
9325
9337
  */
9326
9338
  static since(e) {
9327
- return new h().span(e);
9339
+ return new g().span(e);
9328
9340
  }
9329
9341
  /** @returns A JavaScript Date object representing the TimeStamp. */
9330
9342
  date() {
@@ -9337,7 +9349,7 @@ class h extends Je {
9337
9349
  * @returns True if the TimeStamps are equal, false otherwise.
9338
9350
  */
9339
9351
  equals(e) {
9340
- return this.valueOf() === new h(e).valueOf();
9352
+ return this.valueOf() === new g(e).valueOf();
9341
9353
  }
9342
9354
  /**
9343
9355
  * Creates a TimeSpan representing the duration between the two timestamps.
@@ -9386,7 +9398,7 @@ class h extends Je {
9386
9398
  * otherwise.
9387
9399
  */
9388
9400
  after(e) {
9389
- return this.valueOf() > new h(e).valueOf();
9401
+ return this.valueOf() > new g(e).valueOf();
9390
9402
  }
9391
9403
  /**
9392
9404
  * Checks if the TimeStamp is after or equal to the given TimeStamp.
@@ -9396,7 +9408,7 @@ class h extends Je {
9396
9408
  * false otherwise.
9397
9409
  */
9398
9410
  afterEq(e) {
9399
- return this.valueOf() >= new h(e).valueOf();
9411
+ return this.valueOf() >= new g(e).valueOf();
9400
9412
  }
9401
9413
  /**
9402
9414
  * Checks if the TimeStamp is before the given TimeStamp.
@@ -9406,7 +9418,7 @@ class h extends Je {
9406
9418
  * otherwise.
9407
9419
  */
9408
9420
  before(e) {
9409
- return this.valueOf() < new h(e).valueOf();
9421
+ return this.valueOf() < new g(e).valueOf();
9410
9422
  }
9411
9423
  /**
9412
9424
  * Checks if TimeStamp is before or equal to the current timestamp.
@@ -9416,7 +9428,7 @@ class h extends Je {
9416
9428
  * false otherwise.
9417
9429
  */
9418
9430
  beforeEq(e) {
9419
- return this.valueOf() <= new h(e).valueOf();
9431
+ return this.valueOf() <= new g(e).valueOf();
9420
9432
  }
9421
9433
  /**
9422
9434
  * Adds a TimeSpan to the TimeStamp.
@@ -9426,7 +9438,7 @@ class h extends Je {
9426
9438
  * TimeSpan.
9427
9439
  */
9428
9440
  add(e) {
9429
- return new h(Yt(this.valueOf(), new j(e).valueOf()));
9441
+ return new g(Yt(this.valueOf(), new j(e).valueOf()));
9430
9442
  }
9431
9443
  /**
9432
9444
  * Subtracts a TimeSpan from the TimeStamp.
@@ -9436,7 +9448,7 @@ class h extends Je {
9436
9448
  * TimeSpan.
9437
9449
  */
9438
9450
  sub(e) {
9439
- return new h(Kt(this.valueOf(), new j(e).valueOf()));
9451
+ return new g(Kt(this.valueOf(), new j(e).valueOf()));
9440
9452
  }
9441
9453
  /**
9442
9454
  * @returns the floating point number of hours since the unix epoch to the timestamp
@@ -9468,11 +9480,11 @@ class h extends Je {
9468
9480
  }
9469
9481
  /** @returns the floating point number of milliseconds since the unix epoch. */
9470
9482
  get milliseconds() {
9471
- return Number(this.valueOf()) / Number(h.MILLISECOND.valueOf());
9483
+ return Number(this.valueOf()) / Number(g.MILLISECOND.valueOf());
9472
9484
  }
9473
9485
  /** @returns the floating point number of microseconds since the unix epoch. */
9474
9486
  get microseconds() {
9475
- return Number(this.valueOf()) / Number(h.MICROSECOND.valueOf());
9487
+ return Number(this.valueOf()) / Number(g.MICROSECOND.valueOf());
9476
9488
  }
9477
9489
  /**
9478
9490
  * @returns the floating point number of nanoseconds since the unix epoch.
@@ -9492,7 +9504,7 @@ class h extends Je {
9492
9504
  */
9493
9505
  setYear(e) {
9494
9506
  const r = this.date();
9495
- return r.setUTCFullYear(e), new h(r);
9507
+ return r.setUTCFullYear(e), new g(r);
9496
9508
  }
9497
9509
  /** @returns the integer month that the timestamp corresponds to with its year. */
9498
9510
  get month() {
@@ -9504,7 +9516,7 @@ class h extends Je {
9504
9516
  */
9505
9517
  setMonth(e) {
9506
9518
  const r = this.date();
9507
- return r.setUTCMonth(e), new h(r);
9519
+ return r.setUTCMonth(e), new g(r);
9508
9520
  }
9509
9521
  /** @returns the integer day that the timestamp corresponds to within its month. */
9510
9522
  get day() {
@@ -9516,7 +9528,7 @@ class h extends Je {
9516
9528
  */
9517
9529
  setDay(e) {
9518
9530
  const r = this.date();
9519
- return r.setUTCDate(e), new h(r);
9531
+ return r.setUTCDate(e), new g(r);
9520
9532
  }
9521
9533
  /**
9522
9534
  * @returns the integer hour that the timestamp corresponds to within its day.
@@ -9530,7 +9542,7 @@ class h extends Je {
9530
9542
  */
9531
9543
  setHour(e) {
9532
9544
  const r = this.date();
9533
- return r.setUTCHours(e), new h(r, "UTC");
9545
+ return r.setUTCHours(e), new g(r, "UTC");
9534
9546
  }
9535
9547
  /** @returns the integer minute that the timestamp corresponds to within its hour. */
9536
9548
  get minute() {
@@ -9542,7 +9554,7 @@ class h extends Je {
9542
9554
  */
9543
9555
  setMinute(e) {
9544
9556
  const r = this.date();
9545
- return r.setUTCMinutes(e), new h(r);
9557
+ return r.setUTCMinutes(e), new g(r);
9546
9558
  }
9547
9559
  /**
9548
9560
  * @returns the integer second that the timestamp corresponds to within its
@@ -9557,7 +9569,7 @@ class h extends Je {
9557
9569
  */
9558
9570
  setSecond(e) {
9559
9571
  const r = this.date();
9560
- return r.setUTCSeconds(e), new h(r);
9572
+ return r.setUTCSeconds(e), new g(r);
9561
9573
  }
9562
9574
  /**
9563
9575
  * @reutrns the integer millisecond that the timestamp corresponds to within
@@ -9572,7 +9584,7 @@ class h extends Je {
9572
9584
  */
9573
9585
  setMillisecond(e) {
9574
9586
  const r = this.date();
9575
- return r.setUTCMilliseconds(e), new h(r);
9587
+ return r.setUTCMilliseconds(e), new g(r);
9576
9588
  }
9577
9589
  /** @returns the time stamp formatted as an ISO string. */
9578
9590
  toString() {
@@ -9594,7 +9606,7 @@ class h extends Je {
9594
9606
  }
9595
9607
  /** @returns true if the day portion TimeStamp is today, false otherwise. */
9596
9608
  get isToday() {
9597
- return this.truncate(j.DAY).equals(h.now().truncate(j.DAY));
9609
+ return this.truncate(j.DAY).equals(g.now().truncate(j.DAY));
9598
9610
  }
9599
9611
  /**
9600
9612
  * Truncates the TimeStamp to the nearest multiple of the given span.
@@ -9611,7 +9623,7 @@ class h extends Je {
9611
9623
  * JavaScript can do).
9612
9624
  */
9613
9625
  static now() {
9614
- return new h(/* @__PURE__ */ new Date());
9626
+ return new g(/* @__PURE__ */ new Date());
9615
9627
  }
9616
9628
  /**
9617
9629
  * Finds the maximum timestamp among the provided timestamps.
@@ -9620,9 +9632,9 @@ class h extends Je {
9620
9632
  * @returns The maximum (latest) timestamp from the input.
9621
9633
  */
9622
9634
  static max(...e) {
9623
- let r = h.MIN;
9635
+ let r = g.MIN;
9624
9636
  for (const o of e) {
9625
- const n = new h(o);
9637
+ const n = new g(o);
9626
9638
  n.after(r) && (r = n);
9627
9639
  }
9628
9640
  return r;
@@ -9634,9 +9646,9 @@ class h extends Je {
9634
9646
  * @returns The minimum (earliest) timestamp from the input.
9635
9647
  */
9636
9648
  static min(...e) {
9637
- let r = h.MAX;
9649
+ let r = g.MAX;
9638
9650
  for (const o of e) {
9639
- const n = new h(o);
9651
+ const n = new g(o);
9640
9652
  n.before(r) && (r = n);
9641
9653
  }
9642
9654
  return r;
@@ -9648,62 +9660,62 @@ class h extends Je {
9648
9660
  * @returns A TimeStamp representing the given number of nanoseconds.
9649
9661
  */
9650
9662
  static nanoseconds(e, r = "UTC") {
9651
- return new h(e, r);
9663
+ return new g(e, r);
9652
9664
  }
9653
9665
  /** One nanosecond after the unix epoch */
9654
- static NANOSECOND = h.nanoseconds(1);
9666
+ static NANOSECOND = g.nanoseconds(1);
9655
9667
  /** @returns a new TimeStamp n microseconds after the unix epoch */
9656
9668
  static microseconds(e, r = "UTC") {
9657
- return h.nanoseconds(e * 1e3, r);
9669
+ return g.nanoseconds(e * 1e3, r);
9658
9670
  }
9659
9671
  /** One microsecond after the unix epoch */
9660
- static MICROSECOND = h.microseconds(1);
9672
+ static MICROSECOND = g.microseconds(1);
9661
9673
  /** @returns a new TimeStamp n milliseconds after the unix epoch */
9662
9674
  static milliseconds(e, r = "UTC") {
9663
- return h.microseconds(e * 1e3, r);
9675
+ return g.microseconds(e * 1e3, r);
9664
9676
  }
9665
9677
  /** One millisecond after the unix epoch */
9666
- static MILLISECOND = h.milliseconds(1);
9678
+ static MILLISECOND = g.milliseconds(1);
9667
9679
  /** @returns a new TimeStamp n seconds after the unix epoch */
9668
9680
  static seconds(e, r = "UTC") {
9669
- return h.milliseconds(e * 1e3, r);
9681
+ return g.milliseconds(e * 1e3, r);
9670
9682
  }
9671
9683
  /** One second after the unix epoch */
9672
- static SECOND = h.seconds(1);
9684
+ static SECOND = g.seconds(1);
9673
9685
  /** @returns a new TimeStamp n minutes after the unix epoch */
9674
9686
  static minutes(e, r = "UTC") {
9675
- return h.seconds(e * 60, r);
9687
+ return g.seconds(e * 60, r);
9676
9688
  }
9677
9689
  /** One minute after the unix epoch */
9678
- static MINUTE = h.minutes(1);
9690
+ static MINUTE = g.minutes(1);
9679
9691
  /** @returns a new TimeStamp n hours after the unix epoch */
9680
9692
  static hours(e, r = "UTC") {
9681
- return h.minutes(e * 60, r);
9693
+ return g.minutes(e * 60, r);
9682
9694
  }
9683
9695
  /** One hour after the unix epoch */
9684
- static HOUR = h.hours(1);
9696
+ static HOUR = g.hours(1);
9685
9697
  /** @returns a new TimeStamp n days after the unix epoch */
9686
9698
  static days(e, r = "UTC") {
9687
- return h.hours(e * 24, r);
9699
+ return g.hours(e * 24, r);
9688
9700
  }
9689
9701
  /** One day after the unix epoch */
9690
- static DAY = h.days(1);
9702
+ static DAY = g.days(1);
9691
9703
  /** The maximum possible value for a timestamp */
9692
- static MAX = new h((1n << 63n) - 1n);
9704
+ static MAX = new g((1n << 63n) - 1n);
9693
9705
  /** The minimum possible value for a timestamp */
9694
- static MIN = new h(0);
9706
+ static MIN = new g(0);
9695
9707
  /** The unix epoch */
9696
- static ZERO = new h(0);
9708
+ static ZERO = new g(0);
9697
9709
  /** A zod schema for validating timestamps */
9698
9710
  static z = L([
9699
- B(h),
9700
- D({ value: pe() }).transform((e) => new h(e.value)),
9701
- P().transform((e) => new h(BigInt(e))),
9702
- x().transform((e) => new h(e)),
9703
- pe().transform((e) => new h(e)),
9704
- xs().transform((e) => new h(e)),
9705
- ni((e) => e instanceof j).transform((e) => new h(e)),
9706
- ig.transform((e) => new h(e))
9711
+ B(g),
9712
+ E({ value: pe() }).transform((e) => new g(e.value)),
9713
+ A().transform((e) => new g(BigInt(e))),
9714
+ x().transform((e) => new g(e)),
9715
+ pe().transform((e) => new g(e)),
9716
+ xs().transform((e) => new g(e)),
9717
+ ni((e) => e instanceof j).transform((e) => new g(e)),
9718
+ ig.transform((e) => new g(e))
9707
9719
  ]);
9708
9720
  /**
9709
9721
  * Sorts two timestamps.
@@ -9728,7 +9740,7 @@ let j = class _ extends Je {
9728
9740
  * @returns A TimeSpan representing the given number of seconds.
9729
9741
  */
9730
9742
  static fromSeconds(e) {
9731
- return e instanceof _ ? e : e instanceof H ? e.period : e instanceof h ? new _(e) : ["number", "bigint"].includes(typeof e) ? _.seconds(e) : new _(e);
9743
+ return e instanceof _ ? e : e instanceof H ? e.period : e instanceof g ? new _(e) : ["number", "bigint"].includes(typeof e) ? _.seconds(e) : new _(e);
9732
9744
  }
9733
9745
  /**
9734
9746
  * Creates a TimeSpan representing the given number of milliseconds.
@@ -9737,7 +9749,7 @@ let j = class _ extends Je {
9737
9749
  * @returns A TimeSpan representing the given number of milliseconds.
9738
9750
  */
9739
9751
  static fromMilliseconds(e) {
9740
- return e instanceof _ ? e : e instanceof H ? e.period : e instanceof h ? new _(e) : ["number", "bigint"].includes(typeof e) ? _.milliseconds(e) : new _(e);
9752
+ return e instanceof _ ? e : e instanceof H ? e.period : e instanceof g ? new _(e) : ["number", "bigint"].includes(typeof e) ? _.milliseconds(e) : new _(e);
9741
9753
  }
9742
9754
  /**
9743
9755
  * @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
@@ -9808,9 +9820,9 @@ let j = class _ extends Je {
9808
9820
  * @returns A string representation of the TimeSpan.
9809
9821
  */
9810
9822
  toString() {
9811
- const e = this.truncate(_.DAY), r = this.truncate(_.HOUR), o = this.truncate(_.MINUTE), n = this.truncate(_.SECOND), i = this.truncate(_.MILLISECOND), a = this.truncate(_.MICROSECOND), u = this.truncate(_.NANOSECOND), s = e, f = r.sub(e), p = o.sub(r), l = n.sub(o), g = i.sub(n), y = a.sub(i), d = u.sub(a);
9823
+ const e = this.truncate(_.DAY), r = this.truncate(_.HOUR), o = this.truncate(_.MINUTE), n = this.truncate(_.SECOND), i = this.truncate(_.MILLISECOND), a = this.truncate(_.MICROSECOND), u = this.truncate(_.NANOSECOND), s = e, f = r.sub(e), p = o.sub(r), l = n.sub(o), h = i.sub(n), y = a.sub(i), d = u.sub(a);
9812
9824
  let $ = "";
9813
- return s.isZero || ($ += `${s.days}d `), f.isZero || ($ += `${f.hours}h `), p.isZero || ($ += `${p.minutes}m `), l.isZero || ($ += `${l.seconds}s `), g.isZero || ($ += `${g.milliseconds}ms `), y.isZero || ($ += `${y.microseconds}µs `), d.isZero || ($ += `${d.nanoseconds}ns`), $.trim();
9825
+ return s.isZero || ($ += `${s.days}d `), f.isZero || ($ += `${f.hours}h `), p.isZero || ($ += `${p.minutes}m `), l.isZero || ($ += `${l.seconds}s `), h.isZero || ($ += `${h.milliseconds}ms `), y.isZero || ($ += `${y.microseconds}µs `), d.isZero || ($ += `${d.nanoseconds}ns`), $.trim();
9814
9826
  }
9815
9827
  /**
9816
9828
  * Multiplies the TimeSpan by a scalar value.
@@ -9975,12 +9987,12 @@ let j = class _ extends Je {
9975
9987
  static ZERO = new _(0);
9976
9988
  /** A zod schema for validating and transforming timespans */
9977
9989
  static z = L([
9978
- D({ value: pe() }).transform((e) => new _(e.value)),
9979
- P().transform((e) => new _(BigInt(e))),
9990
+ E({ value: pe() }).transform((e) => new _(e.value)),
9991
+ A().transform((e) => new _(BigInt(e))),
9980
9992
  x().transform((e) => new _(e)),
9981
9993
  pe().transform((e) => new _(e)),
9982
9994
  B(_),
9983
- B(h).transform((e) => new _(e)),
9995
+ B(g).transform((e) => new _(e)),
9984
9996
  ni((e) => e instanceof H).transform((e) => new _(e))
9985
9997
  ]);
9986
9998
  };
@@ -10184,7 +10196,7 @@ let q = class X extends Je {
10184
10196
  x().transform((e) => new X(e)),
10185
10197
  B(X)
10186
10198
  ]);
10187
- }, Ye = class ae {
10199
+ }, Ye = class ne {
10188
10200
  /**
10189
10201
  * The starting TimeStamp of the TimeRange.
10190
10202
  *
@@ -10210,7 +10222,7 @@ let q = class X extends Je {
10210
10222
  * @param end - A TimeStamp representing the end of the range.
10211
10223
  */
10212
10224
  constructor(e, r) {
10213
- typeof e == "object" && "start" in e ? (this.start = new h(e.start), this.end = new h(e.end)) : (this.start = new h(e), this.end = new h(r));
10225
+ typeof e == "object" && "start" in e ? (this.start = new g(e.start), this.end = new g(e.end)) : (this.start = new g(e), this.end = new g(r));
10214
10226
  }
10215
10227
  /** @returns The TimeSpan occupied by the TimeRange. */
10216
10228
  get span() {
@@ -10252,7 +10264,7 @@ let q = class X extends Je {
10252
10264
  * @returns A TimeRange with the start and end swapped.
10253
10265
  */
10254
10266
  swap() {
10255
- return new ae(this.end, this.start);
10267
+ return new ne(this.end, this.start);
10256
10268
  }
10257
10269
  get numericBounds() {
10258
10270
  return {
@@ -10304,11 +10316,11 @@ let q = class X extends Je {
10304
10316
  const o = this.makeValid();
10305
10317
  if (this.equals(e)) return !0;
10306
10318
  if (e.end.equals(o.start) || o.end.equals(e.start)) return !1;
10307
- const n = h.max(o.start, e.start), i = h.min(o.end, e.end);
10319
+ const n = g.max(o.start, e.start), i = g.min(o.end, e.end);
10308
10320
  return i.before(n) ? !1 : new j(i.sub(n)).greaterThanOrEqual(r);
10309
10321
  }
10310
10322
  contains(e) {
10311
- return e instanceof ae ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
10323
+ return e instanceof ne ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
10312
10324
  }
10313
10325
  /**
10314
10326
  * Returns a new TimeRange that is bound by the given TimeRange.
@@ -10322,25 +10334,25 @@ let q = class X extends Je {
10322
10334
  * console.log(bounded); // TimeRange(1500, 2000)
10323
10335
  */
10324
10336
  boundBy(e) {
10325
- const r = new ae(this.start, this.end);
10337
+ const r = new ne(this.start, this.end);
10326
10338
  return e.start.after(this.start) && (r.start = e.start), e.start.after(this.end) && (r.end = e.start), e.end.before(this.end) && (r.end = e.end), e.end.before(this.start) && (r.start = e.end), r;
10327
10339
  }
10328
10340
  static max(...e) {
10329
- return new ae(
10330
- h.min(...e.map((r) => r.start)),
10331
- h.max(...e.map((r) => r.end))
10341
+ return new ne(
10342
+ g.min(...e.map((r) => r.start)),
10343
+ g.max(...e.map((r) => r.end))
10332
10344
  );
10333
10345
  }
10334
10346
  /** The maximum possible time range. */
10335
- static MAX = new ae(h.MIN, h.MAX);
10347
+ static MAX = new ne(g.MIN, g.MAX);
10336
10348
  /** The minimum possible time range. */
10337
- static MIN = new ae(h.MAX, h.MIN);
10349
+ static MIN = new ne(g.MAX, g.MIN);
10338
10350
  /** A time range whose start and end are both zero. */
10339
- static ZERO = new ae(h.ZERO, h.ZERO);
10351
+ static ZERO = new ne(g.ZERO, g.ZERO);
10340
10352
  /** A zod schema for validating and transforming time ranges */
10341
10353
  static z = L([
10342
- D({ start: h.z, end: h.z }).transform((e) => new ae(e.start, e.end)),
10343
- B(ae)
10354
+ E({ start: g.z, end: g.z }).transform((e) => new ne(e.start, e.end)),
10355
+ B(ne)
10344
10356
  ]);
10345
10357
  /**
10346
10358
  * Sorts two time ranges. The range with the earlier start time is considered less than
@@ -10354,7 +10366,23 @@ let q = class X extends Je {
10354
10366
  * equal.
10355
10367
  */
10356
10368
  static sort(e, r) {
10357
- return h.sort(e.start, r.start) || h.sort(e.end, r.end);
10369
+ return g.sort(e.start, r.start) || g.sort(e.end, r.end);
10370
+ }
10371
+ /**
10372
+ * Simplify takes the list of `TimeRange`s, makes all of them valid, sorts them, and
10373
+ * merges any overlapping ranges.
10374
+ *
10375
+ * @param ranges - The list of `TimeRange`s to simplify.
10376
+ * @returns A list of simplified `TimeRange`s.
10377
+ */
10378
+ static simplify(e) {
10379
+ return e.map((r) => r.makeValid()).sort((r, o) => ne.sort(r, o)).reduce((r, o) => {
10380
+ if (o.isZero) return r;
10381
+ if (r.length === 0)
10382
+ return r.push(o), r;
10383
+ const n = r[r.length - 1];
10384
+ return n.overlapsWith(o) || n.end.equals(o.start) ? n.end = g.max(n.end, o.end) : r.push(o), r;
10385
+ }, []);
10358
10386
  }
10359
10387
  }, R = class v extends Je {
10360
10388
  constructor(e) {
@@ -10571,7 +10599,7 @@ let q = class X extends Je {
10571
10599
  static BIG_INT_TYPES = [v.INT64, v.UINT64, v.TIMESTAMP];
10572
10600
  /** A zod schema for a DataType. */
10573
10601
  static z = L([
10574
- P().transform((e) => new v(e)),
10602
+ A().transform((e) => new v(e)),
10575
10603
  B(v)
10576
10604
  ]);
10577
10605
  }, yn = class U extends Je {
@@ -10723,7 +10751,7 @@ L([
10723
10751
  ]);
10724
10752
  const Uc = (t) => {
10725
10753
  const e = typeof t;
10726
- return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof h || t instanceof j || t instanceof Date;
10754
+ return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof g || t instanceof j || t instanceof Date;
10727
10755
  }, og = (t, e, r, o = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(o) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(o.valueOf()) : bt(r, -o), bt = (t, e) => e == 0 ? t : t == 0 ? e : typeof t == "bigint" && typeof e == "bigint" || typeof t == "number" && typeof e == "number" ? t + e : Number(t) + Number(e), ag = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
10728
10756
  function ug(t) {
10729
10757
  return typeof t == "string" && ag.test(t);
@@ -10741,7 +10769,7 @@ function cg(t, e = 0) {
10741
10769
  return r;
10742
10770
  }
10743
10771
  typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
10744
- const jc = (t, e) => cg(t, e), he = -1, lg = P().transform(
10772
+ const jc = (t, e) => cg(t, e), he = -1, lg = A().transform(
10745
10773
  (t) => new Uint8Array(
10746
10774
  atob(t).split("").map((e) => e.charCodeAt(0))
10747
10775
  ).buffer
@@ -10806,7 +10834,7 @@ class se {
10806
10834
  * A zod schema that can be used to validate that a particular value
10807
10835
  * can be constructed into a series.
10808
10836
  */
10809
- static crudeZ = D({
10837
+ static crudeZ = E({
10810
10838
  timeRange: Ye.z.optional(),
10811
10839
  dataType: R.z,
10812
10840
  alignment: ic().optional(),
@@ -10909,8 +10937,8 @@ class se {
10909
10937
  data: f
10910
10938
  } = e;
10911
10939
  if (pg(f)) {
10912
- const g = f;
10913
- this.key = g.key, this.dataType = g.dataType, this.sampleOffset = g.sampleOffset, this.gl = g.gl, this._data = g._data, this.timeRange = g.timeRange, this.alignment = g.alignment, this.alignmentMultiple = g.alignmentMultiple, this.cachedMin = g.cachedMin, this.cachedMax = g.cachedMax, this.writePos = g.writePos, this._refCount = g._refCount, this.cachedLength = g.cachedLength;
10940
+ const h = f;
10941
+ this.key = h.key, this.dataType = h.dataType, this.sampleOffset = h.sampleOffset, this.gl = h.gl, this._data = h._data, this.timeRange = h.timeRange, this.alignment = h.alignment, this.alignmentMultiple = h.alignmentMultiple, this.cachedMin = h.cachedMin, this.cachedMax = h.cachedMax, this.writePos = h.writePos, this._refCount = h._refCount, this.cachedLength = h.cachedLength;
10914
10942
  return;
10915
10943
  }
10916
10944
  const p = Uc(f), l = Array.isArray(f);
@@ -10921,24 +10949,24 @@ class se {
10921
10949
  "cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
10922
10950
  );
10923
10951
  if (l || p) {
10924
- let g = f;
10952
+ let h = f;
10925
10953
  if (!p) {
10926
10954
  if (f.length === 0)
10927
10955
  throw new Error(
10928
10956
  "cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type."
10929
10957
  );
10930
- g = f[0];
10958
+ h = f[0];
10931
10959
  }
10932
- if (typeof g == "string") this.dataType = R.STRING;
10933
- else if (typeof g == "number") this.dataType = R.FLOAT64;
10934
- else if (typeof g == "bigint") this.dataType = R.INT64;
10935
- else if (typeof g == "boolean") this.dataType = R.BOOLEAN;
10936
- else if (g instanceof h || g instanceof Date || g instanceof h)
10960
+ if (typeof h == "string") this.dataType = R.STRING;
10961
+ else if (typeof h == "number") this.dataType = R.FLOAT64;
10962
+ else if (typeof h == "bigint") this.dataType = R.INT64;
10963
+ else if (typeof h == "boolean") this.dataType = R.BOOLEAN;
10964
+ else if (h instanceof g || h instanceof Date || h instanceof g)
10937
10965
  this.dataType = R.TIMESTAMP;
10938
- else if (typeof g == "object") this.dataType = R.JSON;
10966
+ else if (typeof h == "object") this.dataType = R.JSON;
10939
10967
  else
10940
10968
  throw new Error(
10941
- `cannot infer data type of ${typeof g} when constructing a Series from a JS array`
10969
+ `cannot infer data type of ${typeof h} when constructing a Series from a JS array`
10942
10970
  );
10943
10971
  } else this.dataType = new R(f);
10944
10972
  }
@@ -10946,19 +10974,19 @@ class se {
10946
10974
  else if (l && f.length === 0)
10947
10975
  this._data = new this.dataType.Array([]).buffer;
10948
10976
  else {
10949
- let g = p ? [f] : f;
10950
- const y = g[0];
10951
- (y instanceof h || y instanceof Date || y instanceof j) && (g = g.map((d) => new h(d).valueOf())), this.dataType.equals(R.STRING) ? (this.cachedLength = g.length, this._data = new TextEncoder().encode(`${g.join(`
10977
+ let h = p ? [f] : f;
10978
+ const y = h[0];
10979
+ (y instanceof g || y instanceof Date || y instanceof j) && (h = h.map((d) => new g(d).valueOf())), this.dataType.equals(R.STRING) ? (this.cachedLength = h.length, this._data = new TextEncoder().encode(`${h.join(`
10952
10980
  `)}
10953
- `).buffer) : this.dataType.equals(R.JSON) ? (this.cachedLength = g.length, this._data = new TextEncoder().encode(
10954
- `${g.map((d) => un.encodeString(d)).join(`
10981
+ `).buffer) : this.dataType.equals(R.JSON) ? (this.cachedLength = h.length, this._data = new TextEncoder().encode(
10982
+ `${h.map((d) => un.encodeString(d)).join(`
10955
10983
  `)}
10956
10984
  `
10957
10985
  ).buffer) : this.dataType.usesBigInt && typeof y == "number" ? this._data = new this.dataType.Array(
10958
- g.map((d) => BigInt(Math.round(d)))
10986
+ h.map((d) => BigInt(Math.round(d)))
10959
10987
  ).buffer : !this.dataType.usesBigInt && typeof y == "bigint" ? this._data = new this.dataType.Array(
10960
- g.map(Number)
10961
- ).buffer : this._data = new this.dataType.Array(g).buffer;
10988
+ h.map(Number)
10989
+ ).buffer : this._data = new this.dataType.Array(h).buffer;
10962
10990
  }
10963
10991
  this.key = s, this.alignment = a, this.alignmentMultiple = u, this.sampleOffset = n ?? 0, this.timeRange = o ?? Ye.ZERO, this.gl = {
10964
10992
  control: null,
@@ -11466,7 +11494,7 @@ class gg {
11466
11494
  }
11467
11495
  let hg = class Ec {
11468
11496
  wrapped;
11469
- static schema = Jt(P(), Be());
11497
+ static schema = Jt(A(), Be());
11470
11498
  constructor(e) {
11471
11499
  this.wrapped = e;
11472
11500
  }
@@ -11739,17 +11767,17 @@ const Ri = (t) => {
11739
11767
  set: _g,
11740
11768
  transformPath: bg
11741
11769
  }, Symbol.toStringTag, { value: "Module" }));
11742
- D({ key: P(), value: P() });
11770
+ E({ key: A(), value: A() });
11743
11771
  Jt(
11744
- L([x(), P(), $s()]),
11772
+ L([x(), A(), $s()]),
11745
11773
  Be()
11746
11774
  );
11747
11775
  const Mc = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Ug = Mc(), Cc = ["macOS", "Windows", "Linux"], jg = ["macos", "windows", "linux"], Dg = {
11748
11776
  macos: "macOS",
11749
11777
  windows: "Windows",
11750
11778
  linux: "Linux"
11751
- }, Eg = V(Cc).or(
11752
- V(jg).transform((t) => Dg[t])
11779
+ }, Eg = J(Cc).or(
11780
+ J(jg).transform((t) => Dg[t])
11753
11781
  ), Pg = () => {
11754
11782
  if (typeof window > "u") return;
11755
11783
  const t = window.navigator.userAgent.toLowerCase();
@@ -11815,12 +11843,12 @@ class $t {
11815
11843
  }
11816
11844
  static UNKNOWN = new $t({ host: "unknown", port: 0 });
11817
11845
  }
11818
- D({
11846
+ E({
11819
11847
  baseInterval: j.z.optional(),
11820
11848
  maxRetries: x().optional(),
11821
11849
  scale: x().optional()
11822
11850
  });
11823
- const Cg = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Lc = P().regex(Cg), Ze = x().min(0).max(255), Bc = x().min(0).max(1), Wc = me([Ze, Ze, Ze, Bc]), Rg = me([Ze, Ze, Ze]), Lg = D({ rgba255: Wc }), Bg = x().min(0).max(360), Wg = x().min(0).max(100), Fg = x().min(0).max(100), Jg = me([Bg, Wg, Fg, Bc]), mi = L([Lc, Rg, Wc, Jg, Lg]), Vg = mi.transform((t) => pi(t)), pi = (t, e = 1) => {
11851
+ const Cg = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Lc = A().regex(Cg), Ze = x().min(0).max(255), Bc = x().min(0).max(1), Wc = me([Ze, Ze, Ze, Bc]), Rg = me([Ze, Ze, Ze]), Lg = E({ rgba255: Wc }), Bg = x().min(0).max(360), Wg = x().min(0).max(100), Fg = x().min(0).max(100), Jg = me([Bg, Wg, Fg, Bc]), mi = L([Lc, Rg, Wc, Jg, Lg]), Vg = mi.transform((t) => pi(t)), pi = (t, e = 1) => {
11824
11852
  if (t = mi.parse(t), typeof t == "string") return Gg(t, e);
11825
11853
  if (Array.isArray(t)) {
11826
11854
  if (t.length < 3 || t.length > 4)
@@ -11836,27 +11864,27 @@ const Cg = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Lc = P().regex(Cg), Ze = x().min(0)
11836
11864
  ]), ht = (t, e) => parseInt(t.slice(e, e + 2), 16), qg = (t) => t.startsWith("#") ? t.slice(1) : t;
11837
11865
  pi("#000000");
11838
11866
  pi("#ffffff");
11839
- const Kg = D({
11840
- key: P(),
11867
+ const Kg = E({
11868
+ key: A(),
11841
11869
  color: mi,
11842
11870
  position: x(),
11843
11871
  switched: K().optional()
11844
11872
  });
11845
11873
  ct(Kg);
11846
- const Yg = D({
11847
- key: P(),
11848
- name: P(),
11874
+ const Yg = E({
11875
+ key: A(),
11876
+ name: A(),
11849
11877
  color: Vg
11850
11878
  });
11851
- D({
11852
- key: P(),
11853
- name: P(),
11879
+ E({
11880
+ key: A(),
11881
+ name: A(),
11854
11882
  swatches: ct(Yg)
11855
11883
  });
11856
11884
  ce().min(0).max(255);
11857
- D({
11858
- name: P(),
11859
- key: P()
11885
+ E({
11886
+ name: A(),
11887
+ key: A()
11860
11888
  });
11861
11889
  const Xg = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), Hg = (t, e) => {
11862
11890
  const r = Symbol.for(t);
@@ -11921,7 +11949,7 @@ class th {
11921
11949
  Hg("synnax-error-registry", () => new th());
11922
11950
  class Bi extends Jc("unknown") {
11923
11951
  }
11924
- D({ type: P(), data: P() });
11952
+ E({ type: A(), data: A() });
11925
11953
  const nh = W.object({
11926
11954
  jsonrpc: W.literal("2.0"),
11927
11955
  method: W.string(),
@@ -11945,10 +11973,10 @@ const nh = W.object({
11945
11973
  })
11946
11974
  }), oh = W.union([rh, ih]);
11947
11975
  W.union([nh, oh]);
11948
- P().regex(/^\d+\.\d+\.\d+$/);
11976
+ A().regex(/^\d+\.\d+\.\d+$/);
11949
11977
  const ah = ["standard", "scientific", "engineering"];
11950
- V(ah);
11951
- V([
11978
+ J(ah);
11979
+ J([
11952
11980
  "success",
11953
11981
  "info",
11954
11982
  "warning",
@@ -11966,10 +11994,10 @@ const Pe = "main", gi = "prerender", hi = {
11966
11994
  ...hi,
11967
11995
  key: gi,
11968
11996
  visible: !1
11969
- }, Bh = D({
11970
- key: P(),
11971
- url: P().optional(),
11972
- title: P().optional(),
11997
+ }, Bh = E({
11998
+ key: A(),
11999
+ url: A().optional(),
12000
+ title: A().optional(),
11973
12001
  center: K().optional(),
11974
12002
  position: gn.xy.optional(),
11975
12003
  size: rn.dimensions.optional(),