@learncard/ceramic-plugin 1.0.39 → 1.0.41

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.
@@ -9,8 +9,8 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
9
9
  var __esm = (fn, res) => function __init() {
10
10
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
11
  };
12
- var __commonJS = (cb, mod2) => function __require() {
13
- return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
12
+ var __commonJS = (cb, mod) => function __require() {
13
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
14
  };
15
15
  var __export = (target, all) => {
16
16
  for (var name3 in all)
@@ -24,11 +24,11 @@ var __copyProps = (to, from4, except, desc) => {
24
24
  }
25
25
  return to;
26
26
  };
27
- var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
28
- isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
29
- mod2
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
30
  ));
31
- var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
33
  // ../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js
34
34
  var require_lodash = __commonJS({
@@ -8990,8 +8990,8 @@ var require_bn = __commonJS({
8990
8990
  limbLen--;
8991
8991
  limbPow = limbPow / base4 | 0;
8992
8992
  var total = number.length - start;
8993
- var mod2 = total % limbLen;
8994
- var end = Math.min(total, total - mod2) + start;
8993
+ var mod = total % limbLen;
8994
+ var end = Math.min(total, total - mod) + start;
8995
8995
  var word = 0;
8996
8996
  for (var i2 = start; i2 < end; i2 += limbLen) {
8997
8997
  word = parseBase(number, i2, i2 + limbLen, base4);
@@ -9002,10 +9002,10 @@ var require_bn = __commonJS({
9002
9002
  this._iaddn(word);
9003
9003
  }
9004
9004
  }
9005
- if (mod2 !== 0) {
9005
+ if (mod !== 0) {
9006
9006
  var pow = 1;
9007
9007
  word = parseBase(number, i2, number.length, base4);
9008
- for (i2 = 0; i2 < mod2; i2++) {
9008
+ for (i2 = 0; i2 < mod; i2++) {
9009
9009
  pow *= base4;
9010
9010
  }
9011
9011
  this.imuln(pow);
@@ -10740,21 +10740,21 @@ var require_bn = __commonJS({
10740
10740
  mod: new BN3(0)
10741
10741
  };
10742
10742
  }
10743
- var div, mod2, res;
10743
+ var div, mod, res;
10744
10744
  if (this.negative !== 0 && num.negative === 0) {
10745
10745
  res = this.neg().divmod(num, mode);
10746
10746
  if (mode !== "mod") {
10747
10747
  div = res.div.neg();
10748
10748
  }
10749
10749
  if (mode !== "div") {
10750
- mod2 = res.mod.neg();
10751
- if (positive && mod2.negative !== 0) {
10752
- mod2.iadd(num);
10750
+ mod = res.mod.neg();
10751
+ if (positive && mod.negative !== 0) {
10752
+ mod.iadd(num);
10753
10753
  }
10754
10754
  }
10755
10755
  return {
10756
10756
  div,
10757
- mod: mod2
10757
+ mod
10758
10758
  };
10759
10759
  }
10760
10760
  if (this.negative === 0 && num.negative !== 0) {
@@ -10770,14 +10770,14 @@ var require_bn = __commonJS({
10770
10770
  if ((this.negative & num.negative) !== 0) {
10771
10771
  res = this.neg().divmod(num.neg(), mode);
10772
10772
  if (mode !== "div") {
10773
- mod2 = res.mod.neg();
10774
- if (positive && mod2.negative !== 0) {
10775
- mod2.isub(num);
10773
+ mod = res.mod.neg();
10774
+ if (positive && mod.negative !== 0) {
10775
+ mod.isub(num);
10776
10776
  }
10777
10777
  }
10778
10778
  return {
10779
10779
  div: res.div,
10780
- mod: mod2
10780
+ mod
10781
10781
  };
10782
10782
  }
10783
10783
  if (num.length > this.length || this.cmp(num) < 0) {
@@ -10809,7 +10809,7 @@ var require_bn = __commonJS({
10809
10809
  BN3.prototype.div = /* @__PURE__ */ __name(function div(num) {
10810
10810
  return this.divmod(num, "div", false).div;
10811
10811
  }, "div");
10812
- BN3.prototype.mod = /* @__PURE__ */ __name(function mod2(num) {
10812
+ BN3.prototype.mod = /* @__PURE__ */ __name(function mod(num) {
10813
10813
  return this.divmod(num, "mod", false).mod;
10814
10814
  }, "mod");
10815
10815
  BN3.prototype.umod = /* @__PURE__ */ __name(function umod(num) {
@@ -10819,10 +10819,10 @@ var require_bn = __commonJS({
10819
10819
  var dm = this.divmod(num);
10820
10820
  if (dm.mod.isZero())
10821
10821
  return dm.div;
10822
- var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
10822
+ var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
10823
10823
  var half = num.ushrn(1);
10824
10824
  var r2 = num.andln(1);
10825
- var cmp = mod2.cmp(half);
10825
+ var cmp = mod.cmp(half);
10826
10826
  if (cmp < 0 || r2 === 1 && cmp === 0)
10827
10827
  return dm.div;
10828
10828
  return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
@@ -11468,12 +11468,12 @@ var require_bn = __commonJS({
11468
11468
  var one = new BN3(1).toRed(this);
11469
11469
  var nOne = one.redNeg();
11470
11470
  var lpow = this.m.subn(1).iushrn(1);
11471
- var z = this.m.bitLength();
11472
- z = new BN3(2 * z * z).toRed(this);
11473
- while (this.pow(z, lpow).cmp(nOne) !== 0) {
11474
- z.redIAdd(nOne);
11471
+ var z2 = this.m.bitLength();
11472
+ z2 = new BN3(2 * z2 * z2).toRed(this);
11473
+ while (this.pow(z2, lpow).cmp(nOne) !== 0) {
11474
+ z2.redIAdd(nOne);
11475
11475
  }
11476
- var c = this.pow(z, q);
11476
+ var c = this.pow(z2, q);
11477
11477
  var r2 = this.pow(a2, q.addn(1).iushrn(1));
11478
11478
  var t = this.pow(a2, q);
11479
11479
  var m = s2;
@@ -11717,18 +11717,18 @@ var require_utils2 = __commonJS({
11717
11717
  var ws = 1 << w + 1;
11718
11718
  var k = num.clone();
11719
11719
  for (i2 = 0; i2 < naf.length; i2++) {
11720
- var z;
11721
- var mod2 = k.andln(ws - 1);
11720
+ var z2;
11721
+ var mod = k.andln(ws - 1);
11722
11722
  if (k.isOdd()) {
11723
- if (mod2 > (ws >> 1) - 1)
11724
- z = (ws >> 1) - mod2;
11723
+ if (mod > (ws >> 1) - 1)
11724
+ z2 = (ws >> 1) - mod;
11725
11725
  else
11726
- z = mod2;
11727
- k.isubn(z);
11726
+ z2 = mod;
11727
+ k.isubn(z2);
11728
11728
  } else {
11729
- z = 0;
11729
+ z2 = 0;
11730
11730
  }
11731
- naf[i2] = z;
11731
+ naf[i2] = z2;
11732
11732
  k.iushrn(1);
11733
11733
  }
11734
11734
  return naf;
@@ -11947,18 +11947,18 @@ var require_base = __commonJS({
11947
11947
  acc = acc.dblp(l);
11948
11948
  if (i2 < 0)
11949
11949
  break;
11950
- var z = naf[i2];
11951
- assert2(z !== 0);
11950
+ var z2 = naf[i2];
11951
+ assert2(z2 !== 0);
11952
11952
  if (p.type === "affine") {
11953
- if (z > 0)
11954
- acc = acc.mixedAdd(wnd[z - 1 >> 1]);
11953
+ if (z2 > 0)
11954
+ acc = acc.mixedAdd(wnd[z2 - 1 >> 1]);
11955
11955
  else
11956
- acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg());
11956
+ acc = acc.mixedAdd(wnd[-z2 - 1 >> 1].neg());
11957
11957
  } else {
11958
- if (z > 0)
11959
- acc = acc.add(wnd[z - 1 >> 1]);
11958
+ if (z2 > 0)
11959
+ acc = acc.add(wnd[z2 - 1 >> 1]);
11960
11960
  else
11961
- acc = acc.add(wnd[-z - 1 >> 1].neg());
11961
+ acc = acc.add(wnd[-z2 - 1 >> 1].neg());
11962
11962
  }
11963
11963
  }
11964
11964
  return p.type === "affine" ? acc.toP() : acc;
@@ -12048,14 +12048,14 @@ var require_base = __commonJS({
12048
12048
  if (i2 < 0)
12049
12049
  break;
12050
12050
  for (j = 0; j < len; j++) {
12051
- var z = tmp[j];
12051
+ var z2 = tmp[j];
12052
12052
  p;
12053
- if (z === 0)
12053
+ if (z2 === 0)
12054
12054
  continue;
12055
- else if (z > 0)
12056
- p = wnd[j][z - 1 >> 1];
12057
- else if (z < 0)
12058
- p = wnd[j][-z - 1 >> 1].neg();
12055
+ else if (z2 > 0)
12056
+ p = wnd[j][z2 - 1 >> 1];
12057
+ else if (z2 < 0)
12058
+ p = wnd[j][-z2 - 1 >> 1].neg();
12059
12059
  if (p.type === "affine")
12060
12060
  acc = acc.mixedAdd(p);
12061
12061
  else
@@ -12599,16 +12599,16 @@ var require_short = __commonJS({
12599
12599
  var res = this.curve.jpoint(this.x, this.y, this.curve.one);
12600
12600
  return res;
12601
12601
  }, "toJ");
12602
- function JPoint2(curve, x, y, z) {
12602
+ function JPoint2(curve, x, y, z2) {
12603
12603
  Base.BasePoint.call(this, curve, "jacobian");
12604
- if (x === null && y === null && z === null) {
12604
+ if (x === null && y === null && z2 === null) {
12605
12605
  this.x = this.curve.one;
12606
12606
  this.y = this.curve.one;
12607
12607
  this.z = new BN3(0);
12608
12608
  } else {
12609
12609
  this.x = new BN3(x, 16);
12610
12610
  this.y = new BN3(y, 16);
12611
- this.z = new BN3(z, 16);
12611
+ this.z = new BN3(z2, 16);
12612
12612
  }
12613
12613
  if (!this.x.red)
12614
12614
  this.x = this.x.toRed(this.curve.red);
@@ -12620,8 +12620,8 @@ var require_short = __commonJS({
12620
12620
  }
12621
12621
  __name(JPoint2, "JPoint");
12622
12622
  inherits(JPoint2, Base.BasePoint);
12623
- ShortCurve2.prototype.jpoint = /* @__PURE__ */ __name(function jpoint2(x, y, z) {
12624
- return new JPoint2(this, x, y, z);
12623
+ ShortCurve2.prototype.jpoint = /* @__PURE__ */ __name(function jpoint2(x, y, z2) {
12624
+ return new JPoint2(this, x, y, z2);
12625
12625
  }, "jpoint");
12626
12626
  JPoint2.prototype.toP = /* @__PURE__ */ __name(function toP2() {
12627
12627
  if (this.isInfinity())
@@ -12935,14 +12935,14 @@ var require_mont = __commonJS({
12935
12935
  var y = rhs.redSqrt();
12936
12936
  return y.redSqr().cmp(rhs) === 0;
12937
12937
  }, "validate");
12938
- function Point2(curve, x, z) {
12938
+ function Point2(curve, x, z2) {
12939
12939
  Base.BasePoint.call(this, curve, "projective");
12940
- if (x === null && z === null) {
12940
+ if (x === null && z2 === null) {
12941
12941
  this.x = this.curve.one;
12942
12942
  this.z = this.curve.zero;
12943
12943
  } else {
12944
12944
  this.x = new BN3(x, 16);
12945
- this.z = new BN3(z, 16);
12945
+ this.z = new BN3(z2, 16);
12946
12946
  if (!this.x.red)
12947
12947
  this.x = this.x.toRed(this.curve.red);
12948
12948
  if (!this.z.red)
@@ -12954,8 +12954,8 @@ var require_mont = __commonJS({
12954
12954
  MontCurve.prototype.decodePoint = /* @__PURE__ */ __name(function decodePoint2(bytes, enc) {
12955
12955
  return this.point(utils.toArray(bytes, enc), 1);
12956
12956
  }, "decodePoint");
12957
- MontCurve.prototype.point = /* @__PURE__ */ __name(function point3(x, z) {
12958
- return new Point2(this, x, z);
12957
+ MontCurve.prototype.point = /* @__PURE__ */ __name(function point3(x, z2) {
12958
+ return new Point2(this, x, z2);
12959
12959
  }, "point");
12960
12960
  MontCurve.prototype.pointFromJSON = /* @__PURE__ */ __name(function pointFromJSON2(obj) {
12961
12961
  return Point2.fromJSON(this, obj);
@@ -13077,8 +13077,8 @@ var require_edwards = __commonJS({
13077
13077
  else
13078
13078
  return this.c.redMul(num);
13079
13079
  }, "_mulC");
13080
- EdwardsCurve.prototype.jpoint = /* @__PURE__ */ __name(function jpoint2(x, y, z, t) {
13081
- return this.point(x, y, z, t);
13080
+ EdwardsCurve.prototype.jpoint = /* @__PURE__ */ __name(function jpoint2(x, y, z2, t) {
13081
+ return this.point(x, y, z2, t);
13082
13082
  }, "jpoint");
13083
13083
  EdwardsCurve.prototype.pointFromX = /* @__PURE__ */ __name(function pointFromX2(x, odd) {
13084
13084
  x = new BN3(x, 16);
@@ -13127,9 +13127,9 @@ var require_edwards = __commonJS({
13127
13127
  var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
13128
13128
  return lhs.cmp(rhs) === 0;
13129
13129
  }, "validate");
13130
- function Point2(curve, x, y, z, t) {
13130
+ function Point2(curve, x, y, z2, t) {
13131
13131
  Base.BasePoint.call(this, curve, "projective");
13132
- if (x === null && y === null && z === null) {
13132
+ if (x === null && y === null && z2 === null) {
13133
13133
  this.x = this.curve.zero;
13134
13134
  this.y = this.curve.one;
13135
13135
  this.z = this.curve.one;
@@ -13138,7 +13138,7 @@ var require_edwards = __commonJS({
13138
13138
  } else {
13139
13139
  this.x = new BN3(x, 16);
13140
13140
  this.y = new BN3(y, 16);
13141
- this.z = z ? new BN3(z, 16) : this.curve.one;
13141
+ this.z = z2 ? new BN3(z2, 16) : this.curve.one;
13142
13142
  this.t = t && new BN3(t, 16);
13143
13143
  if (!this.x.red)
13144
13144
  this.x = this.x.toRed(this.curve.red);
@@ -13161,8 +13161,8 @@ var require_edwards = __commonJS({
13161
13161
  EdwardsCurve.prototype.pointFromJSON = /* @__PURE__ */ __name(function pointFromJSON2(obj) {
13162
13162
  return Point2.fromJSON(this, obj);
13163
13163
  }, "pointFromJSON");
13164
- EdwardsCurve.prototype.point = /* @__PURE__ */ __name(function point3(x, y, z, t) {
13165
- return new Point2(this, x, y, z, t);
13164
+ EdwardsCurve.prototype.point = /* @__PURE__ */ __name(function point3(x, y, z2, t) {
13165
+ return new Point2(this, x, y, z2, t);
13166
13166
  }, "point");
13167
13167
  Point2.fromJSON = /* @__PURE__ */ __name(function fromJSON2(curve, obj) {
13168
13168
  return new Point2(curve, obj[0], obj[1], obj[2]);
@@ -13711,28 +13711,28 @@ var require_common2 = __commonJS({
13711
13711
  "use strict";
13712
13712
  var utils = require_utils3();
13713
13713
  var rotr32 = utils.rotr32;
13714
- function ft_1(s2, x, y, z) {
13714
+ function ft_1(s2, x, y, z2) {
13715
13715
  if (s2 === 0)
13716
- return ch32(x, y, z);
13716
+ return ch32(x, y, z2);
13717
13717
  if (s2 === 1 || s2 === 3)
13718
- return p32(x, y, z);
13718
+ return p32(x, y, z2);
13719
13719
  if (s2 === 2)
13720
- return maj32(x, y, z);
13720
+ return maj32(x, y, z2);
13721
13721
  }
13722
13722
  __name(ft_1, "ft_1");
13723
13723
  exports.ft_1 = ft_1;
13724
- function ch32(x, y, z) {
13725
- return x & y ^ ~x & z;
13724
+ function ch32(x, y, z2) {
13725
+ return x & y ^ ~x & z2;
13726
13726
  }
13727
13727
  __name(ch32, "ch32");
13728
13728
  exports.ch32 = ch32;
13729
- function maj32(x, y, z) {
13730
- return x & y ^ x & z ^ y & z;
13729
+ function maj32(x, y, z2) {
13730
+ return x & y ^ x & z2 ^ y & z2;
13731
13731
  }
13732
13732
  __name(maj32, "maj32");
13733
13733
  exports.maj32 = maj32;
13734
- function p32(x, y, z) {
13735
- return x ^ y ^ z;
13734
+ function p32(x, y, z2) {
13735
+ return x ^ y ^ z2;
13736
13736
  }
13737
13737
  __name(p32, "p32");
13738
13738
  exports.p32 = p32;
@@ -14606,17 +14606,17 @@ var require_ripemd = __commonJS({
14606
14606
  else
14607
14607
  return utils.split32(this.h, "little");
14608
14608
  }, "digest");
14609
- function f(j, x, y, z) {
14609
+ function f(j, x, y, z2) {
14610
14610
  if (j <= 15)
14611
- return x ^ y ^ z;
14611
+ return x ^ y ^ z2;
14612
14612
  else if (j <= 31)
14613
- return x & y | ~x & z;
14613
+ return x & y | ~x & z2;
14614
14614
  else if (j <= 47)
14615
- return (x | ~y) ^ z;
14615
+ return (x | ~y) ^ z2;
14616
14616
  else if (j <= 63)
14617
- return x & z | y & ~z;
14617
+ return x & z2 | y & ~z2;
14618
14618
  else
14619
- return x ^ (y | ~z);
14619
+ return x ^ (y | ~z2);
14620
14620
  }
14621
14621
  __name(f, "f");
14622
14622
  function K(j) {
@@ -18512,9 +18512,9 @@ var require_ed25519 = __commonJS({
18512
18512
  sub(b, gf1, y);
18513
18513
  inv25519(b, b);
18514
18514
  mul3(a2, a2, b);
18515
- let z = new Uint8Array(32);
18516
- pack25519(z, a2);
18517
- return z;
18515
+ let z2 = new Uint8Array(32);
18516
+ pack25519(z2, a2);
18517
+ return z2;
18518
18518
  }
18519
18519
  __name(convertPublicKeyToX255192, "convertPublicKeyToX25519");
18520
18520
  exports.convertPublicKeyToX25519 = convertPublicKeyToX255192;
@@ -19074,21 +19074,21 @@ var require_x25519 = __commonJS({
19074
19074
  }
19075
19075
  __name(inv25519, "inv25519");
19076
19076
  function scalarMult(n2, p) {
19077
- const z = new Uint8Array(32);
19077
+ const z2 = new Uint8Array(32);
19078
19078
  const x = new Float64Array(80);
19079
19079
  const a2 = gf(), b = gf(), c = gf(), d = gf(), e2 = gf(), f = gf();
19080
19080
  for (let i2 = 0; i2 < 31; i2++) {
19081
- z[i2] = n2[i2];
19081
+ z2[i2] = n2[i2];
19082
19082
  }
19083
- z[31] = n2[31] & 127 | 64;
19084
- z[0] &= 248;
19083
+ z2[31] = n2[31] & 127 | 64;
19084
+ z2[0] &= 248;
19085
19085
  unpack25519(x, p);
19086
19086
  for (let i2 = 0; i2 < 16; i2++) {
19087
19087
  b[i2] = x[i2];
19088
19088
  }
19089
19089
  a2[0] = d[0] = 1;
19090
19090
  for (let i2 = 254; i2 >= 0; --i2) {
19091
- const r2 = z[i2 >>> 3] >>> (i2 & 7) & 1;
19091
+ const r2 = z2[i2 >>> 3] >>> (i2 & 7) & 1;
19092
19092
  sel25519(a2, b, r2);
19093
19093
  sel25519(c, d, r2);
19094
19094
  add3(e2, a2, c);
@@ -31377,8 +31377,8 @@ var require_bn2 = __commonJS({
31377
31377
  limbLen--;
31378
31378
  limbPow = limbPow / base4 | 0;
31379
31379
  var total = number.length - start;
31380
- var mod2 = total % limbLen;
31381
- var end = Math.min(total, total - mod2) + start;
31380
+ var mod = total % limbLen;
31381
+ var end = Math.min(total, total - mod) + start;
31382
31382
  var word = 0;
31383
31383
  for (var i2 = start; i2 < end; i2 += limbLen) {
31384
31384
  word = parseBase(number, i2, i2 + limbLen, base4);
@@ -31389,10 +31389,10 @@ var require_bn2 = __commonJS({
31389
31389
  this._iaddn(word);
31390
31390
  }
31391
31391
  }
31392
- if (mod2 !== 0) {
31392
+ if (mod !== 0) {
31393
31393
  var pow = 1;
31394
31394
  word = parseBase(number, i2, number.length, base4);
31395
- for (i2 = 0; i2 < mod2; i2++) {
31395
+ for (i2 = 0; i2 < mod; i2++) {
31396
31396
  pow *= base4;
31397
31397
  }
31398
31398
  this.imuln(pow);
@@ -33196,21 +33196,21 @@ var require_bn2 = __commonJS({
33196
33196
  mod: new BN3(0)
33197
33197
  };
33198
33198
  }
33199
- var div, mod2, res;
33199
+ var div, mod, res;
33200
33200
  if (this.negative !== 0 && num.negative === 0) {
33201
33201
  res = this.neg().divmod(num, mode);
33202
33202
  if (mode !== "mod") {
33203
33203
  div = res.div.neg();
33204
33204
  }
33205
33205
  if (mode !== "div") {
33206
- mod2 = res.mod.neg();
33207
- if (positive && mod2.negative !== 0) {
33208
- mod2.iadd(num);
33206
+ mod = res.mod.neg();
33207
+ if (positive && mod.negative !== 0) {
33208
+ mod.iadd(num);
33209
33209
  }
33210
33210
  }
33211
33211
  return {
33212
33212
  div,
33213
- mod: mod2
33213
+ mod
33214
33214
  };
33215
33215
  }
33216
33216
  if (this.negative === 0 && num.negative !== 0) {
@@ -33226,14 +33226,14 @@ var require_bn2 = __commonJS({
33226
33226
  if ((this.negative & num.negative) !== 0) {
33227
33227
  res = this.neg().divmod(num.neg(), mode);
33228
33228
  if (mode !== "div") {
33229
- mod2 = res.mod.neg();
33230
- if (positive && mod2.negative !== 0) {
33231
- mod2.isub(num);
33229
+ mod = res.mod.neg();
33230
+ if (positive && mod.negative !== 0) {
33231
+ mod.isub(num);
33232
33232
  }
33233
33233
  }
33234
33234
  return {
33235
33235
  div: res.div,
33236
- mod: mod2
33236
+ mod
33237
33237
  };
33238
33238
  }
33239
33239
  if (num.length > this.length || this.cmp(num) < 0) {
@@ -33265,7 +33265,7 @@ var require_bn2 = __commonJS({
33265
33265
  BN3.prototype.div = /* @__PURE__ */ __name(function div(num) {
33266
33266
  return this.divmod(num, "div", false).div;
33267
33267
  }, "div");
33268
- BN3.prototype.mod = /* @__PURE__ */ __name(function mod2(num) {
33268
+ BN3.prototype.mod = /* @__PURE__ */ __name(function mod(num) {
33269
33269
  return this.divmod(num, "mod", false).mod;
33270
33270
  }, "mod");
33271
33271
  BN3.prototype.umod = /* @__PURE__ */ __name(function umod(num) {
@@ -33275,10 +33275,10 @@ var require_bn2 = __commonJS({
33275
33275
  var dm = this.divmod(num);
33276
33276
  if (dm.mod.isZero())
33277
33277
  return dm.div;
33278
- var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
33278
+ var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
33279
33279
  var half = num.ushrn(1);
33280
33280
  var r2 = num.andln(1);
33281
- var cmp = mod2.cmp(half);
33281
+ var cmp = mod.cmp(half);
33282
33282
  if (cmp < 0 || r2 === 1 && cmp === 0)
33283
33283
  return dm.div;
33284
33284
  return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
@@ -33935,12 +33935,12 @@ var require_bn2 = __commonJS({
33935
33935
  var one = new BN3(1).toRed(this);
33936
33936
  var nOne = one.redNeg();
33937
33937
  var lpow = this.m.subn(1).iushrn(1);
33938
- var z = this.m.bitLength();
33939
- z = new BN3(2 * z * z).toRed(this);
33940
- while (this.pow(z, lpow).cmp(nOne) !== 0) {
33941
- z.redIAdd(nOne);
33938
+ var z2 = this.m.bitLength();
33939
+ z2 = new BN3(2 * z2 * z2).toRed(this);
33940
+ while (this.pow(z2, lpow).cmp(nOne) !== 0) {
33941
+ z2.redIAdd(nOne);
33942
33942
  }
33943
- var c = this.pow(z, q);
33943
+ var c = this.pow(z2, q);
33944
33944
  var r2 = this.pow(a2, q.addn(1).iushrn(1));
33945
33945
  var t = this.pow(a2, q);
33946
33946
  var m = s2;
@@ -41999,18 +41999,18 @@ var utils_1$1 = createCommonjsModule(function(module2, exports) {
41999
41999
  var ws = 1 << w + 1;
42000
42000
  var k = num.clone();
42001
42001
  for (i2 = 0; i2 < naf.length; i2++) {
42002
- var z;
42003
- var mod2 = k.andln(ws - 1);
42002
+ var z2;
42003
+ var mod = k.andln(ws - 1);
42004
42004
  if (k.isOdd()) {
42005
- if (mod2 > (ws >> 1) - 1)
42006
- z = (ws >> 1) - mod2;
42005
+ if (mod > (ws >> 1) - 1)
42006
+ z2 = (ws >> 1) - mod;
42007
42007
  else
42008
- z = mod2;
42009
- k.isubn(z);
42008
+ z2 = mod;
42009
+ k.isubn(z2);
42010
42010
  } else {
42011
- z = 0;
42011
+ z2 = 0;
42012
42012
  }
42013
- naf[i2] = z;
42013
+ naf[i2] = z2;
42014
42014
  k.iushrn(1);
42015
42015
  }
42016
42016
  return naf;
@@ -42163,18 +42163,18 @@ BaseCurve.prototype._wnafMul = /* @__PURE__ */ __name(function _wnafMul(p, k) {
42163
42163
  acc = acc.dblp(l);
42164
42164
  if (i2 < 0)
42165
42165
  break;
42166
- var z = naf[i2];
42167
- assert$1(z !== 0);
42166
+ var z2 = naf[i2];
42167
+ assert$1(z2 !== 0);
42168
42168
  if (p.type === "affine") {
42169
- if (z > 0)
42170
- acc = acc.mixedAdd(wnd[z - 1 >> 1]);
42169
+ if (z2 > 0)
42170
+ acc = acc.mixedAdd(wnd[z2 - 1 >> 1]);
42171
42171
  else
42172
- acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg());
42172
+ acc = acc.mixedAdd(wnd[-z2 - 1 >> 1].neg());
42173
42173
  } else {
42174
- if (z > 0)
42175
- acc = acc.add(wnd[z - 1 >> 1]);
42174
+ if (z2 > 0)
42175
+ acc = acc.add(wnd[z2 - 1 >> 1]);
42176
42176
  else
42177
- acc = acc.add(wnd[-z - 1 >> 1].neg());
42177
+ acc = acc.add(wnd[-z2 - 1 >> 1].neg());
42178
42178
  }
42179
42179
  }
42180
42180
  return p.type === "affine" ? acc.toP() : acc;
@@ -42264,14 +42264,14 @@ BaseCurve.prototype._wnafMulAdd = /* @__PURE__ */ __name(function _wnafMulAdd(de
42264
42264
  if (i2 < 0)
42265
42265
  break;
42266
42266
  for (j = 0; j < len; j++) {
42267
- var z = tmp[j];
42267
+ var z2 = tmp[j];
42268
42268
  p;
42269
- if (z === 0)
42269
+ if (z2 === 0)
42270
42270
  continue;
42271
- else if (z > 0)
42272
- p = wnd[j][z - 1 >> 1];
42273
- else if (z < 0)
42274
- p = wnd[j][-z - 1 >> 1].neg();
42271
+ else if (z2 > 0)
42272
+ p = wnd[j][z2 - 1 >> 1];
42273
+ else if (z2 < 0)
42274
+ p = wnd[j][-z2 - 1 >> 1].neg();
42275
42275
  if (p.type === "affine")
42276
42276
  acc = acc.mixedAdd(p);
42277
42277
  else
@@ -42800,16 +42800,16 @@ Point.prototype.toJ = /* @__PURE__ */ __name(function toJ() {
42800
42800
  var res = this.curve.jpoint(this.x, this.y, this.curve.one);
42801
42801
  return res;
42802
42802
  }, "toJ");
42803
- function JPoint(curve, x, y, z) {
42803
+ function JPoint(curve, x, y, z2) {
42804
42804
  base3.BasePoint.call(this, curve, "jacobian");
42805
- if (x === null && y === null && z === null) {
42805
+ if (x === null && y === null && z2 === null) {
42806
42806
  this.x = this.curve.one;
42807
42807
  this.y = this.curve.one;
42808
42808
  this.z = new import_bn2.default(0);
42809
42809
  } else {
42810
42810
  this.x = new import_bn2.default(x, 16);
42811
42811
  this.y = new import_bn2.default(y, 16);
42812
- this.z = new import_bn2.default(z, 16);
42812
+ this.z = new import_bn2.default(z2, 16);
42813
42813
  }
42814
42814
  if (!this.x.red)
42815
42815
  this.x = this.x.toRed(this.curve.red);
@@ -42821,8 +42821,8 @@ function JPoint(curve, x, y, z) {
42821
42821
  }
42822
42822
  __name(JPoint, "JPoint");
42823
42823
  inherits_browser(JPoint, base3.BasePoint);
42824
- ShortCurve.prototype.jpoint = /* @__PURE__ */ __name(function jpoint(x, y, z) {
42825
- return new JPoint(this, x, y, z);
42824
+ ShortCurve.prototype.jpoint = /* @__PURE__ */ __name(function jpoint(x, y, z2) {
42825
+ return new JPoint(this, x, y, z2);
42826
42826
  }, "jpoint");
42827
42827
  JPoint.prototype.toP = /* @__PURE__ */ __name(function toP() {
42828
42828
  if (this.isInfinity())
@@ -49926,7 +49926,7 @@ var CeramicClient = class {
49926
49926
  };
49927
49927
  __name(CeramicClient, "CeramicClient");
49928
49928
 
49929
- // ../../../node_modules/.pnpm/zod@3.20.2/node_modules/zod/lib/index.mjs
49929
+ // ../../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
49930
49930
  var util;
49931
49931
  (function(util2) {
49932
49932
  util2.assertEqual = (val) => val;
@@ -49988,6 +49988,15 @@ var util;
49988
49988
  return value;
49989
49989
  };
49990
49990
  })(util || (util = {}));
49991
+ var objectUtil;
49992
+ (function(objectUtil2) {
49993
+ objectUtil2.mergeShapes = (first2, second) => {
49994
+ return {
49995
+ ...first2,
49996
+ ...second
49997
+ };
49998
+ };
49999
+ })(objectUtil || (objectUtil = {}));
49991
50000
  var ZodParsedType = util.arrayToEnum([
49992
50001
  "string",
49993
50002
  "nan",
@@ -50131,6 +50140,11 @@ var ZodError = class extends Error {
50131
50140
  processError(this);
50132
50141
  return fieldErrors;
50133
50142
  }
50143
+ static assert(value) {
50144
+ if (!(value instanceof ZodError)) {
50145
+ throw new Error(`Not a ZodError: ${value}`);
50146
+ }
50147
+ }
50134
50148
  toString() {
50135
50149
  return this.message;
50136
50150
  }
@@ -50198,7 +50212,12 @@ var errorMap = /* @__PURE__ */ __name((issue, _ctx) => {
50198
50212
  break;
50199
50213
  case ZodIssueCode.invalid_string:
50200
50214
  if (typeof issue.validation === "object") {
50201
- if ("startsWith" in issue.validation) {
50215
+ if ("includes" in issue.validation) {
50216
+ message = `Invalid input: must include "${issue.validation.includes}"`;
50217
+ if (typeof issue.validation.position === "number") {
50218
+ message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
50219
+ }
50220
+ } else if ("startsWith" in issue.validation) {
50202
50221
  message = `Invalid input: must start with "${issue.validation.startsWith}"`;
50203
50222
  } else if ("endsWith" in issue.validation) {
50204
50223
  message = `Invalid input: must end with "${issue.validation.endsWith}"`;
@@ -50219,7 +50238,7 @@ var errorMap = /* @__PURE__ */ __name((issue, _ctx) => {
50219
50238
  else if (issue.type === "number")
50220
50239
  message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
50221
50240
  else if (issue.type === "date")
50222
- message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(issue.minimum)}`;
50241
+ message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
50223
50242
  else
50224
50243
  message = "Invalid input";
50225
50244
  break;
@@ -50230,8 +50249,10 @@ var errorMap = /* @__PURE__ */ __name((issue, _ctx) => {
50230
50249
  message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
50231
50250
  else if (issue.type === "number")
50232
50251
  message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
50252
+ else if (issue.type === "bigint")
50253
+ message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
50233
50254
  else if (issue.type === "date")
50234
- message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(issue.maximum)}`;
50255
+ message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
50235
50256
  else
50236
50257
  message = "Invalid input";
50237
50258
  break;
@@ -50269,6 +50290,13 @@ var makeIssue = /* @__PURE__ */ __name((params) => {
50269
50290
  ...issueData,
50270
50291
  path: fullPath
50271
50292
  };
50293
+ if (issueData.message !== void 0) {
50294
+ return {
50295
+ ...issueData,
50296
+ path: fullPath,
50297
+ message: issueData.message
50298
+ };
50299
+ }
50272
50300
  let errorMessage = "";
50273
50301
  const maps = errorMaps.filter((m) => !!m).slice().reverse();
50274
50302
  for (const map2 of maps) {
@@ -50277,11 +50305,12 @@ var makeIssue = /* @__PURE__ */ __name((params) => {
50277
50305
  return {
50278
50306
  ...issueData,
50279
50307
  path: fullPath,
50280
- message: issueData.message || errorMessage
50308
+ message: errorMessage
50281
50309
  };
50282
50310
  }, "makeIssue");
50283
50311
  var EMPTY_PATH = [];
50284
50312
  function addIssueToContext(ctx, issueData) {
50313
+ const overrideMap = getErrorMap();
50285
50314
  const issue = makeIssue({
50286
50315
  issueData,
50287
50316
  data: ctx.data,
@@ -50289,8 +50318,8 @@ function addIssueToContext(ctx, issueData) {
50289
50318
  errorMaps: [
50290
50319
  ctx.common.contextualErrorMap,
50291
50320
  ctx.schemaErrorMap,
50292
- getErrorMap(),
50293
- errorMap
50321
+ overrideMap,
50322
+ overrideMap === errorMap ? void 0 : errorMap
50294
50323
  ].filter((x) => !!x)
50295
50324
  });
50296
50325
  ctx.common.issues.push(issue);
@@ -50322,9 +50351,11 @@ var ParseStatus = class {
50322
50351
  static async mergeObjectAsync(status, pairs) {
50323
50352
  const syncPairs = [];
50324
50353
  for (const pair of pairs) {
50354
+ const key2 = await pair.key;
50355
+ const value = await pair.value;
50325
50356
  syncPairs.push({
50326
- key: await pair.key,
50327
- value: await pair.value
50357
+ key: key2,
50358
+ value
50328
50359
  });
50329
50360
  }
50330
50361
  return ParseStatus.mergeObjectSync(status, syncPairs);
@@ -50341,7 +50372,7 @@ var ParseStatus = class {
50341
50372
  status.dirty();
50342
50373
  if (value.status === "dirty")
50343
50374
  status.dirty();
50344
- if (typeof value.value !== "undefined" || pair.alwaysSet) {
50375
+ if (key2.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
50345
50376
  finalObject[key2.value] = value.value;
50346
50377
  }
50347
50378
  }
@@ -50357,21 +50388,49 @@ var OK = /* @__PURE__ */ __name((value) => ({ status: "valid", value }), "OK");
50357
50388
  var isAborted = /* @__PURE__ */ __name((x) => x.status === "aborted", "isAborted");
50358
50389
  var isDirty = /* @__PURE__ */ __name((x) => x.status === "dirty", "isDirty");
50359
50390
  var isValid = /* @__PURE__ */ __name((x) => x.status === "valid", "isValid");
50360
- var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== void 0 && x instanceof Promise, "isAsync");
50391
+ var isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== "undefined" && x instanceof Promise, "isAsync");
50392
+ function __classPrivateFieldGet2(receiver, state, kind, f) {
50393
+ if (kind === "a" && !f)
50394
+ throw new TypeError("Private accessor was defined without a getter");
50395
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
50396
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
50397
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
50398
+ }
50399
+ __name(__classPrivateFieldGet2, "__classPrivateFieldGet");
50400
+ function __classPrivateFieldSet2(receiver, state, value, kind, f) {
50401
+ if (kind === "m")
50402
+ throw new TypeError("Private method is not writable");
50403
+ if (kind === "a" && !f)
50404
+ throw new TypeError("Private accessor was defined without a setter");
50405
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
50406
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
50407
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
50408
+ }
50409
+ __name(__classPrivateFieldSet2, "__classPrivateFieldSet");
50361
50410
  var errorUtil;
50362
50411
  (function(errorUtil2) {
50363
50412
  errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
50364
50413
  errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
50365
50414
  })(errorUtil || (errorUtil = {}));
50415
+ var _ZodEnum_cache;
50416
+ var _ZodNativeEnum_cache;
50366
50417
  var ParseInputLazyPath = class {
50367
50418
  constructor(parent, value, path, key2) {
50419
+ this._cachedPath = [];
50368
50420
  this.parent = parent;
50369
50421
  this.data = value;
50370
50422
  this._path = path;
50371
50423
  this._key = key2;
50372
50424
  }
50373
50425
  get path() {
50374
- return this._path.concat(this._key);
50426
+ if (!this._cachedPath.length) {
50427
+ if (this._key instanceof Array) {
50428
+ this._cachedPath.push(...this._path, ...this._key);
50429
+ } else {
50430
+ this._cachedPath.push(...this._path, this._key);
50431
+ }
50432
+ }
50433
+ return this._cachedPath;
50375
50434
  }
50376
50435
  };
50377
50436
  __name(ParseInputLazyPath, "ParseInputLazyPath");
@@ -50382,8 +50441,16 @@ var handleResult = /* @__PURE__ */ __name((ctx, result) => {
50382
50441
  if (!ctx.common.issues.length) {
50383
50442
  throw new Error("Validation failed but no issues detected.");
50384
50443
  }
50385
- const error = new ZodError(ctx.common.issues);
50386
- return { success: false, error };
50444
+ return {
50445
+ success: false,
50446
+ get error() {
50447
+ if (this._error)
50448
+ return this._error;
50449
+ const error = new ZodError(ctx.common.issues);
50450
+ this._error = error;
50451
+ return this._error;
50452
+ }
50453
+ };
50387
50454
  }
50388
50455
  }, "handleResult");
50389
50456
  function processCreateParams(params) {
@@ -50396,12 +50463,17 @@ function processCreateParams(params) {
50396
50463
  if (errorMap2)
50397
50464
  return { errorMap: errorMap2, description };
50398
50465
  const customMap = /* @__PURE__ */ __name((iss, ctx) => {
50399
- if (iss.code !== "invalid_type")
50400
- return { message: ctx.defaultError };
50466
+ var _a, _b;
50467
+ const { message } = params;
50468
+ if (iss.code === "invalid_enum_value") {
50469
+ return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
50470
+ }
50401
50471
  if (typeof ctx.data === "undefined") {
50402
- return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
50472
+ return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
50403
50473
  }
50404
- return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
50474
+ if (iss.code !== "invalid_type")
50475
+ return { message: ctx.defaultError };
50476
+ return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
50405
50477
  }, "customMap");
50406
50478
  return { errorMap: customMap, description };
50407
50479
  }
@@ -50431,6 +50503,7 @@ var ZodType = class {
50431
50503
  this.catch = this.catch.bind(this);
50432
50504
  this.describe = this.describe.bind(this);
50433
50505
  this.pipe = this.pipe.bind(this);
50506
+ this.readonly = this.readonly.bind(this);
50434
50507
  this.isNullable = this.isNullable.bind(this);
50435
50508
  this.isOptional = this.isOptional.bind(this);
50436
50509
  }
@@ -50575,28 +50648,29 @@ var ZodType = class {
50575
50648
  return this._refinement(refinement);
50576
50649
  }
50577
50650
  optional() {
50578
- return ZodOptional.create(this);
50651
+ return ZodOptional.create(this, this._def);
50579
50652
  }
50580
50653
  nullable() {
50581
- return ZodNullable.create(this);
50654
+ return ZodNullable.create(this, this._def);
50582
50655
  }
50583
50656
  nullish() {
50584
- return this.optional().nullable();
50657
+ return this.nullable().optional();
50585
50658
  }
50586
50659
  array() {
50587
- return ZodArray.create(this);
50660
+ return ZodArray.create(this, this._def);
50588
50661
  }
50589
50662
  promise() {
50590
- return ZodPromise.create(this);
50663
+ return ZodPromise.create(this, this._def);
50591
50664
  }
50592
50665
  or(option) {
50593
- return ZodUnion.create([this, option]);
50666
+ return ZodUnion.create([this, option], this._def);
50594
50667
  }
50595
50668
  and(incoming) {
50596
- return ZodIntersection.create(this, incoming);
50669
+ return ZodIntersection.create(this, incoming, this._def);
50597
50670
  }
50598
50671
  transform(transform) {
50599
50672
  return new ZodEffects({
50673
+ ...processCreateParams(this._def),
50600
50674
  schema: this,
50601
50675
  typeName: ZodFirstPartyTypeKind.ZodEffects,
50602
50676
  effect: { type: "transform", transform }
@@ -50605,6 +50679,7 @@ var ZodType = class {
50605
50679
  default(def) {
50606
50680
  const defaultValueFunc = typeof def === "function" ? def : () => def;
50607
50681
  return new ZodDefault({
50682
+ ...processCreateParams(this._def),
50608
50683
  innerType: this,
50609
50684
  defaultValue: defaultValueFunc,
50610
50685
  typeName: ZodFirstPartyTypeKind.ZodDefault
@@ -50614,14 +50689,15 @@ var ZodType = class {
50614
50689
  return new ZodBranded({
50615
50690
  typeName: ZodFirstPartyTypeKind.ZodBranded,
50616
50691
  type: this,
50617
- ...processCreateParams(void 0)
50692
+ ...processCreateParams(this._def)
50618
50693
  });
50619
50694
  }
50620
50695
  catch(def) {
50621
- const defaultValueFunc = typeof def === "function" ? def : () => def;
50696
+ const catchValueFunc = typeof def === "function" ? def : () => def;
50622
50697
  return new ZodCatch({
50698
+ ...processCreateParams(this._def),
50623
50699
  innerType: this,
50624
- defaultValue: defaultValueFunc,
50700
+ catchValue: catchValueFunc,
50625
50701
  typeName: ZodFirstPartyTypeKind.ZodCatch
50626
50702
  });
50627
50703
  }
@@ -50635,6 +50711,9 @@ var ZodType = class {
50635
50711
  pipe(target) {
50636
50712
  return ZodPipeline.create(this, target);
50637
50713
  }
50714
+ readonly() {
50715
+ return ZodReadonly.create(this);
50716
+ }
50638
50717
  isOptional() {
50639
50718
  return this.safeParse(void 0).success;
50640
50719
  }
@@ -50644,43 +50723,54 @@ var ZodType = class {
50644
50723
  };
50645
50724
  __name(ZodType, "ZodType");
50646
50725
  var cuidRegex = /^c[^\s-]{8,}$/i;
50647
- var uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
50648
- var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
50649
- var datetimeRegex = /* @__PURE__ */ __name((args) => {
50726
+ var cuid2Regex = /^[0-9a-z]+$/;
50727
+ var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
50728
+ var uuidRegex = /^[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;
50729
+ var nanoidRegex = /^[a-z0-9_-]{21}$/i;
50730
+ var durationRegex = /^[-+]?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)?)??$/;
50731
+ var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
50732
+ var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
50733
+ var emojiRegex;
50734
+ var ipv4Regex = /^(?:(?: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])$/;
50735
+ var ipv6Regex = /^(([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})))$/;
50736
+ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
50737
+ var dateRegexSource = `((\\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])))`;
50738
+ var dateRegex = new RegExp(`^${dateRegexSource}$`);
50739
+ function timeRegexSource(args) {
50740
+ let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
50650
50741
  if (args.precision) {
50651
- if (args.offset) {
50652
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
50653
- } else {
50654
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
50655
- }
50656
- } else if (args.precision === 0) {
50657
- if (args.offset) {
50658
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
50659
- } else {
50660
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
50661
- }
50662
- } else {
50663
- if (args.offset) {
50664
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
50665
- } else {
50666
- return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
50667
- }
50742
+ regex = `${regex}\\.\\d{${args.precision}}`;
50743
+ } else if (args.precision == null) {
50744
+ regex = `${regex}(\\.\\d+)?`;
50745
+ }
50746
+ return regex;
50747
+ }
50748
+ __name(timeRegexSource, "timeRegexSource");
50749
+ function timeRegex(args) {
50750
+ return new RegExp(`^${timeRegexSource(args)}$`);
50751
+ }
50752
+ __name(timeRegex, "timeRegex");
50753
+ function datetimeRegex(args) {
50754
+ let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
50755
+ const opts = [];
50756
+ opts.push(args.local ? `Z?` : `Z`);
50757
+ if (args.offset)
50758
+ opts.push(`([+-]\\d{2}:?\\d{2})`);
50759
+ regex = `${regex}(${opts.join("|")})`;
50760
+ return new RegExp(`^${regex}$`);
50761
+ }
50762
+ __name(datetimeRegex, "datetimeRegex");
50763
+ function isValidIP(ip, version11) {
50764
+ if ((version11 === "v4" || !version11) && ipv4Regex.test(ip)) {
50765
+ return true;
50668
50766
  }
50669
- }, "datetimeRegex");
50670
- var ZodString = class extends ZodType {
50671
- constructor() {
50672
- super(...arguments);
50673
- this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
50674
- validation,
50675
- code: ZodIssueCode.invalid_string,
50676
- ...errorUtil.errToObj(message)
50677
- });
50678
- this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
50679
- this.trim = () => new ZodString({
50680
- ...this._def,
50681
- checks: [...this._def.checks, { kind: "trim" }]
50682
- });
50767
+ if ((version11 === "v6" || !version11) && ipv6Regex.test(ip)) {
50768
+ return true;
50683
50769
  }
50770
+ return false;
50771
+ }
50772
+ __name(isValidIP, "isValidIP");
50773
+ var ZodString = class extends ZodType {
50684
50774
  _parse(input) {
50685
50775
  if (this._def.coerce) {
50686
50776
  input.data = String(input.data);
@@ -50688,14 +50778,11 @@ var ZodString = class extends ZodType {
50688
50778
  const parsedType = this._getType(input);
50689
50779
  if (parsedType !== ZodParsedType.string) {
50690
50780
  const ctx2 = this._getOrReturnCtx(input);
50691
- addIssueToContext(
50692
- ctx2,
50693
- {
50694
- code: ZodIssueCode.invalid_type,
50695
- expected: ZodParsedType.string,
50696
- received: ctx2.parsedType
50697
- }
50698
- );
50781
+ addIssueToContext(ctx2, {
50782
+ code: ZodIssueCode.invalid_type,
50783
+ expected: ZodParsedType.string,
50784
+ received: ctx2.parsedType
50785
+ });
50699
50786
  return INVALID;
50700
50787
  }
50701
50788
  const status = new ParseStatus();
@@ -50763,6 +50850,19 @@ var ZodString = class extends ZodType {
50763
50850
  });
50764
50851
  status.dirty();
50765
50852
  }
50853
+ } else if (check.kind === "emoji") {
50854
+ if (!emojiRegex) {
50855
+ emojiRegex = new RegExp(_emojiRegex, "u");
50856
+ }
50857
+ if (!emojiRegex.test(input.data)) {
50858
+ ctx = this._getOrReturnCtx(input, ctx);
50859
+ addIssueToContext(ctx, {
50860
+ validation: "emoji",
50861
+ code: ZodIssueCode.invalid_string,
50862
+ message: check.message
50863
+ });
50864
+ status.dirty();
50865
+ }
50766
50866
  } else if (check.kind === "uuid") {
50767
50867
  if (!uuidRegex.test(input.data)) {
50768
50868
  ctx = this._getOrReturnCtx(input, ctx);
@@ -50773,6 +50873,16 @@ var ZodString = class extends ZodType {
50773
50873
  });
50774
50874
  status.dirty();
50775
50875
  }
50876
+ } else if (check.kind === "nanoid") {
50877
+ if (!nanoidRegex.test(input.data)) {
50878
+ ctx = this._getOrReturnCtx(input, ctx);
50879
+ addIssueToContext(ctx, {
50880
+ validation: "nanoid",
50881
+ code: ZodIssueCode.invalid_string,
50882
+ message: check.message
50883
+ });
50884
+ status.dirty();
50885
+ }
50776
50886
  } else if (check.kind === "cuid") {
50777
50887
  if (!cuidRegex.test(input.data)) {
50778
50888
  ctx = this._getOrReturnCtx(input, ctx);
@@ -50783,6 +50893,26 @@ var ZodString = class extends ZodType {
50783
50893
  });
50784
50894
  status.dirty();
50785
50895
  }
50896
+ } else if (check.kind === "cuid2") {
50897
+ if (!cuid2Regex.test(input.data)) {
50898
+ ctx = this._getOrReturnCtx(input, ctx);
50899
+ addIssueToContext(ctx, {
50900
+ validation: "cuid2",
50901
+ code: ZodIssueCode.invalid_string,
50902
+ message: check.message
50903
+ });
50904
+ status.dirty();
50905
+ }
50906
+ } else if (check.kind === "ulid") {
50907
+ if (!ulidRegex.test(input.data)) {
50908
+ ctx = this._getOrReturnCtx(input, ctx);
50909
+ addIssueToContext(ctx, {
50910
+ validation: "ulid",
50911
+ code: ZodIssueCode.invalid_string,
50912
+ message: check.message
50913
+ });
50914
+ status.dirty();
50915
+ }
50786
50916
  } else if (check.kind === "url") {
50787
50917
  try {
50788
50918
  new URL(input.data);
@@ -50809,6 +50939,20 @@ var ZodString = class extends ZodType {
50809
50939
  }
50810
50940
  } else if (check.kind === "trim") {
50811
50941
  input.data = input.data.trim();
50942
+ } else if (check.kind === "includes") {
50943
+ if (!input.data.includes(check.value, check.position)) {
50944
+ ctx = this._getOrReturnCtx(input, ctx);
50945
+ addIssueToContext(ctx, {
50946
+ code: ZodIssueCode.invalid_string,
50947
+ validation: { includes: check.value, position: check.position },
50948
+ message: check.message
50949
+ });
50950
+ status.dirty();
50951
+ }
50952
+ } else if (check.kind === "toLowerCase") {
50953
+ input.data = input.data.toLowerCase();
50954
+ } else if (check.kind === "toUpperCase") {
50955
+ input.data = input.data.toUpperCase();
50812
50956
  } else if (check.kind === "startsWith") {
50813
50957
  if (!input.data.startsWith(check.value)) {
50814
50958
  ctx = this._getOrReturnCtx(input, ctx);
@@ -50840,12 +50984,71 @@ var ZodString = class extends ZodType {
50840
50984
  });
50841
50985
  status.dirty();
50842
50986
  }
50987
+ } else if (check.kind === "date") {
50988
+ const regex = dateRegex;
50989
+ if (!regex.test(input.data)) {
50990
+ ctx = this._getOrReturnCtx(input, ctx);
50991
+ addIssueToContext(ctx, {
50992
+ code: ZodIssueCode.invalid_string,
50993
+ validation: "date",
50994
+ message: check.message
50995
+ });
50996
+ status.dirty();
50997
+ }
50998
+ } else if (check.kind === "time") {
50999
+ const regex = timeRegex(check);
51000
+ if (!regex.test(input.data)) {
51001
+ ctx = this._getOrReturnCtx(input, ctx);
51002
+ addIssueToContext(ctx, {
51003
+ code: ZodIssueCode.invalid_string,
51004
+ validation: "time",
51005
+ message: check.message
51006
+ });
51007
+ status.dirty();
51008
+ }
51009
+ } else if (check.kind === "duration") {
51010
+ if (!durationRegex.test(input.data)) {
51011
+ ctx = this._getOrReturnCtx(input, ctx);
51012
+ addIssueToContext(ctx, {
51013
+ validation: "duration",
51014
+ code: ZodIssueCode.invalid_string,
51015
+ message: check.message
51016
+ });
51017
+ status.dirty();
51018
+ }
51019
+ } else if (check.kind === "ip") {
51020
+ if (!isValidIP(input.data, check.version)) {
51021
+ ctx = this._getOrReturnCtx(input, ctx);
51022
+ addIssueToContext(ctx, {
51023
+ validation: "ip",
51024
+ code: ZodIssueCode.invalid_string,
51025
+ message: check.message
51026
+ });
51027
+ status.dirty();
51028
+ }
51029
+ } else if (check.kind === "base64") {
51030
+ if (!base64Regex.test(input.data)) {
51031
+ ctx = this._getOrReturnCtx(input, ctx);
51032
+ addIssueToContext(ctx, {
51033
+ validation: "base64",
51034
+ code: ZodIssueCode.invalid_string,
51035
+ message: check.message
51036
+ });
51037
+ status.dirty();
51038
+ }
50843
51039
  } else {
50844
51040
  util.assertNever(check);
50845
51041
  }
50846
51042
  }
50847
51043
  return { status: status.value, value: input.data };
50848
51044
  }
51045
+ _regex(regex, validation, message) {
51046
+ return this.refinement((data) => regex.test(data), {
51047
+ validation,
51048
+ code: ZodIssueCode.invalid_string,
51049
+ ...errorUtil.errToObj(message)
51050
+ });
51051
+ }
50849
51052
  _addCheck(check) {
50850
51053
  return new ZodString({
50851
51054
  ...this._def,
@@ -50858,19 +51061,38 @@ var ZodString = class extends ZodType {
50858
51061
  url(message) {
50859
51062
  return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
50860
51063
  }
51064
+ emoji(message) {
51065
+ return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
51066
+ }
50861
51067
  uuid(message) {
50862
51068
  return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
50863
51069
  }
51070
+ nanoid(message) {
51071
+ return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
51072
+ }
50864
51073
  cuid(message) {
50865
51074
  return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
50866
51075
  }
51076
+ cuid2(message) {
51077
+ return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
51078
+ }
51079
+ ulid(message) {
51080
+ return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
51081
+ }
51082
+ base64(message) {
51083
+ return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
51084
+ }
51085
+ ip(options) {
51086
+ return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
51087
+ }
50867
51088
  datetime(options) {
50868
- var _a;
51089
+ var _a, _b;
50869
51090
  if (typeof options === "string") {
50870
51091
  return this._addCheck({
50871
51092
  kind: "datetime",
50872
51093
  precision: null,
50873
51094
  offset: false,
51095
+ local: false,
50874
51096
  message: options
50875
51097
  });
50876
51098
  }
@@ -50878,9 +51100,30 @@ var ZodString = class extends ZodType {
50878
51100
  kind: "datetime",
50879
51101
  precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
50880
51102
  offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
51103
+ local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
51104
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
51105
+ });
51106
+ }
51107
+ date(message) {
51108
+ return this._addCheck({ kind: "date", message });
51109
+ }
51110
+ time(options) {
51111
+ if (typeof options === "string") {
51112
+ return this._addCheck({
51113
+ kind: "time",
51114
+ precision: null,
51115
+ message: options
51116
+ });
51117
+ }
51118
+ return this._addCheck({
51119
+ kind: "time",
51120
+ precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
50881
51121
  ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
50882
51122
  });
50883
51123
  }
51124
+ duration(message) {
51125
+ return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
51126
+ }
50884
51127
  regex(regex, message) {
50885
51128
  return this._addCheck({
50886
51129
  kind: "regex",
@@ -50888,6 +51131,14 @@ var ZodString = class extends ZodType {
50888
51131
  ...errorUtil.errToObj(message)
50889
51132
  });
50890
51133
  }
51134
+ includes(value, options) {
51135
+ return this._addCheck({
51136
+ kind: "includes",
51137
+ value,
51138
+ position: options === null || options === void 0 ? void 0 : options.position,
51139
+ ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
51140
+ });
51141
+ }
50891
51142
  startsWith(value, message) {
50892
51143
  return this._addCheck({
50893
51144
  kind: "startsWith",
@@ -50923,21 +51174,69 @@ var ZodString = class extends ZodType {
50923
51174
  ...errorUtil.errToObj(message)
50924
51175
  });
50925
51176
  }
51177
+ nonempty(message) {
51178
+ return this.min(1, errorUtil.errToObj(message));
51179
+ }
51180
+ trim() {
51181
+ return new ZodString({
51182
+ ...this._def,
51183
+ checks: [...this._def.checks, { kind: "trim" }]
51184
+ });
51185
+ }
51186
+ toLowerCase() {
51187
+ return new ZodString({
51188
+ ...this._def,
51189
+ checks: [...this._def.checks, { kind: "toLowerCase" }]
51190
+ });
51191
+ }
51192
+ toUpperCase() {
51193
+ return new ZodString({
51194
+ ...this._def,
51195
+ checks: [...this._def.checks, { kind: "toUpperCase" }]
51196
+ });
51197
+ }
50926
51198
  get isDatetime() {
50927
51199
  return !!this._def.checks.find((ch) => ch.kind === "datetime");
50928
51200
  }
51201
+ get isDate() {
51202
+ return !!this._def.checks.find((ch) => ch.kind === "date");
51203
+ }
51204
+ get isTime() {
51205
+ return !!this._def.checks.find((ch) => ch.kind === "time");
51206
+ }
51207
+ get isDuration() {
51208
+ return !!this._def.checks.find((ch) => ch.kind === "duration");
51209
+ }
50929
51210
  get isEmail() {
50930
51211
  return !!this._def.checks.find((ch) => ch.kind === "email");
50931
51212
  }
50932
51213
  get isURL() {
50933
51214
  return !!this._def.checks.find((ch) => ch.kind === "url");
50934
51215
  }
51216
+ get isEmoji() {
51217
+ return !!this._def.checks.find((ch) => ch.kind === "emoji");
51218
+ }
50935
51219
  get isUUID() {
50936
51220
  return !!this._def.checks.find((ch) => ch.kind === "uuid");
50937
51221
  }
51222
+ get isNANOID() {
51223
+ return !!this._def.checks.find((ch) => ch.kind === "nanoid");
51224
+ }
50938
51225
  get isCUID() {
50939
51226
  return !!this._def.checks.find((ch) => ch.kind === "cuid");
50940
51227
  }
51228
+ get isCUID2() {
51229
+ return !!this._def.checks.find((ch) => ch.kind === "cuid2");
51230
+ }
51231
+ get isULID() {
51232
+ return !!this._def.checks.find((ch) => ch.kind === "ulid");
51233
+ }
51234
+ get isIP() {
51235
+ return !!this._def.checks.find((ch) => ch.kind === "ip");
51236
+ }
51237
+ get isBase64() {
51238
+ return !!this._def.checks.find((ch) => ch.kind === "base64");
51239
+ }
50941
51240
  get minLength() {
50942
51241
  let min = null;
50943
51242
  for (const ch of this._def.checks) {
@@ -51149,6 +51448,19 @@ var ZodNumber = class extends ZodType {
51149
51448
  message: errorUtil.toString(message)
51150
51449
  });
51151
51450
  }
51451
+ safe(message) {
51452
+ return this._addCheck({
51453
+ kind: "min",
51454
+ inclusive: true,
51455
+ value: Number.MIN_SAFE_INTEGER,
51456
+ message: errorUtil.toString(message)
51457
+ })._addCheck({
51458
+ kind: "max",
51459
+ inclusive: true,
51460
+ value: Number.MAX_SAFE_INTEGER,
51461
+ message: errorUtil.toString(message)
51462
+ });
51463
+ }
51152
51464
  get minValue() {
51153
51465
  let min = null;
51154
51466
  for (const ch of this._def.checks) {
@@ -51170,7 +51482,22 @@ var ZodNumber = class extends ZodType {
51170
51482
  return max;
51171
51483
  }
51172
51484
  get isInt() {
51173
- return !!this._def.checks.find((ch) => ch.kind === "int");
51485
+ return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
51486
+ }
51487
+ get isFinite() {
51488
+ let max = null, min = null;
51489
+ for (const ch of this._def.checks) {
51490
+ if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
51491
+ return true;
51492
+ } else if (ch.kind === "min") {
51493
+ if (min === null || ch.value > min)
51494
+ min = ch.value;
51495
+ } else if (ch.kind === "max") {
51496
+ if (max === null || ch.value < max)
51497
+ max = ch.value;
51498
+ }
51499
+ }
51500
+ return Number.isFinite(min) && Number.isFinite(max);
51174
51501
  }
51175
51502
  };
51176
51503
  __name(ZodNumber, "ZodNumber");
@@ -51183,27 +51510,167 @@ ZodNumber.create = (params) => {
51183
51510
  });
51184
51511
  };
51185
51512
  var ZodBigInt = class extends ZodType {
51513
+ constructor() {
51514
+ super(...arguments);
51515
+ this.min = this.gte;
51516
+ this.max = this.lte;
51517
+ }
51186
51518
  _parse(input) {
51187
51519
  if (this._def.coerce) {
51188
51520
  input.data = BigInt(input.data);
51189
51521
  }
51190
51522
  const parsedType = this._getType(input);
51191
51523
  if (parsedType !== ZodParsedType.bigint) {
51192
- const ctx = this._getOrReturnCtx(input);
51193
- addIssueToContext(ctx, {
51524
+ const ctx2 = this._getOrReturnCtx(input);
51525
+ addIssueToContext(ctx2, {
51194
51526
  code: ZodIssueCode.invalid_type,
51195
51527
  expected: ZodParsedType.bigint,
51196
- received: ctx.parsedType
51528
+ received: ctx2.parsedType
51197
51529
  });
51198
51530
  return INVALID;
51199
51531
  }
51200
- return OK(input.data);
51532
+ let ctx = void 0;
51533
+ const status = new ParseStatus();
51534
+ for (const check of this._def.checks) {
51535
+ if (check.kind === "min") {
51536
+ const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
51537
+ if (tooSmall) {
51538
+ ctx = this._getOrReturnCtx(input, ctx);
51539
+ addIssueToContext(ctx, {
51540
+ code: ZodIssueCode.too_small,
51541
+ type: "bigint",
51542
+ minimum: check.value,
51543
+ inclusive: check.inclusive,
51544
+ message: check.message
51545
+ });
51546
+ status.dirty();
51547
+ }
51548
+ } else if (check.kind === "max") {
51549
+ const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
51550
+ if (tooBig) {
51551
+ ctx = this._getOrReturnCtx(input, ctx);
51552
+ addIssueToContext(ctx, {
51553
+ code: ZodIssueCode.too_big,
51554
+ type: "bigint",
51555
+ maximum: check.value,
51556
+ inclusive: check.inclusive,
51557
+ message: check.message
51558
+ });
51559
+ status.dirty();
51560
+ }
51561
+ } else if (check.kind === "multipleOf") {
51562
+ if (input.data % check.value !== BigInt(0)) {
51563
+ ctx = this._getOrReturnCtx(input, ctx);
51564
+ addIssueToContext(ctx, {
51565
+ code: ZodIssueCode.not_multiple_of,
51566
+ multipleOf: check.value,
51567
+ message: check.message
51568
+ });
51569
+ status.dirty();
51570
+ }
51571
+ } else {
51572
+ util.assertNever(check);
51573
+ }
51574
+ }
51575
+ return { status: status.value, value: input.data };
51576
+ }
51577
+ gte(value, message) {
51578
+ return this.setLimit("min", value, true, errorUtil.toString(message));
51579
+ }
51580
+ gt(value, message) {
51581
+ return this.setLimit("min", value, false, errorUtil.toString(message));
51582
+ }
51583
+ lte(value, message) {
51584
+ return this.setLimit("max", value, true, errorUtil.toString(message));
51585
+ }
51586
+ lt(value, message) {
51587
+ return this.setLimit("max", value, false, errorUtil.toString(message));
51588
+ }
51589
+ setLimit(kind, value, inclusive, message) {
51590
+ return new ZodBigInt({
51591
+ ...this._def,
51592
+ checks: [
51593
+ ...this._def.checks,
51594
+ {
51595
+ kind,
51596
+ value,
51597
+ inclusive,
51598
+ message: errorUtil.toString(message)
51599
+ }
51600
+ ]
51601
+ });
51602
+ }
51603
+ _addCheck(check) {
51604
+ return new ZodBigInt({
51605
+ ...this._def,
51606
+ checks: [...this._def.checks, check]
51607
+ });
51608
+ }
51609
+ positive(message) {
51610
+ return this._addCheck({
51611
+ kind: "min",
51612
+ value: BigInt(0),
51613
+ inclusive: false,
51614
+ message: errorUtil.toString(message)
51615
+ });
51616
+ }
51617
+ negative(message) {
51618
+ return this._addCheck({
51619
+ kind: "max",
51620
+ value: BigInt(0),
51621
+ inclusive: false,
51622
+ message: errorUtil.toString(message)
51623
+ });
51624
+ }
51625
+ nonpositive(message) {
51626
+ return this._addCheck({
51627
+ kind: "max",
51628
+ value: BigInt(0),
51629
+ inclusive: true,
51630
+ message: errorUtil.toString(message)
51631
+ });
51632
+ }
51633
+ nonnegative(message) {
51634
+ return this._addCheck({
51635
+ kind: "min",
51636
+ value: BigInt(0),
51637
+ inclusive: true,
51638
+ message: errorUtil.toString(message)
51639
+ });
51640
+ }
51641
+ multipleOf(value, message) {
51642
+ return this._addCheck({
51643
+ kind: "multipleOf",
51644
+ value,
51645
+ message: errorUtil.toString(message)
51646
+ });
51647
+ }
51648
+ get minValue() {
51649
+ let min = null;
51650
+ for (const ch of this._def.checks) {
51651
+ if (ch.kind === "min") {
51652
+ if (min === null || ch.value > min)
51653
+ min = ch.value;
51654
+ }
51655
+ }
51656
+ return min;
51657
+ }
51658
+ get maxValue() {
51659
+ let max = null;
51660
+ for (const ch of this._def.checks) {
51661
+ if (ch.kind === "max") {
51662
+ if (max === null || ch.value < max)
51663
+ max = ch.value;
51664
+ }
51665
+ }
51666
+ return max;
51201
51667
  }
51202
51668
  };
51203
51669
  __name(ZodBigInt, "ZodBigInt");
51204
51670
  ZodBigInt.create = (params) => {
51205
51671
  var _a;
51206
51672
  return new ZodBigInt({
51673
+ checks: [],
51207
51674
  typeName: ZodFirstPartyTypeKind.ZodBigInt,
51208
51675
  coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
51209
51676
  ...processCreateParams(params)
@@ -51538,13 +52005,13 @@ var ZodArray = class extends ZodType {
51538
52005
  }
51539
52006
  }
51540
52007
  if (ctx.common.async) {
51541
- return Promise.all(ctx.data.map((item, i2) => {
52008
+ return Promise.all([...ctx.data].map((item, i2) => {
51542
52009
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
51543
52010
  })).then((result2) => {
51544
52011
  return ParseStatus.mergeArray(status, result2);
51545
52012
  });
51546
52013
  }
51547
- const result = ctx.data.map((item, i2) => {
52014
+ const result = [...ctx.data].map((item, i2) => {
51548
52015
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
51549
52016
  });
51550
52017
  return ParseStatus.mergeArray(status, result);
@@ -51585,24 +52052,6 @@ ZodArray.create = (schema, params) => {
51585
52052
  ...processCreateParams(params)
51586
52053
  });
51587
52054
  };
51588
- var objectUtil;
51589
- (function(objectUtil2) {
51590
- objectUtil2.mergeShapes = (first2, second) => {
51591
- return {
51592
- ...first2,
51593
- ...second
51594
- };
51595
- };
51596
- })(objectUtil || (objectUtil = {}));
51597
- var AugmentFactory = /* @__PURE__ */ __name((def) => (augmentation) => {
51598
- return new ZodObject({
51599
- ...def,
51600
- shape: () => ({
51601
- ...def.shape(),
51602
- ...augmentation
51603
- })
51604
- });
51605
- }, "AugmentFactory");
51606
52055
  function deepPartialify(schema) {
51607
52056
  if (schema instanceof ZodObject) {
51608
52057
  const newShape = {};
@@ -51615,7 +52064,10 @@ function deepPartialify(schema) {
51615
52064
  shape: () => newShape
51616
52065
  });
51617
52066
  } else if (schema instanceof ZodArray) {
51618
- return ZodArray.create(deepPartialify(schema.element));
52067
+ return new ZodArray({
52068
+ ...schema._def,
52069
+ type: deepPartialify(schema.element)
52070
+ });
51619
52071
  } else if (schema instanceof ZodOptional) {
51620
52072
  return ZodOptional.create(deepPartialify(schema.unwrap()));
51621
52073
  } else if (schema instanceof ZodNullable) {
@@ -51632,8 +52084,7 @@ var ZodObject = class extends ZodType {
51632
52084
  super(...arguments);
51633
52085
  this._cached = null;
51634
52086
  this.nonstrict = this.passthrough;
51635
- this.augment = AugmentFactory(this._def);
51636
- this.extend = AugmentFactory(this._def);
52087
+ this.augment = this.extend;
51637
52088
  }
51638
52089
  _getCached() {
51639
52090
  if (this._cached !== null)
@@ -51713,9 +52164,10 @@ var ZodObject = class extends ZodType {
51713
52164
  const syncPairs = [];
51714
52165
  for (const pair of pairs) {
51715
52166
  const key2 = await pair.key;
52167
+ const value = await pair.value;
51716
52168
  syncPairs.push({
51717
52169
  key: key2,
51718
- value: await pair.value,
52170
+ value,
51719
52171
  alwaysSet: pair.alwaysSet
51720
52172
  });
51721
52173
  }
@@ -51762,18 +52214,30 @@ var ZodObject = class extends ZodType {
51762
52214
  unknownKeys: "passthrough"
51763
52215
  });
51764
52216
  }
51765
- setKey(key2, schema) {
51766
- return this.augment({ [key2]: schema });
52217
+ extend(augmentation) {
52218
+ return new ZodObject({
52219
+ ...this._def,
52220
+ shape: () => ({
52221
+ ...this._def.shape(),
52222
+ ...augmentation
52223
+ })
52224
+ });
51767
52225
  }
51768
52226
  merge(merging) {
51769
52227
  const merged = new ZodObject({
51770
52228
  unknownKeys: merging._def.unknownKeys,
51771
52229
  catchall: merging._def.catchall,
51772
- shape: () => objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
52230
+ shape: () => ({
52231
+ ...this._def.shape(),
52232
+ ...merging._def.shape()
52233
+ }),
51773
52234
  typeName: ZodFirstPartyTypeKind.ZodObject
51774
52235
  });
51775
52236
  return merged;
51776
52237
  }
52238
+ setKey(key2, schema) {
52239
+ return this.augment({ [key2]: schema });
52240
+ }
51777
52241
  catchall(index) {
51778
52242
  return new ZodObject({
51779
52243
  ...this._def,
@@ -51782,9 +52246,10 @@ var ZodObject = class extends ZodType {
51782
52246
  }
51783
52247
  pick(mask) {
51784
52248
  const shape = {};
51785
- util.objectKeys(mask).map((key2) => {
51786
- if (this.shape[key2])
52249
+ util.objectKeys(mask).forEach((key2) => {
52250
+ if (mask[key2] && this.shape[key2]) {
51787
52251
  shape[key2] = this.shape[key2];
52252
+ }
51788
52253
  });
51789
52254
  return new ZodObject({
51790
52255
  ...this._def,
@@ -51793,8 +52258,8 @@ var ZodObject = class extends ZodType {
51793
52258
  }
51794
52259
  omit(mask) {
51795
52260
  const shape = {};
51796
- util.objectKeys(this.shape).map((key2) => {
51797
- if (util.objectKeys(mask).indexOf(key2) === -1) {
52261
+ util.objectKeys(this.shape).forEach((key2) => {
52262
+ if (!mask[key2]) {
51798
52263
  shape[key2] = this.shape[key2];
51799
52264
  }
51800
52265
  });
@@ -51808,24 +52273,14 @@ var ZodObject = class extends ZodType {
51808
52273
  }
51809
52274
  partial(mask) {
51810
52275
  const newShape = {};
51811
- if (mask) {
51812
- util.objectKeys(this.shape).map((key2) => {
51813
- if (util.objectKeys(mask).indexOf(key2) === -1) {
51814
- newShape[key2] = this.shape[key2];
51815
- } else {
51816
- newShape[key2] = this.shape[key2].optional();
51817
- }
51818
- });
51819
- return new ZodObject({
51820
- ...this._def,
51821
- shape: () => newShape
51822
- });
51823
- } else {
51824
- for (const key2 in this.shape) {
51825
- const fieldSchema = this.shape[key2];
52276
+ util.objectKeys(this.shape).forEach((key2) => {
52277
+ const fieldSchema = this.shape[key2];
52278
+ if (mask && !mask[key2]) {
52279
+ newShape[key2] = fieldSchema;
52280
+ } else {
51826
52281
  newShape[key2] = fieldSchema.optional();
51827
52282
  }
51828
- }
52283
+ });
51829
52284
  return new ZodObject({
51830
52285
  ...this._def,
51831
52286
  shape: () => newShape
@@ -51833,21 +52288,10 @@ var ZodObject = class extends ZodType {
51833
52288
  }
51834
52289
  required(mask) {
51835
52290
  const newShape = {};
51836
- if (mask) {
51837
- util.objectKeys(this.shape).map((key2) => {
51838
- if (util.objectKeys(mask).indexOf(key2) === -1) {
51839
- newShape[key2] = this.shape[key2];
51840
- } else {
51841
- const fieldSchema = this.shape[key2];
51842
- let newField = fieldSchema;
51843
- while (newField instanceof ZodOptional) {
51844
- newField = newField._def.innerType;
51845
- }
51846
- newShape[key2] = newField;
51847
- }
51848
- });
51849
- } else {
51850
- for (const key2 in this.shape) {
52291
+ util.objectKeys(this.shape).forEach((key2) => {
52292
+ if (mask && !mask[key2]) {
52293
+ newShape[key2] = this.shape[key2];
52294
+ } else {
51851
52295
  const fieldSchema = this.shape[key2];
51852
52296
  let newField = fieldSchema;
51853
52297
  while (newField instanceof ZodOptional) {
@@ -51855,7 +52299,7 @@ var ZodObject = class extends ZodType {
51855
52299
  }
51856
52300
  newShape[key2] = newField;
51857
52301
  }
51858
- }
52302
+ });
51859
52303
  return new ZodObject({
51860
52304
  ...this._def,
51861
52305
  shape: () => newShape
@@ -51996,15 +52440,25 @@ var getDiscriminator = /* @__PURE__ */ __name((type) => {
51996
52440
  } else if (type instanceof ZodEnum) {
51997
52441
  return type.options;
51998
52442
  } else if (type instanceof ZodNativeEnum) {
51999
- return Object.keys(type.enum);
52443
+ return util.objectValues(type.enum);
52000
52444
  } else if (type instanceof ZodDefault) {
52001
52445
  return getDiscriminator(type._def.innerType);
52002
52446
  } else if (type instanceof ZodUndefined) {
52003
52447
  return [void 0];
52004
52448
  } else if (type instanceof ZodNull) {
52005
52449
  return [null];
52450
+ } else if (type instanceof ZodOptional) {
52451
+ return [void 0, ...getDiscriminator(type.unwrap())];
52452
+ } else if (type instanceof ZodNullable) {
52453
+ return [null, ...getDiscriminator(type.unwrap())];
52454
+ } else if (type instanceof ZodBranded) {
52455
+ return getDiscriminator(type.unwrap());
52456
+ } else if (type instanceof ZodReadonly) {
52457
+ return getDiscriminator(type.unwrap());
52458
+ } else if (type instanceof ZodCatch) {
52459
+ return getDiscriminator(type._def.innerType);
52006
52460
  } else {
52007
- return null;
52461
+ return [];
52008
52462
  }
52009
52463
  }, "getDiscriminator");
52010
52464
  var ZodDiscriminatedUnion = class extends ZodType {
@@ -52056,7 +52510,7 @@ var ZodDiscriminatedUnion = class extends ZodType {
52056
52510
  const optionsMap = /* @__PURE__ */ new Map();
52057
52511
  for (const type of options) {
52058
52512
  const discriminatorValues = getDiscriminator(type.shape[discriminator]);
52059
- if (!discriminatorValues) {
52513
+ if (!discriminatorValues.length) {
52060
52514
  throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
52061
52515
  }
52062
52516
  for (const value of discriminatorValues) {
@@ -52201,7 +52655,7 @@ var ZodTuple = class extends ZodType {
52201
52655
  });
52202
52656
  status.dirty();
52203
52657
  }
52204
- const items = ctx.data.map((item, itemIndex) => {
52658
+ const items = [...ctx.data].map((item, itemIndex) => {
52205
52659
  const schema = this._def.items[itemIndex] || this._def.rest;
52206
52660
  if (!schema)
52207
52661
  return null;
@@ -52260,7 +52714,8 @@ var ZodRecord = class extends ZodType {
52260
52714
  for (const key2 in ctx.data) {
52261
52715
  pairs.push({
52262
52716
  key: keyType._parse(new ParseInputLazyPath(ctx, key2, ctx.path, key2)),
52263
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key2], ctx.path, key2))
52717
+ value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key2], ctx.path, key2)),
52718
+ alwaysSet: key2 in ctx.data
52264
52719
  });
52265
52720
  }
52266
52721
  if (ctx.common.async) {
@@ -52291,6 +52746,12 @@ var ZodRecord = class extends ZodType {
52291
52746
  };
52292
52747
  __name(ZodRecord, "ZodRecord");
52293
52748
  var ZodMap = class extends ZodType {
52749
+ get keySchema() {
52750
+ return this._def.keyType;
52751
+ }
52752
+ get valueSchema() {
52753
+ return this._def.valueType;
52754
+ }
52294
52755
  _parse(input) {
52295
52756
  const { status, ctx } = this._processInputParams(input);
52296
52757
  if (ctx.parsedType !== ZodParsedType.map) {
@@ -52490,27 +52951,29 @@ var ZodFunction = class extends ZodType {
52490
52951
  const params = { errorMap: ctx.common.contextualErrorMap };
52491
52952
  const fn = ctx.data;
52492
52953
  if (this._def.returns instanceof ZodPromise) {
52493
- return OK(async (...args) => {
52954
+ const me = this;
52955
+ return OK(async function(...args) {
52494
52956
  const error = new ZodError([]);
52495
- const parsedArgs = await this._def.args.parseAsync(args, params).catch((e2) => {
52957
+ const parsedArgs = await me._def.args.parseAsync(args, params).catch((e2) => {
52496
52958
  error.addIssue(makeArgsIssue(args, e2));
52497
52959
  throw error;
52498
52960
  });
52499
- const result = await fn(...parsedArgs);
52500
- const parsedReturns = await this._def.returns._def.type.parseAsync(result, params).catch((e2) => {
52961
+ const result = await Reflect.apply(fn, this, parsedArgs);
52962
+ const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e2) => {
52501
52963
  error.addIssue(makeReturnsIssue(result, e2));
52502
52964
  throw error;
52503
52965
  });
52504
52966
  return parsedReturns;
52505
52967
  });
52506
52968
  } else {
52507
- return OK((...args) => {
52508
- const parsedArgs = this._def.args.safeParse(args, params);
52969
+ const me = this;
52970
+ return OK(function(...args) {
52971
+ const parsedArgs = me._def.args.safeParse(args, params);
52509
52972
  if (!parsedArgs.success) {
52510
52973
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
52511
52974
  }
52512
- const result = fn(...parsedArgs.data);
52513
- const parsedReturns = this._def.returns.safeParse(result, params);
52975
+ const result = Reflect.apply(fn, this, parsedArgs.data);
52976
+ const parsedReturns = me._def.returns.safeParse(result, params);
52514
52977
  if (!parsedReturns.success) {
52515
52978
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
52516
52979
  }
@@ -52577,6 +53040,7 @@ var ZodLiteral = class extends ZodType {
52577
53040
  if (input.data !== this._def.value) {
52578
53041
  const ctx = this._getOrReturnCtx(input);
52579
53042
  addIssueToContext(ctx, {
53043
+ received: ctx.data,
52580
53044
  code: ZodIssueCode.invalid_literal,
52581
53045
  expected: this._def.value
52582
53046
  });
@@ -52605,6 +53069,10 @@ function createZodEnum(values, params) {
52605
53069
  }
52606
53070
  __name(createZodEnum, "createZodEnum");
52607
53071
  var ZodEnum = class extends ZodType {
53072
+ constructor() {
53073
+ super(...arguments);
53074
+ _ZodEnum_cache.set(this, void 0);
53075
+ }
52608
53076
  _parse(input) {
52609
53077
  if (typeof input.data !== "string") {
52610
53078
  const ctx = this._getOrReturnCtx(input);
@@ -52616,7 +53084,10 @@ var ZodEnum = class extends ZodType {
52616
53084
  });
52617
53085
  return INVALID;
52618
53086
  }
52619
- if (this._def.values.indexOf(input.data) === -1) {
53087
+ if (!__classPrivateFieldGet2(this, _ZodEnum_cache, "f")) {
53088
+ __classPrivateFieldSet2(this, _ZodEnum_cache, new Set(this._def.values), "f");
53089
+ }
53090
+ if (!__classPrivateFieldGet2(this, _ZodEnum_cache, "f").has(input.data)) {
52620
53091
  const ctx = this._getOrReturnCtx(input);
52621
53092
  const expectedValues = this._def.values;
52622
53093
  addIssueToContext(ctx, {
@@ -52652,10 +53123,27 @@ var ZodEnum = class extends ZodType {
52652
53123
  }
52653
53124
  return enumValues;
52654
53125
  }
53126
+ extract(values, newDef = this._def) {
53127
+ return ZodEnum.create(values, {
53128
+ ...this._def,
53129
+ ...newDef
53130
+ });
53131
+ }
53132
+ exclude(values, newDef = this._def) {
53133
+ return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
53134
+ ...this._def,
53135
+ ...newDef
53136
+ });
53137
+ }
52655
53138
  };
52656
53139
  __name(ZodEnum, "ZodEnum");
53140
+ _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
52657
53141
  ZodEnum.create = createZodEnum;
52658
53142
  var ZodNativeEnum = class extends ZodType {
53143
+ constructor() {
53144
+ super(...arguments);
53145
+ _ZodNativeEnum_cache.set(this, void 0);
53146
+ }
52659
53147
  _parse(input) {
52660
53148
  const nativeEnumValues = util.getValidEnumValues(this._def.values);
52661
53149
  const ctx = this._getOrReturnCtx(input);
@@ -52668,7 +53156,10 @@ var ZodNativeEnum = class extends ZodType {
52668
53156
  });
52669
53157
  return INVALID;
52670
53158
  }
52671
- if (nativeEnumValues.indexOf(input.data) === -1) {
53159
+ if (!__classPrivateFieldGet2(this, _ZodNativeEnum_cache, "f")) {
53160
+ __classPrivateFieldSet2(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
53161
+ }
53162
+ if (!__classPrivateFieldGet2(this, _ZodNativeEnum_cache, "f").has(input.data)) {
52672
53163
  const expectedValues = util.objectValues(nativeEnumValues);
52673
53164
  addIssueToContext(ctx, {
52674
53165
  received: ctx.data,
@@ -52684,6 +53175,7 @@ var ZodNativeEnum = class extends ZodType {
52684
53175
  }
52685
53176
  };
52686
53177
  __name(ZodNativeEnum, "ZodNativeEnum");
53178
+ _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
52687
53179
  ZodNativeEnum.create = (values, params) => {
52688
53180
  return new ZodNativeEnum({
52689
53181
  values,
@@ -52692,6 +53184,9 @@ ZodNativeEnum.create = (values, params) => {
52692
53184
  });
52693
53185
  };
52694
53186
  var ZodPromise = class extends ZodType {
53187
+ unwrap() {
53188
+ return this._def.type;
53189
+ }
52695
53190
  _parse(input) {
52696
53191
  const { ctx } = this._processInputParams(input);
52697
53192
  if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
@@ -52729,24 +53224,6 @@ var ZodEffects = class extends ZodType {
52729
53224
  _parse(input) {
52730
53225
  const { status, ctx } = this._processInputParams(input);
52731
53226
  const effect = this._def.effect || null;
52732
- if (effect.type === "preprocess") {
52733
- const processed = effect.transform(ctx.data);
52734
- if (ctx.common.async) {
52735
- return Promise.resolve(processed).then((processed2) => {
52736
- return this._def.schema._parseAsync({
52737
- data: processed2,
52738
- path: ctx.path,
52739
- parent: ctx
52740
- });
52741
- });
52742
- } else {
52743
- return this._def.schema._parseSync({
52744
- data: processed,
52745
- path: ctx.path,
52746
- parent: ctx
52747
- });
52748
- }
52749
- }
52750
53227
  const checkCtx = {
52751
53228
  addIssue: (arg) => {
52752
53229
  addIssueToContext(ctx, arg);
@@ -52761,6 +53238,42 @@ var ZodEffects = class extends ZodType {
52761
53238
  }
52762
53239
  };
52763
53240
  checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
53241
+ if (effect.type === "preprocess") {
53242
+ const processed = effect.transform(ctx.data, checkCtx);
53243
+ if (ctx.common.async) {
53244
+ return Promise.resolve(processed).then(async (processed2) => {
53245
+ if (status.value === "aborted")
53246
+ return INVALID;
53247
+ const result = await this._def.schema._parseAsync({
53248
+ data: processed2,
53249
+ path: ctx.path,
53250
+ parent: ctx
53251
+ });
53252
+ if (result.status === "aborted")
53253
+ return INVALID;
53254
+ if (result.status === "dirty")
53255
+ return DIRTY(result.value);
53256
+ if (status.value === "dirty")
53257
+ return DIRTY(result.value);
53258
+ return result;
53259
+ });
53260
+ } else {
53261
+ if (status.value === "aborted")
53262
+ return INVALID;
53263
+ const result = this._def.schema._parseSync({
53264
+ data: processed,
53265
+ path: ctx.path,
53266
+ parent: ctx
53267
+ });
53268
+ if (result.status === "aborted")
53269
+ return INVALID;
53270
+ if (result.status === "dirty")
53271
+ return DIRTY(result.value);
53272
+ if (status.value === "dirty")
53273
+ return DIRTY(result.value);
53274
+ return result;
53275
+ }
53276
+ }
52764
53277
  if (effect.type === "refinement") {
52765
53278
  const executeRefinement = /* @__PURE__ */ __name((acc) => {
52766
53279
  const result = effect.refinement(acc, checkCtx);
@@ -52907,26 +53420,45 @@ ZodDefault.create = (type, params) => {
52907
53420
  var ZodCatch = class extends ZodType {
52908
53421
  _parse(input) {
52909
53422
  const { ctx } = this._processInputParams(input);
53423
+ const newCtx = {
53424
+ ...ctx,
53425
+ common: {
53426
+ ...ctx.common,
53427
+ issues: []
53428
+ }
53429
+ };
52910
53430
  const result = this._def.innerType._parse({
52911
- data: ctx.data,
52912
- path: ctx.path,
52913
- parent: ctx
53431
+ data: newCtx.data,
53432
+ path: newCtx.path,
53433
+ parent: {
53434
+ ...newCtx
53435
+ }
52914
53436
  });
52915
53437
  if (isAsync(result)) {
52916
53438
  return result.then((result2) => {
52917
53439
  return {
52918
53440
  status: "valid",
52919
- value: result2.status === "valid" ? result2.value : this._def.defaultValue()
53441
+ value: result2.status === "valid" ? result2.value : this._def.catchValue({
53442
+ get error() {
53443
+ return new ZodError(newCtx.common.issues);
53444
+ },
53445
+ input: newCtx.data
53446
+ })
52920
53447
  };
52921
53448
  });
52922
53449
  } else {
52923
53450
  return {
52924
53451
  status: "valid",
52925
- value: result.status === "valid" ? result.value : this._def.defaultValue()
53452
+ value: result.status === "valid" ? result.value : this._def.catchValue({
53453
+ get error() {
53454
+ return new ZodError(newCtx.common.issues);
53455
+ },
53456
+ input: newCtx.data
53457
+ })
52926
53458
  };
52927
53459
  }
52928
53460
  }
52929
- removeDefault() {
53461
+ removeCatch() {
52930
53462
  return this._def.innerType;
52931
53463
  }
52932
53464
  };
@@ -52935,7 +53467,7 @@ ZodCatch.create = (type, params) => {
52935
53467
  return new ZodCatch({
52936
53468
  innerType: type,
52937
53469
  typeName: ZodFirstPartyTypeKind.ZodCatch,
52938
- defaultValue: typeof params.default === "function" ? params.default : () => params.default,
53470
+ catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
52939
53471
  ...processCreateParams(params)
52940
53472
  });
52941
53473
  };
@@ -53033,17 +53565,43 @@ var ZodPipeline = class extends ZodType {
53033
53565
  }
53034
53566
  };
53035
53567
  __name(ZodPipeline, "ZodPipeline");
53036
- var custom = /* @__PURE__ */ __name((check, params = {}, fatal) => {
53568
+ var ZodReadonly = class extends ZodType {
53569
+ _parse(input) {
53570
+ const result = this._def.innerType._parse(input);
53571
+ const freeze = /* @__PURE__ */ __name((data) => {
53572
+ if (isValid(data)) {
53573
+ data.value = Object.freeze(data.value);
53574
+ }
53575
+ return data;
53576
+ }, "freeze");
53577
+ return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
53578
+ }
53579
+ unwrap() {
53580
+ return this._def.innerType;
53581
+ }
53582
+ };
53583
+ __name(ZodReadonly, "ZodReadonly");
53584
+ ZodReadonly.create = (type, params) => {
53585
+ return new ZodReadonly({
53586
+ innerType: type,
53587
+ typeName: ZodFirstPartyTypeKind.ZodReadonly,
53588
+ ...processCreateParams(params)
53589
+ });
53590
+ };
53591
+ function custom(check, params = {}, fatal) {
53037
53592
  if (check)
53038
53593
  return ZodAny.create().superRefine((data, ctx) => {
53594
+ var _a, _b;
53039
53595
  if (!check(data)) {
53040
- const p = typeof params === "function" ? params(data) : params;
53596
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
53597
+ const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
53041
53598
  const p2 = typeof p === "string" ? { message: p } : p;
53042
- ctx.addIssue({ code: "custom", ...p2, fatal });
53599
+ ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
53043
53600
  }
53044
53601
  });
53045
53602
  return ZodAny.create();
53046
- }, "custom");
53603
+ }
53604
+ __name(custom, "custom");
53047
53605
  var late = {
53048
53606
  object: ZodObject.lazycreate
53049
53607
  };
@@ -53084,10 +53642,11 @@ var ZodFirstPartyTypeKind;
53084
53642
  ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
53085
53643
  ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
53086
53644
  ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
53645
+ ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
53087
53646
  })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
53088
53647
  var instanceOfType = /* @__PURE__ */ __name((cls, params = {
53089
53648
  message: `Input not instance of ${cls.name}`
53090
- }) => custom((data) => data instanceof cls, params, true), "instanceOfType");
53649
+ }) => custom((data) => data instanceof cls, params), "instanceOfType");
53091
53650
  var stringType = ZodString.create;
53092
53651
  var numberType = ZodNumber.create;
53093
53652
  var nanType = ZodNaN.create;
@@ -53128,12 +53687,15 @@ var oboolean = /* @__PURE__ */ __name(() => booleanType().optional(), "oboolean"
53128
53687
  var coerce2 = {
53129
53688
  string: (arg) => ZodString.create({ ...arg, coerce: true }),
53130
53689
  number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
53131
- boolean: (arg) => ZodBoolean.create({ ...arg, coerce: true }),
53690
+ boolean: (arg) => ZodBoolean.create({
53691
+ ...arg,
53692
+ coerce: true
53693
+ }),
53132
53694
  bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
53133
53695
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
53134
53696
  };
53135
53697
  var NEVER = INVALID;
53136
- var mod = /* @__PURE__ */ Object.freeze({
53698
+ var z = /* @__PURE__ */ Object.freeze({
53137
53699
  __proto__: null,
53138
53700
  defaultErrorMap: errorMap,
53139
53701
  setErrorMap,
@@ -53152,9 +53714,13 @@ var mod = /* @__PURE__ */ Object.freeze({
53152
53714
  get util() {
53153
53715
  return util;
53154
53716
  },
53717
+ get objectUtil() {
53718
+ return objectUtil;
53719
+ },
53155
53720
  ZodParsedType,
53156
53721
  getParsedType,
53157
53722
  ZodType,
53723
+ datetimeRegex,
53158
53724
  ZodString,
53159
53725
  ZodNumber,
53160
53726
  ZodBigInt,
@@ -53168,9 +53734,6 @@ var mod = /* @__PURE__ */ Object.freeze({
53168
53734
  ZodNever,
53169
53735
  ZodVoid,
53170
53736
  ZodArray,
53171
- get objectUtil() {
53172
- return objectUtil;
53173
- },
53174
53737
  ZodObject,
53175
53738
  ZodUnion,
53176
53739
  ZodDiscriminatedUnion,
@@ -53195,6 +53758,7 @@ var mod = /* @__PURE__ */ Object.freeze({
53195
53758
  BRAND,
53196
53759
  ZodBranded,
53197
53760
  ZodPipeline,
53761
+ ZodReadonly,
53198
53762
  custom,
53199
53763
  Schema: ZodType,
53200
53764
  ZodSchema: ZodType,
@@ -53248,38 +53812,140 @@ var mod = /* @__PURE__ */ Object.freeze({
53248
53812
  ZodError
53249
53813
  });
53250
53814
 
53815
+ // ../../../node_modules/.pnpm/zod-openapi@4.2.4_zod@3.23.8/node_modules/zod-openapi/dist/extendZodSymbols.chunk.mjs
53816
+ var currentSymbol = Symbol("current");
53817
+ var previousSymbol = Symbol("previous");
53818
+
53819
+ // ../../../node_modules/.pnpm/zod-openapi@4.2.4_zod@3.23.8/node_modules/zod-openapi/dist/extendZod.chunk.mjs
53820
+ var mergeOpenApi = /* @__PURE__ */ __name((openapi, {
53821
+ ref: _ref,
53822
+ refType: _refType,
53823
+ param: _param,
53824
+ header: _header,
53825
+ ...rest
53826
+ } = {}) => ({
53827
+ ...rest,
53828
+ ...openapi
53829
+ }), "mergeOpenApi");
53830
+ function extendZodWithOpenApi(zod) {
53831
+ if (typeof zod.ZodType.prototype.openapi !== "undefined") {
53832
+ return;
53833
+ }
53834
+ zod.ZodType.prototype.openapi = function(openapi) {
53835
+ const { zodOpenApi, ...rest } = this._def;
53836
+ const result = new this.constructor({
53837
+ ...rest,
53838
+ zodOpenApi: {
53839
+ openapi: mergeOpenApi(
53840
+ openapi,
53841
+ zodOpenApi == null ? void 0 : zodOpenApi.openapi
53842
+ )
53843
+ }
53844
+ });
53845
+ result._def.zodOpenApi[currentSymbol] = result;
53846
+ if (zodOpenApi) {
53847
+ result._def.zodOpenApi[previousSymbol] = this;
53848
+ }
53849
+ return result;
53850
+ };
53851
+ const zodDescribe = zod.ZodType.prototype.describe;
53852
+ zod.ZodType.prototype.describe = function(...args) {
53853
+ const result = zodDescribe.apply(this, args);
53854
+ const def = result._def;
53855
+ if (def.zodOpenApi) {
53856
+ const cloned = { ...def.zodOpenApi };
53857
+ cloned.openapi = mergeOpenApi({ description: args[0] }, cloned.openapi);
53858
+ cloned[previousSymbol] = this;
53859
+ cloned[currentSymbol] = result;
53860
+ def.zodOpenApi = cloned;
53861
+ } else {
53862
+ def.zodOpenApi = {
53863
+ openapi: { description: args[0] },
53864
+ [currentSymbol]: result
53865
+ };
53866
+ }
53867
+ return result;
53868
+ };
53869
+ const zodObjectExtend = zod.ZodObject.prototype.extend;
53870
+ zod.ZodObject.prototype.extend = function(...args) {
53871
+ const extendResult = zodObjectExtend.apply(this, args);
53872
+ const zodOpenApi = extendResult._def.zodOpenApi;
53873
+ if (zodOpenApi) {
53874
+ const cloned = { ...zodOpenApi };
53875
+ cloned.openapi = mergeOpenApi({}, cloned.openapi);
53876
+ cloned[previousSymbol] = this;
53877
+ extendResult._def.zodOpenApi = cloned;
53878
+ } else {
53879
+ extendResult._def.zodOpenApi = {
53880
+ [previousSymbol]: this
53881
+ };
53882
+ }
53883
+ return extendResult;
53884
+ };
53885
+ const zodObjectOmit = zod.ZodObject.prototype.omit;
53886
+ zod.ZodObject.prototype.omit = function(...args) {
53887
+ const omitResult = zodObjectOmit.apply(this, args);
53888
+ const zodOpenApi = omitResult._def.zodOpenApi;
53889
+ if (zodOpenApi) {
53890
+ const cloned = { ...zodOpenApi };
53891
+ cloned.openapi = mergeOpenApi({}, cloned.openapi);
53892
+ delete cloned[previousSymbol];
53893
+ delete cloned[currentSymbol];
53894
+ omitResult._def.zodOpenApi = cloned;
53895
+ }
53896
+ return omitResult;
53897
+ };
53898
+ const zodObjectPick = zod.ZodObject.prototype.pick;
53899
+ zod.ZodObject.prototype.pick = function(...args) {
53900
+ const pickResult = zodObjectPick.apply(this, args);
53901
+ const zodOpenApi = pickResult._def.zodOpenApi;
53902
+ if (zodOpenApi) {
53903
+ const cloned = { ...zodOpenApi };
53904
+ cloned.openapi = mergeOpenApi({}, cloned.openapi);
53905
+ delete cloned[previousSymbol];
53906
+ delete cloned[currentSymbol];
53907
+ pickResult._def.zodOpenApi = cloned;
53908
+ }
53909
+ return pickResult;
53910
+ };
53911
+ }
53912
+ __name(extendZodWithOpenApi, "extendZodWithOpenApi");
53913
+
53914
+ // ../../../node_modules/.pnpm/zod-openapi@4.2.4_zod@3.23.8/node_modules/zod-openapi/dist/extend.mjs
53915
+ extendZodWithOpenApi(z);
53916
+
53251
53917
  // ../../learn-card-types/dist/types.esm.js
53252
53918
  var __defProp2 = Object.defineProperty;
53253
53919
  var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", { value, configurable: true }), "__name");
53254
- var ContextValidator = mod.array(mod.string().or(mod.record(mod.any())));
53255
- var AchievementCriteriaValidator = mod.object({
53256
- type: mod.string().optional(),
53257
- narrative: mod.string().optional()
53920
+ var ContextValidator = z.array(z.string().or(z.record(z.any())));
53921
+ var AchievementCriteriaValidator = z.object({
53922
+ type: z.string().optional(),
53923
+ narrative: z.string().optional()
53258
53924
  });
53259
- var ImageValidator = mod.string().or(
53260
- mod.object({
53261
- id: mod.string(),
53262
- type: mod.string(),
53263
- caption: mod.string().optional()
53925
+ var ImageValidator = z.string().or(
53926
+ z.object({
53927
+ id: z.string(),
53928
+ type: z.string(),
53929
+ caption: z.string().optional()
53264
53930
  })
53265
53931
  );
53266
- var GeoCoordinatesValidator = mod.object({
53267
- type: mod.string().min(1).or(mod.string().array().nonempty()),
53268
- latitude: mod.number(),
53269
- longitude: mod.number()
53932
+ var GeoCoordinatesValidator = z.object({
53933
+ type: z.string().min(1).or(z.string().array().nonempty()),
53934
+ latitude: z.number(),
53935
+ longitude: z.number()
53270
53936
  });
53271
- var AddressValidator = mod.object({
53272
- type: mod.string().min(1).or(mod.string().array().nonempty()),
53273
- addressCountry: mod.string().optional(),
53274
- addressCountryCode: mod.string().optional(),
53275
- addressRegion: mod.string().optional(),
53276
- addressLocality: mod.string().optional(),
53277
- streetAddress: mod.string().optional(),
53278
- postOfficeBoxNumber: mod.string().optional(),
53279
- postalCode: mod.string().optional(),
53937
+ var AddressValidator = z.object({
53938
+ type: z.string().min(1).or(z.string().array().nonempty()),
53939
+ addressCountry: z.string().optional(),
53940
+ addressCountryCode: z.string().optional(),
53941
+ addressRegion: z.string().optional(),
53942
+ addressLocality: z.string().optional(),
53943
+ streetAddress: z.string().optional(),
53944
+ postOfficeBoxNumber: z.string().optional(),
53945
+ postalCode: z.string().optional(),
53280
53946
  geo: GeoCoordinatesValidator.optional()
53281
53947
  });
53282
- var IdentifierTypeValidator = mod.enum([
53948
+ var IdentifierTypeValidator = z.enum([
53283
53949
  "sourcedId",
53284
53950
  "systemId",
53285
53951
  "productId",
@@ -53298,140 +53964,140 @@ var IdentifierTypeValidator = mod.enum([
53298
53964
  "ltiPlatformId",
53299
53965
  "ltiUserId",
53300
53966
  "identifier"
53301
- ]).or(mod.string());
53302
- var IdentifierEntryValidator = mod.object({
53303
- type: mod.string().min(1).or(mod.string().array().nonempty()),
53304
- identifier: mod.string(),
53967
+ ]).or(z.string());
53968
+ var IdentifierEntryValidator = z.object({
53969
+ type: z.string().min(1).or(z.string().array().nonempty()),
53970
+ identifier: z.string(),
53305
53971
  identifierType: IdentifierTypeValidator
53306
53972
  });
53307
- var ProfileValidator = mod.string().or(
53308
- mod.object({
53309
- id: mod.string().optional(),
53310
- type: mod.string().or(mod.string().array().nonempty().optional()),
53311
- name: mod.string().optional(),
53312
- url: mod.string().optional(),
53313
- phone: mod.string().optional(),
53314
- description: mod.string().optional(),
53315
- endorsement: mod.any().array().optional(),
53973
+ var ProfileValidator = z.string().or(
53974
+ z.object({
53975
+ id: z.string().optional(),
53976
+ type: z.string().or(z.string().array().nonempty().optional()),
53977
+ name: z.string().optional(),
53978
+ url: z.string().optional(),
53979
+ phone: z.string().optional(),
53980
+ description: z.string().optional(),
53981
+ endorsement: z.any().array().optional(),
53316
53982
  image: ImageValidator.optional(),
53317
- email: mod.string().email().optional(),
53983
+ email: z.string().email().optional(),
53318
53984
  address: AddressValidator.optional(),
53319
53985
  otherIdentifier: IdentifierEntryValidator.array().optional(),
53320
- official: mod.string().optional(),
53321
- parentOrg: mod.any().optional(),
53322
- familyName: mod.string().optional(),
53323
- givenName: mod.string().optional(),
53324
- additionalName: mod.string().optional(),
53325
- patronymicName: mod.string().optional(),
53326
- honorificPrefix: mod.string().optional(),
53327
- honorificSuffix: mod.string().optional(),
53328
- familyNamePrefix: mod.string().optional(),
53329
- dateOfBirth: mod.string().optional()
53330
- }).catchall(mod.any())
53986
+ official: z.string().optional(),
53987
+ parentOrg: z.any().optional(),
53988
+ familyName: z.string().optional(),
53989
+ givenName: z.string().optional(),
53990
+ additionalName: z.string().optional(),
53991
+ patronymicName: z.string().optional(),
53992
+ honorificPrefix: z.string().optional(),
53993
+ honorificSuffix: z.string().optional(),
53994
+ familyNamePrefix: z.string().optional(),
53995
+ dateOfBirth: z.string().optional()
53996
+ }).catchall(z.any())
53331
53997
  );
53332
- var CredentialSubjectValidator = mod.object({ id: mod.string().optional() }).catchall(mod.any());
53333
- var CredentialStatusValidator = mod.object({ type: mod.string(), id: mod.string() }).catchall(mod.any());
53334
- var CredentialSchemaValidator = mod.object({ id: mod.string(), type: mod.string() }).catchall(mod.any());
53335
- var RefreshServiceValidator = mod.object({ id: mod.string().optional(), type: mod.string() }).catchall(mod.any());
53336
- var TermsOfUseValidator = mod.object({ type: mod.string(), id: mod.string().optional() }).catchall(mod.any());
53337
- var VC2EvidenceValidator = mod.object({ type: mod.string().or(mod.string().array().nonempty()), id: mod.string().optional() }).catchall(mod.any());
53338
- var UnsignedVCValidator = mod.object({
53998
+ var CredentialSubjectValidator = z.object({ id: z.string().optional() }).catchall(z.any());
53999
+ var CredentialStatusValidator = z.object({ type: z.string(), id: z.string() }).catchall(z.any());
54000
+ var CredentialSchemaValidator = z.object({ id: z.string(), type: z.string() }).catchall(z.any());
54001
+ var RefreshServiceValidator = z.object({ id: z.string().optional(), type: z.string() }).catchall(z.any());
54002
+ var TermsOfUseValidator = z.object({ type: z.string(), id: z.string().optional() }).catchall(z.any());
54003
+ var VC2EvidenceValidator = z.object({ type: z.string().or(z.string().array().nonempty()), id: z.string().optional() }).catchall(z.any());
54004
+ var UnsignedVCValidator = z.object({
53339
54005
  "@context": ContextValidator,
53340
- id: mod.string().optional(),
53341
- type: mod.string().array().nonempty(),
54006
+ id: z.string().optional(),
54007
+ type: z.string().array().nonempty(),
53342
54008
  issuer: ProfileValidator,
53343
54009
  credentialSubject: CredentialSubjectValidator.or(CredentialSubjectValidator.array()),
53344
54010
  refreshService: RefreshServiceValidator.or(RefreshServiceValidator.array()).optional(),
53345
54011
  credentialSchema: CredentialSchemaValidator.or(
53346
54012
  CredentialSchemaValidator.array()
53347
54013
  ).optional(),
53348
- issuanceDate: mod.string().optional(),
53349
- expirationDate: mod.string().optional(),
54014
+ issuanceDate: z.string().optional(),
54015
+ expirationDate: z.string().optional(),
53350
54016
  credentialStatus: CredentialStatusValidator.or(
53351
54017
  CredentialStatusValidator.array()
53352
54018
  ).optional(),
53353
- name: mod.string().optional(),
53354
- description: mod.string().optional(),
53355
- validFrom: mod.string().optional(),
53356
- validUntil: mod.string().optional(),
54019
+ name: z.string().optional(),
54020
+ description: z.string().optional(),
54021
+ validFrom: z.string().optional(),
54022
+ validUntil: z.string().optional(),
53357
54023
  status: CredentialStatusValidator.or(CredentialStatusValidator.array()).optional(),
53358
54024
  termsOfUse: TermsOfUseValidator.or(TermsOfUseValidator.array()).optional(),
53359
54025
  evidence: VC2EvidenceValidator.or(VC2EvidenceValidator.array()).optional()
53360
- }).catchall(mod.any());
53361
- var ProofValidator = mod.object({
53362
- type: mod.string(),
53363
- created: mod.string(),
53364
- challenge: mod.string().optional(),
53365
- domain: mod.string().optional(),
53366
- nonce: mod.string().optional(),
53367
- proofPurpose: mod.string(),
53368
- verificationMethod: mod.string(),
53369
- jws: mod.string().optional()
53370
- }).catchall(mod.any());
54026
+ }).catchall(z.any());
54027
+ var ProofValidator = z.object({
54028
+ type: z.string(),
54029
+ created: z.string(),
54030
+ challenge: z.string().optional(),
54031
+ domain: z.string().optional(),
54032
+ nonce: z.string().optional(),
54033
+ proofPurpose: z.string(),
54034
+ verificationMethod: z.string(),
54035
+ jws: z.string().optional()
54036
+ }).catchall(z.any());
53371
54037
  var VCValidator = UnsignedVCValidator.extend({
53372
54038
  proof: ProofValidator.or(ProofValidator.array())
53373
54039
  });
53374
- var UnsignedVPValidator = mod.object({
54040
+ var UnsignedVPValidator = z.object({
53375
54041
  "@context": ContextValidator,
53376
- id: mod.string().optional(),
53377
- type: mod.string().or(mod.string().array().nonempty()),
54042
+ id: z.string().optional(),
54043
+ type: z.string().or(z.string().array().nonempty()),
53378
54044
  verifiableCredential: VCValidator.or(VCValidator.array()).optional(),
53379
- holder: mod.string().optional()
53380
- }).catchall(mod.any());
54045
+ holder: z.string().optional()
54046
+ }).catchall(z.any());
53381
54047
  var VPValidator = UnsignedVPValidator.extend({
53382
54048
  proof: ProofValidator.or(ProofValidator.array())
53383
54049
  });
53384
- var JWKValidator = mod.object({
53385
- kty: mod.string(),
53386
- crv: mod.string(),
53387
- x: mod.string(),
53388
- y: mod.string().optional(),
53389
- n: mod.string().optional(),
53390
- d: mod.string().optional()
54050
+ var JWKValidator = z.object({
54051
+ kty: z.string(),
54052
+ crv: z.string(),
54053
+ x: z.string(),
54054
+ y: z.string().optional(),
54055
+ n: z.string().optional(),
54056
+ d: z.string().optional()
53391
54057
  });
53392
- var JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d: mod.string() });
53393
- var JWERecipientHeaderValidator = mod.object({
53394
- alg: mod.string(),
53395
- iv: mod.string(),
53396
- tag: mod.string(),
54058
+ var JWKWithPrivateKeyValidator = JWKValidator.omit({ d: true }).extend({ d: z.string() });
54059
+ var JWERecipientHeaderValidator = z.object({
54060
+ alg: z.string(),
54061
+ iv: z.string(),
54062
+ tag: z.string(),
53397
54063
  epk: JWKValidator.partial().optional(),
53398
- kid: mod.string().optional(),
53399
- apv: mod.string().optional(),
53400
- apu: mod.string().optional()
54064
+ kid: z.string().optional(),
54065
+ apv: z.string().optional(),
54066
+ apu: z.string().optional()
53401
54067
  });
53402
- var JWERecipientValidator = mod.object({
54068
+ var JWERecipientValidator = z.object({
53403
54069
  header: JWERecipientHeaderValidator,
53404
- encrypted_key: mod.string()
54070
+ encrypted_key: z.string()
53405
54071
  });
53406
- var JWEValidator = mod.object({
53407
- protected: mod.string(),
53408
- iv: mod.string(),
53409
- ciphertext: mod.string(),
53410
- tag: mod.string(),
53411
- aad: mod.string().optional(),
54072
+ var JWEValidator = z.object({
54073
+ protected: z.string(),
54074
+ iv: z.string(),
54075
+ ciphertext: z.string(),
54076
+ tag: z.string(),
54077
+ aad: z.string().optional(),
53412
54078
  recipients: JWERecipientValidator.array().optional()
53413
54079
  });
53414
- var VerificationMethodValidator = mod.string().or(
53415
- mod.object({
54080
+ var VerificationMethodValidator = z.string().or(
54081
+ z.object({
53416
54082
  "@context": ContextValidator.optional(),
53417
- id: mod.string(),
53418
- type: mod.string(),
53419
- controller: mod.string(),
54083
+ id: z.string(),
54084
+ type: z.string(),
54085
+ controller: z.string(),
53420
54086
  publicKeyJwk: JWKValidator.optional(),
53421
- publicKeyBase58: mod.string().optional(),
53422
- blockChainAccountId: mod.string().optional()
53423
- }).catchall(mod.any())
54087
+ publicKeyBase58: z.string().optional(),
54088
+ blockChainAccountId: z.string().optional()
54089
+ }).catchall(z.any())
53424
54090
  );
53425
- var ServiceValidator = mod.object({
53426
- id: mod.string(),
53427
- type: mod.string().or(mod.string().array().nonempty()),
53428
- serviceEndpoint: mod.any().or(mod.any().array().nonempty())
53429
- }).catchall(mod.any());
53430
- var DidDocumentValidator = mod.object({
54091
+ var ServiceValidator = z.object({
54092
+ id: z.string(),
54093
+ type: z.string().or(z.string().array().nonempty()),
54094
+ serviceEndpoint: z.any().or(z.any().array().nonempty())
54095
+ }).catchall(z.any());
54096
+ var DidDocumentValidator = z.object({
53431
54097
  "@context": ContextValidator,
53432
- id: mod.string(),
53433
- alsoKnownAs: mod.string().optional(),
53434
- controller: mod.string().or(mod.string().array().nonempty()).optional(),
54098
+ id: z.string(),
54099
+ alsoKnownAs: z.string().optional(),
54100
+ controller: z.string().or(z.string().array().nonempty()).optional(),
53435
54101
  verificationMethod: VerificationMethodValidator.array().optional(),
53436
54102
  authentication: VerificationMethodValidator.array().optional(),
53437
54103
  assertionMethod: VerificationMethodValidator.array().optional(),
@@ -53441,8 +54107,8 @@ var DidDocumentValidator = mod.object({
53441
54107
  publicKey: VerificationMethodValidator.array().optional(),
53442
54108
  service: ServiceValidator.array().optional(),
53443
54109
  proof: ProofValidator.or(ProofValidator.array()).optional()
53444
- }).catchall(mod.any());
53445
- var AlignmentTargetTypeValidator = mod.enum([
54110
+ }).catchall(z.any());
54111
+ var AlignmentTargetTypeValidator = z.enum([
53446
54112
  "ceasn:Competency",
53447
54113
  "ceterms:Credential",
53448
54114
  "CFItem",
@@ -53450,17 +54116,17 @@ var AlignmentTargetTypeValidator = mod.enum([
53450
54116
  "CFRubricCriterion",
53451
54117
  "CFRubricCriterionLevel",
53452
54118
  "CTDL"
53453
- ]).or(mod.string());
53454
- var AlignmentValidator = mod.object({
53455
- type: mod.string().array().nonempty(),
53456
- targetCode: mod.string().optional(),
53457
- targetDescription: mod.string().optional(),
53458
- targetName: mod.string(),
53459
- targetFramework: mod.string().optional(),
54119
+ ]).or(z.string());
54120
+ var AlignmentValidator = z.object({
54121
+ type: z.string().array().nonempty(),
54122
+ targetCode: z.string().optional(),
54123
+ targetDescription: z.string().optional(),
54124
+ targetName: z.string(),
54125
+ targetFramework: z.string().optional(),
53460
54126
  targetType: AlignmentTargetTypeValidator.optional(),
53461
- targetUrl: mod.string()
54127
+ targetUrl: z.string()
53462
54128
  });
53463
- var KnownAchievementTypeValidator = mod.enum([
54129
+ var KnownAchievementTypeValidator = z.enum([
53464
54130
  "Achievement",
53465
54131
  "ApprenticeshipCertificate",
53466
54132
  "Assessment",
@@ -53493,23 +54159,23 @@ var KnownAchievementTypeValidator = mod.enum([
53493
54159
  "ResearchDoctorate",
53494
54160
  "SecondarySchoolDiploma"
53495
54161
  ]);
53496
- var AchievementTypeValidator = KnownAchievementTypeValidator.or(mod.string());
53497
- var CriteriaValidator = mod.object({ id: mod.string().optional(), narrative: mod.string().optional() }).catchall(mod.any());
53498
- var EndorsementSubjectValidator = mod.object({
53499
- id: mod.string(),
53500
- type: mod.string().array().nonempty(),
53501
- endorsementComment: mod.string().optional()
54162
+ var AchievementTypeValidator = KnownAchievementTypeValidator.or(z.string());
54163
+ var CriteriaValidator = z.object({ id: z.string().optional(), narrative: z.string().optional() }).catchall(z.any());
54164
+ var EndorsementSubjectValidator = z.object({
54165
+ id: z.string(),
54166
+ type: z.string().array().nonempty(),
54167
+ endorsementComment: z.string().optional()
53502
54168
  });
53503
54169
  var EndorsementCredentialValidator = UnsignedVCValidator.extend({
53504
54170
  credentialSubject: EndorsementSubjectValidator,
53505
54171
  proof: ProofValidator.or(ProofValidator.array()).optional()
53506
54172
  });
53507
- var RelatedValidator = mod.object({
53508
- id: mod.string(),
53509
- "@language": mod.string().optional(),
53510
- version: mod.string().optional()
54173
+ var RelatedValidator = z.object({
54174
+ id: z.string(),
54175
+ "@language": z.string().optional(),
54176
+ version: z.string().optional()
53511
54177
  });
53512
- var ResultTypeValidator = mod.enum([
54178
+ var ResultTypeValidator = z.enum([
53513
54179
  "GradePointAverage",
53514
54180
  "LetterGrade",
53515
54181
  "Percent",
@@ -53522,59 +54188,59 @@ var ResultTypeValidator = mod.enum([
53522
54188
  "RubricScore",
53523
54189
  "ScaledScore",
53524
54190
  "Status"
53525
- ]).or(mod.string());
53526
- var RubricCriterionValidator = mod.object({
53527
- id: mod.string(),
53528
- type: mod.string().array().nonempty(),
54191
+ ]).or(z.string());
54192
+ var RubricCriterionValidator = z.object({
54193
+ id: z.string(),
54194
+ type: z.string().array().nonempty(),
53529
54195
  alignment: AlignmentValidator.array().optional(),
53530
- description: mod.string().optional(),
53531
- level: mod.string().optional(),
53532
- name: mod.string(),
53533
- points: mod.string().optional()
53534
- }).catchall(mod.any());
53535
- var ResultDescriptionValidator = mod.object({
53536
- id: mod.string(),
53537
- type: mod.string().array().nonempty(),
54196
+ description: z.string().optional(),
54197
+ level: z.string().optional(),
54198
+ name: z.string(),
54199
+ points: z.string().optional()
54200
+ }).catchall(z.any());
54201
+ var ResultDescriptionValidator = z.object({
54202
+ id: z.string(),
54203
+ type: z.string().array().nonempty(),
53538
54204
  alignment: AlignmentValidator.array().optional(),
53539
- allowedValue: mod.string().array().optional(),
53540
- name: mod.string(),
53541
- requiredLevel: mod.string().optional(),
53542
- requiredValue: mod.string().optional(),
54205
+ allowedValue: z.string().array().optional(),
54206
+ name: z.string(),
54207
+ requiredLevel: z.string().optional(),
54208
+ requiredValue: z.string().optional(),
53543
54209
  resultType: ResultTypeValidator,
53544
54210
  rubricCriterionLevel: RubricCriterionValidator.array().optional(),
53545
- valueMax: mod.string().optional(),
53546
- valueMin: mod.string().optional()
53547
- }).catchall(mod.any());
53548
- var AchievementValidator = mod.object({
53549
- id: mod.string().optional(),
53550
- type: mod.string().array().nonempty(),
54211
+ valueMax: z.string().optional(),
54212
+ valueMin: z.string().optional()
54213
+ }).catchall(z.any());
54214
+ var AchievementValidator = z.object({
54215
+ id: z.string().optional(),
54216
+ type: z.string().array().nonempty(),
53551
54217
  alignment: AlignmentValidator.array().optional(),
53552
54218
  achievementType: AchievementTypeValidator.optional(),
53553
54219
  creator: ProfileValidator.optional(),
53554
- creditsAvailable: mod.number().optional(),
54220
+ creditsAvailable: z.number().optional(),
53555
54221
  criteria: CriteriaValidator,
53556
- description: mod.string(),
54222
+ description: z.string(),
53557
54223
  endorsement: EndorsementCredentialValidator.array().optional(),
53558
- fieldOfStudy: mod.string().optional(),
53559
- humanCode: mod.string().optional(),
54224
+ fieldOfStudy: z.string().optional(),
54225
+ humanCode: z.string().optional(),
53560
54226
  image: ImageValidator.optional(),
53561
- "@language": mod.string().optional(),
53562
- name: mod.string(),
54227
+ "@language": z.string().optional(),
54228
+ name: z.string(),
53563
54229
  otherIdentifier: IdentifierEntryValidator.array().optional(),
53564
54230
  related: RelatedValidator.array().optional(),
53565
54231
  resultDescription: ResultDescriptionValidator.array().optional(),
53566
- specialization: mod.string().optional(),
53567
- tag: mod.string().array().optional(),
53568
- version: mod.string().optional()
53569
- }).catchall(mod.any());
53570
- var IdentityObjectValidator = mod.object({
53571
- type: mod.string(),
53572
- hashed: mod.boolean(),
53573
- identityHash: mod.string(),
53574
- identityType: mod.string(),
53575
- salt: mod.string().optional()
54232
+ specialization: z.string().optional(),
54233
+ tag: z.string().array().optional(),
54234
+ version: z.string().optional()
54235
+ }).catchall(z.any());
54236
+ var IdentityObjectValidator = z.object({
54237
+ type: z.string(),
54238
+ hashed: z.boolean(),
54239
+ identityHash: z.string(),
54240
+ identityType: z.string(),
54241
+ salt: z.string().optional()
53576
54242
  });
53577
- var ResultStatusTypeValidator = mod.enum([
54243
+ var ResultStatusTypeValidator = z.enum([
53578
54244
  "Completed",
53579
54245
  "Enrolled",
53580
54246
  "Failed",
@@ -53582,42 +54248,42 @@ var ResultStatusTypeValidator = mod.enum([
53582
54248
  "OnHold",
53583
54249
  "Withdrew"
53584
54250
  ]);
53585
- var ResultValidator = mod.object({
53586
- type: mod.string().array().nonempty(),
53587
- achievedLevel: mod.string().optional(),
54251
+ var ResultValidator = z.object({
54252
+ type: z.string().array().nonempty(),
54253
+ achievedLevel: z.string().optional(),
53588
54254
  alignment: AlignmentValidator.array().optional(),
53589
- resultDescription: mod.string().optional(),
54255
+ resultDescription: z.string().optional(),
53590
54256
  status: ResultStatusTypeValidator.optional(),
53591
- value: mod.string().optional()
53592
- }).catchall(mod.any());
53593
- var AchievementSubjectValidator = mod.object({
53594
- id: mod.string().optional(),
53595
- type: mod.string().array().nonempty(),
53596
- activityEndDate: mod.string().optional(),
53597
- activityStartDate: mod.string().optional(),
53598
- creditsEarned: mod.number().optional(),
54257
+ value: z.string().optional()
54258
+ }).catchall(z.any());
54259
+ var AchievementSubjectValidator = z.object({
54260
+ id: z.string().optional(),
54261
+ type: z.string().array().nonempty(),
54262
+ activityEndDate: z.string().optional(),
54263
+ activityStartDate: z.string().optional(),
54264
+ creditsEarned: z.number().optional(),
53599
54265
  achievement: AchievementValidator.optional(),
53600
54266
  identifier: IdentityObjectValidator.array().optional(),
53601
54267
  image: ImageValidator.optional(),
53602
- licenseNumber: mod.string().optional(),
53603
- narrative: mod.string().optional(),
54268
+ licenseNumber: z.string().optional(),
54269
+ narrative: z.string().optional(),
53604
54270
  result: ResultValidator.array().optional(),
53605
- role: mod.string().optional(),
54271
+ role: z.string().optional(),
53606
54272
  source: ProfileValidator.optional(),
53607
- term: mod.string().optional()
53608
- }).catchall(mod.any());
53609
- var EvidenceValidator = mod.object({
53610
- id: mod.string().optional(),
53611
- type: mod.string().or(mod.string().array().nonempty()),
53612
- narrative: mod.string().optional(),
53613
- name: mod.string().optional(),
53614
- description: mod.string().optional(),
53615
- genre: mod.string().optional(),
53616
- audience: mod.string().optional()
53617
- }).catchall(mod.any());
54273
+ term: z.string().optional()
54274
+ }).catchall(z.any());
54275
+ var EvidenceValidator = z.object({
54276
+ id: z.string().optional(),
54277
+ type: z.string().or(z.string().array().nonempty()),
54278
+ narrative: z.string().optional(),
54279
+ name: z.string().optional(),
54280
+ description: z.string().optional(),
54281
+ genre: z.string().optional(),
54282
+ audience: z.string().optional()
54283
+ }).catchall(z.any());
53618
54284
  var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
53619
- name: mod.string().optional(),
53620
- description: mod.string().optional(),
54285
+ name: z.string().optional(),
54286
+ description: z.string().optional(),
53621
54287
  image: ImageValidator.optional(),
53622
54288
  credentialSubject: AchievementSubjectValidator.or(
53623
54289
  AchievementSubjectValidator.array()
@@ -53628,42 +54294,42 @@ var UnsignedAchievementCredentialValidator = UnsignedVCValidator.extend({
53628
54294
  var AchievementCredentialValidator = UnsignedAchievementCredentialValidator.extend({
53629
54295
  proof: ProofValidator.or(ProofValidator.array())
53630
54296
  });
53631
- var VerificationCheckValidator = mod.object({
53632
- checks: mod.string().array(),
53633
- warnings: mod.string().array(),
53634
- errors: mod.string().array()
54297
+ var VerificationCheckValidator = z.object({
54298
+ checks: z.string().array(),
54299
+ warnings: z.string().array(),
54300
+ errors: z.string().array()
53635
54301
  });
53636
- var VerificationStatusValidator = mod.enum(["Success", "Failed", "Error"]);
54302
+ var VerificationStatusValidator = z.enum(["Success", "Failed", "Error"]);
53637
54303
  var VerificationStatusEnum = VerificationStatusValidator.enum;
53638
- var VerificationItemValidator = mod.object({
53639
- check: mod.string(),
54304
+ var VerificationItemValidator = z.object({
54305
+ check: z.string(),
53640
54306
  status: VerificationStatusValidator,
53641
- message: mod.string().optional(),
53642
- details: mod.string().optional()
54307
+ message: z.string().optional(),
54308
+ details: z.string().optional()
53643
54309
  });
53644
- var CredentialInfoValidator = mod.object({
53645
- title: mod.string().optional(),
53646
- createdAt: mod.string().optional(),
54310
+ var CredentialInfoValidator = z.object({
54311
+ title: z.string().optional(),
54312
+ createdAt: z.string().optional(),
53647
54313
  issuer: ProfileValidator.optional(),
53648
54314
  issuee: ProfileValidator.optional(),
53649
54315
  credentialSubject: CredentialSubjectValidator.optional()
53650
54316
  });
53651
- var CredentialRecordValidator = mod.object({ id: mod.string(), uri: mod.string() }).catchall(mod.any());
53652
- var PaginationOptionsValidator = mod.object({
53653
- limit: mod.number(),
53654
- cursor: mod.string().optional(),
53655
- sort: mod.string().optional()
54317
+ var CredentialRecordValidator = z.object({ id: z.string(), uri: z.string() }).catchall(z.any());
54318
+ var PaginationOptionsValidator = z.object({
54319
+ limit: z.number(),
54320
+ cursor: z.string().optional(),
54321
+ sort: z.string().optional()
53656
54322
  });
53657
- var PaginationResponseValidator = mod.object({
53658
- cursor: mod.string().optional(),
53659
- hasMore: mod.boolean()
54323
+ var PaginationResponseValidator = z.object({
54324
+ cursor: z.string().optional(),
54325
+ hasMore: z.boolean()
53660
54326
  });
53661
- var EncryptedRecordValidator = mod.object({ encryptedRecord: JWEValidator, fields: mod.string().array() }).catchall(mod.any());
54327
+ var EncryptedRecordValidator = z.object({ encryptedRecord: JWEValidator, fields: z.string().array() }).catchall(z.any());
53662
54328
  var PaginatedEncryptedRecordsValidator = PaginationResponseValidator.extend({
53663
54329
  records: EncryptedRecordValidator.array()
53664
54330
  });
53665
54331
  var EncryptedCredentialRecordValidator = EncryptedRecordValidator.extend({
53666
- id: mod.string()
54332
+ id: z.string()
53667
54333
  });
53668
54334
  var PaginatedEncryptedCredentialRecordsValidator = PaginationResponseValidator.extend({
53669
54335
  records: EncryptedCredentialRecordValidator.array()
@@ -53674,8 +54340,8 @@ var parseRegexString = /* @__PURE__ */ __name2((regexStr) => {
53674
54340
  throw new Error("Invalid RegExp string format");
53675
54341
  return { pattern: match[1], flags: match[2] };
53676
54342
  }, "parseRegexString");
53677
- var RegExpValidator = mod.instanceof(RegExp).or(
53678
- mod.string().refine(
54343
+ var RegExpValidator = z.instanceof(RegExp).or(
54344
+ z.string().refine(
53679
54345
  (str) => {
53680
54346
  try {
53681
54347
  parseRegexString(str);
@@ -53696,71 +54362,71 @@ var RegExpValidator = mod.instanceof(RegExp).or(
53696
54362
  }
53697
54363
  })
53698
54364
  );
53699
- var StringQuery = mod.string().or(mod.object({ $in: mod.string().array() })).or(mod.object({ $regex: RegExpValidator }));
53700
- var LCNProfileDisplayValidator = mod.object({
53701
- backgroundColor: mod.string().optional(),
53702
- backgroundImage: mod.string().optional(),
53703
- fadeBackgroundImage: mod.boolean().optional(),
53704
- repeatBackgroundImage: mod.boolean().optional(),
53705
- fontColor: mod.string().optional(),
53706
- accentColor: mod.string().optional(),
53707
- accentFontColor: mod.string().optional(),
53708
- idBackgroundImage: mod.string().optional(),
53709
- fadeIdBackgroundImage: mod.boolean().optional(),
53710
- idBackgroundColor: mod.string().optional(),
53711
- repeatIdBackgroundImage: mod.boolean().optional()
54365
+ var StringQuery = z.string().or(z.object({ $in: z.string().array() })).or(z.object({ $regex: RegExpValidator }));
54366
+ var LCNProfileDisplayValidator = z.object({
54367
+ backgroundColor: z.string().optional(),
54368
+ backgroundImage: z.string().optional(),
54369
+ fadeBackgroundImage: z.boolean().optional(),
54370
+ repeatBackgroundImage: z.boolean().optional(),
54371
+ fontColor: z.string().optional(),
54372
+ accentColor: z.string().optional(),
54373
+ accentFontColor: z.string().optional(),
54374
+ idBackgroundImage: z.string().optional(),
54375
+ fadeIdBackgroundImage: z.boolean().optional(),
54376
+ idBackgroundColor: z.string().optional(),
54377
+ repeatIdBackgroundImage: z.boolean().optional()
53712
54378
  });
53713
- var LCNProfileValidator = mod.object({
53714
- profileId: mod.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),
53715
- displayName: mod.string().default("").describe("Human-readable display name for the profile."),
53716
- shortBio: mod.string().default("").describe("Short bio for the profile."),
53717
- bio: mod.string().default("").describe("Longer bio for the profile."),
53718
- did: mod.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
53719
- isPrivate: mod.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
53720
- email: mod.string().optional().describe("Contact email address for the profile."),
53721
- image: mod.string().optional().describe("Profile image URL for the profile."),
53722
- heroImage: mod.string().optional().describe("Hero image URL for the profile."),
53723
- websiteLink: mod.string().optional().describe("Website link for the profile."),
53724
- isServiceProfile: mod.boolean().default(false).optional().describe("Whether the profile is a service profile or not."),
53725
- type: mod.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),
53726
- notificationsWebhook: mod.string().url().startsWith("http").optional().describe("URL to send notifications to."),
54379
+ var LCNProfileValidator = z.object({
54380
+ profileId: z.string().min(3).max(40).describe("Unique, URL-safe identifier for the profile."),
54381
+ displayName: z.string().default("").describe("Human-readable display name for the profile."),
54382
+ shortBio: z.string().default("").describe("Short bio for the profile."),
54383
+ bio: z.string().default("").describe("Longer bio for the profile."),
54384
+ did: z.string().describe("Decentralized Identifier for the profile. (auto-assigned)"),
54385
+ isPrivate: z.boolean().optional().describe("Whether the profile is private or not and shows up in search results."),
54386
+ email: z.string().optional().describe("Contact email address for the profile."),
54387
+ image: z.string().optional().describe("Profile image URL for the profile."),
54388
+ heroImage: z.string().optional().describe("Hero image URL for the profile."),
54389
+ websiteLink: z.string().optional().describe("Website link for the profile."),
54390
+ isServiceProfile: z.boolean().default(false).optional().describe("Whether the profile is a service profile or not."),
54391
+ type: z.string().optional().describe('Profile type: e.g. "person", "organization", "service".'),
54392
+ notificationsWebhook: z.string().url().startsWith("http").optional().describe("URL to send notifications to."),
53727
54393
  display: LCNProfileDisplayValidator.optional().describe("Display settings for the profile."),
53728
- role: mod.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),
53729
- dob: mod.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')
54394
+ role: z.string().default("").optional().describe('Role of the profile: e.g. "teacher", "student".'),
54395
+ dob: z.string().default("").optional().describe('Date of birth of the profile: e.g. "1990-01-01".')
53730
54396
  });
53731
- var LCNProfileQueryValidator = mod.object({
54397
+ var LCNProfileQueryValidator = z.object({
53732
54398
  profileId: StringQuery,
53733
54399
  displayName: StringQuery,
53734
54400
  shortBio: StringQuery,
53735
54401
  bio: StringQuery,
53736
54402
  email: StringQuery,
53737
54403
  websiteLink: StringQuery,
53738
- isServiceProfile: mod.boolean(),
54404
+ isServiceProfile: z.boolean(),
53739
54405
  type: StringQuery
53740
54406
  }).partial();
53741
54407
  var PaginatedLCNProfilesValidator = PaginationResponseValidator.extend({
53742
54408
  records: LCNProfileValidator.array()
53743
54409
  });
53744
- var LCNProfileConnectionStatusEnum = mod.enum([
54410
+ var LCNProfileConnectionStatusEnum = z.enum([
53745
54411
  "CONNECTED",
53746
54412
  "PENDING_REQUEST_SENT",
53747
54413
  "PENDING_REQUEST_RECEIVED",
53748
54414
  "NOT_CONNECTED"
53749
54415
  ]);
53750
- var LCNProfileManagerValidator = mod.object({
53751
- id: mod.string(),
53752
- created: mod.string(),
53753
- displayName: mod.string().default("").optional(),
53754
- shortBio: mod.string().default("").optional(),
53755
- bio: mod.string().default("").optional(),
53756
- email: mod.string().optional(),
53757
- image: mod.string().optional(),
53758
- heroImage: mod.string().optional()
54416
+ var LCNProfileManagerValidator = z.object({
54417
+ id: z.string(),
54418
+ created: z.string(),
54419
+ displayName: z.string().default("").optional(),
54420
+ shortBio: z.string().default("").optional(),
54421
+ bio: z.string().default("").optional(),
54422
+ email: z.string().optional(),
54423
+ image: z.string().optional(),
54424
+ heroImage: z.string().optional()
53759
54425
  });
53760
54426
  var PaginatedLCNProfileManagersValidator = PaginationResponseValidator.extend({
53761
- records: LCNProfileManagerValidator.extend({ did: mod.string() }).array()
54427
+ records: LCNProfileManagerValidator.extend({ did: z.string() }).array()
53762
54428
  });
53763
- var LCNProfileManagerQueryValidator = mod.object({
54429
+ var LCNProfileManagerQueryValidator = z.object({
53764
54430
  id: StringQuery,
53765
54431
  displayName: StringQuery,
53766
54432
  shortBio: StringQuery,
@@ -53768,296 +54434,297 @@ var LCNProfileManagerQueryValidator = mod.object({
53768
54434
  email: StringQuery
53769
54435
  }).partial();
53770
54436
  var PaginatedLCNProfilesAndManagersValidator = PaginationResponseValidator.extend({
53771
- records: mod.object({
54437
+ records: z.object({
53772
54438
  profile: LCNProfileValidator,
53773
- manager: LCNProfileManagerValidator.extend({ did: mod.string() }).optional()
54439
+ manager: LCNProfileManagerValidator.extend({ did: z.string() }).optional()
53774
54440
  }).array()
53775
54441
  });
53776
- var SentCredentialInfoValidator = mod.object({
53777
- uri: mod.string(),
53778
- to: mod.string(),
53779
- from: mod.string(),
53780
- sent: mod.string().datetime(),
53781
- received: mod.string().datetime().optional()
54442
+ var SentCredentialInfoValidator = z.object({
54443
+ uri: z.string(),
54444
+ to: z.string(),
54445
+ from: z.string(),
54446
+ sent: z.string().datetime(),
54447
+ received: z.string().datetime().optional()
53782
54448
  });
53783
- var BoostPermissionsValidator = mod.object({
53784
- role: mod.string(),
53785
- canEdit: mod.boolean(),
53786
- canIssue: mod.boolean(),
53787
- canRevoke: mod.boolean(),
53788
- canManagePermissions: mod.boolean(),
53789
- canIssueChildren: mod.string(),
53790
- canCreateChildren: mod.string(),
53791
- canEditChildren: mod.string(),
53792
- canRevokeChildren: mod.string(),
53793
- canManageChildrenPermissions: mod.string(),
53794
- canManageChildrenProfiles: mod.boolean().default(false).optional(),
53795
- canViewAnalytics: mod.boolean()
54449
+ var BoostPermissionsValidator = z.object({
54450
+ role: z.string(),
54451
+ canEdit: z.boolean(),
54452
+ canIssue: z.boolean(),
54453
+ canRevoke: z.boolean(),
54454
+ canManagePermissions: z.boolean(),
54455
+ canIssueChildren: z.string(),
54456
+ canCreateChildren: z.string(),
54457
+ canEditChildren: z.string(),
54458
+ canRevokeChildren: z.string(),
54459
+ canManageChildrenPermissions: z.string(),
54460
+ canManageChildrenProfiles: z.boolean().default(false).optional(),
54461
+ canViewAnalytics: z.boolean()
53796
54462
  });
53797
- var BoostPermissionsQueryValidator = mod.object({
54463
+ var BoostPermissionsQueryValidator = z.object({
53798
54464
  role: StringQuery,
53799
- canEdit: mod.boolean(),
53800
- canIssue: mod.boolean(),
53801
- canRevoke: mod.boolean(),
53802
- canManagePermissions: mod.boolean(),
54465
+ canEdit: z.boolean(),
54466
+ canIssue: z.boolean(),
54467
+ canRevoke: z.boolean(),
54468
+ canManagePermissions: z.boolean(),
53803
54469
  canIssueChildren: StringQuery,
53804
54470
  canCreateChildren: StringQuery,
53805
54471
  canEditChildren: StringQuery,
53806
54472
  canRevokeChildren: StringQuery,
53807
54473
  canManageChildrenPermissions: StringQuery,
53808
- canManageChildrenProfiles: mod.boolean(),
53809
- canViewAnalytics: mod.boolean()
54474
+ canManageChildrenProfiles: z.boolean(),
54475
+ canViewAnalytics: z.boolean()
53810
54476
  }).partial();
53811
- var ClaimHookTypeValidator = mod.enum(["GRANT_PERMISSIONS", "ADD_ADMIN"]);
53812
- var ClaimHookValidator = mod.discriminatedUnion("type", [
53813
- mod.object({
53814
- type: mod.literal(ClaimHookTypeValidator.Values.GRANT_PERMISSIONS),
53815
- data: mod.object({
53816
- claimUri: mod.string(),
53817
- targetUri: mod.string(),
54477
+ var ClaimHookTypeValidator = z.enum(["GRANT_PERMISSIONS", "ADD_ADMIN"]);
54478
+ var ClaimHookValidator = z.discriminatedUnion("type", [
54479
+ z.object({
54480
+ type: z.literal(ClaimHookTypeValidator.Values.GRANT_PERMISSIONS),
54481
+ data: z.object({
54482
+ claimUri: z.string(),
54483
+ targetUri: z.string(),
53818
54484
  permissions: BoostPermissionsValidator.partial()
53819
54485
  })
53820
54486
  }),
53821
- mod.object({
53822
- type: mod.literal(ClaimHookTypeValidator.Values.ADD_ADMIN),
53823
- data: mod.object({ claimUri: mod.string(), targetUri: mod.string() })
54487
+ z.object({
54488
+ type: z.literal(ClaimHookTypeValidator.Values.ADD_ADMIN),
54489
+ data: z.object({ claimUri: z.string(), targetUri: z.string() })
53824
54490
  })
53825
54491
  ]);
53826
- var ClaimHookQueryValidator = mod.object({
54492
+ var ClaimHookQueryValidator = z.object({
53827
54493
  type: StringQuery,
53828
- data: mod.object({
54494
+ data: z.object({
53829
54495
  claimUri: StringQuery,
53830
54496
  targetUri: StringQuery,
53831
54497
  permissions: BoostPermissionsQueryValidator
53832
54498
  })
53833
54499
  }).deepPartial();
53834
- var FullClaimHookValidator = mod.object({ id: mod.string(), createdAt: mod.string(), updatedAt: mod.string() }).and(ClaimHookValidator);
54500
+ var FullClaimHookValidator = z.object({ id: z.string(), createdAt: z.string(), updatedAt: z.string() }).and(ClaimHookValidator);
53835
54501
  var PaginatedClaimHooksValidator = PaginationResponseValidator.extend({
53836
54502
  records: FullClaimHookValidator.array()
53837
54503
  });
53838
- var LCNBoostStatus = mod.enum(["DRAFT", "LIVE"]);
53839
- var BoostValidator = mod.object({
53840
- uri: mod.string(),
53841
- name: mod.string().optional(),
53842
- type: mod.string().optional(),
53843
- category: mod.string().optional(),
54504
+ var LCNBoostStatus = z.enum(["DRAFT", "LIVE"]);
54505
+ var BoostValidator = z.object({
54506
+ uri: z.string(),
54507
+ name: z.string().optional(),
54508
+ type: z.string().optional(),
54509
+ category: z.string().optional(),
53844
54510
  status: LCNBoostStatus.optional(),
53845
- autoConnectRecipients: mod.boolean().optional(),
53846
- meta: mod.record(mod.any()).optional(),
53847
- claimPermissions: BoostPermissionsValidator.optional()
54511
+ autoConnectRecipients: z.boolean().optional(),
54512
+ meta: z.record(z.any()).optional(),
54513
+ claimPermissions: BoostPermissionsValidator.optional(),
54514
+ allowAnyoneToCreateChildren: z.boolean().optional()
53848
54515
  });
53849
- var BoostQueryValidator = mod.object({
54516
+ var BoostQueryValidator = z.object({
53850
54517
  uri: StringQuery,
53851
54518
  name: StringQuery,
53852
54519
  type: StringQuery,
53853
54520
  category: StringQuery,
53854
- meta: mod.record(StringQuery),
53855
- status: LCNBoostStatus.or(mod.object({ $in: LCNBoostStatus.array() })),
53856
- autoConnectRecipients: mod.boolean()
54521
+ meta: z.record(StringQuery),
54522
+ status: LCNBoostStatus.or(z.object({ $in: LCNBoostStatus.array() })),
54523
+ autoConnectRecipients: z.boolean()
53857
54524
  }).partial();
53858
54525
  var PaginatedBoostsValidator = PaginationResponseValidator.extend({
53859
54526
  records: BoostValidator.array()
53860
54527
  });
53861
- var BoostRecipientValidator = mod.object({
54528
+ var BoostRecipientValidator = z.object({
53862
54529
  to: LCNProfileValidator,
53863
- from: mod.string(),
53864
- received: mod.string().optional(),
53865
- uri: mod.string().optional()
54530
+ from: z.string(),
54531
+ received: z.string().optional(),
54532
+ uri: z.string().optional()
53866
54533
  });
53867
54534
  var PaginatedBoostRecipientsValidator = PaginationResponseValidator.extend({
53868
54535
  records: BoostRecipientValidator.array()
53869
54536
  });
53870
- var LCNBoostClaimLinkSigningAuthorityValidator = mod.object({
53871
- endpoint: mod.string(),
53872
- name: mod.string(),
53873
- did: mod.string().optional()
54537
+ var LCNBoostClaimLinkSigningAuthorityValidator = z.object({
54538
+ endpoint: z.string(),
54539
+ name: z.string(),
54540
+ did: z.string().optional()
53874
54541
  });
53875
- var LCNBoostClaimLinkOptionsValidator = mod.object({
53876
- ttlSeconds: mod.number().optional(),
53877
- totalUses: mod.number().optional()
54542
+ var LCNBoostClaimLinkOptionsValidator = z.object({
54543
+ ttlSeconds: z.number().optional(),
54544
+ totalUses: z.number().optional()
53878
54545
  });
53879
- var LCNSigningAuthorityValidator = mod.object({
53880
- endpoint: mod.string()
54546
+ var LCNSigningAuthorityValidator = z.object({
54547
+ endpoint: z.string()
53881
54548
  });
53882
- var LCNSigningAuthorityForUserValidator = mod.object({
54549
+ var LCNSigningAuthorityForUserValidator = z.object({
53883
54550
  signingAuthority: LCNSigningAuthorityValidator,
53884
- relationship: mod.object({
53885
- name: mod.string().max(15).regex(/^[a-z0-9-]+$/, {
54551
+ relationship: z.object({
54552
+ name: z.string().max(15).regex(/^[a-z0-9-]+$/, {
53886
54553
  message: "The input string must contain only lowercase letters, numbers, and hyphens."
53887
54554
  }),
53888
- did: mod.string()
54555
+ did: z.string()
53889
54556
  })
53890
54557
  });
53891
- var AutoBoostConfigValidator = mod.object({
53892
- boostUri: mod.string(),
53893
- signingAuthority: mod.object({
53894
- endpoint: mod.string(),
53895
- name: mod.string()
54558
+ var AutoBoostConfigValidator = z.object({
54559
+ boostUri: z.string(),
54560
+ signingAuthority: z.object({
54561
+ endpoint: z.string(),
54562
+ name: z.string()
53896
54563
  })
53897
54564
  });
53898
- var ConsentFlowTermsStatusValidator = mod.enum(["live", "stale", "withdrawn"]);
53899
- var ConsentFlowContractValidator = mod.object({
53900
- read: mod.object({
53901
- anonymize: mod.boolean().optional(),
53902
- credentials: mod.object({ categories: mod.record(mod.object({ required: mod.boolean() })).default({}) }).default({}),
53903
- personal: mod.record(mod.object({ required: mod.boolean() })).default({})
54565
+ var ConsentFlowTermsStatusValidator = z.enum(["live", "stale", "withdrawn"]);
54566
+ var ConsentFlowContractValidator = z.object({
54567
+ read: z.object({
54568
+ anonymize: z.boolean().optional(),
54569
+ credentials: z.object({ categories: z.record(z.object({ required: z.boolean() })).default({}) }).default({}),
54570
+ personal: z.record(z.object({ required: z.boolean() })).default({})
53904
54571
  }).default({}),
53905
- write: mod.object({
53906
- credentials: mod.object({ categories: mod.record(mod.object({ required: mod.boolean() })).default({}) }).default({}),
53907
- personal: mod.record(mod.object({ required: mod.boolean() })).default({})
54572
+ write: z.object({
54573
+ credentials: z.object({ categories: z.record(z.object({ required: z.boolean() })).default({}) }).default({}),
54574
+ personal: z.record(z.object({ required: z.boolean() })).default({})
53908
54575
  }).default({})
53909
54576
  });
53910
- var ConsentFlowContractDetailsValidator = mod.object({
54577
+ var ConsentFlowContractDetailsValidator = z.object({
53911
54578
  contract: ConsentFlowContractValidator,
53912
54579
  owner: LCNProfileValidator,
53913
- name: mod.string(),
53914
- subtitle: mod.string().optional(),
53915
- description: mod.string().optional(),
53916
- reasonForAccessing: mod.string().optional(),
53917
- image: mod.string().optional(),
53918
- uri: mod.string(),
53919
- needsGuardianConsent: mod.boolean().optional(),
53920
- redirectUrl: mod.string().optional(),
53921
- frontDoorBoostUri: mod.string().optional(),
53922
- createdAt: mod.string(),
53923
- updatedAt: mod.string(),
53924
- expiresAt: mod.string().optional(),
53925
- autoBoosts: mod.string().array().optional(),
53926
- writers: mod.array(LCNProfileValidator).optional()
54580
+ name: z.string(),
54581
+ subtitle: z.string().optional(),
54582
+ description: z.string().optional(),
54583
+ reasonForAccessing: z.string().optional(),
54584
+ image: z.string().optional(),
54585
+ uri: z.string(),
54586
+ needsGuardianConsent: z.boolean().optional(),
54587
+ redirectUrl: z.string().optional(),
54588
+ frontDoorBoostUri: z.string().optional(),
54589
+ createdAt: z.string(),
54590
+ updatedAt: z.string(),
54591
+ expiresAt: z.string().optional(),
54592
+ autoBoosts: z.string().array().optional(),
54593
+ writers: z.array(LCNProfileValidator).optional()
53927
54594
  });
53928
54595
  var PaginatedConsentFlowContractsValidator = PaginationResponseValidator.extend({
53929
54596
  records: ConsentFlowContractDetailsValidator.omit({ owner: true }).array()
53930
54597
  });
53931
- var ConsentFlowContractDataValidator = mod.object({
53932
- credentials: mod.object({ categories: mod.record(mod.string().array()).default({}) }),
53933
- personal: mod.record(mod.string()).default({}),
53934
- date: mod.string()
54598
+ var ConsentFlowContractDataValidator = z.object({
54599
+ credentials: z.object({ categories: z.record(z.string().array()).default({}) }),
54600
+ personal: z.record(z.string()).default({}),
54601
+ date: z.string()
53935
54602
  });
53936
54603
  var PaginatedConsentFlowDataValidator = PaginationResponseValidator.extend({
53937
54604
  records: ConsentFlowContractDataValidator.array()
53938
54605
  });
53939
- var ConsentFlowContractDataForDidValidator = mod.object({
53940
- credentials: mod.object({ category: mod.string(), uri: mod.string() }).array(),
53941
- personal: mod.record(mod.string()).default({}),
53942
- date: mod.string(),
53943
- contractUri: mod.string()
54606
+ var ConsentFlowContractDataForDidValidator = z.object({
54607
+ credentials: z.object({ category: z.string(), uri: z.string() }).array(),
54608
+ personal: z.record(z.string()).default({}),
54609
+ date: z.string(),
54610
+ contractUri: z.string()
53944
54611
  });
53945
54612
  var PaginatedConsentFlowDataForDidValidator = PaginationResponseValidator.extend({
53946
54613
  records: ConsentFlowContractDataForDidValidator.array()
53947
54614
  });
53948
- var ConsentFlowTermValidator = mod.object({
53949
- sharing: mod.boolean().optional(),
53950
- shared: mod.string().array().optional(),
53951
- shareAll: mod.boolean().optional(),
53952
- shareUntil: mod.string().optional()
54615
+ var ConsentFlowTermValidator = z.object({
54616
+ sharing: z.boolean().optional(),
54617
+ shared: z.string().array().optional(),
54618
+ shareAll: z.boolean().optional(),
54619
+ shareUntil: z.string().optional()
53953
54620
  });
53954
- var ConsentFlowTermsValidator = mod.object({
53955
- read: mod.object({
53956
- anonymize: mod.boolean().optional(),
53957
- credentials: mod.object({
53958
- shareAll: mod.boolean().optional(),
53959
- sharing: mod.boolean().optional(),
53960
- categories: mod.record(ConsentFlowTermValidator).default({})
54621
+ var ConsentFlowTermsValidator = z.object({
54622
+ read: z.object({
54623
+ anonymize: z.boolean().optional(),
54624
+ credentials: z.object({
54625
+ shareAll: z.boolean().optional(),
54626
+ sharing: z.boolean().optional(),
54627
+ categories: z.record(ConsentFlowTermValidator).default({})
53961
54628
  }).default({}),
53962
- personal: mod.record(mod.string()).default({})
54629
+ personal: z.record(z.string()).default({})
53963
54630
  }).default({}),
53964
- write: mod.object({
53965
- credentials: mod.object({ categories: mod.record(mod.boolean()).default({}) }).default({}),
53966
- personal: mod.record(mod.boolean()).default({})
54631
+ write: z.object({
54632
+ credentials: z.object({ categories: z.record(z.boolean()).default({}) }).default({}),
54633
+ personal: z.record(z.boolean()).default({})
53967
54634
  }).default({}),
53968
- deniedWriters: mod.array(mod.string()).optional()
54635
+ deniedWriters: z.array(z.string()).optional()
53969
54636
  });
53970
54637
  var PaginatedConsentFlowTermsValidator = PaginationResponseValidator.extend({
53971
- records: mod.object({
53972
- expiresAt: mod.string().optional(),
53973
- oneTime: mod.boolean().optional(),
54638
+ records: z.object({
54639
+ expiresAt: z.string().optional(),
54640
+ oneTime: z.boolean().optional(),
53974
54641
  terms: ConsentFlowTermsValidator,
53975
54642
  contract: ConsentFlowContractDetailsValidator,
53976
- uri: mod.string(),
54643
+ uri: z.string(),
53977
54644
  consenter: LCNProfileValidator,
53978
54645
  status: ConsentFlowTermsStatusValidator
53979
54646
  }).array()
53980
54647
  });
53981
- var ConsentFlowContractQueryValidator = mod.object({
53982
- read: mod.object({
53983
- anonymize: mod.boolean().optional(),
53984
- credentials: mod.object({
53985
- categories: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
54648
+ var ConsentFlowContractQueryValidator = z.object({
54649
+ read: z.object({
54650
+ anonymize: z.boolean().optional(),
54651
+ credentials: z.object({
54652
+ categories: z.record(z.object({ required: z.boolean().optional() })).optional()
53986
54653
  }).optional(),
53987
- personal: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
54654
+ personal: z.record(z.object({ required: z.boolean().optional() })).optional()
53988
54655
  }).optional(),
53989
- write: mod.object({
53990
- credentials: mod.object({
53991
- categories: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
54656
+ write: z.object({
54657
+ credentials: z.object({
54658
+ categories: z.record(z.object({ required: z.boolean().optional() })).optional()
53992
54659
  }).optional(),
53993
- personal: mod.record(mod.object({ required: mod.boolean().optional() })).optional()
54660
+ personal: z.record(z.object({ required: z.boolean().optional() })).optional()
53994
54661
  }).optional()
53995
54662
  });
53996
- var ConsentFlowDataQueryValidator = mod.object({
53997
- anonymize: mod.boolean().optional(),
53998
- credentials: mod.object({ categories: mod.record(mod.boolean()).optional() }).optional(),
53999
- personal: mod.record(mod.boolean()).optional()
54663
+ var ConsentFlowDataQueryValidator = z.object({
54664
+ anonymize: z.boolean().optional(),
54665
+ credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
54666
+ personal: z.record(z.boolean()).optional()
54000
54667
  });
54001
- var ConsentFlowDataForDidQueryValidator = mod.object({
54002
- credentials: mod.object({ categories: mod.record(mod.boolean()).optional() }).optional(),
54003
- personal: mod.record(mod.boolean()).optional(),
54668
+ var ConsentFlowDataForDidQueryValidator = z.object({
54669
+ credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
54670
+ personal: z.record(z.boolean()).optional(),
54004
54671
  id: StringQuery.optional()
54005
54672
  });
54006
- var ConsentFlowTermsQueryValidator = mod.object({
54007
- read: mod.object({
54008
- anonymize: mod.boolean().optional(),
54009
- credentials: mod.object({
54010
- shareAll: mod.boolean().optional(),
54011
- sharing: mod.boolean().optional(),
54012
- categories: mod.record(ConsentFlowTermValidator.optional()).optional()
54673
+ var ConsentFlowTermsQueryValidator = z.object({
54674
+ read: z.object({
54675
+ anonymize: z.boolean().optional(),
54676
+ credentials: z.object({
54677
+ shareAll: z.boolean().optional(),
54678
+ sharing: z.boolean().optional(),
54679
+ categories: z.record(ConsentFlowTermValidator.optional()).optional()
54013
54680
  }).optional(),
54014
- personal: mod.record(mod.string()).optional()
54681
+ personal: z.record(z.string()).optional()
54015
54682
  }).optional(),
54016
- write: mod.object({
54017
- credentials: mod.object({ categories: mod.record(mod.boolean()).optional() }).optional(),
54018
- personal: mod.record(mod.boolean()).optional()
54683
+ write: z.object({
54684
+ credentials: z.object({ categories: z.record(z.boolean()).optional() }).optional(),
54685
+ personal: z.record(z.boolean()).optional()
54019
54686
  }).optional()
54020
54687
  });
54021
- var ConsentFlowTransactionActionValidator = mod.enum([
54688
+ var ConsentFlowTransactionActionValidator = z.enum([
54022
54689
  "consent",
54023
54690
  "update",
54024
54691
  "sync",
54025
54692
  "withdraw",
54026
54693
  "write"
54027
54694
  ]);
54028
- var ConsentFlowTransactionsQueryValidator = mod.object({
54695
+ var ConsentFlowTransactionsQueryValidator = z.object({
54029
54696
  terms: ConsentFlowTermsQueryValidator.optional(),
54030
54697
  action: ConsentFlowTransactionActionValidator.or(
54031
54698
  ConsentFlowTransactionActionValidator.array()
54032
54699
  ).optional(),
54033
- date: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
54034
- expiresAt: mod.object({ $gt: mod.string() }).or(mod.object({ $lt: mod.string() })).or(mod.object({ $eq: mod.string() })).optional(),
54035
- oneTime: mod.boolean().optional()
54700
+ date: z.object({ $gt: z.string() }).or(z.object({ $lt: z.string() })).or(z.object({ $eq: z.string() })).optional(),
54701
+ expiresAt: z.object({ $gt: z.string() }).or(z.object({ $lt: z.string() })).or(z.object({ $eq: z.string() })).optional(),
54702
+ oneTime: z.boolean().optional()
54036
54703
  });
54037
- var ConsentFlowTransactionValidator = mod.object({
54038
- expiresAt: mod.string().optional(),
54039
- oneTime: mod.boolean().optional(),
54704
+ var ConsentFlowTransactionValidator = z.object({
54705
+ expiresAt: z.string().optional(),
54706
+ oneTime: z.boolean().optional(),
54040
54707
  terms: ConsentFlowTermsValidator.optional(),
54041
- id: mod.string(),
54708
+ id: z.string(),
54042
54709
  action: ConsentFlowTransactionActionValidator,
54043
- date: mod.string(),
54044
- uris: mod.string().array().optional()
54710
+ date: z.string(),
54711
+ uris: z.string().array().optional()
54045
54712
  });
54046
54713
  var PaginatedConsentFlowTransactionsValidator = PaginationResponseValidator.extend({
54047
54714
  records: ConsentFlowTransactionValidator.array()
54048
54715
  });
54049
- var ContractCredentialValidator = mod.object({
54050
- credentialUri: mod.string(),
54051
- termsUri: mod.string(),
54052
- contractUri: mod.string(),
54053
- boostUri: mod.string(),
54054
- category: mod.string().optional(),
54055
- date: mod.string()
54716
+ var ContractCredentialValidator = z.object({
54717
+ credentialUri: z.string(),
54718
+ termsUri: z.string(),
54719
+ contractUri: z.string(),
54720
+ boostUri: z.string(),
54721
+ category: z.string().optional(),
54722
+ date: z.string()
54056
54723
  });
54057
54724
  var PaginatedContractCredentialsValidator = PaginationResponseValidator.extend({
54058
54725
  records: ContractCredentialValidator.array()
54059
54726
  });
54060
- var LCNNotificationTypeEnumValidator = mod.enum([
54727
+ var LCNNotificationTypeEnumValidator = z.enum([
54061
54728
  "CONNECTION_REQUEST",
54062
54729
  "CONNECTION_ACCEPTED",
54063
54730
  "CREDENTIAL_RECEIVED",
@@ -54068,40 +54735,40 @@ var LCNNotificationTypeEnumValidator = mod.enum([
54068
54735
  "PRESENTATION_RECEIVED",
54069
54736
  "CONSENT_FLOW_TRANSACTION"
54070
54737
  ]);
54071
- var LCNNotificationMessageValidator = mod.object({
54072
- title: mod.string().optional(),
54073
- body: mod.string().optional()
54738
+ var LCNNotificationMessageValidator = z.object({
54739
+ title: z.string().optional(),
54740
+ body: z.string().optional()
54074
54741
  });
54075
- var LCNNotificationDataValidator = mod.object({
54076
- vcUris: mod.array(mod.string()).optional(),
54077
- vpUris: mod.array(mod.string()).optional(),
54742
+ var LCNNotificationDataValidator = z.object({
54743
+ vcUris: z.array(z.string()).optional(),
54744
+ vpUris: z.array(z.string()).optional(),
54078
54745
  transaction: ConsentFlowTransactionValidator.optional()
54079
54746
  });
54080
- var LCNNotificationValidator = mod.object({
54747
+ var LCNNotificationValidator = z.object({
54081
54748
  type: LCNNotificationTypeEnumValidator,
54082
- to: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
54083
- from: LCNProfileValidator.partial().and(mod.object({ did: mod.string() })),
54749
+ to: LCNProfileValidator.partial().and(z.object({ did: z.string() })),
54750
+ from: LCNProfileValidator.partial().and(z.object({ did: z.string() })),
54084
54751
  message: LCNNotificationMessageValidator.optional(),
54085
54752
  data: LCNNotificationDataValidator.optional(),
54086
- sent: mod.string().datetime().optional()
54753
+ sent: z.string().datetime().optional()
54087
54754
  });
54088
54755
  var AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX = "auth-grant:";
54089
- var AuthGrantValidator = mod.object({
54090
- id: mod.string(),
54091
- name: mod.string(),
54092
- description: mod.string().optional(),
54093
- challenge: mod.string().startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX).min(10, { message: "Challenge is too short" }).max(100, { message: "Challenge is too long" }),
54094
- status: mod.enum(["revoked", "active"], {
54756
+ var AuthGrantValidator = z.object({
54757
+ id: z.string(),
54758
+ name: z.string(),
54759
+ description: z.string().optional(),
54760
+ challenge: z.string().startsWith(AUTH_GRANT_AUDIENCE_DOMAIN_PREFIX).min(10, { message: "Challenge is too short" }).max(100, { message: "Challenge is too long" }),
54761
+ status: z.enum(["revoked", "active"], {
54095
54762
  required_error: "Status is required",
54096
54763
  invalid_type_error: "Status must be either active or revoked"
54097
54764
  }),
54098
- scope: mod.string(),
54099
- createdAt: mod.string().datetime({ message: "createdAt must be a valid ISO 8601 datetime string" }),
54100
- expiresAt: mod.string().datetime({ message: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
54765
+ scope: z.string(),
54766
+ createdAt: z.string().datetime({ message: "createdAt must be a valid ISO 8601 datetime string" }),
54767
+ expiresAt: z.string().datetime({ message: "expiresAt must be a valid ISO 8601 datetime string" }).nullish().optional()
54101
54768
  });
54102
- var FlatAuthGrantValidator = mod.object({ id: mod.string() }).catchall(mod.any());
54103
- var AuthGrantStatusValidator = mod.enum(["active", "revoked"]);
54104
- var AuthGrantQueryValidator = mod.object({
54769
+ var FlatAuthGrantValidator = z.object({ id: z.string() }).catchall(z.any());
54770
+ var AuthGrantStatusValidator = z.enum(["active", "revoked"]);
54771
+ var AuthGrantQueryValidator = z.object({
54105
54772
  id: StringQuery,
54106
54773
  name: StringQuery,
54107
54774
  description: StringQuery,
@@ -54112,7 +54779,7 @@ var AuthGrantQueryValidator = mod.object({
54112
54779
  var streamIdToCeramicURI = /* @__PURE__ */ __name((id) => `lc:ceramic:${id}`, "streamIdToCeramicURI");
54113
54780
 
54114
54781
  // src/types.ts
54115
- var CeramicURIValidator = mod.string().refine(
54782
+ var CeramicURIValidator = z.string().refine(
54116
54783
  (string2) => string2.split(":").length === 3 && string2.split(":")[0] === "lc",
54117
54784
  "URI must be of the form lc:${storage}:${url}"
54118
54785
  ).refine(