@clicktap/state 0.14.1 → 0.14.3
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.
- package/index.js +13 -13
- package/index.mjs +360 -331
- package/package.json +2 -1
- package/quote/CheckoutProvider.d.ts +60 -24
- package/quote/checkout/actions/index.d.ts +1 -0
- package/quote/checkout/actions/updateQuote.d.ts +210 -0
- package/quote/checkout.d.ts +20 -8
- package/toast/ToastProvider.d.ts +1 -1
- package/toast/toast.d.ts +1 -1
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as we } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as be, useContext as Ne, useState as
|
|
2
|
+
import { createContext as be, useContext as Ne, useState as Oe, useEffect as Ce, cloneElement as An } from "react";
|
|
3
3
|
function xn(e, t) {
|
|
4
4
|
for (var n = 0; n < t.length; n++) {
|
|
5
5
|
const s = t[n];
|
|
@@ -72,7 +72,7 @@ function Rn(e, t) {
|
|
|
72
72
|
type: `xstate.after.${e}.${t}`
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function ze(e, t) {
|
|
76
76
|
return {
|
|
77
77
|
type: `xstate.done.state.${e}`,
|
|
78
78
|
output: t
|
|
@@ -106,7 +106,7 @@ function pt(e, t) {
|
|
|
106
106
|
return `${e.sessionId}.${t}`;
|
|
107
107
|
}
|
|
108
108
|
let Ln = 0;
|
|
109
|
-
function
|
|
109
|
+
function Un(e, t) {
|
|
110
110
|
const n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new Set(), o = {}, {
|
|
111
111
|
clock: a,
|
|
112
112
|
logger: c
|
|
@@ -229,9 +229,9 @@ function yt(e) {
|
|
|
229
229
|
if (typeof e != "string")
|
|
230
230
|
return e;
|
|
231
231
|
const t = et(e);
|
|
232
|
-
return
|
|
232
|
+
return Pn(t);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Pn(e) {
|
|
235
235
|
if (e.length === 1)
|
|
236
236
|
return e[0];
|
|
237
237
|
const t = {};
|
|
@@ -259,7 +259,7 @@ function zt(e) {
|
|
|
259
259
|
function j(e) {
|
|
260
260
|
return e === void 0 ? [] : zt(e);
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function Ge(e, t, n, s) {
|
|
263
263
|
return typeof e == "function" ? e({
|
|
264
264
|
context: t,
|
|
265
265
|
event: n,
|
|
@@ -333,7 +333,7 @@ class jn {
|
|
|
333
333
|
systemId: u,
|
|
334
334
|
inspect: h
|
|
335
335
|
} = s;
|
|
336
|
-
this.system = o ? o.system :
|
|
336
|
+
this.system = o ? o.system : Un(this, {
|
|
337
337
|
clock: r,
|
|
338
338
|
logger: i
|
|
339
339
|
}), h && !o && this.system.inspect(gt(h)), this.sessionId = this.system._bookId(), this.id = c ?? this.sessionId, this.logger = (n == null ? void 0 : n.logger) ?? this.system._logger, this.clock = (n == null ? void 0 : n.clock) ?? this.system._clock, this._parent = o, this._syncSnapshot = a, this.options = s, this.src = s.src ?? t, this.ref = this, this._actorScope = {
|
|
@@ -682,7 +682,7 @@ class jn {
|
|
|
682
682
|
return this._snapshot;
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function P(e, ...[t]) {
|
|
686
686
|
return new jn(e, t);
|
|
687
687
|
}
|
|
688
688
|
function $n(e, t, n, s, {
|
|
@@ -710,7 +710,7 @@ function zn(e, t, n, s, {
|
|
|
710
710
|
}) {
|
|
711
711
|
const u = typeof o == "string" ? tt(t.machine, o) : o, h = typeof r == "function" ? r(n) : r;
|
|
712
712
|
let d;
|
|
713
|
-
return u && (d =
|
|
713
|
+
return u && (d = P(u, {
|
|
714
714
|
id: h,
|
|
715
715
|
src: o,
|
|
716
716
|
parent: e.self,
|
|
@@ -760,7 +760,7 @@ function Yn(e, t, n, s, {
|
|
|
760
760
|
children: a
|
|
761
761
|
}), o];
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function Qn(e, t) {
|
|
764
764
|
if (t) {
|
|
765
765
|
if (e.system._unregister(t), t._processingStatus !== D.Running) {
|
|
766
766
|
e.stopChild(t);
|
|
@@ -774,7 +774,7 @@ function Xn(e, t) {
|
|
|
774
774
|
function Yt(e) {
|
|
775
775
|
function t(n, s) {
|
|
776
776
|
}
|
|
777
|
-
return t.type = "xstate.stopChild", t.actorRef = e, t.resolve = Yn, t.execute =
|
|
777
|
+
return t.type = "xstate.stopChild", t.actorRef = e, t.resolve = Yn, t.execute = Qn, t;
|
|
778
778
|
}
|
|
779
779
|
function st(e, t, n, s) {
|
|
780
780
|
const {
|
|
@@ -812,7 +812,7 @@ function le(e, t) {
|
|
|
812
812
|
return n;
|
|
813
813
|
}
|
|
814
814
|
function Se(e) {
|
|
815
|
-
const t = new Set(e), n =
|
|
815
|
+
const t = new Set(e), n = Xt(t);
|
|
816
816
|
for (const s of t)
|
|
817
817
|
if (s.type === "compound" && (!n.get(s) || !n.get(s).length))
|
|
818
818
|
vt(s).forEach((r) => t.add(r));
|
|
@@ -831,7 +831,7 @@ function Se(e) {
|
|
|
831
831
|
}
|
|
832
832
|
return t;
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function Qt(e, t) {
|
|
835
835
|
const n = t.get(e);
|
|
836
836
|
if (!n)
|
|
837
837
|
return {};
|
|
@@ -845,10 +845,10 @@ function Xt(e, t) {
|
|
|
845
845
|
}
|
|
846
846
|
const s = {};
|
|
847
847
|
for (const r of n)
|
|
848
|
-
s[r.key] =
|
|
848
|
+
s[r.key] = Qt(r, t);
|
|
849
849
|
return s;
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function Xt(e) {
|
|
852
852
|
const t = /* @__PURE__ */ new Map();
|
|
853
853
|
for (const n of e)
|
|
854
854
|
t.has(n) || t.set(n, []), n.parent && (t.has(n.parent) || t.set(n.parent, []), t.get(n.parent).push(n));
|
|
@@ -856,13 +856,13 @@ function Qt(e) {
|
|
|
856
856
|
}
|
|
857
857
|
function Wt(e, t) {
|
|
858
858
|
const n = Se(t);
|
|
859
|
-
return
|
|
859
|
+
return Qt(e, Xt(n));
|
|
860
860
|
}
|
|
861
861
|
function it(e, t) {
|
|
862
862
|
return t.type === "compound" ? te(t).some((n) => n.type === "final" && e.has(n)) : t.type === "parallel" ? te(t).every((n) => it(e, n)) : t.type === "final";
|
|
863
863
|
}
|
|
864
|
-
const
|
|
865
|
-
function
|
|
864
|
+
const ke = (e) => e[0] === Cn;
|
|
865
|
+
function Xn(e, t) {
|
|
866
866
|
return e.transitions.get(t) || [...e.transitions.keys()].filter((s) => {
|
|
867
867
|
if (s === kn)
|
|
868
868
|
return !0;
|
|
@@ -982,7 +982,7 @@ function es(e, t) {
|
|
|
982
982
|
return t.map((n) => {
|
|
983
983
|
if (typeof n != "string")
|
|
984
984
|
return n;
|
|
985
|
-
if (
|
|
985
|
+
if (ke(n))
|
|
986
986
|
return e.machine.getStateNodeById(n);
|
|
987
987
|
const s = n[0] === Ft;
|
|
988
988
|
if (s && !e.parent)
|
|
@@ -1029,7 +1029,7 @@ function Zt(e) {
|
|
|
1029
1029
|
return n(e), t;
|
|
1030
1030
|
}
|
|
1031
1031
|
function ne(e, t) {
|
|
1032
|
-
if (
|
|
1032
|
+
if (ke(t))
|
|
1033
1033
|
return e.machine.getStateNodeById(t);
|
|
1034
1034
|
if (!e.states)
|
|
1035
1035
|
throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);
|
|
@@ -1039,7 +1039,7 @@ function ne(e, t) {
|
|
|
1039
1039
|
return n;
|
|
1040
1040
|
}
|
|
1041
1041
|
function Ie(e, t) {
|
|
1042
|
-
if (typeof t == "string" &&
|
|
1042
|
+
if (typeof t == "string" && ke(t))
|
|
1043
1043
|
try {
|
|
1044
1044
|
return e.machine.getStateNodeById(t);
|
|
1045
1045
|
} catch {
|
|
@@ -1117,7 +1117,7 @@ function en(e, t, n) {
|
|
|
1117
1117
|
let i = !1;
|
|
1118
1118
|
const o = /* @__PURE__ */ new Set();
|
|
1119
1119
|
for (const a of s)
|
|
1120
|
-
if (is(
|
|
1120
|
+
if (is(Je([r], t, n), Je([a], t, n)))
|
|
1121
1121
|
if ($(r.source, a.source))
|
|
1122
1122
|
o.add(a);
|
|
1123
1123
|
else {
|
|
@@ -1166,7 +1166,7 @@ function tn(e, t) {
|
|
|
1166
1166
|
if (!e.reenter)
|
|
1167
1167
|
return e.source.machine.root;
|
|
1168
1168
|
}
|
|
1169
|
-
function
|
|
1169
|
+
function Je(e, t, n) {
|
|
1170
1170
|
var r;
|
|
1171
1171
|
const s = /* @__PURE__ */ new Set();
|
|
1172
1172
|
for (const i of e)
|
|
@@ -1186,7 +1186,7 @@ function as(e, t) {
|
|
|
1186
1186
|
return !1;
|
|
1187
1187
|
return !0;
|
|
1188
1188
|
}
|
|
1189
|
-
function
|
|
1189
|
+
function Ye(e, t, n, s, r, i) {
|
|
1190
1190
|
if (!e.length)
|
|
1191
1191
|
return t;
|
|
1192
1192
|
const o = new Set(t._nodes);
|
|
@@ -1208,8 +1208,8 @@ function Ge(e, t, n, s, r, i) {
|
|
|
1208
1208
|
function cs(e, t, n, s, r) {
|
|
1209
1209
|
if (s.output === void 0)
|
|
1210
1210
|
return;
|
|
1211
|
-
const i =
|
|
1212
|
-
return
|
|
1211
|
+
const i = ze(r.id, r.output !== void 0 && r.parent ? Ge(r.output, e.context, t, n.self) : void 0);
|
|
1212
|
+
return Ge(s.output, e.context, i, n.self);
|
|
1213
1213
|
}
|
|
1214
1214
|
function us(e, t, n, s, r, i, o, a) {
|
|
1215
1215
|
let c = e;
|
|
@@ -1232,8 +1232,8 @@ function us(e, t, n, s, r, i, o, a) {
|
|
|
1232
1232
|
if (c = se(c, t, n, m, i, f.invoke.map((y) => y.id)), f.type === "final") {
|
|
1233
1233
|
const y = f.parent;
|
|
1234
1234
|
let v = (y == null ? void 0 : y.type) === "parallel" ? y : y == null ? void 0 : y.parent, I = v || f;
|
|
1235
|
-
for ((y == null ? void 0 : y.type) === "compound" && i.push(
|
|
1236
|
-
d.add(v), i.push(
|
|
1235
|
+
for ((y == null ? void 0 : y.type) === "compound" && i.push(ze(y.id, f.output !== void 0 ? Ge(f.output, c.context, t, n.self) : void 0)); (v == null ? void 0 : v.type) === "parallel" && !d.has(v) && it(r, v); )
|
|
1236
|
+
d.add(v), i.push(ze(v.id)), I = v, v = v.parent;
|
|
1237
1237
|
if (v)
|
|
1238
1238
|
continue;
|
|
1239
1239
|
c = Y(c, {
|
|
@@ -1268,17 +1268,17 @@ function Z(e, t, n, s) {
|
|
|
1268
1268
|
for (const o of i)
|
|
1269
1269
|
s.add(o), Z(o, t, n, s);
|
|
1270
1270
|
for (const o of i)
|
|
1271
|
-
|
|
1271
|
+
Ue(o, e.parent, s, t, n);
|
|
1272
1272
|
} else {
|
|
1273
1273
|
const i = Kt(e);
|
|
1274
1274
|
for (const o of i.target)
|
|
1275
1275
|
s.add(o), i === ((r = e.parent) == null ? void 0 : r.initial) && n.add(e.parent), Z(o, t, n, s);
|
|
1276
1276
|
for (const o of i.target)
|
|
1277
|
-
|
|
1277
|
+
Ue(o, e.parent, s, t, n);
|
|
1278
1278
|
}
|
|
1279
1279
|
else if (e.type === "compound") {
|
|
1280
1280
|
const [i] = e.initial.target;
|
|
1281
|
-
J(i) || (s.add(i), n.add(i)), Z(i, t, n, s),
|
|
1281
|
+
J(i) || (s.add(i), n.add(i)), Z(i, t, n, s), Ue(i, e, s, t, n);
|
|
1282
1282
|
} else if (e.type === "parallel")
|
|
1283
1283
|
for (const i of te(e).filter((o) => !J(o)))
|
|
1284
1284
|
[...s].some((o) => $(o, i)) || (J(i) || (s.add(i), n.add(i)), Z(i, t, n, s));
|
|
@@ -1289,12 +1289,12 @@ function nn(e, t, n, s, r) {
|
|
|
1289
1289
|
for (const o of te(i).filter((a) => !J(a)))
|
|
1290
1290
|
[...e].some((a) => $(a, o)) || (e.add(o), Z(o, t, n, e));
|
|
1291
1291
|
}
|
|
1292
|
-
function
|
|
1292
|
+
function Ue(e, t, n, s, r) {
|
|
1293
1293
|
nn(n, s, r, le(e, t));
|
|
1294
1294
|
}
|
|
1295
1295
|
function ls(e, t, n, s, r, i, o) {
|
|
1296
1296
|
let a = e;
|
|
1297
|
-
const c =
|
|
1297
|
+
const c = Je(s, r, i);
|
|
1298
1298
|
c.sort((h, d) => d.order - h.order);
|
|
1299
1299
|
let u;
|
|
1300
1300
|
for (const h of c)
|
|
@@ -1375,7 +1375,7 @@ function se(e, t, n, s, r, i) {
|
|
|
1375
1375
|
c.retryResolve(n, a, u);
|
|
1376
1376
|
}), a;
|
|
1377
1377
|
}
|
|
1378
|
-
function
|
|
1378
|
+
function Pe(e, t, n, s = []) {
|
|
1379
1379
|
let r = e;
|
|
1380
1380
|
const i = [];
|
|
1381
1381
|
function o(u, h, d) {
|
|
@@ -1405,7 +1405,7 @@ function Le(e, t, n, s = []) {
|
|
|
1405
1405
|
snapshot: r,
|
|
1406
1406
|
microstates: i
|
|
1407
1407
|
};
|
|
1408
|
-
r =
|
|
1408
|
+
r = Ye(
|
|
1409
1409
|
d,
|
|
1410
1410
|
e,
|
|
1411
1411
|
n,
|
|
@@ -1424,7 +1424,7 @@ function Le(e, t, n, s = []) {
|
|
|
1424
1424
|
break;
|
|
1425
1425
|
a = s.shift(), u = St(a, r);
|
|
1426
1426
|
}
|
|
1427
|
-
r =
|
|
1427
|
+
r = Ye(u, r, n, a, !1, s), c = r !== h, o(r, a, u);
|
|
1428
1428
|
}
|
|
1429
1429
|
return r.status !== "active" && _t(r, a, n), {
|
|
1430
1430
|
snapshot: r,
|
|
@@ -1727,7 +1727,7 @@ function xs(e, {
|
|
|
1727
1727
|
const h = tt(t, o);
|
|
1728
1728
|
if (!h)
|
|
1729
1729
|
throw new Error(`Actor logic '${o}' not implemented in machine '${t.id}'`);
|
|
1730
|
-
const d =
|
|
1730
|
+
const d = P(h, {
|
|
1731
1731
|
id: a.id,
|
|
1732
1732
|
parent: e.self,
|
|
1733
1733
|
syncSnapshot: a.syncSnapshot,
|
|
@@ -1741,7 +1741,7 @@ function xs(e, {
|
|
|
1741
1741
|
});
|
|
1742
1742
|
return r[d.id] = d, d;
|
|
1743
1743
|
} else
|
|
1744
|
-
return
|
|
1744
|
+
return P(o, {
|
|
1745
1745
|
id: a.id,
|
|
1746
1746
|
parent: e.self,
|
|
1747
1747
|
syncSnapshot: a.syncSnapshot,
|
|
@@ -1786,7 +1786,7 @@ function ws(e, t, n, s, {
|
|
|
1786
1786
|
} : t.children
|
|
1787
1787
|
})];
|
|
1788
1788
|
}
|
|
1789
|
-
function
|
|
1789
|
+
function O(e) {
|
|
1790
1790
|
function t(n, s) {
|
|
1791
1791
|
}
|
|
1792
1792
|
return t.type = "xstate.assign", t.assignment = e, t.resolve = ws, t;
|
|
@@ -1804,7 +1804,7 @@ function Ns(e, {
|
|
|
1804
1804
|
}) {
|
|
1805
1805
|
e.defer(() => e.emit(t));
|
|
1806
1806
|
}
|
|
1807
|
-
function
|
|
1807
|
+
function Fe(e) {
|
|
1808
1808
|
function t(n, s) {
|
|
1809
1809
|
}
|
|
1810
1810
|
return t.type = "xstate.emit", t.event = e, t.resolve = bs, t.execute = Ns, t;
|
|
@@ -1873,7 +1873,7 @@ function bt(e, t, n) {
|
|
|
1873
1873
|
return s.type = "xsnapshot.sendTo", s.to = e, s.event = t, s.id = n == null ? void 0 : n.id, s.delay = n == null ? void 0 : n.delay, s.resolve = Os, s.retryResolve = Cs, s.execute = ks, s;
|
|
1874
1874
|
}
|
|
1875
1875
|
const Nt = /* @__PURE__ */ new WeakMap();
|
|
1876
|
-
function
|
|
1876
|
+
function X(e, t, n) {
|
|
1877
1877
|
let s = Nt.get(e);
|
|
1878
1878
|
return s ? t in s || (s[t] = n()) : (s = {
|
|
1879
1879
|
[t]: n()
|
|
@@ -1949,7 +1949,7 @@ class ct {
|
|
|
1949
1949
|
* The logic invoked as actors by this state node.
|
|
1950
1950
|
*/
|
|
1951
1951
|
get invoke() {
|
|
1952
|
-
return
|
|
1952
|
+
return X(this, "invoke", () => j(this.config.invoke).map((t, n) => {
|
|
1953
1953
|
const {
|
|
1954
1954
|
src: s,
|
|
1955
1955
|
systemId: r
|
|
@@ -1979,19 +1979,19 @@ class ct {
|
|
|
1979
1979
|
* The mapping of events to transitions.
|
|
1980
1980
|
*/
|
|
1981
1981
|
get on() {
|
|
1982
|
-
return
|
|
1982
|
+
return X(this, "on", () => [...this.transitions].flatMap(([n, s]) => s.map((r) => [n, r])).reduce((n, [s, r]) => (n[s] = n[s] || [], n[s].push(r), n), {}));
|
|
1983
1983
|
}
|
|
1984
1984
|
get after() {
|
|
1985
|
-
return
|
|
1985
|
+
return X(this, "delayedTransitions", () => Wn(this));
|
|
1986
1986
|
}
|
|
1987
1987
|
get initial() {
|
|
1988
|
-
return
|
|
1988
|
+
return X(this, "initial", () => Zn(this, this.config.initial));
|
|
1989
1989
|
}
|
|
1990
1990
|
/** @internal */
|
|
1991
1991
|
next(t, n) {
|
|
1992
1992
|
const s = n.type, r = [];
|
|
1993
1993
|
let i;
|
|
1994
|
-
const o =
|
|
1994
|
+
const o = X(this, `candidates-${s}`, () => Xn(this, s));
|
|
1995
1995
|
for (const a of o) {
|
|
1996
1996
|
const {
|
|
1997
1997
|
guard: c
|
|
@@ -2015,7 +2015,7 @@ ${d.message}`);
|
|
|
2015
2015
|
* All the event types accepted by this state node and its descendants.
|
|
2016
2016
|
*/
|
|
2017
2017
|
get events() {
|
|
2018
|
-
return
|
|
2018
|
+
return X(this, "events", () => {
|
|
2019
2019
|
const {
|
|
2020
2020
|
states: t
|
|
2021
2021
|
} = this, n = new Set(this.ownEvents);
|
|
@@ -2107,7 +2107,7 @@ class ut {
|
|
|
2107
2107
|
* @param event The received event
|
|
2108
2108
|
*/
|
|
2109
2109
|
transition(t, n, s) {
|
|
2110
|
-
return
|
|
2110
|
+
return Pe(t, n, s).snapshot;
|
|
2111
2111
|
}
|
|
2112
2112
|
/**
|
|
2113
2113
|
* Determines the next state given the current `state` and `event`.
|
|
@@ -2117,7 +2117,7 @@ class ut {
|
|
|
2117
2117
|
* @param event The received event
|
|
2118
2118
|
*/
|
|
2119
2119
|
microstep(t, n, s) {
|
|
2120
|
-
return
|
|
2120
|
+
return Pe(t, n, s).microstates;
|
|
2121
2121
|
}
|
|
2122
2122
|
getTransitionData(t, n) {
|
|
2123
2123
|
return ot(this.root, t.value, t, n) || [];
|
|
@@ -2135,7 +2135,7 @@ class ut {
|
|
|
2135
2135
|
children: {},
|
|
2136
2136
|
status: "active"
|
|
2137
2137
|
}, this);
|
|
2138
|
-
return typeof r == "function" ? se(i, n, t, [
|
|
2138
|
+
return typeof r == "function" ? se(i, n, t, [O(({
|
|
2139
2139
|
spawn: a,
|
|
2140
2140
|
event: c,
|
|
2141
2141
|
self: u
|
|
@@ -2149,7 +2149,7 @@ class ut {
|
|
|
2149
2149
|
* Returns the initial `State` instance, with reference to `self` as an `ActorRef`.
|
|
2150
2150
|
*/
|
|
2151
2151
|
getInitialSnapshot(t, n) {
|
|
2152
|
-
const s = Vt(n), r = [], i = this.getPreInitialState(t, s, r), o =
|
|
2152
|
+
const s = Vt(n), r = [], i = this.getPreInitialState(t, s, r), o = Ye([{
|
|
2153
2153
|
target: [...Zt(this.root)],
|
|
2154
2154
|
source: this.root,
|
|
2155
2155
|
reenter: !0,
|
|
@@ -2159,7 +2159,7 @@ class ut {
|
|
|
2159
2159
|
// TODO: fix
|
|
2160
2160
|
}], i, t, s, !0, r), {
|
|
2161
2161
|
snapshot: a
|
|
2162
|
-
} =
|
|
2162
|
+
} = Pe(o, s, t, r);
|
|
2163
2163
|
return a;
|
|
2164
2164
|
}
|
|
2165
2165
|
start(t) {
|
|
@@ -2168,7 +2168,7 @@ class ut {
|
|
|
2168
2168
|
});
|
|
2169
2169
|
}
|
|
2170
2170
|
getStateNodeById(t) {
|
|
2171
|
-
const n = et(t), s = n.slice(1), r =
|
|
2171
|
+
const n = et(t), s = n.slice(1), r = ke(n[0]) ? n[0].slice(Rs.length) : n[0], i = this.idMap.get(r);
|
|
2172
2172
|
if (!i)
|
|
2173
2173
|
throw new Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);
|
|
2174
2174
|
return Ie(i, s);
|
|
@@ -2188,7 +2188,7 @@ class ut {
|
|
|
2188
2188
|
const u = r[c], h = u.snapshot, d = u.src, f = typeof d == "string" ? tt(this, d) : d;
|
|
2189
2189
|
if (!f)
|
|
2190
2190
|
return;
|
|
2191
|
-
const m =
|
|
2191
|
+
const m = P(f, {
|
|
2192
2192
|
id: c,
|
|
2193
2193
|
parent: n.self,
|
|
2194
2194
|
syncSnapshot: u.syncSnapshot,
|
|
@@ -2267,7 +2267,7 @@ function Ls() {
|
|
|
2267
2267
|
errors: []
|
|
2268
2268
|
};
|
|
2269
2269
|
}
|
|
2270
|
-
function
|
|
2270
|
+
function Us({
|
|
2271
2271
|
context: e,
|
|
2272
2272
|
event: t
|
|
2273
2273
|
}) {
|
|
@@ -2279,7 +2279,7 @@ function Ps({
|
|
|
2279
2279
|
ignoreRefreshToken: !1
|
|
2280
2280
|
};
|
|
2281
2281
|
}
|
|
2282
|
-
function
|
|
2282
|
+
function Ps() {
|
|
2283
2283
|
return {
|
|
2284
2284
|
ignoreRefreshToken: !0
|
|
2285
2285
|
};
|
|
@@ -2309,7 +2309,7 @@ function js() {
|
|
|
2309
2309
|
ignoreRefreshToken: !1
|
|
2310
2310
|
};
|
|
2311
2311
|
}
|
|
2312
|
-
async function
|
|
2312
|
+
async function Qe(e, t) {
|
|
2313
2313
|
const n = await fetch(e, t);
|
|
2314
2314
|
return n.status === 200 ? n.json() : Promise.resolve({
|
|
2315
2315
|
message: n.statusText,
|
|
@@ -2318,7 +2318,7 @@ async function Je(e, t) {
|
|
|
2318
2318
|
}
|
|
2319
2319
|
const $s = V(async ({ input: e }) => {
|
|
2320
2320
|
var n;
|
|
2321
|
-
const t = await
|
|
2321
|
+
const t = await Qe(e.endpoint.client, {
|
|
2322
2322
|
method: "POST",
|
|
2323
2323
|
mode: "cors",
|
|
2324
2324
|
credentials: "include",
|
|
@@ -2351,7 +2351,7 @@ const $s = V(async ({ input: e }) => {
|
|
|
2351
2351
|
if (e.refreshToken === "")
|
|
2352
2352
|
throw new Error("Unauthorized.");
|
|
2353
2353
|
try {
|
|
2354
|
-
if (t = await
|
|
2354
|
+
if (t = await Qe(e.endpoint.server, {
|
|
2355
2355
|
method: "POST",
|
|
2356
2356
|
mode: "cors",
|
|
2357
2357
|
credentials: "include",
|
|
@@ -2371,7 +2371,7 @@ const $s = V(async ({ input: e }) => {
|
|
|
2371
2371
|
throw console.log(n), new Error("Could not complete refresh request (server)");
|
|
2372
2372
|
}
|
|
2373
2373
|
} else {
|
|
2374
|
-
if (t = await
|
|
2374
|
+
if (t = await Qe(e.endpoint.client, {
|
|
2375
2375
|
method: "POST",
|
|
2376
2376
|
mode: "cors",
|
|
2377
2377
|
credentials: "include",
|
|
@@ -2413,13 +2413,13 @@ const $s = V(async ({ input: e }) => {
|
|
|
2413
2413
|
input: {}
|
|
2414
2414
|
},
|
|
2415
2415
|
actions: {
|
|
2416
|
-
addError:
|
|
2417
|
-
clearErrors:
|
|
2418
|
-
setAccessToken:
|
|
2419
|
-
setIgnoreRefreshToken:
|
|
2420
|
-
setUserContext:
|
|
2421
|
-
unsetRefreshToken:
|
|
2422
|
-
unsetUserContext:
|
|
2416
|
+
addError: O(Ms),
|
|
2417
|
+
clearErrors: O(Ls),
|
|
2418
|
+
setAccessToken: O(Us),
|
|
2419
|
+
setIgnoreRefreshToken: O(Ps),
|
|
2420
|
+
setUserContext: O(Fs),
|
|
2421
|
+
unsetRefreshToken: O(Bs),
|
|
2422
|
+
unsetUserContext: O(js)
|
|
2423
2423
|
},
|
|
2424
2424
|
actors: {
|
|
2425
2425
|
authenticate: $s,
|
|
@@ -2565,11 +2565,11 @@ const $s = V(async ({ input: e }) => {
|
|
|
2565
2565
|
}
|
|
2566
2566
|
}), an = be(
|
|
2567
2567
|
{}
|
|
2568
|
-
),
|
|
2569
|
-
const e = Ne(an), [t, n] =
|
|
2568
|
+
), fi = () => {
|
|
2569
|
+
const e = Ne(an), [t, n] = Oe(
|
|
2570
2570
|
typeof window < "u" && e.getSnapshot().value === "loggedIn"
|
|
2571
2571
|
);
|
|
2572
|
-
return
|
|
2572
|
+
return Ce(() => {
|
|
2573
2573
|
if (typeof window > "u")
|
|
2574
2574
|
return;
|
|
2575
2575
|
const s = e.subscribe((r) => {
|
|
@@ -2579,19 +2579,19 @@ const $s = V(async ({ input: e }) => {
|
|
|
2579
2579
|
s.unsubscribe();
|
|
2580
2580
|
};
|
|
2581
2581
|
}, [e]), { authActor: e, isLoggedIn: t };
|
|
2582
|
-
},
|
|
2582
|
+
}, pi = async (e = "", t = {
|
|
2583
2583
|
inspect: void 0,
|
|
2584
2584
|
endpoints: { login: "", logout: "", refresh: "", ssrRefresh: "" }
|
|
2585
2585
|
}) => typeof window < "u" ? (console.warn(
|
|
2586
2586
|
"App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
|
|
2587
|
-
),
|
|
2587
|
+
), P(Ot, {
|
|
2588
2588
|
inspect: t.inspect,
|
|
2589
2589
|
input: {
|
|
2590
2590
|
initialContext: {
|
|
2591
2591
|
endpoints: t.endpoints
|
|
2592
2592
|
}
|
|
2593
2593
|
}
|
|
2594
|
-
}).start()) :
|
|
2594
|
+
}).start()) : P(Ot, {
|
|
2595
2595
|
input: {
|
|
2596
2596
|
initialContext: {
|
|
2597
2597
|
endpoints: t.endpoints,
|
|
@@ -2600,7 +2600,7 @@ const $s = V(async ({ input: e }) => {
|
|
|
2600
2600
|
},
|
|
2601
2601
|
inspect: t.inspect
|
|
2602
2602
|
}).start();
|
|
2603
|
-
function
|
|
2603
|
+
function yi({ actor: e, children: t }) {
|
|
2604
2604
|
return /* @__PURE__ */ we(an.Provider, { value: e, children: t });
|
|
2605
2605
|
}
|
|
2606
2606
|
function zs({
|
|
@@ -2613,16 +2613,27 @@ function zs({
|
|
|
2613
2613
|
const s = (i = (r = e.steps) == null ? void 0 : r.find(
|
|
2614
2614
|
(o) => o.name === e.currentStep
|
|
2615
2615
|
)) == null ? void 0 : i.next;
|
|
2616
|
-
return s ?
|
|
2616
|
+
return s ? {
|
|
2617
2617
|
currentStep: s ?? e.currentStep
|
|
2618
|
-
}
|
|
2618
|
+
} : e;
|
|
2619
|
+
}
|
|
2620
|
+
function Gs({
|
|
2621
|
+
context: e,
|
|
2622
|
+
event: t
|
|
2623
|
+
}) {
|
|
2624
|
+
if (!t.type.includes("xstate.done.actor"))
|
|
2625
|
+
return e;
|
|
2626
|
+
const n = t;
|
|
2627
|
+
return n.output.type !== "SUBMIT_STEP_DATA_SUCCESS" ? e : {
|
|
2628
|
+
quote: { ...e.quote, ...n.output.quote }
|
|
2629
|
+
};
|
|
2619
2630
|
}
|
|
2620
|
-
const dt = JSON,
|
|
2631
|
+
const dt = JSON, Js = (e) => e.toUpperCase(), Ys = (e) => {
|
|
2621
2632
|
const t = {};
|
|
2622
2633
|
return e.forEach((n, s) => {
|
|
2623
2634
|
t[s] = n;
|
|
2624
2635
|
}), t;
|
|
2625
|
-
},
|
|
2636
|
+
}, Qs = (e, t, n) => e.document ? e : {
|
|
2626
2637
|
document: e,
|
|
2627
2638
|
variables: t,
|
|
2628
2639
|
requestHeaders: n,
|
|
@@ -2632,11 +2643,11 @@ const dt = JSON, Gs = (e) => e.toUpperCase(), Js = (e) => {
|
|
|
2632
2643
|
variables: t,
|
|
2633
2644
|
requestHeaders: n,
|
|
2634
2645
|
signal: void 0
|
|
2635
|
-
},
|
|
2646
|
+
}, Ws = (e, t) => e.documents ? e : {
|
|
2636
2647
|
documents: e,
|
|
2637
2648
|
requestHeaders: t,
|
|
2638
2649
|
signal: void 0
|
|
2639
|
-
},
|
|
2650
|
+
}, Ks = (e, t, ...n) => {
|
|
2640
2651
|
const [s, r] = n;
|
|
2641
2652
|
return e.document ? e : {
|
|
2642
2653
|
url: e,
|
|
@@ -2650,20 +2661,20 @@ function ve(e, t) {
|
|
|
2650
2661
|
if (!!!e)
|
|
2651
2662
|
throw new Error(t);
|
|
2652
2663
|
}
|
|
2653
|
-
function
|
|
2664
|
+
function Zs(e) {
|
|
2654
2665
|
return typeof e == "object" && e !== null;
|
|
2655
2666
|
}
|
|
2656
|
-
function
|
|
2667
|
+
function er(e, t) {
|
|
2657
2668
|
if (!!!e)
|
|
2658
2669
|
throw new Error(
|
|
2659
2670
|
t ?? "Unexpected invariant triggered."
|
|
2660
2671
|
);
|
|
2661
2672
|
}
|
|
2662
|
-
const
|
|
2663
|
-
function
|
|
2673
|
+
const tr = /\r\n|[\n\r]/g;
|
|
2674
|
+
function Xe(e, t) {
|
|
2664
2675
|
let n = 0, s = 1;
|
|
2665
|
-
for (const r of e.body.matchAll(
|
|
2666
|
-
if (typeof r.index == "number" ||
|
|
2676
|
+
for (const r of e.body.matchAll(tr)) {
|
|
2677
|
+
if (typeof r.index == "number" || er(!1), r.index >= t)
|
|
2667
2678
|
break;
|
|
2668
2679
|
n = r.index + r[0].length, s += 1;
|
|
2669
2680
|
}
|
|
@@ -2672,10 +2683,10 @@ function Ye(e, t) {
|
|
|
2672
2683
|
column: t + 1 - n
|
|
2673
2684
|
};
|
|
2674
2685
|
}
|
|
2675
|
-
function
|
|
2686
|
+
function nr(e) {
|
|
2676
2687
|
return cn(
|
|
2677
2688
|
e.source,
|
|
2678
|
-
|
|
2689
|
+
Xe(e.source, e.start)
|
|
2679
2690
|
);
|
|
2680
2691
|
}
|
|
2681
2692
|
function cn(e, t) {
|
|
@@ -2705,7 +2716,7 @@ function Ct(e) {
|
|
|
2705
2716
|
return t.map(([s, r]) => s.padStart(n) + (r ? " " + r : "")).join(`
|
|
2706
2717
|
`);
|
|
2707
2718
|
}
|
|
2708
|
-
function
|
|
2719
|
+
function sr(e) {
|
|
2709
2720
|
const t = e[0];
|
|
2710
2721
|
return t == null || "kind" in t || "length" in t ? {
|
|
2711
2722
|
nodes: t,
|
|
@@ -2757,15 +2768,15 @@ class lt extends Error {
|
|
|
2757
2768
|
*/
|
|
2758
2769
|
constructor(t, ...n) {
|
|
2759
2770
|
var s, r, i;
|
|
2760
|
-
const { nodes: o, source: a, positions: c, path: u, originalError: h, extensions: d } =
|
|
2771
|
+
const { nodes: o, source: a, positions: c, path: u, originalError: h, extensions: d } = sr(n);
|
|
2761
2772
|
super(t), this.name = "GraphQLError", this.path = u ?? void 0, this.originalError = h ?? void 0, this.nodes = kt(
|
|
2762
2773
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
2763
2774
|
);
|
|
2764
2775
|
const f = kt(
|
|
2765
2776
|
(s = this.nodes) === null || s === void 0 ? void 0 : s.map((y) => y.loc).filter((y) => y != null)
|
|
2766
2777
|
);
|
|
2767
|
-
this.source = a ?? (f == null || (r = f[0]) === null || r === void 0 ? void 0 : r.source), this.positions = c ?? (f == null ? void 0 : f.map((y) => y.start)), this.locations = c && a ? c.map((y) =>
|
|
2768
|
-
const m =
|
|
2778
|
+
this.source = a ?? (f == null || (r = f[0]) === null || r === void 0 ? void 0 : r.source), this.positions = c ?? (f == null ? void 0 : f.map((y) => y.start)), this.locations = c && a ? c.map((y) => Xe(a, y)) : f == null ? void 0 : f.map((y) => Xe(y.source, y.start));
|
|
2779
|
+
const m = Zs(
|
|
2769
2780
|
h == null ? void 0 : h.extensions
|
|
2770
2781
|
) ? h == null ? void 0 : h.extensions : void 0;
|
|
2771
2782
|
this.extensions = (i = d ?? m) !== null && i !== void 0 ? i : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
@@ -2807,7 +2818,7 @@ class lt extends Error {
|
|
|
2807
2818
|
for (const n of this.nodes)
|
|
2808
2819
|
n.loc && (t += `
|
|
2809
2820
|
|
|
2810
|
-
` +
|
|
2821
|
+
` + nr(n.loc));
|
|
2811
2822
|
else if (this.source && this.locations)
|
|
2812
2823
|
for (const n of this.locations)
|
|
2813
2824
|
t += `
|
|
@@ -2831,7 +2842,7 @@ function b(e, t, n) {
|
|
|
2831
2842
|
positions: [t]
|
|
2832
2843
|
});
|
|
2833
2844
|
}
|
|
2834
|
-
class
|
|
2845
|
+
class rr {
|
|
2835
2846
|
/**
|
|
2836
2847
|
* The character offset at which this Node begins.
|
|
2837
2848
|
*/
|
|
@@ -2976,24 +2987,24 @@ const dn = {
|
|
|
2976
2987
|
UnionTypeExtension: ["name", "directives", "types"],
|
|
2977
2988
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
2978
2989
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
2979
|
-
},
|
|
2990
|
+
}, ir = new Set(Object.keys(dn));
|
|
2980
2991
|
function Dt(e) {
|
|
2981
2992
|
const t = e == null ? void 0 : e.kind;
|
|
2982
|
-
return typeof t == "string" &&
|
|
2993
|
+
return typeof t == "string" && ir.has(t);
|
|
2983
2994
|
}
|
|
2984
2995
|
var ee;
|
|
2985
2996
|
(function(e) {
|
|
2986
2997
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
2987
2998
|
})(ee || (ee = {}));
|
|
2988
|
-
var
|
|
2999
|
+
var We;
|
|
2989
3000
|
(function(e) {
|
|
2990
3001
|
e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
|
|
2991
|
-
})(
|
|
3002
|
+
})(We || (We = {}));
|
|
2992
3003
|
var T;
|
|
2993
3004
|
(function(e) {
|
|
2994
3005
|
e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
|
|
2995
3006
|
})(T || (T = {}));
|
|
2996
|
-
function
|
|
3007
|
+
function Ke(e) {
|
|
2997
3008
|
return e === 9 || e === 32;
|
|
2998
3009
|
}
|
|
2999
3010
|
function de(e) {
|
|
@@ -3006,15 +3017,15 @@ function ln(e) {
|
|
|
3006
3017
|
function hn(e) {
|
|
3007
3018
|
return ln(e) || e === 95;
|
|
3008
3019
|
}
|
|
3009
|
-
function
|
|
3020
|
+
function or(e) {
|
|
3010
3021
|
return ln(e) || de(e) || e === 95;
|
|
3011
3022
|
}
|
|
3012
|
-
function
|
|
3023
|
+
function ar(e) {
|
|
3013
3024
|
var t;
|
|
3014
3025
|
let n = Number.MAX_SAFE_INTEGER, s = null, r = -1;
|
|
3015
3026
|
for (let o = 0; o < e.length; ++o) {
|
|
3016
3027
|
var i;
|
|
3017
|
-
const a = e[o], c =
|
|
3028
|
+
const a = e[o], c = cr(a);
|
|
3018
3029
|
c !== a.length && (s = (i = s) !== null && i !== void 0 ? i : o, r = o, o !== 0 && c < n && (n = c));
|
|
3019
3030
|
}
|
|
3020
3031
|
return e.map((o, a) => a === 0 ? o : o.slice(n)).slice(
|
|
@@ -3022,17 +3033,17 @@ function or(e) {
|
|
|
3022
3033
|
r + 1
|
|
3023
3034
|
);
|
|
3024
3035
|
}
|
|
3025
|
-
function
|
|
3036
|
+
function cr(e) {
|
|
3026
3037
|
let t = 0;
|
|
3027
|
-
for (; t < e.length &&
|
|
3038
|
+
for (; t < e.length && Ke(e.charCodeAt(t)); )
|
|
3028
3039
|
++t;
|
|
3029
3040
|
return t;
|
|
3030
3041
|
}
|
|
3031
|
-
function
|
|
3032
|
-
const n = e.replace(/"""/g, '\\"""'), s = n.split(/\r\n|[\n\r]/g), r = s.length === 1, i = s.length > 1 && s.slice(1).every((m) => m.length === 0 ||
|
|
3042
|
+
function ur(e, t) {
|
|
3043
|
+
const n = e.replace(/"""/g, '\\"""'), s = n.split(/\r\n|[\n\r]/g), r = s.length === 1, i = s.length > 1 && s.slice(1).every((m) => m.length === 0 || Ke(m.charCodeAt(0))), o = n.endsWith('\\"""'), a = e.endsWith('"') && !o, c = e.endsWith("\\"), u = a || c, h = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
|
|
3033
3044
|
(!r || e.length > 70 || u || i || o);
|
|
3034
3045
|
let d = "";
|
|
3035
|
-
const f = r &&
|
|
3046
|
+
const f = r && Ke(e.charCodeAt(0));
|
|
3036
3047
|
return (h && !f || i) && (d += `
|
|
3037
3048
|
`), d += n, (h || u) && (d += `
|
|
3038
3049
|
`), '"""' + d + '"""';
|
|
@@ -3041,7 +3052,7 @@ var p;
|
|
|
3041
3052
|
(function(e) {
|
|
3042
3053
|
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
|
|
3043
3054
|
})(p || (p = {}));
|
|
3044
|
-
class
|
|
3055
|
+
class dr {
|
|
3045
3056
|
/**
|
|
3046
3057
|
* The previously focused non-ignored token.
|
|
3047
3058
|
*/
|
|
@@ -3078,20 +3089,20 @@ class ur {
|
|
|
3078
3089
|
if (t.next)
|
|
3079
3090
|
t = t.next;
|
|
3080
3091
|
else {
|
|
3081
|
-
const n =
|
|
3092
|
+
const n = hr(this, t.end);
|
|
3082
3093
|
t.next = n, n.prev = t, t = n;
|
|
3083
3094
|
}
|
|
3084
3095
|
while (t.kind === p.COMMENT);
|
|
3085
3096
|
return t;
|
|
3086
3097
|
}
|
|
3087
3098
|
}
|
|
3088
|
-
function
|
|
3099
|
+
function lr(e) {
|
|
3089
3100
|
return e === p.BANG || e === p.DOLLAR || e === p.AMP || e === p.PAREN_L || e === p.PAREN_R || e === p.SPREAD || e === p.COLON || e === p.EQUALS || e === p.AT || e === p.BRACKET_L || e === p.BRACKET_R || e === p.BRACE_L || e === p.PIPE || e === p.BRACE_R;
|
|
3090
3101
|
}
|
|
3091
3102
|
function re(e) {
|
|
3092
3103
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
3093
3104
|
}
|
|
3094
|
-
function
|
|
3105
|
+
function De(e, t) {
|
|
3095
3106
|
return fn(e.charCodeAt(t)) && pn(e.charCodeAt(t + 1));
|
|
3096
3107
|
}
|
|
3097
3108
|
function fn(e) {
|
|
@@ -3100,7 +3111,7 @@ function fn(e) {
|
|
|
3100
3111
|
function pn(e) {
|
|
3101
3112
|
return e >= 56320 && e <= 57343;
|
|
3102
3113
|
}
|
|
3103
|
-
function
|
|
3114
|
+
function Q(e, t) {
|
|
3104
3115
|
const n = e.source.body.codePointAt(t);
|
|
3105
3116
|
if (n === void 0)
|
|
3106
3117
|
return p.EOF;
|
|
@@ -3114,7 +3125,7 @@ function w(e, t, n, s, r) {
|
|
|
3114
3125
|
const i = e.line, o = 1 + n - e.lineStart;
|
|
3115
3126
|
return new un(t, n, s, i, o, r);
|
|
3116
3127
|
}
|
|
3117
|
-
function
|
|
3128
|
+
function hr(e, t) {
|
|
3118
3129
|
const n = e.source.body, s = n.length;
|
|
3119
3130
|
let r = t;
|
|
3120
3131
|
for (; r < s; ) {
|
|
@@ -3133,7 +3144,7 @@ function lr(e, t) {
|
|
|
3133
3144
|
n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
|
|
3134
3145
|
continue;
|
|
3135
3146
|
case 35:
|
|
3136
|
-
return
|
|
3147
|
+
return fr(e, r);
|
|
3137
3148
|
case 33:
|
|
3138
3149
|
return w(e, p.BANG, r, r + 1);
|
|
3139
3150
|
case 36:
|
|
@@ -3165,21 +3176,21 @@ function lr(e, t) {
|
|
|
3165
3176
|
case 125:
|
|
3166
3177
|
return w(e, p.BRACE_R, r, r + 1);
|
|
3167
3178
|
case 34:
|
|
3168
|
-
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ?
|
|
3179
|
+
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? vr(e, r) : yr(e, r);
|
|
3169
3180
|
}
|
|
3170
3181
|
if (de(i) || i === 45)
|
|
3171
|
-
return
|
|
3182
|
+
return pr(e, r, i);
|
|
3172
3183
|
if (hn(i))
|
|
3173
|
-
return
|
|
3184
|
+
return Tr(e, r);
|
|
3174
3185
|
throw b(
|
|
3175
3186
|
e.source,
|
|
3176
3187
|
r,
|
|
3177
|
-
i === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : re(i) ||
|
|
3188
|
+
i === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : re(i) || De(n, r) ? `Unexpected character: ${Q(e, r)}.` : `Invalid character: ${Q(e, r)}.`
|
|
3178
3189
|
);
|
|
3179
3190
|
}
|
|
3180
3191
|
return w(e, p.EOF, s, s);
|
|
3181
3192
|
}
|
|
3182
|
-
function
|
|
3193
|
+
function fr(e, t) {
|
|
3183
3194
|
const n = e.source.body, s = n.length;
|
|
3184
3195
|
let r = t + 1;
|
|
3185
3196
|
for (; r < s; ) {
|
|
@@ -3188,7 +3199,7 @@ function hr(e, t) {
|
|
|
3188
3199
|
break;
|
|
3189
3200
|
if (re(i))
|
|
3190
3201
|
++r;
|
|
3191
|
-
else if (
|
|
3202
|
+
else if (De(n, r))
|
|
3192
3203
|
r += 2;
|
|
3193
3204
|
else
|
|
3194
3205
|
break;
|
|
@@ -3201,7 +3212,7 @@ function hr(e, t) {
|
|
|
3201
3212
|
n.slice(t + 1, r)
|
|
3202
3213
|
);
|
|
3203
3214
|
}
|
|
3204
|
-
function
|
|
3215
|
+
function pr(e, t, n) {
|
|
3205
3216
|
const s = e.source.body;
|
|
3206
3217
|
let r = t, i = n, o = !1;
|
|
3207
3218
|
if (i === 45 && (i = s.charCodeAt(++r)), i === 48) {
|
|
@@ -3209,18 +3220,18 @@ function fr(e, t, n) {
|
|
|
3209
3220
|
throw b(
|
|
3210
3221
|
e.source,
|
|
3211
3222
|
r,
|
|
3212
|
-
`Invalid number, unexpected digit after 0: ${
|
|
3223
|
+
`Invalid number, unexpected digit after 0: ${Q(
|
|
3213
3224
|
e,
|
|
3214
3225
|
r
|
|
3215
3226
|
)}.`
|
|
3216
3227
|
);
|
|
3217
3228
|
} else
|
|
3218
|
-
r =
|
|
3219
|
-
if (i === 46 && (o = !0, i = s.charCodeAt(++r), r =
|
|
3229
|
+
r = Be(e, r, i), i = s.charCodeAt(r);
|
|
3230
|
+
if (i === 46 && (o = !0, i = s.charCodeAt(++r), r = Be(e, r, i), i = s.charCodeAt(r)), (i === 69 || i === 101) && (o = !0, i = s.charCodeAt(++r), (i === 43 || i === 45) && (i = s.charCodeAt(++r)), r = Be(e, r, i), i = s.charCodeAt(r)), i === 46 || hn(i))
|
|
3220
3231
|
throw b(
|
|
3221
3232
|
e.source,
|
|
3222
3233
|
r,
|
|
3223
|
-
`Invalid number, expected digit but got: ${
|
|
3234
|
+
`Invalid number, expected digit but got: ${Q(
|
|
3224
3235
|
e,
|
|
3225
3236
|
r
|
|
3226
3237
|
)}.`
|
|
@@ -3233,12 +3244,12 @@ function fr(e, t, n) {
|
|
|
3233
3244
|
s.slice(t, r)
|
|
3234
3245
|
);
|
|
3235
3246
|
}
|
|
3236
|
-
function
|
|
3247
|
+
function Be(e, t, n) {
|
|
3237
3248
|
if (!de(n))
|
|
3238
3249
|
throw b(
|
|
3239
3250
|
e.source,
|
|
3240
3251
|
t,
|
|
3241
|
-
`Invalid number, expected digit but got: ${
|
|
3252
|
+
`Invalid number, expected digit but got: ${Q(
|
|
3242
3253
|
e,
|
|
3243
3254
|
t
|
|
3244
3255
|
)}.`
|
|
@@ -3249,7 +3260,7 @@ function Ue(e, t, n) {
|
|
|
3249
3260
|
++r;
|
|
3250
3261
|
return r;
|
|
3251
3262
|
}
|
|
3252
|
-
function
|
|
3263
|
+
function yr(e, t) {
|
|
3253
3264
|
const n = e.source.body, s = n.length;
|
|
3254
3265
|
let r = t + 1, i = r, o = "";
|
|
3255
3266
|
for (; r < s; ) {
|
|
@@ -3258,7 +3269,7 @@ function pr(e, t) {
|
|
|
3258
3269
|
return o += n.slice(i, r), w(e, p.STRING, t, r + 1, o);
|
|
3259
3270
|
if (a === 92) {
|
|
3260
3271
|
o += n.slice(i, r);
|
|
3261
|
-
const c = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ?
|
|
3272
|
+
const c = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? mr(e, r) : gr(e, r) : Er(e, r);
|
|
3262
3273
|
o += c.value, r += c.size, i = r;
|
|
3263
3274
|
continue;
|
|
3264
3275
|
}
|
|
@@ -3266,13 +3277,13 @@ function pr(e, t) {
|
|
|
3266
3277
|
break;
|
|
3267
3278
|
if (re(a))
|
|
3268
3279
|
++r;
|
|
3269
|
-
else if (
|
|
3280
|
+
else if (De(n, r))
|
|
3270
3281
|
r += 2;
|
|
3271
3282
|
else
|
|
3272
3283
|
throw b(
|
|
3273
3284
|
e.source,
|
|
3274
3285
|
r,
|
|
3275
|
-
`Invalid character within String: ${
|
|
3286
|
+
`Invalid character within String: ${Q(
|
|
3276
3287
|
e,
|
|
3277
3288
|
r
|
|
3278
3289
|
)}.`
|
|
@@ -3280,7 +3291,7 @@ function pr(e, t) {
|
|
|
3280
3291
|
}
|
|
3281
3292
|
throw b(e.source, r, "Unterminated string.");
|
|
3282
3293
|
}
|
|
3283
|
-
function
|
|
3294
|
+
function mr(e, t) {
|
|
3284
3295
|
const n = e.source.body;
|
|
3285
3296
|
let s = 0, r = 3;
|
|
3286
3297
|
for (; r < 12; ) {
|
|
@@ -3305,7 +3316,7 @@ function yr(e, t) {
|
|
|
3305
3316
|
)}".`
|
|
3306
3317
|
);
|
|
3307
3318
|
}
|
|
3308
|
-
function
|
|
3319
|
+
function gr(e, t) {
|
|
3309
3320
|
const n = e.source.body, s = Rt(n, t + 2);
|
|
3310
3321
|
if (re(s))
|
|
3311
3322
|
return {
|
|
@@ -3332,7 +3343,7 @@ function Rt(e, t) {
|
|
|
3332
3343
|
function ae(e) {
|
|
3333
3344
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
3334
3345
|
}
|
|
3335
|
-
function
|
|
3346
|
+
function Er(e, t) {
|
|
3336
3347
|
const n = e.source.body;
|
|
3337
3348
|
switch (n.charCodeAt(t + 1)) {
|
|
3338
3349
|
case 34:
|
|
@@ -3386,7 +3397,7 @@ function gr(e, t) {
|
|
|
3386
3397
|
)}".`
|
|
3387
3398
|
);
|
|
3388
3399
|
}
|
|
3389
|
-
function
|
|
3400
|
+
function vr(e, t) {
|
|
3390
3401
|
const n = e.source.body, s = n.length;
|
|
3391
3402
|
let r = e.lineStart, i = t + 3, o = i, a = "";
|
|
3392
3403
|
const c = [];
|
|
@@ -3400,7 +3411,7 @@ function Er(e, t) {
|
|
|
3400
3411
|
t,
|
|
3401
3412
|
i + 3,
|
|
3402
3413
|
// Return a string of the lines joined with U+000A.
|
|
3403
|
-
|
|
3414
|
+
ar(c).join(`
|
|
3404
3415
|
`)
|
|
3405
3416
|
);
|
|
3406
3417
|
return e.line += c.length - 1, e.lineStart = r, h;
|
|
@@ -3415,13 +3426,13 @@ function Er(e, t) {
|
|
|
3415
3426
|
}
|
|
3416
3427
|
if (re(u))
|
|
3417
3428
|
++i;
|
|
3418
|
-
else if (
|
|
3429
|
+
else if (De(n, i))
|
|
3419
3430
|
i += 2;
|
|
3420
3431
|
else
|
|
3421
3432
|
throw b(
|
|
3422
3433
|
e.source,
|
|
3423
3434
|
i,
|
|
3424
|
-
`Invalid character within String: ${
|
|
3435
|
+
`Invalid character within String: ${Q(
|
|
3425
3436
|
e,
|
|
3426
3437
|
i
|
|
3427
3438
|
)}.`
|
|
@@ -3429,12 +3440,12 @@ function Er(e, t) {
|
|
|
3429
3440
|
}
|
|
3430
3441
|
throw b(e.source, i, "Unterminated string.");
|
|
3431
3442
|
}
|
|
3432
|
-
function
|
|
3443
|
+
function Tr(e, t) {
|
|
3433
3444
|
const n = e.source.body, s = n.length;
|
|
3434
3445
|
let r = t + 1;
|
|
3435
3446
|
for (; r < s; ) {
|
|
3436
3447
|
const i = n.charCodeAt(r);
|
|
3437
|
-
if (
|
|
3448
|
+
if (or(i))
|
|
3438
3449
|
++r;
|
|
3439
3450
|
else
|
|
3440
3451
|
break;
|
|
@@ -3447,56 +3458,56 @@ function vr(e, t) {
|
|
|
3447
3458
|
n.slice(t, r)
|
|
3448
3459
|
);
|
|
3449
3460
|
}
|
|
3450
|
-
const
|
|
3461
|
+
const _r = 10, yn = 2;
|
|
3451
3462
|
function ht(e) {
|
|
3452
|
-
return
|
|
3463
|
+
return Re(e, []);
|
|
3453
3464
|
}
|
|
3454
|
-
function
|
|
3465
|
+
function Re(e, t) {
|
|
3455
3466
|
switch (typeof e) {
|
|
3456
3467
|
case "string":
|
|
3457
3468
|
return JSON.stringify(e);
|
|
3458
3469
|
case "function":
|
|
3459
3470
|
return e.name ? `[function ${e.name}]` : "[function]";
|
|
3460
3471
|
case "object":
|
|
3461
|
-
return
|
|
3472
|
+
return Sr(e, t);
|
|
3462
3473
|
default:
|
|
3463
3474
|
return String(e);
|
|
3464
3475
|
}
|
|
3465
3476
|
}
|
|
3466
|
-
function
|
|
3477
|
+
function Sr(e, t) {
|
|
3467
3478
|
if (e === null)
|
|
3468
3479
|
return "null";
|
|
3469
3480
|
if (t.includes(e))
|
|
3470
3481
|
return "[Circular]";
|
|
3471
3482
|
const n = [...t, e];
|
|
3472
|
-
if (
|
|
3483
|
+
if (Ir(e)) {
|
|
3473
3484
|
const s = e.toJSON();
|
|
3474
3485
|
if (s !== e)
|
|
3475
|
-
return typeof s == "string" ? s :
|
|
3486
|
+
return typeof s == "string" ? s : Re(s, n);
|
|
3476
3487
|
} else if (Array.isArray(e))
|
|
3477
|
-
return
|
|
3478
|
-
return
|
|
3488
|
+
return xr(e, n);
|
|
3489
|
+
return Ar(e, n);
|
|
3479
3490
|
}
|
|
3480
|
-
function
|
|
3491
|
+
function Ir(e) {
|
|
3481
3492
|
return typeof e.toJSON == "function";
|
|
3482
3493
|
}
|
|
3483
|
-
function
|
|
3494
|
+
function Ar(e, t) {
|
|
3484
3495
|
const n = Object.entries(e);
|
|
3485
|
-
return n.length === 0 ? "{}" : t.length > yn ? "[" +
|
|
3486
|
-
([r, i]) => r + ": " +
|
|
3496
|
+
return n.length === 0 ? "{}" : t.length > yn ? "[" + wr(e) + "]" : "{ " + n.map(
|
|
3497
|
+
([r, i]) => r + ": " + Re(i, t)
|
|
3487
3498
|
).join(", ") + " }";
|
|
3488
3499
|
}
|
|
3489
|
-
function
|
|
3500
|
+
function xr(e, t) {
|
|
3490
3501
|
if (e.length === 0)
|
|
3491
3502
|
return "[]";
|
|
3492
3503
|
if (t.length > yn)
|
|
3493
3504
|
return "[Array]";
|
|
3494
|
-
const n = Math.min(
|
|
3505
|
+
const n = Math.min(_r, e.length), s = e.length - n, r = [];
|
|
3495
3506
|
for (let i = 0; i < n; ++i)
|
|
3496
|
-
r.push(
|
|
3507
|
+
r.push(Re(e[i], t));
|
|
3497
3508
|
return s === 1 ? r.push("... 1 more item") : s > 1 && r.push(`... ${s} more items`), "[" + r.join(", ") + "]";
|
|
3498
3509
|
}
|
|
3499
|
-
function
|
|
3510
|
+
function wr(e) {
|
|
3500
3511
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
3501
3512
|
if (t === "Object" && typeof e.constructor == "function") {
|
|
3502
3513
|
const n = e.constructor.name;
|
|
@@ -3505,10 +3516,11 @@ function xr(e) {
|
|
|
3505
3516
|
}
|
|
3506
3517
|
return t;
|
|
3507
3518
|
}
|
|
3508
|
-
const
|
|
3519
|
+
const br = globalThis.process && // eslint-disable-next-line no-undef
|
|
3520
|
+
process.env.NODE_ENV === "production", Nr = (
|
|
3509
3521
|
/* c8 ignore next 6 */
|
|
3510
3522
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
3511
|
-
|
|
3523
|
+
br ? function(t, n) {
|
|
3512
3524
|
return t instanceof n;
|
|
3513
3525
|
} : function(t, n) {
|
|
3514
3526
|
if (t instanceof n)
|
|
@@ -3555,16 +3567,16 @@ class mn {
|
|
|
3555
3567
|
return "Source";
|
|
3556
3568
|
}
|
|
3557
3569
|
}
|
|
3558
|
-
function
|
|
3559
|
-
return
|
|
3570
|
+
function Or(e) {
|
|
3571
|
+
return Nr(e, mn);
|
|
3560
3572
|
}
|
|
3561
|
-
function
|
|
3562
|
-
return new
|
|
3573
|
+
function Cr(e, t) {
|
|
3574
|
+
return new kr(e, t).parseDocument();
|
|
3563
3575
|
}
|
|
3564
|
-
class
|
|
3576
|
+
class kr {
|
|
3565
3577
|
constructor(t, n = {}) {
|
|
3566
|
-
const s =
|
|
3567
|
-
this._lexer = new
|
|
3578
|
+
const s = Or(t) ? t : new mn(t);
|
|
3579
|
+
this._lexer = new dr(s), this._options = n, this._tokenCounter = 0;
|
|
3568
3580
|
}
|
|
3569
3581
|
/**
|
|
3570
3582
|
* Converts a name lex token into a name parse node.
|
|
@@ -4520,7 +4532,7 @@ class Or {
|
|
|
4520
4532
|
*/
|
|
4521
4533
|
parseDirectiveLocation() {
|
|
4522
4534
|
const t = this._lexer.token, n = this.parseName();
|
|
4523
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
4535
|
+
if (Object.prototype.hasOwnProperty.call(We, n.value))
|
|
4524
4536
|
return n;
|
|
4525
4537
|
throw this.unexpected(t);
|
|
4526
4538
|
}
|
|
@@ -4531,7 +4543,7 @@ class Or {
|
|
|
4531
4543
|
* given parsed object.
|
|
4532
4544
|
*/
|
|
4533
4545
|
node(t, n) {
|
|
4534
|
-
return this._options.noLocation !== !0 && (n.loc = new
|
|
4546
|
+
return this._options.noLocation !== !0 && (n.loc = new rr(
|
|
4535
4547
|
t,
|
|
4536
4548
|
this._lexer.lastToken,
|
|
4537
4549
|
this._lexer.source
|
|
@@ -4667,16 +4679,16 @@ function ge(e) {
|
|
|
4667
4679
|
return gn(e.kind) + (t != null ? ` "${t}"` : "");
|
|
4668
4680
|
}
|
|
4669
4681
|
function gn(e) {
|
|
4670
|
-
return
|
|
4671
|
-
}
|
|
4672
|
-
function Cr(e) {
|
|
4673
|
-
return `"${e.replace(kr, Dr)}"`;
|
|
4682
|
+
return lr(e) ? `"${e}"` : e;
|
|
4674
4683
|
}
|
|
4675
|
-
const kr = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
4676
4684
|
function Dr(e) {
|
|
4677
|
-
return
|
|
4685
|
+
return `"${e.replace(Rr, qr)}"`;
|
|
4678
4686
|
}
|
|
4679
|
-
const Rr = [
|
|
4687
|
+
const Rr = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
4688
|
+
function qr(e) {
|
|
4689
|
+
return Mr[e.charCodeAt(0)];
|
|
4690
|
+
}
|
|
4691
|
+
const Mr = [
|
|
4680
4692
|
"\\u0000",
|
|
4681
4693
|
"\\u0001",
|
|
4682
4694
|
"\\u0002",
|
|
@@ -4842,11 +4854,11 @@ const Rr = [
|
|
|
4842
4854
|
"\\u009D",
|
|
4843
4855
|
"\\u009E",
|
|
4844
4856
|
"\\u009F"
|
|
4845
|
-
],
|
|
4846
|
-
function
|
|
4857
|
+
], Lr = Object.freeze({});
|
|
4858
|
+
function Ur(e, t, n = dn) {
|
|
4847
4859
|
const s = /* @__PURE__ */ new Map();
|
|
4848
4860
|
for (const x of Object.values(T))
|
|
4849
|
-
s.set(x,
|
|
4861
|
+
s.set(x, Pr(t, x));
|
|
4850
4862
|
let r, i = Array.isArray(e), o = [e], a = -1, c = [], u = e, h, d;
|
|
4851
4863
|
const f = [], m = [];
|
|
4852
4864
|
do {
|
|
@@ -4880,7 +4892,7 @@ function Mr(e, t, n = dn) {
|
|
|
4880
4892
|
var y, v;
|
|
4881
4893
|
Dt(u) || ve(!1, `Invalid AST Node: ${ht(u)}.`);
|
|
4882
4894
|
const q = x ? (y = s.get(u.kind)) === null || y === void 0 ? void 0 : y.leave : (v = s.get(u.kind)) === null || v === void 0 ? void 0 : v.enter;
|
|
4883
|
-
if (k = q == null ? void 0 : q.call(t, u, h, d, f, m), k ===
|
|
4895
|
+
if (k = q == null ? void 0 : q.call(t, u, h, d, f, m), k === Lr)
|
|
4884
4896
|
break;
|
|
4885
4897
|
if (k === !1) {
|
|
4886
4898
|
if (!x) {
|
|
@@ -4910,7 +4922,7 @@ function Mr(e, t, n = dn) {
|
|
|
4910
4922
|
} while (r !== void 0);
|
|
4911
4923
|
return c.length !== 0 ? c[c.length - 1][1] : e;
|
|
4912
4924
|
}
|
|
4913
|
-
function
|
|
4925
|
+
function Pr(e, t) {
|
|
4914
4926
|
const n = e[t];
|
|
4915
4927
|
return typeof n == "object" ? n : typeof n == "function" ? {
|
|
4916
4928
|
enter: n,
|
|
@@ -4921,9 +4933,9 @@ function Lr(e, t) {
|
|
|
4921
4933
|
};
|
|
4922
4934
|
}
|
|
4923
4935
|
function En(e) {
|
|
4924
|
-
return
|
|
4936
|
+
return Ur(e, Br);
|
|
4925
4937
|
}
|
|
4926
|
-
const
|
|
4938
|
+
const Fr = 80, Br = {
|
|
4927
4939
|
Name: {
|
|
4928
4940
|
leave: (e) => e.value
|
|
4929
4941
|
},
|
|
@@ -4959,7 +4971,7 @@ const Pr = 80, Ur = {
|
|
|
4959
4971
|
leave({ alias: e, name: t, arguments: n, directives: s, selectionSet: r }) {
|
|
4960
4972
|
const i = S("", e, ": ") + t;
|
|
4961
4973
|
let o = i + S("(", E(n, ", "), ")");
|
|
4962
|
-
return o.length >
|
|
4974
|
+
return o.length > Fr && (o = i + S(`(
|
|
4963
4975
|
`, Te(E(n, `
|
|
4964
4976
|
`)), `
|
|
4965
4977
|
)`)), E([o, E(s, " "), r], " ");
|
|
@@ -4997,7 +5009,7 @@ const Pr = 80, Ur = {
|
|
|
4997
5009
|
leave: ({ value: e }) => e
|
|
4998
5010
|
},
|
|
4999
5011
|
StringValue: {
|
|
5000
|
-
leave: ({ value: e, block: t }) => t ?
|
|
5012
|
+
leave: ({ value: e, block: t }) => t ? ur(e) : Dr(e)
|
|
5001
5013
|
},
|
|
5002
5014
|
BooleanValue: {
|
|
5003
5015
|
leave: ({ value: e }) => e ? "true" : "false"
|
|
@@ -5187,11 +5199,11 @@ const Mt = (e) => {
|
|
|
5187
5199
|
let t;
|
|
5188
5200
|
const n = e.definitions.filter((i) => i.kind === "OperationDefinition");
|
|
5189
5201
|
return n.length === 1 && (t = (r = (s = n[0]) == null ? void 0 : s.name) == null ? void 0 : r.value), t;
|
|
5190
|
-
},
|
|
5202
|
+
}, je = (e) => {
|
|
5191
5203
|
if (typeof e == "string") {
|
|
5192
5204
|
let n;
|
|
5193
5205
|
try {
|
|
5194
|
-
const s =
|
|
5206
|
+
const s = Cr(e);
|
|
5195
5207
|
n = Mt(s);
|
|
5196
5208
|
} catch {
|
|
5197
5209
|
}
|
|
@@ -5213,13 +5225,13 @@ class ce extends Error {
|
|
|
5213
5225
|
return ((s = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : s.message) ?? `GraphQL Error (Code: ${t.status})`;
|
|
5214
5226
|
}
|
|
5215
5227
|
}
|
|
5216
|
-
var
|
|
5217
|
-
function
|
|
5228
|
+
var jr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
5229
|
+
function $r(e) {
|
|
5218
5230
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
5219
5231
|
}
|
|
5220
|
-
var
|
|
5232
|
+
var Ze = { exports: {} };
|
|
5221
5233
|
(function(e, t) {
|
|
5222
|
-
var n = typeof self < "u" ? self :
|
|
5234
|
+
var n = typeof self < "u" ? self : jr, s = function() {
|
|
5223
5235
|
function i() {
|
|
5224
5236
|
this.fetch = !1, this.DOMException = n.DOMException;
|
|
5225
5237
|
}
|
|
@@ -5339,8 +5351,8 @@ var We = { exports: {} };
|
|
|
5339
5351
|
return g.readAsText(l), _;
|
|
5340
5352
|
}
|
|
5341
5353
|
function k(l) {
|
|
5342
|
-
for (var g = new Uint8Array(l), _ = new Array(g.length),
|
|
5343
|
-
_[
|
|
5354
|
+
for (var g = new Uint8Array(l), _ = new Array(g.length), C = 0; C < g.length; C++)
|
|
5355
|
+
_[C] = String.fromCharCode(g[C]);
|
|
5344
5356
|
return _.join("");
|
|
5345
5357
|
}
|
|
5346
5358
|
function q(l) {
|
|
@@ -5407,15 +5419,15 @@ var We = { exports: {} };
|
|
|
5407
5419
|
var g = new FormData();
|
|
5408
5420
|
return l.trim().split("&").forEach(function(_) {
|
|
5409
5421
|
if (_) {
|
|
5410
|
-
var
|
|
5422
|
+
var C = _.split("="), N = C.shift().replace(/\+/g, " "), A = C.join("=").replace(/\+/g, " ");
|
|
5411
5423
|
g.append(decodeURIComponent(N), decodeURIComponent(A));
|
|
5412
5424
|
}
|
|
5413
5425
|
}), g;
|
|
5414
5426
|
}
|
|
5415
5427
|
function pe(l) {
|
|
5416
5428
|
var g = new y(), _ = l.replace(/\r?\n[\t ]+/g, " ");
|
|
5417
|
-
return _.split(/\r?\n/).forEach(function(
|
|
5418
|
-
var N =
|
|
5429
|
+
return _.split(/\r?\n/).forEach(function(C) {
|
|
5430
|
+
var N = C.split(":"), A = N.shift().trim();
|
|
5419
5431
|
if (A) {
|
|
5420
5432
|
var ye = N.join(":").trim();
|
|
5421
5433
|
g.append(A, ye);
|
|
@@ -5423,40 +5435,40 @@ var We = { exports: {} };
|
|
|
5423
5435
|
}), g;
|
|
5424
5436
|
}
|
|
5425
5437
|
F.call(L.prototype);
|
|
5426
|
-
function
|
|
5438
|
+
function U(l, g) {
|
|
5427
5439
|
g || (g = {}), this.type = "default", this.status = g.status === void 0 ? 200 : g.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in g ? g.statusText : "OK", this.headers = new y(g.headers), this.url = g.url || "", this._initBody(l);
|
|
5428
5440
|
}
|
|
5429
|
-
F.call(
|
|
5430
|
-
return new
|
|
5441
|
+
F.call(U.prototype), U.prototype.clone = function() {
|
|
5442
|
+
return new U(this._bodyInit, {
|
|
5431
5443
|
status: this.status,
|
|
5432
5444
|
statusText: this.statusText,
|
|
5433
5445
|
headers: new y(this.headers),
|
|
5434
5446
|
url: this.url
|
|
5435
5447
|
});
|
|
5436
|
-
},
|
|
5437
|
-
var l = new
|
|
5448
|
+
}, U.error = function() {
|
|
5449
|
+
var l = new U(null, { status: 0, statusText: "" });
|
|
5438
5450
|
return l.type = "error", l;
|
|
5439
5451
|
};
|
|
5440
5452
|
var In = [301, 302, 303, 307, 308];
|
|
5441
|
-
|
|
5453
|
+
U.redirect = function(l, g) {
|
|
5442
5454
|
if (In.indexOf(g) === -1)
|
|
5443
5455
|
throw new RangeError("Invalid status code");
|
|
5444
|
-
return new
|
|
5456
|
+
return new U(null, { status: g, headers: { location: l } });
|
|
5445
5457
|
}, o.DOMException = i.DOMException;
|
|
5446
5458
|
try {
|
|
5447
5459
|
new o.DOMException();
|
|
5448
5460
|
} catch {
|
|
5449
5461
|
o.DOMException = function(g, _) {
|
|
5450
5462
|
this.message = g, this.name = _;
|
|
5451
|
-
var
|
|
5452
|
-
this.stack =
|
|
5463
|
+
var C = Error(g);
|
|
5464
|
+
this.stack = C.stack;
|
|
5453
5465
|
}, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
|
|
5454
5466
|
}
|
|
5455
|
-
function
|
|
5456
|
-
return new Promise(function(_,
|
|
5467
|
+
function Me(l, g) {
|
|
5468
|
+
return new Promise(function(_, C) {
|
|
5457
5469
|
var N = new L(l, g);
|
|
5458
5470
|
if (N.signal && N.signal.aborted)
|
|
5459
|
-
return
|
|
5471
|
+
return C(new o.DOMException("Aborted", "AbortError"));
|
|
5460
5472
|
var A = new XMLHttpRequest();
|
|
5461
5473
|
function ye() {
|
|
5462
5474
|
A.abort();
|
|
@@ -5468,37 +5480,37 @@ var We = { exports: {} };
|
|
|
5468
5480
|
headers: pe(A.getAllResponseHeaders() || "")
|
|
5469
5481
|
};
|
|
5470
5482
|
ie.url = "responseURL" in A ? A.responseURL : ie.headers.get("X-Request-URL");
|
|
5471
|
-
var
|
|
5472
|
-
_(new
|
|
5483
|
+
var Le = "response" in A ? A.response : A.responseText;
|
|
5484
|
+
_(new U(Le, ie));
|
|
5473
5485
|
}, A.onerror = function() {
|
|
5474
|
-
|
|
5486
|
+
C(new TypeError("Network request failed"));
|
|
5475
5487
|
}, A.ontimeout = function() {
|
|
5476
|
-
|
|
5488
|
+
C(new TypeError("Network request failed"));
|
|
5477
5489
|
}, A.onabort = function() {
|
|
5478
|
-
|
|
5479
|
-
}, A.open(N.method, N.url, !0), N.credentials === "include" ? A.withCredentials = !0 : N.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && a.blob && (A.responseType = "blob"), N.headers.forEach(function(ie,
|
|
5480
|
-
A.setRequestHeader(
|
|
5490
|
+
C(new o.DOMException("Aborted", "AbortError"));
|
|
5491
|
+
}, A.open(N.method, N.url, !0), N.credentials === "include" ? A.withCredentials = !0 : N.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && a.blob && (A.responseType = "blob"), N.headers.forEach(function(ie, Le) {
|
|
5492
|
+
A.setRequestHeader(Le, ie);
|
|
5481
5493
|
}), N.signal && (N.signal.addEventListener("abort", ye), A.onreadystatechange = function() {
|
|
5482
5494
|
A.readyState === 4 && N.signal.removeEventListener("abort", ye);
|
|
5483
5495
|
}), A.send(typeof N._bodyInit > "u" ? null : N._bodyInit);
|
|
5484
5496
|
});
|
|
5485
5497
|
}
|
|
5486
|
-
return
|
|
5498
|
+
return Me.polyfill = !0, i.fetch || (i.fetch = Me, i.Headers = y, i.Request = L, i.Response = U), o.Headers = y, o.Request = L, o.Response = U, o.fetch = Me, Object.defineProperty(o, "__esModule", { value: !0 }), o;
|
|
5487
5499
|
})({});
|
|
5488
5500
|
})(s), s.fetch.ponyfill = !0, delete s.fetch.polyfill;
|
|
5489
5501
|
var r = s;
|
|
5490
5502
|
t = r.fetch, t.default = r.fetch, t.fetch = r.fetch, t.Headers = r.Headers, t.Request = r.Request, t.Response = r.Response, e.exports = t;
|
|
5491
|
-
})(
|
|
5492
|
-
var xe =
|
|
5493
|
-
const _e = /* @__PURE__ */
|
|
5503
|
+
})(Ze, Ze.exports);
|
|
5504
|
+
var xe = Ze.exports;
|
|
5505
|
+
const _e = /* @__PURE__ */ $r(xe), Vr = /* @__PURE__ */ xn({
|
|
5494
5506
|
__proto__: null,
|
|
5495
5507
|
default: _e
|
|
5496
5508
|
}, [xe]), W = (e) => {
|
|
5497
5509
|
let t = {};
|
|
5498
|
-
return e && (typeof Headers < "u" && e instanceof Headers ||
|
|
5510
|
+
return e && (typeof Headers < "u" && e instanceof Headers || Vr && xe.Headers && e instanceof xe.Headers ? t = Ys(e) : Array.isArray(e) ? e.forEach(([n, s]) => {
|
|
5499
5511
|
n && s !== void 0 && (t[n] = s);
|
|
5500
5512
|
}) : t = e), t;
|
|
5501
|
-
}, Lt = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(),
|
|
5513
|
+
}, Lt = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Hr = (e) => {
|
|
5502
5514
|
if (!Array.isArray(e.query)) {
|
|
5503
5515
|
const s = e, r = [`query=${encodeURIComponent(Lt(s.query))}`];
|
|
5504
5516
|
return e.variables && r.push(`variables=${encodeURIComponent(s.jsonSerializer.stringify(s.variables))}`), s.operationName && r.push(`operationName=${encodeURIComponent(s.operationName)}`), r.join("&");
|
|
@@ -5510,10 +5522,10 @@ const _e = /* @__PURE__ */ Br(xe), jr = /* @__PURE__ */ xn({
|
|
|
5510
5522
|
variables: t.variables ? t.jsonSerializer.stringify(t.variables[i]) : void 0
|
|
5511
5523
|
}), s), []);
|
|
5512
5524
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
5513
|
-
},
|
|
5525
|
+
}, zr = (e) => async (t) => {
|
|
5514
5526
|
const { url: n, query: s, variables: r, operationName: i, fetch: o, fetchOptions: a, middleware: c } = t, u = { ...t.headers };
|
|
5515
5527
|
let h = "", d;
|
|
5516
|
-
e === "POST" ? (d =
|
|
5528
|
+
e === "POST" ? (d = Gr(s, r, i, a.jsonSerializer), typeof d == "string" && (u["Content-Type"] = "application/json")) : h = Hr({
|
|
5517
5529
|
query: s,
|
|
5518
5530
|
variables: r,
|
|
5519
5531
|
operationName: i,
|
|
@@ -5537,13 +5549,13 @@ class vn {
|
|
|
5537
5549
|
this.url = t, this.requestConfig = n, this.rawRequest = async (...s) => {
|
|
5538
5550
|
const [r, i, o] = s, a = Xs(r, i, o), { headers: c, fetch: u = _e, method: h = "POST", requestMiddleware: d, responseMiddleware: f, ...m } = this.requestConfig, { url: y } = this;
|
|
5539
5551
|
a.signal !== void 0 && (m.signal = a.signal);
|
|
5540
|
-
const { operationName: v } =
|
|
5541
|
-
return
|
|
5552
|
+
const { operationName: v } = je(a.query);
|
|
5553
|
+
return $e({
|
|
5542
5554
|
url: y,
|
|
5543
5555
|
query: a.query,
|
|
5544
5556
|
variables: a.variables,
|
|
5545
5557
|
headers: {
|
|
5546
|
-
...W(
|
|
5558
|
+
...W(Ve(c)),
|
|
5547
5559
|
...W(a.requestHeaders)
|
|
5548
5560
|
},
|
|
5549
5561
|
operationName: v,
|
|
@@ -5557,15 +5569,15 @@ class vn {
|
|
|
5557
5569
|
};
|
|
5558
5570
|
}
|
|
5559
5571
|
async request(t, ...n) {
|
|
5560
|
-
const [s, r] = n, i =
|
|
5572
|
+
const [s, r] = n, i = Qs(t, s, r), { headers: o, fetch: a = _e, method: c = "POST", requestMiddleware: u, responseMiddleware: h, ...d } = this.requestConfig, { url: f } = this;
|
|
5561
5573
|
i.signal !== void 0 && (d.signal = i.signal);
|
|
5562
|
-
const { query: m, operationName: y } =
|
|
5563
|
-
return
|
|
5574
|
+
const { query: m, operationName: y } = je(i.document);
|
|
5575
|
+
return $e({
|
|
5564
5576
|
url: f,
|
|
5565
5577
|
query: m,
|
|
5566
5578
|
variables: i.variables,
|
|
5567
5579
|
headers: {
|
|
5568
|
-
...W(
|
|
5580
|
+
...W(Ve(o)),
|
|
5569
5581
|
...W(i.requestHeaders)
|
|
5570
5582
|
},
|
|
5571
5583
|
operationName: y,
|
|
@@ -5579,16 +5591,16 @@ class vn {
|
|
|
5579
5591
|
}
|
|
5580
5592
|
// prettier-ignore
|
|
5581
5593
|
batchRequests(t, n) {
|
|
5582
|
-
const s =
|
|
5594
|
+
const s = Ws(t, n), { headers: r, ...i } = this.requestConfig;
|
|
5583
5595
|
s.signal !== void 0 && (i.signal = s.signal);
|
|
5584
|
-
const o = s.documents.map(({ document: c }) =>
|
|
5585
|
-
return
|
|
5596
|
+
const o = s.documents.map(({ document: c }) => je(c).query), a = s.documents.map(({ variables: c }) => c);
|
|
5597
|
+
return $e({
|
|
5586
5598
|
url: this.url,
|
|
5587
5599
|
query: o,
|
|
5588
5600
|
// @ts-expect-error TODO reconcile batch variables into system.
|
|
5589
5601
|
variables: a,
|
|
5590
5602
|
headers: {
|
|
5591
|
-
...W(
|
|
5603
|
+
...W(Ve(r)),
|
|
5592
5604
|
...W(s.requestHeaders)
|
|
5593
5605
|
},
|
|
5594
5606
|
operationName: void 0,
|
|
@@ -5617,8 +5629,8 @@ class vn {
|
|
|
5617
5629
|
return this.url = t, this;
|
|
5618
5630
|
}
|
|
5619
5631
|
}
|
|
5620
|
-
const
|
|
5621
|
-
const { query: t, variables: n, fetchOptions: s } = e, r =
|
|
5632
|
+
const $e = async (e) => {
|
|
5633
|
+
const { query: t, variables: n, fetchOptions: s } = e, r = zr(Js(e.method ?? "post")), i = Array.isArray(e.query), o = await r(e), a = await Jr(o, s.jsonSerializer ?? dt), c = Array.isArray(a) ? !a.some(({ data: h }) => !h) : !!a.data, u = Array.isArray(a) || !a.errors || Array.isArray(a.errors) && !a.errors.length || s.errorPolicy === "all" || s.errorPolicy === "ignore";
|
|
5622
5634
|
if (o.ok && u && c) {
|
|
5623
5635
|
const { errors: h, ...d } = (Array.isArray(a), a), f = s.errorPolicy === "ignore" ? d : a;
|
|
5624
5636
|
return {
|
|
@@ -5637,13 +5649,13 @@ const Be = async (e) => {
|
|
|
5637
5649
|
);
|
|
5638
5650
|
}
|
|
5639
5651
|
};
|
|
5640
|
-
async function
|
|
5641
|
-
const s =
|
|
5652
|
+
async function qe(e, t, ...n) {
|
|
5653
|
+
const s = Ks(e, t, ...n);
|
|
5642
5654
|
return new vn(s.url).request({
|
|
5643
5655
|
...s
|
|
5644
5656
|
});
|
|
5645
5657
|
}
|
|
5646
|
-
const
|
|
5658
|
+
const Gr = (e, t, n, s) => {
|
|
5647
5659
|
const r = s ?? dt;
|
|
5648
5660
|
if (!Array.isArray(e))
|
|
5649
5661
|
return r.stringify({ query: e, variables: t, operationName: n });
|
|
@@ -5651,12 +5663,12 @@ const Hr = (e, t, n, s) => {
|
|
|
5651
5663
|
throw new Error("Cannot create request body with given variable type, array expected");
|
|
5652
5664
|
const i = e.reduce((o, a, c) => (o.push({ query: a, variables: t ? t[c] : void 0 }), o), []);
|
|
5653
5665
|
return r.stringify(i);
|
|
5654
|
-
},
|
|
5666
|
+
}, Jr = async (e, t) => {
|
|
5655
5667
|
let n;
|
|
5656
5668
|
return e.headers.forEach((s, r) => {
|
|
5657
5669
|
r.toLowerCase() === "content-type" && (n = s);
|
|
5658
5670
|
}), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
|
|
5659
|
-
},
|
|
5671
|
+
}, Ve = (e) => typeof e == "function" ? e() : e, Yr = V(async ({ input: e }) => {
|
|
5660
5672
|
var t;
|
|
5661
5673
|
if (!e.endpoint || e.endpoint === "")
|
|
5662
5674
|
throw new Error("No endpoint provided.");
|
|
@@ -5667,7 +5679,7 @@ const Hr = (e, t, n, s) => {
|
|
|
5667
5679
|
if (!e.requestHeaders)
|
|
5668
5680
|
throw new Error("No request headers provided.");
|
|
5669
5681
|
try {
|
|
5670
|
-
const n = await
|
|
5682
|
+
const n = await qe(
|
|
5671
5683
|
e.endpoint,
|
|
5672
5684
|
e.document,
|
|
5673
5685
|
{
|
|
@@ -5688,15 +5700,18 @@ const Hr = (e, t, n, s) => {
|
|
|
5688
5700
|
} catch {
|
|
5689
5701
|
throw console.log("Request to add submit step data failed."), new Error("Request to add submit step data failed.");
|
|
5690
5702
|
}
|
|
5691
|
-
}),
|
|
5703
|
+
}), Qr = ({ context: e }) => Object.keys(e.quote).length > 0, Ut = he({
|
|
5692
5704
|
types: {
|
|
5693
5705
|
context: {},
|
|
5694
5706
|
events: {},
|
|
5695
5707
|
input: {}
|
|
5696
5708
|
},
|
|
5697
|
-
actions: {
|
|
5698
|
-
|
|
5699
|
-
|
|
5709
|
+
actions: {
|
|
5710
|
+
nextStep: O(zs),
|
|
5711
|
+
updateQuote: O(Gs)
|
|
5712
|
+
},
|
|
5713
|
+
actors: { submitStepData: Yr },
|
|
5714
|
+
guards: { quoteExists: Qr }
|
|
5700
5715
|
}).createMachine({
|
|
5701
5716
|
/** @todo do we need to add the view to the id? (e.g. checkout_en-us) */
|
|
5702
5717
|
id: "checkout",
|
|
@@ -5792,7 +5807,7 @@ const Hr = (e, t, n, s) => {
|
|
|
5792
5807
|
* how to handle quote and checkout being synced here?
|
|
5793
5808
|
*/
|
|
5794
5809
|
// actions: ['updateQuote', 'updateCheckout', 'nextStep'],
|
|
5795
|
-
actions: ["nextStep"],
|
|
5810
|
+
actions: ["updateQuote", "nextStep"],
|
|
5796
5811
|
target: "showStep"
|
|
5797
5812
|
}
|
|
5798
5813
|
],
|
|
@@ -5832,12 +5847,12 @@ const Hr = (e, t, n, s) => {
|
|
|
5832
5847
|
// SYNC_IS_LOGGED_IN: '.syncIsLoggedIn',
|
|
5833
5848
|
// SYNC_QUOTE: '.syncQuote',
|
|
5834
5849
|
// },
|
|
5835
|
-
}), Tn = be({}),
|
|
5850
|
+
}), Tn = be({}), mi = () => {
|
|
5836
5851
|
const e = Ne(Tn);
|
|
5837
5852
|
if (!e || !e.getSnapshot)
|
|
5838
5853
|
throw new Error("checkoutActor is not properly initialized");
|
|
5839
|
-
const [t, n] =
|
|
5840
|
-
|
|
5854
|
+
const [t, n] = Oe(() => e.getSnapshot());
|
|
5855
|
+
Ce(() => {
|
|
5841
5856
|
if (!e || !e.getSnapshot) {
|
|
5842
5857
|
console.error("checkoutActor is not properly initialized");
|
|
5843
5858
|
return;
|
|
@@ -5857,7 +5872,7 @@ const Hr = (e, t, n, s) => {
|
|
|
5857
5872
|
checkoutActor: e,
|
|
5858
5873
|
currentStep: s
|
|
5859
5874
|
};
|
|
5860
|
-
},
|
|
5875
|
+
}, gi = async (e = {
|
|
5861
5876
|
inspect: void 0,
|
|
5862
5877
|
currentStep: "",
|
|
5863
5878
|
steps: [],
|
|
@@ -5866,14 +5881,14 @@ const Hr = (e, t, n, s) => {
|
|
|
5866
5881
|
graphql: {}
|
|
5867
5882
|
}) => typeof window < "u" ? (console.warn(
|
|
5868
5883
|
"App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
|
|
5869
|
-
),
|
|
5884
|
+
), P(Ut, {
|
|
5870
5885
|
inspect: e.inspect,
|
|
5871
5886
|
input: {
|
|
5872
5887
|
initialContext: {
|
|
5873
5888
|
endpoints: e.endpoints
|
|
5874
5889
|
}
|
|
5875
5890
|
}
|
|
5876
|
-
}).start()) :
|
|
5891
|
+
}).start()) : P(Ut, {
|
|
5877
5892
|
input: {
|
|
5878
5893
|
initialContext: {
|
|
5879
5894
|
currentStep: e.currentStep,
|
|
@@ -5887,10 +5902,11 @@ const Hr = (e, t, n, s) => {
|
|
|
5887
5902
|
},
|
|
5888
5903
|
inspect: e.inspect
|
|
5889
5904
|
}).start();
|
|
5890
|
-
function
|
|
5905
|
+
function Ei({ actor: e, children: t }) {
|
|
5891
5906
|
return /* @__PURE__ */ we(Tn.Provider, { value: e, children: t });
|
|
5892
5907
|
}
|
|
5893
|
-
|
|
5908
|
+
let Xr = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, n) => (n &= 63, n < 36 ? t += n.toString(36) : n < 62 ? t += (n - 26).toString(36).toUpperCase() : n > 62 ? t += "-" : t += "_", t), "");
|
|
5909
|
+
const Wr = he({
|
|
5894
5910
|
actors: {
|
|
5895
5911
|
tick: As(
|
|
5896
5912
|
({ sendBack: e, input: t }) => {
|
|
@@ -5957,7 +5973,7 @@ const Yr = he({
|
|
|
5957
5973
|
],
|
|
5958
5974
|
on: {
|
|
5959
5975
|
TICK: {
|
|
5960
|
-
actions:
|
|
5976
|
+
actions: O(({ context: e, event: t }) => t.type !== "TICK" ? e : {
|
|
5961
5977
|
elapsed: e.elapsed + e.interval
|
|
5962
5978
|
})
|
|
5963
5979
|
},
|
|
@@ -5968,9 +5984,9 @@ const Yr = he({
|
|
|
5968
5984
|
type: "final"
|
|
5969
5985
|
}
|
|
5970
5986
|
}
|
|
5971
|
-
}),
|
|
5987
|
+
}), vi = he({
|
|
5972
5988
|
actors: {
|
|
5973
|
-
timer:
|
|
5989
|
+
timer: Wr
|
|
5974
5990
|
},
|
|
5975
5991
|
types: {
|
|
5976
5992
|
context: {},
|
|
@@ -5978,10 +5994,10 @@ const Yr = he({
|
|
|
5978
5994
|
input: {}
|
|
5979
5995
|
},
|
|
5980
5996
|
actions: {
|
|
5981
|
-
addItem:
|
|
5997
|
+
addItem: O(({ context: e, event: t }) => {
|
|
5982
5998
|
if (t.type !== "ADD_ITEM")
|
|
5983
5999
|
return e;
|
|
5984
|
-
const n = `notification-${
|
|
6000
|
+
const n = `notification-${Xr()}`, s = t.duration ?? e.duration, r = An(t.item, {
|
|
5985
6001
|
duration: s,
|
|
5986
6002
|
id: n,
|
|
5987
6003
|
key: t.item.key ?? n,
|
|
@@ -5996,7 +6012,7 @@ const Yr = he({
|
|
|
5996
6012
|
activeItem: n
|
|
5997
6013
|
};
|
|
5998
6014
|
}),
|
|
5999
|
-
removeItem:
|
|
6015
|
+
removeItem: O(({ context: e, event: t }) => {
|
|
6000
6016
|
if (t.type !== "REMOVE_ITEM" && t.type !== "xstate.done.actor.timer")
|
|
6001
6017
|
return e;
|
|
6002
6018
|
const n = e.items;
|
|
@@ -6017,7 +6033,15 @@ const Yr = he({
|
|
|
6017
6033
|
}
|
|
6018
6034
|
}).createMachine({
|
|
6019
6035
|
id: "toast",
|
|
6020
|
-
context: {
|
|
6036
|
+
context: ({ input: e }) => {
|
|
6037
|
+
var t, n, s, r;
|
|
6038
|
+
return {
|
|
6039
|
+
items: ((t = e == null ? void 0 : e.initialContext) == null ? void 0 : t.items) ?? [],
|
|
6040
|
+
order: ((n = e == null ? void 0 : e.initialContext) == null ? void 0 : n.order) ?? "desc",
|
|
6041
|
+
duration: ((s = e == null ? void 0 : e.initialContext) == null ? void 0 : s.duration) ?? 0,
|
|
6042
|
+
activeItem: ((r = e == null ? void 0 : e.initialContext) == null ? void 0 : r.activeItem) ?? null
|
|
6043
|
+
};
|
|
6044
|
+
},
|
|
6021
6045
|
initial: "idle",
|
|
6022
6046
|
states: {
|
|
6023
6047
|
idle: {
|
|
@@ -6041,16 +6065,9 @@ const Yr = he({
|
|
|
6041
6065
|
target: "removing",
|
|
6042
6066
|
guard: "itemHasTimeout"
|
|
6043
6067
|
}
|
|
6044
|
-
// data: Object.assign(timerMachine.context, {
|
|
6045
|
-
// duration: (context: ToastMachineContext) =>
|
|
6046
|
-
// // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return
|
|
6047
|
-
// context.items[context.items.length - 1].duration ??
|
|
6048
|
-
// context.duration,
|
|
6049
|
-
// }),
|
|
6050
6068
|
},
|
|
6051
6069
|
on: {
|
|
6052
6070
|
ADD_ITEM: {
|
|
6053
|
-
// actions: sendTo('timer', 'PAUSE_TIMER'),
|
|
6054
6071
|
target: "adding"
|
|
6055
6072
|
},
|
|
6056
6073
|
REMOVE_ITEM: {
|
|
@@ -6061,19 +6078,11 @@ const Yr = he({
|
|
|
6061
6078
|
},
|
|
6062
6079
|
RESUME_TIMER: {
|
|
6063
6080
|
actions: bt("timer", { type: "RESUME_TIMER" })
|
|
6064
|
-
// cond: (context) => context.duration > 0,
|
|
6065
6081
|
},
|
|
6066
6082
|
PAUSE_TIMER: {
|
|
6067
6083
|
actions: bt("timer", { type: "PAUSE_TIMER" })
|
|
6068
|
-
// cond: (context) => context.duration > 0,
|
|
6069
6084
|
}
|
|
6070
6085
|
}
|
|
6071
|
-
// after: {
|
|
6072
|
-
// ITEM_TIMEOUT: {
|
|
6073
|
-
// target: 'removing',
|
|
6074
|
-
// cond: 'itemHasTimeout',
|
|
6075
|
-
// },
|
|
6076
|
-
// },
|
|
6077
6086
|
},
|
|
6078
6087
|
adding: {
|
|
6079
6088
|
entry: ["addItem"],
|
|
@@ -6100,11 +6109,31 @@ const Yr = he({
|
|
|
6100
6109
|
}
|
|
6101
6110
|
}), _n = be(
|
|
6102
6111
|
{}
|
|
6103
|
-
),
|
|
6104
|
-
|
|
6112
|
+
), Ti = () => {
|
|
6113
|
+
const e = Ne(_n);
|
|
6114
|
+
if (!e || !e.getSnapshot)
|
|
6115
|
+
throw new Error("toastActor is not properly initialized");
|
|
6116
|
+
const [t, n] = Oe(() => e.getSnapshot());
|
|
6117
|
+
return Ce(() => {
|
|
6118
|
+
if (!e || !e.getSnapshot) {
|
|
6119
|
+
console.error("toastActor is not properly initialized");
|
|
6120
|
+
return;
|
|
6121
|
+
}
|
|
6122
|
+
(() => {
|
|
6123
|
+
n(e.getSnapshot());
|
|
6124
|
+
})();
|
|
6125
|
+
const r = e.subscribe((i) => {
|
|
6126
|
+
n(i);
|
|
6127
|
+
});
|
|
6128
|
+
return () => {
|
|
6129
|
+
r.unsubscribe();
|
|
6130
|
+
};
|
|
6131
|
+
}, [e]), { toastActor: e };
|
|
6132
|
+
};
|
|
6133
|
+
function _i({ children: e, actor: t }) {
|
|
6105
6134
|
return /* @__PURE__ */ we(_n.Provider, { value: t, children: e });
|
|
6106
6135
|
}
|
|
6107
|
-
function
|
|
6136
|
+
function Kr({
|
|
6108
6137
|
context: e,
|
|
6109
6138
|
event: t
|
|
6110
6139
|
}) {
|
|
@@ -6116,7 +6145,7 @@ function Xr({
|
|
|
6116
6145
|
itemsAdded: n.output.itemsAdded
|
|
6117
6146
|
};
|
|
6118
6147
|
}
|
|
6119
|
-
function
|
|
6148
|
+
function Zr({
|
|
6120
6149
|
event: e
|
|
6121
6150
|
}) {
|
|
6122
6151
|
if (!e.type.includes("xstate.done.actor"))
|
|
@@ -6127,7 +6156,7 @@ function Qr({
|
|
|
6127
6156
|
itemsAdded: t.output.itemsAdded
|
|
6128
6157
|
};
|
|
6129
6158
|
}
|
|
6130
|
-
function
|
|
6159
|
+
function ei({
|
|
6131
6160
|
event: e
|
|
6132
6161
|
}) {
|
|
6133
6162
|
if (!e.type.includes("xstate.done.actor"))
|
|
@@ -6138,7 +6167,7 @@ function Wr({
|
|
|
6138
6167
|
itemsRemoved: t.output.itemsRemoved
|
|
6139
6168
|
};
|
|
6140
6169
|
}
|
|
6141
|
-
function
|
|
6170
|
+
function ti({
|
|
6142
6171
|
event: e
|
|
6143
6172
|
}) {
|
|
6144
6173
|
if (!e.type.includes("xstate.done.actor"))
|
|
@@ -6155,7 +6184,7 @@ function Kr({
|
|
|
6155
6184
|
itemsUpdated: t.output.itemsUpdated
|
|
6156
6185
|
};
|
|
6157
6186
|
}
|
|
6158
|
-
function
|
|
6187
|
+
function ni({
|
|
6159
6188
|
context: e,
|
|
6160
6189
|
event: t
|
|
6161
6190
|
}) {
|
|
@@ -6167,7 +6196,7 @@ function Zr({
|
|
|
6167
6196
|
itemsRemoved: n.output.itemsRemoved
|
|
6168
6197
|
};
|
|
6169
6198
|
}
|
|
6170
|
-
function
|
|
6199
|
+
function si({
|
|
6171
6200
|
context: e,
|
|
6172
6201
|
event: t
|
|
6173
6202
|
}) {
|
|
@@ -6178,7 +6207,7 @@ function ei({
|
|
|
6178
6207
|
quote: { ...e.quote, ...n.output.quote }
|
|
6179
6208
|
};
|
|
6180
6209
|
}
|
|
6181
|
-
function
|
|
6210
|
+
function ri({
|
|
6182
6211
|
context: e,
|
|
6183
6212
|
event: t
|
|
6184
6213
|
}) {
|
|
@@ -6190,7 +6219,7 @@ function ti({
|
|
|
6190
6219
|
itemsUpdated: n.output.itemsUpdated
|
|
6191
6220
|
};
|
|
6192
6221
|
}
|
|
6193
|
-
const
|
|
6222
|
+
const ii = V(
|
|
6194
6223
|
async ({ input: e }) => {
|
|
6195
6224
|
var t;
|
|
6196
6225
|
if (!e.endpoint || e.endpoint === "")
|
|
@@ -6202,7 +6231,7 @@ const ni = V(
|
|
|
6202
6231
|
if (!e.requestHeaders)
|
|
6203
6232
|
throw new Error("No request headers provided.");
|
|
6204
6233
|
try {
|
|
6205
|
-
const n = await
|
|
6234
|
+
const n = await qe(
|
|
6206
6235
|
e.endpoint,
|
|
6207
6236
|
e.document,
|
|
6208
6237
|
{ items: e.items },
|
|
@@ -6219,14 +6248,14 @@ const ni = V(
|
|
|
6219
6248
|
throw new Error("Request to add item(s) failed.");
|
|
6220
6249
|
}
|
|
6221
6250
|
}
|
|
6222
|
-
),
|
|
6251
|
+
), oi = V(async ({ input: e }) => {
|
|
6223
6252
|
var t;
|
|
6224
6253
|
if (!e.endpoint || e.endpoint === "")
|
|
6225
6254
|
throw new Error("No endpoint provided.");
|
|
6226
6255
|
if (e.items.length < 1)
|
|
6227
6256
|
throw new Error("No items provided.");
|
|
6228
6257
|
try {
|
|
6229
|
-
const n = await
|
|
6258
|
+
const n = await qe(
|
|
6230
6259
|
e.endpoint,
|
|
6231
6260
|
""
|
|
6232
6261
|
// input.document,
|
|
@@ -6243,7 +6272,7 @@ const ni = V(
|
|
|
6243
6272
|
} catch {
|
|
6244
6273
|
throw new Error("Request to remove item(s) failed.");
|
|
6245
6274
|
}
|
|
6246
|
-
}),
|
|
6275
|
+
}), He = typeof window > "u", ai = V(
|
|
6247
6276
|
async ({ input: e }) => {
|
|
6248
6277
|
var n, s, r, i;
|
|
6249
6278
|
if (!e.endpoint)
|
|
@@ -6257,8 +6286,8 @@ const ni = V(
|
|
|
6257
6286
|
if (!e.requestHeaders)
|
|
6258
6287
|
throw console.log("no headers"), new Error("No request headers provided.");
|
|
6259
6288
|
const t = new vn(
|
|
6260
|
-
|
|
6261
|
-
|
|
6289
|
+
He ? e.endpointSsr : e.endpoint,
|
|
6290
|
+
He ? { fetch, method: "POST" } : {
|
|
6262
6291
|
credentials: "include",
|
|
6263
6292
|
method: "POST",
|
|
6264
6293
|
mode: "cors"
|
|
@@ -6268,7 +6297,7 @@ const ni = V(
|
|
|
6268
6297
|
const { data: o, headers: a, status: c, errors: u, extensions: h } = await t.rawRequest(
|
|
6269
6298
|
En(e.document),
|
|
6270
6299
|
{},
|
|
6271
|
-
|
|
6300
|
+
He ? {
|
|
6272
6301
|
...e.requestHeaders,
|
|
6273
6302
|
Cookie: `quote_${e.locale}=${e.quoteId ?? ""}`
|
|
6274
6303
|
} : e.requestHeaders
|
|
@@ -6285,7 +6314,7 @@ const ni = V(
|
|
|
6285
6314
|
throw console.log("refresh error", o), new Error("Request to add item(s) failed.");
|
|
6286
6315
|
}
|
|
6287
6316
|
}
|
|
6288
|
-
),
|
|
6317
|
+
), ci = V(async ({ input: e }) => {
|
|
6289
6318
|
var t;
|
|
6290
6319
|
if (!e.endpoint || e.endpoint === "")
|
|
6291
6320
|
throw new Error("No endpoint provided.");
|
|
@@ -6296,7 +6325,7 @@ const ni = V(
|
|
|
6296
6325
|
if (!e.requestHeaders)
|
|
6297
6326
|
throw new Error("No request headers provided.");
|
|
6298
6327
|
try {
|
|
6299
|
-
const n = await
|
|
6328
|
+
const n = await qe(
|
|
6300
6329
|
e.endpoint,
|
|
6301
6330
|
e.document,
|
|
6302
6331
|
{ items: e.items },
|
|
@@ -6312,7 +6341,7 @@ const ni = V(
|
|
|
6312
6341
|
} catch {
|
|
6313
6342
|
throw new Error("Request to add item(s) failed.");
|
|
6314
6343
|
}
|
|
6315
|
-
}),
|
|
6344
|
+
}), ui = ({ context: e }) => typeof window > "u" && e.quote.id !== "" || typeof window < "u", di = ({ context: e }) => !!e.quote.items && e.quote.items.length > 0, Pt = he({
|
|
6316
6345
|
types: {
|
|
6317
6346
|
context: {},
|
|
6318
6347
|
emitted: {},
|
|
@@ -6320,23 +6349,23 @@ const ni = V(
|
|
|
6320
6349
|
input: {}
|
|
6321
6350
|
},
|
|
6322
6351
|
actions: {
|
|
6323
|
-
addItems:
|
|
6324
|
-
notifyAddItems:
|
|
6325
|
-
notifyRemoveItems:
|
|
6326
|
-
notifyUpdateItems:
|
|
6327
|
-
removeItems:
|
|
6328
|
-
refresh:
|
|
6329
|
-
updateItems:
|
|
6352
|
+
addItems: O(Kr),
|
|
6353
|
+
notifyAddItems: Fe(Zr),
|
|
6354
|
+
notifyRemoveItems: Fe(ei),
|
|
6355
|
+
notifyUpdateItems: Fe(ti),
|
|
6356
|
+
removeItems: O(ni),
|
|
6357
|
+
refresh: O(si),
|
|
6358
|
+
updateItems: O(ri)
|
|
6330
6359
|
},
|
|
6331
6360
|
actors: {
|
|
6332
|
-
addItems:
|
|
6333
|
-
removeItems:
|
|
6334
|
-
refresh:
|
|
6335
|
-
updateItems:
|
|
6361
|
+
addItems: ii,
|
|
6362
|
+
removeItems: oi,
|
|
6363
|
+
refresh: ai,
|
|
6364
|
+
updateItems: ci
|
|
6336
6365
|
},
|
|
6337
6366
|
guards: {
|
|
6338
|
-
canRefresh:
|
|
6339
|
-
hasItems:
|
|
6367
|
+
canRefresh: ui,
|
|
6368
|
+
hasItems: di
|
|
6340
6369
|
}
|
|
6341
6370
|
}).createMachine({
|
|
6342
6371
|
/** @todo do we need to add the view to the id? (e.g. quote_en-us) */
|
|
@@ -6691,13 +6720,13 @@ const ni = V(
|
|
|
6691
6720
|
}
|
|
6692
6721
|
}), Sn = be(
|
|
6693
6722
|
{}
|
|
6694
|
-
),
|
|
6723
|
+
), Si = () => {
|
|
6695
6724
|
var c;
|
|
6696
6725
|
const e = Ne(Sn);
|
|
6697
6726
|
if (!e || !e.getSnapshot)
|
|
6698
6727
|
throw new Error("quoteActor is not properly initialized");
|
|
6699
|
-
const [t, n] =
|
|
6700
|
-
|
|
6728
|
+
const [t, n] = Oe(() => e.getSnapshot());
|
|
6729
|
+
Ce(() => {
|
|
6701
6730
|
if (!e || !e.getSnapshot) {
|
|
6702
6731
|
console.error("quoteActor is not properly initialized");
|
|
6703
6732
|
return;
|
|
@@ -6721,21 +6750,21 @@ const ni = V(
|
|
|
6721
6750
|
isRemovingItems: o,
|
|
6722
6751
|
isUpdatingItems: a
|
|
6723
6752
|
};
|
|
6724
|
-
},
|
|
6753
|
+
}, Ii = async (e = {
|
|
6725
6754
|
inspect: void 0,
|
|
6726
6755
|
quote: { id: "", locale: "" },
|
|
6727
6756
|
endpoints: { client: "", server: "" },
|
|
6728
6757
|
graphql: {}
|
|
6729
6758
|
}) => typeof window < "u" ? (console.warn(
|
|
6730
6759
|
"App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
|
|
6731
|
-
),
|
|
6760
|
+
), P(Pt, {
|
|
6732
6761
|
inspect: e.inspect,
|
|
6733
6762
|
input: {
|
|
6734
6763
|
initialContext: {
|
|
6735
6764
|
endpoints: e.endpoints
|
|
6736
6765
|
}
|
|
6737
6766
|
}
|
|
6738
|
-
}).start()) :
|
|
6767
|
+
}).start()) : P(Pt, {
|
|
6739
6768
|
input: {
|
|
6740
6769
|
initialContext: {
|
|
6741
6770
|
endpoints: e.endpoints,
|
|
@@ -6748,28 +6777,28 @@ const ni = V(
|
|
|
6748
6777
|
},
|
|
6749
6778
|
inspect: e.inspect
|
|
6750
6779
|
}).start();
|
|
6751
|
-
function
|
|
6780
|
+
function Ai({ actor: e, children: t }) {
|
|
6752
6781
|
return /* @__PURE__ */ we(Sn.Provider, { value: e, children: t });
|
|
6753
6782
|
}
|
|
6754
6783
|
export {
|
|
6755
6784
|
an as AuthContext,
|
|
6756
|
-
|
|
6785
|
+
yi as AuthProvider,
|
|
6757
6786
|
Tn as CheckoutContext,
|
|
6758
|
-
|
|
6787
|
+
Ei as CheckoutProvider,
|
|
6759
6788
|
Sn as QuoteContext,
|
|
6760
|
-
|
|
6789
|
+
Ai as QuoteProvider,
|
|
6761
6790
|
_n as ToastContext,
|
|
6762
|
-
|
|
6791
|
+
_i as ToastProvider,
|
|
6763
6792
|
Ot as authMachine,
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6793
|
+
Ut as checkoutMachine,
|
|
6794
|
+
pi as getAuth,
|
|
6795
|
+
gi as getCheckout,
|
|
6796
|
+
Ii as getQuote,
|
|
6797
|
+
Pt as quoteMachine,
|
|
6798
|
+
Wr as timerMachine,
|
|
6799
|
+
vi as toastMachine,
|
|
6800
|
+
fi as useAuth,
|
|
6801
|
+
mi as useCheckout,
|
|
6802
|
+
Si as useQuote,
|
|
6803
|
+
Ti as useToast
|
|
6775
6804
|
};
|