@tapcart/app-studio-sdk 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import Y, { createContext as H, useReducer as Oa, useEffect as We, useContext as U, useMemo as X, useId as Ia, useState as xt, useCallback as Jr } from "react";
1
+ import Y, { createContext as H, useReducer as Oa, useEffect as We, useContext as q, useMemo as X, useId as Ia, useState as xt, useCallback as Jr } from "react";
2
2
  const Na = (e) => e && Object.keys(e).length === 0 && e.constructor === Object;
3
3
  class Da {
4
4
  constructor(t) {
@@ -29,7 +29,7 @@ function La(e) {
29
29
  Number.isNaN(V) ? null : V
30
30
  );
31
31
  }
32
- ), { product: d, ...f } = n || {}, { variants: p, id: m, availableForSale: v, title: g, vendor: S, ...b } = d || {}, C = p == null ? void 0 : p.find((P) => P.id === (n == null ? void 0 : n.id)), { id: x, price: $, compareAtPrice: _, availableForSale: N, quantityAvailable: R, selectedOptions: G, title: L, image: F, ...K } = C || {}, z = $ != null && $.amount ? Number.parseFloat($.amount) : null, T = _ != null && _.amount ? Number.parseFloat(_.amount) : null, { totalAmount: w } = a || {}, Ae = w != null && w.amount ? Number.parseFloat(w.amount) : null, Bt = (w == null ? void 0 : w.currencyCode) || ($ == null ? void 0 : $.currencyCode) || null, Ta = ((Wt = (Kt = p == null ? void 0 : p[0]) == null ? void 0 : Kt.image) == null ? void 0 : Wt.url) || (F == null ? void 0 : F.url) || null, xa = (F == null ? void 0 : F.url) || null, Pa = (P) => {
32
+ ), { product: d, ...f } = n || {}, { variants: p, id: m, availableForSale: v, title: g, vendor: S, ...$ } = d || {}, C = p == null ? void 0 : p.find((P) => P.id === (n == null ? void 0 : n.id)), { id: x, price: b, compareAtPrice: _, availableForSale: N, quantityAvailable: R, selectedOptions: G, title: L, image: F, ...K } = C || {}, z = b != null && b.amount ? Number.parseFloat(b.amount) : null, T = _ != null && _.amount ? Number.parseFloat(_.amount) : null, { totalAmount: w } = a || {}, Ae = w != null && w.amount ? Number.parseFloat(w.amount) : null, Bt = (w == null ? void 0 : w.currencyCode) || (b == null ? void 0 : b.currencyCode) || null, Ta = ((Wt = (Kt = p == null ? void 0 : p[0]) == null ? void 0 : Kt.image) == null ? void 0 : Wt.url) || (F == null ? void 0 : F.url) || null, xa = (F == null ? void 0 : F.url) || null, Pa = (P) => {
33
33
  var V;
34
34
  const O = (V = d == null ? void 0 : d.sellingPlanGroups) == null ? void 0 : V.flatMap((J) => J.sellingPlans).find((J) => J.id === P);
35
35
  return (O == null ? void 0 : O.name) || null;
@@ -71,7 +71,7 @@ function La(e) {
71
71
  price: z,
72
72
  priceCurrencyCode: Bt,
73
73
  product: {
74
- ...b,
74
+ ...$,
75
75
  availableForSale: v || !1,
76
76
  featuredImage: (Yt = p == null ? void 0 : p[0]) != null && Yt.image ? {
77
77
  id: "",
@@ -239,7 +239,7 @@ let ie = {
239
239
  return r === null && (i += '\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'), i;
240
240
  },
241
241
  defined: "${path} must be defined"
242
- }, k = {
242
+ }, j = {
243
243
  length: "${path} must be exactly ${length} characters",
244
244
  min: "${path} must be at least ${min} characters",
245
245
  max: "${path} must be at most ${max} characters",
@@ -272,7 +272,7 @@ let ie = {
272
272
  };
273
273
  Object.assign(/* @__PURE__ */ Object.create(null), {
274
274
  mixed: ie,
275
- string: k,
275
+ string: j,
276
276
  number: Z,
277
277
  date: pt,
278
278
  object: mt,
@@ -314,12 +314,12 @@ var Fe = yi, gi = Pe, vi = Fe, _i = "[object Symbol]";
314
314
  function Si(e) {
315
315
  return typeof e == "symbol" || vi(e) && gi(e) == _i;
316
316
  }
317
- var Pt = Si, bi = ee, $i = Pt, Ai = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, wi = /^\w*$/;
317
+ var Pt = Si, $i = ee, bi = Pt, Ai = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, wi = /^\w*$/;
318
318
  function Ei(e, t) {
319
- if (bi(e))
319
+ if ($i(e))
320
320
  return !1;
321
321
  var r = typeof e;
322
- return r == "number" || r == "symbol" || r == "boolean" || e == null || $i(e) ? !0 : wi.test(e) || !Ai.test(e) || t != null && e in Object(t);
322
+ return r == "number" || r == "symbol" || r == "boolean" || e == null || bi(e) ? !0 : wi.test(e) || !Ai.test(e) || t != null && e in Object(t);
323
323
  }
324
324
  var Ft = Ei;
325
325
  function Ci(e) {
@@ -391,16 +391,16 @@ function ys(e) {
391
391
  return ms.call(t, e) ? t[e] : void 0;
392
392
  }
393
393
  var gs = ys, vs = Ze, _s = Object.prototype, Ss = _s.hasOwnProperty;
394
- function bs(e) {
394
+ function $s(e) {
395
395
  var t = this.__data__;
396
396
  return vs ? t[e] !== void 0 : Ss.call(t, e);
397
397
  }
398
- var $s = bs, As = Ze, ws = "__lodash_hash_undefined__";
398
+ var bs = $s, As = Ze, ws = "__lodash_hash_undefined__";
399
399
  function Es(e, t) {
400
400
  var r = this.__data__;
401
401
  return this.size += this.has(e) ? 0 : 1, r[e] = As && t === void 0 ? ws : t, this;
402
402
  }
403
- var Cs = Es, Ts = us, xs = ds, Ps = gs, Fs = $s, Os = Cs;
403
+ var Cs = Es, Ts = us, xs = ds, Ps = gs, Fs = bs, Os = Cs;
404
404
  function ye(e) {
405
405
  var t = -1, r = e == null ? 0 : e.length;
406
406
  for (this.clear(); ++t < r; ) {
@@ -490,11 +490,11 @@ var go = yo, vo = Qe;
490
490
  function _o(e) {
491
491
  return vo(this, e).get(e);
492
492
  }
493
- var So = _o, bo = Qe;
494
- function $o(e) {
495
- return bo(this, e).has(e);
493
+ var So = _o, $o = Qe;
494
+ function bo(e) {
495
+ return $o(this, e).has(e);
496
496
  }
497
- var Ao = $o, wo = Qe;
497
+ var Ao = bo, wo = Qe;
498
498
  function Eo(e, t) {
499
499
  var r = wo(this, e), n = r.size;
500
500
  return r.set(e, t), this.size += r.size == n ? 0 : 1, this;
@@ -587,7 +587,7 @@ function _c(e) {
587
587
  var t = e + "";
588
588
  return t == "0" && 1 / e == -vc ? "-0" : t;
589
589
  }
590
- var He = _c, Sc = sn, bc = cn, $c = ee, Ac = un, wc = Rt, Ec = He;
590
+ var He = _c, Sc = sn, $c = cn, bc = ee, Ac = un, wc = Rt, Ec = He;
591
591
  function Cc(e, t, r) {
592
592
  t = Sc(t, e);
593
593
  for (var n = -1, a = t.length, i = !1; ++n < a; ) {
@@ -596,7 +596,7 @@ function Cc(e, t, r) {
596
596
  break;
597
597
  e = e[s];
598
598
  }
599
- return i || ++n != a ? i : (a = e == null ? 0 : e.length, !!a && wc(a) && Ac(s, a) && ($c(e) || bc(e)));
599
+ return i || ++n != a ? i : (a = e == null ? 0 : e.length, !!a && wc(a) && Ac(s, a) && (bc(e) || $c(e)));
600
600
  }
601
601
  var ln = Cc, Tc = Za, xc = ln;
602
602
  function Pc(e, t) {
@@ -751,13 +751,13 @@ A[Yc] = A[Xc] = A[uu] = A[Qc] = A[lu] = A[Hc] = A[eu] = A[tu] = A[ru] = A[nu] =
751
751
  function Su(e) {
752
752
  return Zc(e) && Jc(e.length) && !!A[Wc(e)];
753
753
  }
754
- var bu = Su;
755
- function $u(e) {
754
+ var $u = Su;
755
+ function bu(e) {
756
756
  return function(t) {
757
757
  return e(t);
758
758
  };
759
759
  }
760
- var Au = $u, Ge = { exports: {} };
760
+ var Au = bu, Ge = { exports: {} };
761
761
  Ge.exports;
762
762
  (function(e, t) {
763
763
  var r = Qr, n = t && !t.nodeType && t, a = n && !0 && e && !e.nodeType && e, i = a && a.exports === n, s = i && r.process, o = function() {
@@ -769,7 +769,7 @@ Ge.exports;
769
769
  }();
770
770
  e.exports = o;
771
771
  })(Ge, Ge.exports);
772
- var wu = Ge.exports, Eu = bu, Cu = Au, ur = wu, lr = ur && ur.isTypedArray, Tu = lr ? Cu(lr) : Eu, hn = Tu, xu = Vc, Pu = cn, Fu = ee, Ou = pn, Iu = un, Nu = hn, Du = Object.prototype, Ru = Du.hasOwnProperty;
772
+ var wu = Ge.exports, Eu = $u, Cu = Au, ur = wu, lr = ur && ur.isTypedArray, Tu = lr ? Cu(lr) : Eu, hn = Tu, xu = Vc, Pu = cn, Fu = ee, Ou = pn, Iu = un, Nu = hn, Du = Object.prototype, Ru = Du.hasOwnProperty;
773
773
  function Lu(e, t) {
774
774
  var r = Fu(e), n = !r && Pu(e), a = !r && !n && Ou(e), i = !r && !n && !a && Nu(e), s = r || n || a || i, o = s ? xu(e.length, String) : [], c = o.length;
775
775
  for (var u in e)
@@ -829,18 +829,18 @@ var ml = hl;
829
829
  function yl(e) {
830
830
  return this.__data__.has(e);
831
831
  }
832
- var gl = yl, vl = Xe, _l = It, Sl = Nt, bl = 200;
833
- function $l(e, t) {
832
+ var gl = yl, vl = Xe, _l = It, Sl = Nt, $l = 200;
833
+ function bl(e, t) {
834
834
  var r = this.__data__;
835
835
  if (r instanceof vl) {
836
836
  var n = r.__data__;
837
- if (!_l || n.length < bl - 1)
837
+ if (!_l || n.length < $l - 1)
838
838
  return n.push([e, t]), this.size = ++r.size, this;
839
839
  r = this.__data__ = new Sl(n);
840
840
  }
841
841
  return r.set(e, t), this.size = r.size, this;
842
842
  }
843
- var Al = $l, wl = Xe, El = dl, Cl = pl, Tl = ml, xl = gl, Pl = Al;
843
+ var Al = bl, wl = Xe, El = dl, Cl = pl, Tl = ml, xl = gl, Pl = Al;
844
844
  function _e(e) {
845
845
  var t = this.__data__ = new wl(e);
846
846
  this.size = t.size;
@@ -897,9 +897,9 @@ function Jl(e, t, r, n, a, i) {
897
897
  break;
898
898
  }
899
899
  if (p) {
900
- if (!Vl(t, function(S, b) {
901
- if (!Bl(p, b) && (m === S || a(m, S, r, n, i)))
902
- return p.push(b);
900
+ if (!Vl(t, function(S, $) {
901
+ if (!Bl(p, $) && (m === S || a(m, S, r, n, i)))
902
+ return p.push($);
903
903
  })) {
904
904
  f = !1;
905
905
  break;
@@ -962,12 +962,12 @@ function _d(e, t, r, n, a, i, s) {
962
962
  return !1;
963
963
  }
964
964
  var Sd = _d;
965
- function bd(e, t) {
965
+ function $d(e, t) {
966
966
  for (var r = -1, n = t.length, a = e.length; ++r < n; )
967
967
  e[a + r] = t[r];
968
968
  return e;
969
969
  }
970
- var $d = bd, Ad = $d, wd = ee;
970
+ var bd = $d, Ad = bd, wd = ee;
971
971
  function Ed(e, t, r) {
972
972
  var n = t(e);
973
973
  return wd(e) ? n : Ad(n, r(e));
@@ -1009,23 +1009,23 @@ function Bd(e, t, r, n, a, i) {
1009
1009
  i.set(e, t), i.set(t, e);
1010
1010
  for (var g = s; ++d < c; ) {
1011
1011
  f = o[d];
1012
- var S = e[f], b = t[f];
1012
+ var S = e[f], $ = t[f];
1013
1013
  if (n)
1014
- var C = s ? n(b, S, f, t, e, i) : n(S, b, f, e, t, i);
1015
- if (!(C === void 0 ? S === b || a(S, b, r, n, i) : C)) {
1014
+ var C = s ? n($, S, f, t, e, i) : n(S, $, f, e, t, i);
1015
+ if (!(C === void 0 ? S === $ || a(S, $, r, n, i) : C)) {
1016
1016
  v = !1;
1017
1017
  break;
1018
1018
  }
1019
1019
  g || (g = f == "constructor");
1020
1020
  }
1021
1021
  if (v && !g) {
1022
- var x = e.constructor, $ = t.constructor;
1023
- x != $ && "constructor" in e && "constructor" in t && !(typeof x == "function" && x instanceof x && typeof $ == "function" && $ instanceof $) && (v = !1);
1022
+ var x = e.constructor, b = t.constructor;
1023
+ x != b && "constructor" in e && "constructor" in t && !(typeof x == "function" && x instanceof x && typeof b == "function" && b instanceof b) && (v = !1);
1024
1024
  }
1025
1025
  return i.delete(e), i.delete(t), v;
1026
1026
  }
1027
- var Kd = Bd, Wd = ce, Jd = W, Zd = Wd(Jd, "DataView"), Yd = Zd, Xd = ce, Qd = W, Hd = Xd(Qd, "Promise"), ef = Hd, tf = ce, rf = W, nf = tf(rf, "Set"), af = nf, sf = ce, of = W, cf = sf(of, "WeakMap"), uf = cf, gt = Yd, vt = It, _t = ef, St = af, bt = uf, vn = Pe, Se = tn, yr = "[object Map]", lf = "[object Object]", gr = "[object Promise]", vr = "[object Set]", _r = "[object WeakMap]", Sr = "[object DataView]", df = Se(gt), ff = Se(vt), pf = Se(_t), hf = Se(St), mf = Se(bt), se = vn;
1028
- (gt && se(new gt(new ArrayBuffer(1))) != Sr || vt && se(new vt()) != yr || _t && se(_t.resolve()) != gr || St && se(new St()) != vr || bt && se(new bt()) != _r) && (se = function(e) {
1027
+ var Kd = Bd, Wd = ce, Jd = W, Zd = Wd(Jd, "DataView"), Yd = Zd, Xd = ce, Qd = W, Hd = Xd(Qd, "Promise"), ef = Hd, tf = ce, rf = W, nf = tf(rf, "Set"), af = nf, sf = ce, of = W, cf = sf(of, "WeakMap"), uf = cf, gt = Yd, vt = It, _t = ef, St = af, $t = uf, vn = Pe, Se = tn, yr = "[object Map]", lf = "[object Object]", gr = "[object Promise]", vr = "[object Set]", _r = "[object WeakMap]", Sr = "[object DataView]", df = Se(gt), ff = Se(vt), pf = Se(_t), hf = Se(St), mf = Se($t), se = vn;
1028
+ (gt && se(new gt(new ArrayBuffer(1))) != Sr || vt && se(new vt()) != yr || _t && se(_t.resolve()) != gr || St && se(new St()) != vr || $t && se(new $t()) != _r) && (se = function(e) {
1029
1029
  var t = vn(e), r = t == lf ? e.constructor : void 0, n = r ? Se(r) : "";
1030
1030
  if (n)
1031
1031
  switch (n) {
@@ -1042,9 +1042,9 @@ var Kd = Bd, Wd = ce, Jd = W, Zd = Wd(Jd, "DataView"), Yd = Zd, Xd = ce, Qd = W,
1042
1042
  }
1043
1043
  return t;
1044
1044
  });
1045
- var yf = se, it = yn, gf = gn, vf = Sd, _f = Kd, br = yf, $r = ee, Ar = pn, Sf = hn, bf = 1, wr = "[object Arguments]", Er = "[object Array]", Ne = "[object Object]", $f = Object.prototype, Cr = $f.hasOwnProperty;
1045
+ var yf = se, it = yn, gf = gn, vf = Sd, _f = Kd, $r = yf, br = ee, Ar = pn, Sf = hn, $f = 1, wr = "[object Arguments]", Er = "[object Array]", Ne = "[object Object]", bf = Object.prototype, Cr = bf.hasOwnProperty;
1046
1046
  function Af(e, t, r, n, a, i) {
1047
- var s = $r(e), o = $r(t), c = s ? Er : br(e), u = o ? Er : br(t);
1047
+ var s = br(e), o = br(t), c = s ? Er : $r(e), u = o ? Er : $r(t);
1048
1048
  c = c == wr ? Ne : c, u = u == wr ? Ne : u;
1049
1049
  var l = c == Ne, d = u == Ne, f = c == u;
1050
1050
  if (f && Ar(e)) {
@@ -1054,7 +1054,7 @@ function Af(e, t, r, n, a, i) {
1054
1054
  }
1055
1055
  if (f && !l)
1056
1056
  return i || (i = new it()), s || Sf(e) ? gf(e, t, r, n, a, i) : vf(e, t, c, r, n, a, i);
1057
- if (!(r & bf)) {
1057
+ if (!(r & $f)) {
1058
1058
  var p = l && Cr.call(e, "__wrapped__"), m = d && Cr.call(t, "__wrapped__");
1059
1059
  if (p || m) {
1060
1060
  var v = p ? e.value() : e, g = m ? t.value() : t;
@@ -1097,7 +1097,7 @@ var Of = Ff, If = Ot;
1097
1097
  function Nf(e) {
1098
1098
  return e === e && !If(e);
1099
1099
  }
1100
- var bn = Nf, Df = bn, Rf = Mt;
1100
+ var $n = Nf, Df = $n, Rf = Mt;
1101
1101
  function Lf(e) {
1102
1102
  for (var t = Rf(e), r = t.length; r--; ) {
1103
1103
  var n = t[r], a = e[n];
@@ -1111,7 +1111,7 @@ function qf(e, t) {
1111
1111
  return r == null ? !1 : r[e] === t && (t !== void 0 || e in Object(r));
1112
1112
  };
1113
1113
  }
1114
- var $n = qf, Uf = Of, jf = Mf, kf = $n;
1114
+ var bn = qf, Uf = Of, jf = Mf, kf = bn;
1115
1115
  function Gf(e) {
1116
1116
  var t = jf(e);
1117
1117
  return t.length == 1 && t[0][2] ? kf(t[0][0], t[0][1]) : function(r) {
@@ -1138,7 +1138,7 @@ var Xf = Yf, Qf = Xf, Hf = ln;
1138
1138
  function ep(e, t) {
1139
1139
  return e != null && Hf(e, t, Qf);
1140
1140
  }
1141
- var tp = ep, rp = Sn, np = Zf, ap = tp, ip = Ft, sp = bn, op = $n, cp = He, up = 1, lp = 2;
1141
+ var tp = ep, rp = Sn, np = Zf, ap = tp, ip = Ft, sp = $n, op = bn, cp = He, up = 1, lp = 2;
1142
1142
  function dp(e, t) {
1143
1143
  return ip(e) && sp(t) ? op(cp(e), t) : function(r) {
1144
1144
  var n = np(r, e);
@@ -1161,9 +1161,9 @@ function vp(e) {
1161
1161
  return gp(t, e);
1162
1162
  };
1163
1163
  }
1164
- var _p = vp, Sp = yp, bp = _p, $p = Ft, Ap = He;
1164
+ var _p = vp, Sp = yp, $p = _p, bp = Ft, Ap = He;
1165
1165
  function wp(e) {
1166
- return $p(e) ? Sp(Ap(e)) : bp(e);
1166
+ return bp(e) ? Sp(Ap(e)) : $p(e);
1167
1167
  }
1168
1168
  var Ep = wp, Cp = zf, Tp = fp, xp = hp, Pp = ee, Fp = Ep;
1169
1169
  function Op(e) {
@@ -1192,7 +1192,7 @@ ue.prototype.set = function(e, t) {
1192
1192
  };
1193
1193
  var Mp = /[^.^\]^[]+|(?=\[\]|\.\.)/g, Cn = /^\d+$/, qp = /^\d/, Up = /[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g, jp = /^\s*(['"]?)(.*?)(\1)\s*$/, qt = 512, xr = new ue(qt), Pr = new ue(qt), Fr = new ue(qt), et = {
1194
1194
  Cache: ue,
1195
- split: $t,
1195
+ split: bt,
1196
1196
  normalizePath: st,
1197
1197
  setter: function(e) {
1198
1198
  var t = st(e);
@@ -1223,18 +1223,18 @@ var Mp = /[^.^\]^[]+|(?=\[\]|\.\.)/g, Cn = /^\d+$/, qp = /^\d/, Up = /[~`!#$%\^&
1223
1223
  }, "");
1224
1224
  },
1225
1225
  forEach: function(e, t, r) {
1226
- kp(Array.isArray(e) ? e : $t(e), t, r);
1226
+ kp(Array.isArray(e) ? e : bt(e), t, r);
1227
1227
  }
1228
1228
  };
1229
1229
  function st(e) {
1230
1230
  return xr.get(e) || xr.set(
1231
1231
  e,
1232
- $t(e).map(function(t) {
1232
+ bt(e).map(function(t) {
1233
1233
  return t.replace(jp, "$2");
1234
1234
  })
1235
1235
  );
1236
1236
  }
1237
- function $t(e) {
1237
+ function bt(e) {
1238
1238
  return e.match(Mp) || [""];
1239
1239
  }
1240
1240
  function kp(e, t, r) {
@@ -1340,7 +1340,7 @@ function Re(e) {
1340
1340
  function S(_) {
1341
1341
  return Q.isRef(_) ? _.getValue(a, v, g) : _;
1342
1342
  }
1343
- function b(_ = {}) {
1343
+ function $(_ = {}) {
1344
1344
  const N = En(Ve({
1345
1345
  value: a,
1346
1346
  originalValue: c,
@@ -1353,7 +1353,7 @@ function Re(e) {
1353
1353
  path: i,
1354
1354
  parent: v,
1355
1355
  type: d,
1356
- createError: b,
1356
+ createError: $,
1357
1357
  resolve: S,
1358
1358
  options: o,
1359
1359
  originalValue: c
@@ -1361,7 +1361,7 @@ function Re(e) {
1361
1361
  if (!u) {
1362
1362
  try {
1363
1363
  Promise.resolve(f.call(C, a, C)).then((_) => {
1364
- D.isError(_) ? n(_) : _ ? n(null, _) : n(b());
1364
+ D.isError(_) ? n(_) : _ ? n(null, _) : n($());
1365
1365
  }).catch(n);
1366
1366
  } catch (_) {
1367
1367
  n(_);
@@ -1370,14 +1370,14 @@ function Re(e) {
1370
1370
  }
1371
1371
  let x;
1372
1372
  try {
1373
- var $;
1374
- if (x = f.call(C, a, C), typeof (($ = x) == null ? void 0 : $.then) == "function")
1373
+ var b;
1374
+ if (x = f.call(C, a, C), typeof ((b = x) == null ? void 0 : b.then) == "function")
1375
1375
  throw new Error(`Validation test of type: "${C.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
1376
1376
  } catch (_) {
1377
1377
  n(_);
1378
1378
  return;
1379
1379
  }
1380
- D.isError(x) ? n(x) : x ? n(null, x) : n(b());
1380
+ D.isError(x) ? n(x) : x ? n(null, x) : n($());
1381
1381
  }
1382
1382
  return t.OPTIONS = e, t;
1383
1383
  }
@@ -1448,21 +1448,21 @@ class Be {
1448
1448
  return t.list.forEach((a) => n.add(a)), t.refs.forEach((a) => n.add(a)), r.list.forEach((a) => n.delete(a)), r.refs.forEach((a) => n.delete(a)), n;
1449
1449
  }
1450
1450
  }
1451
- function q() {
1452
- return q = Object.assign || function(e) {
1451
+ function M() {
1452
+ return M = Object.assign || function(e) {
1453
1453
  for (var t = 1; t < arguments.length; t++) {
1454
1454
  var r = arguments[t];
1455
1455
  for (var n in r)
1456
1456
  Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
1457
1457
  }
1458
1458
  return e;
1459
- }, q.apply(this, arguments);
1459
+ }, M.apply(this, arguments);
1460
1460
  }
1461
1461
  class I {
1462
1462
  constructor(t) {
1463
1463
  this.deps = [], this.tests = void 0, this.transforms = void 0, this.conditions = [], this._mutate = void 0, this._typeError = void 0, this._whitelist = new Be(), this._blacklist = new Be(), this.exclusiveTests = /* @__PURE__ */ Object.create(null), this.spec = void 0, this.tests = [], this.transforms = [], this.withMutation(() => {
1464
1464
  this.typeError(ie.notType);
1465
- }), this.type = (t == null ? void 0 : t.type) || "mixed", this.spec = q({
1465
+ }), this.type = (t == null ? void 0 : t.type) || "mixed", this.spec = M({
1466
1466
  strip: !1,
1467
1467
  strict: !1,
1468
1468
  abortEarly: !0,
@@ -1482,7 +1482,7 @@ class I {
1482
1482
  if (this._mutate)
1483
1483
  return t && Object.assign(this.spec, t), this;
1484
1484
  const r = Object.create(Object.getPrototypeOf(this));
1485
- return r.type = this.type, r._typeError = this._typeError, r._whitelistError = this._whitelistError, r._blacklistError = this._blacklistError, r._whitelist = this._whitelist.clone(), r._blacklist = this._blacklist.clone(), r.exclusiveTests = q({}, this.exclusiveTests), r.deps = [...this.deps], r.conditions = [...this.conditions], r.tests = [...this.tests], r.transforms = [...this.transforms], r.spec = ft(q({}, this.spec, t)), r;
1485
+ return r.type = this.type, r._typeError = this._typeError, r._whitelistError = this._whitelistError, r._blacklistError = this._blacklistError, r._whitelist = this._whitelist.clone(), r._blacklist = this._blacklist.clone(), r.exclusiveTests = M({}, this.exclusiveTests), r.deps = [...this.deps], r.conditions = [...this.conditions], r.tests = [...this.tests], r.transforms = [...this.transforms], r.spec = ft(M({}, this.spec, t)), r;
1486
1486
  }
1487
1487
  label(t) {
1488
1488
  let r = this.clone();
@@ -1513,7 +1513,7 @@ class I {
1513
1513
  if (t.type !== this.type && this.type !== "mixed")
1514
1514
  throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);
1515
1515
  let r = this, n = t.clone();
1516
- const a = q({}, r.spec, n.spec);
1516
+ const a = M({}, r.spec, n.spec);
1517
1517
  return n.spec = a, n._typeError || (n._typeError = r._typeError), n._whitelistError || (n._whitelistError = r._whitelistError), n._blacklistError || (n._blacklistError = r._blacklistError), n._whitelist = r._whitelist.merge(t._whitelist, t._blacklist), n._blacklist = r._blacklist.merge(t._blacklist, t._whitelist), n.tests = r.tests, n.exclusiveTests = r.exclusiveTests, n.withMutation((i) => {
1518
1518
  t.tests.forEach((s) => {
1519
1519
  i.test(s.OPTIONS);
@@ -1539,7 +1539,7 @@ class I {
1539
1539
  * @param {*=} options.context
1540
1540
  */
1541
1541
  cast(t, r = {}) {
1542
- let n = this.resolve(q({
1542
+ let n = this.resolve(M({
1543
1543
  value: t
1544
1544
  }, r)), a = n._cast(t, r);
1545
1545
  if (t !== void 0 && r.assert !== !1 && n.isType(a) !== !0) {
@@ -1564,7 +1564,7 @@ attempted value: ${i}
1564
1564
  strict: c = this.spec.strict,
1565
1565
  abortEarly: u = this.spec.abortEarly
1566
1566
  } = r, l = t;
1567
- c || (l = this._cast(l, q({
1567
+ c || (l = this._cast(l, M({
1568
1568
  assert: !1
1569
1569
  }, r)));
1570
1570
  let d = {
@@ -1600,7 +1600,7 @@ attempted value: ${i}
1600
1600
  });
1601
1601
  }
1602
1602
  validate(t, r, n) {
1603
- let a = this.resolve(q({}, r, {
1603
+ let a = this.resolve(M({}, r, {
1604
1604
  value: t
1605
1605
  }));
1606
1606
  return typeof n == "function" ? a._validate(t, r, n) : new Promise((i, s) => a._validate(t, r, (o, c) => {
@@ -1608,10 +1608,10 @@ attempted value: ${i}
1608
1608
  }));
1609
1609
  }
1610
1610
  validateSync(t, r) {
1611
- let n = this.resolve(q({}, r, {
1611
+ let n = this.resolve(M({}, r, {
1612
1612
  value: t
1613
1613
  })), a;
1614
- return n._validate(t, q({}, r, {
1614
+ return n._validate(t, M({}, r, {
1615
1615
  sync: !0
1616
1616
  }), (i, s) => {
1617
1617
  if (i)
@@ -1811,7 +1811,7 @@ for (const e of ["validate", "validateSync"])
1811
1811
  parentPath: i,
1812
1812
  schema: s
1813
1813
  } = Wp(this, t, r, n.context);
1814
- return s[e](a && a[i], q({}, n, {
1814
+ return s[e](a && a[i], M({}, n, {
1815
1815
  parent: a,
1816
1816
  path: t
1817
1817
  }));
@@ -1822,12 +1822,12 @@ for (const e of ["not", "nope"])
1822
1822
  I.prototype[e] = I.prototype.notOneOf;
1823
1823
  I.prototype.optional = I.prototype.notRequired;
1824
1824
  const Tn = I;
1825
- function be() {
1825
+ function $e() {
1826
1826
  return new Tn();
1827
1827
  }
1828
- be.prototype = Tn.prototype;
1828
+ $e.prototype = Tn.prototype;
1829
1829
  const E = (e) => e == null;
1830
- function $e() {
1830
+ function be() {
1831
1831
  return new xn();
1832
1832
  }
1833
1833
  class xn extends I {
@@ -1876,7 +1876,7 @@ class xn extends I {
1876
1876
  });
1877
1877
  }
1878
1878
  }
1879
- $e.prototype = xn.prototype;
1879
+ be.prototype = xn.prototype;
1880
1880
  let Jp = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i, Zp = /^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i, Yp = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i, Xp = (e) => E(e) || e === e.trim(), Qp = {}.toString();
1881
1881
  function h() {
1882
1882
  return new Pn();
@@ -1900,7 +1900,7 @@ class Pn extends I {
1900
1900
  _isPresent(t) {
1901
1901
  return super._isPresent(t) && !!t.length;
1902
1902
  }
1903
- length(t, r = k.length) {
1903
+ length(t, r = j.length) {
1904
1904
  return this.test({
1905
1905
  message: r,
1906
1906
  name: "length",
@@ -1913,7 +1913,7 @@ class Pn extends I {
1913
1913
  }
1914
1914
  });
1915
1915
  }
1916
- min(t, r = k.min) {
1916
+ min(t, r = j.min) {
1917
1917
  return this.test({
1918
1918
  message: r,
1919
1919
  name: "min",
@@ -1926,7 +1926,7 @@ class Pn extends I {
1926
1926
  }
1927
1927
  });
1928
1928
  }
1929
- max(t, r = k.max) {
1929
+ max(t, r = j.max) {
1930
1930
  return this.test({
1931
1931
  name: "max",
1932
1932
  exclusive: !0,
@@ -1947,28 +1947,28 @@ class Pn extends I {
1947
1947
  name: i
1948
1948
  } = r : a = r), this.test({
1949
1949
  name: i || "matches",
1950
- message: a || k.matches,
1950
+ message: a || j.matches,
1951
1951
  params: {
1952
1952
  regex: t
1953
1953
  },
1954
1954
  test: (s) => E(s) || s === "" && n || s.search(t) !== -1
1955
1955
  });
1956
1956
  }
1957
- email(t = k.email) {
1957
+ email(t = j.email) {
1958
1958
  return this.matches(Jp, {
1959
1959
  name: "email",
1960
1960
  message: t,
1961
1961
  excludeEmptyString: !0
1962
1962
  });
1963
1963
  }
1964
- url(t = k.url) {
1964
+ url(t = j.url) {
1965
1965
  return this.matches(Zp, {
1966
1966
  name: "url",
1967
1967
  message: t,
1968
1968
  excludeEmptyString: !0
1969
1969
  });
1970
1970
  }
1971
- uuid(t = k.uuid) {
1971
+ uuid(t = j.uuid) {
1972
1972
  return this.matches(Yp, {
1973
1973
  name: "uuid",
1974
1974
  message: t,
@@ -1979,14 +1979,14 @@ class Pn extends I {
1979
1979
  ensure() {
1980
1980
  return this.default("").transform((t) => t === null ? "" : t);
1981
1981
  }
1982
- trim(t = k.trim) {
1982
+ trim(t = j.trim) {
1983
1983
  return this.transform((r) => r != null ? r.trim() : r).test({
1984
1984
  message: t,
1985
1985
  name: "trim",
1986
1986
  test: Xp
1987
1987
  });
1988
1988
  }
1989
- lowercase(t = k.lowercase) {
1989
+ lowercase(t = j.lowercase) {
1990
1990
  return this.transform((r) => E(r) ? r : r.toLowerCase()).test({
1991
1991
  message: t,
1992
1992
  name: "string_case",
@@ -1994,7 +1994,7 @@ class Pn extends I {
1994
1994
  test: (r) => E(r) || r === r.toLowerCase()
1995
1995
  });
1996
1996
  }
1997
- uppercase(t = k.uppercase) {
1997
+ uppercase(t = j.uppercase) {
1998
1998
  return this.transform((r) => E(r) ? r : r.toUpperCase()).test({
1999
1999
  message: t,
2000
2000
  name: "string_case",
@@ -2383,9 +2383,9 @@ var sh = ih, oh = sh, ch = {
2383
2383
  function Sh(e) {
2384
2384
  return e = fh(e), e && e.replace(ph, dh).replace(_h, "");
2385
2385
  }
2386
- var bh = Sh, $h = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
2386
+ var $h = Sh, bh = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
2387
2387
  function Ah(e) {
2388
- return e.match($h) || [];
2388
+ return e.match(bh) || [];
2389
2389
  }
2390
2390
  var wh = Ah, Eh = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
2391
2391
  function Ch(e) {
@@ -2408,7 +2408,7 @@ var Xh = Yh, Qh = wh, Hh = Th, em = Oe, tm = Xh;
2408
2408
  function rm(e, t, r) {
2409
2409
  return e = em(e), t = r ? void 0 : t, t === void 0 ? Hh(e) ? tm(e) : Qh(e) : e.match(t) || [];
2410
2410
  }
2411
- var nm = rm, am = ah, im = bh, sm = nm, om = "['’]", cm = RegExp(om, "g");
2411
+ var nm = rm, am = ah, im = $h, sm = nm, om = "['’]", cm = RegExp(om, "g");
2412
2412
  function um(e) {
2413
2413
  return function(t) {
2414
2414
  return am(sm(im(t).replace(cm, "")), e, "");
@@ -2430,7 +2430,7 @@ function ym(e, t, r) {
2430
2430
  var n = e.length;
2431
2431
  return r = r === void 0 ? n : r, !t && r >= n ? e : mm(e, t, r);
2432
2432
  }
2433
- var gm = ym, vm = "\\ud800-\\udfff", _m = "\\u0300-\\u036f", Sm = "\\ufe20-\\ufe2f", bm = "\\u20d0-\\u20ff", $m = _m + Sm + bm, Am = "\\ufe0e\\ufe0f", wm = "\\u200d", Em = RegExp("[" + wm + vm + $m + Am + "]");
2433
+ var gm = ym, vm = "\\ud800-\\udfff", _m = "\\u0300-\\u036f", Sm = "\\ufe20-\\ufe2f", $m = "\\u20d0-\\u20ff", bm = _m + Sm + $m, Am = "\\ufe0e\\ufe0f", wm = "\\u200d", Em = RegExp("[" + wm + vm + bm + Am + "]");
2434
2434
  function Cm(e) {
2435
2435
  return Em.test(e);
2436
2436
  }
@@ -2530,8 +2530,8 @@ function Sy(e) {
2530
2530
  t.set(e[r], r);
2531
2531
  return t;
2532
2532
  }
2533
- var by = jt.exports;
2534
- const $y = /* @__PURE__ */ me(by);
2533
+ var $y = jt.exports;
2534
+ const by = /* @__PURE__ */ me($y);
2535
2535
  function Ay(e, t = []) {
2536
2536
  let r = [], n = /* @__PURE__ */ new Set(), a = new Set(t.map(([s, o]) => `${s}-${o}`));
2537
2537
  function i(s, o) {
@@ -2543,7 +2543,7 @@ function Ay(e, t = []) {
2543
2543
  let o = e[s];
2544
2544
  n.add(s), Q.isRef(o) && o.isSibling ? i(o.path, s) : Lt(o) && "deps" in o && o.deps.forEach((c) => i(c, s));
2545
2545
  }
2546
- return $y.array(Array.from(n), r).reverse();
2546
+ return by.array(Array.from(n), r).reverse();
2547
2547
  }
2548
2548
  function Lr(e, t) {
2549
2549
  let r = 1 / 0;
@@ -2835,14 +2835,14 @@ class na extends I {
2835
2835
  f = f || m;
2836
2836
  let v = new Array(m.length);
2837
2837
  for (let g = 0; g < m.length; g++) {
2838
- let S = m[g], b = `${r.path || ""}[${g}]`, C = Ke({}, r, {
2839
- path: b,
2838
+ let S = m[g], $ = `${r.path || ""}[${g}]`, C = Ke({}, r, {
2839
+ path: $,
2840
2840
  strict: !0,
2841
2841
  parent: m,
2842
2842
  index: g,
2843
2843
  originalValue: f[g]
2844
2844
  });
2845
- v[g] = (x, $) => u.validate(S, C, $);
2845
+ v[g] = (x, b) => u.validate(S, C, b);
2846
2846
  }
2847
2847
  je({
2848
2848
  sync: o,
@@ -2986,20 +2986,20 @@ const qr = B().of(
2986
2986
  productId: h().required(),
2987
2987
  variantId: h().required(),
2988
2988
  wishlistId: h().required()
2989
- }), jy = $e().required().isTrue(), ky = y().shape({
2989
+ }), jy = be().required().isTrue(), ky = y().shape({
2990
2990
  productId: h().required(),
2991
2991
  variantId: h().required(),
2992
2992
  wishlistId: h().required()
2993
- }), Gy = $e().required().isTrue(), zy = y().shape({
2993
+ }), Gy = be().required().isTrue(), zy = y().shape({
2994
2994
  action: h().oneOf(["login", "create"], 'action must be either "login" or "create".').notRequired()
2995
- }).notRequired(), Vy = $e().required().isTrue(), By = y().shape({
2995
+ }).notRequired(), Vy = be().required().isTrue(), By = y().shape({
2996
2996
  appId: h().optional()
2997
- }).nullable(), Ky = B().of(be()).nullable(), Wy = y().shape({
2997
+ }).nullable(), Ky = B().of($e()).nullable(), Wy = y().shape({
2998
2998
  appId: h().optional()
2999
- }).nullable(), Jy = B().of(be()).nullable(), Zy = y().shape({
2999
+ }).nullable(), Jy = B().of($e()).nullable(), Zy = y().shape({
3000
3000
  appId: h().optional(),
3001
3001
  email: h().optional()
3002
- }).nullable(), Yy = be().nullable(), Xy = y({
3002
+ }).nullable(), Yy = $e().nullable(), Xy = y({
3003
3003
  appId: h().optional(),
3004
3004
  rewardId: h().required(),
3005
3005
  options: y().shape({}).optional()
@@ -3010,9 +3010,9 @@ const qr = B().of(
3010
3010
  activityUrl: h().optional()
3011
3011
  }).nullable(), Hy = y().shape({}), eg = y().shape({}).nullable(), tg = y().shape({
3012
3012
  appId: h().optional()
3013
- }).nullable(), rg = B().of(be()).nullable(), ng = y().shape({
3013
+ }).nullable(), rg = B().of($e()).nullable(), ng = y().shape({
3014
3014
  appId: h().optional()
3015
- }).nullable(), ag = be().nullable(), ig = y().shape({
3015
+ }).nullable(), ag = $e().nullable(), ig = y().shape({
3016
3016
  appId: h().optional(),
3017
3017
  version: h().required()
3018
3018
  }).nullable(), sg = y().shape({}).nullable(), Et = (e) => typeof e == "function" ? !1 : typeof e == "object" && e !== null ? !Object.values(e).some((t) => !Et(t)) : !0, og = (e) => {
@@ -3026,7 +3026,7 @@ const qr = B().of(
3026
3026
  }, cg = y().shape({
3027
3027
  analyticEvent: h().required(),
3028
3028
  analyticProperties: y().test("is-json", "Field must be a valid JSON object or array", og).required()
3029
- }), ug = $e().required().isTrue();
3029
+ }), ug = be().required().isTrue();
3030
3030
  y().shape({
3031
3031
  firstName: h().required(),
3032
3032
  lastName: h().required(),
@@ -3145,7 +3145,7 @@ const lg = y().shape({
3145
3145
  schema: y().shape({
3146
3146
  productId: h().required(),
3147
3147
  variantId: h(),
3148
- isRelatedProduct: $e()
3148
+ isRelatedProduct: be()
3149
3149
  })
3150
3150
  },
3151
3151
  {
@@ -3361,7 +3361,7 @@ const lg = y().shape({
3361
3361
  actionName: "cart/applePayOnShippingMethodSelected",
3362
3362
  schema: _g
3363
3363
  }
3364
- ], M = {
3364
+ ], k = {
3365
3365
  PLATFORM_IOS: "ios",
3366
3366
  PLATFORM_ANDROID: "android",
3367
3367
  PLATFORM_EDITOR: "editor",
@@ -3401,7 +3401,7 @@ const lg = y().shape({
3401
3401
  return r.onError(a.message || "Error"), null;
3402
3402
  throw a.message || "Error";
3403
3403
  }
3404
- }, j = (e, t, r = {}) => sa(e, t, r), bg = async (e, t) => j("applyGiftCard", e, t), $g = (e, t) => j("getGiftCard", e, t), Ag = (e, t) => j("removeDiscount", e, t), wg = (e, t) => j("removeGiftCard", e, t), Eg = (e, t) => j("updateApplePay", e, t), Cg = (e, t) => j("submitForCompletion", e, t), Tg = (e, t) => j("addDeliveryAddress", e, t), xg = (e, t) => j("updateDeliveryAddress", e, t), Pg = (e, t) => j("removeDeliveryAddress", e, t), Fg = (e, t) => j("updateSelectedDeliveryOptions", e, t), xe = (e, t) => j("prepareForCompletion", e, t), oa = (e, t) => j("updateBuyerIdentity", e, t), Og = ({ hostname: e }) => `${(e == null ? void 0 : e.includes("tapc.studio")) ? "https://api.tapcart.xyz" : "https://api.tapcart.com"}/public/apple-pay/session`, Ig = ({ hostname: e, appId: t }) => {
3404
+ }, U = (e, t, r = {}) => sa(e, t, r), $g = async (e, t) => U("applyGiftCard", e, t), bg = (e, t) => U("getGiftCard", e, t), Ag = (e, t) => U("removeDiscount", e, t), wg = (e, t) => U("removeGiftCard", e, t), Eg = (e, t) => U("updateApplePay", e, t), Cg = (e, t) => U("submitForCompletion", e, t), Tg = (e, t) => U("addDeliveryAddress", e, t), xg = (e, t) => U("updateDeliveryAddress", e, t), Pg = (e, t) => U("removeDeliveryAddress", e, t), Fg = (e, t) => U("updateSelectedDeliveryOptions", e, t), xe = (e, t) => U("prepareForCompletion", e, t), oa = (e, t) => U("updateBuyerIdentity", e, t), Og = ({ hostname: e }) => `${(e == null ? void 0 : e.includes("tapc.studio")) ? "https://api.tapcart.xyz" : "https://api.tapcart.com"}/public/apple-pay/session`, Ig = ({ hostname: e, appId: t }) => {
3405
3405
  const r = e == null ? void 0 : e.includes("tapc.studio"), n = t.toLowerCase();
3406
3406
  return r ? `${n}.tapc.studio` : `${n}.tapcart.studio`;
3407
3407
  }, Ng = async (e, t) => {
@@ -3411,7 +3411,7 @@ const lg = y().shape({
3411
3411
  const { billingContact: u, shippingContact: l } = n;
3412
3412
  let d = null;
3413
3413
  try {
3414
- const f = ($) => {
3414
+ const f = (b) => {
3415
3415
  const {
3416
3416
  addressLines: _,
3417
3417
  locality: N,
@@ -3422,7 +3422,7 @@ const lg = y().shape({
3422
3422
  administrativeArea: K,
3423
3423
  postalCode: z,
3424
3424
  emailAddress: T
3425
- } = $, w = {};
3425
+ } = b, w = {};
3426
3426
  if (Array.isArray(_) && _.length > 0) {
3427
3427
  const [Ae] = _;
3428
3428
  w.address1 = Ae;
@@ -3443,8 +3443,8 @@ const lg = y().shape({
3443
3443
  billingAddress: f(u)
3444
3444
  };
3445
3445
  (s = (i = d == null ? void 0 : d.cost) == null ? void 0 : i.totalAmount) != null && s.amount && (m.amount = d.cost.totalAmount.amount), (c = (o = d == null ? void 0 : d.cost) == null ? void 0 : o.totalAmount) != null && c.currencyCode && (m.currencyCode = d.cost.totalAmount.currencyCode);
3446
- const { token: v } = n, { data: g, signature: S, version: b, header: C } = v.paymentData;
3447
- m.data = g, m.signature = S, m.version = b, m.header = C, await Eg(m), await xe({ cartId: r, appId: a });
3446
+ const { token: v } = n, { data: g, signature: S, version: $, header: C } = v.paymentData;
3447
+ m.data = g, m.signature = S, m.version = $, m.header = C, await Eg(m), await xe({ cartId: r, appId: a });
3448
3448
  const x = crypto.randomUUID();
3449
3449
  return await Cg({
3450
3450
  attemptToken: x,
@@ -3463,7 +3463,7 @@ const lg = y().shape({
3463
3463
  const { cartId: r, shippingContact: n, displayName: a, appId: i } = e;
3464
3464
  let s = null;
3465
3465
  try {
3466
- const b = ($) => {
3466
+ const $ = (b) => {
3467
3467
  const {
3468
3468
  addressLines: _,
3469
3469
  locality: N,
@@ -3473,7 +3473,7 @@ const lg = y().shape({
3473
3473
  phoneNumber: F,
3474
3474
  administrativeArea: K,
3475
3475
  postalCode: z
3476
- } = $, T = {};
3476
+ } = b, T = {};
3477
3477
  if (Array.isArray(_) && _.length > 0) {
3478
3478
  const [w] = _;
3479
3479
  T.address1 = w;
@@ -3490,7 +3490,7 @@ const lg = y().shape({
3490
3490
  if (n != null && n.countryCode && (C.countryCode = n.countryCode), n != null && n.emailAddress && (C.email = n.emailAddress), n != null && n.phoneNumber && (C.phone = n.phoneNumber), await oa(C), s = await sa("getCart", { cartId: r, appId: i }), (((c = (o = s == null ? void 0 : s.cart) == null ? void 0 : o.delivery) == null ? void 0 : c.addresses) ?? []).length > 1 && await Pg({
3491
3491
  cartId: r,
3492
3492
  appId: i,
3493
- deliveryAddressIds: s.cart.delivery.addresses.map(($) => $.id)
3493
+ deliveryAddressIds: s.cart.delivery.addresses.map((b) => b.id)
3494
3494
  }), n) {
3495
3495
  if (((d = (l = (u = s == null ? void 0 : s.cart) == null ? void 0 : u.delivery) == null ? void 0 : l.addresses) == null ? void 0 : d.length) === 0)
3496
3496
  await Tg({
@@ -3499,7 +3499,7 @@ const lg = y().shape({
3499
3499
  addresses: [
3500
3500
  {
3501
3501
  address: {
3502
- deliveryAddress: b(n)
3502
+ deliveryAddress: $(n)
3503
3503
  },
3504
3504
  oneTimeUse: !0,
3505
3505
  selected: !0,
@@ -3508,15 +3508,15 @@ const lg = y().shape({
3508
3508
  ]
3509
3509
  });
3510
3510
  else if (((m = (p = (f = s == null ? void 0 : s.cart) == null ? void 0 : f.delivery) == null ? void 0 : p.addresses) == null ? void 0 : m.length) === 1) {
3511
- const $ = s.cart.delivery.addresses[0];
3511
+ const b = s.cart.delivery.addresses[0];
3512
3512
  await xg({
3513
3513
  cartId: r,
3514
3514
  appId: i,
3515
3515
  addresses: [
3516
3516
  {
3517
- id: $.id,
3517
+ id: b.id,
3518
3518
  address: {
3519
- deliveryAddress: b(n)
3519
+ deliveryAddress: $(n)
3520
3520
  }
3521
3521
  }
3522
3522
  ]
@@ -3524,8 +3524,8 @@ const lg = y().shape({
3524
3524
  }
3525
3525
  }
3526
3526
  return s = await xe({ cartId: r, appId: i }), {
3527
- shippingMethods: (($) => {
3528
- const _ = $[0], { deliveryOptions: N } = _;
3527
+ shippingMethods: ((b) => {
3528
+ const _ = b[0], { deliveryOptions: N } = _;
3529
3529
  return N.map((R) => {
3530
3530
  const { title: G, estimatedCost: L, description: F, handle: K } = R, { id: z } = _, T = {
3531
3531
  label: G,
@@ -3539,10 +3539,10 @@ const lg = y().shape({
3539
3539
  amount: (S = (g = (v = s.cart) == null ? void 0 : v.cost) == null ? void 0 : g.totalAmount) == null ? void 0 : S.amount
3540
3540
  }
3541
3541
  };
3542
- } catch (b) {
3543
- if (console.error("Error in applePayOnShippingContactSelected:", b), t != null && t.onError)
3544
- return t.onError(b), null;
3545
- throw b;
3542
+ } catch ($) {
3543
+ if (console.error("Error in applePayOnShippingContactSelected:", $), t != null && t.onError)
3544
+ return t.onError($), null;
3545
+ throw $;
3546
3546
  }
3547
3547
  }, Rg = async (e, t) => {
3548
3548
  var i, s, o;
@@ -3633,7 +3633,7 @@ const lg = y().shape({
3633
3633
  onError: i == null ? void 0 : i.onError
3634
3634
  }
3635
3635
  ),
3636
- "giftcard/apply": async (a, i) => bg(
3636
+ "giftcard/apply": async (a, i) => $g(
3637
3637
  { appId: a.data.appId, giftCardCode: a.data.giftCardCode, cartId: a.data.cartId },
3638
3638
  {
3639
3639
  onSuccess: (s) => {
@@ -3642,7 +3642,7 @@ const lg = y().shape({
3642
3642
  onError: i == null ? void 0 : i.onError
3643
3643
  }
3644
3644
  ),
3645
- "giftcard/get": async (a, i) => $g(
3645
+ "giftcard/get": async (a, i) => bg(
3646
3646
  { appId: a.data.appId, cartId: a.data.cartId },
3647
3647
  {
3648
3648
  onSuccess: i == null ? void 0 : i.onSuccess,
@@ -3794,8 +3794,8 @@ const lg = y().shape({
3794
3794
  else
3795
3795
  c(f);
3796
3796
  }), r[o] = {
3797
- [M.ACTION_RESPONSE_SUCCESS]: d,
3798
- [M.ACTION_RESPONSE_ERROR]: u
3797
+ [k.ACTION_RESPONSE_SUCCESS]: d,
3798
+ [k.ACTION_RESPONSE_ERROR]: u
3799
3799
  };
3800
3800
  }, a = (o, c, u) => {
3801
3801
  var l;
@@ -3872,32 +3872,38 @@ const lg = y().shape({
3872
3872
  };
3873
3873
  }, zg = () => {
3874
3874
  let e;
3875
- const t = (c, u) => window.webkit.messageHandlers[c].postMessage(
3876
- JSON.stringify(u)
3877
- ), r = (c, u) => window[c].postMessage(JSON.stringify(u)), n = (c, u) => {
3875
+ const t = (c, u) => {
3876
+ var d, f;
3877
+ const l = (f = (d = window.webkit) == null ? void 0 : d.messageHandlers) == null ? void 0 : f[c];
3878
+ if (!l) {
3879
+ console.warn(
3880
+ `Tapcart: iOS message handler "${c}" not available yet; dropping message`
3881
+ );
3882
+ return;
3883
+ }
3884
+ l.postMessage(JSON.stringify(u));
3885
+ }, r = (c, u) => window[c].postMessage(JSON.stringify(u)), n = (c, u) => {
3878
3886
  var l, d;
3879
3887
  console.log(u), window == null || window.postMessage(
3880
- { type: M.TAPCART_SDK, message: JSON.stringify(u) },
3888
+ { type: k.TAPCART_SDK, message: JSON.stringify(u) },
3881
3889
  "*"
3882
3890
  ), (d = (l = window == null ? void 0 : window.parent) == null ? void 0 : l.window) == null || d.postMessage(
3883
- { type: M.TAPCART_SDK, message: JSON.stringify(u) },
3891
+ { type: k.TAPCART_SDK, message: JSON.stringify(u) },
3884
3892
  "*"
3885
3893
  );
3886
3894
  }, a = {
3887
- [M.PLATFORM_IOS]: t,
3888
- [M.PLATFORM_ANDROID]: r,
3889
- [M.PLATFORM_EDITOR]: n
3895
+ [k.PLATFORM_IOS]: t,
3896
+ [k.PLATFORM_ANDROID]: r,
3897
+ [k.PLATFORM_EDITOR]: n
3890
3898
  }, i = (c, u) => (l) => a[c](u, l);
3891
3899
  return {
3892
3900
  sendMessage: (c) => e(c),
3893
3901
  init: (c, u) => {
3894
3902
  if (!c || !u)
3895
3903
  throw new Error("Failed to initialize ActionBridge");
3896
- if (c !== M.PLATFORM_IOS && c !== M.PLATFORM_ANDROID && c !== M.PLATFORM_EDITOR)
3904
+ if (c !== k.PLATFORM_IOS && c !== k.PLATFORM_ANDROID && c !== k.PLATFORM_EDITOR)
3897
3905
  throw new Error("Unknown Platform");
3898
- if (c === M.PLATFORM_IOS && !window.webkit)
3899
- throw new Error("Webview Interface not available");
3900
- if (c === M.PLATFORM_ANDROID && !window[u])
3906
+ if (c === k.PLATFORM_ANDROID && !window[u])
3901
3907
  throw new Error("Webview Interface not available");
3902
3908
  e = i(c, u);
3903
3909
  }
@@ -4226,9 +4232,9 @@ function Kv({ webbridgeClient: e, children: t }) {
4226
4232
  }, [e]), /* @__PURE__ */ Y.createElement(kt.Provider, { value: r }, /* @__PURE__ */ Y.createElement(tt.Provider, { value: e.actions }, t));
4227
4233
  }
4228
4234
  const Wv = () => ({
4229
- ...U(tt)
4230
- }), Jv = () => U(kt), lv = () => {
4231
- const e = U(tt), t = U(kt);
4235
+ ...q(tt)
4236
+ }), Jv = () => q(kt), lv = () => {
4237
+ const e = q(tt), t = q(kt);
4232
4238
  return X(
4233
4239
  () => ({
4234
4240
  action: e.action,
@@ -4480,7 +4486,7 @@ const Wv = () => ({
4480
4486
  }, va = (e) => Gt(e, { headers: { Accept: "application/json" } }), _a = () => le(
4481
4487
  "TapcartAiConfigError",
4482
4488
  "Tapcart ai: catalog needs appId and customerProfilesBaseUrl"
4483
- ), bv = async ({
4489
+ ), $v = async ({
4484
4490
  productId: e,
4485
4491
  config: t
4486
4492
  }) => {
@@ -4495,7 +4501,7 @@ const Wv = () => ({
4495
4501
  data: (Array.isArray(a == null ? void 0 : a.relatedProductIds) ? a.relatedProductIds : Array.isArray(a == null ? void 0 : a.related) ? a.related.map((o) => o == null ? void 0 : o.productId) : []).map((o) => o == null ? "" : String(o)).filter(Boolean),
4496
4502
  error: null
4497
4503
  };
4498
- }, $v = async ({
4504
+ }, bv = async ({
4499
4505
  productId: e,
4500
4506
  config: t
4501
4507
  }) => {
@@ -4526,7 +4532,7 @@ const Wv = () => ({
4526
4532
  complementProductIds: (Array.isArray(c == null ? void 0 : c.complementProductIds) ? c.complementProductIds : []).map((l) => l == null ? "" : String(l)).filter(Boolean)
4527
4533
  })), error: null };
4528
4534
  }, Av = async ({ productId: e, config: t }) => {
4529
- const { data: r, error: n } = await bv({
4535
+ const { data: r, error: n } = await $v({
4530
4536
  productId: e,
4531
4537
  config: t
4532
4538
  });
@@ -4535,7 +4541,7 @@ const Wv = () => ({
4535
4541
  productId: e,
4536
4542
  config: t
4537
4543
  }) => {
4538
- const { data: r, error: n } = await $v({
4544
+ const { data: r, error: n } = await bv({
4539
4545
  productId: e,
4540
4546
  config: t
4541
4547
  });
@@ -4830,7 +4836,7 @@ function Rv(e, t = () => null) {
4830
4836
  }
4831
4837
  };
4832
4838
  }
4833
- const Sa = H(void 0), ba = H(void 0), $a = H(null), Aa = H(null), Lv = () => U(ba), Mv = () => U($a), qv = () => U(Aa), Me = () => {
4839
+ const Sa = H(void 0), $a = H(void 0), ba = H(null), Aa = H(null), Lv = () => q($a), Mv = () => q(ba), qv = () => q(Aa), Me = () => {
4834
4840
  }, Kr = (e) => e, Wr = () => !1, Uv = [
4835
4841
  "appId",
4836
4842
  "apiUrl",
@@ -4862,7 +4868,7 @@ const Gv = () => {
4862
4868
  (S = p == null ? void 0 : p.onSuccess) == null || S.call(p, g);
4863
4869
  },
4864
4870
  onError: (g) => {
4865
- var S, b;
4871
+ var S, $;
4866
4872
  try {
4867
4873
  (S = o == null ? void 0 : o.action) == null || S.call(o, "track", {
4868
4874
  name: "_error",
@@ -4878,7 +4884,7 @@ const Gv = () => {
4878
4884
  });
4879
4885
  } catch {
4880
4886
  }
4881
- (b = p == null ? void 0 : p.onError) == null || b.call(p, g);
4887
+ ($ = p == null ? void 0 : p.onError) == null || $.call(p, g);
4882
4888
  }
4883
4889
  };
4884
4890
  return m(o == null ? void 0 : o.action(d, f, v));
@@ -4952,24 +4958,24 @@ function Yv({
4952
4958
  ...t
4953
4959
  }) {
4954
4960
  var m, v, g, S;
4955
- if (!U(tt))
4961
+ if (!q(tt))
4956
4962
  throw new Error(
4957
4963
  "DataSourceProvider must be nested inside a WebbridgeProvider"
4958
4964
  );
4959
4965
  const n = lv(), [a, i] = xt(n.variables), s = Jr(
4960
- ({ product: b, isLoadingProduct: C, collection: x, isLoadingCollection: $ }) => {
4966
+ ({ product: $, isLoadingProduct: C, collection: x, isLoadingCollection: b }) => {
4961
4967
  i((_) => ({
4962
4968
  ..._,
4963
- ...b && { product: b },
4969
+ ...$ && { product: $ },
4964
4970
  ...x && { collection: x },
4965
4971
  isLoadingProduct: C ?? !1,
4966
- isLoadingCollection: $ ?? !1
4972
+ isLoadingCollection: b ?? !1
4967
4973
  }));
4968
4974
  },
4969
4975
  []
4970
4976
  );
4971
4977
  We(() => {
4972
- i((b) => zv(b, n.variables || {}));
4978
+ i(($) => zv($, n.variables || {}));
4973
4979
  }, [n.variables]);
4974
4980
  const o = ((v = (m = n.variables) == null ? void 0 : m.device) == null ? void 0 : v.id) ?? t.deviceId ?? null, c = jv(t), u = X(() => Gv(), [c]);
4975
4981
  u.update({ ...t, deviceId: o });
@@ -4984,27 +4990,27 @@ function Yv({
4984
4990
  () => ({ variables: a, setProductAndCollectionVariables: s }),
4985
4991
  [a, s]
4986
4992
  ), f = (S = (g = n.variables) == null ? void 0 : g.view) == null ? void 0 : S.focused, p = typeof f == "boolean" ? f : void 0;
4987
- return /* @__PURE__ */ Y.createElement(Sa.Provider, { value: u.api }, /* @__PURE__ */ Y.createElement($a.Provider, { value: u.client }, /* @__PURE__ */ Y.createElement(Aa.Provider, { value: o }, /* @__PURE__ */ Y.createElement(ba.Provider, { value: l }, /* @__PURE__ */ Y.createElement(Ea.Provider, { value: d }, /* @__PURE__ */ Y.createElement(Vt.Provider, { value: p }, e))))));
4993
+ return /* @__PURE__ */ Y.createElement(Sa.Provider, { value: u.api }, /* @__PURE__ */ Y.createElement(ba.Provider, { value: u.client }, /* @__PURE__ */ Y.createElement(Aa.Provider, { value: o }, /* @__PURE__ */ Y.createElement($a.Provider, { value: l }, /* @__PURE__ */ Y.createElement(Ea.Provider, { value: d }, /* @__PURE__ */ Y.createElement(Vt.Provider, { value: p }, e))))));
4988
4994
  }
4989
4995
  const Ca = (e) => {
4990
- const t = U(Sa);
4996
+ const t = q(Sa);
4991
4997
  if (!t)
4992
4998
  throw new Error(`${e} must be used within a DataSourceProvider`);
4993
4999
  return t;
4994
5000
  }, Xv = () => Ca("useDataSource"), Qv = (e) => Ca("useTapcart").useTapcart(e), Hv = () => {
4995
- const e = U(Vt);
5001
+ const e = q(Vt);
4996
5002
  if (e === zt)
4997
5003
  throw new Error("useViewFocused must be used within a DataSourceProvider");
4998
5004
  return e === !0;
4999
5005
  }, e0 = () => {
5000
- const e = U(Vt);
5006
+ const e = q(Vt);
5001
5007
  if (e === zt)
5002
5008
  throw new Error(
5003
5009
  "useViewFocusedState must be used within a DataSourceProvider"
5004
5010
  );
5005
5011
  return e;
5006
5012
  }, t0 = () => {
5007
- const e = U(Ea);
5013
+ const e = q(Ea);
5008
5014
  if (!e)
5009
5015
  throw new Error(
5010
5016
  "useSetProductAndCollectionVariables must be used within a DataSourceProvider"