@authhero/kysely-adapter 0.23.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- var Ga = Object.defineProperty;
2
- var Kn = (t) => {
1
+ var Wa = Object.defineProperty;
2
+ var Bn = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
- var Ha = (t, e, n) => e in t ? Ga(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
6
- var ut = (t, e, n) => Ha(t, typeof e != "symbol" ? e + "" : e, n), bn = (t, e, n) => e.has(t) || Kn("Cannot " + n);
7
- var v = (t, e, n) => (bn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), ae = (t, e, n) => e.has(t) ? Kn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), ht = (t, e, n, a) => (bn(t, e, "write to private field"), a ? a.call(t, n) : e.set(t, n), n), T = (t, e, n) => (bn(t, e, "access private method"), n);
5
+ var qa = (t, e, n) => e in t ? Wa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
6
+ var ut = (t, e, n) => qa(t, typeof e != "symbol" ? e + "" : e, n), bn = (t, e, n) => e.has(t) || Bn("Cannot " + n);
7
+ var v = (t, e, n) => (bn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), ae = (t, e, n) => e.has(t) ? Bn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), ht = (t, e, n, a) => (bn(t, e, "write to private field"), a ? a.call(t, n) : e.set(t, n), n), T = (t, e, n) => (bn(t, e, "access private method"), n);
8
8
  var Tn = class extends Error {
9
9
  constructor(e = 500, n) {
10
10
  super(n == null ? void 0 : n.message, { cause: n == null ? void 0 : n.cause });
@@ -21,7 +21,7 @@ var Tn = class extends Error {
21
21
  });
22
22
  }
23
23
  };
24
- function Ya(t) {
24
+ function Qa(t) {
25
25
  return async (e, n) => {
26
26
  const { identities: a, ...r } = n, s = {
27
27
  ...r,
@@ -47,13 +47,13 @@ function Ya(t) {
47
47
  };
48
48
  };
49
49
  }
50
- function M(t) {
50
+ function R(t) {
51
51
  const e = { ...t };
52
52
  for (const n in e)
53
- e[n] === null ? delete e[n] : typeof e[n] == "object" && (Array.isArray(e[n]) ? e[n] = e[n].map(M) : e[n] = M(e[n]));
53
+ e[n] === null ? delete e[n] : typeof e[n] == "object" && (Array.isArray(e[n]) ? e[n] = e[n].map(R) : e[n] = R(e[n]));
54
54
  return e;
55
55
  }
56
- function Xa(t, e) {
56
+ function Ga(t, e) {
57
57
  var n = {};
58
58
  for (var a in t) Object.prototype.hasOwnProperty.call(t, a) && e.indexOf(a) < 0 && (n[a] = t[a]);
59
59
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
@@ -61,26 +61,26 @@ function Xa(t, e) {
61
61
  e.indexOf(a[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, a[r]) && (n[a[r]] = t[a[r]]);
62
62
  return n;
63
63
  }
64
- function er(t, e) {
64
+ function Ha(t, e) {
65
65
  var n;
66
66
  return ((n = t == null ? void 0 : t._def) === null || n === void 0 ? void 0 : n.typeName) === e;
67
67
  }
68
- function pt(t, e) {
68
+ function mt(t, e) {
69
69
  const n = t.ZodType.prototype[e];
70
70
  t.ZodType.prototype[e] = function(...a) {
71
71
  const r = n.apply(this, a);
72
72
  return r._def.openapi = this._def.openapi, r;
73
73
  };
74
74
  }
75
- function tr(t) {
75
+ function Ya(t) {
76
76
  if (typeof t.ZodType.prototype.openapi < "u")
77
77
  return;
78
78
  t.ZodType.prototype.openapi = function(r, s) {
79
79
  var o, d, c, l, u, Z;
80
- const R = typeof r == "string" ? s : r, W = R ?? {}, { param: _e } = W, Je = Xa(W, ["param"]), ge = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ye = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Je), !((l = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || l === void 0) && l.param || _e ? {
80
+ const M = typeof r == "string" ? s : r, W = M ?? {}, { param: _e } = W, Je = Ga(W, ["param"]), ge = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ye = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Je), !((l = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || l === void 0) && l.param || _e ? {
81
81
  param: Object.assign(Object.assign({}, (Z = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || Z === void 0 ? void 0 : Z.param), _e)
82
82
  } : void 0), ve = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ge).length > 0 ? { _internal: ge } : void 0), Object.keys(ye).length > 0 ? { metadata: ye } : void 0) }));
83
- if (er(this, "ZodObject")) {
83
+ if (Ha(this, "ZodObject")) {
84
84
  const We = this.extend;
85
85
  ve.extend = function(...qe) {
86
86
  var ee, te, ne, be, $e, Pe;
@@ -94,7 +94,7 @@ function tr(t) {
94
94
  };
95
95
  }
96
96
  return ve;
97
- }, pt(t, "optional"), pt(t, "nullable"), pt(t, "default"), pt(t, "transform"), pt(t, "refine");
97
+ }, mt(t, "optional"), mt(t, "nullable"), mt(t, "default"), mt(t, "transform"), mt(t, "refine");
98
98
  const e = t.ZodObject.prototype.deepPartial;
99
99
  t.ZodObject.prototype.deepPartial = function() {
100
100
  const r = this._def.shape(), s = e.apply(this), o = s._def.shape();
@@ -218,7 +218,7 @@ const g = E.arrayToEnum([
218
218
  "invalid_intersection_types",
219
219
  "not_multiple_of",
220
220
  "not_finite"
221
- ]), nr = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
221
+ ]), Xa = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
222
222
  class K extends Error {
223
223
  constructor(e) {
224
224
  super(), this.issues = [], this.addIssue = (a) => {
@@ -335,12 +335,12 @@ const st = (t, e) => {
335
335
  }
336
336
  return { message: n };
337
337
  };
338
- let ea = st;
339
- function ar(t) {
340
- ea = t;
338
+ let Xn = st;
339
+ function er(t) {
340
+ Xn = t;
341
341
  }
342
342
  function tn() {
343
- return ea;
343
+ return Xn;
344
344
  }
345
345
  const nn = (t) => {
346
346
  const { data: e, path: n, errorMaps: a, issueData: r } = t, s = [...n, ...r.path || []], o = {
@@ -362,7 +362,7 @@ const nn = (t) => {
362
362
  path: s,
363
363
  message: d
364
364
  };
365
- }, rr = [];
365
+ }, tr = [];
366
366
  function f(t, e) {
367
367
  const n = tn(), a = nn({
368
368
  issueData: e,
@@ -426,7 +426,7 @@ function rn(t, e, n, a) {
426
426
  if (typeof e == "function" ? t !== e || !a : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
427
427
  return e.get(t);
428
428
  }
429
- function ta(t, e, n, a, r) {
429
+ function ea(t, e, n, a, r) {
430
430
  if (typeof e == "function" ? t !== e || !r : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
431
431
  return e.set(t, n), n;
432
432
  }
@@ -443,7 +443,7 @@ class ie {
443
443
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
444
444
  }
445
445
  }
446
- const Jn = (t, e) => {
446
+ const Kn = (t, e) => {
447
447
  if (wt(e))
448
448
  return { success: !0, data: e.value };
449
449
  if (!t.common.issues.length)
@@ -533,7 +533,7 @@ class j {
533
533
  data: e,
534
534
  parsedType: xe(e)
535
535
  }, s = this._parseSync({ data: e, path: r.path, parent: r });
536
- return Jn(r, s);
536
+ return Kn(r, s);
537
537
  }
538
538
  async parseAsync(e, n) {
539
539
  const a = await this.safeParseAsync(e, n);
@@ -554,7 +554,7 @@ class j {
554
554
  data: e,
555
555
  parsedType: xe(e)
556
556
  }, r = this._parse({ data: e, path: a.path, parent: a }), s = await (xt(r) ? r : Promise.resolve(r));
557
- return Jn(a, s);
557
+ return Kn(a, s);
558
558
  }
559
559
  refine(e, n) {
560
560
  const a = (r) => typeof n == "string" || typeof n > "u" ? { message: n } : typeof n == "function" ? n(r) : n;
@@ -653,23 +653,23 @@ class j {
653
653
  return this.safeParse(null).success;
654
654
  }
655
655
  }
656
- const sr = /^c[^\s-]{8,}$/i, ir = /^[0-9a-z]+$/, or = /^[0-9A-HJKMNP-TV-Z]{26}$/, dr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, cr = /^[a-z0-9_-]{21}$/i, lr = /^[-+]?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)?)??$/, ur = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, hr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
656
+ const nr = /^c[^\s-]{8,}$/i, ar = /^[0-9a-z]+$/, rr = /^[0-9A-HJKMNP-TV-Z]{26}$/, sr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, ir = /^[a-z0-9_-]{21}$/i, or = /^[-+]?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)?)??$/, dr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, cr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
657
657
  let wn;
658
- const pr = /^(?:(?: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])$/, mr = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, fr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, na = "((\\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])))", _r = new RegExp(`^${na}$`);
659
- function aa(t) {
658
+ const lr = /^(?:(?: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])$/, ur = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, hr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ta = "((\\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])))", mr = new RegExp(`^${ta}$`);
659
+ function na(t) {
660
660
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
661
661
  return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
662
662
  }
663
- function gr(t) {
664
- return new RegExp(`^${aa(t)}$`);
663
+ function pr(t) {
664
+ return new RegExp(`^${na(t)}$`);
665
665
  }
666
- function ra(t) {
667
- let e = `${na}T${aa(t)}`;
666
+ function aa(t) {
667
+ let e = `${ta}T${na(t)}`;
668
668
  const n = [];
669
669
  return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
670
670
  }
671
- function yr(t, e) {
672
- return !!((e === "v4" || !e) && pr.test(t) || (e === "v6" || !e) && mr.test(t));
671
+ function fr(t, e) {
672
+ return !!((e === "v4" || !e) && lr.test(t) || (e === "v6" || !e) && ur.test(t));
673
673
  }
674
674
  class q extends j {
675
675
  _parse(e) {
@@ -720,43 +720,43 @@ class q extends j {
720
720
  message: r.message
721
721
  }), n.dirty());
722
722
  } else if (r.kind === "email")
723
- ur.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
723
+ dr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
724
724
  validation: "email",
725
725
  code: h.invalid_string,
726
726
  message: r.message
727
727
  }), n.dirty());
728
728
  else if (r.kind === "emoji")
729
- wn || (wn = new RegExp(hr, "u")), wn.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
729
+ wn || (wn = new RegExp(cr, "u")), wn.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
730
730
  validation: "emoji",
731
731
  code: h.invalid_string,
732
732
  message: r.message
733
733
  }), n.dirty());
734
734
  else if (r.kind === "uuid")
735
- dr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
735
+ sr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
736
736
  validation: "uuid",
737
737
  code: h.invalid_string,
738
738
  message: r.message
739
739
  }), n.dirty());
740
740
  else if (r.kind === "nanoid")
741
- cr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
741
+ ir.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
742
742
  validation: "nanoid",
743
743
  code: h.invalid_string,
744
744
  message: r.message
745
745
  }), n.dirty());
746
746
  else if (r.kind === "cuid")
747
- sr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
747
+ nr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
748
748
  validation: "cuid",
749
749
  code: h.invalid_string,
750
750
  message: r.message
751
751
  }), n.dirty());
752
752
  else if (r.kind === "cuid2")
753
- ir.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
753
+ ar.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
754
754
  validation: "cuid2",
755
755
  code: h.invalid_string,
756
756
  message: r.message
757
757
  }), n.dirty());
758
758
  else if (r.kind === "ulid")
759
- or.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
759
+ rr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
760
760
  validation: "ulid",
761
761
  code: h.invalid_string,
762
762
  message: r.message
@@ -787,27 +787,27 @@ class q extends j {
787
787
  code: h.invalid_string,
788
788
  validation: { endsWith: r.value },
789
789
  message: r.message
790
- }), n.dirty()) : r.kind === "datetime" ? ra(r).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
790
+ }), n.dirty()) : r.kind === "datetime" ? aa(r).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
791
791
  code: h.invalid_string,
792
792
  validation: "datetime",
793
793
  message: r.message
794
- }), n.dirty()) : r.kind === "date" ? _r.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
794
+ }), n.dirty()) : r.kind === "date" ? mr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
795
795
  code: h.invalid_string,
796
796
  validation: "date",
797
797
  message: r.message
798
- }), n.dirty()) : r.kind === "time" ? gr(r).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
798
+ }), n.dirty()) : r.kind === "time" ? pr(r).test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
799
799
  code: h.invalid_string,
800
800
  validation: "time",
801
801
  message: r.message
802
- }), n.dirty()) : r.kind === "duration" ? lr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
802
+ }), n.dirty()) : r.kind === "duration" ? or.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
803
803
  validation: "duration",
804
804
  code: h.invalid_string,
805
805
  message: r.message
806
- }), n.dirty()) : r.kind === "ip" ? yr(e.data, r.version) || (a = this._getOrReturnCtx(e, a), f(a, {
806
+ }), n.dirty()) : r.kind === "ip" ? fr(e.data, r.version) || (a = this._getOrReturnCtx(e, a), f(a, {
807
807
  validation: "ip",
808
808
  code: h.invalid_string,
809
809
  message: r.message
810
- }), n.dirty()) : r.kind === "base64" ? fr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
810
+ }), n.dirty()) : r.kind === "base64" ? hr.test(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
811
811
  validation: "base64",
812
812
  code: h.invalid_string,
813
813
  message: r.message
@@ -1029,7 +1029,7 @@ q.create = (t) => {
1029
1029
  ...O(t)
1030
1030
  });
1031
1031
  };
