@getmicdrop/venue-calendar 4.0.84 → 4.0.86
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/README.md +740 -740
- package/dist/{CartView-DwAGELwG.js → CartView-e2hG7cOV.js} +5 -5
- package/dist/CartView-e2hG7cOV.js.map +1 -0
- package/dist/{Checkout-CHo11MsU.js → Checkout-BpTUMyLk.js} +7 -7
- package/dist/Checkout-BpTUMyLk.js.map +1 -0
- package/dist/Checkout-DmnOMwhl.js +809 -0
- package/dist/Checkout-DmnOMwhl.js.map +1 -0
- package/dist/{CheckoutTimer-CAGR7L-7.js → CheckoutTimer-Dv0c-X6O.js} +4 -4
- package/dist/CheckoutTimer-Dv0c-X6O.js.map +1 -0
- package/dist/{CollectionView-Dstgu8sR.js → CollectionView-CyxK6aI9.js} +5 -5
- package/dist/CollectionView-CyxK6aI9.js.map +1 -0
- package/dist/{Event-kfRjkMzQ.js → Event-Cw7b9UEd.js} +6 -6
- package/dist/{Event-kfRjkMzQ.js.map → Event-Cw7b9UEd.js.map} +1 -1
- package/dist/{EventPage-CnhccVCI.js → EventPage-BKtFiZL1.js} +7 -7
- package/dist/EventPage-BKtFiZL1.js.map +1 -0
- package/dist/{Heading-Ielp7dS-.js → Heading-D0grC8vd.js} +2 -2
- package/dist/{Heading-Ielp7dS-.js.map → Heading-D0grC8vd.js.map} +1 -1
- package/dist/{ModalHeader-Q7levd4l.js → ModalHeader-V5AlK1dt.js} +2 -2
- package/dist/{ModalHeader-Q7levd4l.js.map → ModalHeader-V5AlK1dt.js.map} +1 -1
- package/dist/{ScarcityBadge-CG7Mz5YN.js → ScarcityBadge-Co7gZXuW.js} +2 -2
- package/dist/ScarcityBadge-Co7gZXuW.js.map +1 -0
- package/dist/{SeriesPage-C8fIvt63.js → SeriesPage-USYe3APQ.js} +5 -5
- package/dist/SeriesPage-USYe3APQ.js.map +1 -0
- package/dist/{Success-SZNXo-Ou.js → Success-C387RvIY.js} +7 -7
- package/dist/Success-C387RvIY.js.map +1 -0
- package/dist/{Text-DHgQP4rA.js → Text-ZUPglf_o.js} +2 -2
- package/dist/{Text-DHgQP4rA.js.map → Text-ZUPglf_o.js.map} +1 -1
- package/dist/{VenueCalendar-DTOyAhDU.js → VenueCalendar-tmWZSmhT.js} +21 -18
- package/dist/VenueCalendar-tmWZSmhT.js.map +1 -0
- package/dist/{ViewTicketsEmbed-DBEOjijY.js → ViewTicketsEmbed--091XJJn.js} +4 -4
- package/dist/ViewTicketsEmbed--091XJJn.js.map +1 -0
- package/dist/api/api.cjs +1 -1
- package/dist/api/api.cjs.map +1 -1
- package/dist/api/api.mjs +18 -15
- package/dist/api/api.mjs.map +1 -1
- package/dist/api/gift-cards.d.ts +3 -2
- package/dist/{data-toggle-store.svelte-E2JyoGTV.js → data-toggle-store.svelte-Bn0h8FT_.js} +2 -2
- package/dist/data-toggle-store.svelte-Bn0h8FT_.js.map +1 -0
- package/dist/{labels-nQIooadc.js → labels-C7Znep_T.js} +3 -3
- package/dist/labels-C7Znep_T.js.map +1 -0
- package/dist/seo/seo.cjs.map +1 -1
- package/dist/seo/seo.mjs.map +1 -1
- package/dist/{transform-C1Rmuzlt.js → transform-BxgTZDAD.js} +2 -2
- package/dist/transform-BxgTZDAD.js.map +1 -0
- package/dist/types/index.d.ts +442 -442
- package/dist/venue-calendar.css +1 -1
- package/dist/venue-calendar.es.js +2 -2
- package/dist/venue-calendar.iife.js +20 -20
- package/dist/venue-calendar.iife.js.map +1 -1
- package/dist/venue-calendar.umd.js +19 -19
- package/dist/venue-calendar.umd.js.map +1 -1
- package/package.json +170 -170
- package/src/lib/theme.js +222 -222
- package/dist/CartView-DwAGELwG.js.map +0 -1
- package/dist/Checkout-CHo11MsU.js.map +0 -1
- package/dist/Checkout-_NuoBAKt.js +0 -789
- package/dist/Checkout-_NuoBAKt.js.map +0 -1
- package/dist/CheckoutTimer-CAGR7L-7.js.map +0 -1
- package/dist/CollectionView-Dstgu8sR.js.map +0 -1
- package/dist/EventPage-CnhccVCI.js.map +0 -1
- package/dist/ScarcityBadge-CG7Mz5YN.js.map +0 -1
- package/dist/SeriesPage-C8fIvt63.js.map +0 -1
- package/dist/Success-SZNXo-Ou.js.map +0 -1
- package/dist/VenueCalendar-DTOyAhDU.js.map +0 -1
- package/dist/ViewTicketsEmbed-DBEOjijY.js.map +0 -1
- package/dist/data-toggle-store.svelte-E2JyoGTV.js.map +0 -1
- package/dist/labels-nQIooadc.js.map +0 -1
- package/dist/transform-C1Rmuzlt.js.map +0 -1
|
@@ -0,0 +1,809 @@
|
|
|
1
|
+
import "svelte/internal/disclose-version";
|
|
2
|
+
import * as e from "svelte/internal/client";
|
|
3
|
+
import { j as he, C as fe, m as de, s as ce, D as ue, G as Se, r as we, n as Te, o as Pe, W as ke, q as Ee, u as Ae, w as Fe, x as De, y as Ne, z as Oe, A as me, E as pe, F as Re, H as je, I as ze } from "./VenueCalendar-tmWZSmhT.js";
|
|
4
|
+
import { onMount as Ge } from "svelte";
|
|
5
|
+
import { g as Le, C as qe, a as Me } from "./Checkout-BpTUMyLk.js";
|
|
6
|
+
function ie(h) {
|
|
7
|
+
"@babel/helpers - typeof";
|
|
8
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? ie = function(t) {
|
|
9
|
+
return typeof t;
|
|
10
|
+
} : ie = function(t) {
|
|
11
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
12
|
+
}, ie(h);
|
|
13
|
+
}
|
|
14
|
+
var _e = "clover", Ue = function(t) {
|
|
15
|
+
return t === 3 ? "v3" : t;
|
|
16
|
+
}, be = "https://js.stripe.com", Ve = "".concat(be, "/").concat(_e, "/stripe.js"), We = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, Be = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;
|
|
17
|
+
var Ke = function(t) {
|
|
18
|
+
return We.test(t) || Be.test(t);
|
|
19
|
+
}, He = function() {
|
|
20
|
+
for (var t = document.querySelectorAll('script[src^="'.concat(be, '"]')), l = 0; l < t.length; l++) {
|
|
21
|
+
var c = t[l];
|
|
22
|
+
if (Ke(c.src))
|
|
23
|
+
return c;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}, ve = function(t) {
|
|
27
|
+
var l = "", c = document.createElement("script");
|
|
28
|
+
c.src = "".concat(Ve).concat(l);
|
|
29
|
+
var s = document.head || document.body;
|
|
30
|
+
if (!s)
|
|
31
|
+
throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
32
|
+
return s.appendChild(c), c;
|
|
33
|
+
}, Je = function(t, l) {
|
|
34
|
+
!t || !t._registerWrapper || t._registerWrapper({
|
|
35
|
+
name: "stripe-js",
|
|
36
|
+
version: "8.8.0",
|
|
37
|
+
startTime: l
|
|
38
|
+
});
|
|
39
|
+
}, $ = null, ae = null, ne = null, Ye = function(t) {
|
|
40
|
+
return function(l) {
|
|
41
|
+
t(new Error("Failed to load Stripe.js", {
|
|
42
|
+
cause: l
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
}, Xe = function(t, l) {
|
|
46
|
+
return function() {
|
|
47
|
+
window.Stripe ? t(window.Stripe) : l(new Error("Stripe.js not available"));
|
|
48
|
+
};
|
|
49
|
+
}, Ze = function(t) {
|
|
50
|
+
return $ !== null ? $ : ($ = new Promise(function(l, c) {
|
|
51
|
+
if (typeof window > "u" || typeof document > "u") {
|
|
52
|
+
l(null);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (window.Stripe) {
|
|
56
|
+
l(window.Stripe);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
var s = He();
|
|
61
|
+
if (!(s && t)) {
|
|
62
|
+
if (!s)
|
|
63
|
+
s = ve(t);
|
|
64
|
+
else if (s && ne !== null && ae !== null) {
|
|
65
|
+
var u;
|
|
66
|
+
s.removeEventListener("load", ne), s.removeEventListener("error", ae), (u = s.parentNode) === null || u === void 0 || u.removeChild(s), s = ve(t);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
ne = Xe(l, c), ae = Ye(c), s.addEventListener("load", ne), s.addEventListener("error", ae);
|
|
70
|
+
} catch (w) {
|
|
71
|
+
c(w);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}), $.catch(function(l) {
|
|
75
|
+
return $ = null, Promise.reject(l);
|
|
76
|
+
}));
|
|
77
|
+
}, Qe = function(t, l, c) {
|
|
78
|
+
if (t === null)
|
|
79
|
+
return null;
|
|
80
|
+
var s = l[0];
|
|
81
|
+
if (typeof s != "string")
|
|
82
|
+
throw new Error("Expected publishable key to be of type string, got type ".concat(ie(s), " instead."));
|
|
83
|
+
var u = s.match(/^pk_test/), w = Ue(t.version), d = _e;
|
|
84
|
+
u && w !== d && console.warn("Stripe.js@".concat(w, " was loaded on the page, but @stripe/stripe-js@").concat("8.8.0", " expected Stripe.js@").concat(d, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
85
|
+
var x = t.apply(void 0, l);
|
|
86
|
+
return Je(x, c), x;
|
|
87
|
+
}, ee, xe = !1, Ce = function() {
|
|
88
|
+
return ee || (ee = Ze(null).catch(function(t) {
|
|
89
|
+
return ee = null, Promise.reject(t);
|
|
90
|
+
}), ee);
|
|
91
|
+
};
|
|
92
|
+
Promise.resolve().then(function() {
|
|
93
|
+
return Ce();
|
|
94
|
+
}).catch(function(h) {
|
|
95
|
+
xe || console.warn(h);
|
|
96
|
+
});
|
|
97
|
+
var $e = function() {
|
|
98
|
+
for (var t = arguments.length, l = new Array(t), c = 0; c < t; c++)
|
|
99
|
+
l[c] = arguments[c];
|
|
100
|
+
xe = !0;
|
|
101
|
+
var s = Date.now();
|
|
102
|
+
return Ce().then(function(u) {
|
|
103
|
+
return Qe(u, l, s);
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
function X(h) {
|
|
107
|
+
const t = h?.code || h?.decline_code || "", l = h?.type || "", c = h?.message || "";
|
|
108
|
+
if (t === "card_declined" || l === "card_error") {
|
|
109
|
+
const s = h?.decline_code || "";
|
|
110
|
+
return s === "insufficient_funds" ? {
|
|
111
|
+
type: "card_declined",
|
|
112
|
+
title: "Insufficient funds",
|
|
113
|
+
message: "Your card has insufficient funds to complete this purchase.",
|
|
114
|
+
suggestion: "Please try a different payment method or contact your bank.",
|
|
115
|
+
retryable: !0
|
|
116
|
+
} : s === "lost_card" || s === "stolen_card" ? {
|
|
117
|
+
type: "card_declined",
|
|
118
|
+
title: "Card cannot be used",
|
|
119
|
+
message: "This card cannot be used for this transaction.",
|
|
120
|
+
suggestion: "Please use a different payment method.",
|
|
121
|
+
retryable: !0
|
|
122
|
+
} : s === "expired_card" ? {
|
|
123
|
+
type: "card_declined",
|
|
124
|
+
title: "Card expired",
|
|
125
|
+
message: "Your card has expired.",
|
|
126
|
+
suggestion: "Please use a different card or update your card details.",
|
|
127
|
+
retryable: !0
|
|
128
|
+
} : {
|
|
129
|
+
type: "card_declined",
|
|
130
|
+
title: "Card declined",
|
|
131
|
+
message: "Your card was declined by your bank.",
|
|
132
|
+
suggestion: "Please try a different card or contact your bank for more information.",
|
|
133
|
+
retryable: !0
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return l === "api_connection_error" || c.includes("network") || c.includes("connection") ? {
|
|
137
|
+
type: "network",
|
|
138
|
+
title: "Connection error",
|
|
139
|
+
message: "We couldn't connect to the payment server.",
|
|
140
|
+
suggestion: "Please check your internet connection and try again.",
|
|
141
|
+
retryable: !0
|
|
142
|
+
} : t === "rate_limit" ? {
|
|
143
|
+
type: "rate_limit",
|
|
144
|
+
title: "Too many attempts",
|
|
145
|
+
message: "Too many payment attempts. Please wait a moment.",
|
|
146
|
+
suggestion: "Wait 30 seconds before trying again.",
|
|
147
|
+
retryable: !0
|
|
148
|
+
} : t === "incorrect_number" || t === "invalid_number" ? {
|
|
149
|
+
type: "validation",
|
|
150
|
+
title: "Invalid card number",
|
|
151
|
+
message: "The card number you entered is invalid.",
|
|
152
|
+
suggestion: "Please check your card number and try again.",
|
|
153
|
+
retryable: !0
|
|
154
|
+
} : t === "incorrect_cvc" || t === "invalid_cvc" ? {
|
|
155
|
+
type: "validation",
|
|
156
|
+
title: "Invalid security code",
|
|
157
|
+
message: "The security code (CVC) is incorrect.",
|
|
158
|
+
suggestion: "Please check the 3-digit code on the back of your card.",
|
|
159
|
+
retryable: !0
|
|
160
|
+
} : t === "invalid_expiry_month" || t === "invalid_expiry_year" ? {
|
|
161
|
+
type: "validation",
|
|
162
|
+
title: "Invalid expiration date",
|
|
163
|
+
message: "The expiration date is invalid.",
|
|
164
|
+
suggestion: "Please check your card's expiration date.",
|
|
165
|
+
retryable: !0
|
|
166
|
+
} : {
|
|
167
|
+
type: "general",
|
|
168
|
+
title: "Payment failed",
|
|
169
|
+
message: c || "Something went wrong with your payment.",
|
|
170
|
+
suggestion: "Please try again or use a different payment method.",
|
|
171
|
+
retryable: !0
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
const ye = he("GiftCardInput");
|
|
175
|
+
var et = e.from_html('<span class="gc-spinner gc-spinner-sm svelte-emw0hd"></span>'), tt = e.from_html('<div class="applied-card mb-2 svelte-emw0hd"><div class="flex items-center gap-3"><div class="applied-icon svelte-emw0hd"><!></div> <div class="flex flex-col flex-1"><span class="text-xs text-status-success-text font-medium"> </span> <span class="text-sm font-mono text-text-primary"> </span></div> <span class="font-medium text-accent-success"> </span> <button class="remove-btn svelte-emw0hd"><!></button></div></div>'), rt = e.from_html('<div class="full-coverage-badge svelte-emw0hd"><!> <span> </span></div>'), at = e.from_html('<div class="flex justify-between items-center text-sm mt-1.5"><span class="text-text-secondary"> </span> <span class="font-medium text-text-primary"> </span></div>'), nt = e.from_html('<div class="applied-card mb-3 svelte-emw0hd"><div class="flex justify-between items-center text-sm"><span class="text-text-secondary"> </span> <span class="font-medium text-accent-success"> </span></div> <!></div>'), it = e.from_html('<span class="gc-spinner svelte-emw0hd"></span>'), st = e.from_html('<div class="flex items-center gap-1.5 mt-2 text-sm text-accent-danger"><!> <span> </span></div>'), ot = e.from_html('<div class="input-section svelte-emw0hd"><div class="flex gap-2"><input type="text" name="giftCardCode" autocomplete="off" autocapitalize="characters"/> <button class="apply-btn svelte-emw0hd"><!></button></div> <!></div>'), lt = e.from_html('<div class="mb-4"><!> <!> <button class="gift-card-toggle svelte-emw0hd"><!> <span> </span> <span class="toggle-indicator svelte-emw0hd"> </span></button> <!></div>');
|
|
176
|
+
function dt(h, t) {
|
|
177
|
+
e.push(t, !0);
|
|
178
|
+
let l = e.prop(t, "onApplied", 3, () => {
|
|
179
|
+
}), c = e.prop(t, "onRemoved", 3, () => {
|
|
180
|
+
}), s = e.prop(t, "disabled", 3, !1), u = e.prop(t, "labels", 19, () => ({})), w = e.state(""), d = e.state(!1), x = e.state(""), E = e.state(e.proxy([])), R = e.state(!1), m = e.state(0), y = e.derived(() => e.get(E).reduce((f, o) => f + (o.giftCardAmount || 0), 0)), A = e.derived(() => Math.max(0, e.get(m) - e.get(y))), Z = e.derived(() => e.get(E).length > 0 && e.get(A) <= 0);
|
|
181
|
+
function L() {
|
|
182
|
+
if (e.get(E).length === 0) {
|
|
183
|
+
c()();
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
l()({
|
|
187
|
+
code: e.get(E).map((f) => f.code).join(", "),
|
|
188
|
+
giftCardAmount: e.get(y),
|
|
189
|
+
stripeAmount: e.get(A),
|
|
190
|
+
requiresStripe: e.get(A) > 0,
|
|
191
|
+
paymentType: e.get(A) > 0 ? "split" : "gift_card_only",
|
|
192
|
+
orderTotal: e.get(m)
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
async function B() {
|
|
196
|
+
const f = e.get(w).trim().toUpperCase();
|
|
197
|
+
if (!(!f || e.get(d) || !t.cartId)) {
|
|
198
|
+
if (e.get(E).some((o) => o.code === f)) {
|
|
199
|
+
e.set(x, u().giftCardAlreadyApplied || "That gift card is already applied", !0);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
e.set(d, !0), e.set(x, "");
|
|
203
|
+
try {
|
|
204
|
+
const o = await Pe(t.cartId, f);
|
|
205
|
+
o.valid ? (e.set(
|
|
206
|
+
E,
|
|
207
|
+
[
|
|
208
|
+
...e.get(E),
|
|
209
|
+
{
|
|
210
|
+
code: o.giftCardCode || f,
|
|
211
|
+
giftCardAmount: o.giftCardAmount || 0
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
!0
|
|
215
|
+
), e.set(m, e.get(y) + (o.stripeAmount || 0)), e.set(w, ""), e.set(R, !1), L()) : e.set(x, o.error || u().invalidGiftCardCode || "Invalid gift card code", !0);
|
|
216
|
+
} catch (o) {
|
|
217
|
+
ye.error("Error applying gift card:", o), e.set(x, u().failedToApplyGiftCard || "Failed to apply gift card. Please try again.", !0);
|
|
218
|
+
}
|
|
219
|
+
e.set(d, !1);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
async function te(f) {
|
|
223
|
+
if (!(e.get(d) || !t.cartId)) {
|
|
224
|
+
e.set(d, !0), e.set(x, "");
|
|
225
|
+
try {
|
|
226
|
+
const o = await we(t.cartId, f);
|
|
227
|
+
o.success !== !1 && !o.error ? (e.set(E, e.get(E).filter((S) => S.code !== f), !0), L()) : e.set(x, o.error || u().failedToRemoveGiftCard || "Failed to remove gift card.", !0);
|
|
228
|
+
} catch (o) {
|
|
229
|
+
ye.error("Error removing gift card:", o), e.set(x, u().failedToRemoveGiftCard || "Failed to remove gift card. Please try again.", !0);
|
|
230
|
+
}
|
|
231
|
+
e.set(d, !1);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function F(f) {
|
|
235
|
+
f.key === "Enter" && !e.get(d) && B();
|
|
236
|
+
}
|
|
237
|
+
function K() {
|
|
238
|
+
e.set(R, !e.get(R)), e.get(R) || (e.set(w, ""), e.set(x, ""));
|
|
239
|
+
}
|
|
240
|
+
var j = lt(), q = e.child(j);
|
|
241
|
+
e.each(q, 17, () => e.get(E), (f) => f.code, (f, o) => {
|
|
242
|
+
var S = tt(), I = e.child(S), G = e.child(I), D = e.child(G);
|
|
243
|
+
fe(D, { size: 16 }), e.reset(G);
|
|
244
|
+
var U = e.sibling(G, 2), V = e.child(U), Y = e.child(V, !0);
|
|
245
|
+
e.reset(V);
|
|
246
|
+
var W = e.sibling(V, 2), T = e.child(W, !0);
|
|
247
|
+
e.reset(W), e.reset(U);
|
|
248
|
+
var g = e.sibling(U, 2), b = e.child(g);
|
|
249
|
+
e.reset(g);
|
|
250
|
+
var P = e.sibling(g, 2), N = e.child(P);
|
|
251
|
+
{
|
|
252
|
+
var r = (a) => {
|
|
253
|
+
var i = et();
|
|
254
|
+
e.append(a, i);
|
|
255
|
+
}, n = (a) => {
|
|
256
|
+
Te(a, { size: 16 });
|
|
257
|
+
};
|
|
258
|
+
e.if(N, (a) => {
|
|
259
|
+
e.get(d) ? a(r) : a(n, -1);
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
e.reset(P), e.reset(I), e.reset(S), e.template_effect(
|
|
263
|
+
(a) => {
|
|
264
|
+
e.set_text(Y, u().giftCardApplied || "Gift card applied"), e.set_text(T, e.get(o).code), e.set_text(b, `-${a ?? ""}`), P.disabled = e.get(d) || s(), e.set_attribute(P, "aria-label", u().removeGiftCard || "Remove gift card");
|
|
265
|
+
},
|
|
266
|
+
[() => de(e.get(o).giftCardAmount)]
|
|
267
|
+
), e.delegated("click", P, () => te(e.get(o).code)), e.transition(3, S, () => ce, () => ({ duration: ue.fast })), e.append(f, S);
|
|
268
|
+
});
|
|
269
|
+
var _ = e.sibling(q, 2);
|
|
270
|
+
{
|
|
271
|
+
var re = (f) => {
|
|
272
|
+
var o = nt(), S = e.child(o), I = e.child(S), G = e.child(I, !0);
|
|
273
|
+
e.reset(I);
|
|
274
|
+
var D = e.sibling(I, 2), U = e.child(D);
|
|
275
|
+
e.reset(D), e.reset(S);
|
|
276
|
+
var V = e.sibling(S, 2);
|
|
277
|
+
{
|
|
278
|
+
var Y = (T) => {
|
|
279
|
+
var g = rt(), b = e.child(g);
|
|
280
|
+
fe(b, { size: 16 });
|
|
281
|
+
var P = e.sibling(b, 2), N = e.child(P, !0);
|
|
282
|
+
e.reset(P), e.reset(g), e.template_effect(() => e.set_text(N, u().fullyCoveredByGiftCard || "Fully covered by gift card")), e.append(T, g);
|
|
283
|
+
}, W = (T) => {
|
|
284
|
+
var g = at(), b = e.child(g), P = e.child(b, !0);
|
|
285
|
+
e.reset(b);
|
|
286
|
+
var N = e.sibling(b, 2), r = e.child(N, !0);
|
|
287
|
+
e.reset(N), e.reset(g), e.template_effect(
|
|
288
|
+
(n) => {
|
|
289
|
+
e.set_text(P, u().remainingToPay || "Remaining to pay"), e.set_text(r, n);
|
|
290
|
+
},
|
|
291
|
+
[() => de(e.get(A))]
|
|
292
|
+
), e.append(T, g);
|
|
293
|
+
};
|
|
294
|
+
e.if(V, (T) => {
|
|
295
|
+
e.get(Z) ? T(Y) : T(W, -1);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
e.reset(o), e.template_effect(
|
|
299
|
+
(T) => {
|
|
300
|
+
e.set_text(G, u().appliedToOrder || "Applied to order"), e.set_text(U, `-${T ?? ""}`);
|
|
301
|
+
},
|
|
302
|
+
[() => de(e.get(y))]
|
|
303
|
+
), e.append(f, o);
|
|
304
|
+
};
|
|
305
|
+
e.if(_, (f) => {
|
|
306
|
+
e.get(E).length > 0 && f(re);
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
var M = e.sibling(_, 2), H = e.child(M);
|
|
310
|
+
Se(H, { size: 20, class: "gift-icon" });
|
|
311
|
+
var C = e.sibling(H, 2), z = e.child(C, !0);
|
|
312
|
+
e.reset(C);
|
|
313
|
+
var J = e.sibling(C, 2), se = e.child(J, !0);
|
|
314
|
+
e.reset(J), e.reset(M);
|
|
315
|
+
var oe = e.sibling(M, 2);
|
|
316
|
+
{
|
|
317
|
+
var le = (f) => {
|
|
318
|
+
var o = ot(), S = e.child(o), I = e.child(S);
|
|
319
|
+
e.remove_input_defaults(I);
|
|
320
|
+
let G;
|
|
321
|
+
var D = e.sibling(I, 2), U = e.child(D);
|
|
322
|
+
{
|
|
323
|
+
var V = (g) => {
|
|
324
|
+
var b = it();
|
|
325
|
+
e.append(g, b);
|
|
326
|
+
}, Y = (g) => {
|
|
327
|
+
var b = e.text();
|
|
328
|
+
e.template_effect(() => e.set_text(b, u().apply || "Apply")), e.append(g, b);
|
|
329
|
+
};
|
|
330
|
+
e.if(U, (g) => {
|
|
331
|
+
e.get(d) ? g(V) : g(Y, -1);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
e.reset(D), e.reset(S);
|
|
335
|
+
var W = e.sibling(S, 2);
|
|
336
|
+
{
|
|
337
|
+
var T = (g) => {
|
|
338
|
+
var b = st(), P = e.child(b);
|
|
339
|
+
ke(P, { size: 16 });
|
|
340
|
+
var N = e.sibling(P, 2), r = e.child(N, !0);
|
|
341
|
+
e.reset(N), e.reset(b), e.template_effect(() => e.set_text(r, e.get(x))), e.transition(3, b, () => ce, () => ({ duration: ue.micro })), e.append(g, b);
|
|
342
|
+
};
|
|
343
|
+
e.if(W, (g) => {
|
|
344
|
+
e.get(x) && g(T);
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
e.reset(o), e.template_effect(
|
|
348
|
+
(g) => {
|
|
349
|
+
e.set_attribute(I, "aria-label", u().enterGiftCardCode || "Enter gift card code"), e.set_attribute(I, "placeholder", u().enterGiftCardCode || "Enter gift card code"), I.disabled = e.get(d) || s(), G = e.set_class(I, 1, "gift-input svelte-emw0hd", null, G, { "has-error": !!e.get(x) }), D.disabled = g;
|
|
350
|
+
},
|
|
351
|
+
[() => !e.get(w).trim() || e.get(d) || s()]
|
|
352
|
+
), e.delegated("keydown", I, F), e.bind_value(I, () => e.get(w), (g) => e.set(w, g)), e.delegated("click", D, B), e.transition(3, o, () => ce, () => ({ duration: ue.fast })), e.append(f, o);
|
|
353
|
+
};
|
|
354
|
+
e.if(oe, (f) => {
|
|
355
|
+
e.get(R) && f(le);
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
e.reset(j), e.template_effect(() => {
|
|
359
|
+
M.disabled = s(), e.set_attribute(M, "aria-expanded", e.get(R)), e.set_text(z, e.get(E).length > 0 ? u().addAnotherGiftCard || "Add another gift card" : u().haveAGiftCard || "Have a gift card?"), e.set_text(se, e.get(R) ? "-" : "+");
|
|
360
|
+
}), e.delegated("click", M, K), e.append(h, j), e.pop();
|
|
361
|
+
}
|
|
362
|
+
e.delegate(["click", "keydown"]);
|
|
363
|
+
const O = he("Checkout");
|
|
364
|
+
var ct = e.from_html('<div class="max-w-6xl mx-auto px-4 md:px-6 -mt-4 mb-8"><!></div>'), ut = e.from_html("<!> <!>", 1), gt = e.from_html('<div class="p-8 text-center"><p class="text-accent-danger"> </p></div>'), ft = e.from_html('<div class="p-8 text-center"><p class="text-muted-foreground"> </p></div>');
|
|
365
|
+
function ht(h, t) {
|
|
366
|
+
e.push(t, !0);
|
|
367
|
+
let l = e.prop(t, "availableTickets", 23, () => []);
|
|
368
|
+
e.prop(t, "value", 3, "");
|
|
369
|
+
let c = e.prop(t, "venueId", 3, ""), s = e.prop(t, "organizationId", 3, ""), u = e.prop(t, "onNavigateBack", 3, void 0), w = e.prop(t, "initialError", 3, void 0), d = e.prop(t, "labels", 19, () => ({})), x = e.derived(() => (t.data || {}).id);
|
|
370
|
+
e.derived(() => (t.data || {}).orgSlug);
|
|
371
|
+
let E = e.derived(() => (t.data || {}).slug), R = e.derived(() => (t.data || {}).event), m = e.derived(() => e.get(R) ? Ee(e.get(R)) : t.data && (t.data.id || e.get(x)) ? {
|
|
372
|
+
id: t.data.id || e.get(x),
|
|
373
|
+
eventID: t.data.id || e.get(x),
|
|
374
|
+
venueID: t.data.venueID ?? t.data.venueId ?? null,
|
|
375
|
+
venueId: t.data.venueId ?? t.data.venueID ?? null,
|
|
376
|
+
eventTicketingType: 0,
|
|
377
|
+
ticketType: 0,
|
|
378
|
+
availableTickets: []
|
|
379
|
+
} : null), y = e.state(""), A = e.state(e.proxy({})), Z = e.state(e.proxy({})), L = e.state(e.proxy([])), B = e.state(""), te = e.state(0), F = e.state(!1), K = e.state(null), j = e.state(""), q = e.state(void 0), _ = e.state(""), re = e.state(!1), M = e.state(""), H = e.state(null), C = e.state(null), z = null;
|
|
380
|
+
Ge(async () => {
|
|
381
|
+
if (e.set(y, Le(Me.CHECKOUT_CARTID), !0), !e.get(y)) {
|
|
382
|
+
e.set(re, !0), e.set(M, d().noCheckoutSession || "No checkout session found. Please select tickets first.", !0);
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
try {
|
|
386
|
+
const i = Ae(e.get(m)?.eventID || e.get(m)?.id || e.get(x));
|
|
387
|
+
e.set(A, i.quantities || {}, !0), e.set(Z, i.donationAmounts || {}, !0), e.set(B, i.promocode || "", !0), e.set(te, i.promoDiscountAmount || 0, !0), e.set(L, i.tickets || [], !0);
|
|
388
|
+
} catch (i) {
|
|
389
|
+
O.error("Error loading checkout state:", i), e.set(A, {}, !0), e.set(L, [], !0);
|
|
390
|
+
}
|
|
391
|
+
e.get(L).length > 0 && e.get(m) && (e.get(m).availableTickets = e.get(L), l(e.get(L)));
|
|
392
|
+
let r = {
|
|
393
|
+
serviceFeeCents: 0,
|
|
394
|
+
serviceFeePercentage: 0,
|
|
395
|
+
serviceFeeChargeType: "both",
|
|
396
|
+
maxServiceFeeCents: 0,
|
|
397
|
+
taxPercentage: 0
|
|
398
|
+
};
|
|
399
|
+
try {
|
|
400
|
+
const i = (
|
|
401
|
+
/** @type {any} */
|
|
402
|
+
await Fe(e.get(m)?.venueID || e.get(m)?.venueId || c())
|
|
403
|
+
);
|
|
404
|
+
r = {
|
|
405
|
+
serviceFeeCents: Number(i?.serviceFeeCents ?? 0),
|
|
406
|
+
serviceFeePercentage: Number(i?.serviceFeePercentage ?? 0),
|
|
407
|
+
serviceFeeChargeType: String(i?.serviceFeeChargeType ?? "both"),
|
|
408
|
+
maxServiceFeeCents: Number(i?.maxServiceFeeCents ?? 0),
|
|
409
|
+
taxPercentage: Number(i?.taxPercentage ?? 0)
|
|
410
|
+
};
|
|
411
|
+
} catch (i) {
|
|
412
|
+
O.error("Error fetching venue data:", i);
|
|
413
|
+
}
|
|
414
|
+
const n = oe(e.get(A), e.get(L), r);
|
|
415
|
+
Object.keys(e.get(A)).length > 0 && await J();
|
|
416
|
+
let a = 900;
|
|
417
|
+
if (e.get(y)) {
|
|
418
|
+
const i = typeof localStorage < "u" ? localStorage.getItem(`checkout-expiry-${e.get(
|
|
419
|
+
y
|
|
420
|
+
// @storage-escape: checkout-timer state (intentional raw localStorage)
|
|
421
|
+
)}`) : null;
|
|
422
|
+
if (i) {
|
|
423
|
+
const p = Math.max(0, Math.floor((parseInt(i, 10) - Date.now()) / 1e3));
|
|
424
|
+
p > 0 && (a = p);
|
|
425
|
+
}
|
|
426
|
+
try {
|
|
427
|
+
const p = await De(e.get(y));
|
|
428
|
+
!p.error && p.expiresAt && (a = Math.max(0, Math.floor((new Date(p.expiresAt).getTime() - Date.now()) / 1e3)), localStorage.setItem(
|
|
429
|
+
// @storage-escape: checkout-timer state (intentional raw localStorage)
|
|
430
|
+
`checkout-expiry-${e.get(y)}`,
|
|
431
|
+
String(new Date(p.expiresAt).getTime())
|
|
432
|
+
));
|
|
433
|
+
} catch {
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
if (e.set(
|
|
437
|
+
C,
|
|
438
|
+
{
|
|
439
|
+
event: se(e.get(m), r),
|
|
440
|
+
lines: n,
|
|
441
|
+
timerStart: a,
|
|
442
|
+
promoApplied: !!e.get(B),
|
|
443
|
+
promoDiscount: e.get(te),
|
|
444
|
+
forceExpired: !1,
|
|
445
|
+
...z ? { serverTotals: z } : {}
|
|
446
|
+
},
|
|
447
|
+
!0
|
|
448
|
+
), w()) {
|
|
449
|
+
const i = X(typeof w() == "object" ? w() : {
|
|
450
|
+
code: "card_declined",
|
|
451
|
+
message: "Your card was declined. Please try a different payment method."
|
|
452
|
+
});
|
|
453
|
+
e.set(_, i.message, !0);
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
async function J() {
|
|
457
|
+
if (!e.get(y)) {
|
|
458
|
+
O.error("Missing cartId!");
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
const r = Object.fromEntries(Object.entries(e.get(A)).filter(([n, a]) => a > 0));
|
|
462
|
+
try {
|
|
463
|
+
const n = Object.fromEntries(Object.entries(e.get(Z)).filter(([, v]) => parseFloat(String(v)) > 0).map(([v, k]) => [parseInt(v, 10), parseFloat(String(k))]));
|
|
464
|
+
if (e.get(B)) {
|
|
465
|
+
const v = await Ne(e.get(y), e.get(B));
|
|
466
|
+
v.success || O.error("Failed to apply promo code to cart:", v.error);
|
|
467
|
+
}
|
|
468
|
+
const a = await Oe(e.get(y), r, Object.keys(n).length > 0 ? n : void 0);
|
|
469
|
+
if (!a) {
|
|
470
|
+
e.set(_, d().failedToCreatePaymentIntent || "Failed to create payment intent. Please try again.", !0);
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
const i = (
|
|
474
|
+
/** @type {any} */
|
|
475
|
+
a
|
|
476
|
+
);
|
|
477
|
+
if (z = {
|
|
478
|
+
subtotal: (i.subtotal ?? 0) / 100,
|
|
479
|
+
fees: (i.service_fee ?? 0) / 100,
|
|
480
|
+
taxes: (i.tax_amount_exclusive ?? 0) / 100,
|
|
481
|
+
total: (i.amount_total ?? 0) / 100,
|
|
482
|
+
promoDiscount: (i.discount ?? 0) / 100,
|
|
483
|
+
giftCardAmount: (i.gift_card_amount ?? 0) / 100,
|
|
484
|
+
stripeAmount: (i.stripe_amount ?? 0) / 100
|
|
485
|
+
}, e.get(C) && e.set(
|
|
486
|
+
C,
|
|
487
|
+
{
|
|
488
|
+
...e.get(C),
|
|
489
|
+
serverTotals: z
|
|
490
|
+
},
|
|
491
|
+
!0
|
|
492
|
+
), i.requires_stripe === !1 || i.payment_type === "free") {
|
|
493
|
+
e.set(j, "free");
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
const p = a.stripe_publishable_key;
|
|
497
|
+
if (!p) {
|
|
498
|
+
O.error("No Stripe publishable key in payment intent response"), e.set(_, d().paymentConfigError || "Payment configuration error. Please try again.", !0);
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
e.set(K, await $e(p), !0), a.client_secret ? e.set(j, a.client_secret, !0) : e.set(_, d().failedToInitPayment || "Failed to initialize payment. Please try again.", !0);
|
|
502
|
+
} catch (n) {
|
|
503
|
+
O.error("Failed to initialize Stripe payment:", n), e.set(_, n.message || d().failedToInitPayment || "Failed to initialize payment. Please try again.", !0);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
function se(r, n) {
|
|
507
|
+
return r ? {
|
|
508
|
+
id: r.id || r.eventID,
|
|
509
|
+
title: r.name || r.title || "",
|
|
510
|
+
slug: r.slug || e.get(E) || "",
|
|
511
|
+
description: r.description || "",
|
|
512
|
+
date: r.date || "",
|
|
513
|
+
startDateTime: r.startDateTime || "",
|
|
514
|
+
endDateTime: r.endDateTime || "",
|
|
515
|
+
doorsOpenTime: r.doorsOpenTime || "",
|
|
516
|
+
timezone: r.timeZone || r.timezone || me(),
|
|
517
|
+
imageUrl: r.imageUrl || r.image || "",
|
|
518
|
+
venue: {
|
|
519
|
+
id: r.venueID || r.venueId || 0,
|
|
520
|
+
name: r.venueName || "",
|
|
521
|
+
address: r.venueAddress || "",
|
|
522
|
+
timezone: r.timeZone || r.timezone || me(),
|
|
523
|
+
serviceFeePercentage: n.serviceFeePercentage,
|
|
524
|
+
serviceFeeCents: n.serviceFeeCents,
|
|
525
|
+
taxPercentage: n.taxPercentage,
|
|
526
|
+
serviceFeeChargeType: n.serviceFeeChargeType,
|
|
527
|
+
maxServiceFeeCents: n.maxServiceFeeCents
|
|
528
|
+
},
|
|
529
|
+
performers: r.performers || [],
|
|
530
|
+
tickets: (r.availableTickets || []).map((a) => ({
|
|
531
|
+
id: a.ID || a.id,
|
|
532
|
+
name: a.name || "",
|
|
533
|
+
description: a.description || "",
|
|
534
|
+
price: (a.price || 0) / 100,
|
|
535
|
+
fee: 0,
|
|
536
|
+
quantityAvailable: a.quantityAvailable || 0,
|
|
537
|
+
quantityTotal: a.quantityTotal || 0,
|
|
538
|
+
minPerOrder: a.minPerOrder || 1,
|
|
539
|
+
maxPerOrder: a.maxPerOrder || 10,
|
|
540
|
+
status: "on_sale",
|
|
541
|
+
isDonation: a.type === 2,
|
|
542
|
+
isHidden: !1
|
|
543
|
+
})),
|
|
544
|
+
faqs: r.faqs || [],
|
|
545
|
+
status: "on_sale",
|
|
546
|
+
isPasswordProtected: !1,
|
|
547
|
+
isRegistrationEvent: r.eventTicketingType === 1 || r.ticketType === 1,
|
|
548
|
+
totalTicketsRemaining: 100,
|
|
549
|
+
totalTicketsCapacity: 100
|
|
550
|
+
} : null;
|
|
551
|
+
}
|
|
552
|
+
function oe(r, n, a) {
|
|
553
|
+
const i = [];
|
|
554
|
+
for (const [p, v] of Object.entries(r)) {
|
|
555
|
+
if (v <= 0) continue;
|
|
556
|
+
const k = n.find((ge) => String(ge.ID) === p || String(ge.id) === p);
|
|
557
|
+
if (!k) continue;
|
|
558
|
+
const Q = k.price || 0, Ie = le(Q, a);
|
|
559
|
+
i.push({
|
|
560
|
+
ticketId: parseInt(p),
|
|
561
|
+
ticketName: k.name || "",
|
|
562
|
+
quantity: v,
|
|
563
|
+
unitPrice: Q,
|
|
564
|
+
fee: Ie,
|
|
565
|
+
subtotal: pe(Q * v)
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
return i;
|
|
569
|
+
}
|
|
570
|
+
function le(r, n) {
|
|
571
|
+
if (r === 0) return 0;
|
|
572
|
+
const {
|
|
573
|
+
serviceFeePercentage: a = 0,
|
|
574
|
+
serviceFeeCents: i = 0,
|
|
575
|
+
serviceFeeChargeType: p = "both",
|
|
576
|
+
maxServiceFeeCents: v = 0
|
|
577
|
+
} = n;
|
|
578
|
+
let k = 0;
|
|
579
|
+
return (p === "percentage" || p === "both") && (k += r * (a / 100)), (p === "fixed" || p === "flat" || p === "cents" || p === "both") && (k += i / 100), v > 0 && (k = Math.min(k, v / 100)), pe(k);
|
|
580
|
+
}
|
|
581
|
+
let f = e.derived(() => Object.values(e.get(Z)).some((r) => (Number(r) || 0) > 0)), o = e.derived(() => !e.get(f) && (e.get(C) ? e.get(C).lines.every((r) => r.unitPrice === 0) : !0));
|
|
582
|
+
async function S(r) {
|
|
583
|
+
if (!e.get(F)) {
|
|
584
|
+
e.set(F, !0), e.set(_, "");
|
|
585
|
+
try {
|
|
586
|
+
if (e.get(H) && !e.get(H).requiresStripe) {
|
|
587
|
+
await I(r);
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
if (e.get(o)) {
|
|
591
|
+
await G(r);
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
if (!e.get(q)) {
|
|
595
|
+
e.set(_, d().paymentFormNotReady || "Payment form is not ready. Please wait a moment and try again.", !0), e.set(F, !1);
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
if (!e.get(K)) {
|
|
599
|
+
e.set(_, d().paymentSystemNotInitialized || "Payment system is not initialized. Please refresh the page.", !0), e.set(F, !1);
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
const { error: n } = await e.get(q).submit();
|
|
603
|
+
if (n) {
|
|
604
|
+
const v = X(n);
|
|
605
|
+
e.set(_, v.message, !0), e.set(F, !1);
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
const a = await e.get(K).confirmPayment({ elements: e.get(q), redirect: "if_required" });
|
|
609
|
+
if (a.error) {
|
|
610
|
+
const v = X(a.error);
|
|
611
|
+
e.set(_, v.message, !0), e.set(F, !1);
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
const i = {
|
|
615
|
+
id: e.get(y),
|
|
616
|
+
paymentIntentId: a.paymentIntent.id,
|
|
617
|
+
tickets: e.get(A),
|
|
618
|
+
firstName: r.firstName,
|
|
619
|
+
lastName: r.lastName,
|
|
620
|
+
email: r.email,
|
|
621
|
+
paymentMethod: "credit-card",
|
|
622
|
+
mailingList: r.keepMeUpdated,
|
|
623
|
+
saleType: "online"
|
|
624
|
+
}, p = await je(e.get(y), i);
|
|
625
|
+
if (p?.status === "Payment succeeded") {
|
|
626
|
+
const v = {
|
|
627
|
+
orderId: e.get(y),
|
|
628
|
+
eventId: e.get(m)?.id || e.get(m)?.eventID || null,
|
|
629
|
+
event: e.get(m) || null,
|
|
630
|
+
venueId: c() || e.get(m)?.venueId || null,
|
|
631
|
+
organizationId: s() || e.get(m)?.organizationId || null
|
|
632
|
+
};
|
|
633
|
+
t.onNavigateToSuccess && t.onNavigateToSuccess(v);
|
|
634
|
+
} else p?.status === "Payment amount does not match the total price" ? e.set(_, d().paymentAmountMismatch || "Payment amount mismatch. Please refresh and try again.", !0) : e.set(_, d().paymentValidationFailed || "Payment validation failed. Please try again.", !0);
|
|
635
|
+
} catch (n) {
|
|
636
|
+
O.error("Payment execution error:", n);
|
|
637
|
+
const a = X(n);
|
|
638
|
+
e.set(_, a.message, !0);
|
|
639
|
+
} finally {
|
|
640
|
+
e.set(F, !1);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
async function I(r) {
|
|
645
|
+
try {
|
|
646
|
+
const n = await ze(e.get(y), {
|
|
647
|
+
firstName: r.firstName,
|
|
648
|
+
lastName: r.lastName,
|
|
649
|
+
email: r.email,
|
|
650
|
+
phoneNumber: null,
|
|
651
|
+
mailingList: r.keepMeUpdated
|
|
652
|
+
});
|
|
653
|
+
if (n?.success) {
|
|
654
|
+
const a = {
|
|
655
|
+
orderId: n.orderId || e.get(y),
|
|
656
|
+
eventId: e.get(m)?.id || e.get(m)?.eventID || null,
|
|
657
|
+
event: e.get(m) || null,
|
|
658
|
+
venueId: c() || e.get(m)?.venueId || null,
|
|
659
|
+
organizationId: s() || e.get(m)?.organizationId || null,
|
|
660
|
+
paymentType: "gift_card_only"
|
|
661
|
+
};
|
|
662
|
+
t.onNavigateToSuccess && t.onNavigateToSuccess(a);
|
|
663
|
+
} else
|
|
664
|
+
e.set(_, n?.error || d().failedToCompleteOrder || "Failed to complete order. Please try again.", !0);
|
|
665
|
+
} catch (n) {
|
|
666
|
+
O.error("Gift card payment error:", n);
|
|
667
|
+
const a = X(n);
|
|
668
|
+
e.set(_, a.message, !0);
|
|
669
|
+
} finally {
|
|
670
|
+
e.set(F, !1);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
async function G(r) {
|
|
674
|
+
try {
|
|
675
|
+
if (e.get(j) !== "free" && await J(), e.get(j) !== "free") {
|
|
676
|
+
e.set(_, d().failedToCompleteOrder || "Could not complete the order. Please try again.", !0);
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
const n = {
|
|
680
|
+
orderId: e.get(y),
|
|
681
|
+
eventId: e.get(m)?.id || e.get(m)?.eventID || null,
|
|
682
|
+
event: e.get(m) || null,
|
|
683
|
+
venueId: c() || e.get(m)?.venueId || null,
|
|
684
|
+
organizationId: s() || e.get(m)?.organizationId || null,
|
|
685
|
+
paymentType: "free"
|
|
686
|
+
};
|
|
687
|
+
t.onNavigateToSuccess && t.onNavigateToSuccess(n);
|
|
688
|
+
} catch (n) {
|
|
689
|
+
O.error("Free order completion error:", n);
|
|
690
|
+
const a = X(n);
|
|
691
|
+
e.set(_, a.message, !0);
|
|
692
|
+
} finally {
|
|
693
|
+
e.set(F, !1);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
function D(r) {
|
|
697
|
+
if (e.set(H, r, !0), e.get(C) && z) {
|
|
698
|
+
const n = r.requiresStripe ? r.stripeAmount ?? 0 : 0;
|
|
699
|
+
e.set(
|
|
700
|
+
C,
|
|
701
|
+
{
|
|
702
|
+
...e.get(C),
|
|
703
|
+
serverTotals: {
|
|
704
|
+
...z,
|
|
705
|
+
giftCardAmount: r.giftCardAmount ?? 0,
|
|
706
|
+
total: n
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
!0
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
r.requiresStripe ? e.get(y) && Object.keys(e.get(A)).length > 0 && J() : (e.set(q, void 0), e.set(K, null), e.set(j, ""));
|
|
713
|
+
}
|
|
714
|
+
function U() {
|
|
715
|
+
e.set(H, null), e.get(C) && z && e.set(
|
|
716
|
+
C,
|
|
717
|
+
{
|
|
718
|
+
...e.get(C),
|
|
719
|
+
serverTotals: z
|
|
720
|
+
},
|
|
721
|
+
!0
|
|
722
|
+
), e.get(y) && Object.keys(e.get(A)).length > 0 && J();
|
|
723
|
+
}
|
|
724
|
+
function V() {
|
|
725
|
+
u() ? u()() : window.history.back();
|
|
726
|
+
}
|
|
727
|
+
function Y() {
|
|
728
|
+
u() ? u()() : window.history.back();
|
|
729
|
+
}
|
|
730
|
+
async function W() {
|
|
731
|
+
if (!e.get(y)) return null;
|
|
732
|
+
try {
|
|
733
|
+
const r = await Re(e.get(y));
|
|
734
|
+
return r.success ? {
|
|
735
|
+
newExpiryTime: r.newExpiryTime,
|
|
736
|
+
remainingExtensions: r.remainingExtensions
|
|
737
|
+
} : (O.error("Failed to extend session:", r.error), null);
|
|
738
|
+
} catch (r) {
|
|
739
|
+
return O.error("Error extending checkout session:", r), null;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
var T = e.comment(), g = e.first_child(T);
|
|
743
|
+
{
|
|
744
|
+
var b = (r) => {
|
|
745
|
+
var n = ut(), a = e.first_child(n);
|
|
746
|
+
qe(a, {
|
|
747
|
+
get config() {
|
|
748
|
+
return e.get(C);
|
|
749
|
+
},
|
|
750
|
+
onPlaceOrder: S,
|
|
751
|
+
onBack: V,
|
|
752
|
+
onRetryExpired: Y,
|
|
753
|
+
onExtendSession: W,
|
|
754
|
+
get stripe() {
|
|
755
|
+
return e.get(K);
|
|
756
|
+
},
|
|
757
|
+
get paymentIntent() {
|
|
758
|
+
return e.get(j);
|
|
759
|
+
},
|
|
760
|
+
get paymentError() {
|
|
761
|
+
return e.get(_);
|
|
762
|
+
},
|
|
763
|
+
get labels() {
|
|
764
|
+
return d();
|
|
765
|
+
},
|
|
766
|
+
get elements() {
|
|
767
|
+
return e.get(q);
|
|
768
|
+
},
|
|
769
|
+
set elements(v) {
|
|
770
|
+
e.set(q, v, !0);
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
var i = e.sibling(a, 2);
|
|
774
|
+
{
|
|
775
|
+
var p = (v) => {
|
|
776
|
+
var k = ct(), Q = e.child(k);
|
|
777
|
+
dt(Q, {
|
|
778
|
+
get cartId() {
|
|
779
|
+
return e.get(y);
|
|
780
|
+
},
|
|
781
|
+
onApplied: D,
|
|
782
|
+
onRemoved: U,
|
|
783
|
+
get disabled() {
|
|
784
|
+
return e.get(F);
|
|
785
|
+
}
|
|
786
|
+
}), e.reset(k), e.append(v, k);
|
|
787
|
+
};
|
|
788
|
+
e.if(i, (v) => {
|
|
789
|
+
e.get(o) || v(p);
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
e.append(r, n);
|
|
793
|
+
}, P = (r) => {
|
|
794
|
+
var n = gt(), a = e.child(n), i = e.child(a, !0);
|
|
795
|
+
e.reset(a), e.reset(n), e.template_effect(() => e.set_text(i, e.get(M))), e.append(r, n);
|
|
796
|
+
}, N = (r) => {
|
|
797
|
+
var n = ft(), a = e.child(n), i = e.child(a, !0);
|
|
798
|
+
e.reset(a), e.reset(n), e.template_effect(() => e.set_text(i, d().loadingSecurePaymentForm || "Loading secure payment form...")), e.append(r, n);
|
|
799
|
+
};
|
|
800
|
+
e.if(g, (r) => {
|
|
801
|
+
e.get(C) ? r(b) : e.get(re) ? r(P, 1) : r(N, -1);
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
e.append(h, T), e.pop();
|
|
805
|
+
}
|
|
806
|
+
export {
|
|
807
|
+
ht as default
|
|
808
|
+
};
|
|
809
|
+
//# sourceMappingURL=Checkout-DmnOMwhl.js.map
|