@clicktap/state 0.14.4 → 0.14.6
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 +31 -31
- package/index.mjs +408 -375
- package/package.json +1 -1
- package/quote/CheckoutProvider.d.ts +30 -6
- package/quote/checkout/actions/changeStep.d.ts +8 -0
- package/quote/checkout/actions/index.d.ts +1 -0
- package/quote/checkout/actions/updateQuote.d.ts +14 -10
- package/quote/checkout/types.d.ts +6 -7
- package/quote/checkout.d.ts +10 -2
- package/quote/quote/actions/addItems.d.ts +14 -10
- package/quote/quote/actions/refresh.d.ts +14 -10
- package/quote/quote/actions/removeItems.d.ts +14 -10
- package/quote/quote/actions/updateItems.d.ts +14 -10
- package/quote/quote/types.d.ts +13 -4
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as be, useContext as Ne, useState as
|
|
3
|
-
function
|
|
1
|
+
import { jsx as xe } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as be, useContext as Ne, useState as Ce, useEffect as Oe, cloneElement as An } from "react";
|
|
3
|
+
function wn(e, t) {
|
|
4
4
|
for (var n = 0; n < t.length; n++) {
|
|
5
5
|
const s = t[n];
|
|
6
6
|
if (typeof s != "string" && !Array.isArray(s)) {
|
|
@@ -16,7 +16,7 @@ function xn(e, t) {
|
|
|
16
16
|
}
|
|
17
17
|
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function xn() {
|
|
20
20
|
if (typeof globalThis < "u")
|
|
21
21
|
return globalThis;
|
|
22
22
|
if (typeof self < "u")
|
|
@@ -27,7 +27,7 @@ function wn() {
|
|
|
27
27
|
return global;
|
|
28
28
|
}
|
|
29
29
|
function bn() {
|
|
30
|
-
const e =
|
|
30
|
+
const e = xn();
|
|
31
31
|
if (e.__xstate__)
|
|
32
32
|
return e.__xstate__;
|
|
33
33
|
}
|
|
@@ -66,7 +66,7 @@ class ft {
|
|
|
66
66
|
this._last = null;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
const Ft = ".",
|
|
69
|
+
const Ft = ".", Cn = "", Bt = "", On = "#", kn = "*", jt = "xstate.init", Dn = "xstate.error", ue = "xstate.stop";
|
|
70
70
|
function Rn(e, t) {
|
|
71
71
|
return {
|
|
72
72
|
type: `xstate.after.${e}.${t}`
|
|
@@ -106,13 +106,13 @@ function pt(e, t) {
|
|
|
106
106
|
return `${e.sessionId}.${t}`;
|
|
107
107
|
}
|
|
108
108
|
let Ln = 0;
|
|
109
|
-
function
|
|
109
|
+
function Pn(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
|
|
113
113
|
} = t, u = {
|
|
114
114
|
schedule: (f, m, y, v, I = Math.random().toString(36).slice(2)) => {
|
|
115
|
-
const
|
|
115
|
+
const w = {
|
|
116
116
|
source: f,
|
|
117
117
|
target: m,
|
|
118
118
|
event: y,
|
|
@@ -120,7 +120,7 @@ function Un(e, t) {
|
|
|
120
120
|
id: I,
|
|
121
121
|
startedAt: Date.now()
|
|
122
122
|
}, R = pt(f, I);
|
|
123
|
-
d._snapshot._scheduledEvents[R] =
|
|
123
|
+
d._snapshot._scheduledEvents[R] = w;
|
|
124
124
|
const k = a.setTimeout(() => {
|
|
125
125
|
delete o[R], delete d._snapshot._scheduledEvents[R], d._relay(f, m, y);
|
|
126
126
|
}, v);
|
|
@@ -191,10 +191,10 @@ function Un(e, t) {
|
|
|
191
191
|
source: y,
|
|
192
192
|
target: v,
|
|
193
193
|
event: I,
|
|
194
|
-
delay:
|
|
194
|
+
delay: w,
|
|
195
195
|
id: R
|
|
196
196
|
} = f[m];
|
|
197
|
-
u.schedule(y, v, I,
|
|
197
|
+
u.schedule(y, v, I, w, R);
|
|
198
198
|
}
|
|
199
199
|
},
|
|
200
200
|
_clock: a,
|
|
@@ -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 Un(t);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Un(e) {
|
|
235
235
|
if (e.length === 1)
|
|
236
236
|
return e[0];
|
|
237
237
|
const t = {};
|
|
@@ -278,7 +278,7 @@ function K(e) {
|
|
|
278
278
|
} : t);
|
|
279
279
|
}
|
|
280
280
|
function Jt(e) {
|
|
281
|
-
if (!(e === void 0 || e ===
|
|
281
|
+
if (!(e === void 0 || e === Cn))
|
|
282
282
|
return j(e);
|
|
283
283
|
}
|
|
284
284
|
function gt(e, t, 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 : Pn(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 U(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 = U(u, {
|
|
714
714
|
id: h,
|
|
715
715
|
src: o,
|
|
716
716
|
parent: e.self,
|
|
@@ -861,7 +861,7 @@ function Wt(e, t) {
|
|
|
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 ke = (e) => e[0] ===
|
|
864
|
+
const ke = (e) => e[0] === On;
|
|
865
865
|
function Xn(e, t) {
|
|
866
866
|
return e.transitions.get(t) || [...e.transitions.keys()].filter((s) => {
|
|
867
867
|
if (s === kn)
|
|
@@ -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
|
+
Pe(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
|
+
Pe(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), Pe(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,7 +1289,7 @@ 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 Pe(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) {
|
|
@@ -1353,7 +1353,7 @@ function sn(e, t, n, s, r, i) {
|
|
|
1353
1353
|
});
|
|
1354
1354
|
continue;
|
|
1355
1355
|
}
|
|
1356
|
-
const y = h, [v, I,
|
|
1356
|
+
const y = h, [v, I, w] = y.resolve(
|
|
1357
1357
|
n,
|
|
1358
1358
|
a,
|
|
1359
1359
|
d,
|
|
@@ -1362,7 +1362,7 @@ function sn(e, t, n, s, r, i) {
|
|
|
1362
1362
|
// this holds all params
|
|
1363
1363
|
r
|
|
1364
1364
|
);
|
|
1365
|
-
a = v, "retryResolve" in y && (i == null || i.push([y, I])), "execute" in y && (n.self._processingStatus === D.Running ? y.execute(n, I) : n.defer(y.execute.bind(null, n, I))),
|
|
1365
|
+
a = v, "retryResolve" in y && (i == null || i.push([y, I])), "execute" in y && (n.self._processingStatus === D.Running ? y.execute(n, I) : n.defer(y.execute.bind(null, n, I))), w && (a = sn(a, t, n, w, r, i));
|
|
1366
1366
|
}
|
|
1367
1367
|
return a;
|
|
1368
1368
|
}
|
|
@@ -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 Ue(e, t, n, s = []) {
|
|
1379
1379
|
let r = e;
|
|
1380
1380
|
const i = [];
|
|
1381
1381
|
function o(u, h, d) {
|
|
@@ -1645,7 +1645,7 @@ function As(e) {
|
|
|
1645
1645
|
restoreSnapshot: (n) => n
|
|
1646
1646
|
};
|
|
1647
1647
|
}
|
|
1648
|
-
const At = "xstate.promise.resolve",
|
|
1648
|
+
const At = "xstate.promise.resolve", wt = "xstate.promise.reject", me = /* @__PURE__ */ new WeakMap();
|
|
1649
1649
|
function V(e) {
|
|
1650
1650
|
return {
|
|
1651
1651
|
config: e,
|
|
@@ -1663,7 +1663,7 @@ function V(e) {
|
|
|
1663
1663
|
input: void 0
|
|
1664
1664
|
};
|
|
1665
1665
|
}
|
|
1666
|
-
case
|
|
1666
|
+
case wt:
|
|
1667
1667
|
return {
|
|
1668
1668
|
...n,
|
|
1669
1669
|
status: "error",
|
|
@@ -1699,7 +1699,7 @@ function V(e) {
|
|
|
1699
1699
|
}));
|
|
1700
1700
|
}, (a) => {
|
|
1701
1701
|
s.getSnapshot().status === "active" && (me.delete(s), r._relay(s, s, {
|
|
1702
|
-
type:
|
|
1702
|
+
type: wt,
|
|
1703
1703
|
data: a
|
|
1704
1704
|
}));
|
|
1705
1705
|
});
|
|
@@ -1714,7 +1714,7 @@ function V(e) {
|
|
|
1714
1714
|
restoreSnapshot: (n) => n
|
|
1715
1715
|
};
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function ws(e, {
|
|
1718
1718
|
machine: t,
|
|
1719
1719
|
context: n
|
|
1720
1720
|
}, s, 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 = U(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 U(o, {
|
|
1745
1745
|
id: a.id,
|
|
1746
1746
|
parent: e.self,
|
|
1747
1747
|
syncSnapshot: a.syncSnapshot,
|
|
@@ -1757,7 +1757,7 @@ function xs(e, {
|
|
|
1757
1757
|
}), c;
|
|
1758
1758
|
};
|
|
1759
1759
|
}
|
|
1760
|
-
function
|
|
1760
|
+
function xs(e, t, n, s, {
|
|
1761
1761
|
assignment: r
|
|
1762
1762
|
}) {
|
|
1763
1763
|
if (!t.context)
|
|
@@ -1765,7 +1765,7 @@ function ws(e, t, n, s, {
|
|
|
1765
1765
|
const i = {}, o = {
|
|
1766
1766
|
context: t.context,
|
|
1767
1767
|
event: n.event,
|
|
1768
|
-
spawn:
|
|
1768
|
+
spawn: ws(e, t, n.event, i),
|
|
1769
1769
|
self: e.self,
|
|
1770
1770
|
system: e.system
|
|
1771
1771
|
};
|
|
@@ -1786,10 +1786,10 @@ function ws(e, t, n, s, {
|
|
|
1786
1786
|
} : t.children
|
|
1787
1787
|
})];
|
|
1788
1788
|
}
|
|
1789
|
-
function
|
|
1789
|
+
function b(e) {
|
|
1790
1790
|
function t(n, s) {
|
|
1791
1791
|
}
|
|
1792
|
-
return t.type = "xstate.assign", t.assignment = e, t.resolve =
|
|
1792
|
+
return t.type = "xstate.assign", t.assignment = e, t.resolve = xs, t;
|
|
1793
1793
|
}
|
|
1794
1794
|
function bs(e, t, n, s, {
|
|
1795
1795
|
event: r
|
|
@@ -1809,10 +1809,10 @@ function Fe(e) {
|
|
|
1809
1809
|
}
|
|
1810
1810
|
return t.type = "xstate.emit", t.event = e, t.resolve = bs, t.execute = Ns, t;
|
|
1811
1811
|
}
|
|
1812
|
-
let
|
|
1812
|
+
let xt = /* @__PURE__ */ function(e) {
|
|
1813
1813
|
return e.Parent = "#_parent", e.Internal = "#_internal", e;
|
|
1814
1814
|
}({});
|
|
1815
|
-
function
|
|
1815
|
+
function Cs(e, t, n, s, {
|
|
1816
1816
|
to: r,
|
|
1817
1817
|
event: i,
|
|
1818
1818
|
id: o,
|
|
@@ -1832,7 +1832,7 @@ function Os(e, t, n, s, {
|
|
|
1832
1832
|
const f = typeof r == "function" ? r(n, s) : r;
|
|
1833
1833
|
let m;
|
|
1834
1834
|
if (typeof f == "string") {
|
|
1835
|
-
if (f ===
|
|
1835
|
+
if (f === xt.Parent ? m = e.self._parent : f === xt.Internal ? m = e.self : f.startsWith("#_") ? m = t.children[f.slice(2)] : m = (y = c.deferredActorIds) != null && y.includes(f) ? f : t.children[f], !m)
|
|
1836
1836
|
throw new Error(`Unable to send event to actor '${f}' from machine '${t.machine.id}'.`);
|
|
1837
1837
|
} else
|
|
1838
1838
|
m = f || e.self;
|
|
@@ -1843,7 +1843,7 @@ function Os(e, t, n, s, {
|
|
|
1843
1843
|
delay: d
|
|
1844
1844
|
}];
|
|
1845
1845
|
}
|
|
1846
|
-
function
|
|
1846
|
+
function Os(e, t, n) {
|
|
1847
1847
|
typeof n.to == "string" && (n.to = t.children[n.to]);
|
|
1848
1848
|
}
|
|
1849
1849
|
function ks(e, t) {
|
|
@@ -1870,7 +1870,7 @@ function ks(e, t) {
|
|
|
1870
1870
|
function bt(e, t, n) {
|
|
1871
1871
|
function s(r, i) {
|
|
1872
1872
|
}
|
|
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 =
|
|
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 = Cs, s.retryResolve = Os, s.execute = ks, s;
|
|
1874
1874
|
}
|
|
1875
1875
|
const Nt = /* @__PURE__ */ new WeakMap();
|
|
1876
1876
|
function X(e, t, n) {
|
|
@@ -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 Ue(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 Ue(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, [b(({
|
|
2139
2139
|
spawn: a,
|
|
2140
2140
|
event: c,
|
|
2141
2141
|
self: u
|
|
@@ -2159,7 +2159,7 @@ class ut {
|
|
|
2159
2159
|
// TODO: fix
|
|
2160
2160
|
}], i, t, s, !0, r), {
|
|
2161
2161
|
snapshot: a
|
|
2162
|
-
} =
|
|
2162
|
+
} = Ue(o, s, t, r);
|
|
2163
2163
|
return a;
|
|
2164
2164
|
}
|
|
2165
2165
|
start(t) {
|
|
@@ -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 = U(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 Ps({
|
|
2271
2271
|
context: e,
|
|
2272
2272
|
event: t
|
|
2273
2273
|
}) {
|
|
@@ -2279,7 +2279,7 @@ function Us({
|
|
|
2279
2279
|
ignoreRefreshToken: !1
|
|
2280
2280
|
};
|
|
2281
2281
|
}
|
|
2282
|
-
function
|
|
2282
|
+
function Us() {
|
|
2283
2283
|
return {
|
|
2284
2284
|
ignoreRefreshToken: !0
|
|
2285
2285
|
};
|
|
@@ -2317,35 +2317,41 @@ async function Qe(e, t) {
|
|
|
2317
2317
|
});
|
|
2318
2318
|
}
|
|
2319
2319
|
const $s = V(async ({ input: e }) => {
|
|
2320
|
-
var
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
)
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2320
|
+
var t;
|
|
2321
|
+
if (!e.endpoint.client || e.endpoint.client === "")
|
|
2322
|
+
throw console.log("refreshAccessToken: No client endpoint provided."), new Error("No client endpoint provided.");
|
|
2323
|
+
try {
|
|
2324
|
+
const n = await Qe(e.endpoint.client, {
|
|
2325
|
+
method: "POST",
|
|
2326
|
+
mode: "cors",
|
|
2327
|
+
credentials: "include",
|
|
2328
|
+
headers: {
|
|
2329
|
+
"Content-Type": "application/json",
|
|
2330
|
+
"clicktap-scope": "view",
|
|
2331
|
+
"clicktap-scope-id": "default"
|
|
2332
|
+
},
|
|
2333
|
+
body: JSON.stringify({
|
|
2334
|
+
username: e.username,
|
|
2335
|
+
password: e.password
|
|
2336
|
+
}).toString()
|
|
2337
|
+
});
|
|
2338
|
+
if (!n.success)
|
|
2339
|
+
throw new Error(
|
|
2340
|
+
((t = n.message) == null ? void 0 : t.toString()) ?? "Sign in failed. Please try again."
|
|
2341
|
+
);
|
|
2342
|
+
return {
|
|
2343
|
+
type: "AUTHENTICATE_SUCCESS",
|
|
2344
|
+
user: null,
|
|
2345
|
+
accessToken: n.accessToken ?? ""
|
|
2346
|
+
};
|
|
2347
|
+
} catch (n) {
|
|
2348
|
+
throw console.log(n), new Error("Could not complete authenticate request (server)");
|
|
2349
|
+
}
|
|
2344
2350
|
}), Vs = V(async ({ input: e }) => {
|
|
2345
2351
|
if (!e.endpoint.client || e.endpoint.client === "")
|
|
2346
|
-
throw new Error("No client endpoint provided.");
|
|
2352
|
+
throw console.log("refreshAccessToken: No client endpoint provided."), new Error("No client endpoint provided.");
|
|
2347
2353
|
if (!e.endpoint.server || e.endpoint.server === "")
|
|
2348
|
-
throw new Error("No server endpoint provided.");
|
|
2354
|
+
throw console.log("refreshAccessToken: No server endpoint provided."), new Error("No server endpoint provided.");
|
|
2349
2355
|
let t;
|
|
2350
2356
|
if (typeof window > "u") {
|
|
2351
2357
|
if (e.refreshToken === "")
|
|
@@ -2394,32 +2400,40 @@ const $s = V(async ({ input: e }) => {
|
|
|
2394
2400
|
accessToken: t.accessToken
|
|
2395
2401
|
};
|
|
2396
2402
|
}
|
|
2397
|
-
}), Hs = V(async ({ input: e }) =>
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2403
|
+
}), Hs = V(async ({ input: e }) => {
|
|
2404
|
+
if (!e.endpoint.client || e.endpoint.client === "")
|
|
2405
|
+
throw console.log("unauthenticate: No client endpoint provided."), new Error("No client endpoint provided.");
|
|
2406
|
+
try {
|
|
2407
|
+
return await fetch(e.endpoint.client, {
|
|
2408
|
+
method: "POST",
|
|
2409
|
+
mode: "cors",
|
|
2410
|
+
credentials: "include",
|
|
2411
|
+
headers: {
|
|
2412
|
+
"clicktap-scope": "view",
|
|
2413
|
+
"clicktap-scope-id": "default"
|
|
2414
|
+
}
|
|
2415
|
+
// headers: {
|
|
2416
|
+
// 'Access-Control-Allow-Origin': 'https://middleware-clicktap.local-rmgmedia.com',
|
|
2417
|
+
// 'Access-Control-Allow-Credentials': 'true',
|
|
2418
|
+
// },
|
|
2419
|
+
}), { type: "UNAUTHENTICATE_SUCCESS" };
|
|
2420
|
+
} catch (t) {
|
|
2421
|
+
throw console.log(t), new Error("Could not complete unauthenticate request (server)");
|
|
2422
|
+
}
|
|
2423
|
+
}), Ct = he({
|
|
2410
2424
|
types: {
|
|
2411
2425
|
context: {},
|
|
2412
2426
|
events: {},
|
|
2413
2427
|
input: {}
|
|
2414
2428
|
},
|
|
2415
2429
|
actions: {
|
|
2416
|
-
addError:
|
|
2417
|
-
clearErrors:
|
|
2418
|
-
setAccessToken:
|
|
2419
|
-
setIgnoreRefreshToken:
|
|
2420
|
-
setUserContext:
|
|
2421
|
-
unsetRefreshToken:
|
|
2422
|
-
unsetUserContext:
|
|
2430
|
+
addError: b(Ms),
|
|
2431
|
+
clearErrors: b(Ls),
|
|
2432
|
+
setAccessToken: b(Ps),
|
|
2433
|
+
setIgnoreRefreshToken: b(Us),
|
|
2434
|
+
setUserContext: b(Fs),
|
|
2435
|
+
unsetRefreshToken: b(Bs),
|
|
2436
|
+
unsetUserContext: b(js)
|
|
2423
2437
|
},
|
|
2424
2438
|
actors: {
|
|
2425
2439
|
authenticate: $s,
|
|
@@ -2565,11 +2579,11 @@ const $s = V(async ({ input: e }) => {
|
|
|
2565
2579
|
}
|
|
2566
2580
|
}), an = be(
|
|
2567
2581
|
{}
|
|
2568
|
-
),
|
|
2569
|
-
const e = Ne(an), [t, n] =
|
|
2582
|
+
), pi = () => {
|
|
2583
|
+
const e = Ne(an), [t, n] = Ce(
|
|
2570
2584
|
typeof window < "u" && e.getSnapshot().value === "loggedIn"
|
|
2571
2585
|
);
|
|
2572
|
-
return
|
|
2586
|
+
return Oe(() => {
|
|
2573
2587
|
if (typeof window > "u")
|
|
2574
2588
|
return;
|
|
2575
2589
|
const s = e.subscribe((r) => {
|
|
@@ -2579,19 +2593,19 @@ const $s = V(async ({ input: e }) => {
|
|
|
2579
2593
|
s.unsubscribe();
|
|
2580
2594
|
};
|
|
2581
2595
|
}, [e]), { authActor: e, isLoggedIn: t };
|
|
2582
|
-
},
|
|
2596
|
+
}, yi = async (e = "", t = {
|
|
2583
2597
|
inspect: void 0,
|
|
2584
2598
|
endpoints: { login: "", logout: "", refresh: "", ssrRefresh: "" }
|
|
2585
2599
|
}) => typeof window < "u" ? (console.warn(
|
|
2586
2600
|
"App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
|
|
2587
|
-
),
|
|
2601
|
+
), U(Ct, {
|
|
2588
2602
|
inspect: t.inspect,
|
|
2589
2603
|
input: {
|
|
2590
2604
|
initialContext: {
|
|
2591
2605
|
endpoints: t.endpoints
|
|
2592
2606
|
}
|
|
2593
2607
|
}
|
|
2594
|
-
}).start()) :
|
|
2608
|
+
}).start()) : U(Ct, {
|
|
2595
2609
|
input: {
|
|
2596
2610
|
initialContext: {
|
|
2597
2611
|
endpoints: t.endpoints,
|
|
@@ -2600,24 +2614,37 @@ const $s = V(async ({ input: e }) => {
|
|
|
2600
2614
|
},
|
|
2601
2615
|
inspect: t.inspect
|
|
2602
2616
|
}).start();
|
|
2603
|
-
function
|
|
2604
|
-
return /* @__PURE__ */
|
|
2617
|
+
function mi({ actor: e, children: t }) {
|
|
2618
|
+
return /* @__PURE__ */ xe(an.Provider, { value: e, children: t });
|
|
2605
2619
|
}
|
|
2606
2620
|
function zs({
|
|
2607
2621
|
context: e,
|
|
2608
2622
|
event: t
|
|
2623
|
+
}) {
|
|
2624
|
+
var s;
|
|
2625
|
+
if (t.type !== "CHANGE_STEP")
|
|
2626
|
+
return e;
|
|
2627
|
+
console.log("changeStep steps", e.steps);
|
|
2628
|
+
const n = (s = e.steps) == null ? void 0 : s.find((r) => r.code === t.step);
|
|
2629
|
+
return !n || !n.isAvailable ? e : (console.log("changeStep", n.code), {
|
|
2630
|
+
currentStep: n.code ?? e.currentStep
|
|
2631
|
+
});
|
|
2632
|
+
}
|
|
2633
|
+
function Gs({
|
|
2634
|
+
context: e,
|
|
2635
|
+
event: t
|
|
2609
2636
|
}) {
|
|
2610
2637
|
var r, i;
|
|
2611
2638
|
if (!t.type.includes("xstate.done.actor") || t.output.type !== "SUBMIT_STEP_DATA_SUCCESS")
|
|
2612
2639
|
return e;
|
|
2613
2640
|
const s = (i = (r = e.steps) == null ? void 0 : r.find(
|
|
2614
|
-
(o) => o.
|
|
2641
|
+
(o) => o.code === e.currentStep
|
|
2615
2642
|
)) == null ? void 0 : i.next;
|
|
2616
2643
|
return s ? {
|
|
2617
2644
|
currentStep: s ?? e.currentStep
|
|
2618
2645
|
} : e;
|
|
2619
2646
|
}
|
|
2620
|
-
function
|
|
2647
|
+
function Js({
|
|
2621
2648
|
context: e,
|
|
2622
2649
|
event: t
|
|
2623
2650
|
}) {
|
|
@@ -2628,26 +2655,26 @@ function Gs({
|
|
|
2628
2655
|
quote: { ...e.quote, ...n.output.quote }
|
|
2629
2656
|
};
|
|
2630
2657
|
}
|
|
2631
|
-
const dt = JSON,
|
|
2658
|
+
const dt = JSON, Ys = (e) => e.toUpperCase(), Qs = (e) => {
|
|
2632
2659
|
const t = {};
|
|
2633
2660
|
return e.forEach((n, s) => {
|
|
2634
2661
|
t[s] = n;
|
|
2635
2662
|
}), t;
|
|
2636
|
-
},
|
|
2663
|
+
}, Xs = (e, t, n) => e.document ? e : {
|
|
2637
2664
|
document: e,
|
|
2638
2665
|
variables: t,
|
|
2639
2666
|
requestHeaders: n,
|
|
2640
2667
|
signal: void 0
|
|
2641
|
-
},
|
|
2668
|
+
}, Ws = (e, t, n) => e.query ? e : {
|
|
2642
2669
|
query: e,
|
|
2643
2670
|
variables: t,
|
|
2644
2671
|
requestHeaders: n,
|
|
2645
2672
|
signal: void 0
|
|
2646
|
-
},
|
|
2673
|
+
}, Ks = (e, t) => e.documents ? e : {
|
|
2647
2674
|
documents: e,
|
|
2648
2675
|
requestHeaders: t,
|
|
2649
2676
|
signal: void 0
|
|
2650
|
-
},
|
|
2677
|
+
}, Zs = (e, t, ...n) => {
|
|
2651
2678
|
const [s, r] = n;
|
|
2652
2679
|
return e.document ? e : {
|
|
2653
2680
|
url: e,
|
|
@@ -2661,20 +2688,20 @@ function ve(e, t) {
|
|
|
2661
2688
|
if (!!!e)
|
|
2662
2689
|
throw new Error(t);
|
|
2663
2690
|
}
|
|
2664
|
-
function
|
|
2691
|
+
function er(e) {
|
|
2665
2692
|
return typeof e == "object" && e !== null;
|
|
2666
2693
|
}
|
|
2667
|
-
function
|
|
2694
|
+
function tr(e, t) {
|
|
2668
2695
|
if (!!!e)
|
|
2669
2696
|
throw new Error(
|
|
2670
2697
|
t ?? "Unexpected invariant triggered."
|
|
2671
2698
|
);
|
|
2672
2699
|
}
|
|
2673
|
-
const
|
|
2700
|
+
const nr = /\r\n|[\n\r]/g;
|
|
2674
2701
|
function Xe(e, t) {
|
|
2675
2702
|
let n = 0, s = 1;
|
|
2676
|
-
for (const r of e.body.matchAll(
|
|
2677
|
-
if (typeof r.index == "number" ||
|
|
2703
|
+
for (const r of e.body.matchAll(nr)) {
|
|
2704
|
+
if (typeof r.index == "number" || tr(!1), r.index >= t)
|
|
2678
2705
|
break;
|
|
2679
2706
|
n = r.index + r[0].length, s += 1;
|
|
2680
2707
|
}
|
|
@@ -2683,7 +2710,7 @@ function Xe(e, t) {
|
|
|
2683
2710
|
column: t + 1 - n
|
|
2684
2711
|
};
|
|
2685
2712
|
}
|
|
2686
|
-
function
|
|
2713
|
+
function sr(e) {
|
|
2687
2714
|
return cn(
|
|
2688
2715
|
e.source,
|
|
2689
2716
|
Xe(e.source, e.start)
|
|
@@ -2696,14 +2723,14 @@ function cn(e, t) {
|
|
|
2696
2723
|
const f = Math.floor(c / 80), m = c % 80, y = [];
|
|
2697
2724
|
for (let v = 0; v < d.length; v += 80)
|
|
2698
2725
|
y.push(d.slice(v, v + 80));
|
|
2699
|
-
return u +
|
|
2726
|
+
return u + Ot([
|
|
2700
2727
|
[`${o} |`, y[0]],
|
|
2701
2728
|
...y.slice(1, f + 1).map((v) => ["|", v]),
|
|
2702
2729
|
["|", "^".padStart(m)],
|
|
2703
2730
|
["|", y[f + 1]]
|
|
2704
2731
|
]);
|
|
2705
2732
|
}
|
|
2706
|
-
return u +
|
|
2733
|
+
return u + Ot([
|
|
2707
2734
|
// Lines specified like this: ["prefix", "string"],
|
|
2708
2735
|
[`${o - 1} |`, h[r - 1]],
|
|
2709
2736
|
[`${o} |`, d],
|
|
@@ -2711,12 +2738,12 @@ function cn(e, t) {
|
|
|
2711
2738
|
[`${o + 1} |`, h[r + 1]]
|
|
2712
2739
|
]);
|
|
2713
2740
|
}
|
|
2714
|
-
function
|
|
2741
|
+
function Ot(e) {
|
|
2715
2742
|
const t = e.filter(([s, r]) => r !== void 0), n = Math.max(...t.map(([s]) => s.length));
|
|
2716
2743
|
return t.map(([s, r]) => s.padStart(n) + (r ? " " + r : "")).join(`
|
|
2717
2744
|
`);
|
|
2718
2745
|
}
|
|
2719
|
-
function
|
|
2746
|
+
function rr(e) {
|
|
2720
2747
|
const t = e[0];
|
|
2721
2748
|
return t == null || "kind" in t || "length" in t ? {
|
|
2722
2749
|
nodes: t,
|
|
@@ -2768,7 +2795,7 @@ class lt extends Error {
|
|
|
2768
2795
|
*/
|
|
2769
2796
|
constructor(t, ...n) {
|
|
2770
2797
|
var s, r, i;
|
|
2771
|
-
const { nodes: o, source: a, positions: c, path: u, originalError: h, extensions: d } =
|
|
2798
|
+
const { nodes: o, source: a, positions: c, path: u, originalError: h, extensions: d } = rr(n);
|
|
2772
2799
|
super(t), this.name = "GraphQLError", this.path = u ?? void 0, this.originalError = h ?? void 0, this.nodes = kt(
|
|
2773
2800
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
2774
2801
|
);
|
|
@@ -2776,7 +2803,7 @@ class lt extends Error {
|
|
|
2776
2803
|
(s = this.nodes) === null || s === void 0 ? void 0 : s.map((y) => y.loc).filter((y) => y != null)
|
|
2777
2804
|
);
|
|
2778
2805
|
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 =
|
|
2806
|
+
const m = er(
|
|
2780
2807
|
h == null ? void 0 : h.extensions
|
|
2781
2808
|
) ? h == null ? void 0 : h.extensions : void 0;
|
|
2782
2809
|
this.extensions = (i = d ?? m) !== null && i !== void 0 ? i : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
@@ -2818,7 +2845,7 @@ class lt extends Error {
|
|
|
2818
2845
|
for (const n of this.nodes)
|
|
2819
2846
|
n.loc && (t += `
|
|
2820
2847
|
|
|
2821
|
-
` +
|
|
2848
|
+
` + sr(n.loc));
|
|
2822
2849
|
else if (this.source && this.locations)
|
|
2823
2850
|
for (const n of this.locations)
|
|
2824
2851
|
t += `
|
|
@@ -2836,13 +2863,13 @@ class lt extends Error {
|
|
|
2836
2863
|
function kt(e) {
|
|
2837
2864
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
2838
2865
|
}
|
|
2839
|
-
function
|
|
2866
|
+
function N(e, t, n) {
|
|
2840
2867
|
return new lt(`Syntax Error: ${n}`, {
|
|
2841
2868
|
source: e,
|
|
2842
2869
|
positions: [t]
|
|
2843
2870
|
});
|
|
2844
2871
|
}
|
|
2845
|
-
class
|
|
2872
|
+
class ir {
|
|
2846
2873
|
/**
|
|
2847
2874
|
* The character offset at which this Node begins.
|
|
2848
2875
|
*/
|
|
@@ -2987,10 +3014,10 @@ const dn = {
|
|
|
2987
3014
|
UnionTypeExtension: ["name", "directives", "types"],
|
|
2988
3015
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
2989
3016
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
2990
|
-
},
|
|
3017
|
+
}, or = new Set(Object.keys(dn));
|
|
2991
3018
|
function Dt(e) {
|
|
2992
3019
|
const t = e == null ? void 0 : e.kind;
|
|
2993
|
-
return typeof t == "string" &&
|
|
3020
|
+
return typeof t == "string" && or.has(t);
|
|
2994
3021
|
}
|
|
2995
3022
|
var ee;
|
|
2996
3023
|
(function(e) {
|
|
@@ -3017,15 +3044,15 @@ function ln(e) {
|
|
|
3017
3044
|
function hn(e) {
|
|
3018
3045
|
return ln(e) || e === 95;
|
|
3019
3046
|
}
|
|
3020
|
-
function
|
|
3047
|
+
function ar(e) {
|
|
3021
3048
|
return ln(e) || de(e) || e === 95;
|
|
3022
3049
|
}
|
|
3023
|
-
function
|
|
3050
|
+
function cr(e) {
|
|
3024
3051
|
var t;
|
|
3025
3052
|
let n = Number.MAX_SAFE_INTEGER, s = null, r = -1;
|
|
3026
3053
|
for (let o = 0; o < e.length; ++o) {
|
|
3027
3054
|
var i;
|
|
3028
|
-
const a = e[o], c =
|
|
3055
|
+
const a = e[o], c = ur(a);
|
|
3029
3056
|
c !== a.length && (s = (i = s) !== null && i !== void 0 ? i : o, r = o, o !== 0 && c < n && (n = c));
|
|
3030
3057
|
}
|
|
3031
3058
|
return e.map((o, a) => a === 0 ? o : o.slice(n)).slice(
|
|
@@ -3033,13 +3060,13 @@ function ar(e) {
|
|
|
3033
3060
|
r + 1
|
|
3034
3061
|
);
|
|
3035
3062
|
}
|
|
3036
|
-
function
|
|
3063
|
+
function ur(e) {
|
|
3037
3064
|
let t = 0;
|
|
3038
3065
|
for (; t < e.length && Ke(e.charCodeAt(t)); )
|
|
3039
3066
|
++t;
|
|
3040
3067
|
return t;
|
|
3041
3068
|
}
|
|
3042
|
-
function
|
|
3069
|
+
function dr(e, t) {
|
|
3043
3070
|
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
|
|
3044
3071
|
(!r || e.length > 70 || u || i || o);
|
|
3045
3072
|
let d = "";
|
|
@@ -3052,7 +3079,7 @@ var p;
|
|
|
3052
3079
|
(function(e) {
|
|
3053
3080
|
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";
|
|
3054
3081
|
})(p || (p = {}));
|
|
3055
|
-
class
|
|
3082
|
+
class lr {
|
|
3056
3083
|
/**
|
|
3057
3084
|
* The previously focused non-ignored token.
|
|
3058
3085
|
*/
|
|
@@ -3089,14 +3116,14 @@ class dr {
|
|
|
3089
3116
|
if (t.next)
|
|
3090
3117
|
t = t.next;
|
|
3091
3118
|
else {
|
|
3092
|
-
const n =
|
|
3119
|
+
const n = fr(this, t.end);
|
|
3093
3120
|
t.next = n, n.prev = t, t = n;
|
|
3094
3121
|
}
|
|
3095
3122
|
while (t.kind === p.COMMENT);
|
|
3096
3123
|
return t;
|
|
3097
3124
|
}
|
|
3098
3125
|
}
|
|
3099
|
-
function
|
|
3126
|
+
function hr(e) {
|
|
3100
3127
|
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;
|
|
3101
3128
|
}
|
|
3102
3129
|
function re(e) {
|
|
@@ -3121,11 +3148,11 @@ function Q(e, t) {
|
|
|
3121
3148
|
}
|
|
3122
3149
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
3123
3150
|
}
|
|
3124
|
-
function
|
|
3151
|
+
function x(e, t, n, s, r) {
|
|
3125
3152
|
const i = e.line, o = 1 + n - e.lineStart;
|
|
3126
3153
|
return new un(t, n, s, i, o, r);
|
|
3127
3154
|
}
|
|
3128
|
-
function
|
|
3155
|
+
function fr(e, t) {
|
|
3129
3156
|
const n = e.source.body, s = n.length;
|
|
3130
3157
|
let r = t;
|
|
3131
3158
|
for (; r < s; ) {
|
|
@@ -3144,53 +3171,53 @@ function hr(e, t) {
|
|
|
3144
3171
|
n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
|
|
3145
3172
|
continue;
|
|
3146
3173
|
case 35:
|
|
3147
|
-
return
|
|
3174
|
+
return pr(e, r);
|
|
3148
3175
|
case 33:
|
|
3149
|
-
return
|
|
3176
|
+
return x(e, p.BANG, r, r + 1);
|
|
3150
3177
|
case 36:
|
|
3151
|
-
return
|
|
3178
|
+
return x(e, p.DOLLAR, r, r + 1);
|
|
3152
3179
|
case 38:
|
|
3153
|
-
return
|
|
3180
|
+
return x(e, p.AMP, r, r + 1);
|
|
3154
3181
|
case 40:
|
|
3155
|
-
return
|
|
3182
|
+
return x(e, p.PAREN_L, r, r + 1);
|
|
3156
3183
|
case 41:
|
|
3157
|
-
return
|
|
3184
|
+
return x(e, p.PAREN_R, r, r + 1);
|
|
3158
3185
|
case 46:
|
|
3159
3186
|
if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
|
|
3160
|
-
return
|
|
3187
|
+
return x(e, p.SPREAD, r, r + 3);
|
|
3161
3188
|
break;
|
|
3162
3189
|
case 58:
|
|
3163
|
-
return
|
|
3190
|
+
return x(e, p.COLON, r, r + 1);
|
|
3164
3191
|
case 61:
|
|
3165
|
-
return
|
|
3192
|
+
return x(e, p.EQUALS, r, r + 1);
|
|
3166
3193
|
case 64:
|
|
3167
|
-
return
|
|
3194
|
+
return x(e, p.AT, r, r + 1);
|
|
3168
3195
|
case 91:
|
|
3169
|
-
return
|
|
3196
|
+
return x(e, p.BRACKET_L, r, r + 1);
|
|
3170
3197
|
case 93:
|
|
3171
|
-
return
|
|
3198
|
+
return x(e, p.BRACKET_R, r, r + 1);
|
|
3172
3199
|
case 123:
|
|
3173
|
-
return
|
|
3200
|
+
return x(e, p.BRACE_L, r, r + 1);
|
|
3174
3201
|
case 124:
|
|
3175
|
-
return
|
|
3202
|
+
return x(e, p.PIPE, r, r + 1);
|
|
3176
3203
|
case 125:
|
|
3177
|
-
return
|
|
3204
|
+
return x(e, p.BRACE_R, r, r + 1);
|
|
3178
3205
|
case 34:
|
|
3179
|
-
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ?
|
|
3206
|
+
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Tr(e, r) : mr(e, r);
|
|
3180
3207
|
}
|
|
3181
3208
|
if (de(i) || i === 45)
|
|
3182
|
-
return
|
|
3209
|
+
return yr(e, r, i);
|
|
3183
3210
|
if (hn(i))
|
|
3184
|
-
return
|
|
3185
|
-
throw
|
|
3211
|
+
return _r(e, r);
|
|
3212
|
+
throw N(
|
|
3186
3213
|
e.source,
|
|
3187
3214
|
r,
|
|
3188
3215
|
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)}.`
|
|
3189
3216
|
);
|
|
3190
3217
|
}
|
|
3191
|
-
return
|
|
3218
|
+
return x(e, p.EOF, s, s);
|
|
3192
3219
|
}
|
|
3193
|
-
function
|
|
3220
|
+
function pr(e, t) {
|
|
3194
3221
|
const n = e.source.body, s = n.length;
|
|
3195
3222
|
let r = t + 1;
|
|
3196
3223
|
for (; r < s; ) {
|
|
@@ -3204,7 +3231,7 @@ function fr(e, t) {
|
|
|
3204
3231
|
else
|
|
3205
3232
|
break;
|
|
3206
3233
|
}
|
|
3207
|
-
return
|
|
3234
|
+
return x(
|
|
3208
3235
|
e,
|
|
3209
3236
|
p.COMMENT,
|
|
3210
3237
|
t,
|
|
@@ -3212,12 +3239,12 @@ function fr(e, t) {
|
|
|
3212
3239
|
n.slice(t + 1, r)
|
|
3213
3240
|
);
|
|
3214
3241
|
}
|
|
3215
|
-
function
|
|
3242
|
+
function yr(e, t, n) {
|
|
3216
3243
|
const s = e.source.body;
|
|
3217
3244
|
let r = t, i = n, o = !1;
|
|
3218
3245
|
if (i === 45 && (i = s.charCodeAt(++r)), i === 48) {
|
|
3219
3246
|
if (i = s.charCodeAt(++r), de(i))
|
|
3220
|
-
throw
|
|
3247
|
+
throw N(
|
|
3221
3248
|
e.source,
|
|
3222
3249
|
r,
|
|
3223
3250
|
`Invalid number, unexpected digit after 0: ${Q(
|
|
@@ -3228,7 +3255,7 @@ function pr(e, t, n) {
|
|
|
3228
3255
|
} else
|
|
3229
3256
|
r = Be(e, r, i), i = s.charCodeAt(r);
|
|
3230
3257
|
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))
|
|
3231
|
-
throw
|
|
3258
|
+
throw N(
|
|
3232
3259
|
e.source,
|
|
3233
3260
|
r,
|
|
3234
3261
|
`Invalid number, expected digit but got: ${Q(
|
|
@@ -3236,7 +3263,7 @@ function pr(e, t, n) {
|
|
|
3236
3263
|
r
|
|
3237
3264
|
)}.`
|
|
3238
3265
|
);
|
|
3239
|
-
return
|
|
3266
|
+
return x(
|
|
3240
3267
|
e,
|
|
3241
3268
|
o ? p.FLOAT : p.INT,
|
|
3242
3269
|
t,
|
|
@@ -3246,7 +3273,7 @@ function pr(e, t, n) {
|
|
|
3246
3273
|
}
|
|
3247
3274
|
function Be(e, t, n) {
|
|
3248
3275
|
if (!de(n))
|
|
3249
|
-
throw
|
|
3276
|
+
throw N(
|
|
3250
3277
|
e.source,
|
|
3251
3278
|
t,
|
|
3252
3279
|
`Invalid number, expected digit but got: ${Q(
|
|
@@ -3260,16 +3287,16 @@ function Be(e, t, n) {
|
|
|
3260
3287
|
++r;
|
|
3261
3288
|
return r;
|
|
3262
3289
|
}
|
|
3263
|
-
function
|
|
3290
|
+
function mr(e, t) {
|
|
3264
3291
|
const n = e.source.body, s = n.length;
|
|
3265
3292
|
let r = t + 1, i = r, o = "";
|
|
3266
3293
|
for (; r < s; ) {
|
|
3267
3294
|
const a = n.charCodeAt(r);
|
|
3268
3295
|
if (a === 34)
|
|
3269
|
-
return o += n.slice(i, r),
|
|
3296
|
+
return o += n.slice(i, r), x(e, p.STRING, t, r + 1, o);
|
|
3270
3297
|
if (a === 92) {
|
|
3271
3298
|
o += n.slice(i, r);
|
|
3272
|
-
const c = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ?
|
|
3299
|
+
const c = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? gr(e, r) : Er(e, r) : vr(e, r);
|
|
3273
3300
|
o += c.value, r += c.size, i = r;
|
|
3274
3301
|
continue;
|
|
3275
3302
|
}
|
|
@@ -3280,7 +3307,7 @@ function yr(e, t) {
|
|
|
3280
3307
|
else if (De(n, r))
|
|
3281
3308
|
r += 2;
|
|
3282
3309
|
else
|
|
3283
|
-
throw
|
|
3310
|
+
throw N(
|
|
3284
3311
|
e.source,
|
|
3285
3312
|
r,
|
|
3286
3313
|
`Invalid character within String: ${Q(
|
|
@@ -3289,9 +3316,9 @@ function yr(e, t) {
|
|
|
3289
3316
|
)}.`
|
|
3290
3317
|
);
|
|
3291
3318
|
}
|
|
3292
|
-
throw
|
|
3319
|
+
throw N(e.source, r, "Unterminated string.");
|
|
3293
3320
|
}
|
|
3294
|
-
function
|
|
3321
|
+
function gr(e, t) {
|
|
3295
3322
|
const n = e.source.body;
|
|
3296
3323
|
let s = 0, r = 3;
|
|
3297
3324
|
for (; r < 12; ) {
|
|
@@ -3307,7 +3334,7 @@ function mr(e, t) {
|
|
|
3307
3334
|
if (s = s << 4 | ae(i), s < 0)
|
|
3308
3335
|
break;
|
|
3309
3336
|
}
|
|
3310
|
-
throw
|
|
3337
|
+
throw N(
|
|
3311
3338
|
e.source,
|
|
3312
3339
|
t,
|
|
3313
3340
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
@@ -3316,7 +3343,7 @@ function mr(e, t) {
|
|
|
3316
3343
|
)}".`
|
|
3317
3344
|
);
|
|
3318
3345
|
}
|
|
3319
|
-
function
|
|
3346
|
+
function Er(e, t) {
|
|
3320
3347
|
const n = e.source.body, s = Rt(n, t + 2);
|
|
3321
3348
|
if (re(s))
|
|
3322
3349
|
return {
|
|
@@ -3331,7 +3358,7 @@ function gr(e, t) {
|
|
|
3331
3358
|
size: 12
|
|
3332
3359
|
};
|
|
3333
3360
|
}
|
|
3334
|
-
throw
|
|
3361
|
+
throw N(
|
|
3335
3362
|
e.source,
|
|
3336
3363
|
t,
|
|
3337
3364
|
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
@@ -3343,7 +3370,7 @@ function Rt(e, t) {
|
|
|
3343
3370
|
function ae(e) {
|
|
3344
3371
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
3345
3372
|
}
|
|
3346
|
-
function
|
|
3373
|
+
function vr(e, t) {
|
|
3347
3374
|
const n = e.source.body;
|
|
3348
3375
|
switch (n.charCodeAt(t + 1)) {
|
|
3349
3376
|
case 34:
|
|
@@ -3388,7 +3415,7 @@ function Er(e, t) {
|
|
|
3388
3415
|
size: 2
|
|
3389
3416
|
};
|
|
3390
3417
|
}
|
|
3391
|
-
throw
|
|
3418
|
+
throw N(
|
|
3392
3419
|
e.source,
|
|
3393
3420
|
t,
|
|
3394
3421
|
`Invalid character escape sequence: "${n.slice(
|
|
@@ -3397,7 +3424,7 @@ function Er(e, t) {
|
|
|
3397
3424
|
)}".`
|
|
3398
3425
|
);
|
|
3399
3426
|
}
|
|
3400
|
-
function
|
|
3427
|
+
function Tr(e, t) {
|
|
3401
3428
|
const n = e.source.body, s = n.length;
|
|
3402
3429
|
let r = e.lineStart, i = t + 3, o = i, a = "";
|
|
3403
3430
|
const c = [];
|
|
@@ -3405,13 +3432,13 @@ function vr(e, t) {
|
|
|
3405
3432
|
const u = n.charCodeAt(i);
|
|
3406
3433
|
if (u === 34 && n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34) {
|
|
3407
3434
|
a += n.slice(o, i), c.push(a);
|
|
3408
|
-
const h =
|
|
3435
|
+
const h = x(
|
|
3409
3436
|
e,
|
|
3410
3437
|
p.BLOCK_STRING,
|
|
3411
3438
|
t,
|
|
3412
3439
|
i + 3,
|
|
3413
3440
|
// Return a string of the lines joined with U+000A.
|
|
3414
|
-
|
|
3441
|
+
cr(c).join(`
|
|
3415
3442
|
`)
|
|
3416
3443
|
);
|
|
3417
3444
|
return e.line += c.length - 1, e.lineStart = r, h;
|
|
@@ -3429,7 +3456,7 @@ function vr(e, t) {
|
|
|
3429
3456
|
else if (De(n, i))
|
|
3430
3457
|
i += 2;
|
|
3431
3458
|
else
|
|
3432
|
-
throw
|
|
3459
|
+
throw N(
|
|
3433
3460
|
e.source,
|
|
3434
3461
|
i,
|
|
3435
3462
|
`Invalid character within String: ${Q(
|
|
@@ -3438,19 +3465,19 @@ function vr(e, t) {
|
|
|
3438
3465
|
)}.`
|
|
3439
3466
|
);
|
|
3440
3467
|
}
|
|
3441
|
-
throw
|
|
3468
|
+
throw N(e.source, i, "Unterminated string.");
|
|
3442
3469
|
}
|
|
3443
|
-
function
|
|
3470
|
+
function _r(e, t) {
|
|
3444
3471
|
const n = e.source.body, s = n.length;
|
|
3445
3472
|
let r = t + 1;
|
|
3446
3473
|
for (; r < s; ) {
|
|
3447
3474
|
const i = n.charCodeAt(r);
|
|
3448
|
-
if (
|
|
3475
|
+
if (ar(i))
|
|
3449
3476
|
++r;
|
|
3450
3477
|
else
|
|
3451
3478
|
break;
|
|
3452
3479
|
}
|
|
3453
|
-
return
|
|
3480
|
+
return x(
|
|
3454
3481
|
e,
|
|
3455
3482
|
p.NAME,
|
|
3456
3483
|
t,
|
|
@@ -3458,7 +3485,7 @@ function Tr(e, t) {
|
|
|
3458
3485
|
n.slice(t, r)
|
|
3459
3486
|
);
|
|
3460
3487
|
}
|
|
3461
|
-
const
|
|
3488
|
+
const Sr = 10, yn = 2;
|
|
3462
3489
|
function ht(e) {
|
|
3463
3490
|
return Re(e, []);
|
|
3464
3491
|
}
|
|
@@ -3469,31 +3496,31 @@ function Re(e, t) {
|
|
|
3469
3496
|
case "function":
|
|
3470
3497
|
return e.name ? `[function ${e.name}]` : "[function]";
|
|
3471
3498
|
case "object":
|
|
3472
|
-
return
|
|
3499
|
+
return Ir(e, t);
|
|
3473
3500
|
default:
|
|
3474
3501
|
return String(e);
|
|
3475
3502
|
}
|
|
3476
3503
|
}
|
|
3477
|
-
function
|
|
3504
|
+
function Ir(e, t) {
|
|
3478
3505
|
if (e === null)
|
|
3479
3506
|
return "null";
|
|
3480
3507
|
if (t.includes(e))
|
|
3481
3508
|
return "[Circular]";
|
|
3482
3509
|
const n = [...t, e];
|
|
3483
|
-
if (
|
|
3510
|
+
if (Ar(e)) {
|
|
3484
3511
|
const s = e.toJSON();
|
|
3485
3512
|
if (s !== e)
|
|
3486
3513
|
return typeof s == "string" ? s : Re(s, n);
|
|
3487
3514
|
} else if (Array.isArray(e))
|
|
3488
3515
|
return xr(e, n);
|
|
3489
|
-
return
|
|
3516
|
+
return wr(e, n);
|
|
3490
3517
|
}
|
|
3491
|
-
function
|
|
3518
|
+
function Ar(e) {
|
|
3492
3519
|
return typeof e.toJSON == "function";
|
|
3493
3520
|
}
|
|
3494
|
-
function
|
|
3521
|
+
function wr(e, t) {
|
|
3495
3522
|
const n = Object.entries(e);
|
|
3496
|
-
return n.length === 0 ? "{}" : t.length > yn ? "[" +
|
|
3523
|
+
return n.length === 0 ? "{}" : t.length > yn ? "[" + br(e) + "]" : "{ " + n.map(
|
|
3497
3524
|
([r, i]) => r + ": " + Re(i, t)
|
|
3498
3525
|
).join(", ") + " }";
|
|
3499
3526
|
}
|
|
@@ -3502,12 +3529,12 @@ function xr(e, t) {
|
|
|
3502
3529
|
return "[]";
|
|
3503
3530
|
if (t.length > yn)
|
|
3504
3531
|
return "[Array]";
|
|
3505
|
-
const n = Math.min(
|
|
3532
|
+
const n = Math.min(Sr, e.length), s = e.length - n, r = [];
|
|
3506
3533
|
for (let i = 0; i < n; ++i)
|
|
3507
3534
|
r.push(Re(e[i], t));
|
|
3508
3535
|
return s === 1 ? r.push("... 1 more item") : s > 1 && r.push(`... ${s} more items`), "[" + r.join(", ") + "]";
|
|
3509
3536
|
}
|
|
3510
|
-
function
|
|
3537
|
+
function br(e) {
|
|
3511
3538
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
3512
3539
|
if (t === "Object" && typeof e.constructor == "function") {
|
|
3513
3540
|
const n = e.constructor.name;
|
|
@@ -3516,11 +3543,11 @@ function wr(e) {
|
|
|
3516
3543
|
}
|
|
3517
3544
|
return t;
|
|
3518
3545
|
}
|
|
3519
|
-
const
|
|
3520
|
-
process.env.NODE_ENV === "production",
|
|
3546
|
+
const Nr = globalThis.process && // eslint-disable-next-line no-undef
|
|
3547
|
+
process.env.NODE_ENV === "production", Cr = (
|
|
3521
3548
|
/* c8 ignore next 6 */
|
|
3522
3549
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
3523
|
-
|
|
3550
|
+
Nr ? function(t, n) {
|
|
3524
3551
|
return t instanceof n;
|
|
3525
3552
|
} : function(t, n) {
|
|
3526
3553
|
if (t instanceof n)
|
|
@@ -3568,15 +3595,15 @@ class mn {
|
|
|
3568
3595
|
}
|
|
3569
3596
|
}
|
|
3570
3597
|
function Or(e) {
|
|
3571
|
-
return
|
|
3598
|
+
return Cr(e, mn);
|
|
3572
3599
|
}
|
|
3573
|
-
function
|
|
3574
|
-
return new
|
|
3600
|
+
function kr(e, t) {
|
|
3601
|
+
return new Dr(e, t).parseDocument();
|
|
3575
3602
|
}
|
|
3576
|
-
class
|
|
3603
|
+
class Dr {
|
|
3577
3604
|
constructor(t, n = {}) {
|
|
3578
3605
|
const s = Or(t) ? t : new mn(t);
|
|
3579
|
-
this._lexer = new
|
|
3606
|
+
this._lexer = new lr(s), this._options = n, this._tokenCounter = 0;
|
|
3580
3607
|
}
|
|
3581
3608
|
/**
|
|
3582
3609
|
* Converts a name lex token into a name parse node.
|
|
@@ -3649,7 +3676,7 @@ class kr {
|
|
|
3649
3676
|
return this.parseDirectiveDefinition();
|
|
3650
3677
|
}
|
|
3651
3678
|
if (t)
|
|
3652
|
-
throw
|
|
3679
|
+
throw N(
|
|
3653
3680
|
this._lexer.source,
|
|
3654
3681
|
this._lexer.token.start,
|
|
3655
3682
|
"Unexpected description, descriptions are supported only on type definitions."
|
|
@@ -3923,7 +3950,7 @@ class kr {
|
|
|
3923
3950
|
if (t)
|
|
3924
3951
|
if (this.expectToken(p.DOLLAR), this._lexer.token.kind === p.NAME) {
|
|
3925
3952
|
const s = this._lexer.token.value;
|
|
3926
|
-
throw
|
|
3953
|
+
throw N(
|
|
3927
3954
|
this._lexer.source,
|
|
3928
3955
|
n.start,
|
|
3929
3956
|
`Unexpected variable "$${s}" in constant value.`
|
|
@@ -4270,7 +4297,7 @@ class kr {
|
|
|
4270
4297
|
*/
|
|
4271
4298
|
parseEnumValueName() {
|
|
4272
4299
|
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
|
|
4273
|
-
throw
|
|
4300
|
+
throw N(
|
|
4274
4301
|
this._lexer.source,
|
|
4275
4302
|
this._lexer.token.start,
|
|
4276
4303
|
`${ge(
|
|
@@ -4543,7 +4570,7 @@ class kr {
|
|
|
4543
4570
|
* given parsed object.
|
|
4544
4571
|
*/
|
|
4545
4572
|
node(t, n) {
|
|
4546
|
-
return this._options.noLocation !== !0 && (n.loc = new
|
|
4573
|
+
return this._options.noLocation !== !0 && (n.loc = new ir(
|
|
4547
4574
|
t,
|
|
4548
4575
|
this._lexer.lastToken,
|
|
4549
4576
|
this._lexer.source
|
|
@@ -4563,7 +4590,7 @@ class kr {
|
|
|
4563
4590
|
const n = this._lexer.token;
|
|
4564
4591
|
if (n.kind === t)
|
|
4565
4592
|
return this.advanceLexer(), n;
|
|
4566
|
-
throw
|
|
4593
|
+
throw N(
|
|
4567
4594
|
this._lexer.source,
|
|
4568
4595
|
n.start,
|
|
4569
4596
|
`Expected ${gn(t)}, found ${ge(n)}.`
|
|
@@ -4585,7 +4612,7 @@ class kr {
|
|
|
4585
4612
|
if (n.kind === p.NAME && n.value === t)
|
|
4586
4613
|
this.advanceLexer();
|
|
4587
4614
|
else
|
|
4588
|
-
throw
|
|
4615
|
+
throw N(
|
|
4589
4616
|
this._lexer.source,
|
|
4590
4617
|
n.start,
|
|
4591
4618
|
`Expected "${t}", found ${ge(n)}.`
|
|
@@ -4604,7 +4631,7 @@ class kr {
|
|
|
4604
4631
|
*/
|
|
4605
4632
|
unexpected(t) {
|
|
4606
4633
|
const n = t ?? this._lexer.token;
|
|
4607
|
-
return
|
|
4634
|
+
return N(
|
|
4608
4635
|
this._lexer.source,
|
|
4609
4636
|
n.start,
|
|
4610
4637
|
`Unexpected ${ge(n)}.`
|
|
@@ -4667,7 +4694,7 @@ class kr {
|
|
|
4667
4694
|
advanceLexer() {
|
|
4668
4695
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
4669
4696
|
if (t !== void 0 && n.kind !== p.EOF && (++this._tokenCounter, this._tokenCounter > t))
|
|
4670
|
-
throw
|
|
4697
|
+
throw N(
|
|
4671
4698
|
this._lexer.source,
|
|
4672
4699
|
n.start,
|
|
4673
4700
|
`Document contains more that ${t} tokens. Parsing aborted.`
|
|
@@ -4679,16 +4706,16 @@ function ge(e) {
|
|
|
4679
4706
|
return gn(e.kind) + (t != null ? ` "${t}"` : "");
|
|
4680
4707
|
}
|
|
4681
4708
|
function gn(e) {
|
|
4682
|
-
return
|
|
4709
|
+
return hr(e) ? `"${e}"` : e;
|
|
4683
4710
|
}
|
|
4684
|
-
function
|
|
4685
|
-
return `"${e.replace(
|
|
4711
|
+
function Rr(e) {
|
|
4712
|
+
return `"${e.replace(qr, Mr)}"`;
|
|
4686
4713
|
}
|
|
4687
|
-
const
|
|
4688
|
-
function
|
|
4689
|
-
return
|
|
4714
|
+
const qr = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
4715
|
+
function Mr(e) {
|
|
4716
|
+
return Lr[e.charCodeAt(0)];
|
|
4690
4717
|
}
|
|
4691
|
-
const
|
|
4718
|
+
const Lr = [
|
|
4692
4719
|
"\\u0000",
|
|
4693
4720
|
"\\u0001",
|
|
4694
4721
|
"\\u0002",
|
|
@@ -4854,17 +4881,17 @@ const Mr = [
|
|
|
4854
4881
|
"\\u009D",
|
|
4855
4882
|
"\\u009E",
|
|
4856
4883
|
"\\u009F"
|
|
4857
|
-
],
|
|
4884
|
+
], Pr = Object.freeze({});
|
|
4858
4885
|
function Ur(e, t, n = dn) {
|
|
4859
4886
|
const s = /* @__PURE__ */ new Map();
|
|
4860
|
-
for (const
|
|
4861
|
-
s.set(
|
|
4887
|
+
for (const w of Object.values(T))
|
|
4888
|
+
s.set(w, Fr(t, w));
|
|
4862
4889
|
let r, i = Array.isArray(e), o = [e], a = -1, c = [], u = e, h, d;
|
|
4863
4890
|
const f = [], m = [];
|
|
4864
4891
|
do {
|
|
4865
4892
|
a++;
|
|
4866
|
-
const
|
|
4867
|
-
if (
|
|
4893
|
+
const w = a === o.length, R = w && c.length !== 0;
|
|
4894
|
+
if (w) {
|
|
4868
4895
|
if (h = m.length === 0 ? void 0 : f[f.length - 1], u = d, d = m.pop(), R)
|
|
4869
4896
|
if (i) {
|
|
4870
4897
|
u = u.slice();
|
|
@@ -4891,15 +4918,15 @@ function Ur(e, t, n = dn) {
|
|
|
4891
4918
|
if (!Array.isArray(u)) {
|
|
4892
4919
|
var y, v;
|
|
4893
4920
|
Dt(u) || ve(!1, `Invalid AST Node: ${ht(u)}.`);
|
|
4894
|
-
const q =
|
|
4895
|
-
if (k = q == null ? void 0 : q.call(t, u, h, d, f, m), k ===
|
|
4921
|
+
const q = w ? (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;
|
|
4922
|
+
if (k = q == null ? void 0 : q.call(t, u, h, d, f, m), k === Pr)
|
|
4896
4923
|
break;
|
|
4897
4924
|
if (k === !1) {
|
|
4898
|
-
if (!
|
|
4925
|
+
if (!w) {
|
|
4899
4926
|
f.pop();
|
|
4900
4927
|
continue;
|
|
4901
4928
|
}
|
|
4902
|
-
} else if (k !== void 0 && (c.push([h, k]), !
|
|
4929
|
+
} else if (k !== void 0 && (c.push([h, k]), !w))
|
|
4903
4930
|
if (Dt(k))
|
|
4904
4931
|
u = k;
|
|
4905
4932
|
else {
|
|
@@ -4907,7 +4934,7 @@ function Ur(e, t, n = dn) {
|
|
|
4907
4934
|
continue;
|
|
4908
4935
|
}
|
|
4909
4936
|
}
|
|
4910
|
-
if (k === void 0 && R && c.push([h, u]),
|
|
4937
|
+
if (k === void 0 && R && c.push([h, u]), w)
|
|
4911
4938
|
f.pop();
|
|
4912
4939
|
else {
|
|
4913
4940
|
var I;
|
|
@@ -4922,7 +4949,7 @@ function Ur(e, t, n = dn) {
|
|
|
4922
4949
|
} while (r !== void 0);
|
|
4923
4950
|
return c.length !== 0 ? c[c.length - 1][1] : e;
|
|
4924
4951
|
}
|
|
4925
|
-
function
|
|
4952
|
+
function Fr(e, t) {
|
|
4926
4953
|
const n = e[t];
|
|
4927
4954
|
return typeof n == "object" ? n : typeof n == "function" ? {
|
|
4928
4955
|
enter: n,
|
|
@@ -4933,9 +4960,9 @@ function Pr(e, t) {
|
|
|
4933
4960
|
};
|
|
4934
4961
|
}
|
|
4935
4962
|
function En(e) {
|
|
4936
|
-
return Ur(e,
|
|
4963
|
+
return Ur(e, jr);
|
|
4937
4964
|
}
|
|
4938
|
-
const
|
|
4965
|
+
const Br = 80, jr = {
|
|
4939
4966
|
Name: {
|
|
4940
4967
|
leave: (e) => e.value
|
|
4941
4968
|
},
|
|
@@ -4971,7 +4998,7 @@ const Fr = 80, Br = {
|
|
|
4971
4998
|
leave({ alias: e, name: t, arguments: n, directives: s, selectionSet: r }) {
|
|
4972
4999
|
const i = S("", e, ": ") + t;
|
|
4973
5000
|
let o = i + S("(", E(n, ", "), ")");
|
|
4974
|
-
return o.length >
|
|
5001
|
+
return o.length > Br && (o = i + S(`(
|
|
4975
5002
|
`, Te(E(n, `
|
|
4976
5003
|
`)), `
|
|
4977
5004
|
)`)), E([o, E(s, " "), r], " ");
|
|
@@ -5009,7 +5036,7 @@ const Fr = 80, Br = {
|
|
|
5009
5036
|
leave: ({ value: e }) => e
|
|
5010
5037
|
},
|
|
5011
5038
|
StringValue: {
|
|
5012
|
-
leave: ({ value: e, block: t }) => t ?
|
|
5039
|
+
leave: ({ value: e, block: t }) => t ? dr(e) : Rr(e)
|
|
5013
5040
|
},
|
|
5014
5041
|
BooleanValue: {
|
|
5015
5042
|
leave: ({ value: e }) => e ? "true" : "false"
|
|
@@ -5203,7 +5230,7 @@ const Mt = (e) => {
|
|
|
5203
5230
|
if (typeof e == "string") {
|
|
5204
5231
|
let n;
|
|
5205
5232
|
try {
|
|
5206
|
-
const s =
|
|
5233
|
+
const s = kr(e);
|
|
5207
5234
|
n = Mt(s);
|
|
5208
5235
|
} catch {
|
|
5209
5236
|
}
|
|
@@ -5225,13 +5252,13 @@ class ce extends Error {
|
|
|
5225
5252
|
return ((s = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : s.message) ?? `GraphQL Error (Code: ${t.status})`;
|
|
5226
5253
|
}
|
|
5227
5254
|
}
|
|
5228
|
-
var
|
|
5229
|
-
function
|
|
5255
|
+
var $r = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
5256
|
+
function Vr(e) {
|
|
5230
5257
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
5231
5258
|
}
|
|
5232
5259
|
var Ze = { exports: {} };
|
|
5233
5260
|
(function(e, t) {
|
|
5234
|
-
var n = typeof self < "u" ? self :
|
|
5261
|
+
var n = typeof self < "u" ? self : $r, s = function() {
|
|
5235
5262
|
function i() {
|
|
5236
5263
|
this.fetch = !1, this.DOMException = n.DOMException;
|
|
5237
5264
|
}
|
|
@@ -5342,7 +5369,7 @@ var Ze = { exports: {} };
|
|
|
5342
5369
|
};
|
|
5343
5370
|
});
|
|
5344
5371
|
}
|
|
5345
|
-
function
|
|
5372
|
+
function w(l) {
|
|
5346
5373
|
var g = new FileReader(), _ = I(g);
|
|
5347
5374
|
return g.readAsArrayBuffer(l), _;
|
|
5348
5375
|
}
|
|
@@ -5351,8 +5378,8 @@ var Ze = { exports: {} };
|
|
|
5351
5378
|
return g.readAsText(l), _;
|
|
5352
5379
|
}
|
|
5353
5380
|
function k(l) {
|
|
5354
|
-
for (var g = new Uint8Array(l), _ = new Array(g.length),
|
|
5355
|
-
_[
|
|
5381
|
+
for (var g = new Uint8Array(l), _ = new Array(g.length), O = 0; O < g.length; O++)
|
|
5382
|
+
_[O] = String.fromCharCode(g[O]);
|
|
5356
5383
|
return _.join("");
|
|
5357
5384
|
}
|
|
5358
5385
|
function q(l) {
|
|
@@ -5376,7 +5403,7 @@ var Ze = { exports: {} };
|
|
|
5376
5403
|
throw new Error("could not read FormData body as blob");
|
|
5377
5404
|
return Promise.resolve(new Blob([this._bodyText]));
|
|
5378
5405
|
}, this.arrayBuffer = function() {
|
|
5379
|
-
return this._bodyArrayBuffer ? v(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(
|
|
5406
|
+
return this._bodyArrayBuffer ? v(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(w);
|
|
5380
5407
|
}), this.text = function() {
|
|
5381
5408
|
var l = v(this);
|
|
5382
5409
|
if (l)
|
|
@@ -5419,56 +5446,56 @@ var Ze = { exports: {} };
|
|
|
5419
5446
|
var g = new FormData();
|
|
5420
5447
|
return l.trim().split("&").forEach(function(_) {
|
|
5421
5448
|
if (_) {
|
|
5422
|
-
var
|
|
5423
|
-
g.append(decodeURIComponent(
|
|
5449
|
+
var O = _.split("="), C = O.shift().replace(/\+/g, " "), A = O.join("=").replace(/\+/g, " ");
|
|
5450
|
+
g.append(decodeURIComponent(C), decodeURIComponent(A));
|
|
5424
5451
|
}
|
|
5425
5452
|
}), g;
|
|
5426
5453
|
}
|
|
5427
5454
|
function pe(l) {
|
|
5428
5455
|
var g = new y(), _ = l.replace(/\r?\n[\t ]+/g, " ");
|
|
5429
|
-
return _.split(/\r?\n/).forEach(function(
|
|
5430
|
-
var
|
|
5456
|
+
return _.split(/\r?\n/).forEach(function(O) {
|
|
5457
|
+
var C = O.split(":"), A = C.shift().trim();
|
|
5431
5458
|
if (A) {
|
|
5432
|
-
var ye =
|
|
5459
|
+
var ye = C.join(":").trim();
|
|
5433
5460
|
g.append(A, ye);
|
|
5434
5461
|
}
|
|
5435
5462
|
}), g;
|
|
5436
5463
|
}
|
|
5437
5464
|
F.call(L.prototype);
|
|
5438
|
-
function
|
|
5465
|
+
function P(l, g) {
|
|
5439
5466
|
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);
|
|
5440
5467
|
}
|
|
5441
|
-
F.call(
|
|
5442
|
-
return new
|
|
5468
|
+
F.call(P.prototype), P.prototype.clone = function() {
|
|
5469
|
+
return new P(this._bodyInit, {
|
|
5443
5470
|
status: this.status,
|
|
5444
5471
|
statusText: this.statusText,
|
|
5445
5472
|
headers: new y(this.headers),
|
|
5446
5473
|
url: this.url
|
|
5447
5474
|
});
|
|
5448
|
-
},
|
|
5449
|
-
var l = new
|
|
5475
|
+
}, P.error = function() {
|
|
5476
|
+
var l = new P(null, { status: 0, statusText: "" });
|
|
5450
5477
|
return l.type = "error", l;
|
|
5451
5478
|
};
|
|
5452
5479
|
var In = [301, 302, 303, 307, 308];
|
|
5453
|
-
|
|
5480
|
+
P.redirect = function(l, g) {
|
|
5454
5481
|
if (In.indexOf(g) === -1)
|
|
5455
5482
|
throw new RangeError("Invalid status code");
|
|
5456
|
-
return new
|
|
5483
|
+
return new P(null, { status: g, headers: { location: l } });
|
|
5457
5484
|
}, o.DOMException = i.DOMException;
|
|
5458
5485
|
try {
|
|
5459
5486
|
new o.DOMException();
|
|
5460
5487
|
} catch {
|
|
5461
5488
|
o.DOMException = function(g, _) {
|
|
5462
5489
|
this.message = g, this.name = _;
|
|
5463
|
-
var
|
|
5464
|
-
this.stack =
|
|
5490
|
+
var O = Error(g);
|
|
5491
|
+
this.stack = O.stack;
|
|
5465
5492
|
}, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
|
|
5466
5493
|
}
|
|
5467
5494
|
function Me(l, g) {
|
|
5468
|
-
return new Promise(function(_,
|
|
5469
|
-
var
|
|
5470
|
-
if (
|
|
5471
|
-
return
|
|
5495
|
+
return new Promise(function(_, O) {
|
|
5496
|
+
var C = new L(l, g);
|
|
5497
|
+
if (C.signal && C.signal.aborted)
|
|
5498
|
+
return O(new o.DOMException("Aborted", "AbortError"));
|
|
5472
5499
|
var A = new XMLHttpRequest();
|
|
5473
5500
|
function ye() {
|
|
5474
5501
|
A.abort();
|
|
@@ -5481,36 +5508,36 @@ var Ze = { exports: {} };
|
|
|
5481
5508
|
};
|
|
5482
5509
|
ie.url = "responseURL" in A ? A.responseURL : ie.headers.get("X-Request-URL");
|
|
5483
5510
|
var Le = "response" in A ? A.response : A.responseText;
|
|
5484
|
-
_(new
|
|
5511
|
+
_(new P(Le, ie));
|
|
5485
5512
|
}, A.onerror = function() {
|
|
5486
|
-
|
|
5513
|
+
O(new TypeError("Network request failed"));
|
|
5487
5514
|
}, A.ontimeout = function() {
|
|
5488
|
-
|
|
5515
|
+
O(new TypeError("Network request failed"));
|
|
5489
5516
|
}, A.onabort = function() {
|
|
5490
|
-
|
|
5491
|
-
}, A.open(
|
|
5517
|
+
O(new o.DOMException("Aborted", "AbortError"));
|
|
5518
|
+
}, A.open(C.method, C.url, !0), C.credentials === "include" ? A.withCredentials = !0 : C.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && a.blob && (A.responseType = "blob"), C.headers.forEach(function(ie, Le) {
|
|
5492
5519
|
A.setRequestHeader(Le, ie);
|
|
5493
|
-
}),
|
|
5494
|
-
A.readyState === 4 &&
|
|
5495
|
-
}), A.send(typeof
|
|
5520
|
+
}), C.signal && (C.signal.addEventListener("abort", ye), A.onreadystatechange = function() {
|
|
5521
|
+
A.readyState === 4 && C.signal.removeEventListener("abort", ye);
|
|
5522
|
+
}), A.send(typeof C._bodyInit > "u" ? null : C._bodyInit);
|
|
5496
5523
|
});
|
|
5497
5524
|
}
|
|
5498
|
-
return Me.polyfill = !0, i.fetch || (i.fetch = Me, i.Headers = y, i.Request = L, i.Response =
|
|
5525
|
+
return Me.polyfill = !0, i.fetch || (i.fetch = Me, i.Headers = y, i.Request = L, i.Response = P), o.Headers = y, o.Request = L, o.Response = P, o.fetch = Me, Object.defineProperty(o, "__esModule", { value: !0 }), o;
|
|
5499
5526
|
})({});
|
|
5500
5527
|
})(s), s.fetch.ponyfill = !0, delete s.fetch.polyfill;
|
|
5501
5528
|
var r = s;
|
|
5502
5529
|
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;
|
|
5503
5530
|
})(Ze, Ze.exports);
|
|
5504
|
-
var
|
|
5505
|
-
const _e = /* @__PURE__ */
|
|
5531
|
+
var we = Ze.exports;
|
|
5532
|
+
const _e = /* @__PURE__ */ Vr(we), Hr = /* @__PURE__ */ wn({
|
|
5506
5533
|
__proto__: null,
|
|
5507
5534
|
default: _e
|
|
5508
|
-
}, [
|
|
5535
|
+
}, [we]), W = (e) => {
|
|
5509
5536
|
let t = {};
|
|
5510
|
-
return e && (typeof Headers < "u" && e instanceof Headers ||
|
|
5537
|
+
return e && (typeof Headers < "u" && e instanceof Headers || Hr && we.Headers && e instanceof we.Headers ? t = Qs(e) : Array.isArray(e) ? e.forEach(([n, s]) => {
|
|
5511
5538
|
n && s !== void 0 && (t[n] = s);
|
|
5512
5539
|
}) : t = e), t;
|
|
5513
|
-
}, Lt = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(),
|
|
5540
|
+
}, Lt = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), zr = (e) => {
|
|
5514
5541
|
if (!Array.isArray(e.query)) {
|
|
5515
5542
|
const s = e, r = [`query=${encodeURIComponent(Lt(s.query))}`];
|
|
5516
5543
|
return e.variables && r.push(`variables=${encodeURIComponent(s.jsonSerializer.stringify(s.variables))}`), s.operationName && r.push(`operationName=${encodeURIComponent(s.operationName)}`), r.join("&");
|
|
@@ -5522,10 +5549,10 @@ const _e = /* @__PURE__ */ $r(xe), Vr = /* @__PURE__ */ xn({
|
|
|
5522
5549
|
variables: t.variables ? t.jsonSerializer.stringify(t.variables[i]) : void 0
|
|
5523
5550
|
}), s), []);
|
|
5524
5551
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
5525
|
-
},
|
|
5552
|
+
}, Gr = (e) => async (t) => {
|
|
5526
5553
|
const { url: n, query: s, variables: r, operationName: i, fetch: o, fetchOptions: a, middleware: c } = t, u = { ...t.headers };
|
|
5527
5554
|
let h = "", d;
|
|
5528
|
-
e === "POST" ? (d =
|
|
5555
|
+
e === "POST" ? (d = Jr(s, r, i, a.jsonSerializer), typeof d == "string" && (u["Content-Type"] = "application/json")) : h = zr({
|
|
5529
5556
|
query: s,
|
|
5530
5557
|
variables: r,
|
|
5531
5558
|
operationName: i,
|
|
@@ -5539,15 +5566,15 @@ const _e = /* @__PURE__ */ $r(xe), Vr = /* @__PURE__ */ xn({
|
|
|
5539
5566
|
};
|
|
5540
5567
|
let m = n, y = f;
|
|
5541
5568
|
if (c) {
|
|
5542
|
-
const v = await Promise.resolve(c({ ...f, url: n, operationName: i, variables: r })), { url: I, ...
|
|
5543
|
-
m = I, y =
|
|
5569
|
+
const v = await Promise.resolve(c({ ...f, url: n, operationName: i, variables: r })), { url: I, ...w } = v;
|
|
5570
|
+
m = I, y = w;
|
|
5544
5571
|
}
|
|
5545
5572
|
return h && (m = `${m}?${h}`), await o(m, y);
|
|
5546
5573
|
};
|
|
5547
5574
|
class vn {
|
|
5548
5575
|
constructor(t, n = {}) {
|
|
5549
5576
|
this.url = t, this.requestConfig = n, this.rawRequest = async (...s) => {
|
|
5550
|
-
const [r, i, o] = s, a =
|
|
5577
|
+
const [r, i, o] = s, a = Ws(r, i, o), { headers: c, fetch: u = _e, method: h = "POST", requestMiddleware: d, responseMiddleware: f, ...m } = this.requestConfig, { url: y } = this;
|
|
5551
5578
|
a.signal !== void 0 && (m.signal = a.signal);
|
|
5552
5579
|
const { operationName: v } = je(a.query);
|
|
5553
5580
|
return $e({
|
|
@@ -5569,7 +5596,7 @@ class vn {
|
|
|
5569
5596
|
};
|
|
5570
5597
|
}
|
|
5571
5598
|
async request(t, ...n) {
|
|
5572
|
-
const [s, r] = n, i =
|
|
5599
|
+
const [s, r] = n, i = Xs(t, s, r), { headers: o, fetch: a = _e, method: c = "POST", requestMiddleware: u, responseMiddleware: h, ...d } = this.requestConfig, { url: f } = this;
|
|
5573
5600
|
i.signal !== void 0 && (d.signal = i.signal);
|
|
5574
5601
|
const { query: m, operationName: y } = je(i.document);
|
|
5575
5602
|
return $e({
|
|
@@ -5591,7 +5618,7 @@ class vn {
|
|
|
5591
5618
|
}
|
|
5592
5619
|
// prettier-ignore
|
|
5593
5620
|
batchRequests(t, n) {
|
|
5594
|
-
const s =
|
|
5621
|
+
const s = Ks(t, n), { headers: r, ...i } = this.requestConfig;
|
|
5595
5622
|
s.signal !== void 0 && (i.signal = s.signal);
|
|
5596
5623
|
const o = s.documents.map(({ document: c }) => je(c).query), a = s.documents.map(({ variables: c }) => c);
|
|
5597
5624
|
return $e({
|
|
@@ -5630,7 +5657,7 @@ class vn {
|
|
|
5630
5657
|
}
|
|
5631
5658
|
}
|
|
5632
5659
|
const $e = async (e) => {
|
|
5633
|
-
const { query: t, variables: n, fetchOptions: s } = e, r =
|
|
5660
|
+
const { query: t, variables: n, fetchOptions: s } = e, r = Gr(Ys(e.method ?? "post")), i = Array.isArray(e.query), o = await r(e), a = await Yr(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";
|
|
5634
5661
|
if (o.ok && u && c) {
|
|
5635
5662
|
const { errors: h, ...d } = (Array.isArray(a), a), f = s.errorPolicy === "ignore" ? d : a;
|
|
5636
5663
|
return {
|
|
@@ -5650,12 +5677,12 @@ const $e = async (e) => {
|
|
|
5650
5677
|
}
|
|
5651
5678
|
};
|
|
5652
5679
|
async function qe(e, t, ...n) {
|
|
5653
|
-
const s =
|
|
5680
|
+
const s = Zs(e, t, ...n);
|
|
5654
5681
|
return new vn(s.url).request({
|
|
5655
5682
|
...s
|
|
5656
5683
|
});
|
|
5657
5684
|
}
|
|
5658
|
-
const
|
|
5685
|
+
const Jr = (e, t, n, s) => {
|
|
5659
5686
|
const r = s ?? dt;
|
|
5660
5687
|
if (!Array.isArray(e))
|
|
5661
5688
|
return r.stringify({ query: e, variables: t, operationName: n });
|
|
@@ -5663,12 +5690,12 @@ const Gr = (e, t, n, s) => {
|
|
|
5663
5690
|
throw new Error("Cannot create request body with given variable type, array expected");
|
|
5664
5691
|
const i = e.reduce((o, a, c) => (o.push({ query: a, variables: t ? t[c] : void 0 }), o), []);
|
|
5665
5692
|
return r.stringify(i);
|
|
5666
|
-
},
|
|
5693
|
+
}, Yr = async (e, t) => {
|
|
5667
5694
|
let n;
|
|
5668
5695
|
return e.headers.forEach((s, r) => {
|
|
5669
5696
|
r.toLowerCase() === "content-type" && (n = s);
|
|
5670
5697
|
}), 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();
|
|
5671
|
-
}, Ve = (e) => typeof e == "function" ? e() : e,
|
|
5698
|
+
}, Ve = (e) => typeof e == "function" ? e() : e, Qr = V(async ({ input: e }) => {
|
|
5672
5699
|
var t;
|
|
5673
5700
|
if (!e.endpoint || e.endpoint === "")
|
|
5674
5701
|
throw new Error("No endpoint provided.");
|
|
@@ -5700,18 +5727,19 @@ const Gr = (e, t, n, s) => {
|
|
|
5700
5727
|
} catch {
|
|
5701
5728
|
throw console.log("Request to add submit step data failed."), new Error("Request to add submit step data failed.");
|
|
5702
5729
|
}
|
|
5703
|
-
}),
|
|
5730
|
+
}), Xr = ({ context: e }) => Object.keys(e.quote).length > 0, Pt = he({
|
|
5704
5731
|
types: {
|
|
5705
5732
|
context: {},
|
|
5706
5733
|
events: {},
|
|
5707
5734
|
input: {}
|
|
5708
5735
|
},
|
|
5709
5736
|
actions: {
|
|
5710
|
-
|
|
5711
|
-
|
|
5737
|
+
changeStep: b(zs),
|
|
5738
|
+
nextStep: b(Gs),
|
|
5739
|
+
updateQuote: b(Js)
|
|
5712
5740
|
},
|
|
5713
|
-
actors: { submitStepData:
|
|
5714
|
-
guards: { quoteExists:
|
|
5741
|
+
actors: { submitStepData: Qr },
|
|
5742
|
+
guards: { quoteExists: Xr }
|
|
5715
5743
|
}).createMachine({
|
|
5716
5744
|
/** @todo do we need to add the view to the id? (e.g. checkout_en-us) */
|
|
5717
5745
|
id: "checkout",
|
|
@@ -5719,23 +5747,23 @@ const Gr = (e, t, n, s) => {
|
|
|
5719
5747
|
context: ({ input: e }) => {
|
|
5720
5748
|
var t, n, s, r, i, o, a, c, u, h, d;
|
|
5721
5749
|
return {
|
|
5722
|
-
currentStep: (t = e == null ? void 0 : e.initialContext)
|
|
5750
|
+
currentStep: ((t = e == null ? void 0 : e.initialContext) == null ? void 0 : t.currentStep) ?? "",
|
|
5723
5751
|
errors: [],
|
|
5724
5752
|
isLoggedIn: ((n = e == null ? void 0 : e.initialContext) == null ? void 0 : n.isLoggedIn) ?? !1,
|
|
5725
5753
|
// sync with auth machine
|
|
5726
5754
|
steps: ((s = e == null ? void 0 : e.initialContext) == null ? void 0 : s.steps) ?? [
|
|
5727
|
-
{ name:
|
|
5728
|
-
{
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
},
|
|
5733
|
-
{
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
},
|
|
5738
|
-
{ name:
|
|
5755
|
+
// { name: 'contact_information', prev: null, next: 'shipping_address' },
|
|
5756
|
+
// {
|
|
5757
|
+
// name: 'shipping_address',
|
|
5758
|
+
// prev: 'contact_information',
|
|
5759
|
+
// next: 'payment_method',
|
|
5760
|
+
// },
|
|
5761
|
+
// {
|
|
5762
|
+
// name: 'payment_method',
|
|
5763
|
+
// prev: 'shipping_address',
|
|
5764
|
+
// next: 'shipping_method',
|
|
5765
|
+
// },
|
|
5766
|
+
// { name: 'shipping_method', prev: 'payment_method', next: null },
|
|
5739
5767
|
// 'createAccount',
|
|
5740
5768
|
// 'shippingAddress',
|
|
5741
5769
|
// 'paymentMethod',
|
|
@@ -5817,7 +5845,12 @@ const Gr = (e, t, n, s) => {
|
|
|
5817
5845
|
}
|
|
5818
5846
|
}
|
|
5819
5847
|
},
|
|
5820
|
-
changingStep: {
|
|
5848
|
+
changingStep: {
|
|
5849
|
+
always: {
|
|
5850
|
+
actions: ["changeStep"],
|
|
5851
|
+
target: "showStep"
|
|
5852
|
+
}
|
|
5853
|
+
}
|
|
5821
5854
|
// syncIsLoggedIn: {},
|
|
5822
5855
|
// syncQuote: {},
|
|
5823
5856
|
// createAccount: {
|
|
@@ -5847,12 +5880,12 @@ const Gr = (e, t, n, s) => {
|
|
|
5847
5880
|
// SYNC_IS_LOGGED_IN: '.syncIsLoggedIn',
|
|
5848
5881
|
// SYNC_QUOTE: '.syncQuote',
|
|
5849
5882
|
// },
|
|
5850
|
-
}), Tn = be({}),
|
|
5883
|
+
}), Tn = be({}), gi = () => {
|
|
5851
5884
|
const e = Ne(Tn);
|
|
5852
5885
|
if (!e || !e.getSnapshot)
|
|
5853
5886
|
throw new Error("checkoutActor is not properly initialized");
|
|
5854
|
-
const [t, n] =
|
|
5855
|
-
|
|
5887
|
+
const [t, n] = Ce(() => e.getSnapshot());
|
|
5888
|
+
Oe(() => {
|
|
5856
5889
|
if (!e || !e.getSnapshot) {
|
|
5857
5890
|
console.error("checkoutActor is not properly initialized");
|
|
5858
5891
|
return;
|
|
@@ -5872,7 +5905,7 @@ const Gr = (e, t, n, s) => {
|
|
|
5872
5905
|
checkoutActor: e,
|
|
5873
5906
|
currentStep: s
|
|
5874
5907
|
};
|
|
5875
|
-
},
|
|
5908
|
+
}, Ei = async (e = {
|
|
5876
5909
|
inspect: void 0,
|
|
5877
5910
|
currentStep: "",
|
|
5878
5911
|
steps: [],
|
|
@@ -5881,14 +5914,14 @@ const Gr = (e, t, n, s) => {
|
|
|
5881
5914
|
graphql: {}
|
|
5882
5915
|
}) => typeof window < "u" ? (console.warn(
|
|
5883
5916
|
"App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
|
|
5884
|
-
),
|
|
5917
|
+
), U(Pt, {
|
|
5885
5918
|
inspect: e.inspect,
|
|
5886
5919
|
input: {
|
|
5887
5920
|
initialContext: {
|
|
5888
5921
|
endpoints: e.endpoints
|
|
5889
5922
|
}
|
|
5890
5923
|
}
|
|
5891
|
-
}).start()) :
|
|
5924
|
+
}).start()) : U(Pt, {
|
|
5892
5925
|
input: {
|
|
5893
5926
|
initialContext: {
|
|
5894
5927
|
currentStep: e.currentStep,
|
|
@@ -5902,11 +5935,11 @@ const Gr = (e, t, n, s) => {
|
|
|
5902
5935
|
},
|
|
5903
5936
|
inspect: e.inspect
|
|
5904
5937
|
}).start();
|
|
5905
|
-
function
|
|
5906
|
-
return /* @__PURE__ */
|
|
5938
|
+
function vi({ actor: e, children: t }) {
|
|
5939
|
+
return /* @__PURE__ */ xe(Tn.Provider, { value: e, children: t });
|
|
5907
5940
|
}
|
|
5908
|
-
let
|
|
5909
|
-
const
|
|
5941
|
+
let Wr = (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), "");
|
|
5942
|
+
const Kr = he({
|
|
5910
5943
|
actors: {
|
|
5911
5944
|
tick: As(
|
|
5912
5945
|
({ sendBack: e, input: t }) => {
|
|
@@ -5973,7 +6006,7 @@ const Wr = he({
|
|
|
5973
6006
|
],
|
|
5974
6007
|
on: {
|
|
5975
6008
|
TICK: {
|
|
5976
|
-
actions:
|
|
6009
|
+
actions: b(({ context: e, event: t }) => t.type !== "TICK" ? e : {
|
|
5977
6010
|
elapsed: e.elapsed + e.interval
|
|
5978
6011
|
})
|
|
5979
6012
|
},
|
|
@@ -5984,9 +6017,9 @@ const Wr = he({
|
|
|
5984
6017
|
type: "final"
|
|
5985
6018
|
}
|
|
5986
6019
|
}
|
|
5987
|
-
}),
|
|
6020
|
+
}), Ti = he({
|
|
5988
6021
|
actors: {
|
|
5989
|
-
timer:
|
|
6022
|
+
timer: Kr
|
|
5990
6023
|
},
|
|
5991
6024
|
types: {
|
|
5992
6025
|
context: {},
|
|
@@ -5994,10 +6027,10 @@ const Wr = he({
|
|
|
5994
6027
|
input: {}
|
|
5995
6028
|
},
|
|
5996
6029
|
actions: {
|
|
5997
|
-
addItem:
|
|
6030
|
+
addItem: b(({ context: e, event: t }) => {
|
|
5998
6031
|
if (t.type !== "ADD_ITEM")
|
|
5999
6032
|
return e;
|
|
6000
|
-
const n = `notification-${
|
|
6033
|
+
const n = `notification-${Wr()}`, s = t.duration ?? e.duration, r = An(t.item, {
|
|
6001
6034
|
duration: s,
|
|
6002
6035
|
id: n,
|
|
6003
6036
|
key: t.item.key ?? n,
|
|
@@ -6012,7 +6045,7 @@ const Wr = he({
|
|
|
6012
6045
|
activeItem: n
|
|
6013
6046
|
};
|
|
6014
6047
|
}),
|
|
6015
|
-
removeItem:
|
|
6048
|
+
removeItem: b(({ context: e, event: t }) => {
|
|
6016
6049
|
if (t.type !== "REMOVE_ITEM" && t.type !== "xstate.done.actor.timer")
|
|
6017
6050
|
return e;
|
|
6018
6051
|
const n = e.items;
|
|
@@ -6109,12 +6142,12 @@ const Wr = he({
|
|
|
6109
6142
|
}
|
|
6110
6143
|
}), _n = be(
|
|
6111
6144
|
{}
|
|
6112
|
-
),
|
|
6145
|
+
), _i = () => {
|
|
6113
6146
|
const e = Ne(_n);
|
|
6114
6147
|
if (!e || !e.getSnapshot)
|
|
6115
6148
|
throw new Error("toastActor is not properly initialized");
|
|
6116
|
-
const [t, n] =
|
|
6117
|
-
return
|
|
6149
|
+
const [t, n] = Ce(() => e.getSnapshot());
|
|
6150
|
+
return Oe(() => {
|
|
6118
6151
|
if (!e || !e.getSnapshot) {
|
|
6119
6152
|
console.error("toastActor is not properly initialized");
|
|
6120
6153
|
return;
|
|
@@ -6130,10 +6163,10 @@ const Wr = he({
|
|
|
6130
6163
|
};
|
|
6131
6164
|
}, [e]), { toastActor: e };
|
|
6132
6165
|
};
|
|
6133
|
-
function
|
|
6134
|
-
return /* @__PURE__ */
|
|
6166
|
+
function Si({ children: e, actor: t }) {
|
|
6167
|
+
return /* @__PURE__ */ xe(_n.Provider, { value: t, children: e });
|
|
6135
6168
|
}
|
|
6136
|
-
function
|
|
6169
|
+
function Zr({
|
|
6137
6170
|
context: e,
|
|
6138
6171
|
event: t
|
|
6139
6172
|
}) {
|
|
@@ -6145,7 +6178,7 @@ function Kr({
|
|
|
6145
6178
|
itemsAdded: n.output.itemsAdded
|
|
6146
6179
|
};
|
|
6147
6180
|
}
|
|
6148
|
-
function
|
|
6181
|
+
function ei({
|
|
6149
6182
|
event: e
|
|
6150
6183
|
}) {
|
|
6151
6184
|
if (!e.type.includes("xstate.done.actor"))
|
|
@@ -6156,7 +6189,7 @@ function Zr({
|
|
|
6156
6189
|
itemsAdded: t.output.itemsAdded
|
|
6157
6190
|
};
|
|
6158
6191
|
}
|
|
6159
|
-
function
|
|
6192
|
+
function ti({
|
|
6160
6193
|
event: e
|
|
6161
6194
|
}) {
|
|
6162
6195
|
if (!e.type.includes("xstate.done.actor"))
|
|
@@ -6167,7 +6200,7 @@ function ei({
|
|
|
6167
6200
|
itemsRemoved: t.output.itemsRemoved
|
|
6168
6201
|
};
|
|
6169
6202
|
}
|
|
6170
|
-
function
|
|
6203
|
+
function ni({
|
|
6171
6204
|
event: e
|
|
6172
6205
|
}) {
|
|
6173
6206
|
if (!e.type.includes("xstate.done.actor"))
|
|
@@ -6184,7 +6217,7 @@ function ti({
|
|
|
6184
6217
|
itemsUpdated: t.output.itemsUpdated
|
|
6185
6218
|
};
|
|
6186
6219
|
}
|
|
6187
|
-
function
|
|
6220
|
+
function si({
|
|
6188
6221
|
context: e,
|
|
6189
6222
|
event: t
|
|
6190
6223
|
}) {
|
|
@@ -6196,7 +6229,7 @@ function ni({
|
|
|
6196
6229
|
itemsRemoved: n.output.itemsRemoved
|
|
6197
6230
|
};
|
|
6198
6231
|
}
|
|
6199
|
-
function
|
|
6232
|
+
function ri({
|
|
6200
6233
|
context: e,
|
|
6201
6234
|
event: t
|
|
6202
6235
|
}) {
|
|
@@ -6207,7 +6240,7 @@ function si({
|
|
|
6207
6240
|
quote: { ...e.quote, ...n.output.quote }
|
|
6208
6241
|
};
|
|
6209
6242
|
}
|
|
6210
|
-
function
|
|
6243
|
+
function ii({
|
|
6211
6244
|
context: e,
|
|
6212
6245
|
event: t
|
|
6213
6246
|
}) {
|
|
@@ -6219,7 +6252,7 @@ function ri({
|
|
|
6219
6252
|
itemsUpdated: n.output.itemsUpdated
|
|
6220
6253
|
};
|
|
6221
6254
|
}
|
|
6222
|
-
const
|
|
6255
|
+
const oi = V(
|
|
6223
6256
|
async ({ input: e }) => {
|
|
6224
6257
|
var t;
|
|
6225
6258
|
if (!e.endpoint || e.endpoint === "")
|
|
@@ -6248,7 +6281,7 @@ const ii = V(
|
|
|
6248
6281
|
throw new Error("Request to add item(s) failed.");
|
|
6249
6282
|
}
|
|
6250
6283
|
}
|
|
6251
|
-
),
|
|
6284
|
+
), ai = V(async ({ input: e }) => {
|
|
6252
6285
|
var t;
|
|
6253
6286
|
if (!e.endpoint || e.endpoint === "")
|
|
6254
6287
|
throw new Error("No endpoint provided.");
|
|
@@ -6272,7 +6305,7 @@ const ii = V(
|
|
|
6272
6305
|
} catch {
|
|
6273
6306
|
throw new Error("Request to remove item(s) failed.");
|
|
6274
6307
|
}
|
|
6275
|
-
}), He = typeof window > "u",
|
|
6308
|
+
}), He = typeof window > "u", ci = V(
|
|
6276
6309
|
async ({ input: e }) => {
|
|
6277
6310
|
var n, s, r, i;
|
|
6278
6311
|
if (!e.endpoint)
|
|
@@ -6314,7 +6347,7 @@ const ii = V(
|
|
|
6314
6347
|
throw console.log("refresh error", o), new Error("Request to add item(s) failed.");
|
|
6315
6348
|
}
|
|
6316
6349
|
}
|
|
6317
|
-
),
|
|
6350
|
+
), ui = V(async ({ input: e }) => {
|
|
6318
6351
|
var t;
|
|
6319
6352
|
if (!e.endpoint || e.endpoint === "")
|
|
6320
6353
|
throw new Error("No endpoint provided.");
|
|
@@ -6341,7 +6374,7 @@ const ii = V(
|
|
|
6341
6374
|
} catch {
|
|
6342
6375
|
throw new Error("Request to add item(s) failed.");
|
|
6343
6376
|
}
|
|
6344
|
-
}),
|
|
6377
|
+
}), di = ({ context: e }) => typeof window > "u" && e.quote.id !== "" || typeof window < "u", li = ({ context: e }) => !!e.quote.items && e.quote.items.length > 0, Ut = he({
|
|
6345
6378
|
types: {
|
|
6346
6379
|
context: {},
|
|
6347
6380
|
emitted: {},
|
|
@@ -6349,30 +6382,30 @@ const ii = V(
|
|
|
6349
6382
|
input: {}
|
|
6350
6383
|
},
|
|
6351
6384
|
actions: {
|
|
6352
|
-
addItems:
|
|
6353
|
-
notifyAddItems: Fe(
|
|
6354
|
-
notifyRemoveItems: Fe(
|
|
6355
|
-
notifyUpdateItems: Fe(
|
|
6356
|
-
removeItems:
|
|
6357
|
-
refresh:
|
|
6358
|
-
updateItems:
|
|
6385
|
+
addItems: b(Zr),
|
|
6386
|
+
notifyAddItems: Fe(ei),
|
|
6387
|
+
notifyRemoveItems: Fe(ti),
|
|
6388
|
+
notifyUpdateItems: Fe(ni),
|
|
6389
|
+
removeItems: b(si),
|
|
6390
|
+
refresh: b(ri),
|
|
6391
|
+
updateItems: b(ii)
|
|
6359
6392
|
},
|
|
6360
6393
|
actors: {
|
|
6361
|
-
addItems:
|
|
6362
|
-
removeItems:
|
|
6363
|
-
refresh:
|
|
6364
|
-
updateItems:
|
|
6394
|
+
addItems: oi,
|
|
6395
|
+
removeItems: ai,
|
|
6396
|
+
refresh: ci,
|
|
6397
|
+
updateItems: ui
|
|
6365
6398
|
},
|
|
6366
6399
|
guards: {
|
|
6367
|
-
canRefresh:
|
|
6368
|
-
hasItems:
|
|
6400
|
+
canRefresh: di,
|
|
6401
|
+
hasItems: li
|
|
6369
6402
|
}
|
|
6370
6403
|
}).createMachine({
|
|
6371
6404
|
/** @todo do we need to add the view to the id? (e.g. quote_en-us) */
|
|
6372
6405
|
id: "quote",
|
|
6373
6406
|
initial: "initializing",
|
|
6374
6407
|
context: ({ input: e }) => {
|
|
6375
|
-
var t, n, s, r, i, o, a, c, u, h, d, f, m, y, v, I,
|
|
6408
|
+
var t, n, s, r, i, o, a, c, u, h, d, f, m, y, v, I, w, R, k, q, F, H, z, L, fe, pe;
|
|
6376
6409
|
return {
|
|
6377
6410
|
quote: {
|
|
6378
6411
|
id: "",
|
|
@@ -6394,9 +6427,9 @@ const ii = V(
|
|
|
6394
6427
|
},
|
|
6395
6428
|
totals: {
|
|
6396
6429
|
discount: 0,
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6430
|
+
taxAmount: 0,
|
|
6431
|
+
shippingAmount: 0,
|
|
6432
|
+
shippingTaxAmount: 0,
|
|
6400
6433
|
subtotal: 0,
|
|
6401
6434
|
grandTotal: 0
|
|
6402
6435
|
},
|
|
@@ -6443,7 +6476,7 @@ const ii = V(
|
|
|
6443
6476
|
requestHeaders: ((y = (m = (f = e == null ? void 0 : e.initialContext) == null ? void 0 : f.graphql) == null ? void 0 : m.addItems) == null ? void 0 : y.requestHeaders) ?? void 0
|
|
6444
6477
|
},
|
|
6445
6478
|
removeItems: {
|
|
6446
|
-
document: ((
|
|
6479
|
+
document: ((w = (I = (v = e == null ? void 0 : e.initialContext) == null ? void 0 : v.graphql) == null ? void 0 : I.removeItems) == null ? void 0 : w.document) ?? "",
|
|
6447
6480
|
requestHeaders: ((q = (k = (R = e == null ? void 0 : e.initialContext) == null ? void 0 : R.graphql) == null ? void 0 : k.removeItems) == null ? void 0 : q.requestHeaders) ?? void 0
|
|
6448
6481
|
},
|
|
6449
6482
|
updateItems: {
|
|
@@ -6720,13 +6753,13 @@ const ii = V(
|
|
|
6720
6753
|
}
|
|
6721
6754
|
}), Sn = be(
|
|
6722
6755
|
{}
|
|
6723
|
-
),
|
|
6756
|
+
), Ii = () => {
|
|
6724
6757
|
var c;
|
|
6725
6758
|
const e = Ne(Sn);
|
|
6726
6759
|
if (!e || !e.getSnapshot)
|
|
6727
6760
|
throw new Error("quoteActor is not properly initialized");
|
|
6728
|
-
const [t, n] =
|
|
6729
|
-
|
|
6761
|
+
const [t, n] = Ce(() => e.getSnapshot());
|
|
6762
|
+
Oe(() => {
|
|
6730
6763
|
if (!e || !e.getSnapshot) {
|
|
6731
6764
|
console.error("quoteActor is not properly initialized");
|
|
6732
6765
|
return;
|
|
@@ -6750,21 +6783,21 @@ const ii = V(
|
|
|
6750
6783
|
isRemovingItems: o,
|
|
6751
6784
|
isUpdatingItems: a
|
|
6752
6785
|
};
|
|
6753
|
-
},
|
|
6786
|
+
}, Ai = async (e = {
|
|
6754
6787
|
inspect: void 0,
|
|
6755
6788
|
quote: { id: "", locale: "" },
|
|
6756
6789
|
endpoints: { client: "", server: "" },
|
|
6757
6790
|
graphql: {}
|
|
6758
6791
|
}) => typeof window < "u" ? (console.warn(
|
|
6759
6792
|
"App.getInitialProps::getAuth should not be run on the frontend. You are probably missing getServerSideProps in your page."
|
|
6760
|
-
),
|
|
6793
|
+
), U(Ut, {
|
|
6761
6794
|
inspect: e.inspect,
|
|
6762
6795
|
input: {
|
|
6763
6796
|
initialContext: {
|
|
6764
6797
|
endpoints: e.endpoints
|
|
6765
6798
|
}
|
|
6766
6799
|
}
|
|
6767
|
-
}).start()) :
|
|
6800
|
+
}).start()) : U(Ut, {
|
|
6768
6801
|
input: {
|
|
6769
6802
|
initialContext: {
|
|
6770
6803
|
endpoints: e.endpoints,
|
|
@@ -6777,28 +6810,28 @@ const ii = V(
|
|
|
6777
6810
|
},
|
|
6778
6811
|
inspect: e.inspect
|
|
6779
6812
|
}).start();
|
|
6780
|
-
function
|
|
6781
|
-
return /* @__PURE__ */
|
|
6813
|
+
function wi({ actor: e, children: t }) {
|
|
6814
|
+
return /* @__PURE__ */ xe(Sn.Provider, { value: e, children: t });
|
|
6782
6815
|
}
|
|
6783
6816
|
export {
|
|
6784
6817
|
an as AuthContext,
|
|
6785
|
-
|
|
6818
|
+
mi as AuthProvider,
|
|
6786
6819
|
Tn as CheckoutContext,
|
|
6787
|
-
|
|
6820
|
+
vi as CheckoutProvider,
|
|
6788
6821
|
Sn as QuoteContext,
|
|
6789
|
-
|
|
6822
|
+
wi as QuoteProvider,
|
|
6790
6823
|
_n as ToastContext,
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6824
|
+
Si as ToastProvider,
|
|
6825
|
+
Ct as authMachine,
|
|
6826
|
+
Pt as checkoutMachine,
|
|
6827
|
+
yi as getAuth,
|
|
6828
|
+
Ei as getCheckout,
|
|
6829
|
+
Ai as getQuote,
|
|
6830
|
+
Ut as quoteMachine,
|
|
6831
|
+
Kr as timerMachine,
|
|
6832
|
+
Ti as toastMachine,
|
|
6833
|
+
pi as useAuth,
|
|
6834
|
+
gi as useCheckout,
|
|
6835
|
+
Ii as useQuote,
|
|
6836
|
+
_i as useToast
|
|
6804
6837
|
};
|