1032
- function vr(t, e) {
1032
+ function _r(t, e) {
1033
1033
  const n = (t.toString().split(".")[1] || "").length, a = (e.toString().split(".")[1] || "").length, r = n > a ? n : a, s = parseInt(t.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
1034
1034
  return s % o / Math.pow(10, r);
1035
1035
  }
@@ -1068,7 +1068,7 @@ class ke extends j {
1068
1068
  inclusive: r.inclusive,
1069
1069
  exact: !1,
1070
1070
  message: r.message
1071
- }), a.dirty()) : r.kind === "multipleOf" ? vr(e.data, r.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
1071
+ }), a.dirty()) : r.kind === "multipleOf" ? _r(e.data, r.value) !== 0 && (n = this._getOrReturnCtx(e, n), f(n, {
1072
1072
  code: h.not_multiple_of,
1073
1073
  multipleOf: r.value,
1074
1074
  message: r.message
@@ -1492,7 +1492,7 @@ it.create = (t) => new it({
1492
1492
  typeName: x.ZodAny,
1493
1493
  ...O(t)
1494
1494
  });
1495
- class Me extends j {
1495
+ class Re extends j {
1496
1496
  constructor() {
1497
1497
  super(...arguments), this._unknown = !0;
1498
1498
  }
@@ -1500,11 +1500,11 @@ class Me extends j {
1500
1500
  return V(e.data);
1501
1501
  }
1502
1502
  }
1503
- Me.create = (t) => new Me({
1503
+ Re.create = (t) => new Re({
1504
1504
  typeName: x.ZodUnknown,
1505
1505
  ...O(t)
1506
1506
  });
1507
- class me extends j {
1507
+ class pe extends j {
1508
1508
  _parse(e) {
1509
1509
  const n = this._getOrReturnCtx(e);
1510
1510
  return f(n, {
@@ -1514,7 +1514,7 @@ class me extends j {
1514
1514
  }), C;
1515
1515
  }
1516
1516
  }
1517
- me.create = (t) => new me({
1517
+ pe.create = (t) => new pe({
1518
1518
  typeName: x.ZodNever,
1519
1519
  ...O(t)
1520
1520
  });
@@ -1644,7 +1644,7 @@ class A extends j {
1644
1644
  }), C;
1645
1645
  }
1646
1646
  const { status: n, ctx: a } = this._processInputParams(e), { shape: r, keys: s } = this._getCached(), o = [];
1647
- if (!(this._def.catchall instanceof me && this._def.unknownKeys === "strip"))
1647
+ if (!(this._def.catchall instanceof pe && this._def.unknownKeys === "strip"))
1648
1648
  for (const c in a.data)
1649
1649
  s.includes(c) || o.push(c);
1650
1650
  const d = [];
@@ -1656,7 +1656,7 @@ class A extends j {
1656
1656
  alwaysSet: c in a.data
1657
1657
  });
1658
1658
  }
1659
- if (this._def.catchall instanceof me) {
1659
+ if (this._def.catchall instanceof pe) {
1660
1660
  const c = this._def.unknownKeys;
1661
1661
  if (c === "passthrough")
1662
1662
  for (const l of o)
@@ -1887,27 +1887,27 @@ class A extends j {
1887
1887
  });
1888
1888
  }
1889
1889
  keyof() {
1890
- return sa(E.objectKeys(this.shape));
1890
+ return ra(E.objectKeys(this.shape));
1891
1891
  }
1892
1892
  }
1893
1893
  A.create = (t, e) => new A({
1894
1894
  shape: () => t,
1895
1895
  unknownKeys: "strip",
1896
- catchall: me.create(),
1896
+ catchall: pe.create(),
1897
1897
  typeName: x.ZodObject,
1898
1898
  ...O(e)
1899
1899
  });
1900
1900
  A.strictCreate = (t, e) => new A({
1901
1901
  shape: () => t,
1902
1902
  unknownKeys: "strict",
1903
- catchall: me.create(),
1903
+ catchall: pe.create(),
1904
1904
  typeName: x.ZodObject,
1905
1905
  ...O(e)
1906
1906
  });
1907
1907
  A.lazycreate = (t, e) => new A({
1908
1908
  shape: t,
1909
1909
  unknownKeys: "strip",
1910
- catchall: me.create(),
1910
+ catchall: pe.create(),
1911
1911
  typeName: x.ZodObject,
1912
1912
  ...O(e)
1913
1913
  });
@@ -2362,11 +2362,11 @@ class nt extends j {
2362
2362
  if (this._def.returns instanceof ot) {
2363
2363
  const d = this;
2364
2364
  return V(async function(...c) {
2365
- const l = new K([]), u = await d._def.args.parseAsync(c, s).catch((R) => {
2366
- throw l.addIssue(a(c, R)), l;
2365
+ const l = new K([]), u = await d._def.args.parseAsync(c, s).catch((M) => {
2366
+ throw l.addIssue(a(c, M)), l;
2367
2367
  }), Z = await Reflect.apply(o, this, u);
2368
- return await d._def.returns._def.type.parseAsync(Z, s).catch((R) => {
2369
- throw l.addIssue(r(Z, R)), l;
2368
+ return await d._def.returns._def.type.parseAsync(Z, s).catch((M) => {
2369
+ throw l.addIssue(r(Z, M)), l;
2370
2370
  });
2371
2371
  });
2372
2372
  } else {
@@ -2391,7 +2391,7 @@ class nt extends j {
2391
2391
  args(...e) {
2392
2392
  return new nt({
2393
2393
  ...this._def,
2394
- args: oe.create(e).rest(Me.create())
2394
+ args: oe.create(e).rest(Re.create())
2395
2395
  });
2396
2396
  }
2397
2397
  returns(e) {
@@ -2408,8 +2408,8 @@ class nt extends j {
2408
2408
  }
2409
2409
  static create(e, n, a) {
2410
2410
  return new nt({
2411
- args: e || oe.create([]).rest(Me.create()),
2412
- returns: n || Me.create(),
2411
+ args: e || oe.create([]).rest(Re.create()),
2412
+ returns: n || Re.create(),
2413
2413
  typeName: x.ZodFunction,
2414
2414
  ...O(a)
2415
2415
  });
@@ -2450,7 +2450,7 @@ It.create = (t, e) => new It({
2450
2450
  typeName: x.ZodLiteral,
2451
2451
  ...O(e)
2452
2452
  });
2453
- function sa(t, e) {
2453
+ function ra(t, e) {
2454
2454
  return new Te({
2455
2455
  values: t,
2456
2456
  typeName: x.ZodEnum,
@@ -2470,7 +2470,7 @@ class Te extends j {
2470
2470
  code: h.invalid_type
2471
2471
  }), C;
2472
2472
  }
2473
- if (rn(this, ft) || ta(this, ft, new Set(this._def.values)), !rn(this, ft).has(e.data)) {
2473
+ if (rn(this, ft) || ea(this, ft, new Set(this._def.values)), !rn(this, ft).has(e.data)) {
2474
2474
  const n = this._getOrReturnCtx(e), a = this._def.values;
2475
2475
  return f(n, {
2476
2476
  received: n.data,
@@ -2515,7 +2515,7 @@ class Te extends j {
2515
2515
  }
2516
2516
  }
2517
2517
  ft = /* @__PURE__ */ new WeakMap();
2518
- Te.create = sa;
2518
+ Te.create = ra;
2519
2519
  class Zt extends j {
2520
2520
  constructor() {
2521
2521
  super(...arguments), _t.set(this, void 0);
@@ -2530,7 +2530,7 @@ class Zt extends j {
2530
2530
  code: h.invalid_type
2531
2531
  }), C;
2532
2532
  }
2533
- if (rn(this, _t) || ta(this, _t, new Set(E.getValidEnumValues(this._def.values))), !rn(this, _t).has(e.data)) {
2533
+ if (rn(this, _t) || ea(this, _t, new Set(E.getValidEnumValues(this._def.values))), !rn(this, _t).has(e.data)) {
2534
2534
  const r = E.objectValues(n);
2535
2535
  return f(a, {
2536
2536
  received: a.data,
@@ -2769,7 +2769,7 @@ cn.create = (t) => new cn({
2769
2769
  typeName: x.ZodNaN,
2770
2770
  ...O(t)
2771
2771
  });
2772
- const br = Symbol("zod_brand");
2772
+ const gr = Symbol("zod_brand");
2773
2773
  class zn extends j {
2774
2774
  _parse(e) {
2775
2775
  const { ctx: n } = this._processInputParams(e), a = n.data;
@@ -2837,7 +2837,7 @@ Pt.create = (t, e) => new Pt({
2837
2837
  typeName: x.ZodReadonly,
2838
2838
  ...O(e)
2839
2839
  });
2840
- function ia(t, e = {}, n) {
2840
+ function sa(t, e = {}, n) {
2841
2841
  return t ? it.create().superRefine((a, r) => {
2842
2842
  var s, o;
2843
2843
  if (!t(a)) {
@@ -2846,16 +2846,16 @@ function ia(t, e = {}, n) {
2846
2846
  }
2847
2847
  }) : it.create();
2848
2848
  }
2849
- const wr = {
2849
+ const yr = {
2850
2850
  object: A.lazycreate
2851
2851
  };
2852
2852
  var x;
2853
2853
  (function(t) {
2854
2854
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
2855
2855
  })(x || (x = {}));
2856
- const xr = (t, e = {
2856
+ const vr = (t, e = {
2857
2857
  message: `Input not instance of ${t.name}`
2858
- }) => ia((n) => n instanceof t, e), oa = q.create, da = ke.create, Nr = cn.create, kr = Ce.create, ca = Nt.create, Cr = ze.create, Tr = sn.create, Or = kt.create, Sr = Ct.create, jr = it.create, Ir = Me.create, Zr = me.create, Er = on.create, $r = G.create, Pr = A.create, Ar = A.strictCreate, Dr = Tt.create, Rr = yn.create, Mr = Ot.create, Lr = oe.create, zr = St.create, Ur = dn.create, Fr = Ue.create, Vr = nt.create, Br = jt.create, Kr = It.create, Jr = Te.create, Wr = Zt.create, qr = ot.create, Wn = Y.create, Qr = re.create, Gr = Oe.create, Hr = Y.createWithPreprocess, Yr = Ht.create, Xr = () => oa().optional(), es = () => da().optional(), ts = () => ca().optional(), ns = {
2858
+ }) => sa((n) => n instanceof t, e), ia = q.create, oa = ke.create, br = cn.create, wr = Ce.create, da = Nt.create, xr = ze.create, Nr = sn.create, kr = kt.create, Cr = Ct.create, Tr = it.create, Or = Re.create, Sr = pe.create, jr = on.create, Ir = G.create, Zr = A.create, Er = A.strictCreate, $r = Tt.create, Pr = yn.create, Ar = Ot.create, Dr = oe.create, Mr = St.create, Rr = dn.create, Lr = Ue.create, zr = nt.create, Ur = jt.create, Fr = It.create, Vr = Te.create, Br = Zt.create, Kr = ot.create, Jn = Y.create, Jr = re.create, Wr = Oe.create, qr = Y.createWithPreprocess, Qr = Ht.create, Gr = () => ia().optional(), Hr = () => oa().optional(), Yr = () => da().optional(), Xr = {
2859
2859
  string: (t) => q.create({ ...t, coerce: !0 }),
2860
2860
  number: (t) => ke.create({ ...t, coerce: !0 }),
2861
2861
  boolean: (t) => Nt.create({
@@ -2864,14 +2864,14 @@ const xr = (t, e = {
2864
2864
  }),
2865
2865
  bigint: (t) => Ce.create({ ...t, coerce: !0 }),
2866
2866
  date: (t) => ze.create({ ...t, coerce: !0 })
2867
- }, as = C;
2867
+ }, es = C;
2868
2868
  var i = /* @__PURE__ */ Object.freeze({
2869
2869
  __proto__: null,
2870
2870
  defaultErrorMap: st,
2871
- setErrorMap: ar,
2871
+ setErrorMap: er,
2872
2872
  getErrorMap: tn,
2873
2873
  makeIssue: nn,
2874
- EMPTY_PATH: rr,
2874
+ EMPTY_PATH: tr,
2875
2875
  addIssueToContext: f,
2876
2876
  ParseStatus: U,
2877
2877
  INVALID: C,
@@ -2890,7 +2890,7 @@ var i = /* @__PURE__ */ Object.freeze({
2890
2890
  ZodParsedType: g,
2891
2891
  getParsedType: xe,
2892
2892
  ZodType: j,
2893
- datetimeRegex: ra,
2893
+ datetimeRegex: aa,
2894
2894
  ZodString: q,
2895
2895
  ZodNumber: ke,
2896
2896
  ZodBigInt: Ce,
@@ -2900,8 +2900,8 @@ var i = /* @__PURE__ */ Object.freeze({
2900
2900
  ZodUndefined: kt,
2901
2901
  ZodNull: Ct,
2902
2902
  ZodAny: it,
2903
- ZodUnknown: Me,
2904
- ZodNever: me,
2903
+ ZodUnknown: Re,
2904
+ ZodNever: pe,
2905
2905
  ZodVoid: on,
2906
2906
  ZodArray: G,
2907
2907
  ZodObject: A,
@@ -2925,63 +2925,63 @@ var i = /* @__PURE__ */ Object.freeze({
2925
2925
  ZodDefault: Et,
2926
2926
  ZodCatch: $t,
2927
2927
  ZodNaN: cn,
2928
- BRAND: br,
2928
+ BRAND: gr,
2929
2929
  ZodBranded: zn,
2930
2930
  ZodPipeline: Ht,
2931
2931
  ZodReadonly: Pt,
2932
- custom: ia,
2932
+ custom: sa,
2933
2933
  Schema: j,
2934
2934
  ZodSchema: j,
2935
- late: wr,
2935
+ late: yr,
2936
2936
  get ZodFirstPartyTypeKind() {
2937
2937
  return x;
2938
2938
  },
2939
- coerce: ns,
2940
- any: jr,
2941
- array: $r,
2942
- bigint: kr,
2943
- boolean: ca,
2944
- date: Cr,
2945
- discriminatedUnion: Rr,
2946
- effect: Wn,
2947
- enum: Jr,
2948
- function: Vr,
2949
- instanceof: xr,
2950
- intersection: Mr,
2951
- lazy: Br,
2952
- literal: Kr,
2953
- map: Ur,
2954
- nan: Nr,
2955
- nativeEnum: Wr,
2956
- never: Zr,
2957
- null: Sr,
2958
- nullable: Gr,
2959
- number: da,
2960
- object: Pr,
2961
- oboolean: ts,
2962
- onumber: es,
2963
- optional: Qr,
2964
- ostring: Xr,
2965
- pipeline: Yr,
2966
- preprocess: Hr,
2967
- promise: qr,
2968
- record: zr,
2969
- set: Fr,
2970
- strictObject: Ar,
2971
- string: oa,
2972
- symbol: Tr,
2973
- transformer: Wn,
2974
- tuple: Lr,
2975
- undefined: Or,
2976
- union: Dr,
2977
- unknown: Ir,
2978
- void: Er,
2979
- NEVER: as,
2939
+ coerce: Xr,
2940
+ any: Tr,
2941
+ array: Ir,
2942
+ bigint: wr,
2943
+ boolean: da,
2944
+ date: xr,
2945
+ discriminatedUnion: Pr,
2946
+ effect: Jn,
2947
+ enum: Vr,
2948
+ function: zr,
2949
+ instanceof: vr,
2950
+ intersection: Ar,
2951
+ lazy: Ur,
2952
+ literal: Fr,
2953
+ map: Rr,
2954
+ nan: br,
2955
+ nativeEnum: Br,
2956
+ never: Sr,
2957
+ null: Cr,
2958
+ nullable: Wr,
2959
+ number: oa,
2960
+ object: Zr,
2961
+ oboolean: Yr,
2962
+ onumber: Hr,
2963
+ optional: Jr,
2964
+ ostring: Gr,
2965
+ pipeline: Qr,
2966
+ preprocess: qr,
2967
+ promise: Kr,
2968
+ record: Mr,
2969
+ set: Lr,
2970
+ strictObject: Er,
2971
+ string: ia,
2972
+ symbol: Nr,
2973
+ transformer: Jn,
2974
+ tuple: Dr,
2975
+ undefined: kr,
2976
+ union: $r,
2977
+ unknown: Or,
2978
+ void: jr,
2979
+ NEVER: es,
2980
2980
  ZodIssueCode: h,
2981
- quotelessJson: nr,
2981
+ quotelessJson: Xa,
2982
2982
  ZodError: K
2983
2983
  });
2984
- tr(i);
2984
+ Ya(i);
2985
2985
  i.object({
2986
2986
  start: i.number(),
2987
2987
  limit: i.number(),
@@ -2990,7 +2990,7 @@ i.object({
2990
2990
  const Un = i.object({
2991
2991
  created_at: i.string(),
2992
2992
  updated_at: i.string()
2993
- }), rs = i.object({
2993
+ }), ts = i.object({
2994
2994
  email: i.string().optional(),
2995
2995
  email_verified: i.boolean().optional(),
2996
2996
  name: i.string().optional(),
@@ -2999,7 +2999,7 @@ const Un = i.object({
2999
2999
  phone_number: i.string().optional(),
3000
3000
  phone_verified: i.boolean().optional(),
3001
3001
  family_name: i.string().optional()
3002
- }).catchall(i.any()), ss = i.object({
3002
+ }).catchall(i.any()), ns = i.object({
3003
3003
  connection: i.string(),
3004
3004
  user_id: i.string(),
3005
3005
  provider: i.string(),
@@ -3007,8 +3007,8 @@ const Un = i.object({
3007
3007
  access_token: i.string().optional(),
3008
3008
  access_token_secret: i.string().optional(),
3009
3009
  refresh_token: i.string().optional(),
3010
- profileData: rs.optional()
3011
- }), la = i.object({
3010
+ profileData: ts.optional()
3011
+ }), ca = i.object({
3012
3012
  email: i.string().optional(),
3013
3013
  username: i.string().optional(),
3014
3014
  given_name: i.string().optional(),
@@ -3022,7 +3022,7 @@ const Un = i.object({
3022
3022
  user_id: i.string().optional(),
3023
3023
  app_metadata: i.any().default({}).optional(),
3024
3024
  user_metadata: i.any().default({}).optional()
3025
- }), is = la.extend({
3025
+ }), as = ca.extend({
3026
3026
  email_verified: i.boolean().default(!1),
3027
3027
  verify_email: i.boolean().optional(),
3028
3028
  last_ip: i.string().optional(),
@@ -3032,16 +3032,16 @@ const Un = i.object({
3032
3032
  connection: i.string().default("email")
3033
3033
  });
3034
3034
  i.object({
3035
- ...is.shape,
3035
+ ...as.shape,
3036
3036
  ...Un.shape,
3037
3037
  user_id: i.string(),
3038
3038
  // TODO: this not might be correct if you use the username
3039
3039
  email: i.string(),
3040
3040
  is_social: i.boolean(),
3041
3041
  login_count: i.number(),
3042
- identities: i.array(ss).optional()
3042
+ identities: i.array(ns).optional()
3043
3043
  });
3044
- la.extend({
3044
+ ca.extend({
3045
3045
  email: i.string(),
3046
3046
  login_count: i.number(),
3047
3047
  multifactor: i.array(i.string()).optional(),
@@ -3049,14 +3049,14 @@ la.extend({
3049
3049
  last_login: i.string().optional(),
3050
3050
  user_id: i.string()
3051
3051
  }).catchall(i.any());
3052
- const os = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3053
- let ds = (t = 21) => {
3052
+ const rs = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3053
+ let ss = (t = 21) => {
3054
3054
  let e = "", n = crypto.getRandomValues(new Uint8Array(t));
3055
3055
  for (; t--; )
3056
- e += os[n[t] & 63];
3056
+ e += rs[n[t] & 63];
3057
3057
  return e;
3058
3058
  };
3059
- const cs = i.object({
3059
+ const is = i.object({
3060
3060
  audience: i.string().optional(),
3061
3061
  recipient: i.string().optional(),
3062
3062
  createUpnClaim: i.boolean().optional(),
@@ -3073,7 +3073,7 @@ const cs = i.object({
3073
3073
  nameIdentifierProbes: i.array(i.string()).optional(),
3074
3074
  authnContextClassRef: i.string().optional(),
3075
3075
  mappings: i.record(i.string()).optional()
3076
- }), ls = i.object({
3076
+ }), os = i.object({
3077
3077
  id: i.string(),
3078
3078
  name: i.string(),
3079
3079
  callbacks: i.array(i.string()).default([]).optional().openapi({
@@ -3092,36 +3092,36 @@ const cs = i.object({
3092
3092
  description: "Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients"
3093
3093
  }),
3094
3094
  addons: i.object({
3095
- samlp: cs.optional()
3095
+ samlp: is.optional()
3096
3096
  }).default({}).optional().openapi({
3097
3097
  description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon."
3098
3098
  }),
3099
3099
  email_validation: i.enum(["enabled", "disabled", "enforced"]).default("enforced").optional().openapi({
3100
3100
  description: "Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0"
3101
3101
  }),
3102
- client_secret: i.string().default(() => ds()).optional(),
3102
+ client_secret: i.string().default(() => ss()).optional(),
3103
3103
  disable_sign_ups: i.boolean().optional().default(!1).openapi({
3104
3104
  description: "Prevents users from signing up using the hosted login page. This is not available in auth0"
3105
3105
  })
3106
- }), us = i.object({
3106
+ }), ds = i.object({
3107
3107
  created_at: i.string().transform((t) => t === null ? "" : t),
3108
3108
  updated_at: i.string().transform((t) => t === null ? "" : t),
3109
- ...ls.shape
3109
+ ...os.shape
3110
3110
  });
3111
- var ua = /* @__PURE__ */ ((t) => (t.TOKEN = "token", t.TOKEN_ID_TOKEN = "token id_token", t.CODE = "code", t))(ua || {}), ha = /* @__PURE__ */ ((t) => (t.QUERY = "query", t.FRAGMENT = "fragment", t.FORM_POST = "form_post", t.WEB_MESSAGE = "web_message", t.SAML_POST = "saml_post", t))(ha || {}), pa = /* @__PURE__ */ ((t) => (t.S265 = "S256", t.plain = "plain", t))(pa || {});
3112
- const hs = i.object({
3111
+ var la = /* @__PURE__ */ ((t) => (t.TOKEN = "token", t.TOKEN_ID_TOKEN = "token id_token", t.CODE = "code", t))(la || {}), ua = /* @__PURE__ */ ((t) => (t.QUERY = "query", t.FRAGMENT = "fragment", t.FORM_POST = "form_post", t.WEB_MESSAGE = "web_message", t.SAML_POST = "saml_post", t))(ua || {});
3112
+ const cs = i.object({
3113
3113
  client_id: i.string(),
3114
3114
  vendor_id: i.string().optional(),
3115
3115
  act_as: i.string().optional(),
3116
- response_type: i.nativeEnum(ua).optional(),
3117
- response_mode: i.nativeEnum(ha).optional(),
3116
+ response_type: i.nativeEnum(la).optional(),
3117
+ response_mode: i.nativeEnum(ua).optional(),
3118
3118
  redirect_uri: i.string().optional(),
3119
3119
  audience: i.string().optional(),
3120
3120
  state: i.string().optional(),
3121
3121
  nonce: i.string().optional(),
3122
3122
  scope: i.string().optional(),
3123
3123
  prompt: i.string().optional(),
3124
- code_challenge_method: i.nativeEnum(pa).optional(),
3124
+ code_challenge_method: i.enum(["plain", "S256"]).optional(),
3125
3125
  code_challenge: i.string().optional(),
3126
3126
  username: i.string().optional(),
3127
3127
  ui_locales: i.string().optional()
@@ -3142,7 +3142,7 @@ i.object({
3142
3142
  url: i.string()
3143
3143
  }).optional()
3144
3144
  });
3145
- const ps = i.object({
3145
+ const ls = i.object({
3146
3146
  id: i.string().optional(),
3147
3147
  name: i.string(),
3148
3148
  strategy: i.enum([
@@ -3178,11 +3178,11 @@ const ps = i.object({
3178
3178
  enabled_clients: i.array(i.string()).default([]).optional(),
3179
3179
  response_type: i.custom().optional(),
3180
3180
  response_mode: i.custom().optional()
3181
- }), ma = i.object({
3181
+ }), ha = i.object({
3182
3182
  id: i.string(),
3183
3183
  created_at: i.string().transform((t) => t === null ? "" : t),
3184
3184
  updated_at: i.string().transform((t) => t === null ? "" : t)
3185
- }).extend(ps.shape), ms = i.object({
3185
+ }).extend(ls.shape), us = i.object({
3186
3186
  name: i.string(),
3187
3187
  audience: i.string(),
3188
3188
  sender_email: i.string().email(),
@@ -3192,11 +3192,11 @@ const ps = i.object({
3192
3192
  primary_color: i.string().optional(),
3193
3193
  secondary_color: i.string().optional(),
3194
3194
  language: i.string().optional()
3195
- }), fs = i.object({
3195
+ }), hs = i.object({
3196
3196
  created_at: i.string().transform((t) => t === null ? "" : t),
3197
3197
  updated_at: i.string().transform((t) => t === null ? "" : t),
3198
3198
  id: i.string(),
3199
- ...ms.shape
3199
+ ...us.shape
3200
3200
  });
3201
3201
  i.object({
3202
3202
  logoUrl: i.string(),
@@ -3216,7 +3216,7 @@ i.object({
3216
3216
  siteUrl: i.string().nullable(),
3217
3217
  manageSubscriptionsUrl: i.string().optional()
3218
3218
  });
3219
- const _s = i.object({
3219
+ const ms = i.object({
3220
3220
  domain: i.string(),
3221
3221
  dkim_private_key: i.string().optional(),
3222
3222
  dkim_public_key: i.string().optional(),
@@ -3224,19 +3224,19 @@ const _s = i.object({
3224
3224
  email_service: i.union([i.literal("mailgun"), i.literal("mailchannels")]).optional()
3225
3225
  });
3226
3226
  i.object({
3227
- ...us.shape,
3228
- domains: i.array(_s),
3229
- tenant: fs,
3230
- connections: i.array(ma)
3227
+ ...ds.shape,
3228
+ domains: i.array(ms),
3229
+ tenant: hs,
3230
+ connections: i.array(ha)
3231
3231
  });
3232
- const gs = i.enum([
3232
+ const ps = i.enum([
3233
3233
  "password_reset",
3234
3234
  "email_verification",
3235
3235
  "otp",
3236
3236
  "authorization_code",
3237
3237
  "oauth2_state",
3238
3238
  "ticket"
3239
- ]), ys = i.object({
3239
+ ]), fs = i.object({
3240
3240
  code_id: i.string().openapi({
3241
3241
  description: "The code that will be used in for instance an email verification flow"
3242
3242
  }),
@@ -3246,15 +3246,14 @@ const gs = i.enum([
3246
3246
  connection_id: i.string().optional().openapi({
3247
3247
  description: "The connection that the code is connected to"
3248
3248
  }),
3249
- code_type: gs,
3250
- code_verifier: i.string().optional(),
3249
+ code_type: ps,
3251
3250
  expires_at: i.string(),
3252
3251
  used_at: i.string().optional(),
3253
3252
  user_id: i.string().optional()
3254
- }), vs = i.object({
3255
- ...ys.shape,
3253
+ }), _s = i.object({
3254
+ ...fs.shape,
3256
3255
  created_at: i.string()
3257
- }), bs = i.object({
3256
+ }), gs = i.object({
3258
3257
  domain: i.string(),
3259
3258
  dkim_private_key: i.string().optional(),
3260
3259
  dkim_public_key: i.string().optional(),
@@ -3262,10 +3261,10 @@ const gs = i.enum([
3262
3261
  email_service: i.enum(["mailgun", "mailchannels"])
3263
3262
  });
3264
3263
  Un.extend({
3265
- ...bs.shape,
3264
+ ...gs.shape,
3266
3265
  id: i.string()
3267
3266
  });
3268
- const ws = i.object({
3267
+ const ys = i.object({
3269
3268
  trigger_id: i.enum([
3270
3269
  "pre-user-signup",
3271
3270
  "post-user-registration",
@@ -3277,11 +3276,11 @@ const ws = i.object({
3277
3276
  synchronous: i.boolean().default(!1),
3278
3277
  priority: i.number().optional()
3279
3278
  });
3280
- ws.extend({
3279
+ ys.extend({
3281
3280
  ...Un.shape,
3282
3281
  hook_id: i.string()
3283
3282
  });
3284
- const xs = i.object({
3283
+ const vs = i.object({
3285
3284
  alg: i.enum([
3286
3285
  "RS256",
3287
3286
  "RS384",
@@ -3302,7 +3301,7 @@ const xs = i.object({
3302
3301
  use: i.enum(["sig", "enc"]).optional()
3303
3302
  });
3304
3303
  i.object({
3305
- keys: i.array(xs)
3304
+ keys: i.array(vs)
3306
3305
  });
3307
3306
  i.object({
3308
3307
  issuer: i.string(),
@@ -3326,23 +3325,23 @@ i.object({
3326
3325
  request_parameter_supported: i.boolean(),
3327
3326
  token_endpoint_auth_signing_alg_values_supported: i.array(i.string())
3328
3327
  });
3329
- const Ns = i.object({
3328
+ const bs = i.object({
3330
3329
  auth0Client: i.string().optional(),
3331
- authParams: hs,
3330
+ authParams: cs,
3332
3331
  expires_at: i.string(),
3333
3332
  deleted_at: i.string().optional(),
3334
3333
  ip: i.string().optional(),
3335
3334
  useragent: i.string().optional()
3336
3335
  }).openapi({
3337
3336
  description: "This represents a login sesion"
3338
- }), ks = i.object({
3339
- ...Ns.shape,
3337
+ }), ws = i.object({
3338
+ ...bs.shape,
3340
3339
  login_id: i.string().openapi({
3341
3340
  description: "This is is used as the state in the universal login"
3342
3341
  }),
3343
3342
  created_at: i.string(),
3344
3343
  updated_at: i.string()
3345
- }), Cs = i.enum([
3344
+ }), xs = i.enum([
3346
3345
  "cls",
3347
3346
  // CODE_LINK_SENT
3348
3347
  "fsa",
@@ -3391,7 +3390,7 @@ const Ns = i.object({
3391
3390
  // SUCCESS_VERIFICATION_EMAIL
3392
3391
  "svr"
3393
3392
  // SUCCESS_VERIFICATION_EMAIL_REQUEST
3394
- ]), Ts = i.object({
3393
+ ]), Ns = i.object({
3395
3394
  name: i.string(),
3396
3395
  version: i.string(),
3397
3396
  env: i.object({
@@ -3399,7 +3398,7 @@ const Ns = i.object({
3399
3398
  }).optional()
3400
3399
  });
3401
3400
  i.object({
3402
- type: Cs,
3401
+ type: xs,
3403
3402
  date: i.string(),
3404
3403
  description: i.string().optional(),
3405
3404
  log_id: i.string().optional(),
@@ -3420,19 +3419,19 @@ i.object({
3420
3419
  strategy: i.string().optional(),
3421
3420
  strategy_type: i.string().optional(),
3422
3421
  hostname: i.string().optional(),
3423
- auth0_client: Ts.optional()
3422
+ auth0_client: Ns.optional()
3424
3423
  });
3425
- const Os = i.object({
3424
+ const ks = i.object({
3426
3425
  user_id: i.string(),
3427
3426
  password: i.string(),
3428
3427
  algorithm: i.enum(["bcrypt", "argon2id"]).default("argon2id")
3429
3428
  });
3430
3429
  i.object({
3431
- ...Os.shape,
3430
+ ...ks.shape,
3432
3431
  created_at: i.string(),
3433
3432
  updated_at: i.string()
3434
3433
  });
3435
- const Ss = i.object({
3434
+ const Cs = i.object({
3436
3435
  session_id: i.string(),
3437
3436
  client_id: i.string(),
3438
3437
  expires_at: i.string(),
@@ -3442,7 +3441,7 @@ const Ss = i.object({
3442
3441
  });
3443
3442
  i.object({
3444
3443
  created_at: i.string(),
3445
- ...Ss.shape
3444
+ ...Cs.shape
3446
3445
  });
3447
3446
  i.object({
3448
3447
  kid: i.string().openapi({ description: "The key id of the signing key" }),
@@ -3464,37 +3463,6 @@ i.object({
3464
3463
  revoked: i.boolean().optional().openapi({ description: "True if the key is revoked" }),
3465
3464
  revoked_at: i.string().optional().openapi({ description: "The date and time when the key was revoked" })
3466
3465
  });
3467
- var fa = /* @__PURE__ */ ((t) => (t.RefreshToken = "refresh_token", t.AuthorizationCode = "authorization_code", t.ClientCredential = "client_credentials", t.Passwordless = "passwordless", t.Password = "password", t))(fa || {});
3468
- const Fn = i.nativeEnum(fa);
3469
- i.object({
3470
- grant_type: Fn.refine(
3471
- (t) => t === "authorization_code"
3472
- /* AuthorizationCode */
3473
- ),
3474
- code: i.string(),
3475
- client_secret: i.string(),
3476
- client_id: i.string()
3477
- });
3478
- i.object({
3479
- grant_type: Fn.refine(
3480
- (t) => t === "authorization_code"
3481
- /* AuthorizationCode */
3482
- ),
3483
- code: i.string(),
3484
- code_verifier: i.string(),
3485
- client_id: i.string().optional(),
3486
- redirect_uri: i.string()
3487
- });
3488
- i.object({
3489
- grant_type: Fn.refine(
3490
- (t) => t === "client_credentials"
3491
- /* ClientCredential */
3492
- ),
3493
- scope: i.string().optional(),
3494
- client_secret: i.string(),
3495
- client_id: i.string(),
3496
- audience: i.string().optional()
3497
- });
3498
3466
  i.object({
3499
3467
  access_token: i.string(),
3500
3468
  id_token: i.string().optional(),
@@ -3508,7 +3476,7 @@ i.object({
3508
3476
  code: i.string(),
3509
3477
  state: i.string().optional()
3510
3478
  });
3511
- const js = i.object({
3479
+ const Ts = i.object({
3512
3480
  button_border_radius: i.number(),
3513
3481
  button_border_weight: i.number(),
3514
3482
  buttons_style: i.enum(["pill"]),
@@ -3518,7 +3486,7 @@ const js = i.object({
3518
3486
  show_widget_shadow: i.boolean(),
3519
3487
  widget_border_weight: i.number(),
3520
3488
  widget_corner_radius: i.number()
3521
- }), Is = i.object({
3489
+ }), Os = i.object({
3522
3490
  base_focus_color: i.string(),
3523
3491
  base_hover_color: i.string(),
3524
3492
  body_text: i.string(),
@@ -3541,7 +3509,7 @@ const js = i.object({
3541
3509
  }), Qe = i.object({
3542
3510
  bold: i.boolean(),
3543
3511
  size: i.number()
3544
- }), Zs = i.object({
3512
+ }), Ss = i.object({
3545
3513
  body_text: Qe,
3546
3514
  buttons_text: Qe,
3547
3515
  font_url: i.string(),
@@ -3551,28 +3519,28 @@ const js = i.object({
3551
3519
  reference_text_size: i.number(),
3552
3520
  subtitle: Qe,
3553
3521
  title: Qe
3554
- }), Es = i.object({
3522
+ }), js = i.object({
3555
3523
  background_color: i.string(),
3556
3524
  background_image_url: i.string(),
3557
3525
  page_layout: i.enum(["center"])
3558
- }), $s = i.object({
3526
+ }), Is = i.object({
3559
3527
  header_text_alignment: i.enum(["center"]),
3560
3528
  logo_height: i.number(),
3561
3529
  logo_position: i.enum(["center"]),
3562
3530
  logo_url: i.string(),
3563
3531
  social_buttons_layout: i.enum(["bottom"])
3564
- }), Ps = i.object({
3565
- borders: js,
3566
- colors: Is,
3532
+ }), Zs = i.object({
3533
+ borders: Ts,
3534
+ colors: Os,
3567
3535
  displayName: i.string(),
3568
- fonts: Zs,
3569
- page_background: Es,
3570
- widget: $s
3536
+ fonts: Ss,
3537
+ page_background: js,
3538
+ widget: Is
3571
3539
  });
3572
- Ps.extend({
3540
+ Zs.extend({
3573
3541
  themeId: i.string()
3574
3542
  });
3575
- const As = i.object({
3543
+ const Es = i.object({
3576
3544
  universal_login_experience: i.enum(["new", "classic"]).default("new"),
3577
3545
  identifier_first: i.boolean().default(!0),
3578
3546
  password_first: i.boolean().default(!1),
@@ -3609,13 +3577,13 @@ i.object({
3609
3577
  ]),
3610
3578
  settings: i.object({}).optional()
3611
3579
  });
3612
- function Vn(t) {
3580
+ function Fn(t) {
3613
3581
  const [e, n] = t.split("|");
3614
3582
  if (!e || !n)
3615
3583
  throw new Error(`Invalid user_id: ${t}`);
3616
3584
  return { connection: e, id: n };
3617
3585
  }
3618
- function _a(t) {
3586
+ function ma(t) {
3619
3587
  let e = {};
3620
3588
  try {
3621
3589
  e = JSON.parse(t.profileData || "{}");
@@ -3625,7 +3593,7 @@ function _a(t) {
3625
3593
  return {
3626
3594
  connection: t.connection,
3627
3595
  provider: t.provider,
3628
- user_id: Vn(t.user_id).id,
3596
+ user_id: Fn(t.user_id).id,
3629
3597
  isSocial: !!t.is_social,
3630
3598
  profileData: {
3631
3599
  email: t.email,
@@ -3634,7 +3602,7 @@ function _a(t) {
3634
3602
  }
3635
3603
  };
3636
3604
  }
3637
- function Ds(t) {
3605
+ function $s(t) {
3638
3606
  return async (e, n) => {
3639
3607
  const [a, r] = await Promise.all([
3640
3608
  t.selectFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", n).selectAll().executeTakeFirst(),
@@ -3653,19 +3621,19 @@ function Ds(t) {
3653
3621
  {
3654
3622
  connection: a.connection,
3655
3623
  provider: a.provider,
3656
- user_id: Vn(a.user_id).id,
3624
+ user_id: Fn(a.user_id).id,
3657
3625
  isSocial: !!a.is_social
3658
3626
  },
3659
- ...r.map(_a)
3627
+ ...r.map(ma)
3660
3628
  ]
3661
3629
  };
3662
- return M(d);
3630
+ return R(d);
3663
3631
  };
3664
3632
  }
3665
3633
  function Be(t, e, n, a) {
3666
3634
  return n.split(/\s+/).map((s) => s.replace(/^([^:]+)=/g, "$1:")).map((s) => {
3667
3635
  let o = s.startsWith("-"), d, c, l, u;
3668
- return s.startsWith("-_exists_:") ? (d = s.substring(10), l = !0, o = !0) : s.startsWith("_exists_:") ? (d = s.substring(9), l = !0, o = !1) : s.includes(":") ? (o = s.startsWith("-"), [d, c] = o ? s.substring(1).split(":") : s.split(":"), l = !1, c.startsWith(">=") ? (u = ">=", c = c.substring(2)) : c.startsWith(">") ? (u = ">", c = c.substring(1)) : c.startsWith("<=") ? (console.log("value", c), u = "<=", c = c.substring(2)) : c.startsWith("<") ? (u = "<", c = c.substring(1)) : u = "=") : (d = null, c = s, l = !1), { key: d, value: c, isNegation: o, isExistsQuery: l, operator: u };
3636
+ return s.startsWith("-_exists_:") ? (d = s.substring(10), l = !0, o = !0) : s.startsWith("_exists_:") ? (d = s.substring(9), l = !0, o = !1) : s.includes(":") ? (o = s.startsWith("-"), [d, c] = o ? s.substring(1).split(":") : s.split(":"), l = !1, c.startsWith(">=") ? (u = ">=", c = c.substring(2)) : c.startsWith(">") ? (u = ">", c = c.substring(1)) : c.startsWith("<=") ? (u = "<=", c = c.substring(2)) : c.startsWith("<") ? (u = "<", c = c.substring(1)) : u = "=") : (d = null, c = s, l = !1), { key: d, value: c, isNegation: o, isExistsQuery: l, operator: u };
3669
3637
  }).forEach(({ key: s, value: o, isNegation: d, isExistsQuery: c, operator: l }) => {
3670
3638
  if (s)
3671
3639
  if (c)
@@ -3693,7 +3661,7 @@ function Be(t, e, n, a) {
3693
3661
  const { ref: u } = t.dynamic;
3694
3662
  e = e.where(
3695
3663
  (Z) => Z.or(
3696
- a.map((R) => Z(u(R), "like", `%${o}%`))
3664
+ a.map((M) => Z(u(M), "like", `%${o}%`))
3697
3665
  )
3698
3666
  );
3699
3667
  }
@@ -3702,7 +3670,7 @@ function Be(t, e, n, a) {
3702
3670
  function Ee(t) {
3703
3671
  return typeof t == "string" ? parseInt(t, 10) : typeof t == "bigint" ? Number(t) : t;
3704
3672
  }
3705
- function Rs(t) {
3673
+ function Ps(t) {
3706
3674
  return async (e, n) => {
3707
3675
  let a = t.selectFrom("users").where("users.tenant_id", "=", e);
3708
3676
  if (n.q && (a = Be(t, a, n.q, ["email", "name"])), n.sort && n.sort.sort_by) {
@@ -3711,9 +3679,9 @@ function Rs(t) {
3711
3679
  }
3712
3680
  const s = await a.offset(n.page * n.per_page).limit(n.per_page).selectAll().execute(), o = s.map((u) => u.user_id), d = o.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", o).execute() : [], c = s.map((u) => {
3713
3681
  const Z = d.filter(
3714
- (R) => R.linked_to === u.user_id
3682
+ (M) => M.linked_to === u.user_id
3715
3683
  );
3716
- return M({
3684
+ return R({
3717
3685
  ...u,
3718
3686
  email_verified: u.email_verified === 1,
3719
3687
  is_social: u.is_social === 1,
@@ -3723,10 +3691,10 @@ function Rs(t) {
3723
3691
  {
3724
3692
  connection: u.connection,
3725
3693
  provider: u.provider,
3726
- user_id: Vn(u.user_id).id,
3694
+ user_id: Fn(u.user_id).id,
3727
3695
  isSocial: !!u.is_social
3728
3696
  },
3729
- ...Z.map(_a)
3697
+ ...Z.map(ma)
3730
3698
  ]
3731
3699
  });
3732
3700
  }), { count: l } = await a.select((u) => u.fn.countAll().as("count")).executeTakeFirstOrThrow();
@@ -3738,48 +3706,48 @@ function Rs(t) {
3738
3706
  };
3739
3707
  };
3740
3708
  }
3741
- function Ms(t) {
3709
+ function As(t) {
3742
3710
  return async (e, n) => (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.linked_to", "=", n).execute(), (await t.deleteFrom("users").where("users.tenant_id", "=", e).where("users.user_id", "=", n).execute()).length === 1);
3743
3711
  }
3744
- function Ls(t) {
3712
+ function Ds(t) {
3745
3713
  if (t.email_verified !== void 0)
3746
3714
  return t.email_verified ? 1 : 0;
3747
3715
  }
3748
- function zs(t) {
3716
+ function Ms(t) {
3749
3717
  return async (e, n, a) => {
3750
3718
  const r = {
3751
3719
  ...a,
3752
- email_verified: Ls(a),
3720
+ email_verified: Ds(a),
3753
3721
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
3754
3722
  };
3755
3723
  return a.app_metadata && (r.app_metadata = JSON.stringify(a.app_metadata)), a.user_metadata && (r.user_metadata = JSON.stringify(a.user_metadata)), (await t.updateTable("users").set(r).where("users.tenant_id", "=", e).where("users.user_id", "=", n).execute()).length === 1;
3756
3724
  };
3757
3725
  }
3758
- function Us(t) {
3726
+ function Rs(t) {
3759
3727
  return async (e, n, a, r) => {
3760
3728
  const s = { linked_to: null };
3761
3729
  return (await t.updateTable("users").set(s).where("users.tenant_id", "=", e).where("users.user_id", "=", `${a}|${r}`).where("users.linked_to", "=", `${n}`).execute()).length === 1;
3762
3730
  };
3763
3731
  }
3764
- function Fs(t) {
3732
+ function Ls(t) {
3765
3733
  return {
3766
- create: Ya(t),
3767
- remove: Ms(t),
3768
- get: Ds(t),
3769
- list: Rs(t),
3770
- update: zs(t),
3734
+ create: Qa(t),
3735
+ remove: As(t),
3736
+ get: $s(t),
3737
+ list: Ps(t),
3738
+ update: Ms(t),
3771
3739
  // TODO - think about this more when other issues fixed
3772
- unlink: Us(t)
3740
+ unlink: Rs(t)
3773
3741
  };
3774
3742
  }
3775
- const Vs = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3743
+ const zs = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
3776
3744
  let Ke = (t = 21) => {
3777
3745
  let e = "", n = crypto.getRandomValues(new Uint8Array(t));
3778
3746
  for (; t--; )
3779
- e += Vs[n[t] & 63];
3747
+ e += zs[n[t] & 63];
3780
3748
  return e;
3781
3749
  };
3782
- function Bs(t) {
3750
+ function Us(t) {
3783
3751
  return async (e) => {
3784
3752
  const n = {
3785
3753
  id: e.id || Ke(),
@@ -3790,13 +3758,13 @@ function Bs(t) {
3790
3758
  return await t.insertInto("tenants").values(n).execute(), n;
3791
3759
  };
3792
3760
  }
3793
- function Ks(t) {
3761
+ function Fs(t) {
3794
3762
  return async (e) => {
3795
3763
  const n = await t.selectFrom("tenants").where("tenants.id", "=", e).selectAll().executeTakeFirst();
3796
- return n ? M(n) : null;
3764
+ return n ? R(n) : null;
3797
3765
  };
3798
3766
  }
3799
- function Js(t) {
3767
+ function Vs(t) {
3800
3768
  return async (e) => {
3801
3769
  let n = t.selectFrom("tenants");
3802
3770
  if (e.sort && e.sort.sort_by) {
@@ -3811,14 +3779,14 @@ function Js(t) {
3811
3779
  };
3812
3780
  const { count: s } = await n.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow(), o = Ee(s);
3813
3781
  return {
3814
- tenants: r.map(M),
3782
+ tenants: r.map(R),
3815
3783
  start: (e.page - 1) * e.per_page,
3816
3784
  limit: e.per_page,
3817
3785
  length: o
3818
3786
  };
3819
3787
  };
3820
3788
  }
3821
- function Ws(t) {
3789
+ function Bs(t) {
3822
3790
  return async (e, n) => {
3823
3791
  const a = {
3824
3792
  ...n,
@@ -3828,29 +3796,29 @@ function Ws(t) {
3828
3796
  await t.updateTable("tenants").set(a).where("id", "=", e).execute();
3829
3797
  };
3830
3798
  }
3831
- function qs(t) {
3799
+ function Ks(t) {
3832
3800
  return async (e) => (await t.deleteFrom("tenants").where("tenants.id", "=", e).execute()).length === 1;
3833
3801
  }
3834
- function Qs(t) {
3802
+ function Js(t) {
3835
3803
  return {
3836
- create: Bs(t),
3837
- get: Ks(t),
3838
- list: Js(t),
3839
- update: Ws(t),
3840
- remove: qs(t)
3804
+ create: Us(t),
3805
+ get: Fs(t),
3806
+ list: Vs(t),
3807
+ update: Bs(t),
3808
+ remove: Ks(t)
3841
3809
  };
3842
3810
  }
3843
- function qn(t) {
3811
+ function Wn(t) {
3844
3812
  return t ? JSON.stringify(t) : void 0;
3845
3813
  }
3846
- const Gs = 1024;
3847
- function Hs(t) {
3814
+ const Ws = 1024;
3815
+ function qs(t) {
3848
3816
  return async (e, n) => {
3849
3817
  var r, s, o;
3850
3818
  const a = {
3851
3819
  id: Ke(),
3852
3820
  ...n,
3853
- user_agent: n.user_agent.slice(0, Gs)
3821
+ user_agent: n.user_agent.slice(0, Ws)
3854
3822
  };
3855
3823
  return await t.insertInto("logs").values({
3856
3824
  ...a,
@@ -3859,12 +3827,12 @@ function Hs(t) {
3859
3827
  isMobile: n.isMobile ? 1 : 0,
3860
3828
  tenant_id: e,
3861
3829
  scope: (s = n.scope) == null ? void 0 : s.join(","),
3862
- auth0_client: qn(n.auth0_client),
3863
- details: (o = qn(n.details)) == null ? void 0 : o.substring(0, 8192)
3830
+ auth0_client: Wn(n.auth0_client),
3831
+ details: (o = Wn(n.details)) == null ? void 0 : o.substring(0, 8192)
3864
3832
  }).execute(), a;
3865
3833
  };
3866
3834
  }
3867
- function Qn(t) {
3835
+ function qn(t) {
3868
3836
  if (!t)
3869
3837
  return "";
3870
3838
  try {
@@ -3873,20 +3841,20 @@ function Qn(t) {
3873
3841
  return t;
3874
3842
  }
3875
3843
  }
3876
- function ga(t) {
3844
+ function pa(t) {
3877
3845
  return {
3878
3846
  ...t,
3879
3847
  client_id: t.client_id,
3880
3848
  client_name: "",
3881
- auth0_client: Qn(t.auth0_client),
3882
- details: Qn(t.details),
3849
+ auth0_client: qn(t.auth0_client),
3850
+ details: qn(t.details),
3883
3851
  isMobile: !!t.isMobile,
3884
3852
  scope: t.scope ? t.scope.split(",") : void 0,
3885
3853
  log_id: t.id,
3886
3854
  _id: t.id
3887
3855
  };
3888
3856
  }
3889
- function Ys(t) {
3857
+ function Qs(t) {
3890
3858
  return async (e, n) => {
3891
3859
  let a = t.selectFrom("logs").where("logs.tenant_id", "=", e);
3892
3860
  n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
@@ -3901,30 +3869,30 @@ function Ys(t) {
3901
3869
  r = r.offset(n.page * n.per_page).limit(n.per_page);
3902
3870
  const s = await r.selectAll().execute(), { count: o } = await a.select((d) => d.fn.countAll().as("count")).executeTakeFirstOrThrow();
3903
3871
  return {
3904
- logs: s.map(ga),
3872
+ logs: s.map(pa),
3905
3873
  start: n.page * n.per_page,
3906
3874
  limit: n.per_page,
3907
3875
  length: Ee(o)
3908
3876
  };
3909
3877
  };
3910
3878
  }
3911
- function Xs(t) {
3879
+ function Gs(t) {
3912
3880
  return async (e, n) => {
3913
3881
  const a = await t.selectFrom("logs").where("logs.tenant_id", "=", e).where("logs.id", "=", n).selectAll().executeTakeFirst();
3914
- return a ? ga(a) : null;
3882
+ return a ? pa(a) : null;
3915
3883
  };
3916
3884
  }
3917
- function ei(t) {
3885
+ function Hs(t) {
3918
3886
  return {
3919
- create: Hs(t),
3920
- list: Ys(t),
3921
- get: Xs(t)
3887
+ create: qs(t),
3888
+ list: Qs(t),
3889
+ get: Gs(t)
3922
3890
  };
3923
3891
  }
3924
- function ti(t) {
3892
+ function Ys(t) {
3925
3893
  return async (e, n) => await t.selectFrom("sessions").where("sessions.tenant_id", "=", e).where("sessions.session_id", "=", n).where("sessions.deleted_at", "is", null).selectAll().executeTakeFirst() ?? null;
3926
3894
  }
3927
- function ni(t) {
3895
+ function Xs(t) {
3928
3896
  return async (e, n) => {
3929
3897
  const a = {
3930
3898
  ...n,
@@ -3934,13 +3902,13 @@ function ni(t) {
3934
3902
  return await t.insertInto("sessions").values({ ...a, tenant_id: e }).execute(), { ...n, ...a };
3935
3903
  };
3936
3904
  }
3937
- function ai(t) {
3905
+ function ei(t) {
3938
3906
  return async (e, n) => !!(await t.updateTable("sessions").set({ deleted_at: (/* @__PURE__ */ new Date()).toISOString() }).where("tenant_id", "=", e).where("sessions.session_id", "=", n).where("sessions.deleted_at", "is", null).execute()).length;
3939
3907
  }
3940
- function ri(t) {
3908
+ function ti(t) {
3941
3909
  return async (e, n, a) => !!(await t.updateTable("sessions").set(a).where("tenant_id", "=", e).where("sessions.session_id", "=", n).where("sessions.deleted_at", "is", null).execute()).length;
3942
3910
  }
3943
- function si(t) {
3911
+ function ni(t) {
3944
3912
  return async (e, n) => {
3945
3913
  let a = t.selectFrom("sessions").where("sessions.tenant_id", "=", e);
3946
3914
  n.q && (a = Be(t, a, n.q, ["user_id", "session_id"]));
@@ -3962,22 +3930,22 @@ function si(t) {
3962
3930
  };
3963
3931
  };
3964
3932
  }
3965
- function ii(t) {
3933
+ function ai(t) {
3966
3934
  return {
3967
- create: ni(t),
3968
- get: ti(t),
3969
- list: si(t),
3970
- remove: ai(t),
3971
- update: ri(t)
3935
+ create: Xs(t),
3936
+ get: Ys(t),
3937
+ list: ni(t),
3938
+ remove: ei(t),
3939
+ update: ti(t)
3972
3940
  };
3973
3941
  }
3974
- function oi(t) {
3942
+ function ri(t) {
3975
3943
  return async (e, n) => {
3976
3944
  const a = await t.selectFrom("passwords").where("passwords.tenant_id", "=", e).where("passwords.user_id", "=", n).selectAll().executeTakeFirstOrThrow(), { tenant_id: r, ...s } = a;
3977
3945
  return s;
3978
3946
  };
3979
3947
  }
3980
- function di(t) {
3948
+ function si(t) {
3981
3949
  return async (e, n) => {
3982
3950
  const a = {
3983
3951
  ...n,
@@ -3990,20 +3958,20 @@ function di(t) {
3990
3958
  }).execute(), a;
3991
3959
  };
3992
3960
  }
3993
- function ci(t) {
3961
+ function ii(t) {
3994
3962
  return async (e, n) => (await t.updateTable("passwords").set({
3995
3963
  password: n.password,
3996
3964
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
3997
3965
  }).where("tenant_id", "=", e).where("user_id", "=", n.user_id).execute()).length === 1;
3998
3966
  }
3999
- function li(t) {
3967
+ function oi(t) {
4000
3968
  return {
4001
- create: di(t),
4002
- update: ci(t),
4003
- get: oi(t)
3969
+ create: si(t),
3970
+ update: ii(t),
3971
+ get: ri(t)
4004
3972
  };
4005
3973
  }
4006
- function ui(t) {
3974
+ function di(t) {
4007
3975
  return async (e, n) => {
4008
3976
  let a = t.selectFrom("codes").where("codes.tenant_id", "=", e);
4009
3977
  n.q && (a = Be(t, a, n.q, ["code", "login_id"]));
@@ -4011,7 +3979,7 @@ function ui(t) {
4011
3979
  return {
4012
3980
  codes: s.map((c) => {
4013
3981
  const { tenant_id: l, ...u } = c;
4014
- return vs.parse(M(u));
3982
+ return _s.parse(R(u));
4015
3983
  }),
4016
3984
  start: n.page * n.per_page,
4017
3985
  limit: n.per_page,
@@ -4019,7 +3987,7 @@ function ui(t) {
4019
3987
  };
4020
3988
  };
4021
3989
  }
4022
- function hi(t) {
3990
+ function ci(t) {
4023
3991
  return async (e, n) => {
4024
3992
  const a = {
4025
3993
  ...n,
@@ -4031,26 +3999,26 @@ function hi(t) {
4031
3999
  }).execute(), a;
4032
4000
  };
4033
4001
  }
4034
- function pi(t) {
4002
+ function li(t) {
4035
4003
  return async (e, n) => (await t.deleteFrom("codes").where("codes.tenant_id", "=", e).where("codes.code_id", "=", n).executeTakeFirst()).numDeletedRows > 0;
4036
4004
  }
4037
- function mi(t) {
4005
+ function ui(t) {
4038
4006
  return async (e, n, a) => {
4039
- let r = t.selectFrom("codes").where("codes.code_id", "=", n).where("codes.code_type", "=", a).where("codes.expires_at", ">", (/* @__PURE__ */ new Date()).toISOString());
4007
+ let r = t.selectFrom("codes").where("codes.code_id", "=", n).where("codes.code_type", "=", a);
4040
4008
  e.length && (r = r.where("codes.tenant_id", "=", e));
4041
4009
  const s = await r.selectAll().executeTakeFirst();
4042
- return s ? M(s) : null;
4010
+ return s ? R(s) : null;
4043
4011
  };
4044
4012
  }
4045
- function fi(t) {
4013
+ function hi(t) {
4046
4014
  return {
4047
- create: hi(t),
4048
- list: ui(t),
4049
- remove: pi(t),
4050
- get: mi(t)
4015
+ create: ci(t),
4016
+ list: di(t),
4017
+ remove: li(t),
4018
+ get: ui(t)
4051
4019
  };
4052
4020
  }
4053
- function _i(t) {
4021
+ function mi(t) {
4054
4022
  return async (e, n) => {
4055
4023
  const a = {
4056
4024
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4070,7 +4038,7 @@ function _i(t) {
4070
4038
  }).execute(), a;
4071
4039
  };
4072
4040
  }
4073
- function gi(t) {
4041
+ function pi(t) {
4074
4042
  return async (e) => ({
4075
4043
  applications: (await t.selectFrom("applications").where("applications.tenant_id", "=", e).selectAll().execute()).map((s) => ({
4076
4044
  ...s,
@@ -4084,10 +4052,10 @@ function gi(t) {
4084
4052
  }))
4085
4053
  });
4086
4054
  }
4087
- function yi(t) {
4055
+ function fi(t) {
4088
4056
  return async (e, n) => {
4089
4057
  const a = await t.selectFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", n).selectAll().executeTakeFirst();
4090
- return a ? M({
4058
+ return a ? R({
4091
4059
  ...a,
4092
4060
  disable_sign_ups: !!a.disable_sign_ups,
4093
4061
  addons: JSON.parse(a.addons),
@@ -4098,10 +4066,10 @@ function yi(t) {
4098
4066
  }) : null;
4099
4067
  };
4100
4068
  }
4101
- function vi(t) {
4069
+ function _i(t) {
4102
4070
  return async (e, n) => (await t.deleteFrom("applications").where("applications.tenant_id", "=", e).where("applications.id", "=", n).executeTakeFirst()).numDeletedRows > 0;
4103
4071
  }
4104
- function bi(t) {
4072
+ function gi(t) {
4105
4073
  return async (e, n, a) => {
4106
4074
  const r = {
4107
4075
  ...a,
@@ -4117,16 +4085,16 @@ function bi(t) {
4117
4085
  return await t.updateTable("applications").set(r).where("applications.id", "=", n).where("applications.tenant_id", "=", e).execute(), !0;
4118
4086
  };
4119
4087
  }
4120
- function wi(t) {
4088
+ function yi(t) {
4121
4089
  return {
4122
- create: _i(t),
4123
- list: gi(t),
4124
- get: yi(t),
4125
- remove: vi(t),
4126
- update: bi(t)
4090
+ create: mi(t),
4091
+ list: pi(t),
4092
+ get: fi(t),
4093
+ remove: _i(t),
4094
+ update: gi(t)
4127
4095
  };
4128
4096
  }
4129
- function xi(t) {
4097
+ function vi(t) {
4130
4098
  return async (e, n) => {
4131
4099
  const a = {
4132
4100
  id: Ke(),
@@ -4142,7 +4110,7 @@ function xi(t) {
4142
4110
  }).execute(), a;
4143
4111
  };
4144
4112
  }
4145
- function Ni(t, e) {
4113
+ function bi(t, e) {
4146
4114
  var n = {};
4147
4115
  for (var a in t) Object.prototype.hasOwnProperty.call(t, a) && e.indexOf(a) < 0 && (n[a] = t[a]);
4148
4116
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
@@ -4150,26 +4118,26 @@ function Ni(t, e) {
4150
4118
  e.indexOf(a[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, a[r]) && (n[a[r]] = t[a[r]]);
4151
4119
  return n;
4152
4120
  }
4153
- function ki(t, e) {
4121
+ function wi(t, e) {
4154
4122
  var n;
4155
4123
  return ((n = t == null ? void 0 : t._def) === null || n === void 0 ? void 0 : n.typeName) === e;
4156
4124
  }
4157
- function mt(t, e) {
4125
+ function pt(t, e) {
4158
4126
  const n = t.ZodType.prototype[e];
4159
4127
  t.ZodType.prototype[e] = function(...a) {
4160
4128
  const r = n.apply(this, a);
4161
4129
  return r._def.openapi = this._def.openapi, r;
4162
4130
  };
4163
4131
  }
4164
- function Ci(t) {
4132
+ function xi(t) {
4165
4133
  if (typeof t.ZodType.prototype.openapi < "u")
4166
4134
  return;
4167
4135
  t.ZodType.prototype.openapi = function(r, s) {
4168
4136
  var o, d, c, l, u, Z;
4169
- const R = typeof r == "string" ? s : r, W = R ?? {}, { param: _e } = W, Je = Ni(W, ["param"]), ge = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ye = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Je), !((l = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || l === void 0) && l.param || _e ? {
4137
+ const M = typeof r == "string" ? s : r, W = M ?? {}, { param: _e } = W, Je = bi(W, ["param"]), ge = Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o._internal), typeof r == "string" ? { refId: r } : void 0), ye = Object.assign(Object.assign(Object.assign({}, (d = this._def.openapi) === null || d === void 0 ? void 0 : d.metadata), Je), !((l = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || l === void 0) && l.param || _e ? {
4170
4138
  param: Object.assign(Object.assign({}, (Z = (u = this._def.openapi) === null || u === void 0 ? void 0 : u.metadata) === null || Z === void 0 ? void 0 : Z.param), _e)
4171
4139
  } : void 0), ve = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(ge).length > 0 ? { _internal: ge } : void 0), Object.keys(ye).length > 0 ? { metadata: ye } : void 0) }));
4172
- if (ki(this, "ZodObject")) {
4140
+ if (wi(this, "ZodObject")) {
4173
4141
  const We = this.extend;
4174
4142
  ve.extend = function(...qe) {
4175
4143
  var ee, te, ne, be, $e, Pe;
@@ -4183,7 +4151,7 @@ function Ci(t) {
4183
4151
  };
4184
4152
  }
4185
4153
  return ve;
4186
- }, mt(t, "optional"), mt(t, "nullable"), mt(t, "default"), mt(t, "transform"), mt(t, "refine");
4154
+ }, pt(t, "optional"), pt(t, "nullable"), pt(t, "default"), pt(t, "transform"), pt(t, "refine");
4187
4155
  const e = t.ZodObject.prototype.deepPartial;
4188
4156
  t.ZodObject.prototype.deepPartial = function() {
4189
4157
  const r = this._def.shape(), s = e.apply(this), o = s._def.shape();
@@ -4290,7 +4258,7 @@ const y = $.arrayToEnum([
4290
4258
  default:
4291
4259
  return y.unknown;
4292
4260
  }
4293
- }, p = $.arrayToEnum([
4261
+ }, m = $.arrayToEnum([
4294
4262
  "invalid_type",
4295
4263
  "invalid_literal",
4296
4264
  "custom",
@@ -4307,7 +4275,7 @@ const y = $.arrayToEnum([
4307
4275
  "invalid_intersection_types",
4308
4276
  "not_multiple_of",
4309
4277
  "not_finite"
4310
- ]), Ti = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
4278
+ ]), Ni = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
4311
4279
  class J extends Error {
4312
4280
  constructor(e) {
4313
4281
  super(), this.issues = [], this.addIssue = (a) => {
@@ -4371,52 +4339,52 @@ J.create = (t) => new J(t);
4371
4339
  const dt = (t, e) => {
4372
4340
  let n;
4373
4341
  switch (t.code) {
4374
- case p.invalid_type:
4342
+ case m.invalid_type:
4375
4343
  t.received === y.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
4376
4344
  break;
4377
- case p.invalid_literal:
4345
+ case m.invalid_literal:
4378
4346
  n = `Invalid literal value, expected ${JSON.stringify(t.expected, $.jsonStringifyReplacer)}`;
4379
4347
  break;
4380
- case p.unrecognized_keys:
4348
+ case m.unrecognized_keys:
4381
4349
  n = `Unrecognized key(s) in object: ${$.joinValues(t.keys, ", ")}`;
4382
4350
  break;
4383
- case p.invalid_union:
4351
+ case m.invalid_union:
4384
4352
  n = "Invalid input";
4385
4353
  break;
4386
- case p.invalid_union_discriminator:
4354
+ case m.invalid_union_discriminator:
4387
4355
  n = `Invalid discriminator value. Expected ${$.joinValues(t.options)}`;
4388
4356
  break;
4389
- case p.invalid_enum_value:
4357
+ case m.invalid_enum_value:
4390
4358
  n = `Invalid enum value. Expected ${$.joinValues(t.options)}, received '${t.received}'`;
4391
4359
  break;
4392
- case p.invalid_arguments:
4360
+ case m.invalid_arguments:
4393
4361
  n = "Invalid function arguments";
4394
4362
  break;
4395
- case p.invalid_return_type:
4363
+ case m.invalid_return_type:
4396
4364
  n = "Invalid function return type";
4397
4365
  break;
4398
- case p.invalid_date:
4366
+ case m.invalid_date:
4399
4367
  n = "Invalid date";
4400
4368
  break;
4401
- case p.invalid_string:
4369
+ case m.invalid_string:
4402
4370
  typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` : $.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
4403
4371
  break;
4404
- case p.too_small:
4372
+ case m.too_small:
4405
4373
  t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : n = "Invalid input";
4406
4374
  break;
4407
- case p.too_big:
4375
+ case m.too_big:
4408
4376
  t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "less than"} ${t.maximum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "under"} ${t.maximum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "bigint" ? n = `BigInt must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly" : t.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(t.maximum))}` : n = "Invalid input";
4409
4377
  break;
4410
- case p.custom:
4378
+ case m.custom:
4411
4379
  n = "Invalid input";
4412
4380
  break;
4413
- case p.invalid_intersection_types:
4381
+ case m.invalid_intersection_types:
4414
4382
  n = "Intersection results could not be merged";
4415
4383
  break;
4416
- case p.not_multiple_of:
4384
+ case m.not_multiple_of:
4417
4385
  n = `Number must be a multiple of ${t.multipleOf}`;
4418
4386
  break;
4419
- case p.not_finite:
4387
+ case m.not_finite:
4420
4388
  n = "Number must be finite";
4421
4389
  break;
4422
4390
  default:
@@ -4424,12 +4392,12 @@ const dt = (t, e) => {
4424
4392
  }
4425
4393
  return { message: n };
4426
4394
  };
4427
- let ya = dt;
4428
- function Oi(t) {
4429
- ya = t;
4395
+ let fa = dt;
4396
+ function ki(t) {
4397
+ fa = t;
4430
4398
  }
4431
4399
  function ln() {
4432
- return ya;
4400
+ return fa;
4433
4401
  }
4434
4402
  const un = (t) => {
4435
4403
  const { data: e, path: n, errorMaps: a, issueData: r } = t, s = [...n, ...r.path || []], o = {
@@ -4451,7 +4419,7 @@ const un = (t) => {
4451
4419
  path: s,
4452
4420
  message: d
4453
4421
  };
4454
- }, Si = [];
4422
+ }, Ci = [];
4455
4423
  function _(t, e) {
4456
4424
  const n = ln(), a = un({
4457
4425
  issueData: e,
@@ -4515,7 +4483,7 @@ function hn(t, e, n, a) {
4515
4483
  if (typeof e == "function" ? t !== e || !a : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4516
4484
  return e.get(t);
4517
4485
  }
4518
- function va(t, e, n, a, r) {
4486
+ function _a(t, e, n, a, r) {
4519
4487
  if (typeof e == "function" ? t !== e || !r : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
4520
4488
  return e.set(t, n), n;
4521
4489
  }
@@ -4532,7 +4500,7 @@ class de {
4532
4500
  return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
4533
4501
  }
4534
4502
  }
4535
- const Gn = (t, e) => {
4503
+ const Qn = (t, e) => {
4536
4504
  if (At(e))
4537
4505
  return { success: !0, data: e.value };
4538
4506
  if (!t.common.issues.length)
@@ -4622,7 +4590,7 @@ class I {
4622
4590
  data: e,
4623
4591
  parsedType: Ne(e)
4624
4592
  }, s = this._parseSync({ data: e, path: r.path, parent: r });
4625
- return Gn(r, s);
4593
+ return Qn(r, s);
4626
4594
  }
4627
4595
  async parseAsync(e, n) {
4628
4596
  const a = await this.safeParseAsync(e, n);
@@ -4643,13 +4611,13 @@ class I {
4643
4611
  data: e,
4644
4612
  parsedType: Ne(e)
4645
4613
  }, r = this._parse({ data: e, path: a.path, parent: a }), s = await (Dt(r) ? r : Promise.resolve(r));
4646
- return Gn(a, s);
4614
+ return Qn(a, s);
4647
4615
  }
4648
4616
  refine(e, n) {
4649
4617
  const a = (r) => typeof n == "string" || typeof n > "u" ? { message: n } : typeof n == "function" ? n(r) : n;
4650
4618
  return this._refinement((r, s) => {
4651
4619
  const o = e(r), d = () => s.addIssue({
4652
- code: p.custom,
4620
+ code: m.custom,
4653
4621
  ...a(r)
4654
4622
  });
4655
4623
  return typeof Promise < "u" && o instanceof Promise ? o.then((c) => c ? !0 : (d(), !1)) : o ? !0 : (d(), !1);
@@ -4707,7 +4675,7 @@ class I {
4707
4675
  });
4708
4676
  }
4709
4677
  brand() {
4710
- return new Bn({
4678
+ return new Vn({
4711
4679
  typeName: N.ZodBranded,
4712
4680
  type: this,
4713
4681
  ...S(this._def)
@@ -4742,30 +4710,30 @@ class I {
4742
4710
  return this.safeParse(null).success;
4743
4711
  }
4744
4712
  }
4745
- const ji = /^c[^\s-]{8,}$/i, Ii = /^[0-9a-z]+$/, Zi = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ei = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, $i = /^[a-z0-9_-]{21}$/i, Pi = /^[-+]?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)?)??$/, Ai = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Di = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
4713
+ const Ti = /^c[^\s-]{8,}$/i, Oi = /^[0-9a-z]+$/, Si = /^[0-9A-HJKMNP-TV-Z]{26}$/, ji = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ii = /^[a-z0-9_-]{21}$/i, Zi = /^[-+]?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)?)??$/, Ei = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, $i = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
4746
4714
  let xn;
4747
- const Ri = /^(?:(?: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])$/, Mi = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Li = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ba = "((\\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])))", zi = new RegExp(`^${ba}$`);
4748
- function wa(t) {
4715
+ const Pi = /^(?:(?: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])$/, Ai = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Di = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ga = "((\\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])))", Mi = new RegExp(`^${ga}$`);
4716
+ function ya(t) {
4749
4717
  let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
4750
4718
  return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
4751
4719
  }
4752
- function Ui(t) {
4753
- return new RegExp(`^${wa(t)}$`);
4720
+ function Ri(t) {
4721
+ return new RegExp(`^${ya(t)}$`);
4754
4722
  }
4755
- function xa(t) {
4756
- let e = `${ba}T${wa(t)}`;
4723
+ function va(t) {
4724
+ let e = `${ga}T${ya(t)}`;
4757
4725
  const n = [];
4758
4726
  return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
4759
4727
  }
4760
- function Fi(t, e) {
4761
- return !!((e === "v4" || !e) && Ri.test(t) || (e === "v6" || !e) && Mi.test(t));
4728
+ function Li(t, e) {
4729
+ return !!((e === "v4" || !e) && Pi.test(t) || (e === "v6" || !e) && Ai.test(t));
4762
4730
  }
4763
4731
  class Q extends I {
4764
4732
  _parse(e) {
4765
4733
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== y.string) {
4766
4734
  const s = this._getOrReturnCtx(e);
4767
4735
  return _(s, {
4768
- code: p.invalid_type,
4736
+ code: m.invalid_type,
4769
4737
  expected: y.string,
4770
4738
  received: s.parsedType
4771
4739
  }), k;
@@ -4775,7 +4743,7 @@ class Q extends I {
4775
4743
  for (const s of this._def.checks)
4776
4744
  if (s.kind === "min")
4777
4745
  e.data.length < s.value && (r = this._getOrReturnCtx(e, r), _(r, {
4778
- code: p.too_small,
4746
+ code: m.too_small,
4779
4747
  minimum: s.value,
4780
4748
  type: "string",
4781
4749
  inclusive: !0,
@@ -4784,7 +4752,7 @@ class Q extends I {
4784
4752
  }), a.dirty());
4785
4753
  else if (s.kind === "max")
4786
4754
  e.data.length > s.value && (r = this._getOrReturnCtx(e, r), _(r, {
4787
- code: p.too_big,
4755
+ code: m.too_big,
4788
4756
  maximum: s.value,
4789
4757
  type: "string",
4790
4758
  inclusive: !0,
@@ -4794,14 +4762,14 @@ class Q extends I {
4794
4762
  else if (s.kind === "length") {
4795
4763
  const o = e.data.length > s.value, d = e.data.length < s.value;
4796
4764
  (o || d) && (r = this._getOrReturnCtx(e, r), o ? _(r, {
4797
- code: p.too_big,
4765
+ code: m.too_big,
4798
4766
  maximum: s.value,
4799
4767
  type: "string",
4800
4768
  inclusive: !0,
4801
4769
  exact: !0,
4802
4770
  message: s.message
4803
4771
  }) : d && _(r, {
4804
- code: p.too_small,
4772
+ code: m.too_small,
4805
4773
  minimum: s.value,
4806
4774
  type: "string",
4807
4775
  inclusive: !0,
@@ -4809,45 +4777,45 @@ class Q extends I {
4809
4777
  message: s.message
4810
4778
  }), a.dirty());
4811
4779
  } else if (s.kind === "email")
4812
- Ai.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4780
+ Ei.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4813
4781
  validation: "email",
4814
- code: p.invalid_string,
4782
+ code: m.invalid_string,
4815
4783
  message: s.message
4816
4784
  }), a.dirty());
4817
4785
  else if (s.kind === "emoji")
4818
- xn || (xn = new RegExp(Di, "u")), xn.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4786
+ xn || (xn = new RegExp($i, "u")), xn.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4819
4787
  validation: "emoji",
4820
- code: p.invalid_string,
4788
+ code: m.invalid_string,
4821
4789
  message: s.message
4822
4790
  }), a.dirty());
4823
4791
  else if (s.kind === "uuid")
4824
- Ei.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4792
+ ji.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4825
4793
  validation: "uuid",
4826
- code: p.invalid_string,
4794
+ code: m.invalid_string,
4827
4795
  message: s.message
4828
4796
  }), a.dirty());
4829
4797
  else if (s.kind === "nanoid")
4830
- $i.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4798
+ Ii.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4831
4799
  validation: "nanoid",
4832
- code: p.invalid_string,
4800
+ code: m.invalid_string,
4833
4801
  message: s.message
4834
4802
  }), a.dirty());
4835
4803
  else if (s.kind === "cuid")
4836
- ji.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4804
+ Ti.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4837
4805
  validation: "cuid",
4838
- code: p.invalid_string,
4806
+ code: m.invalid_string,
4839
4807
  message: s.message
4840
4808
  }), a.dirty());
4841
4809
  else if (s.kind === "cuid2")
4842
- Ii.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4810
+ Oi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4843
4811
  validation: "cuid2",
4844
- code: p.invalid_string,
4812
+ code: m.invalid_string,
4845
4813
  message: s.message
4846
4814
  }), a.dirty());
4847
4815
  else if (s.kind === "ulid")
4848
- Zi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4816
+ Si.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4849
4817
  validation: "ulid",
4850
- code: p.invalid_string,
4818
+ code: m.invalid_string,
4851
4819
  message: s.message
4852
4820
  }), a.dirty());
4853
4821
  else if (s.kind === "url")
@@ -4856,49 +4824,49 @@ class Q extends I {
4856
4824
  } catch {
4857
4825
  r = this._getOrReturnCtx(e, r), _(r, {
4858
4826
  validation: "url",
4859
- code: p.invalid_string,
4827
+ code: m.invalid_string,
4860
4828
  message: s.message
4861
4829
  }), a.dirty();
4862
4830
  }
4863
4831
  else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4864
4832
  validation: "regex",
4865
- code: p.invalid_string,
4833
+ code: m.invalid_string,
4866
4834
  message: s.message
4867
4835
  }), a.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (r = this._getOrReturnCtx(e, r), _(r, {
4868
- code: p.invalid_string,
4836
+ code: m.invalid_string,
4869
4837
  validation: { includes: s.value, position: s.position },
4870
4838
  message: s.message
4871
4839
  }), a.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (r = this._getOrReturnCtx(e, r), _(r, {
4872
- code: p.invalid_string,
4840
+ code: m.invalid_string,
4873
4841
  validation: { startsWith: s.value },
4874
4842
  message: s.message
4875
4843
  }), a.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (r = this._getOrReturnCtx(e, r), _(r, {
4876
- code: p.invalid_string,
4844
+ code: m.invalid_string,
4877
4845
  validation: { endsWith: s.value },
4878
4846
  message: s.message
4879
- }), a.dirty()) : s.kind === "datetime" ? xa(s).test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4880
- code: p.invalid_string,
4847
+ }), a.dirty()) : s.kind === "datetime" ? va(s).test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4848
+ code: m.invalid_string,
4881
4849
  validation: "datetime",
4882
4850
  message: s.message
4883
- }), a.dirty()) : s.kind === "date" ? zi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4884
- code: p.invalid_string,
4851
+ }), a.dirty()) : s.kind === "date" ? Mi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4852
+ code: m.invalid_string,
4885
4853
  validation: "date",
4886
4854
  message: s.message
4887
- }), a.dirty()) : s.kind === "time" ? Ui(s).test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4888
- code: p.invalid_string,
4855
+ }), a.dirty()) : s.kind === "time" ? Ri(s).test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4856
+ code: m.invalid_string,
4889
4857
  validation: "time",
4890
4858
  message: s.message
4891
- }), a.dirty()) : s.kind === "duration" ? Pi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4859
+ }), a.dirty()) : s.kind === "duration" ? Zi.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4892
4860
  validation: "duration",
4893
- code: p.invalid_string,
4861
+ code: m.invalid_string,
4894
4862
  message: s.message
4895
- }), a.dirty()) : s.kind === "ip" ? Fi(e.data, s.version) || (r = this._getOrReturnCtx(e, r), _(r, {
4863
+ }), a.dirty()) : s.kind === "ip" ? Li(e.data, s.version) || (r = this._getOrReturnCtx(e, r), _(r, {
4896
4864
  validation: "ip",
4897
- code: p.invalid_string,
4865
+ code: m.invalid_string,
4898
4866
  message: s.message
4899
- }), a.dirty()) : s.kind === "base64" ? Li.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4867
+ }), a.dirty()) : s.kind === "base64" ? Di.test(e.data) || (r = this._getOrReturnCtx(e, r), _(r, {
4900
4868
  validation: "base64",
4901
- code: p.invalid_string,
4869
+ code: m.invalid_string,
4902
4870
  message: s.message
4903
4871
  }), a.dirty()) : $.assertNever(s);
4904
4872
  return { status: a.value, value: e.data };
@@ -4906,7 +4874,7 @@ class Q extends I {
4906
4874
  _regex(e, n, a) {
4907
4875
  return this.refinement((r) => e.test(r), {
4908
4876
  validation: n,
4909
- code: p.invalid_string,
4877
+ code: m.invalid_string,
4910
4878
  ...w.errToObj(a)
4911
4879
  });
4912
4880
  }
@@ -5118,7 +5086,7 @@ Q.create = (t) => {
5118
5086
  ...S(t)
5119
5087
  });
5120
5088
  };
5121
- function Vi(t, e) {
5089
+ function zi(t, e) {
5122
5090
  const n = (t.toString().split(".")[1] || "").length, a = (e.toString().split(".")[1] || "").length, r = n > a ? n : a, s = parseInt(t.toFixed(r).replace(".", "")), o = parseInt(e.toFixed(r).replace(".", ""));
5123
5091
  return s % o / Math.pow(10, r);
5124
5092
  }
@@ -5130,7 +5098,7 @@ class Se extends I {
5130
5098
  if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== y.number) {
5131
5099
  const s = this._getOrReturnCtx(e);
5132
5100
  return _(s, {
5133
- code: p.invalid_type,
5101
+ code: m.invalid_type,
5134
5102
  expected: y.number,
5135
5103
  received: s.parsedType
5136
5104
  }), k;
@@ -5139,30 +5107,30 @@ class Se extends I {
5139
5107
  const r = new F();
5140
5108
  for (const s of this._def.checks)
5141
5109
  s.kind === "int" ? $.isInteger(e.data) || (a = this._getOrReturnCtx(e, a), _(a, {
5142
- code: p.invalid_type,
5110
+ code: m.invalid_type,
5143
5111
  expected: "integer",
5144
5112
  received: "float",
5145
5113
  message: s.message
5146
5114
  }), r.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (a = this._getOrReturnCtx(e, a), _(a, {
5147
- code: p.too_small,
5115
+ code: m.too_small,
5148
5116
  minimum: s.value,
5149
5117
  type: "number",
5150
5118
  inclusive: s.inclusive,
5151
5119
  exact: !1,
5152
5120
  message: s.message
5153
5121
  }), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (a = this._getOrReturnCtx(e, a), _(a, {
5154
- code: p.too_big,
5122
+ code: m.too_big,
5155
5123
  maximum: s.value,
5156
5124
  type: "number",
5157
5125
  inclusive: s.inclusive,
5158
5126
  exact: !1,
5159
5127
  message: s.message
5160
- }), r.dirty()) : s.kind === "multipleOf" ? Vi(e.data, s.value) !== 0 && (a = this._getOrReturnCtx(e, a), _(a, {
5161
- code: p.not_multiple_of,
5128
+ }), r.dirty()) : s.kind === "multipleOf" ? zi(e.data, s.value) !== 0 && (a = this._getOrReturnCtx(e, a), _(a, {
5129
+ code: m.not_multiple_of,
5162
5130
  multipleOf: s.value,
5163
5131
  message: s.message
5164
5132
  }), r.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (a = this._getOrReturnCtx(e, a), _(a, {
5165
- code: p.not_finite,
5133
+ code: m.not_finite,
5166
5134
  message: s.message
5167
5135
  }), r.dirty()) : $.assertNever(s);
5168
5136
  return { status: r.value, value: e.data };
@@ -5302,7 +5270,7 @@ class je extends I {
5302
5270
  if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== y.bigint) {
5303
5271
  const s = this._getOrReturnCtx(e);
5304
5272
  return _(s, {
5305
- code: p.invalid_type,
5273
+ code: m.invalid_type,
5306
5274
  expected: y.bigint,
5307
5275
  received: s.parsedType
5308
5276
  }), k;
@@ -5311,19 +5279,19 @@ class je extends I {
5311
5279
  const r = new F();
5312
5280
  for (const s of this._def.checks)
5313
5281
  s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (a = this._getOrReturnCtx(e, a), _(a, {
5314
- code: p.too_small,
5282
+ code: m.too_small,
5315
5283
  type: "bigint",
5316
5284
  minimum: s.value,
5317
5285
  inclusive: s.inclusive,
5318
5286
  message: s.message
5319
5287
  }), r.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (a = this._getOrReturnCtx(e, a), _(a, {
5320
- code: p.too_big,
5288
+ code: m.too_big,
5321
5289
  type: "bigint",
5322
5290
  maximum: s.value,
5323
5291
  inclusive: s.inclusive,
5324
5292
  message: s.message
5325
5293
  }), r.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (a = this._getOrReturnCtx(e, a), _(a, {
5326
- code: p.not_multiple_of,
5294
+ code: m.not_multiple_of,
5327
5295
  multipleOf: s.value,
5328
5296
  message: s.message
5329
5297
  }), r.dirty()) : $.assertNever(s);
@@ -5422,12 +5390,12 @@ je.create = (t) => {
5422
5390
  ...S(t)
5423
5391
  });
5424
5392
  };
5425
- class Rt extends I {
5393
+ class Mt extends I {
5426
5394
  _parse(e) {
5427
5395
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== y.boolean) {
5428
5396
  const a = this._getOrReturnCtx(e);
5429
5397
  return _(a, {
5430
- code: p.invalid_type,
5398
+ code: m.invalid_type,
5431
5399
  expected: y.boolean,
5432
5400
  received: a.parsedType
5433
5401
  }), k;
@@ -5435,7 +5403,7 @@ class Rt extends I {
5435
5403
  return B(e.data);
5436
5404
  }
5437
5405
  }
5438
- Rt.create = (t) => new Rt({
5406
+ Mt.create = (t) => new Mt({
5439
5407
  typeName: N.ZodBoolean,
5440
5408
  coerce: (t == null ? void 0 : t.coerce) || !1,
5441
5409
  ...S(t)
@@ -5445,7 +5413,7 @@ class Fe extends I {
5445
5413
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== y.date) {
5446
5414
  const s = this._getOrReturnCtx(e);
5447
5415
  return _(s, {
5448
- code: p.invalid_type,
5416
+ code: m.invalid_type,
5449
5417
  expected: y.date,
5450
5418
  received: s.parsedType
5451
5419
  }), k;
@@ -5453,21 +5421,21 @@ class Fe extends I {
5453
5421
  if (isNaN(e.data.getTime())) {
5454
5422
  const s = this._getOrReturnCtx(e);
5455
5423
  return _(s, {
5456
- code: p.invalid_date
5424
+ code: m.invalid_date
5457
5425
  }), k;
5458
5426
  }
5459
5427
  const a = new F();
5460
5428
  let r;
5461
5429
  for (const s of this._def.checks)
5462
5430
  s.kind === "min" ? e.data.getTime() < s.value && (r = this._getOrReturnCtx(e, r), _(r, {
5463
- code: p.too_small,
5431
+ code: m.too_small,
5464
5432
  message: s.message,
5465
5433
  inclusive: !0,
5466
5434
  exact: !1,
5467
5435
  minimum: s.value,
5468
5436
  type: "date"
5469
5437
  }), a.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (r = this._getOrReturnCtx(e, r), _(r, {
5470
- code: p.too_big,
5438
+ code: m.too_big,
5471
5439
  message: s.message,
5472
5440
  inclusive: !0,
5473
5441
  exact: !1,
@@ -5518,12 +5486,12 @@ Fe.create = (t) => new Fe({
5518
5486
  typeName: N.ZodDate,
5519
5487
  ...S(t)
5520
5488
  });
5521
- class pn extends I {
5489
+ class mn extends I {
5522
5490
  _parse(e) {
5523
5491
  if (this._getType(e) !== y.symbol) {
5524
5492
  const a = this._getOrReturnCtx(e);
5525
5493
  return _(a, {
5526
- code: p.invalid_type,
5494
+ code: m.invalid_type,
5527
5495
  expected: y.symbol,
5528
5496
  received: a.parsedType
5529
5497
  }), k;
@@ -5531,16 +5499,16 @@ class pn extends I {
5531
5499
  return B(e.data);
5532
5500
  }
5533
5501
  }
5534
- pn.create = (t) => new pn({
5502
+ mn.create = (t) => new mn({
5535
5503
  typeName: N.ZodSymbol,
5536
5504
  ...S(t)
5537
5505
  });
5538
- class Mt extends I {
5506
+ class Rt extends I {
5539
5507
  _parse(e) {
5540
5508
  if (this._getType(e) !== y.undefined) {
5541
5509
  const a = this._getOrReturnCtx(e);
5542
5510
  return _(a, {
5543
- code: p.invalid_type,
5511
+ code: m.invalid_type,
5544
5512
  expected: y.undefined,
5545
5513
  received: a.parsedType
5546
5514
  }), k;
@@ -5548,7 +5516,7 @@ class Mt extends I {
5548
5516
  return B(e.data);
5549
5517
  }
5550
5518
  }
5551
- Mt.create = (t) => new Mt({
5519
+ Rt.create = (t) => new Rt({
5552
5520
  typeName: N.ZodUndefined,
5553
5521
  ...S(t)
5554
5522
  });
@@ -5557,7 +5525,7 @@ class Lt extends I {
5557
5525
  if (this._getType(e) !== y.null) {
5558
5526
  const a = this._getOrReturnCtx(e);
5559
5527
  return _(a, {
5560
- code: p.invalid_type,
5528
+ code: m.invalid_type,
5561
5529
  expected: y.null,
5562
5530
  received: a.parsedType
5563
5531
  }), k;
@@ -5597,7 +5565,7 @@ class fe extends I {
5597
5565
  _parse(e) {
5598
5566
  const n = this._getOrReturnCtx(e);
5599
5567
  return _(n, {
5600
- code: p.invalid_type,
5568
+ code: m.invalid_type,
5601
5569
  expected: y.never,
5602
5570
  received: n.parsedType
5603
5571
  }), k;
@@ -5607,12 +5575,12 @@ fe.create = (t) => new fe({
5607
5575
  typeName: N.ZodNever,
5608
5576
  ...S(t)
5609
5577
  });
5610
- class mn extends I {
5578
+ class pn extends I {
5611
5579
  _parse(e) {
5612
5580
  if (this._getType(e) !== y.undefined) {
5613
5581
  const a = this._getOrReturnCtx(e);
5614
5582
  return _(a, {
5615
- code: p.invalid_type,
5583
+ code: m.invalid_type,
5616
5584
  expected: y.void,
5617
5585
  received: a.parsedType
5618
5586
  }), k;
@@ -5620,7 +5588,7 @@ class mn extends I {
5620
5588
  return B(e.data);
5621
5589
  }
5622
5590
  }
5623
- mn.create = (t) => new mn({
5591
+ pn.create = (t) => new pn({
5624
5592
  typeName: N.ZodVoid,
5625
5593
  ...S(t)
5626
5594
  });
@@ -5629,14 +5597,14 @@ class H extends I {
5629
5597
  const { ctx: n, status: a } = this._processInputParams(e), r = this._def;
5630
5598
  if (n.parsedType !== y.array)
5631
5599
  return _(n, {
5632
- code: p.invalid_type,
5600
+ code: m.invalid_type,
5633
5601
  expected: y.array,
5634
5602
  received: n.parsedType
5635
5603
  }), k;
5636
5604
  if (r.exactLength !== null) {
5637
5605
  const o = n.data.length > r.exactLength.value, d = n.data.length < r.exactLength.value;
5638
5606
  (o || d) && (_(n, {
5639
- code: o ? p.too_big : p.too_small,
5607
+ code: o ? m.too_big : m.too_small,
5640
5608
  minimum: d ? r.exactLength.value : void 0,
5641
5609
  maximum: o ? r.exactLength.value : void 0,
5642
5610
  type: "array",
@@ -5646,14 +5614,14 @@ class H extends I {
5646
5614
  }), a.dirty());
5647
5615
  }
5648
5616
  if (r.minLength !== null && n.data.length < r.minLength.value && (_(n, {
5649
- code: p.too_small,
5617
+ code: m.too_small,
5650
5618
  minimum: r.minLength.value,
5651
5619
  type: "array",
5652
5620
  inclusive: !0,
5653
5621
  exact: !1,
5654
5622
  message: r.minLength.message
5655
5623
  }), a.dirty()), r.maxLength !== null && n.data.length > r.maxLength.value && (_(n, {
5656
- code: p.too_big,
5624
+ code: m.too_big,
5657
5625
  maximum: r.maxLength.value,
5658
5626
  type: "array",
5659
5627
  inclusive: !0,
@@ -5727,7 +5695,7 @@ class D extends I {
5727
5695
  if (this._getType(e) !== y.object) {
5728
5696
  const l = this._getOrReturnCtx(e);
5729
5697
  return _(l, {
5730
- code: p.invalid_type,
5698
+ code: m.invalid_type,
5731
5699
  expected: y.object,
5732
5700
  received: l.parsedType
5733
5701
  }), k;
@@ -5755,7 +5723,7 @@ class D extends I {
5755
5723
  });
5756
5724
  else if (l === "strict")
5757
5725
  d.length > 0 && (_(r, {
5758
- code: p.unrecognized_keys,
5726
+ code: m.unrecognized_keys,
5759
5727
  keys: d
5760
5728
  }), a.dirty());
5761
5729
  else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
@@ -5776,10 +5744,10 @@ class D extends I {
5776
5744
  return r.common.async ? Promise.resolve().then(async () => {
5777
5745
  const l = [];
5778
5746
  for (const u of c) {
5779
- const Z = await u.key, R = await u.value;
5747
+ const Z = await u.key, M = await u.value;
5780
5748
  l.push({
5781
5749
  key: Z,
5782
- value: R,
5750
+ value: M,
5783
5751
  alwaysSet: u.alwaysSet
5784
5752
  });
5785
5753
  }
@@ -5976,7 +5944,7 @@ class D extends I {
5976
5944
  });
5977
5945
  }
5978
5946
  keyof() {
5979
- return Na($.objectKeys(this.shape));
5947
+ return ba($.objectKeys(this.shape));
5980
5948
  }
5981
5949
  }
5982
5950
  D.create = (t, e) => new D({
@@ -6012,7 +5980,7 @@ class zt extends I {
6012
5980
  return n.common.issues.push(...d.ctx.common.issues), d.result;
6013
5981
  const o = s.map((d) => new J(d.ctx.common.issues));
6014
5982
  return _(n, {
6015
- code: p.invalid_union,
5983
+ code: m.invalid_union,
6016
5984
  unionErrors: o
6017
5985
  }), k;
6018
5986
  }
@@ -6059,7 +6027,7 @@ class zt extends I {
6059
6027
  return n.common.issues.push(...s.ctx.common.issues), s.result;
6060
6028
  const d = o.map((c) => new J(c));
6061
6029
  return _(n, {
6062
- code: p.invalid_union,
6030
+ code: m.invalid_union,
6063
6031
  unionErrors: d
6064
6032
  }), k;
6065
6033
  }
@@ -6073,13 +6041,13 @@ zt.create = (t, e) => new zt({
6073
6041
  typeName: N.ZodUnion,
6074
6042
  ...S(e)
6075
6043
  });
6076
- const le = (t) => t instanceof Vt ? le(t.schema) : t instanceof X ? le(t.innerType()) : t instanceof Bt ? [t.value] : t instanceof Ie ? t.options : t instanceof Kt ? $.objectValues(t.enum) : t instanceof Jt ? le(t._def.innerType) : t instanceof Mt ? [void 0] : t instanceof Lt ? [null] : t instanceof se ? [void 0, ...le(t.unwrap())] : t instanceof Ze ? [null, ...le(t.unwrap())] : t instanceof Bn || t instanceof qt ? le(t.unwrap()) : t instanceof Wt ? le(t._def.innerType) : [];
6044
+ const le = (t) => t instanceof Vt ? le(t.schema) : t instanceof X ? le(t.innerType()) : t instanceof Bt ? [t.value] : t instanceof Ie ? t.options : t instanceof Kt ? $.objectValues(t.enum) : t instanceof Jt ? le(t._def.innerType) : t instanceof Rt ? [void 0] : t instanceof Lt ? [null] : t instanceof se ? [void 0, ...le(t.unwrap())] : t instanceof Ze ? [null, ...le(t.unwrap())] : t instanceof Vn || t instanceof qt ? le(t.unwrap()) : t instanceof Wt ? le(t._def.innerType) : [];
6077
6045
  class vn extends I {
6078
6046
  _parse(e) {
6079
6047
  const { ctx: n } = this._processInputParams(e);
6080
6048
  if (n.parsedType !== y.object)
6081
6049
  return _(n, {
6082
- code: p.invalid_type,
6050
+ code: m.invalid_type,
6083
6051
  expected: y.object,
6084
6052
  received: n.parsedType
6085
6053
  }), k;
@@ -6093,7 +6061,7 @@ class vn extends I {
6093
6061
  path: n.path,
6094
6062
  parent: n
6095
6063
  }) : (_(n, {
6096
- code: p.invalid_union_discriminator,
6064
+ code: m.invalid_union_discriminator,
6097
6065
  options: Array.from(this.optionsMap.keys()),
6098
6066
  path: [a]
6099
6067
  }), k);
@@ -6169,7 +6137,7 @@ class Ut extends I {
6169
6137
  return k;
6170
6138
  const d = Pn(s.value, o.value);
6171
6139
  return d.valid ? (($n(s) || $n(o)) && n.dirty(), { status: n.value, value: d.data }) : (_(a, {
6172
- code: p.invalid_intersection_types
6140
+ code: m.invalid_intersection_types
6173
6141
  }), k);
6174
6142
  };
6175
6143
  return a.common.async ? Promise.all([
@@ -6205,20 +6173,20 @@ class ce extends I {
6205
6173
  const { status: n, ctx: a } = this._processInputParams(e);
6206
6174
  if (a.parsedType !== y.array)
6207
6175
  return _(a, {
6208
- code: p.invalid_type,
6176
+ code: m.invalid_type,
6209
6177
  expected: y.array,
6210
6178
  received: a.parsedType
6211
6179
  }), k;
6212
6180
  if (a.data.length < this._def.items.length)
6213
6181
  return _(a, {
6214
- code: p.too_small,
6182
+ code: m.too_small,
6215
6183
  minimum: this._def.items.length,
6216
6184
  inclusive: !0,
6217
6185
  exact: !1,
6218
6186
  type: "array"
6219
6187
  }), k;
6220
6188
  !this._def.rest && a.data.length > this._def.items.length && (_(a, {
6221
- code: p.too_big,
6189
+ code: m.too_big,
6222
6190
  maximum: this._def.items.length,
6223
6191
  inclusive: !0,
6224
6192
  exact: !1,
@@ -6261,7 +6229,7 @@ class Ft extends I {
6261
6229
  const { status: n, ctx: a } = this._processInputParams(e);
6262
6230
  if (a.parsedType !== y.object)
6263
6231
  return _(a, {
6264
- code: p.invalid_type,
6232
+ code: m.invalid_type,
6265
6233
  expected: y.object,
6266
6234
  received: a.parsedType
6267
6235
  }), k;
@@ -6302,7 +6270,7 @@ class fn extends I {
6302
6270
  const { status: n, ctx: a } = this._processInputParams(e);
6303
6271
  if (a.parsedType !== y.map)
6304
6272
  return _(a, {
6305
- code: p.invalid_type,
6273
+ code: m.invalid_type,
6306
6274
  expected: y.map,
6307
6275
  received: a.parsedType
6308
6276
  }), k;
@@ -6344,20 +6312,20 @@ class Ve extends I {
6344
6312
  const { status: n, ctx: a } = this._processInputParams(e);
6345
6313
  if (a.parsedType !== y.set)
6346
6314
  return _(a, {
6347
- code: p.invalid_type,
6315
+ code: m.invalid_type,
6348
6316
  expected: y.set,
6349
6317
  received: a.parsedType
6350
6318
  }), k;
6351
6319
  const r = this._def;
6352
6320
  r.minSize !== null && a.data.size < r.minSize.value && (_(a, {
6353
- code: p.too_small,
6321
+ code: m.too_small,
6354
6322
  minimum: r.minSize.value,
6355
6323
  type: "set",
6356
6324
  inclusive: !0,
6357
6325
  exact: !1,
6358
6326
  message: r.minSize.message
6359
6327
  }), n.dirty()), r.maxSize !== null && a.data.size > r.maxSize.value && (_(a, {
6360
- code: p.too_big,
6328
+ code: m.too_big,
6361
6329
  maximum: r.maxSize.value,
6362
6330
  type: "set",
6363
6331
  inclusive: !0,
@@ -6411,7 +6379,7 @@ class at extends I {
6411
6379
  const { ctx: n } = this._processInputParams(e);
6412
6380
  if (n.parsedType !== y.function)
6413
6381
  return _(n, {
6414
- code: p.invalid_type,
6382
+ code: m.invalid_type,
6415
6383
  expected: y.function,
6416
6384
  received: n.parsedType
6417
6385
  }), k;
@@ -6426,7 +6394,7 @@ class at extends I {
6426
6394
  dt
6427
6395
  ].filter((l) => !!l),
6428
6396
  issueData: {
6429
- code: p.invalid_arguments,
6397
+ code: m.invalid_arguments,
6430
6398
  argumentsError: c
6431
6399
  }
6432
6400
  });
@@ -6442,7 +6410,7 @@ class at extends I {
6442
6410
  dt
6443
6411
  ].filter((l) => !!l),
6444
6412
  issueData: {
6445
- code: p.invalid_return_type,
6413
+ code: m.invalid_return_type,
6446
6414
  returnTypeError: c
6447
6415
  }
6448
6416
  });
@@ -6524,7 +6492,7 @@ class Bt extends I {
6524
6492
  const n = this._getOrReturnCtx(e);
6525
6493
  return _(n, {
6526
6494
  received: n.data,
6527
- code: p.invalid_literal,
6495
+ code: m.invalid_literal,
6528
6496
  expected: this._def.value
6529
6497
  }), k;
6530
6498
  }
@@ -6539,7 +6507,7 @@ Bt.create = (t, e) => new Bt({
6539
6507
  typeName: N.ZodLiteral,
6540
6508
  ...S(e)
6541
6509
  });
6542
- function Na(t, e) {
6510
+ function ba(t, e) {
6543
6511
  return new Ie({
6544
6512
  values: t,
6545
6513
  typeName: N.ZodEnum,
@@ -6556,14 +6524,14 @@ class Ie extends I {
6556
6524
  return _(n, {
6557
6525
  expected: $.joinValues(a),
6558
6526
  received: n.parsedType,
6559
- code: p.invalid_type
6527
+ code: m.invalid_type
6560
6528
  }), k;
6561
6529
  }
6562
- if (hn(this, gt) || va(this, gt, new Set(this._def.values)), !hn(this, gt).has(e.data)) {
6530
+ if (hn(this, gt) || _a(this, gt, new Set(this._def.values)), !hn(this, gt).has(e.data)) {
6563
6531
  const n = this._getOrReturnCtx(e), a = this._def.values;
6564
6532
  return _(n, {
6565
6533
  received: n.data,
6566
- code: p.invalid_enum_value,
6534
+ code: m.invalid_enum_value,
6567
6535
  options: a
6568
6536
  }), k;
6569
6537
  }
@@ -6604,7 +6572,7 @@ class Ie extends I {
6604
6572
  }
6605
6573
  }
6606
6574
  gt = /* @__PURE__ */ new WeakMap();
6607
- Ie.create = Na;
6575
+ Ie.create = ba;
6608
6576
  class Kt extends I {
6609
6577
  constructor() {
6610
6578
  super(...arguments), yt.set(this, void 0);
@@ -6616,14 +6584,14 @@ class Kt extends I {
6616
6584
  return _(a, {
6617
6585
  expected: $.joinValues(r),
6618
6586
  received: a.parsedType,
6619
- code: p.invalid_type
6587
+ code: m.invalid_type
6620
6588
  }), k;
6621
6589
  }
6622
- if (hn(this, yt) || va(this, yt, new Set($.getValidEnumValues(this._def.values))), !hn(this, yt).has(e.data)) {
6590
+ if (hn(this, yt) || _a(this, yt, new Set($.getValidEnumValues(this._def.values))), !hn(this, yt).has(e.data)) {
6623
6591
  const r = $.objectValues(n);
6624
6592
  return _(a, {
6625
6593
  received: a.data,
6626
- code: p.invalid_enum_value,
6594
+ code: m.invalid_enum_value,
6627
6595
  options: r
6628
6596
  }), k;
6629
6597
  }
@@ -6647,7 +6615,7 @@ class lt extends I {
6647
6615
  const { ctx: n } = this._processInputParams(e);
6648
6616
  if (n.parsedType !== y.promise && n.common.async === !1)
6649
6617
  return _(n, {
6650
- code: p.invalid_type,
6618
+ code: m.invalid_type,
6651
6619
  expected: y.promise,
6652
6620
  received: n.parsedType
6653
6621
  }), k;
@@ -6846,7 +6814,7 @@ class _n extends I {
6846
6814
  if (this._getType(e) !== y.nan) {
6847
6815
  const a = this._getOrReturnCtx(e);
6848
6816
  return _(a, {
6849
- code: p.invalid_type,
6817
+ code: m.invalid_type,
6850
6818
  expected: y.nan,
6851
6819
  received: a.parsedType
6852
6820
  }), k;
@@ -6858,8 +6826,8 @@ _n.create = (t) => new _n({
6858
6826
  typeName: N.ZodNaN,
6859
6827
  ...S(t)
6860
6828
  });
6861
- const Bi = Symbol("zod_brand");
6862
- class Bn extends I {
6829
+ const Ui = Symbol("zod_brand");
6830
+ class Vn extends I {
6863
6831
  _parse(e) {
6864
6832
  const { ctx: n } = this._processInputParams(e), a = n.data;
6865
6833
  return this._def.type._parse({
@@ -6926,7 +6894,7 @@ qt.create = (t, e) => new qt({
6926
6894
  typeName: N.ZodReadonly,
6927
6895
  ...S(e)
6928
6896
  });
6929
- function ka(t, e = {}, n) {
6897
+ function wa(t, e = {}, n) {
6930
6898
  return t ? ct.create().superRefine((a, r) => {
6931
6899
  var s, o;
6932
6900
  if (!t(a)) {
@@ -6935,32 +6903,32 @@ function ka(t, e = {}, n) {
6935
6903
  }
6936
6904
  }) : ct.create();
6937
6905
  }
6938
- const Ki = {
6906
+ const Fi = {
6939
6907
  object: D.lazycreate
6940
6908
  };
6941
6909
  var N;
6942
6910
  (function(t) {
6943
6911
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
6944
6912
  })(N || (N = {}));
6945
- const Ji = (t, e = {
6913
+ const Vi = (t, e = {
6946
6914
  message: `Input not instance of ${t.name}`
6947
- }) => ka((n) => n instanceof t, e), Ca = Q.create, Ta = Se.create, Wi = _n.create, qi = je.create, Oa = Rt.create, Qi = Fe.create, Gi = pn.create, Hi = Mt.create, Yi = Lt.create, Xi = ct.create, eo = Le.create, to = fe.create, no = mn.create, ao = H.create, ro = D.create, so = D.strictCreate, io = zt.create, oo = vn.create, co = Ut.create, lo = ce.create, uo = Ft.create, ho = fn.create, po = Ve.create, mo = at.create, fo = Vt.create, _o = Bt.create, go = Ie.create, yo = Kt.create, vo = lt.create, Hn = X.create, bo = se.create, wo = Ze.create, xo = X.createWithPreprocess, No = Yt.create, ko = () => Ca().optional(), Co = () => Ta().optional(), To = () => Oa().optional(), Oo = {
6915
+ }) => wa((n) => n instanceof t, e), xa = Q.create, Na = Se.create, Bi = _n.create, Ki = je.create, ka = Mt.create, Ji = Fe.create, Wi = mn.create, qi = Rt.create, Qi = Lt.create, Gi = ct.create, Hi = Le.create, Yi = fe.create, Xi = pn.create, eo = H.create, to = D.create, no = D.strictCreate, ao = zt.create, ro = vn.create, so = Ut.create, io = ce.create, oo = Ft.create, co = fn.create, lo = Ve.create, uo = at.create, ho = Vt.create, mo = Bt.create, po = Ie.create, fo = Kt.create, _o = lt.create, Gn = X.create, go = se.create, yo = Ze.create, vo = X.createWithPreprocess, bo = Yt.create, wo = () => xa().optional(), xo = () => Na().optional(), No = () => ka().optional(), ko = {
6948
6916
  string: (t) => Q.create({ ...t, coerce: !0 }),
6949
6917
  number: (t) => Se.create({ ...t, coerce: !0 }),
6950
- boolean: (t) => Rt.create({
6918
+ boolean: (t) => Mt.create({
6951
6919
  ...t,
6952
6920
  coerce: !0
6953
6921
  }),
6954
6922
  bigint: (t) => je.create({ ...t, coerce: !0 }),
6955
6923
  date: (t) => Fe.create({ ...t, coerce: !0 })
6956
- }, So = k;
6957
- var jo = /* @__PURE__ */ Object.freeze({
6924
+ }, Co = k;
6925
+ var To = /* @__PURE__ */ Object.freeze({
6958
6926
  __proto__: null,
6959
6927
  defaultErrorMap: dt,
6960
- setErrorMap: Oi,
6928
+ setErrorMap: ki,
6961
6929
  getErrorMap: ln,
6962
6930
  makeIssue: un,
6963
- EMPTY_PATH: Si,
6931
+ EMPTY_PATH: Ci,
6964
6932
  addIssueToContext: _,
6965
6933
  ParseStatus: F,
6966
6934
  INVALID: k,
@@ -6979,19 +6947,19 @@ var jo = /* @__PURE__ */ Object.freeze({
6979
6947
  ZodParsedType: y,
6980
6948
  getParsedType: Ne,
6981
6949
  ZodType: I,
6982
- datetimeRegex: xa,
6950
+ datetimeRegex: va,
6983
6951
  ZodString: Q,
6984
6952
  ZodNumber: Se,
6985
6953
  ZodBigInt: je,
6986
- ZodBoolean: Rt,
6954
+ ZodBoolean: Mt,
6987
6955
  ZodDate: Fe,
6988
- ZodSymbol: pn,
6989
- ZodUndefined: Mt,
6956
+ ZodSymbol: mn,
6957
+ ZodUndefined: Rt,
6990
6958
  ZodNull: Lt,
6991
6959
  ZodAny: ct,
6992
6960
  ZodUnknown: Le,
6993
6961
  ZodNever: fe,
6994
- ZodVoid: mn,
6962
+ ZodVoid: pn,
6995
6963
  ZodArray: H,
6996
6964
  ZodObject: D,
6997
6965
  ZodUnion: zt,
@@ -7014,63 +6982,63 @@ var jo = /* @__PURE__ */ Object.freeze({
7014
6982
  ZodDefault: Jt,
7015
6983
  ZodCatch: Wt,
7016
6984
  ZodNaN: _n,
7017
- BRAND: Bi,
7018
- ZodBranded: Bn,
6985
+ BRAND: Ui,
6986
+ ZodBranded: Vn,
7019
6987
  ZodPipeline: Yt,
7020
6988
  ZodReadonly: qt,
7021
- custom: ka,
6989
+ custom: wa,
7022
6990
  Schema: I,
7023
6991
  ZodSchema: I,
7024
- late: Ki,
6992
+ late: Fi,
7025
6993
  get ZodFirstPartyTypeKind() {
7026
6994
  return N;
7027
6995
  },
7028
- coerce: Oo,
7029
- any: Xi,
7030
- array: ao,
7031
- bigint: qi,
7032
- boolean: Oa,
7033
- date: Qi,
7034
- discriminatedUnion: oo,
7035
- effect: Hn,
7036
- enum: go,
7037
- function: mo,
7038
- instanceof: Ji,
7039
- intersection: co,
7040
- lazy: fo,
7041
- literal: _o,
7042
- map: ho,
7043
- nan: Wi,
7044
- nativeEnum: yo,
7045
- never: to,
7046
- null: Yi,
7047
- nullable: wo,
7048
- number: Ta,
7049
- object: ro,
7050
- oboolean: To,
7051
- onumber: Co,
7052
- optional: bo,
7053
- ostring: ko,
7054
- pipeline: No,
7055
- preprocess: xo,
7056
- promise: vo,
7057
- record: uo,
7058
- set: po,
7059
- strictObject: so,
7060
- string: Ca,
7061
- symbol: Gi,
7062
- transformer: Hn,
7063
- tuple: lo,
7064
- undefined: Hi,
7065
- union: io,
7066
- unknown: eo,
7067
- void: no,
7068
- NEVER: So,
7069
- ZodIssueCode: p,
7070
- quotelessJson: Ti,
6996
+ coerce: ko,
6997
+ any: Gi,
6998
+ array: eo,
6999
+ bigint: Ki,
7000
+ boolean: ka,
7001
+ date: Ji,
7002
+ discriminatedUnion: ro,
7003
+ effect: Gn,
7004
+ enum: po,
7005
+ function: uo,
7006
+ instanceof: Vi,
7007
+ intersection: so,
7008
+ lazy: ho,
7009
+ literal: mo,
7010
+ map: co,
7011
+ nan: Bi,
7012
+ nativeEnum: fo,
7013
+ never: Yi,
7014
+ null: Qi,
7015
+ nullable: yo,
7016
+ number: Na,
7017
+ object: to,
7018
+ oboolean: No,
7019
+ onumber: xo,
7020
+ optional: go,
7021
+ ostring: wo,
7022
+ pipeline: bo,
7023
+ preprocess: vo,
7024
+ promise: _o,
7025
+ record: oo,
7026
+ set: lo,
7027
+ strictObject: no,
7028
+ string: xa,
7029
+ symbol: Wi,
7030
+ transformer: Gn,
7031
+ tuple: io,
7032
+ undefined: qi,
7033
+ union: ao,
7034
+ unknown: Hi,
7035
+ void: Xi,
7036
+ NEVER: Co,
7037
+ ZodIssueCode: m,
7038
+ quotelessJson: Ni,
7071
7039
  ZodError: J
7072
7040
  });
7073
- Ci(jo);
7041
+ xi(To);
7074
7042
  function Xt(t, e = "", n = {}) {
7075
7043
  for (let a in t)
7076
7044
  if (Object.prototype.hasOwnProperty.call(t, a)) {
@@ -7079,7 +7047,7 @@ function Xt(t, e = "", n = {}) {
7079
7047
  }
7080
7048
  return n;
7081
7049
  }
7082
- function Sa(t, e) {
7050
+ function Ca(t, e) {
7083
7051
  const n = {};
7084
7052
  for (const [a, r] of Object.entries(t)) {
7085
7053
  const s = e.find(
@@ -7097,12 +7065,12 @@ function Sa(t, e) {
7097
7065
  }
7098
7066
  return n;
7099
7067
  }
7100
- function Io(t) {
7068
+ function Oo(t) {
7101
7069
  return async (e, n) => {
7102
7070
  let a = t.selectFrom("connections").where("connections.tenant_id", "=", e);
7103
7071
  n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
7104
7072
  const o = (await a.offset(n.page * n.per_page).limit(n.per_page).selectAll().execute()).map(
7105
- (c) => M(Sa(c, ["options"]))
7073
+ (c) => R(Ca(c, ["options"]))
7106
7074
  ), { count: d } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
7107
7075
  return {
7108
7076
  connections: o,
@@ -7112,19 +7080,19 @@ function Io(t) {
7112
7080
  };
7113
7081
  };
7114
7082
  }
7115
- function Zo(t) {
7083
+ function So(t) {
7116
7084
  return async (e, n) => (await t.deleteFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", n).executeTakeFirst()).numDeletedRows > 0;
7117
7085
  }
7118
- function Eo(t) {
7086
+ function jo(t) {
7119
7087
  return async (e, n) => {
7120
7088
  const a = await t.selectFrom("connections").where("connections.tenant_id", "=", e).where("connections.id", "=", n).selectAll().executeTakeFirst();
7121
- return a ? M({
7089
+ return a ? R({
7122
7090
  ...a,
7123
7091
  options: JSON.parse(a.options)
7124
7092
  }) : null;
7125
7093
  };
7126
7094
  }
7127
- function $o(t) {
7095
+ function Io(t) {
7128
7096
  return async (e, n, a) => {
7129
7097
  const r = {
7130
7098
  ...a,
@@ -7136,16 +7104,16 @@ function $o(t) {
7136
7104
  }).where("connections.id", "=", n).where("connections.tenant_id", "=", e).execute(), !0;
7137
7105
  };
7138
7106
  }
7139
- function Po(t) {
7107
+ function Zo(t) {
7140
7108
  return {
7141
- create: xi(t),
7142
- get: Eo(t),
7143
- list: Io(t),
7144
- remove: Zo(t),
7145
- update: $o(t)
7109
+ create: vi(t),
7110
+ get: jo(t),
7111
+ list: Oo(t),
7112
+ remove: So(t),
7113
+ update: Io(t)
7146
7114
  };
7147
7115
  }
7148
- function Ao(t) {
7116
+ function Eo(t) {
7149
7117
  return {
7150
7118
  get: async (e) => {
7151
7119
  const n = await t.selectFrom("applications").selectAll().where("id", "=", e).executeTakeFirst();
@@ -7158,8 +7126,8 @@ function Ao(t) {
7158
7126
  return {
7159
7127
  ...n,
7160
7128
  connections: r.map(
7161
- (d) => ma.parse(
7162
- M({
7129
+ (d) => ha.parse(
7130
+ R({
7163
7131
  ...d,
7164
7132
  options: d.options ? JSON.parse(d.options) : {}
7165
7133
  })
@@ -7172,14 +7140,14 @@ function Ao(t) {
7172
7140
  web_origins: n.web_origins ? JSON.parse(n.web_origins) : [],
7173
7141
  allowed_logout_urls: n.allowed_logout_urls ? JSON.parse(n.allowed_logout_urls) : [],
7174
7142
  allowed_clients: n.allowed_clients ? JSON.parse(n.allowed_clients) : [],
7175
- tenant: M(a),
7143
+ tenant: R(a),
7176
7144
  // this is really an integer in the database
7177
7145
  disable_sign_ups: !!n.disable_sign_ups
7178
7146
  };
7179
7147
  }
7180
7148
  };
7181
7149
  }
7182
- function Do(t) {
7150
+ function $o(t) {
7183
7151
  return async () => await t.selectFrom("keys").where(
7184
7152
  (n) => n.or([
7185
7153
  n("revoked_at", ">", (/* @__PURE__ */ new Date()).toISOString()),
@@ -7187,22 +7155,22 @@ function Do(t) {
7187
7155
  ])
7188
7156
  ).selectAll().execute();
7189
7157
  }
7190
- function Ro(t) {
7158
+ function Po(t) {
7191
7159
  return async (e) => {
7192
7160
  await t.insertInto("keys").values({ ...e, created_at: (/* @__PURE__ */ new Date()).toDateString() }).execute();
7193
7161
  };
7194
7162
  }
7195
- function Mo(t) {
7163
+ function Ao(t) {
7196
7164
  return async (e, n) => !!(await t.updateTable("keys").set(n).where("kid", "=", e).execute()).length;
7197
7165
  }
7198
- function Lo(t) {
7166
+ function Do(t) {
7199
7167
  return {
7200
- create: Ro(t),
7201
- list: Do(t),
7202
- update: Mo(t)
7168
+ create: Po(t),
7169
+ list: $o(t),
7170
+ update: Ao(t)
7203
7171
  };
7204
7172
  }
7205
- function zo(t) {
7173
+ function Mo(t) {
7206
7174
  return async (e, n) => {
7207
7175
  const a = {
7208
7176
  created_at: (/* @__PURE__ */ new Date()).toISOString(),
@@ -7214,7 +7182,7 @@ function zo(t) {
7214
7182
  return await t.insertInto("domains").values(a).execute(), a;
7215
7183
  };
7216
7184
  }
7217
- function Uo(t) {
7185
+ function Ro(t) {
7218
7186
  return async (e, n) => {
7219
7187
  let a = t.selectFrom("domains").where("domains.tenant_id", "=", e);
7220
7188
  n.q && (a = Be(t, a, n.q, ["user_id", "ip"]));
@@ -7227,13 +7195,13 @@ function Uo(t) {
7227
7195
  };
7228
7196
  };
7229
7197
  }
7230
- function Fo(t) {
7198
+ function Lo(t) {
7231
7199
  return {
7232
- create: zo(t),
7233
- list: Uo(t)
7200
+ create: Mo(t),
7201
+ list: Ro(t)
7234
7202
  };
7235
7203
  }
7236
- function Vo(t) {
7204
+ function zo(t) {
7237
7205
  return async (e) => {
7238
7206
  const [n] = await t.selectFrom("branding").where("branding.tenant_id", "=", e).selectAll().execute();
7239
7207
  if (!n)
@@ -7248,7 +7216,7 @@ function Vo(t) {
7248
7216
  font_url: l,
7249
7217
  ...u
7250
7218
  } = n;
7251
- return M({
7219
+ return R({
7252
7220
  ...u,
7253
7221
  colors: {
7254
7222
  primary: r,
@@ -7263,9 +7231,9 @@ function Vo(t) {
7263
7231
  });
7264
7232
  };
7265
7233
  }
7266
- function Bo(t) {
7234
+ function Uo(t) {
7267
7235
  return async (e, n) => {
7268
- var o, d, c, l, u, Z, R, W, _e, Je, ge, ye, ve, We, qe, ee, te, ne;
7236
+ var o, d, c, l, u, Z, M, W, _e, Je, ge, ye, ve, We, qe, ee, te, ne;
7269
7237
  const { colors: a, font: r, ...s } = n;
7270
7238
  try {
7271
7239
  await t.insertInto("branding").values({
@@ -7274,7 +7242,7 @@ function Bo(t) {
7274
7242
  colors_page_background_type: (d = (o = n.colors) == null ? void 0 : o.page_background) == null ? void 0 : d.type,
7275
7243
  colors_page_background_start: (l = (c = n.colors) == null ? void 0 : c.page_background) == null ? void 0 : l.start,
7276
7244
  colors_page_background_end: (Z = (u = n.colors) == null ? void 0 : u.page_background) == null ? void 0 : Z.end,
7277
- colors_page_background_angle_dev: (W = (R = n.colors) == null ? void 0 : R.page_background) == null ? void 0 : W.angle_deg,
7245
+ colors_page_background_angle_dev: (W = (M = n.colors) == null ? void 0 : M.page_background) == null ? void 0 : W.angle_deg,
7278
7246
  font_url: (_e = n.font) == null ? void 0 : _e.url,
7279
7247
  tenant_id: e
7280
7248
  }).execute();
@@ -7291,22 +7259,22 @@ function Bo(t) {
7291
7259
  }
7292
7260
  };
7293
7261
  }
7294
- function Ko(t) {
7262
+ function Fo(t) {
7295
7263
  return {
7296
- get: Vo(t),
7297
- set: Bo(t)
7264
+ get: zo(t),
7265
+ set: Uo(t)
7298
7266
  };
7299
7267
  }
7300
- function Jo(t) {
7268
+ function Vo(t) {
7301
7269
  return async (e, n) => {
7302
7270
  let a = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
7303
7271
  n.q && (a = Be(t, a, n.q, ["url"]));
7304
7272
  const s = await a.offset(n.page * n.per_page).limit(n.per_page).selectAll().execute(), { count: o } = await a.select((c) => c.fn.countAll().as("count")).executeTakeFirstOrThrow();
7305
7273
  return {
7306
7274
  hooks: s.map((c) => {
7307
- const { tenant_id: l, enabled: u, synchronous: Z, ...R } = c;
7308
- return M({
7309
- ...R,
7275
+ const { tenant_id: l, enabled: u, synchronous: Z, ...M } = c;
7276
+ return R({
7277
+ ...M,
7310
7278
  enabled: !!u,
7311
7279
  synchronous: !!Z
7312
7280
  });
@@ -7317,20 +7285,20 @@ function Jo(t) {
7317
7285
  };
7318
7286
  };
7319
7287
  }
7320
- function Wo(t) {
7288
+ function Bo(t) {
7321
7289
  return async (e, n) => {
7322
7290
  const a = await t.selectFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", n).selectAll().executeTakeFirst();
7323
- return a ? M({
7291
+ return a ? R({
7324
7292
  ...a,
7325
7293
  enabled: !!a.enabled,
7326
7294
  synchronous: !!a.synchronous
7327
7295
  }) : null;
7328
7296
  };
7329
7297
  }
7330
- function qo(t) {
7298
+ function Ko(t) {
7331
7299
  return async (e, n) => (await t.deleteFrom("hooks").where("hooks.tenant_id", "=", e).where("hooks.hook_id", "=", n).executeTakeFirst()).numDeletedRows > 0;
7332
7300
  }
7333
- function Qo(t) {
7301
+ function Jo(t) {
7334
7302
  return async (e, n) => {
7335
7303
  const a = {
7336
7304
  hook_id: Ke(),
@@ -7346,7 +7314,7 @@ function Qo(t) {
7346
7314
  }).execute(), a;
7347
7315
  };
7348
7316
  }
7349
- function Go(t) {
7317
+ function Wo(t) {
7350
7318
  return async (e, n, a) => {
7351
7319
  const r = {
7352
7320
  ...a,
@@ -7357,16 +7325,16 @@ function Go(t) {
7357
7325
  return await t.updateTable("hooks").set(r).where("hooks.hook_id", "=", n).where("hooks.tenant_id", "=", e).execute(), !0;
7358
7326
  };
7359
7327
  }
7360
- function Ho(t) {
7328
+ function qo(t) {
7361
7329
  return {
7362
- create: Qo(t),
7363
- get: Wo(t),
7364
- list: Jo(t),
7365
- update: Go(t),
7366
- remove: qo(t)
7330
+ create: Jo(t),
7331
+ get: Bo(t),
7332
+ list: Vo(t),
7333
+ update: Wo(t),
7334
+ remove: Ko(t)
7367
7335
  };
7368
7336
  }
7369
- function Yo(t) {
7337
+ function Qo(t) {
7370
7338
  return async (e, n) => {
7371
7339
  const a = {
7372
7340
  themeId: Ke(),
@@ -7377,16 +7345,16 @@ function Yo(t) {
7377
7345
  return await t.insertInto("themes").values({ ...Xt(a), tenant_id: e }).execute(), a;
7378
7346
  };
7379
7347
  }
7380
- function Xo(t) {
7348
+ function Go(t) {
7381
7349
  return async (e, n) => (await t.deleteFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", n).executeTakeFirst()).numDeletedRows > 0;
7382
7350
  }
7383
- function ed(t) {
7351
+ function Ho(t) {
7384
7352
  return async (e, n) => {
7385
7353
  const a = await t.selectFrom("themes").where("themes.tenant_id", "=", e).where("themes.theme_id", "=", n).selectAll().executeTakeFirst();
7386
- return a ? M(a) : null;
7354
+ return a ? R(a) : null;
7387
7355
  };
7388
7356
  }
7389
- function td(t) {
7357
+ function Yo(t) {
7390
7358
  return async (e, n, a) => {
7391
7359
  const r = Xt({
7392
7360
  ...a,
@@ -7395,23 +7363,23 @@ function td(t) {
7395
7363
  return await t.updateTable("themes").set(r).where("themes.id", "=", n).where("themes.tenant_id", "=", e).execute(), !0;
7396
7364
  };
7397
7365
  }
7398
- function nd(t) {
7366
+ function Xo(t) {
7399
7367
  return {
7400
- create: Yo(t),
7401
- get: ed(t),
7402
- remove: Xo(t),
7403
- update: td(t)
7368
+ create: Qo(t),
7369
+ get: Ho(t),
7370
+ remove: Go(t),
7371
+ update: Yo(t)
7404
7372
  };
7405
7373
  }
7406
- function ad(t) {
7374
+ function ed(t) {
7407
7375
  return async (e, n) => {
7408
7376
  const a = (/* @__PURE__ */ new Date()).toISOString(), r = await t.selectFrom("logins").where("logins.expires_at", ">", a).where("logins.login_id", "=", n).selectAll().executeTakeFirst();
7409
- return r ? ks.parse(
7410
- Sa(M(r), ["authParams"])
7377
+ return r ? ws.parse(
7378
+ Ca(R(r), ["authParams"])
7411
7379
  ) : null;
7412
7380
  };
7413
7381
  }
7414
- function rd(t) {
7382
+ function td(t) {
7415
7383
  return async (e, n) => {
7416
7384
  const a = {
7417
7385
  login_id: Ke(),
@@ -7422,24 +7390,24 @@ function rd(t) {
7422
7390
  return await t.insertInto("logins").values({ ...Xt(a), tenant_id: e }).execute(), a;
7423
7391
  };
7424
7392
  }
7425
- function sd(t) {
7393
+ function nd(t) {
7426
7394
  return async (e, n, a) => (await t.updateTable("logins").set(Xt(a)).where("logins.login_id", "=", n).where("logins.tenant_id", "=", e).execute()).length === 1;
7427
7395
  }
7428
- function id(t) {
7396
+ function ad(t) {
7429
7397
  return async (e, n) => (await t.deleteFrom("logins").where("logins.tenant_id", "=", e).where("logins.login_id", "=", n).execute()).length > 0;
7430
7398
  }
7431
- function od(t) {
7399
+ function rd(t) {
7432
7400
  return {
7433
- create: rd(t),
7434
- get: ad(t),
7435
- update: sd(t),
7436
- remove: id(t)
7401
+ create: td(t),
7402
+ get: ed(t),
7403
+ update: nd(t),
7404
+ remove: ad(t)
7437
7405
  };
7438
7406
  }
7439
- function dd(t) {
7407
+ function sd(t) {
7440
7408
  return async (e) => {
7441
7409
  const [n] = await t.selectFrom("prompt_settings").where("prompt_settings.tenant_id", "=", e).selectAll().execute();
7442
- return M({
7410
+ return R({
7443
7411
  identifier_first: !!(n != null && n.identifier_first),
7444
7412
  password_first: !!(n != null && n.password_first),
7445
7413
  webauthn_platform_first_factor: !!(n != null && n.webauthn_platform_first_factor),
@@ -7447,8 +7415,8 @@ function dd(t) {
7447
7415
  });
7448
7416
  };
7449
7417
  }
7450
- function Yn(t) {
7451
- return M({
7418
+ function Hn(t) {
7419
+ return R({
7452
7420
  ...t,
7453
7421
  webauthn_platform_first_factor: t.webauthn_platform_first_factor ? !!t.webauthn_platform_first_factor : void 0,
7454
7422
  identifier_first: t.identifier_first ? !!t.identifier_first : void 0,
@@ -7456,26 +7424,26 @@ function Yn(t) {
7456
7424
  universal_login_experience: t.universal_login_experience
7457
7425
  });
7458
7426
  }
7459
- function cd(t) {
7427
+ function id(t) {
7460
7428
  return async (e, n) => {
7461
7429
  try {
7462
- const a = As.parse(n);
7430
+ const a = Es.parse(n);
7463
7431
  await t.insertInto("prompt_settings").values({
7464
- ...Yn(a),
7432
+ ...Hn(a),
7465
7433
  tenant_id: e
7466
7434
  }).execute();
7467
7435
  } catch {
7468
- await t.updateTable("prompt_settings").set(Yn(n)).where("tenant_id", "=", e).execute();
7436
+ await t.updateTable("prompt_settings").set(Hn(n)).where("tenant_id", "=", e).execute();
7469
7437
  }
7470
7438
  };
7471
7439
  }
7472
- function ld(t) {
7440
+ function od(t) {
7473
7441
  return {
7474
- get: dd(t),
7475
- set: cd(t)
7442
+ get: sd(t),
7443
+ set: id(t)
7476
7444
  };
7477
7445
  }
7478
- function ud(t) {
7446
+ function dd(t) {
7479
7447
  return async (e) => {
7480
7448
  const [n] = await t.selectFrom("email_providers").where("email_providers.tenant_id", "=", e).selectAll().execute();
7481
7449
  if (!n)
@@ -7487,7 +7455,7 @@ function ud(t) {
7487
7455
  enabled: o,
7488
7456
  ...d
7489
7457
  } = n;
7490
- return M({
7458
+ return R({
7491
7459
  ...d,
7492
7460
  credentials: JSON.parse(r),
7493
7461
  settings: JSON.parse(s),
@@ -7495,7 +7463,7 @@ function ud(t) {
7495
7463
  });
7496
7464
  };
7497
7465
  }
7498
- function hd(t) {
7466
+ function cd(t) {
7499
7467
  return async (e, n) => {
7500
7468
  const { credentials: a, settings: r, enabled: s, ...o } = n;
7501
7469
  await t.updateTable("email_providers").set({
@@ -7506,7 +7474,7 @@ function hd(t) {
7506
7474
  }).where("tenant_id", "=", e).execute();
7507
7475
  };
7508
7476
  }
7509
- function pd(t) {
7477
+ function ld(t) {
7510
7478
  return async (e, n) => {
7511
7479
  const { credentials: a, settings: r, enabled: s, ...o } = n;
7512
7480
  await t.insertInto("email_providers").values({
@@ -7520,14 +7488,14 @@ function pd(t) {
7520
7488
  }).execute();
7521
7489
  };
7522
7490
  }
7523
- function md(t) {
7491
+ function ud(t) {
7524
7492
  return {
7525
- get: ud(t),
7526
- create: pd(t),
7527
- update: hd(t)
7493
+ get: dd(t),
7494
+ create: ld(t),
7495
+ update: cd(t)
7528
7496
  };
7529
7497
  }
7530
- function fd(t) {
7498
+ function hd(t) {
7531
7499
  return t[t.length - 1];
7532
7500
  }
7533
7501
  function z(t) {
@@ -7560,7 +7528,7 @@ const en = z({
7560
7528
  identifier: en.create(e)
7561
7529
  });
7562
7530
  }
7563
- }), _d = z({
7531
+ }), md = z({
7564
7532
  is(t) {
7565
7533
  return t.kind === "AliasNode";
7566
7534
  },
@@ -7589,7 +7557,7 @@ const en = z({
7589
7557
  }
7590
7558
  });
7591
7559
  var gn;
7592
- class gd {
7560
+ class pd {
7593
7561
  constructor() {
7594
7562
  ut(this, "nodeStack", []);
7595
7563
  ae(this, gn, z({
@@ -8423,7 +8391,7 @@ class gd {
8423
8391
  }
8424
8392
  }
8425
8393
  gn = new WeakMap();
8426
- const yd = z({
8394
+ const fd = z({
8427
8395
  AlterTableNode: !0,
8428
8396
  CreateIndexNode: !0,
8429
8397
  CreateSchemaNode: !0,
@@ -8442,30 +8410,30 @@ const yd = z({
8442
8410
  UpdateQueryNode: !0,
8443
8411
  MergeQueryNode: !0
8444
8412
  });
8445
- var rt, De, Re, L, ja, Ia, Za, Ye, Dn, Ea;
8446
- class vd extends gd {
8413
+ var rt, De, Me, L, Ta, Oa, Sa, Ye, Dn, ja;
8414
+ class _d extends pd {
8447
8415
  constructor(n) {
8448
8416
  super();
8449
8417
  ae(this, L);
8450
8418
  ae(this, rt);
8451
8419
  ae(this, De, /* @__PURE__ */ new Set());
8452
- ae(this, Re, /* @__PURE__ */ new Set());
8420
+ ae(this, Me, /* @__PURE__ */ new Set());
8453
8421
  ht(this, rt, n);
8454
8422
  }
8455
8423
  transformNodeImpl(n) {
8456
- if (!T(this, L, ja).call(this, n))
8424
+ if (!T(this, L, Ta).call(this, n))
8457
8425
  return super.transformNodeImpl(n);
8458
- const a = T(this, L, Za).call(this, n);
8426
+ const a = T(this, L, Sa).call(this, n);
8459
8427
  for (const o of a)
8460
- v(this, Re).add(o);
8461
- const r = T(this, L, Ia).call(this, n);
8428
+ v(this, Me).add(o);
8429
+ const r = T(this, L, Oa).call(this, n);
8462
8430
  for (const o of r)
8463
8431
  v(this, De).add(o);
8464
8432
  const s = super.transformNodeImpl(n);
8465
8433
  for (const o of r)
8466
8434
  v(this, De).delete(o);
8467
8435
  for (const o of a)
8468
- v(this, Re).delete(o);
8436
+ v(this, Me).delete(o);
8469
8437
  return s;
8470
8438
  }
8471
8439
  transformSchemableIdentifier(n) {
@@ -8483,9 +8451,9 @@ class vd extends gd {
8483
8451
  };
8484
8452
  }
8485
8453
  }
8486
- rt = new WeakMap(), De = new WeakMap(), Re = new WeakMap(), L = new WeakSet(), ja = function(n) {
8487
- return n.kind in yd;
8488
- }, Ia = function(n) {
8454
+ rt = new WeakMap(), De = new WeakMap(), Me = new WeakMap(), L = new WeakSet(), Ta = function(n) {
8455
+ return n.kind in fd;
8456
+ }, Oa = function(n) {
8489
8457
  const a = /* @__PURE__ */ new Set();
8490
8458
  if ("name" in n && n.name && An.is(n.name) && T(this, L, Dn).call(this, n.name, a), "from" in n && n.from)
8491
8459
  for (const r of n.from.froms)
@@ -8494,26 +8462,26 @@ rt = new WeakMap(), De = new WeakMap(), Re = new WeakMap(), L = new WeakSet(), j
8494
8462
  for (const r of n.joins)
8495
8463
  T(this, L, Ye).call(this, r.table, a);
8496
8464
  return "using" in n && n.using && T(this, L, Ye).call(this, n.using, a), a;
8497
- }, Za = function(n) {
8465
+ }, Sa = function(n) {
8498
8466
  const a = /* @__PURE__ */ new Set();
8499
- return "with" in n && n.with && T(this, L, Ea).call(this, n.with, a), a;
8467
+ return "with" in n && n.with && T(this, L, ja).call(this, n.with, a), a;
8500
8468
  }, Ye = function(n, a) {
8501
- const r = Nn.is(n) ? n : _d.is(n) && Nn.is(n.node) ? n.node : null;
8469
+ const r = Nn.is(n) ? n : md.is(n) && Nn.is(n.node) ? n.node : null;
8502
8470
  r && T(this, L, Dn).call(this, r.table, a);
8503
8471
  }, Dn = function(n, a) {
8504
8472
  const r = n.identifier.name;
8505
- !v(this, De).has(r) && !v(this, Re).has(r) && a.add(r);
8506
- }, Ea = function(n, a) {
8473
+ !v(this, De).has(r) && !v(this, Me).has(r) && a.add(r);
8474
+ }, ja = function(n, a) {
8507
8475
  for (const r of n.expressions) {
8508
8476
  const s = r.name.table.table.identifier.name;
8509
- v(this, Re).has(s) || a.add(s);
8477
+ v(this, Me).has(s) || a.add(s);
8510
8478
  }
8511
8479
  };
8512
8480
  var Qt;
8513
- class bd {
8481
+ class gd {
8514
8482
  constructor(e) {
8515
8483
  ae(this, Qt);
8516
- ht(this, Qt, new vd(e));
8484
+ ht(this, Qt, new _d(e));
8517
8485
  }
8518
8486
  transformQuery(e) {
8519
8487
  return v(this, Qt).transformNode(e.node);
@@ -8523,7 +8491,7 @@ class bd {
8523
8491
  }
8524
8492
  }
8525
8493
  Qt = new WeakMap();
8526
- class wd {
8494
+ class yd {
8527
8495
  transformQuery(e) {
8528
8496
  return e.node;
8529
8497
  }
@@ -8531,11 +8499,11 @@ class wd {
8531
8499
  return e.result;
8532
8500
  }
8533
8501
  }
8534
- const xd = "kysely_migration", Xn = "kysely_migration_lock", Nd = !1, kn = "migration_lock", kd = z({ __noMigrations__: !0 });
8535
- var P, m, vt, ue, he, Xe, Pa, pe, Aa, Da, Ra, Ma, La, Rn, et, Mn, za, Ua, Fa, Ln, Va, Ba, Ka, Ja, Wa, bt;
8536
- class $a {
8502
+ const vd = "kysely_migration", Yn = "kysely_migration_lock", bd = !1, kn = "migration_lock", wd = z({ __noMigrations__: !0 });
8503
+ var P, p, vt, ue, he, Xe, Za, me, Ea, $a, Pa, Aa, Da, Mn, et, Rn, Ma, Ra, La, Ln, za, Ua, Fa, Va, Ba, bt;
8504
+ class Ia {
8537
8505
  constructor(e) {
8538
- ae(this, m);
8506
+ ae(this, p);
8539
8507
  ae(this, P);
8540
8508
  ht(this, P, z(e));
8541
8509
  }
@@ -8545,8 +8513,8 @@ class $a {
8545
8513
  * The returned array is sorted by migration name.
8546
8514
  */
8547
8515
  async getMigrations() {
8548
- const e = await T(this, m, et).call(this, v(this, m, he)) ? await v(this, P).db.withPlugin(v(this, m, pe)).selectFrom(v(this, m, he)).select(["name", "timestamp"]).execute() : [];
8549
- return (await T(this, m, Ln).call(this)).map(({ name: a, ...r }) => {
8516
+ const e = await T(this, p, et).call(this, v(this, p, he)) ? await v(this, P).db.withPlugin(v(this, p, me)).selectFrom(v(this, p, he)).select(["name", "timestamp"]).execute() : [];
8517
+ return (await T(this, p, Ln).call(this)).map(({ name: a, ...r }) => {
8550
8518
  const s = e.find((o) => o.name === a);
8551
8519
  return {
8552
8520
  name: a,
@@ -8603,7 +8571,7 @@ class $a {
8603
8571
  * ```
8604
8572
  */
8605
8573
  async migrateToLatest() {
8606
- return T(this, m, vt).call(this, () => ({ direction: "Up", step: 1 / 0 }));
8574
+ return T(this, p, vt).call(this, () => ({ direction: "Up", step: 1 / 0 }));
8607
8575
  }
8608
8576
  /**
8609
8577
  * Migrate up/down to a specific migration.
@@ -8629,8 +8597,8 @@ class $a {
8629
8597
  * ```
8630
8598
  */
8631
8599
  async migrateTo(e) {
8632
- return T(this, m, vt).call(this, ({ migrations: n, executedMigrations: a, pendingMigrations: r }) => {
8633
- if (e === kd)
8600
+ return T(this, p, vt).call(this, ({ migrations: n, executedMigrations: a, pendingMigrations: r }) => {
8601
+ if (e === wd)
8634
8602
  return { direction: "Down", step: 1 / 0 };
8635
8603
  if (!n.find((d) => d.name === e))
8636
8604
  throw new Error(`migration "${e}" doesn't exist`);
@@ -8660,7 +8628,7 @@ class $a {
8660
8628
  * ```
8661
8629
  */
8662
8630
  async migrateUp() {
8663
- return T(this, m, vt).call(this, () => ({ direction: "Up", step: 1 }));
8631
+ return T(this, p, vt).call(this, () => ({ direction: "Up", step: 1 }));
8664
8632
  }
8665
8633
  /**
8666
8634
  * Migrate one step down.
@@ -8677,97 +8645,97 @@ class $a {
8677
8645
  * ```
8678
8646
  */
8679
8647
  async migrateDown() {
8680
- return T(this, m, vt).call(this, () => ({ direction: "Down", step: 1 }));
8648
+ return T(this, p, vt).call(this, () => ({ direction: "Down", step: 1 }));
8681
8649
  }
8682
8650
  }
8683
- P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8651
+ P = new WeakMap(), p = new WeakSet(), vt = async function(e) {
8684
8652
  try {
8685
- return await T(this, m, Aa).call(this), await T(this, m, za).call(this, e);
8653
+ return await T(this, p, Ea).call(this), await T(this, p, Ma).call(this, e);
8686
8654
  } catch (n) {
8687
8655
  return n instanceof Cn ? n.resultSet : { error: n };
8688
8656
  }
8689
8657
  }, ue = function() {
8690
8658
  return v(this, P).migrationTableSchema;
8691
8659
  }, he = function() {
8692
- return v(this, P).migrationTableName ?? xd;
8660
+ return v(this, P).migrationTableName ?? vd;
8693
8661
  }, Xe = function() {
8694
- return v(this, P).migrationLockTableName ?? Xn;
8695
- }, Pa = function() {
8696
- return v(this, P).allowUnorderedMigrations ?? Nd;
8697
- }, pe = function() {
8698
- return v(this, m, ue) ? new bd(v(this, m, ue)) : new wd();
8699
- }, Aa = async function() {
8700
- await T(this, m, Da).call(this), await T(this, m, Ra).call(this), await T(this, m, Ma).call(this), await T(this, m, La).call(this);
8701
- }, Da = async function() {
8702
- if (v(this, m, ue) && !await T(this, m, Rn).call(this))
8662
+ return v(this, P).migrationLockTableName ?? Yn;
8663
+ }, Za = function() {
8664
+ return v(this, P).allowUnorderedMigrations ?? bd;
8665
+ }, me = function() {
8666
+ return v(this, p, ue) ? new gd(v(this, p, ue)) : new yd();
8667
+ }, Ea = async function() {
8668
+ await T(this, p, $a).call(this), await T(this, p, Pa).call(this), await T(this, p, Aa).call(this), await T(this, p, Da).call(this);
8669
+ }, $a = async function() {
8670
+ if (v(this, p, ue) && !await T(this, p, Mn).call(this))
8703
8671
  try {
8704
- await T(this, m, bt).call(this, v(this, P).db.schema.createSchema(v(this, m, ue)));
8672
+ await T(this, p, bt).call(this, v(this, P).db.schema.createSchema(v(this, p, ue)));
8705
8673
  } catch (e) {
8706
- if (!await T(this, m, Rn).call(this))
8674
+ if (!await T(this, p, Mn).call(this))
8707
8675
  throw e;
8708
8676
  }
8709
- }, Ra = async function() {
8710
- if (!await T(this, m, et).call(this, v(this, m, he)))
8677
+ }, Pa = async function() {
8678
+ if (!await T(this, p, et).call(this, v(this, p, he)))
8711
8679
  try {
8712
- v(this, m, ue) && await T(this, m, bt).call(this, v(this, P).db.schema.createSchema(v(this, m, ue))), await T(this, m, bt).call(this, v(this, P).db.schema.withPlugin(v(this, m, pe)).createTable(v(this, m, he)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
8680
+ v(this, p, ue) && await T(this, p, bt).call(this, v(this, P).db.schema.createSchema(v(this, p, ue))), await T(this, p, bt).call(this, v(this, P).db.schema.withPlugin(v(this, p, me)).createTable(v(this, p, he)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
8713
8681
  } catch (e) {
8714
- if (!await T(this, m, et).call(this, v(this, m, he)))
8682
+ if (!await T(this, p, et).call(this, v(this, p, he)))
8715
8683
  throw e;
8716
8684
  }
8717
- }, Ma = async function() {
8718
- if (!await T(this, m, et).call(this, v(this, m, Xe)))
8685
+ }, Aa = async function() {
8686
+ if (!await T(this, p, et).call(this, v(this, p, Xe)))
8719
8687
  try {
8720
- await T(this, m, bt).call(this, v(this, P).db.schema.withPlugin(v(this, m, pe)).createTable(v(this, m, Xe)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
8688
+ await T(this, p, bt).call(this, v(this, P).db.schema.withPlugin(v(this, p, me)).createTable(v(this, p, Xe)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
8721
8689
  } catch (e) {
8722
- if (!await T(this, m, et).call(this, v(this, m, Xe)))
8690
+ if (!await T(this, p, et).call(this, v(this, p, Xe)))
8723
8691
  throw e;
8724
8692
  }
8725
- }, La = async function() {
8726
- if (!await T(this, m, Mn).call(this))
8693
+ }, Da = async function() {
8694
+ if (!await T(this, p, Rn).call(this))
8727
8695
  try {
8728
- await v(this, P).db.withPlugin(v(this, m, pe)).insertInto(v(this, m, Xe)).values({ id: kn, is_locked: 0 }).execute();
8696
+ await v(this, P).db.withPlugin(v(this, p, me)).insertInto(v(this, p, Xe)).values({ id: kn, is_locked: 0 }).execute();
8729
8697
  } catch (e) {
8730
- if (!await T(this, m, Mn).call(this))
8698
+ if (!await T(this, p, Rn).call(this))
8731
8699
  throw e;
8732
8700
  }
8733
- }, Rn = async function() {
8734
- return (await v(this, P).db.introspection.getSchemas()).some((n) => n.name === v(this, m, ue));
8701
+ }, Mn = async function() {
8702
+ return (await v(this, P).db.introspection.getSchemas()).some((n) => n.name === v(this, p, ue));
8735
8703
  }, et = async function(e) {
8736
- const n = v(this, m, ue);
8704
+ const n = v(this, p, ue);
8737
8705
  return (await v(this, P).db.introspection.getTables({
8738
8706
  withInternalKyselyTables: !0
8739
8707
  })).some((r) => r.name === e && (!n || r.schema === n));
8740
- }, Mn = async function() {
8741
- return !!await v(this, P).db.withPlugin(v(this, m, pe)).selectFrom(v(this, m, Xe)).where("id", "=", kn).select("id").executeTakeFirst();
8742
- }, za = async function(e) {
8708
+ }, Rn = async function() {
8709
+ return !!await v(this, P).db.withPlugin(v(this, p, me)).selectFrom(v(this, p, Xe)).where("id", "=", kn).select("id").executeTakeFirst();
8710
+ }, Ma = async function(e) {
8743
8711
  const n = v(this, P).db.getExecutor().adapter, a = z({
8744
- lockTable: v(this, P).migrationLockTableName ?? Xn,
8712
+ lockTable: v(this, P).migrationLockTableName ?? Yn,
8745
8713
  lockRowId: kn,
8746
8714
  lockTableSchema: v(this, P).migrationTableSchema
8747
8715
  }), r = async (s) => {
8748
8716
  try {
8749
8717
  await n.acquireMigrationLock(s, a);
8750
- const o = await T(this, m, Ua).call(this, s);
8718
+ const o = await T(this, p, Ra).call(this, s);
8751
8719
  if (o.migrations.length === 0)
8752
8720
  return { results: [] };
8753
8721
  const { direction: d, step: c } = e(o);
8754
- return c <= 0 ? { results: [] } : d === "Down" ? await T(this, m, Ja).call(this, s, o, c) : d === "Up" ? await T(this, m, Wa).call(this, s, o, c) : { results: [] };
8722
+ return c <= 0 ? { results: [] } : d === "Down" ? await T(this, p, Va).call(this, s, o, c) : d === "Up" ? await T(this, p, Ba).call(this, s, o, c) : { results: [] };
8755
8723
  } finally {
8756
8724
  await n.releaseMigrationLock(s, a);
8757
8725
  }
8758
8726
  };
8759
8727
  return n.supportsTransactionalDdl ? v(this, P).db.transaction().execute(r) : v(this, P).db.connection().execute(r);
8760
- }, Ua = async function(e) {
8761
- const n = await T(this, m, Ln).call(this), a = await T(this, m, Va).call(this, e);
8762
- T(this, m, Ba).call(this, n, a), v(this, m, Pa) || T(this, m, Ka).call(this, n, a);
8763
- const r = T(this, m, Fa).call(this, n, a);
8728
+ }, Ra = async function(e) {
8729
+ const n = await T(this, p, Ln).call(this), a = await T(this, p, za).call(this, e);
8730
+ T(this, p, Ua).call(this, n, a), v(this, p, Za) || T(this, p, Fa).call(this, n, a);
8731
+ const r = T(this, p, La).call(this, n, a);
8764
8732
  return z({
8765
8733
  migrations: n,
8766
8734
  executedMigrations: a,
8767
- lastMigration: fd(a),
8735
+ lastMigration: hd(a),
8768
8736
  pendingMigrations: r
8769
8737
  });
8770
- }, Fa = function(e, n) {
8738
+ }, La = function(e, n) {
8771
8739
  return e.filter((a) => !n.includes(a.name));
8772
8740
  }, Ln = async function() {
8773
8741
  const e = await v(this, P).provider.getMigrations();
@@ -8775,17 +8743,17 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8775
8743
  ...e[n],
8776
8744
  name: n
8777
8745
  }));
8778
- }, Va = async function(e) {
8779
- return (await e.withPlugin(v(this, m, pe)).selectFrom(v(this, m, he)).select("name").orderBy(["timestamp", "name"]).execute()).map((a) => a.name);
8780
- }, Ba = function(e, n) {
8746
+ }, za = async function(e) {
8747
+ return (await e.withPlugin(v(this, p, me)).selectFrom(v(this, p, he)).select("name").orderBy(["timestamp", "name"]).execute()).map((a) => a.name);
8748
+ }, Ua = function(e, n) {
8781
8749
  for (const a of n)
8782
8750
  if (!e.some((r) => r.name === a))
8783
8751
  throw new Error(`corrupted migrations: previously executed migration ${a} is missing`);
8784
- }, Ka = function(e, n) {
8752
+ }, Fa = function(e, n) {
8785
8753
  for (let a = 0; a < n.length; ++a)
8786
8754
  if (e[a].name !== n[a])
8787
8755
  throw new Error(`corrupted migrations: expected previously executed migration ${n[a]} to be at index ${a} but ${e[a].name} was found in its place. New migrations must always have a name that comes alphabetically after the last executed migration.`);
8788
- }, Ja = async function(e, n, a) {
8756
+ }, Va = async function(e, n, a) {
8789
8757
  const r = n.executedMigrations.slice().reverse().slice(0, a).map((o) => n.migrations.find((d) => d.name === o)), s = r.map((o) => ({
8790
8758
  migrationName: o.name,
8791
8759
  direction: "Down",
@@ -8794,7 +8762,7 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8794
8762
  for (let o = 0; o < s.length; ++o) {
8795
8763
  const d = r[o];
8796
8764
  try {
8797
- d.down && (await d.down(e), await e.withPlugin(v(this, m, pe)).deleteFrom(v(this, m, he)).where("name", "=", d.name).execute(), s[o] = {
8765
+ d.down && (await d.down(e), await e.withPlugin(v(this, p, me)).deleteFrom(v(this, p, he)).where("name", "=", d.name).execute(), s[o] = {
8798
8766
  migrationName: d.name,
8799
8767
  direction: "Down",
8800
8768
  status: "Success"
@@ -8811,7 +8779,7 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8811
8779
  }
8812
8780
  }
8813
8781
  return { results: s };
8814
- }, Wa = async function(e, n, a) {
8782
+ }, Ba = async function(e, n, a) {
8815
8783
  const s = n.pendingMigrations.slice(0, a).map((o) => ({
8816
8784
  migrationName: o.name,
8817
8785
  direction: "Up",
@@ -8820,7 +8788,7 @@ P = new WeakMap(), m = new WeakSet(), vt = async function(e) {
8820
8788
  for (let o = 0; o < s.length; o++) {
8821
8789
  const d = n.pendingMigrations[o];
8822
8790
  try {
8823
- await d.up(e), await e.withPlugin(v(this, m, pe)).insertInto(v(this, m, he)).values({
8791
+ await d.up(e), await e.withPlugin(v(this, p, me)).insertInto(v(this, p, he)).values({
8824
8792
  name: d.name,
8825
8793
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
8826
8794
  }).execute(), s[o] = {
@@ -8855,7 +8823,7 @@ class Cn extends Error {
8855
8823
  }
8856
8824
  }
8857
8825
  Gt = new WeakMap();
8858
- class qa {
8826
+ class Ka {
8859
8827
  constructor(e) {
8860
8828
  ut(this, "migrations");
8861
8829
  this.migrations = e;
@@ -8864,7 +8832,7 @@ class qa {
8864
8832
  return this.migrations;
8865
8833
  }
8866
8834
  }
8867
- async function Cd(t) {
8835
+ async function xd(t) {
8868
8836
  await t.schema.createTable("tenants").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)").addColumn("audience", "varchar(255)").addColumn("sender_email", "varchar(255)").addColumn("sender_name", "varchar(255)").addColumn("language", "varchar(255)").addColumn("logo", "varchar(255)").addColumn("primary_color", "varchar(255)").addColumn("secondary_color", "varchar(255)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute(), await t.schema.createTable("users").addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn(
8869
8837
  "tenant_id",
8870
8838
  "varchar(255)",
@@ -8932,19 +8900,28 @@ async function Cd(t) {
8932
8900
  (e) => e.references("tenants.id").onDelete("cascade").notNull()
8933
8901
  ).addColumn("domain", "varchar(255)", (e) => e.notNull()).addColumn("email_service", "varchar(255)").addColumn("email_api_key", "varchar(255)").addColumn("dkim_private_key", "varchar(2048)").addColumn("dkim_public_key", "varchar(2048)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("updated_at", "varchar(255)", (e) => e.notNull()).execute();
8934
8902
  }
8935
- async function Td(t) {
8903
+ async function Nd(t) {
8936
8904
  await t.schema.dropTable("domains").execute(), await t.schema.dropTable("members").execute(), await t.schema.dropTable("users").execute(), await t.schema.dropTable("connections").execute(), await t.schema.dropTable("applications").execute(), await t.schema.dropTable("migrations").execute(), await t.schema.dropTable("tenants").execute();
8937
8905
  }
8906
+ const kd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8907
+ __proto__: null,
8908
+ down: Nd,
8909
+ up: xd
8910
+ }, Symbol.toStringTag, { value: "Module" }));
8911
+ async function Cd(t) {
8912
+ await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
8913
+ }
8914
+ async function Td(t) {
8915
+ await t.schema.alterTable("tenants").dropColumn("support_url").execute();
8916
+ }
8938
8917
  const Od = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8939
8918
  __proto__: null,
8940
8919
  down: Td,
8941
8920
  up: Cd
8942
8921
  }, Symbol.toStringTag, { value: "Module" }));
8943
8922
  async function Sd(t) {
8944
- await t.schema.alterTable("tenants").addColumn("support_url", "varchar(255)").execute();
8945
8923
  }
8946
8924
  async function jd(t) {
8947
- await t.schema.alterTable("tenants").dropColumn("support_url").execute();
8948
8925
  }
8949
8926
  const Id = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8950
8927
  __proto__: null,
@@ -8952,8 +8929,16 @@ const Id = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8952
8929
  up: Sd
8953
8930
  }, Symbol.toStringTag, { value: "Module" }));
8954
8931
  async function Zd(t) {
8932
+ await t.schema.createTable("logs").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("category", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(64)").addColumn("user_id", "varchar(64)").addForeignKeyConstraint(
8933
+ "tenant_id_constraint",
8934
+ ["tenant_id"],
8935
+ "tenants",
8936
+ ["id"],
8937
+ (e) => e.onDelete("cascade")
8938
+ ).addColumn("ip", "varchar(255)").addColumn("type", "varchar(8)", (e) => e.notNull()).addColumn("date", "varchar(25)", (e) => e.notNull()).addColumn("client_id", "varchar(255)").addColumn("client_name", "varchar(255)").addColumn("user_agent", "varchar(255)").addColumn("description", "varchar(255)").addColumn("details", "varchar(2048)").execute();
8955
8939
  }
8956
8940
  async function Ed(t) {
8941
+ await t.schema.dropTable("logs").execute();
8957
8942
  }
8958
8943
  const $d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8959
8944
  __proto__: null,
@@ -8961,32 +8946,15 @@ const $d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8961
8946
  up: Zd
8962
8947
  }, Symbol.toStringTag, { value: "Module" }));
8963
8948
  async function Pd(t) {
8964
- await t.schema.createTable("logs").addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("category", "varchar(255)", (e) => e.notNull()).addColumn("tenant_id", "varchar(64)").addColumn("user_id", "varchar(64)").addForeignKeyConstraint(
8965
- "tenant_id_constraint",
8966
- ["tenant_id"],
8967
- "tenants",
8968
- ["id"],
8969
- (e) => e.onDelete("cascade")
8970
- ).addColumn("ip", "varchar(255)").addColumn("type", "varchar(8)", (e) => e.notNull()).addColumn("date", "varchar(25)", (e) => e.notNull()).addColumn("client_id", "varchar(255)").addColumn("client_name", "varchar(255)").addColumn("user_agent", "varchar(255)").addColumn("description", "varchar(255)").addColumn("details", "varchar(2048)").execute();
8971
8949
  }
8972
8950
  async function Ad(t) {
8973
- await t.schema.dropTable("logs").execute();
8974
8951
  }
8975
8952
  const Dd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8976
8953
  __proto__: null,
8977
8954
  down: Ad,
8978
8955
  up: Pd
8979
8956
  }, Symbol.toStringTag, { value: "Module" }));
8980
- async function Rd(t) {
8981
- }
8982
8957
  async function Md(t) {
8983
- }
8984
- const Ld = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8985
- __proto__: null,
8986
- down: Md,
8987
- up: Rd
8988
- }, Symbol.toStringTag, { value: "Module" }));
8989
- async function zd(t) {
8990
8958
  await t.schema.createTable("sessions").addColumn("session_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
8991
8959
  "client_id",
8992
8960
  "varchar(255)",
@@ -9015,15 +8983,15 @@ async function zd(t) {
9015
8983
  (e) => e.references("applications.id").onDelete("cascade").notNull()
9016
8984
  ).addColumn("code", "varchar(255)", (e) => e.notNull()).addColumn("email", "varchar(255)", (e) => e.notNull()).addColumn("user_id", "varchar(255)").addColumn("send", "varchar(255)").addColumn("nonce", "varchar(255)").addColumn("state", "varchar(1024)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute(), await t.schema.createIndex("otps_email_index").on("otps").column("email").execute(), await t.schema.createIndex("otps_expires_at_index").on("otps").column("expires_at").execute();
9017
8985
  }
9018
- async function Ud(t) {
8986
+ async function Rd(t) {
9019
8987
  await t.schema.dropTable("sessions").execute(), await t.schema.dropTable("tickets").execute(), await t.schema.dropTable("otps").execute();
9020
8988
  }
9021
- const Fd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8989
+ const Ld = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9022
8990
  __proto__: null,
9023
- down: Ud,
9024
- up: zd
8991
+ down: Rd,
8992
+ up: Md
9025
8993
  }, Symbol.toStringTag, { value: "Module" }));
9026
- async function Vd(t) {
8994
+ async function zd(t) {
9027
8995
  await t.schema.createTable("passwords").addColumn("tenant_id", "varchar(255)").addColumn("user_id", "varchar(255)").addForeignKeyConstraint(
9028
8996
  "user_id_constraint",
9029
8997
  ["user_id", "tenant_id"],
@@ -9038,17 +9006,33 @@ async function Vd(t) {
9038
9006
  (e) => e.onDelete("cascade")
9039
9007
  ).addColumn("type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute(), await t.schema.createIndex("codes_expires_at_index").on("codes").column("expires_at").execute();
9040
9008
  }
9041
- async function Bd(t) {
9009
+ async function Ud(t) {
9042
9010
  await t.schema.dropTable("passwords").execute(), await t.schema.dropTable("codes").execute();
9043
9011
  }
9012
+ const Fd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9013
+ __proto__: null,
9014
+ down: Ud,
9015
+ up: zd
9016
+ }, Symbol.toStringTag, { value: "Module" }));
9017
+ async function Vd(t) {
9018
+ }
9019
+ async function Bd(t) {
9020
+ }
9044
9021
  const Kd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9045
9022
  __proto__: null,
9046
9023
  down: Bd,
9047
9024
  up: Vd
9048
9025
  }, Symbol.toStringTag, { value: "Module" }));
9049
9026
  async function Jd(t) {
9027
+ await t.schema.alterTable("passwords").addColumn(
9028
+ "password",
9029
+ "varchar(255)",
9030
+ // do we want not null?
9031
+ (e) => e.notNull()
9032
+ ).execute();
9050
9033
  }
9051
9034
  async function Wd(t) {
9035
+ await t.schema.alterTable("passwords").dropColumn("password").execute();
9052
9036
  }
9053
9037
  const qd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9054
9038
  __proto__: null,
@@ -9056,15 +9040,8 @@ const qd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9056
9040
  up: Jd
9057
9041
  }, Symbol.toStringTag, { value: "Module" }));
9058
9042
  async function Qd(t) {
9059
- await t.schema.alterTable("passwords").addColumn(
9060
- "password",
9061
- "varchar(255)",
9062
- // do we want not null?
9063
- (e) => e.notNull()
9064
- ).execute();
9065
9043
  }
9066
9044
  async function Gd(t) {
9067
- await t.schema.alterTable("passwords").dropColumn("password").execute();
9068
9045
  }
9069
9046
  const Hd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9070
9047
  __proto__: null,
@@ -9090,8 +9067,10 @@ const ac = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9090
9067
  up: tc
9091
9068
  }, Symbol.toStringTag, { value: "Module" }));
9092
9069
  async function rc(t) {
9070
+ await t.schema.createIndex("users_email_index").on("users").column("email").execute();
9093
9071
  }
9094
9072
  async function sc(t) {
9073
+ await t.schema.dropIndex("users_email_index").execute();
9095
9074
  }
9096
9075
  const ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9097
9076
  __proto__: null,
@@ -9099,10 +9078,10 @@ const ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9099
9078
  up: rc
9100
9079
  }, Symbol.toStringTag, { value: "Module" }));
9101
9080
  async function oc(t) {
9102
- await t.schema.createIndex("users_email_index").on("users").column("email").execute();
9081
+ await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
9103
9082
  }
9104
9083
  async function dc(t) {
9105
- await t.schema.dropIndex("users_email_index").execute();
9084
+ await t.schema.alterTable("users").dropColumn("profileData").execute();
9106
9085
  }
9107
9086
  const cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9108
9087
  __proto__: null,
@@ -9110,32 +9089,36 @@ const cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9110
9089
  up: oc
9111
9090
  }, Symbol.toStringTag, { value: "Module" }));
9112
9091
  async function lc(t) {
9113
- await t.schema.alterTable("users").addColumn("profileData", "varchar(2048)").execute();
9092
+ await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
9114
9093
  }
9115
9094
  async function uc(t) {
9116
- await t.schema.alterTable("users").dropColumn("profileData").execute();
9095
+ await t.schema.dropIndex("users_linked_to_index");
9117
9096
  }
9118
9097
  const hc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9119
9098
  __proto__: null,
9120
9099
  down: uc,
9121
9100
  up: lc
9122
9101
  }, Symbol.toStringTag, { value: "Module" }));
9123
- async function pc(t) {
9124
- await t.schema.createIndex("users_linked_to_index").on("users").column("linked_to").execute();
9125
- }
9126
9102
  async function mc(t) {
9127
- await t.schema.dropIndex("users_linked_to_index");
9103
+ await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
9104
+ }
9105
+ async function pc(t) {
9106
+ await t.schema.alterTable("users").dropColumn("locale").execute();
9128
9107
  }
9129
9108
  const fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9130
9109
  __proto__: null,
9131
- down: mc,
9132
- up: pc
9110
+ down: pc,
9111
+ up: mc
9133
9112
  }, Symbol.toStringTag, { value: "Module" }));
9134
9113
  async function _c(t) {
9135
- await t.schema.alterTable("users").addColumn("locale", "varchar(255)").execute();
9114
+ await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
9115
+ "tenant_id",
9116
+ "varchar(255)",
9117
+ (e) => e.references("tenants.id").onDelete("cascade")
9118
+ ).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn("cert", "varchar(2048)").addColumn("pkcs7", "varchar(2048)").addColumn("fingerprint", "varchar(256)").addColumn("thumbprint", "varchar(256)").addColumn("current_since", "varchar(256)").addColumn("current_until", "varchar(256)").execute();
9136
9119
  }
9137
9120
  async function gc(t) {
9138
- await t.schema.alterTable("users").dropColumn("locale").execute();
9121
+ await t.schema.dropTable("keys").execute();
9139
9122
  }
9140
9123
  const yc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9141
9124
  __proto__: null,
@@ -9143,14 +9126,8 @@ const yc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9143
9126
  up: _c
9144
9127
  }, Symbol.toStringTag, { value: "Module" }));
9145
9128
  async function vc(t) {
9146
- await t.schema.createTable("keys").addColumn("kid", "varchar(255)", (e) => e.primaryKey()).addColumn(
9147
- "tenant_id",
9148
- "varchar(255)",
9149
- (e) => e.references("tenants.id").onDelete("cascade")
9150
- ).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("revoked_at", "varchar(255)").addColumn("cert", "varchar(2048)").addColumn("pkcs7", "varchar(2048)").addColumn("fingerprint", "varchar(256)").addColumn("thumbprint", "varchar(256)").addColumn("current_since", "varchar(256)").addColumn("current_until", "varchar(256)").execute();
9151
9129
  }
9152
9130
  async function bc(t) {
9153
- await t.schema.dropTable("keys").execute();
9154
9131
  }
9155
9132
  const wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9156
9133
  __proto__: null,
@@ -9167,8 +9144,10 @@ const kc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9167
9144
  up: xc
9168
9145
  }, Symbol.toStringTag, { value: "Module" }));
9169
9146
  async function Cc(t) {
9147
+ await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
9170
9148
  }
9171
9149
  async function Tc(t) {
9150
+ await t.schema.alterTable("otps").dropColumn("audience").execute();
9172
9151
  }
9173
9152
  const Oc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9174
9153
  __proto__: null,
@@ -9176,10 +9155,8 @@ const Oc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9176
9155
  up: Cc
9177
9156
  }, Symbol.toStringTag, { value: "Module" }));
9178
9157
  async function Sc(t) {
9179
- await t.schema.alterTable("otps").addColumn("audience", "varchar(255)").execute();
9180
9158
  }
9181
9159
  async function jc(t) {
9182
- await t.schema.alterTable("otps").dropColumn("audience").execute();
9183
9160
  }
9184
9161
  const Ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9185
9162
  __proto__: null,
@@ -9187,8 +9164,10 @@ const Ic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9187
9164
  up: Sc
9188
9165
  }, Symbol.toStringTag, { value: "Module" }));
9189
9166
  async function Zc(t) {
9167
+ await t.schema.alterTable("logs").dropColumn("category").execute();
9190
9168
  }
9191
9169
  async function Ec(t) {
9170
+ await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
9192
9171
  }
9193
9172
  const $c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9194
9173
  __proto__: null,
@@ -9196,32 +9175,32 @@ const $c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9196
9175
  up: Zc
9197
9176
  }, Symbol.toStringTag, { value: "Module" }));
9198
9177
  async function Pc(t) {
9199
- await t.schema.alterTable("logs").dropColumn("category").execute();
9178
+ await t.schema.alterTable("users").dropColumn("tags").execute();
9200
9179
  }
9201
9180
  async function Ac(t) {
9202
- await t.schema.alterTable("logs").addColumn("category", "varchar(255)", (e) => e.notNull()).execute();
9181
+ await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
9203
9182
  }
9204
9183
  const Dc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9205
9184
  __proto__: null,
9206
9185
  down: Ac,
9207
9186
  up: Pc
9208
9187
  }, Symbol.toStringTag, { value: "Module" }));
9209
- async function Rc(t) {
9210
- await t.schema.alterTable("users").dropColumn("tags").execute();
9211
- }
9212
9188
  async function Mc(t) {
9213
- await t.schema.alterTable("users").addColumn("tags", "varchar(255)").execute();
9189
+ await t.schema.createIndex("logs_user_id").on("logs").column("user_id").execute(), await t.schema.createIndex("logs_tenant_id").on("logs").column("tenant_id").execute(), await t.schema.createIndex("logs_date").on("logs").column("date").execute();
9190
+ }
9191
+ async function Rc(t) {
9192
+ await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
9214
9193
  }
9215
9194
  const Lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9216
9195
  __proto__: null,
9217
- down: Mc,
9218
- up: Rc
9196
+ down: Rc,
9197
+ up: Mc
9219
9198
  }, Symbol.toStringTag, { value: "Module" }));
9220
9199
  async function zc(t) {
9221
- await t.schema.createIndex("logs_user_id").on("logs").column("user_id").execute(), await t.schema.createIndex("logs_tenant_id").on("logs").column("tenant_id").execute(), await t.schema.createIndex("logs_date").on("logs").column("date").execute();
9200
+ await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
9222
9201
  }
9223
9202
  async function Uc(t) {
9224
- await t.schema.dropIndex("logs_user_id"), await t.schema.dropIndex("logs_tenant_id"), await t.schema.dropIndex("logs_date");
9203
+ await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
9225
9204
  }
9226
9205
  const Fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9227
9206
  __proto__: null,
@@ -9229,10 +9208,10 @@ const Fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9229
9208
  up: zc
9230
9209
  }, Symbol.toStringTag, { value: "Module" }));
9231
9210
  async function Vc(t) {
9232
- await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(8192)").execute();
9211
+ await t.schema.alterTable("logs").addColumn("user_name", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("auth0_client", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("isMobile", "boolean").execute(), await t.schema.alterTable("logs").addColumn("connection", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("connection_id", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("audience", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("scope", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("strategy", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("strategy_type", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("hostname", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("session_connection", "varchar(255)").execute();
9233
9212
  }
9234
9213
  async function Bc(t) {
9235
- await t.schema.alterTable("logs").dropColumn("details").execute(), await t.schema.alterTable("logs").addColumn("details", "varchar(2048)").execute();
9214
+ await t.schema.alterTable("logs").dropColumn("user_name").execute(), await t.schema.alterTable("logs").dropColumn("auth0_client").execute(), await t.schema.alterTable("logs").dropColumn("isMobile").execute(), await t.schema.alterTable("logs").dropColumn("connection").execute(), await t.schema.alterTable("logs").dropColumn("connection_id").execute(), await t.schema.alterTable("logs").dropColumn("audience").execute(), await t.schema.alterTable("logs").dropColumn("scope").execute(), await t.schema.alterTable("logs").dropColumn("strategy").execute(), await t.schema.alterTable("logs").dropColumn("strategy_type").execute(), await t.schema.alterTable("logs").dropColumn("hostname").execute(), await t.schema.alterTable("logs").dropColumn("session_connection").execute();
9236
9215
  }
9237
9216
  const Kc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9238
9217
  __proto__: null,
@@ -9240,10 +9219,10 @@ const Kc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9240
9219
  up: Vc
9241
9220
  }, Symbol.toStringTag, { value: "Module" }));
9242
9221
  async function Jc(t) {
9243
- await t.schema.alterTable("logs").addColumn("user_name", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("auth0_client", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("isMobile", "boolean").execute(), await t.schema.alterTable("logs").addColumn("connection", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("connection_id", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("audience", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("scope", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("strategy", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("strategy_type", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("hostname", "varchar(255)").execute(), await t.schema.alterTable("logs").addColumn("session_connection", "varchar(255)").execute();
9222
+ await t.schema.createIndex("users_name_index").on("users").column("name").execute();
9244
9223
  }
9245
9224
  async function Wc(t) {
9246
- await t.schema.alterTable("logs").dropColumn("user_name").execute(), await t.schema.alterTable("logs").dropColumn("auth0_client").execute(), await t.schema.alterTable("logs").dropColumn("isMobile").execute(), await t.schema.alterTable("logs").dropColumn("connection").execute(), await t.schema.alterTable("logs").dropColumn("connection_id").execute(), await t.schema.alterTable("logs").dropColumn("audience").execute(), await t.schema.alterTable("logs").dropColumn("scope").execute(), await t.schema.alterTable("logs").dropColumn("strategy").execute(), await t.schema.alterTable("logs").dropColumn("strategy_type").execute(), await t.schema.alterTable("logs").dropColumn("hostname").execute(), await t.schema.alterTable("logs").dropColumn("session_connection").execute();
9225
+ await t.schema.dropIndex("users_name_index").execute();
9247
9226
  }
9248
9227
  const qc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9249
9228
  __proto__: null,
@@ -9251,10 +9230,9 @@ const qc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9251
9230
  up: Jc
9252
9231
  }, Symbol.toStringTag, { value: "Module" }));
9253
9232
  async function Qc(t) {
9254
- await t.schema.createIndex("users_name_index").on("users").column("name").execute();
9255
9233
  }
9256
9234
  async function Gc(t) {
9257
- await t.schema.dropIndex("users_name_index").execute();
9235
+ await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
9258
9236
  }
9259
9237
  const Hc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9260
9238
  __proto__: null,
@@ -9262,9 +9240,10 @@ const Hc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9262
9240
  up: Qc
9263
9241
  }, Symbol.toStringTag, { value: "Module" }));
9264
9242
  async function Yc(t) {
9243
+ await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
9265
9244
  }
9266
9245
  async function Xc(t) {
9267
- await t.schema.alterTable("users").dropConstraint("unique_email_provider").execute();
9246
+ await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
9268
9247
  }
9269
9248
  const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9270
9249
  __proto__: null,
@@ -9272,10 +9251,10 @@ const el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9272
9251
  up: Yc
9273
9252
  }, Symbol.toStringTag, { value: "Module" }));
9274
9253
  async function tl(t) {
9275
- await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(8192)").execute();
9254
+ await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
9276
9255
  }
9277
9256
  async function nl(t) {
9278
- await t.schema.alterTable("otps").dropColumn("state").execute(), await t.schema.alterTable("otps").addColumn("state", "varchar(1024)").execute();
9257
+ await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
9279
9258
  }
9280
9259
  const al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9281
9260
  __proto__: null,
@@ -9283,10 +9262,14 @@ const al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9283
9262
  up: tl
9284
9263
  }, Symbol.toStringTag, { value: "Module" }));
9285
9264
  async function rl(t) {
9286
- await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(8192)").execute();
9265
+ await t.schema.createTable("branding").addColumn(
9266
+ "tenant_id",
9267
+ "varchar(255)",
9268
+ (e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
9269
+ ).addColumn("logo_url", "varchar(512)").addColumn("favicon_url", "varchar(512)").addColumn("font_url", "varchar(512)").addColumn("colors_primary", "varchar(8)").addColumn("colors_page_background_type", "varchar(32)").addColumn("colors_page_background_start", "varchar(8)").addColumn("colors_page_background_end", "varchar(8)").addColumn("colors_page_background_angle_dev", "integer").execute();
9287
9270
  }
9288
9271
  async function sl(t) {
9289
- await t.schema.alterTable("tickets").dropColumn("state").execute(), await t.schema.alterTable("tickets").addColumn("state", "varchar(1024)").execute();
9272
+ await t.schema.dropTable("branding").execute();
9290
9273
  }
9291
9274
  const il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9292
9275
  __proto__: null,
@@ -9294,14 +9277,8 @@ const il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9294
9277
  up: rl
9295
9278
  }, Symbol.toStringTag, { value: "Module" }));
9296
9279
  async function ol(t) {
9297
- await t.schema.createTable("branding").addColumn(
9298
- "tenant_id",
9299
- "varchar(255)",
9300
- (e) => e.references("tenants.id").onDelete("cascade").notNull().primaryKey()
9301
- ).addColumn("logo_url", "varchar(512)").addColumn("favicon_url", "varchar(512)").addColumn("font_url", "varchar(512)").addColumn("colors_primary", "varchar(8)").addColumn("colors_page_background_type", "varchar(32)").addColumn("colors_page_background_start", "varchar(8)").addColumn("colors_page_background_end", "varchar(8)").addColumn("colors_page_background_angle_dev", "integer").execute();
9302
9280
  }
9303
9281
  async function dl(t) {
9304
- await t.schema.dropTable("branding").execute();
9305
9282
  }
9306
9283
  const cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9307
9284
  __proto__: null,
@@ -9317,14 +9294,14 @@ const hl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9317
9294
  down: ul,
9318
9295
  up: ll
9319
9296
  }, Symbol.toStringTag, { value: "Module" }));
9320
- async function pl(t) {
9321
- }
9322
9297
  async function ml(t) {
9323
9298
  }
9299
+ async function pl(t) {
9300
+ }
9324
9301
  const fl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9325
9302
  __proto__: null,
9326
- down: ml,
9327
- up: pl
9303
+ down: pl,
9304
+ up: ml
9328
9305
  }, Symbol.toStringTag, { value: "Module" }));
9329
9306
  async function _l(t) {
9330
9307
  }
@@ -9336,15 +9313,6 @@ const yl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9336
9313
  up: _l
9337
9314
  }, Symbol.toStringTag, { value: "Module" }));
9338
9315
  async function vl(t) {
9339
- }
9340
- async function bl(t) {
9341
- }
9342
- const wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9343
- __proto__: null,
9344
- down: bl,
9345
- up: vl
9346
- }, Symbol.toStringTag, { value: "Module" }));
9347
- async function xl(t) {
9348
9316
  await t.schema.createTable("authentication_codes").addColumn(
9349
9317
  "tenant_id",
9350
9318
  "varchar(255)",
@@ -9355,17 +9323,28 @@ async function xl(t) {
9355
9323
  (e) => e.references("applications.id").onDelete("cascade").notNull()
9356
9324
  ).addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(8192)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9357
9325
  }
9358
- async function Nl(t) {
9326
+ async function bl(t) {
9359
9327
  await t.schema.dropTable("authentication_codes").execute();
9360
9328
  }
9329
+ const wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9330
+ __proto__: null,
9331
+ down: bl,
9332
+ up: vl
9333
+ }, Symbol.toStringTag, { value: "Module" }));
9334
+ async function xl(t) {
9335
+ }
9336
+ async function Nl(t) {
9337
+ }
9361
9338
  const kl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9362
9339
  __proto__: null,
9363
9340
  down: Nl,
9364
9341
  up: xl
9365
9342
  }, Symbol.toStringTag, { value: "Module" }));
9366
9343
  async function Cl(t) {
9344
+ await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
9367
9345
  }
9368
9346
  async function Tl(t) {
9347
+ await t.schema.alterTable("otps").dropColumn("ip").execute();
9369
9348
  }
9370
9349
  const Ol = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9371
9350
  __proto__: null,
@@ -9373,10 +9352,10 @@ const Ol = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9373
9352
  up: Cl
9374
9353
  }, Symbol.toStringTag, { value: "Module" }));
9375
9354
  async function Sl(t) {
9376
- await t.schema.alterTable("otps").addColumn("ip", "varchar(64)").execute();
9355
+ await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
9377
9356
  }
9378
9357
  async function jl(t) {
9379
- await t.schema.alterTable("otps").dropColumn("ip").execute();
9358
+ await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
9380
9359
  }
9381
9360
  const Il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9382
9361
  __proto__: null,
@@ -9384,10 +9363,8 @@ const Il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9384
9363
  up: Sl
9385
9364
  }, Symbol.toStringTag, { value: "Module" }));
9386
9365
  async function Zl(t) {
9387
- await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(1024)").execute();
9388
9366
  }
9389
9367
  async function El(t) {
9390
- await t.schema.alterTable("logs").dropColumn("user_agent").execute(), await t.schema.alterTable("logs").addColumn("user_agent", "varchar(255)").execute();
9391
9368
  }
9392
9369
  const $l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9393
9370
  __proto__: null,
@@ -9395,15 +9372,6 @@ const $l = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9395
9372
  up: Zl
9396
9373
  }, Symbol.toStringTag, { value: "Module" }));
9397
9374
  async function Pl(t) {
9398
- }
9399
- async function Al(t) {
9400
- }
9401
- const Dl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9402
- __proto__: null,
9403
- down: Al,
9404
- up: Pl
9405
- }, Symbol.toStringTag, { value: "Module" }));
9406
- async function Rl(t) {
9407
9375
  await t.schema.createTable("hooks").addColumn("hook_id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn(
9408
9376
  "tenant_id",
9409
9377
  "varchar(255)",
@@ -9414,13 +9382,22 @@ async function Rl(t) {
9414
9382
  (e) => e.defaultTo(!1).notNull()
9415
9383
  ).addColumn("priority", "integer").execute();
9416
9384
  }
9417
- async function Ml(t) {
9385
+ async function Al(t) {
9418
9386
  await t.schema.dropTable("hooks").execute();
9419
9387
  }
9388
+ const Dl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9389
+ __proto__: null,
9390
+ down: Al,
9391
+ up: Pl
9392
+ }, Symbol.toStringTag, { value: "Module" }));
9393
+ async function Ml(t) {
9394
+ }
9395
+ async function Rl(t) {
9396
+ }
9420
9397
  const Ll = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9421
9398
  __proto__: null,
9422
- down: Ml,
9423
- up: Rl
9399
+ down: Rl,
9400
+ up: Ml
9424
9401
  }, Symbol.toStringTag, { value: "Module" }));
9425
9402
  async function zl(t) {
9426
9403
  }
@@ -9432,15 +9409,6 @@ const Fl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9432
9409
  up: zl
9433
9410
  }, Symbol.toStringTag, { value: "Module" }));
9434
9411
  async function Vl(t) {
9435
- }
9436
- async function Bl(t) {
9437
- }
9438
- const Kl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9439
- __proto__: null,
9440
- down: Bl,
9441
- up: Vl
9442
- }, Symbol.toStringTag, { value: "Module" }));
9443
- async function Jl(t) {
9444
9412
  await t.schema.createTable("logins").addColumn("login_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
9445
9413
  "tenant_id",
9446
9414
  "varchar(255)",
@@ -9457,7 +9425,7 @@ async function Jl(t) {
9457
9425
  (e) => e.onDelete("cascade")
9458
9426
  ).addColumn("code_type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9459
9427
  }
9460
- async function Wl(t) {
9428
+ async function Bl(t) {
9461
9429
  await t.schema.dropTable("logins").execute(), await t.schema.alterTable("passwords").dropColumn("algorithm").execute(), await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("id", "varchar(255)", (e) => e.primaryKey()).addColumn("code", "varchar(255)", (e) => e.notNull()).addColumn("user_id", "varchar(255)").addColumn("tenant_id", "varchar(255)").addForeignKeyConstraint(
9462
9430
  "codes_user_id_tenant_id_constraint",
9463
9431
  ["user_id", "tenant_id"],
@@ -9466,14 +9434,25 @@ async function Wl(t) {
9466
9434
  (e) => e.onDelete("cascade")
9467
9435
  ).addColumn("type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9468
9436
  }
9437
+ const Kl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9438
+ __proto__: null,
9439
+ down: Bl,
9440
+ up: Vl
9441
+ }, Symbol.toStringTag, { value: "Module" }));
9442
+ async function Jl(t) {
9443
+ }
9444
+ async function Wl(t) {
9445
+ }
9469
9446
  const ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9470
9447
  __proto__: null,
9471
9448
  down: Wl,
9472
9449
  up: Jl
9473
9450
  }, Symbol.toStringTag, { value: "Module" }));
9474
9451
  async function Ql(t) {
9452
+ await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
9475
9453
  }
9476
9454
  async function Gl(t) {
9455
+ await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
9477
9456
  }
9478
9457
  const Hl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9479
9458
  __proto__: null,
@@ -9481,10 +9460,10 @@ const Hl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9481
9460
  up: Ql
9482
9461
  }, Symbol.toStringTag, { value: "Module" }));
9483
9462
  async function Yl(t) {
9484
- await t.schema.alterTable("logins").addColumn("auth0Client", "varchar(256)").execute();
9463
+ await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
9485
9464
  }
9486
9465
  async function Xl(t) {
9487
- await t.schema.alterTable("logins").dropColumn("auth0Client").execute();
9466
+ await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
9488
9467
  }
9489
9468
  const eu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9490
9469
  __proto__: null,
@@ -9492,10 +9471,8 @@ const eu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9492
9471
  up: Yl
9493
9472
  }, Symbol.toStringTag, { value: "Module" }));
9494
9473
  async function tu(t) {
9495
- await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(8192)").execute();
9496
9474
  }
9497
9475
  async function nu(t) {
9498
- await t.schema.alterTable("logins").dropColumn("authParams_state").execute(), await t.schema.alterTable("logins").addColumn("authParams_state", "varchar(511)").execute();
9499
9476
  }
9500
9477
  const au = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9501
9478
  __proto__: null,
@@ -9512,8 +9489,10 @@ const iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9512
9489
  up: ru
9513
9490
  }, Symbol.toStringTag, { value: "Module" }));
9514
9491
  async function ou(t) {
9492
+ await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
9515
9493
  }
9516
9494
  async function du(t) {
9495
+ await t.schema.alterTable("logins").dropColumn("nonce").execute();
9517
9496
  }
9518
9497
  const cu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9519
9498
  __proto__: null,
@@ -9521,35 +9500,24 @@ const cu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9521
9500
  up: ou
9522
9501
  }, Symbol.toStringTag, { value: "Module" }));
9523
9502
  async function lu(t) {
9524
- await t.schema.alterTable("logins").addColumn("authParams_nonce", "varchar(255)").execute();
9525
9503
  }
9526
9504
  async function uu(t) {
9527
- await t.schema.alterTable("logins").dropColumn("nonce").execute();
9528
9505
  }
9529
9506
  const hu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9530
9507
  __proto__: null,
9531
9508
  down: uu,
9532
9509
  up: lu
9533
9510
  }, Symbol.toStringTag, { value: "Module" }));
9534
- async function pu(t) {
9535
- }
9536
9511
  async function mu(t) {
9537
9512
  }
9513
+ async function pu(t) {
9514
+ }
9538
9515
  const fu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9539
9516
  __proto__: null,
9540
- down: mu,
9541
- up: pu
9517
+ down: pu,
9518
+ up: mu
9542
9519
  }, Symbol.toStringTag, { value: "Module" }));
9543
9520
  async function _u(t) {
9544
- }
9545
- async function gu(t) {
9546
- }
9547
- const yu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9548
- __proto__: null,
9549
- down: gu,
9550
- up: _u
9551
- }, Symbol.toStringTag, { value: "Module" }));
9552
- async function vu(t) {
9553
9521
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.notNull()).addColumn(
9554
9522
  "tenant_id",
9555
9523
  "varchar(255)",
@@ -9565,7 +9533,7 @@ async function vu(t) {
9565
9533
  "code_type"
9566
9534
  ]).execute();
9567
9535
  }
9568
- async function bu(t) {
9536
+ async function gu(t) {
9569
9537
  await t.schema.dropTable("codes").execute(), await t.schema.createTable("codes").addColumn("code_id", "varchar(255)", (e) => e.primaryKey()).addColumn(
9570
9538
  "tenant_id",
9571
9539
  "varchar(255)",
@@ -9578,15 +9546,15 @@ async function bu(t) {
9578
9546
  (e) => e.onDelete("cascade")
9579
9547
  ).addColumn("code_type", "varchar(255)", (e) => e.notNull()).addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9580
9548
  }
9581
- const wu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9549
+ const yu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9582
9550
  __proto__: null,
9583
- down: bu,
9584
- up: vu
9551
+ down: gu,
9552
+ up: _u
9585
9553
  }, Symbol.toStringTag, { value: "Module" }));
9586
- async function xu(t) {
9554
+ async function vu(t) {
9587
9555
  await t.schema.dropTable("otps").execute(), await t.schema.dropTable("authentication_codes").execute();
9588
9556
  }
9589
- async function Nu(t) {
9557
+ async function bu(t) {
9590
9558
  await t.schema.alterTable("keys").addColumn("private_key", "varchar(2048)").addColumn("public_key", "varchar(2048)").execute(), await t.schema.createTable("otps").addColumn(
9591
9559
  "tenant_id",
9592
9560
  "varchar(255)",
@@ -9605,16 +9573,25 @@ async function Nu(t) {
9605
9573
  (e) => e.references("applications.id").onDelete("cascade").notNull()
9606
9574
  ).addColumn("user_id", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(8192)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9607
9575
  }
9576
+ const wu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9577
+ __proto__: null,
9578
+ down: bu,
9579
+ up: vu
9580
+ }, Symbol.toStringTag, { value: "Module" }));
9581
+ async function xu(t) {
9582
+ await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
9583
+ }
9584
+ async function Nu(t) {
9585
+ await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
9586
+ }
9608
9587
  const ku = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9609
9588
  __proto__: null,
9610
9589
  down: Nu,
9611
9590
  up: xu
9612
9591
  }, Symbol.toStringTag, { value: "Module" }));
9613
9592
  async function Cu(t) {
9614
- await t.schema.createIndex("IDX_logs_tenant_date_type_user").on("logs").columns(["tenant_id", "date", "type", "user_id"]).execute();
9615
9593
  }
9616
9594
  async function Tu(t) {
9617
- await t.schema.dropIndex("IDX_logs_tenant_date_type_user").on("logs").execute();
9618
9595
  }
9619
9596
  const Ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9620
9597
  __proto__: null,
@@ -9622,15 +9599,6 @@ const Ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9622
9599
  up: Cu
9623
9600
  }, Symbol.toStringTag, { value: "Module" }));
9624
9601
  async function Su(t) {
9625
- }
9626
- async function ju(t) {
9627
- }
9628
- const Iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9629
- __proto__: null,
9630
- down: ju,
9631
- up: Su
9632
- }, Symbol.toStringTag, { value: "Module" }));
9633
- async function Zu(t) {
9634
9602
  await t.schema.createTable("prompt_settings").addColumn("tenant_id", "varchar(64)", (e) => e.primaryKey()).addColumn(
9635
9603
  "universal_login_experience",
9636
9604
  "varchar(16)",
@@ -9649,9 +9617,18 @@ async function Zu(t) {
9649
9617
  (e) => e.defaultTo(!1).notNull()
9650
9618
  ).execute();
9651
9619
  }
9652
- async function Eu(t) {
9620
+ async function ju(t) {
9653
9621
  await t.schema.dropTable("prompt_settings").execute();
9654
9622
  }
9623
+ const Iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9624
+ __proto__: null,
9625
+ down: ju,
9626
+ up: Su
9627
+ }, Symbol.toStringTag, { value: "Module" }));
9628
+ async function Zu(t) {
9629
+ }
9630
+ async function Eu(t) {
9631
+ }
9655
9632
  const $u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9656
9633
  __proto__: null,
9657
9634
  down: Eu,
@@ -9666,18 +9643,20 @@ const Du = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9666
9643
  down: Au,
9667
9644
  up: Pu
9668
9645
  }, Symbol.toStringTag, { value: "Module" }));
9669
- async function Ru(t) {
9670
- }
9671
9646
  async function Mu(t) {
9672
9647
  }
9648
+ async function Ru(t) {
9649
+ }
9673
9650
  const Lu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9674
9651
  __proto__: null,
9675
- down: Mu,
9676
- up: Ru
9652
+ down: Ru,
9653
+ up: Mu
9677
9654
  }, Symbol.toStringTag, { value: "Module" }));
9678
9655
  async function zu(t) {
9656
+ await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
9679
9657
  }
9680
9658
  async function Uu(t) {
9659
+ await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
9681
9660
  }
9682
9661
  const Fu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9683
9662
  __proto__: null,
@@ -9685,10 +9664,10 @@ const Fu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9685
9664
  up: zu
9686
9665
  }, Symbol.toStringTag, { value: "Module" }));
9687
9666
  async function Vu(t) {
9688
- await t.schema.alterTable("logins").addColumn("authParams_ui_locales", "varchar(32)").execute();
9667
+ await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
9689
9668
  }
9690
9669
  async function Bu(t) {
9691
- await t.schema.alterTable("logins").dropColumn("authParams_ui_locales").execute();
9670
+ await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
9692
9671
  }
9693
9672
  const Ku = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9694
9673
  __proto__: null,
@@ -9696,10 +9675,8 @@ const Ku = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9696
9675
  up: Vu
9697
9676
  }, Symbol.toStringTag, { value: "Module" }));
9698
9677
  async function Ju(t) {
9699
- await t.schema.alterTable("logins").addColumn("authParams_prompt", "varchar(16)").execute();
9700
9678
  }
9701
9679
  async function Wu(t) {
9702
- await t.schema.alterTable("logins").dropColumn("authParams_prompt").execute();
9703
9680
  }
9704
9681
  const qu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9705
9682
  __proto__: null,
@@ -9707,8 +9684,10 @@ const qu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9707
9684
  up: Ju
9708
9685
  }, Symbol.toStringTag, { value: "Module" }));
9709
9686
  async function Qu(t) {
9687
+ await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
9710
9688
  }
9711
9689
  async function Gu(t) {
9690
+ await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
9712
9691
  }
9713
9692
  const Hu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9714
9693
  __proto__: null,
@@ -9716,10 +9695,10 @@ const Hu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9716
9695
  up: Qu
9717
9696
  }, Symbol.toStringTag, { value: "Module" }));
9718
9697
  async function Yu(t) {
9719
- await t.schema.alterTable("logins").addColumn("authParams_act_as", "varchar(255)").execute();
9698
+ await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
9720
9699
  }
9721
9700
  async function Xu(t) {
9722
- await t.schema.alterTable("logins").dropColumn("authParam_act_as").execute();
9701
+ await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
9723
9702
  }
9724
9703
  const eh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9725
9704
  __proto__: null,
@@ -9727,17 +9706,6 @@ const eh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9727
9706
  up: Yu
9728
9707
  }, Symbol.toStringTag, { value: "Module" }));
9729
9708
  async function th(t) {
9730
- await t.schema.alterTable("codes").addColumn("code_verifier", "varchar(128)").execute();
9731
- }
9732
- async function nh(t) {
9733
- await t.schema.alterTable("codes").dropColumn("code_verifier").execute();
9734
- }
9735
- const ah = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9736
- __proto__: null,
9737
- down: nh,
9738
- up: th
9739
- }, Symbol.toStringTag, { value: "Module" }));
9740
- async function rh(t) {
9741
9709
  await t.schema.createTable("email_providers").addColumn("tenant_id", "varchar(255)", (e) => e.primaryKey()).addColumn("name", "varchar(255)", (e) => e.notNull()).addColumn("enabled", "boolean", (e) => e.notNull()).addColumn("default_from_address", "varchar(255)").addColumn(
9742
9710
  "credentials",
9743
9711
  "varchar(2048)",
@@ -9748,18 +9716,18 @@ async function rh(t) {
9748
9716
  (e) => e.notNull().defaultTo("{}")
9749
9717
  ).addColumn("created_at", "varchar(29)", (e) => e.notNull()).addColumn("updated_at", "varchar(29)", (e) => e.notNull()).execute();
9750
9718
  }
9751
- async function sh(t) {
9719
+ async function nh(t) {
9752
9720
  await t.schema.dropTable("email_providers").execute();
9753
9721
  }
9754
- const ih = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9722
+ const ah = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9755
9723
  __proto__: null,
9756
- down: sh,
9757
- up: rh
9724
+ down: nh,
9725
+ up: th
9758
9726
  }, Symbol.toStringTag, { value: "Module" }));
9759
- async function oh(t) {
9727
+ async function rh(t) {
9760
9728
  await t.schema.dropTable("tickets").execute();
9761
9729
  }
9762
- async function dh(t) {
9730
+ async function sh(t) {
9763
9731
  await t.schema.createTable("tickets").addColumn(
9764
9732
  "tenant_id",
9765
9733
  "varchar(255)",
@@ -9770,93 +9738,93 @@ async function dh(t) {
9770
9738
  (e) => e.references("applications.id").onDelete("cascade").notNull()
9771
9739
  ).addColumn("email", "varchar(255)", (e) => e.notNull()).addColumn("nonce", "varchar(255)").addColumn("state", "varchar(1024)").addColumn("scope", "varchar(1024)").addColumn("response_type", "varchar(256)").addColumn("response_mode", "varchar(256)").addColumn("redirect_uri", "varchar(1024)").addColumn("created_at", "varchar(255)", (e) => e.notNull()).addColumn("expires_at", "varchar(255)", (e) => e.notNull()).addColumn("used_at", "varchar(255)").execute();
9772
9740
  }
9773
- const ch = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9741
+ const ih = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9774
9742
  __proto__: null,
9775
- down: dh,
9776
- up: oh
9743
+ down: sh,
9744
+ up: rh
9777
9745
  }, Symbol.toStringTag, { value: "Module" }));
9778
- async function lh(t) {
9746
+ async function oh(t) {
9779
9747
  }
9780
- async function uh(t) {
9748
+ async function dh(t) {
9781
9749
  await t.schema.alterTable("logins").dropColumn("ip").dropColumn("useragent").execute();
9782
9750
  }
9783
- const hh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9751
+ const ch = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9784
9752
  __proto__: null,
9785
- down: uh,
9786
- up: lh
9787
- }, Symbol.toStringTag, { value: "Module" })), Qa = {
9788
- m1_init: Od,
9789
- m2_magicLink: Id,
9790
- m3_updateAt: $d,
9791
- m4_logTable: Dd,
9792
- m5_userProfile: Ld,
9793
- m6_sessions: Fd,
9794
- m7_passwords: Kd,
9795
- m8_logsTableNewFields: qd,
9796
- m9_passwordTableNewField: Hd,
9797
- n01_codesTable: ec,
9798
- n11_universalLoginSession: ac,
9799
- n12_userFields: ic,
9800
- n13_userEmailIndex: cc,
9801
- n14_profileDataField: hc,
9802
- n15_userEmailIndex: fc,
9803
- n16_userLocale: yc,
9804
- n17_signingKeys: wc,
9805
- n18_logsFields: kc,
9806
- n19_connectionsUserinfo: Oc,
9807
- n20_missingFields: Ic,
9808
- n21_sessionDeletedAt: $c,
9809
- n22_dropLogsFields: Dc,
9810
- n23_dropUsersFields: Lc,
9811
- n24_logsIndexes: Fc,
9812
- n25_logDescMaxLength: Kc,
9813
- n26_logsTableExtraFields: qc,
9814
- n27_usersTableNameIndex: Hc,
9815
- n28_usersEmailConstrain: el,
9816
- n29_increaseOtpStateLength: al,
9817
- n30_increaseTicketStateLength: il,
9818
- n31_branding: cl,
9819
- n32_indexesAndNotNull: hl,
9820
- n33_vendorIdInUniversalLoginSession: fl,
9821
- n34_auth0ClientInUniversalLoginSession: yl,
9822
- n35_increaseUniversalSessionStateLength: wl,
9823
- n36_authenticationCodes: kl,
9824
- n37_disableSignUps: Ol,
9825
- n38_otpIpAddress: Il,
9826
- n39_increaseUserAgentLength: $l,
9827
- n40_userId: Dl,
9828
- n41_hooks: Ll,
9829
- n42_userIdIndexes: Fl,
9830
- n43_userIdIndexes: Kl,
9831
- n44_codes: ql,
9832
- n45_hookProperties: Hl,
9833
- n46_loginAuth0Client: eu,
9834
- n47_loginAuth0Client: au,
9835
- n48_saml: iu,
9836
- n49_removeFields: cu,
9837
- n50_authParamsNonce: hu,
9838
- n51_connectionid: fu,
9839
- n52_cert: yu,
9840
- n53_codes_primary_key: wu,
9841
- n54_cleanup_tables: ku,
9842
- n55_logs_index: Ou,
9843
- n56_application_fields: Iu,
9844
- n57_prompt_settings: $u,
9845
- n58_connection_client_id: Du,
9846
- n59_connection_options: Lu,
9847
- n60_users_metadata: Fu,
9848
- n61_userLocales: Ku,
9849
- n62_prompt: qu,
9850
- n63_connection_cleanup: Hu,
9851
- n64_act_as: eh,
9852
- n65_code_verifier: ah,
9853
- n66_email_providers: ih,
9854
- n67_drop_tickets: ch,
9855
- n68_login_useragents: hh
9753
+ down: dh,
9754
+ up: oh
9755
+ }, Symbol.toStringTag, { value: "Module" })), Ja = {
9756
+ m1_init: kd,
9757
+ m2_magicLink: Od,
9758
+ m3_updateAt: Id,
9759
+ m4_logTable: $d,
9760
+ m5_userProfile: Dd,
9761
+ m6_sessions: Ld,
9762
+ m7_passwords: Fd,
9763
+ m8_logsTableNewFields: Kd,
9764
+ m9_passwordTableNewField: qd,
9765
+ n01_codesTable: Hd,
9766
+ n11_universalLoginSession: ec,
9767
+ n12_userFields: ac,
9768
+ n13_userEmailIndex: ic,
9769
+ n14_profileDataField: cc,
9770
+ n15_userEmailIndex: hc,
9771
+ n16_userLocale: fc,
9772
+ n17_signingKeys: yc,
9773
+ n18_logsFields: wc,
9774
+ n19_connectionsUserinfo: kc,
9775
+ n20_missingFields: Oc,
9776
+ n21_sessionDeletedAt: Ic,
9777
+ n22_dropLogsFields: $c,
9778
+ n23_dropUsersFields: Dc,
9779
+ n24_logsIndexes: Lc,
9780
+ n25_logDescMaxLength: Fc,
9781
+ n26_logsTableExtraFields: Kc,
9782
+ n27_usersTableNameIndex: qc,
9783
+ n28_usersEmailConstrain: Hc,
9784
+ n29_increaseOtpStateLength: el,
9785
+ n30_increaseTicketStateLength: al,
9786
+ n31_branding: il,
9787
+ n32_indexesAndNotNull: cl,
9788
+ n33_vendorIdInUniversalLoginSession: hl,
9789
+ n34_auth0ClientInUniversalLoginSession: fl,
9790
+ n35_increaseUniversalSessionStateLength: yl,
9791
+ n36_authenticationCodes: wl,
9792
+ n37_disableSignUps: kl,
9793
+ n38_otpIpAddress: Ol,
9794
+ n39_increaseUserAgentLength: Il,
9795
+ n40_userId: $l,
9796
+ n41_hooks: Dl,
9797
+ n42_userIdIndexes: Ll,
9798
+ n43_userIdIndexes: Fl,
9799
+ n44_codes: Kl,
9800
+ n45_hookProperties: ql,
9801
+ n46_loginAuth0Client: Hl,
9802
+ n47_loginAuth0Client: eu,
9803
+ n48_saml: au,
9804
+ n49_removeFields: iu,
9805
+ n50_authParamsNonce: cu,
9806
+ n51_connectionid: hu,
9807
+ n52_cert: fu,
9808
+ n53_codes_primary_key: yu,
9809
+ n54_cleanup_tables: wu,
9810
+ n55_logs_index: ku,
9811
+ n56_application_fields: Ou,
9812
+ n57_prompt_settings: Iu,
9813
+ n58_connection_client_id: $u,
9814
+ n59_connection_options: Du,
9815
+ n60_users_metadata: Lu,
9816
+ n61_userLocales: Fu,
9817
+ n62_prompt: Ku,
9818
+ n63_connection_cleanup: qu,
9819
+ n64_act_as: Hu,
9820
+ n65_code_verifier: eh,
9821
+ n66_email_providers: ah,
9822
+ n67_drop_tickets: ih,
9823
+ n68_login_useragents: ch
9856
9824
  };
9857
- async function mh(t, e = !1) {
9825
+ async function uh(t, e = !1) {
9858
9826
  e && console.log("migrating...");
9859
- const n = new qa(Qa), a = new $a({
9827
+ const n = new Ka(Ja), a = new Ia({
9860
9828
  db: t,
9861
9829
  provider: n
9862
9830
  }), { error: r, results: s } = await a.migrateToLatest();
@@ -9867,9 +9835,9 @@ async function mh(t, e = !1) {
9867
9835
  }), r)
9868
9836
  throw console.error("failed to migrate"), console.error(r), r;
9869
9837
  }
9870
- async function fh(t) {
9838
+ async function hh(t) {
9871
9839
  console.log("migrating...");
9872
- const e = new qa(Qa), n = new $a({
9840
+ const e = new Ka(Ja), n = new Ia({
9873
9841
  db: t,
9874
9842
  provider: e
9875
9843
  }), { error: a, results: r } = await n.migrateDown();
@@ -9878,29 +9846,29 @@ async function fh(t) {
9878
9846
  }), a)
9879
9847
  throw console.error("failed to migrate"), console.error(a), a;
9880
9848
  }
9881
- function _h(t) {
9849
+ function mh(t) {
9882
9850
  return {
9883
- applications: wi(t),
9884
- branding: Ko(t),
9885
- clients: Ao(t),
9886
- codes: fi(t),
9887
- connections: Po(t),
9888
- emailProviders: md(t),
9889
- domains: Fo(t),
9890
- hooks: Ho(t),
9891
- keys: Lo(t),
9892
- logins: od(t),
9893
- logs: ei(t),
9894
- passwords: li(t),
9895
- promptSettings: ld(t),
9896
- users: Fs(t),
9897
- sessions: ii(t),
9898
- tenants: Qs(t),
9899
- themes: nd(t)
9851
+ applications: yi(t),
9852
+ branding: Fo(t),
9853
+ clients: Eo(t),
9854
+ codes: hi(t),
9855
+ connections: Zo(t),
9856
+ emailProviders: ud(t),
9857
+ domains: Lo(t),
9858
+ hooks: qo(t),
9859
+ keys: Do(t),
9860
+ logins: rd(t),
9861
+ logs: Hs(t),
9862
+ passwords: oi(t),
9863
+ promptSettings: od(t),
9864
+ users: Ls(t),
9865
+ sessions: ai(t),
9866
+ tenants: Js(t),
9867
+ themes: Xo(t)
9900
9868
  };
9901
9869
  }
9902
9870
  export {
9903
- _h as default,
9904
- fh as migrateDown,
9905
- mh as migrateToLatest
9871
+ mh as default,
9872
+ hh as migrateDown,
9873
+ uh as migrateToLatest
9906
9874
  };