@fanfare-io/fanfare-sdk-solid 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +82 -79
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -2059,7 +2059,7 @@ function Qi(e) {
|
|
|
2059
2059
|
function Gn(e) {
|
|
2060
2060
|
const {
|
|
2061
2061
|
t
|
|
2062
|
-
} = he(), r = () => e.label ?? t("auth.badgeLabel"), a = () => e.variant ?? "default", i = () => e.title ?? t("auth.title"), o = () => e.description ?? t("auth.description"), f = () => e.submitLabel ?? t("auth.submit"), d = () => e.verifyLabel ?? t("auth.verify"), c = e.defaultStep ?? "credential", g = e.defaultCredential ?? "", [m, y] = A(c), [C, x] = A(g), [I, z] = A(e.defaultCredentialType ?? Un(g)), [_, b] = A(!1), [$, S] = A(""), [k, V] = A(!1), [O, L] = A(e.defaultError ?? null), [J, W] = A(c === "verify" && g.length > 0 ? Date.now() + er : null), [ee, Ae] = A(Date.now()), [j, F] = A(!1), [K,
|
|
2062
|
+
} = he(), r = () => e.label ?? t("auth.badgeLabel"), a = () => e.variant ?? "default", i = () => e.title ?? t("auth.title"), o = () => e.description ?? t("auth.description"), f = () => e.submitLabel ?? t("auth.submit"), d = () => e.verifyLabel ?? t("auth.verify"), c = e.defaultStep ?? "credential", g = e.defaultCredential ?? "", [m, y] = A(c), [C, x] = A(g), [I, z] = A(e.defaultCredentialType ?? Un(g)), [_, b] = A(!1), [$, S] = A(""), [k, V] = A(!1), [O, L] = A(e.defaultError ?? null), [J, W] = A(c === "verify" && g.length > 0 ? Date.now() + er : null), [ee, Ae] = A(Date.now()), [j, F] = A(!1), [K, ne] = A(!1);
|
|
2063
2063
|
let Q = !1;
|
|
2064
2064
|
const P = v(() => I() === "email" ? t("auth.email") : t("auth.phone"));
|
|
2065
2065
|
H(qe(m, (G) => {
|
|
@@ -2091,11 +2091,11 @@ function Gn(e) {
|
|
|
2091
2091
|
S(G), L(null);
|
|
2092
2092
|
}, te = async (G, U) => {
|
|
2093
2093
|
G?.preventDefault();
|
|
2094
|
-
const
|
|
2095
|
-
if (!(!
|
|
2094
|
+
const ae = U || $();
|
|
2095
|
+
if (!(!ae || ae.length < 6) && !Q) {
|
|
2096
2096
|
Q = !0, V(!0), L(null);
|
|
2097
2097
|
try {
|
|
2098
|
-
await e.onVerify?.(
|
|
2098
|
+
await e.onVerify?.(ae), y("success"), e.onSuccess?.();
|
|
2099
2099
|
} catch (Be) {
|
|
2100
2100
|
L(Be instanceof Error ? Be.message : t("auth.invalidCode"));
|
|
2101
2101
|
} finally {
|
|
@@ -2117,13 +2117,13 @@ function Gn(e) {
|
|
|
2117
2117
|
Q || (y("credential"), S(""), L(null), W(null), F(!1));
|
|
2118
2118
|
}, xe = async () => {
|
|
2119
2119
|
if (!(!C() || K()) && !Q) {
|
|
2120
|
-
Q = !0,
|
|
2120
|
+
Q = !0, ne(!0), L(null), S("");
|
|
2121
2121
|
try {
|
|
2122
2122
|
await e.onSubmit?.(C(), I()), W(Date.now() + er), Ae(Date.now()), F(!0);
|
|
2123
2123
|
} catch (G) {
|
|
2124
2124
|
L(G instanceof Error ? G.message : t("auth.sendFailed"));
|
|
2125
2125
|
} finally {
|
|
2126
|
-
Q = !1,
|
|
2126
|
+
Q = !1, ne(!1);
|
|
2127
2127
|
}
|
|
2128
2128
|
}
|
|
2129
2129
|
}, fe = () => e.showBranding !== !1;
|
|
@@ -2137,8 +2137,8 @@ function Gn(e) {
|
|
|
2137
2137
|
get children() {
|
|
2138
2138
|
return [n(me, {
|
|
2139
2139
|
get children() {
|
|
2140
|
-
var G = Ui(), U = G.firstChild,
|
|
2141
|
-
return l(
|
|
2140
|
+
var G = Ui(), U = G.firstChild, ae = U.nextSibling;
|
|
2141
|
+
return l(ae, () => t("auth.success")), M(() => q(U, R("ff:flex ff:h-12 ff:w-12 ff:items-center ff:justify-center ff:rounded-full", "ff:bg-success/10 ff:text-success"))), G;
|
|
2142
2142
|
}
|
|
2143
2143
|
}), n(w, {
|
|
2144
2144
|
get when() {
|
|
@@ -2176,8 +2176,8 @@ function Gn(e) {
|
|
|
2176
2176
|
return e.countdownTo;
|
|
2177
2177
|
},
|
|
2178
2178
|
children: (G) => (() => {
|
|
2179
|
-
var U = Gi(),
|
|
2180
|
-
return l(
|
|
2179
|
+
var U = Gi(), ae = U.firstChild;
|
|
2180
|
+
return l(ae, () => t("duration.opensIn")), l(U, n(Ie, {
|
|
2181
2181
|
get targetDate() {
|
|
2182
2182
|
return G();
|
|
2183
2183
|
},
|
|
@@ -2215,8 +2215,8 @@ function Gn(e) {
|
|
|
2215
2215
|
})();
|
|
2216
2216
|
},
|
|
2217
2217
|
get children() {
|
|
2218
|
-
var U = Yi(),
|
|
2219
|
-
return Be.nextSibling, l(U, () => t("auth.sentTo"),
|
|
2218
|
+
var U = Yi(), ae = U.firstChild, Be = ae.nextSibling;
|
|
2219
|
+
return Be.nextSibling, l(U, () => t("auth.sentTo"), ae), l(Be, C), l(U, n(Y, {
|
|
2220
2220
|
type: "button",
|
|
2221
2221
|
variant: "link",
|
|
2222
2222
|
size: "xs",
|
|
@@ -2260,8 +2260,8 @@ function Gn(e) {
|
|
|
2260
2260
|
return $();
|
|
2261
2261
|
},
|
|
2262
2262
|
onChange: ie,
|
|
2263
|
-
onComplete: (
|
|
2264
|
-
te(void 0,
|
|
2263
|
+
onComplete: (ae) => {
|
|
2264
|
+
te(void 0, ae);
|
|
2265
2265
|
},
|
|
2266
2266
|
get hasError() {
|
|
2267
2267
|
return !!O();
|
|
@@ -2311,8 +2311,8 @@ function Gn(e) {
|
|
|
2311
2311
|
},
|
|
2312
2312
|
get fallback() {
|
|
2313
2313
|
return (() => {
|
|
2314
|
-
var
|
|
2315
|
-
return l(Be, () => t("auth.didntGetIt")), l(
|
|
2314
|
+
var ae = Ji(), Be = ae.firstChild;
|
|
2315
|
+
return l(Be, () => t("auth.didntGetIt")), l(ae, n(w, {
|
|
2316
2316
|
get when() {
|
|
2317
2317
|
return N();
|
|
2318
2318
|
},
|
|
@@ -2336,7 +2336,7 @@ function Gn(e) {
|
|
|
2336
2336
|
var We = Hi();
|
|
2337
2337
|
return l(We, () => Qi(E())), We;
|
|
2338
2338
|
}
|
|
2339
|
-
}), null),
|
|
2339
|
+
}), null), ae;
|
|
2340
2340
|
})();
|
|
2341
2341
|
},
|
|
2342
2342
|
get children() {
|
|
@@ -2615,8 +2615,8 @@ function Hn(e) {
|
|
|
2615
2615
|
if (b(F), !j) return;
|
|
2616
2616
|
const K = Date.parse(j);
|
|
2617
2617
|
if (!Number.isFinite(K) || K <= F) return;
|
|
2618
|
-
const
|
|
2619
|
-
Ee(() => window.clearTimeout(
|
|
2618
|
+
const ne = window.setTimeout(() => b(Date.now()), Math.min(K - F + 1, 2147483647));
|
|
2619
|
+
Ee(() => window.clearTimeout(ne));
|
|
2620
2620
|
});
|
|
2621
2621
|
const k = v(() => uf(a.botMitigation, _())), V = v(() => typeof a.botMitigation?.attemptsRemaining == "number" ? a.botMitigation.attemptsRemaining : void 0);
|
|
2622
2622
|
H(qe(() => a.challenge?.id, () => {
|
|
@@ -2626,12 +2626,12 @@ function Hn(e) {
|
|
|
2626
2626
|
}), H(() => {
|
|
2627
2627
|
const j = a.challenge?.id, F = $();
|
|
2628
2628
|
if (!j || !F) return;
|
|
2629
|
-
const K = (
|
|
2630
|
-
if (
|
|
2631
|
-
if (
|
|
2629
|
+
const K = (ne) => {
|
|
2630
|
+
if (ne.origin !== F || !cf(ne.data) || ne.data.challengeId !== j) return;
|
|
2631
|
+
if (ne.data.kind === "fanfare:challenge:turnstile") {
|
|
2632
2632
|
x(!0), g(!0), y(null), (async () => {
|
|
2633
2633
|
try {
|
|
2634
|
-
await a.onVerifyToken(
|
|
2634
|
+
await a.onVerifyToken(ne.data.token);
|
|
2635
2635
|
} catch (E) {
|
|
2636
2636
|
y(E instanceof Error ? E.message : t("challenge.verificationFailed"));
|
|
2637
2637
|
} finally {
|
|
@@ -2641,12 +2641,12 @@ function Hn(e) {
|
|
|
2641
2641
|
return;
|
|
2642
2642
|
}
|
|
2643
2643
|
x(!0);
|
|
2644
|
-
const Q = typeof
|
|
2644
|
+
const Q = typeof ne.data.reason == "string" ? ne.data.reason : void 0, P = typeof ne.data.message == "string" ? ne.data.message : void 0;
|
|
2645
2645
|
if (Q === "challenge_expired" || Q === "challenge_not_found") {
|
|
2646
|
-
z("reroute"), y(P ?? (
|
|
2646
|
+
z("reroute"), y(P ?? (ne.data.kind === "fanfare:challenge:turnstile_expired" ? t("challenge.expiredRefresh") : t("challenge.errorRefresh")));
|
|
2647
2647
|
return;
|
|
2648
2648
|
}
|
|
2649
|
-
if (z("reload"),
|
|
2649
|
+
if (z("reload"), ne.data.kind === "fanfare:challenge:turnstile_expired") {
|
|
2650
2650
|
y(P ?? t("challenge.expiredRetry")), o((E) => E + 1), d(!1);
|
|
2651
2651
|
return;
|
|
2652
2652
|
}
|
|
@@ -2660,7 +2660,7 @@ function Hn(e) {
|
|
|
2660
2660
|
a.onRetry();
|
|
2661
2661
|
return;
|
|
2662
2662
|
}
|
|
2663
|
-
z("reload"), o((
|
|
2663
|
+
z("reload"), o((ne) => ne + 1), d(!1);
|
|
2664
2664
|
};
|
|
2665
2665
|
return n(pe, {
|
|
2666
2666
|
get class() {
|
|
@@ -2733,8 +2733,8 @@ function Hn(e) {
|
|
|
2733
2733
|
})), K;
|
|
2734
2734
|
}
|
|
2735
2735
|
}), F), F.addEventListener("load", () => d(!0)), lr(F, "height", "120px"), lr(F, "border", "0"), M((K) => {
|
|
2736
|
-
var
|
|
2737
|
-
return
|
|
2736
|
+
var ne = t("challenge.iframeTitle"), Q = S() ?? void 0;
|
|
2737
|
+
return ne !== K.e && Z(F, "title", K.e = ne), Q !== K.t && Z(F, "src", K.t = Q), K;
|
|
2738
2738
|
}, {
|
|
2739
2739
|
e: void 0,
|
|
2740
2740
|
t: void 0
|
|
@@ -3747,7 +3747,7 @@ function or(e) {
|
|
|
3747
3747
|
});
|
|
3748
3748
|
}, K = () => {
|
|
3749
3749
|
$ || ($ = !0, d(null), F().catch(Ae));
|
|
3750
|
-
},
|
|
3750
|
+
}, ne = async () => {
|
|
3751
3751
|
if (e.intent === "checkout") {
|
|
3752
3752
|
await e.onResume();
|
|
3753
3753
|
return;
|
|
@@ -3759,7 +3759,7 @@ function or(e) {
|
|
|
3759
3759
|
W.recovery() === "declined" && ee();
|
|
3760
3760
|
}), H(() => {
|
|
3761
3761
|
const D = e.pendingAction;
|
|
3762
|
-
e.isEntering || !D || D.processor !== "internal" || W.launch(D.clientSecret,
|
|
3762
|
+
e.isEntering || !D || D.processor !== "internal" || W.launch(D.clientSecret, ne);
|
|
3763
3763
|
});
|
|
3764
3764
|
const Q = () => e.intent === "reenter";
|
|
3765
3765
|
H(() => {
|
|
@@ -3975,7 +3975,7 @@ function or(e) {
|
|
|
3975
3975
|
type: "button",
|
|
3976
3976
|
onClick: () => {
|
|
3977
3977
|
const D = e.pendingAction;
|
|
3978
|
-
E() && D ? W.retry(D.clientSecret,
|
|
3978
|
+
E() && D ? W.retry(D.clientSecret, ne) : K();
|
|
3979
3979
|
},
|
|
3980
3980
|
get disabled() {
|
|
3981
3981
|
return N();
|
|
@@ -4537,18 +4537,18 @@ function pr(e) {
|
|
|
4537
4537
|
}
|
|
4538
4538
|
await e.onBook(E.id, E.locationId ?? e.defaultLocationId);
|
|
4539
4539
|
}
|
|
4540
|
-
}, K = v(() => a().booking),
|
|
4540
|
+
}, K = v(() => a().booking), ne = v(() => K()?.consumerStatus), Q = () => C() ? e.isRescheduling : e.isBooking, P = () => e.bookError ?? c();
|
|
4541
4541
|
return n(Ue, {
|
|
4542
4542
|
fallback: null,
|
|
4543
4543
|
get children() {
|
|
4544
4544
|
return [n(oe, {
|
|
4545
4545
|
get when() {
|
|
4546
|
-
return e.sequencePhase === "ended" ||
|
|
4546
|
+
return e.sequencePhase === "ended" || ne() === "completed" || ne() === "cancelled";
|
|
4547
4547
|
},
|
|
4548
4548
|
get children() {
|
|
4549
4549
|
return n(ct, {
|
|
4550
4550
|
get outcomeReason() {
|
|
4551
|
-
return B(() =>
|
|
4551
|
+
return B(() => ne() === "completed")() ? "completed" : B(() => ne() === "cancelled")() ? "cancelled" : e.outcomeReason ?? "ended";
|
|
4552
4552
|
},
|
|
4553
4553
|
participationType: "appointment",
|
|
4554
4554
|
get class() {
|
|
@@ -5297,7 +5297,7 @@ function ss(e) {
|
|
|
5297
5297
|
},
|
|
5298
5298
|
tone: "live"
|
|
5299
5299
|
})
|
|
5300
|
-
})],
|
|
5300
|
+
})], ne = () => [n(ke, {
|
|
5301
5301
|
get label() {
|
|
5302
5302
|
return t("auction.panel.bidsPlaced");
|
|
5303
5303
|
},
|
|
@@ -5410,7 +5410,7 @@ function ss(e) {
|
|
|
5410
5410
|
get fallback() {
|
|
5411
5411
|
return n(Ye, {
|
|
5412
5412
|
get children() {
|
|
5413
|
-
return [B(() => K()), B(() =>
|
|
5413
|
+
return [B(() => K()), B(() => ne()), B(() => Q())];
|
|
5414
5414
|
}
|
|
5415
5415
|
});
|
|
5416
5416
|
},
|
|
@@ -5422,7 +5422,7 @@ function ss(e) {
|
|
|
5422
5422
|
}
|
|
5423
5423
|
}), null), l(N, n(Ye, {
|
|
5424
5424
|
get children() {
|
|
5425
|
-
return
|
|
5425
|
+
return ne();
|
|
5426
5426
|
}
|
|
5427
5427
|
}), null), N;
|
|
5428
5428
|
}
|
|
@@ -6720,14 +6720,14 @@ function Ts(e) {
|
|
|
6720
6720
|
autoStart: () => o.autoStart ?? !1,
|
|
6721
6721
|
accessCode: () => o.accessCode,
|
|
6722
6722
|
autoEnterWaitlist: () => o.autoEnterWaitlist ?? !1
|
|
6723
|
-
}), [d, c] = A(!1), g = He(!1), m = Fe(g), [y, C] = A(!1), [x, I] = A(!1), [z, _] = A(!1), [b, $] = A(!1), [S, k] = A(!1), [V, O] = A(!1), [L, J] = A(!1), [W, ee] = A(!1), [Ae, j] = A(!1), [F, K] = A(!1), [
|
|
6723
|
+
}), [d, c] = A(!1), g = He(!1), m = Fe(g), [y, C] = A(!1), [x, I] = A(!1), [z, _] = A(!1), [b, $] = A(!1), [S, k] = A(!1), [V, O] = A(!1), [L, J] = A(!1), [W, ee] = A(!1), [Ae, j] = A(!1), [F, K] = A(!1), [ne, Q] = A(null), [P, E] = A(null), N = (s) => {
|
|
6724
6724
|
Q(s?.message ?? null), E(s);
|
|
6725
6725
|
}, se = Fe(() => t.payment?.list$ ?? Cs);
|
|
6726
6726
|
let ce = null;
|
|
6727
6727
|
const ie = e.deliveredCheckoutOrderIds, te = v(() => f.snapshot()), D = v(() => f.view()), X = v(() => D()?.journeyStage ?? null), xe = v(() => {
|
|
6728
6728
|
const s = D();
|
|
6729
6729
|
return s?.journeyStage === "routed" ? s : void 0;
|
|
6730
|
-
}), fe = v(() => Wt(te())), le = v(() => fe()?.phase ?? xe()?.sequence.phase ?? null), Le = v(() =>
|
|
6730
|
+
}), fe = v(() => Wt(te())), le = v(() => fe()?.phase ?? xe()?.sequence.phase ?? null), Le = v(() => ne() ?? f.error()), G = v(() => {
|
|
6731
6731
|
const s = P() ?? f.fanfareError();
|
|
6732
6732
|
return s ? ht(s, i) : null;
|
|
6733
6733
|
}), U = v(() => G()?.description ?? Le());
|
|
@@ -6755,11 +6755,11 @@ function Ts(e) {
|
|
|
6755
6755
|
const s = Le();
|
|
6756
6756
|
s && o.onError && Xe(() => o.onError?.(new Error(s)));
|
|
6757
6757
|
});
|
|
6758
|
-
const
|
|
6758
|
+
const ae = (s) => {
|
|
6759
6759
|
N(it(s));
|
|
6760
6760
|
}, Be = (s) => {
|
|
6761
6761
|
const u = it(s), p = ht(u, i);
|
|
6762
|
-
throw p.disposition === "INLINE" || p.disposition === "STEP_RESET" ? o.onError?.(u) :
|
|
6762
|
+
throw p.disposition === "INLINE" || p.disposition === "STEP_RESET" ? o.onError?.(u) : ae(u), new Error(p.description);
|
|
6763
6763
|
}, We = (s) => {
|
|
6764
6764
|
const u = it(s);
|
|
6765
6765
|
if (u.quietable) {
|
|
@@ -6773,13 +6773,13 @@ function Ts(e) {
|
|
|
6773
6773
|
o.onError?.(u);
|
|
6774
6774
|
return;
|
|
6775
6775
|
}
|
|
6776
|
-
|
|
6776
|
+
ae(u);
|
|
6777
6777
|
}, Et = async () => {
|
|
6778
6778
|
C(!0), N(null);
|
|
6779
6779
|
try {
|
|
6780
6780
|
await f.start();
|
|
6781
6781
|
} catch (s) {
|
|
6782
|
-
|
|
6782
|
+
ae(s);
|
|
6783
6783
|
} finally {
|
|
6784
6784
|
C(!1);
|
|
6785
6785
|
}
|
|
@@ -6800,8 +6800,8 @@ function Ts(e) {
|
|
|
6800
6800
|
if (s)
|
|
6801
6801
|
try {
|
|
6802
6802
|
s.view$.get().journeyStage === "routing" && await new Promise((T) => {
|
|
6803
|
-
const
|
|
6804
|
-
ue.journeyStage !== "routing" && (
|
|
6803
|
+
const re = s.view$.listen((ue) => {
|
|
6804
|
+
ue.journeyStage !== "routing" && (re(), T());
|
|
6805
6805
|
});
|
|
6806
6806
|
});
|
|
6807
6807
|
const u = s.snapshot$.get();
|
|
@@ -6809,7 +6809,7 @@ function Ts(e) {
|
|
|
6809
6809
|
const p = s.view$.get();
|
|
6810
6810
|
p.journeyStage === "ready" ? await p.start() : (p.journeyStage === "gated" || p.journeyStage === "routed") && await p.reroute();
|
|
6811
6811
|
} catch (u) {
|
|
6812
|
-
|
|
6812
|
+
ae(u);
|
|
6813
6813
|
} finally {
|
|
6814
6814
|
ut(null), c(!1);
|
|
6815
6815
|
}
|
|
@@ -6824,13 +6824,16 @@ function Ts(e) {
|
|
|
6824
6824
|
};
|
|
6825
6825
|
ut(T), g.set(!0), N(null);
|
|
6826
6826
|
try {
|
|
6827
|
+
const re = o.experienceId;
|
|
6827
6828
|
await t.auth.requestOtp(u === "email" ? {
|
|
6828
|
-
email: s
|
|
6829
|
+
email: s,
|
|
6830
|
+
experienceId: re
|
|
6829
6831
|
} : {
|
|
6830
|
-
phone: s
|
|
6832
|
+
phone: s,
|
|
6833
|
+
experienceId: re
|
|
6831
6834
|
});
|
|
6832
|
-
} catch (
|
|
6833
|
-
Er(T) && (ut(p), Be(
|
|
6835
|
+
} catch (re) {
|
|
6836
|
+
Er(T) && (ut(p), Be(re));
|
|
6834
6837
|
} finally {
|
|
6835
6838
|
g.set(!1);
|
|
6836
6839
|
}
|
|
@@ -6882,7 +6885,7 @@ function Ts(e) {
|
|
|
6882
6885
|
accessCode: s
|
|
6883
6886
|
});
|
|
6884
6887
|
} catch (p) {
|
|
6885
|
-
|
|
6888
|
+
ae(p);
|
|
6886
6889
|
} finally {
|
|
6887
6890
|
g.set(!1);
|
|
6888
6891
|
}
|
|
@@ -6895,7 +6898,7 @@ function Ts(e) {
|
|
|
6895
6898
|
const u = s.view$.get();
|
|
6896
6899
|
u.journeyStage === "routed" && u.sequence.phase === "scheduled" && await u.waitlist?.join();
|
|
6897
6900
|
} catch (u) {
|
|
6898
|
-
|
|
6901
|
+
ae(u);
|
|
6899
6902
|
} finally {
|
|
6900
6903
|
g.set(!1), I(!1);
|
|
6901
6904
|
}
|
|
@@ -6908,7 +6911,7 @@ function Ts(e) {
|
|
|
6908
6911
|
const u = s.view$.get();
|
|
6909
6912
|
u.journeyStage === "routed" && u.sequence.phase === "scheduled" && await u.waitlist?.leave();
|
|
6910
6913
|
} catch (u) {
|
|
6911
|
-
|
|
6914
|
+
ae(u);
|
|
6912
6915
|
} finally {
|
|
6913
6916
|
_(!1);
|
|
6914
6917
|
}
|
|
@@ -6924,7 +6927,7 @@ function Ts(e) {
|
|
|
6924
6927
|
try {
|
|
6925
6928
|
await ua();
|
|
6926
6929
|
} catch (s) {
|
|
6927
|
-
|
|
6930
|
+
ae(s);
|
|
6928
6931
|
} finally {
|
|
6929
6932
|
g.set(!1), $(!1);
|
|
6930
6933
|
}
|
|
@@ -6996,7 +6999,7 @@ function Ts(e) {
|
|
|
6996
6999
|
const u = s.view$.get();
|
|
6997
7000
|
u.journeyStage === "routed" && u.sequence.phase === "participating" && "leave" in u.sequence && await u.sequence.leave();
|
|
6998
7001
|
} catch (u) {
|
|
6999
|
-
|
|
7002
|
+
ae(u);
|
|
7000
7003
|
} finally {
|
|
7001
7004
|
k(!1);
|
|
7002
7005
|
}
|
|
@@ -7009,7 +7012,7 @@ function Ts(e) {
|
|
|
7009
7012
|
const u = s.view$.get();
|
|
7010
7013
|
u.journeyStage === "routed" && u.sequence.phase === "participating" && "complete" in u.sequence && await u.sequence.complete();
|
|
7011
7014
|
} catch (u) {
|
|
7012
|
-
|
|
7015
|
+
ae(u);
|
|
7013
7016
|
}
|
|
7014
7017
|
}
|
|
7015
7018
|
}, pa = async (s) => {
|
|
@@ -7022,9 +7025,9 @@ function Ts(e) {
|
|
|
7022
7025
|
p.journeyStage === "routed" && Ss(p.sequence) && await p.sequence.bid(s);
|
|
7023
7026
|
} catch (p) {
|
|
7024
7027
|
const T = it(p), {
|
|
7025
|
-
disposition:
|
|
7028
|
+
disposition: re
|
|
7026
7029
|
} = ht(T, i);
|
|
7027
|
-
throw
|
|
7030
|
+
throw re === "INLINE" || re === "STEP_RESET" ? o.onError?.(T) : ae(T), p;
|
|
7028
7031
|
} finally {
|
|
7029
7032
|
g.set(!1);
|
|
7030
7033
|
}
|
|
@@ -7037,7 +7040,7 @@ function Ts(e) {
|
|
|
7037
7040
|
const T = p.view$.get();
|
|
7038
7041
|
T.journeyStage === "routed" && T.sequence.phase === "enterable" && "book" in T.sequence && await T.sequence.book(s, u);
|
|
7039
7042
|
} catch (T) {
|
|
7040
|
-
|
|
7043
|
+
ae(T);
|
|
7041
7044
|
} finally {
|
|
7042
7045
|
g.set(!1), ee(!1);
|
|
7043
7046
|
}
|
|
@@ -7070,7 +7073,7 @@ function Ts(e) {
|
|
|
7070
7073
|
const u = s.view$.get();
|
|
7071
7074
|
u.journeyStage === "routed" && u.sequence.phase === "participating" && "cancel" in u.sequence && await u.sequence.cancel();
|
|
7072
7075
|
} catch (u) {
|
|
7073
|
-
|
|
7076
|
+
ae(u);
|
|
7074
7077
|
} finally {
|
|
7075
7078
|
j(!1);
|
|
7076
7079
|
}
|
|
@@ -7083,7 +7086,7 @@ function Ts(e) {
|
|
|
7083
7086
|
const T = p.view$.get();
|
|
7084
7087
|
T.journeyStage === "routed" && T.sequence.phase === "participating" && "reschedule" in T.sequence && await T.sequence.reschedule(s, u);
|
|
7085
7088
|
} catch (T) {
|
|
7086
|
-
|
|
7089
|
+
ae(T);
|
|
7087
7090
|
} finally {
|
|
7088
7091
|
K(!1);
|
|
7089
7092
|
}
|
|
@@ -7094,14 +7097,14 @@ function Ts(e) {
|
|
|
7094
7097
|
try {
|
|
7095
7098
|
s && "retry" in s ? await s.retry() : await Et();
|
|
7096
7099
|
} catch (u) {
|
|
7097
|
-
|
|
7100
|
+
ae(u);
|
|
7098
7101
|
}
|
|
7099
7102
|
}, Br = async (s) => {
|
|
7100
7103
|
const u = f.journey();
|
|
7101
7104
|
if (u) {
|
|
7102
7105
|
N(null);
|
|
7103
7106
|
try {
|
|
7104
|
-
const p = Je().find((
|
|
7107
|
+
const p = Je().find((re) => re.type === "bot_check");
|
|
7105
7108
|
p?.type === "bot_check" && p.challenge && await t.challenges.verify({
|
|
7106
7109
|
challengeId: p.challenge.id,
|
|
7107
7110
|
token: s
|
|
@@ -7109,7 +7112,7 @@ function Ts(e) {
|
|
|
7109
7112
|
const T = u.view$.get();
|
|
7110
7113
|
T.journeyStage === "gated" && await T.reroute();
|
|
7111
7114
|
} catch (p) {
|
|
7112
|
-
|
|
7115
|
+
ae(p);
|
|
7113
7116
|
}
|
|
7114
7117
|
}
|
|
7115
7118
|
}, qr = () => {
|
|
@@ -7117,7 +7120,7 @@ function Ts(e) {
|
|
|
7117
7120
|
if (!s) return;
|
|
7118
7121
|
N(null);
|
|
7119
7122
|
const u = s.view$.get();
|
|
7120
|
-
u.journeyStage === "gated" && u.retry().catch(
|
|
7123
|
+
u.journeyStage === "gated" && u.retry().catch(ae);
|
|
7121
7124
|
}, zr = v(() => D()), be = v(() => {
|
|
7122
7125
|
const s = zr();
|
|
7123
7126
|
return s?.journeyStage === "routed" && "sequence" in s ? s.sequence : void 0;
|
|
@@ -7482,7 +7485,7 @@ function Ts(e) {
|
|
|
7482
7485
|
const T = le();
|
|
7483
7486
|
switch (u) {
|
|
7484
7487
|
case "queue": {
|
|
7485
|
-
const
|
|
7488
|
+
const re = rt(), ue = re?.type === "queue" ? re : void 0;
|
|
7486
7489
|
return n(Bt, {
|
|
7487
7490
|
get display$() {
|
|
7488
7491
|
return Qe();
|
|
@@ -7508,7 +7511,7 @@ function Ts(e) {
|
|
|
7508
7511
|
});
|
|
7509
7512
|
}
|
|
7510
7513
|
case "draw": {
|
|
7511
|
-
const
|
|
7514
|
+
const re = rt(), ue = re?.type === "draw" ? re : void 0;
|
|
7512
7515
|
return n(xt, {
|
|
7513
7516
|
get display$() {
|
|
7514
7517
|
return Qe();
|
|
@@ -7534,7 +7537,7 @@ function Ts(e) {
|
|
|
7534
7537
|
});
|
|
7535
7538
|
}
|
|
7536
7539
|
case "auction": {
|
|
7537
|
-
const
|
|
7540
|
+
const re = rt(), ue = re?.type === "auction" ? re : void 0, je = ue?.closeAt ?? ue?.endsAt;
|
|
7538
7541
|
return n(yt, {
|
|
7539
7542
|
get display$() {
|
|
7540
7543
|
return Qe();
|
|
@@ -7554,7 +7557,7 @@ function Ts(e) {
|
|
|
7554
7557
|
});
|
|
7555
7558
|
}
|
|
7556
7559
|
case "timed_release": {
|
|
7557
|
-
const
|
|
7560
|
+
const re = rt(), ue = re?.type === "timed_release" ? re : void 0;
|
|
7558
7561
|
return n(qt, {
|
|
7559
7562
|
get display$() {
|
|
7560
7563
|
return Qe();
|
|
@@ -7584,7 +7587,7 @@ function Ts(e) {
|
|
|
7584
7587
|
});
|
|
7585
7588
|
}
|
|
7586
7589
|
case "appointment": {
|
|
7587
|
-
const
|
|
7590
|
+
const re = rt(), ue = re?.type === "appointment" ? re : void 0;
|
|
7588
7591
|
return n(pr, {
|
|
7589
7592
|
appointmentId: p,
|
|
7590
7593
|
get display$() {
|
|
@@ -7655,7 +7658,7 @@ function Ts(e) {
|
|
|
7655
7658
|
});
|
|
7656
7659
|
}
|
|
7657
7660
|
case "auction": {
|
|
7658
|
-
const T = p?.type === "auction" ? p : void 0,
|
|
7661
|
+
const T = p?.type === "auction" ? p : void 0, re = T?.closeAt ?? T?.endsAt;
|
|
7659
7662
|
return n(
|
|
7660
7663
|
yt,
|
|
7661
7664
|
{
|
|
@@ -7669,7 +7672,7 @@ function Ts(e) {
|
|
|
7669
7672
|
get yourStatus() {
|
|
7670
7673
|
return gt()?.status;
|
|
7671
7674
|
},
|
|
7672
|
-
countdownTo:
|
|
7675
|
+
countdownTo: re ? new Date(re) : void 0,
|
|
7673
7676
|
get currencyCode() {
|
|
7674
7677
|
return T?.currencyCode;
|
|
7675
7678
|
}
|
|
@@ -7679,7 +7682,7 @@ function Ts(e) {
|
|
|
7679
7682
|
}
|
|
7680
7683
|
}
|
|
7681
7684
|
if (le() === "granted") {
|
|
7682
|
-
const u = ya(), p = u?.expiresAt ? new Date(u.expiresAt).getTime() : void 0, T = be(),
|
|
7685
|
+
const u = ya(), p = u?.expiresAt ? new Date(u.expiresAt).getTime() : void 0, T = be(), re = An(T) ? T.settlement : void 0;
|
|
7683
7686
|
if (o.slots?.granted && An(be())) {
|
|
7684
7687
|
const Ma = be();
|
|
7685
7688
|
return o.slots.granted({
|
|
@@ -7689,7 +7692,7 @@ function Ts(e) {
|
|
|
7689
7692
|
expiresAt: p
|
|
7690
7693
|
});
|
|
7691
7694
|
}
|
|
7692
|
-
const ue =
|
|
7695
|
+
const ue = re?.processor === "external" ? o.checkoutUrl : void 0, je = ze()?.details, Te = je?.type === "auction" ? je : void 0, Qt = {
|
|
7693
7696
|
sequencePhase: "granted",
|
|
7694
7697
|
canEnter: !1,
|
|
7695
7698
|
canLeave: !1,
|
|
@@ -7744,12 +7747,12 @@ function Ts(e) {
|
|
|
7744
7747
|
};
|
|
7745
7748
|
return o.slots?.receipt ? o.slots.receipt(Te) : n(ul, Te);
|
|
7746
7749
|
}
|
|
7747
|
-
const p = Ht(), T = u?.phase === "ended" ? u.outcome.reason : void 0,
|
|
7748
|
-
if (
|
|
7750
|
+
const p = Ht(), T = u?.phase === "ended" ? u.outcome.reason : void 0, re = p?.type ?? T ?? "unknown", ue = Io(p, T);
|
|
7751
|
+
if (re === "expired" && o.slots?.expired) {
|
|
7749
7752
|
const Te = Ht()?.at;
|
|
7750
7753
|
return o.slots.expired({
|
|
7751
7754
|
...ye(),
|
|
7752
|
-
reason:
|
|
7755
|
+
reason: re,
|
|
7753
7756
|
endedAt: Te ? new Date(Te) : void 0
|
|
7754
7757
|
});
|
|
7755
7758
|
}
|
|
@@ -7757,7 +7760,7 @@ function Ts(e) {
|
|
|
7757
7760
|
const Te = Ht()?.at;
|
|
7758
7761
|
return o.slots.ended({
|
|
7759
7762
|
...ye(),
|
|
7760
|
-
reason:
|
|
7763
|
+
reason: re,
|
|
7761
7764
|
endedAt: Te ? new Date(Te) : void 0
|
|
7762
7765
|
});
|
|
7763
7766
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fanfare-io/fanfare-sdk-solid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "SolidJS web components for Fanfare experiences",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"solid-element": "^1.8.0",
|
|
43
43
|
"tailwind-merge": "^2.6.0",
|
|
44
44
|
"valibot": "^1.1.0",
|
|
45
|
-
"@fanfare-io/fanfare-sdk-core": "0.
|
|
46
|
-
"@fanfare-io/fanfare-sdk-i18n": "0.
|
|
45
|
+
"@fanfare-io/fanfare-sdk-core": "0.17.0",
|
|
46
|
+
"@fanfare-io/fanfare-sdk-i18n": "0.17.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@size-limit/preset-small-lib": "^11.1.8",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"vite-plugin-solid": "^2.11.6",
|
|
79
79
|
"vite-tsconfig-paths": "^5.1.4",
|
|
80
80
|
"vitest": "^5.0.0",
|
|
81
|
-
"@fanfare-io/fanfare-sdk-core": "0.
|
|
82
|
-
"@fanfare-io/fanfare-sdk-react": "0.
|
|
81
|
+
"@fanfare-io/fanfare-sdk-core": "0.17.0",
|
|
82
|
+
"@fanfare-io/fanfare-sdk-react": "0.17.0"
|
|
83
83
|
},
|
|
84
84
|
"sideEffects": [
|
|
85
85
|
"**/*.css"
|