@getmicdrop/venue-calendar 4.3.1 → 4.3.2
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/api/api.cjs +1 -0
- package/dist/api/api.mjs +1442 -0
- package/dist/api/client.d.ts +157 -0
- package/dist/api/cta.d.ts +50 -0
- package/dist/api/events.d.ts +202 -0
- package/dist/api/gift-cards.d.ts +119 -0
- package/dist/api/index.d.ts +46 -0
- package/dist/api/orders.d.ts +193 -0
- package/dist/api/promo.d.ts +45 -0
- package/dist/api/result.d.ts +78 -0
- package/dist/api/route-manifest.d.ts +206 -0
- package/dist/api/transformers/address.d.ts +18 -0
- package/dist/api/transformers/cart.d.ts +34 -0
- package/dist/api/transformers/collection.d.ts +12 -0
- package/dist/api/transformers/event.d.ts +177 -0
- package/dist/api/transformers/faq.d.ts +40 -0
- package/dist/api/transformers/giftCard.d.ts +11 -0
- package/dist/api/transformers/index.d.ts +27 -0
- package/dist/api/transformers/order.d.ts +44 -0
- package/dist/api/transformers/performer.d.ts +8 -0
- package/dist/api/transformers/series.d.ts +12 -0
- package/dist/api/transformers/venue.d.ts +65 -0
- package/dist/api/types.d.ts +554 -0
- package/dist/api/venues.d.ts +33 -0
- package/dist/api/waitlist.d.ts +77 -0
- package/dist/seo/HostSeoController.d.ts +68 -0
- package/dist/seo/buildCollectionJsonLd.d.ts +8 -0
- package/dist/seo/buildEventJsonLd.d.ts +9 -0
- package/dist/seo/buildSeriesJsonLd.d.ts +6 -0
- package/dist/seo/helpers.d.ts +88 -0
- package/dist/seo/index.d.ts +10 -0
- package/dist/seo/seo.cjs +1 -0
- package/dist/seo/seo.mjs +592 -0
- package/dist/seo/types.d.ts +156 -0
- package/dist/venue-calendar.es.js +1 -1
- package/dist/venue-calendar.iife.js +2 -2
- package/dist/venue-calendar.umd.js +1 -1
- package/package.json +1 -1
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/de.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/es.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/fr.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/id.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/it.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/ja.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/ko.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/nl.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/pl.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/pt-br.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/tr.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/flow/zh.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/de.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/es.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/fr.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/id.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/it.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/ja.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/ko.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/nl.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/pl.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/pt-br.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/tr.js +0 -0
- /package/dist/locales/{4.3.1 → 4.3.2}/main/zh.js +0 -0
package/dist/api/api.mjs
ADDED
|
@@ -0,0 +1,1442 @@
|
|
|
1
|
+
import { createLogger as e } from "@getmicdrop/svelte-components/utils/logger";
|
|
2
|
+
import { ApiError as t, NotFoundError as n } from "@getmicdrop/svelte-components/errors";
|
|
3
|
+
import { asUSD as r, centsToDollars as i, createLogger as a, formatCurrency as o, formatFullName as s, getLocalStorage as c, getSessionStorage as l, resolveImageUrl as u, setLocalStorage as d, setSessionStorage as f, toCents as p } from "@getmicdrop/svelte-components";
|
|
4
|
+
import { browserNow as ee, compareInstants as m, formatLocal as h, toInstantOrNull as g } from "@getmicdrop/svelte-components/datetime";
|
|
5
|
+
import { isHiddenTicketPurchasable as te } from "@getmicdrop/svelte-components/transforms";
|
|
6
|
+
import "@getmicdrop/svelte-components/utils/timezones";
|
|
7
|
+
import "@getmicdrop/svelte-components/utils/formatters";
|
|
8
|
+
e("VC:config", { enabled: !0 });
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/lib/api/client.ts
|
|
11
|
+
var _ = e("VC"), v = /* @__PURE__ */ new Set();
|
|
12
|
+
function ne(e) {
|
|
13
|
+
if (e) for (let t of v) try {
|
|
14
|
+
t(e);
|
|
15
|
+
} catch {}
|
|
16
|
+
}
|
|
17
|
+
var re = "ABORTED";
|
|
18
|
+
function ie(e, t) {
|
|
19
|
+
let n = t || void 0;
|
|
20
|
+
return n ? {
|
|
21
|
+
...e,
|
|
22
|
+
"X-Widget-Key": n
|
|
23
|
+
} : e;
|
|
24
|
+
}
|
|
25
|
+
function ae(e, t) {
|
|
26
|
+
let n = `HTTP ${t}`;
|
|
27
|
+
if (!e || typeof e != "object") return { message: n };
|
|
28
|
+
let r = e, i = r.error && typeof r.error == "object" ? r.error : null, a = typeof r.code == "string" ? r.code : typeof i?.code == "string" ? i.code : void 0;
|
|
29
|
+
return {
|
|
30
|
+
message: typeof r.error == "string" ? r.error : typeof i?.message == "string" ? i.message : typeof r.message == "string" ? r.message : n,
|
|
31
|
+
code: a
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
var oe = class extends Error {
|
|
35
|
+
code;
|
|
36
|
+
statusCode;
|
|
37
|
+
constructor(e, t, n) {
|
|
38
|
+
super(e), this.name = "ApiRequestError", this.code = t, this.statusCode = n;
|
|
39
|
+
}
|
|
40
|
+
}, y = {
|
|
41
|
+
baseUrl: "https://get-micdrop.com",
|
|
42
|
+
timeout: 3e4,
|
|
43
|
+
retries: 2,
|
|
44
|
+
retryDelay: 500,
|
|
45
|
+
onError: (e) => _.error("API Error:", e)
|
|
46
|
+
};
|
|
47
|
+
function se(e) {
|
|
48
|
+
y = {
|
|
49
|
+
...y,
|
|
50
|
+
...e
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function ce() {
|
|
54
|
+
return { ...y };
|
|
55
|
+
}
|
|
56
|
+
function b() {
|
|
57
|
+
return `${y.baseUrl}/api/v2/public`;
|
|
58
|
+
}
|
|
59
|
+
function le() {
|
|
60
|
+
return `${y.baseUrl}/api/public`;
|
|
61
|
+
}
|
|
62
|
+
function x() {
|
|
63
|
+
return `${y.baseUrl}/api/orders/v2/public`;
|
|
64
|
+
}
|
|
65
|
+
async function ue() {
|
|
66
|
+
return "";
|
|
67
|
+
}
|
|
68
|
+
var de = (e) => new Promise((t) => setTimeout(t, e));
|
|
69
|
+
async function fe(e, t, n) {
|
|
70
|
+
let r = (t.method || "GET").toUpperCase(), i = r === "GET" || r === "HEAD" ? n.retries + 1 : 1, a;
|
|
71
|
+
for (let r = 1; r <= i; r++) {
|
|
72
|
+
let o = new AbortController(), s = setTimeout(() => o.abort(), n.timeout), c = t.signal, l;
|
|
73
|
+
c && (c.aborted ? o.abort() : (l = () => o.abort(), c.addEventListener("abort", l, { once: !0 })));
|
|
74
|
+
try {
|
|
75
|
+
let n = await fetch(e, {
|
|
76
|
+
...t,
|
|
77
|
+
signal: o.signal
|
|
78
|
+
});
|
|
79
|
+
if (n.status >= 500 && r < i) a = /* @__PURE__ */ Error(`HTTP ${n.status}`);
|
|
80
|
+
else return n;
|
|
81
|
+
} catch (e) {
|
|
82
|
+
if (a = e, c?.aborted) throw e;
|
|
83
|
+
} finally {
|
|
84
|
+
clearTimeout(s), c && l && c.removeEventListener("abort", l);
|
|
85
|
+
}
|
|
86
|
+
r < i && await de(n.retryDelay * 2 ** (r - 1));
|
|
87
|
+
}
|
|
88
|
+
throw a;
|
|
89
|
+
}
|
|
90
|
+
async function S(e, t) {
|
|
91
|
+
return w("GET", e, void 0, t);
|
|
92
|
+
}
|
|
93
|
+
async function C(e, t, n) {
|
|
94
|
+
return w("POST", e, t, n);
|
|
95
|
+
}
|
|
96
|
+
async function pe(e, t, n) {
|
|
97
|
+
return w("PUT", e, t, n);
|
|
98
|
+
}
|
|
99
|
+
async function me(e, t) {
|
|
100
|
+
return w("DELETE", e, void 0, t);
|
|
101
|
+
}
|
|
102
|
+
async function w(e, t, n, r) {
|
|
103
|
+
let i = t.startsWith("http") || t.startsWith("/api/") ? t : `${b()}${t}`, { widgetKey: a, suppressOnError: o, headers: s, ...c } = r ?? {}, l = (e) => {
|
|
104
|
+
o || y.onError(e);
|
|
105
|
+
};
|
|
106
|
+
try {
|
|
107
|
+
let t = await fe(i, {
|
|
108
|
+
method: e,
|
|
109
|
+
headers: ie({
|
|
110
|
+
"Content-Type": "application/json",
|
|
111
|
+
...s
|
|
112
|
+
}, a),
|
|
113
|
+
body: n === void 0 ? void 0 : JSON.stringify(n),
|
|
114
|
+
...c
|
|
115
|
+
}, y);
|
|
116
|
+
if (!t.ok) {
|
|
117
|
+
let { message: e, code: n } = ae(await t.json().catch(() => ({})), t.status);
|
|
118
|
+
return l(new oe(e, n, t.status)), ne(n), {
|
|
119
|
+
success: !1,
|
|
120
|
+
error: e,
|
|
121
|
+
errorCode: n,
|
|
122
|
+
statusCode: t.status
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
success: !0,
|
|
127
|
+
data: await t.json(),
|
|
128
|
+
statusCode: t.status
|
|
129
|
+
};
|
|
130
|
+
} catch (e) {
|
|
131
|
+
if (r?.signal?.aborted) return {
|
|
132
|
+
success: !1,
|
|
133
|
+
error: "Request aborted",
|
|
134
|
+
errorCode: re,
|
|
135
|
+
aborted: !0
|
|
136
|
+
};
|
|
137
|
+
let t = e instanceof Error ? e.name === "AbortError" ? "Request timed out" : e.message : "Unknown error";
|
|
138
|
+
return l(e instanceof Error ? e : Error(t)), {
|
|
139
|
+
success: !1,
|
|
140
|
+
error: t
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
async function T(e, t) {
|
|
145
|
+
try {
|
|
146
|
+
let n = e.startsWith(y.baseUrl), { widgetKey: r, ...i } = t ?? {}, a = await fe(e, {
|
|
147
|
+
...i,
|
|
148
|
+
...n ? { headers: ie(i.headers, r) } : {}
|
|
149
|
+
}, y);
|
|
150
|
+
if (!a.ok) {
|
|
151
|
+
let e = await a.json().catch(() => ({}));
|
|
152
|
+
return _.error(`API request failed: ${a.status}`, e), null;
|
|
153
|
+
}
|
|
154
|
+
return a.json();
|
|
155
|
+
} catch (e) {
|
|
156
|
+
return _.error("API request error:", e), null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/lib/api/transformers/cart.ts
|
|
161
|
+
function he(e) {
|
|
162
|
+
let t = e ?? {};
|
|
163
|
+
return {
|
|
164
|
+
ticketID: Number(t.TicketID ?? t.ticketID ?? 0),
|
|
165
|
+
quantity: Number(t.Quantity ?? t.quantity ?? 0),
|
|
166
|
+
priceAtReservation: Number(t.PriceAtReservation ?? t.priceAtReservation ?? 0),
|
|
167
|
+
status: String(t.Status ?? t.status ?? "")
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function ge(e) {
|
|
171
|
+
let t = e ?? {}, n = t.Amount ?? t.amount, r = Number(n);
|
|
172
|
+
return {
|
|
173
|
+
giftCardId: Number(t.GiftCardID ?? t.giftCardId ?? 0),
|
|
174
|
+
maskedCode: String(t.MaskedCode ?? t.maskedCode ?? ""),
|
|
175
|
+
amount: n == null || !Number.isFinite(r) ? null : i(p(r))
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function _e(e) {
|
|
179
|
+
let t = e ?? {};
|
|
180
|
+
return {
|
|
181
|
+
uuid: t.UUID ?? t.uuid ?? "",
|
|
182
|
+
eventID: Number(t.EventID ?? t.eventID ?? 0),
|
|
183
|
+
status: t.Status ?? t.status ?? "",
|
|
184
|
+
expiresAt: t.ExpiresAt ?? t.expiresAt ?? "",
|
|
185
|
+
reservations: (t.Reservations ?? t.reservations ?? []).map(he),
|
|
186
|
+
giftCards: (t.GiftCards ?? t.giftCards ?? []).map(ge)
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/lib/tracking/normalize.ts
|
|
191
|
+
var ve = [
|
|
192
|
+
"utmSource",
|
|
193
|
+
"utmMedium",
|
|
194
|
+
"utmCampaign",
|
|
195
|
+
"utmContent",
|
|
196
|
+
"utmTerm"
|
|
197
|
+
], ye = {
|
|
198
|
+
utmSource: "utm_source",
|
|
199
|
+
utmMedium: "utm_medium",
|
|
200
|
+
utmCampaign: "utm_campaign",
|
|
201
|
+
utmContent: "utm_content",
|
|
202
|
+
utmTerm: "utm_term"
|
|
203
|
+
}, be = "direct";
|
|
204
|
+
function xe(e) {
|
|
205
|
+
return e ? e.trim().toLowerCase().replace(/\s+/g, "_") : "";
|
|
206
|
+
}
|
|
207
|
+
function Se(e) {
|
|
208
|
+
let t = {};
|
|
209
|
+
for (let n of ve) t[n] = xe(e[n]);
|
|
210
|
+
return t.utmSource ||= be, t;
|
|
211
|
+
}
|
|
212
|
+
function Ce(e) {
|
|
213
|
+
let t = {};
|
|
214
|
+
for (let n of ve) t[n] = e.get(ye[n]);
|
|
215
|
+
return Se(t);
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/lib/tracking/context.ts
|
|
219
|
+
var E = {
|
|
220
|
+
search: null,
|
|
221
|
+
referrer: null,
|
|
222
|
+
pageUrl: null
|
|
223
|
+
};
|
|
224
|
+
function we() {
|
|
225
|
+
if (typeof window > "u") return !0;
|
|
226
|
+
try {
|
|
227
|
+
return window.self === window.top;
|
|
228
|
+
} catch {
|
|
229
|
+
return !1;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function Te() {
|
|
233
|
+
let e = typeof window < "u", t = we(), n = E.search ?? (e ? window.location.search : ""), r = E.referrer ?? (typeof document < "u" ? document.referrer : "") ?? "", i = E.pageUrl ?? (e && t ? window.location.href : "");
|
|
234
|
+
return {
|
|
235
|
+
utm: Ce(new URLSearchParams(n)),
|
|
236
|
+
referrer: r || "",
|
|
237
|
+
pageUrl: i || ""
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/lib/tracking/consent.ts
|
|
242
|
+
var D = null, Ee = !1;
|
|
243
|
+
function De() {
|
|
244
|
+
return typeof window < "u" && typeof window.__tcfapi == "function";
|
|
245
|
+
}
|
|
246
|
+
function Oe() {
|
|
247
|
+
return typeof navigator < "u" && navigator.globalPrivacyControl === !0;
|
|
248
|
+
}
|
|
249
|
+
function ke() {
|
|
250
|
+
return D === null ? De() || Oe() : D;
|
|
251
|
+
}
|
|
252
|
+
function Ae() {
|
|
253
|
+
return !ke() || Ee;
|
|
254
|
+
}
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/lib/tracking/identity.ts
|
|
257
|
+
var O = "micdrop_session_id", k = "micdrop_visitor_id", je = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
258
|
+
function A(e) {
|
|
259
|
+
return typeof e == "string" && je.test(e);
|
|
260
|
+
}
|
|
261
|
+
function Me() {
|
|
262
|
+
let e = typeof crypto < "u" ? crypto : void 0;
|
|
263
|
+
if (e?.randomUUID) return e.randomUUID();
|
|
264
|
+
let t = /* @__PURE__ */ new Uint8Array(16);
|
|
265
|
+
if (e?.getRandomValues) e.getRandomValues(t);
|
|
266
|
+
else for (let e = 0; e < 16; e++) t[e] = Math.floor(Math.random() * 256);
|
|
267
|
+
t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128;
|
|
268
|
+
let n = [];
|
|
269
|
+
for (let e = 0; e < 16; e++) n.push(t[e].toString(16).padStart(2, "0"));
|
|
270
|
+
return `${n[0]}${n[1]}${n[2]}${n[3]}-${n[4]}${n[5]}-${n[6]}${n[7]}-${n[8]}${n[9]}-${n[10]}${n[11]}${n[12]}${n[13]}${n[14]}${n[15]}`;
|
|
271
|
+
}
|
|
272
|
+
function Ne() {
|
|
273
|
+
let e = l(O);
|
|
274
|
+
return e || (e = Me(), f(O, e)), e;
|
|
275
|
+
}
|
|
276
|
+
function Pe(e) {
|
|
277
|
+
let t = c(k);
|
|
278
|
+
if (A(t)) return {
|
|
279
|
+
id: t,
|
|
280
|
+
createdAt: e,
|
|
281
|
+
migrated: !0
|
|
282
|
+
};
|
|
283
|
+
if (t && typeof t == "object") {
|
|
284
|
+
let { id: n, createdAt: r } = t;
|
|
285
|
+
if (!A(n)) return null;
|
|
286
|
+
let i = typeof r == "number" && Number.isFinite(r), a = i ? Math.min(r, e) : e;
|
|
287
|
+
return {
|
|
288
|
+
id: n,
|
|
289
|
+
createdAt: a,
|
|
290
|
+
migrated: !i || a !== r
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
function Fe() {
|
|
296
|
+
if (!Ae()) return null;
|
|
297
|
+
let e = Date.now(), t = Pe(e);
|
|
298
|
+
if (t && e - t.createdAt < 34128e6) {
|
|
299
|
+
if (t.migrated) {
|
|
300
|
+
let e = {
|
|
301
|
+
id: t.id,
|
|
302
|
+
createdAt: t.createdAt
|
|
303
|
+
};
|
|
304
|
+
d(k, e);
|
|
305
|
+
}
|
|
306
|
+
return t.id;
|
|
307
|
+
}
|
|
308
|
+
let n = Me();
|
|
309
|
+
return d(k, {
|
|
310
|
+
id: n,
|
|
311
|
+
createdAt: e
|
|
312
|
+
}), n;
|
|
313
|
+
}
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/lib/tracking/attribution-store.ts
|
|
316
|
+
var Ie = "micdrop_attribution";
|
|
317
|
+
function Le() {
|
|
318
|
+
let e = l(Ie);
|
|
319
|
+
return !e || !e.utm || typeof e.utm.utmSource != "string" ? null : e;
|
|
320
|
+
}
|
|
321
|
+
function j() {
|
|
322
|
+
let e = Le() ?? Te();
|
|
323
|
+
return {
|
|
324
|
+
sessionId: Ne(),
|
|
325
|
+
visitorId: Fe(),
|
|
326
|
+
utmSource: e.utm.utmSource,
|
|
327
|
+
utmMedium: e.utm.utmMedium,
|
|
328
|
+
utmCampaign: e.utm.utmCampaign,
|
|
329
|
+
utmContent: e.utm.utmContent,
|
|
330
|
+
utmTerm: e.utm.utmTerm,
|
|
331
|
+
referrer: e.referrer || ""
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
a("tracking"), $state(0);
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/lib/i18n/createI18n.js
|
|
337
|
+
function Re() {
|
|
338
|
+
return typeof navigator > "u" ? null : navigator.language || navigator.userLanguage || null;
|
|
339
|
+
}
|
|
340
|
+
//#endregion
|
|
341
|
+
//#region src/lib/i18n/localeSpec.js
|
|
342
|
+
var ze = [
|
|
343
|
+
[
|
|
344
|
+
"es",
|
|
345
|
+
"es",
|
|
346
|
+
"es"
|
|
347
|
+
],
|
|
348
|
+
[
|
|
349
|
+
"fr",
|
|
350
|
+
"fr",
|
|
351
|
+
"fr"
|
|
352
|
+
],
|
|
353
|
+
[
|
|
354
|
+
"pt-br",
|
|
355
|
+
"pt-br",
|
|
356
|
+
"pt_br"
|
|
357
|
+
],
|
|
358
|
+
[
|
|
359
|
+
"pt",
|
|
360
|
+
"pt-br",
|
|
361
|
+
"pt_br"
|
|
362
|
+
],
|
|
363
|
+
[
|
|
364
|
+
"de",
|
|
365
|
+
"de",
|
|
366
|
+
"de"
|
|
367
|
+
],
|
|
368
|
+
[
|
|
369
|
+
"ja",
|
|
370
|
+
"ja",
|
|
371
|
+
"ja"
|
|
372
|
+
],
|
|
373
|
+
[
|
|
374
|
+
"zh",
|
|
375
|
+
"zh",
|
|
376
|
+
"zh"
|
|
377
|
+
],
|
|
378
|
+
[
|
|
379
|
+
"ko",
|
|
380
|
+
"ko",
|
|
381
|
+
"ko"
|
|
382
|
+
],
|
|
383
|
+
[
|
|
384
|
+
"it",
|
|
385
|
+
"it",
|
|
386
|
+
"it"
|
|
387
|
+
],
|
|
388
|
+
[
|
|
389
|
+
"nl",
|
|
390
|
+
"nl",
|
|
391
|
+
"nl"
|
|
392
|
+
],
|
|
393
|
+
[
|
|
394
|
+
"tr",
|
|
395
|
+
"tr",
|
|
396
|
+
"tr"
|
|
397
|
+
],
|
|
398
|
+
[
|
|
399
|
+
"id",
|
|
400
|
+
"id",
|
|
401
|
+
"id"
|
|
402
|
+
],
|
|
403
|
+
[
|
|
404
|
+
"pl",
|
|
405
|
+
"pl",
|
|
406
|
+
"pl"
|
|
407
|
+
]
|
|
408
|
+
];
|
|
409
|
+
Array.from(new Set(ze.map(([, e]) => e)));
|
|
410
|
+
//#endregion
|
|
411
|
+
//#region src/lib/i18n/buyerLocale.ts
|
|
412
|
+
var Be = new Map([["en", "en"], ...ze.map(([e]) => [e, e === "pt" || e === "pt-br" ? "pt-BR" : e])]);
|
|
413
|
+
function M(e) {
|
|
414
|
+
let t = e || Re();
|
|
415
|
+
if (!t || typeof t != "string") return;
|
|
416
|
+
let n = t.toLowerCase();
|
|
417
|
+
return Be.get(n) ?? Be.get(n.split("-")[0]);
|
|
418
|
+
}
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region src/lib/api/orders.ts
|
|
421
|
+
var N = e("VC");
|
|
422
|
+
async function Ve(e, n, r, i, a) {
|
|
423
|
+
let o = M(a);
|
|
424
|
+
try {
|
|
425
|
+
let a = await C(`${x()}/cart/${e}/payment-intent`, {
|
|
426
|
+
productQuantities: n,
|
|
427
|
+
...r && Object.keys(r).length > 0 ? { donationAmounts: r } : {},
|
|
428
|
+
...i ? {
|
|
429
|
+
firstName: i.firstName,
|
|
430
|
+
lastName: i.lastName,
|
|
431
|
+
email: i.email,
|
|
432
|
+
phone: i.phone ?? "",
|
|
433
|
+
questionAnswer: i.questionAnswer ?? "",
|
|
434
|
+
mailingList: i.mailingList ?? !1
|
|
435
|
+
} : {},
|
|
436
|
+
attribution: j(),
|
|
437
|
+
...o ? { locale: o } : {}
|
|
438
|
+
});
|
|
439
|
+
if (!a.success) throw N.error("Payment intent creation failed:", a.error), new t(a.error || "Failed to create payment intent", a.statusCode ?? 0, {
|
|
440
|
+
endpoint: `${x()}/cart/${e}/payment-intent`,
|
|
441
|
+
method: "POST"
|
|
442
|
+
});
|
|
443
|
+
return N.debug("Payment intent created:", a.data), a.data;
|
|
444
|
+
} catch (e) {
|
|
445
|
+
return N.error("createPaymentIntent error:", e), null;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
async function He(e, t) {
|
|
449
|
+
if (!e) return null;
|
|
450
|
+
try {
|
|
451
|
+
let n = await S(`${x()}/cart/${e}`);
|
|
452
|
+
if (!n.success) return null;
|
|
453
|
+
let { uuid: r, eventID: i, status: a, expiresAt: o, reservations: s, giftCards: c } = _e(n.data);
|
|
454
|
+
return a !== "reserved" && a !== "active" || t !== void 0 && i !== Number(t) ? null : {
|
|
455
|
+
uuid: r,
|
|
456
|
+
eventID: i,
|
|
457
|
+
status: a,
|
|
458
|
+
expiresAt: o,
|
|
459
|
+
reservations: s,
|
|
460
|
+
giftCards: c
|
|
461
|
+
};
|
|
462
|
+
} catch (e) {
|
|
463
|
+
return N.error("getCartByUUID error:", e), null;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
async function Ue(e, t, n) {
|
|
467
|
+
try {
|
|
468
|
+
let r = {};
|
|
469
|
+
for (let [e, n] of Object.entries(t)) {
|
|
470
|
+
let t = typeof e == "number" ? e : parseInt(e, 10);
|
|
471
|
+
!Number.isNaN(t) && n > 0 && (r[t] = n);
|
|
472
|
+
}
|
|
473
|
+
let i = {};
|
|
474
|
+
if (n) for (let [e, t] of Object.entries(n)) {
|
|
475
|
+
let n = typeof e == "number" ? e : parseInt(e, 10);
|
|
476
|
+
!Number.isNaN(n) && t > 0 && (i[n] = t);
|
|
477
|
+
}
|
|
478
|
+
let a = await fetch(`${x()}/cart/${e}`, {
|
|
479
|
+
method: "PUT",
|
|
480
|
+
headers: { "Content-Type": "application/json" },
|
|
481
|
+
body: JSON.stringify({
|
|
482
|
+
quantities: r,
|
|
483
|
+
...Object.keys(i).length > 0 ? { donationAmounts: i } : {}
|
|
484
|
+
})
|
|
485
|
+
});
|
|
486
|
+
if (!a.ok) {
|
|
487
|
+
let e = await a.json().catch(() => ({}));
|
|
488
|
+
return N.error("Cart update failed:", e), !1;
|
|
489
|
+
}
|
|
490
|
+
return !0;
|
|
491
|
+
} catch (e) {
|
|
492
|
+
return N.error("updateCartQuantities error:", e), !1;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
async function We(e) {
|
|
496
|
+
try {
|
|
497
|
+
let t = await C(`${b()}/orders/complete/${e}`);
|
|
498
|
+
return t.success ? {
|
|
499
|
+
success: !0,
|
|
500
|
+
message: t.data?.message
|
|
501
|
+
} : {
|
|
502
|
+
success: !1,
|
|
503
|
+
error: t.error || "Failed to complete reservation"
|
|
504
|
+
};
|
|
505
|
+
} catch (e) {
|
|
506
|
+
return N.error("Error completing reservation:", e), {
|
|
507
|
+
success: !1,
|
|
508
|
+
error: "Network error completing reservation"
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
async function Ge(e) {
|
|
513
|
+
try {
|
|
514
|
+
let t = await C(`${b()}/orders/cancel/${e}`);
|
|
515
|
+
return t.success ? {
|
|
516
|
+
success: !0,
|
|
517
|
+
message: t.data?.message
|
|
518
|
+
} : {
|
|
519
|
+
success: !1,
|
|
520
|
+
error: t.error || "Failed to cancel reservation"
|
|
521
|
+
};
|
|
522
|
+
} catch (e) {
|
|
523
|
+
return N.error("Error cancelling reservation:", e), {
|
|
524
|
+
success: !1,
|
|
525
|
+
error: "Network error cancelling reservation"
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
async function Ke(e, t) {
|
|
530
|
+
try {
|
|
531
|
+
let n = await C(`${b()}/orders/create`, {
|
|
532
|
+
eventID: e,
|
|
533
|
+
promoCode: t,
|
|
534
|
+
attribution: j()
|
|
535
|
+
});
|
|
536
|
+
return n.success ? n.data : (N.error("Create order failed:", n.error), null);
|
|
537
|
+
} catch (e) {
|
|
538
|
+
return N.error("createOrder error:", e), null;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
async function qe(e) {
|
|
542
|
+
return T(`${b()}/orders/${e}`);
|
|
543
|
+
}
|
|
544
|
+
async function Je(e, t, n) {
|
|
545
|
+
let r = M(n);
|
|
546
|
+
try {
|
|
547
|
+
let n = await C(`${x()}/validatePaymentIntent/${e}`, {
|
|
548
|
+
...t,
|
|
549
|
+
attribution: j(),
|
|
550
|
+
...r ? { locale: r } : {}
|
|
551
|
+
});
|
|
552
|
+
if (!n.success) return N.error("Payment validation failed:", n.error), {
|
|
553
|
+
success: !1,
|
|
554
|
+
status: "failed",
|
|
555
|
+
error: n.error || "Payment validation failed"
|
|
556
|
+
};
|
|
557
|
+
let i = n.data;
|
|
558
|
+
return i.eventCanceled || i.eventPostponed ? {
|
|
559
|
+
success: !1,
|
|
560
|
+
status: "failed",
|
|
561
|
+
eventCanceled: i.eventCanceled,
|
|
562
|
+
eventPostponed: i.eventPostponed
|
|
563
|
+
} : {
|
|
564
|
+
success: !0,
|
|
565
|
+
status: i.status || "Payment succeeded",
|
|
566
|
+
orderUUID: i.orderUUID || i.uuid
|
|
567
|
+
};
|
|
568
|
+
} catch (e) {
|
|
569
|
+
return N.error("validatePaymentIntent error:", e), null;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
async function Ye(e) {
|
|
573
|
+
try {
|
|
574
|
+
let t = await C(`${b()}/orders/extend-session`, { orderUuid: e });
|
|
575
|
+
if (!t.success) return {
|
|
576
|
+
success: !1,
|
|
577
|
+
error: t.error || "Failed to extend session",
|
|
578
|
+
statusCode: t.statusCode
|
|
579
|
+
};
|
|
580
|
+
let n = t.data;
|
|
581
|
+
return {
|
|
582
|
+
success: !0,
|
|
583
|
+
newExpiryTime: n.newExpiryTime,
|
|
584
|
+
remainingExtensions: n.remainingExtensions
|
|
585
|
+
};
|
|
586
|
+
} catch (e) {
|
|
587
|
+
return N.error("Error extending checkout session:", e), {
|
|
588
|
+
success: !1,
|
|
589
|
+
error: "Network error extending session"
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
async function Xe(e) {
|
|
594
|
+
try {
|
|
595
|
+
let t = await S(`${b()}/orders/session/${e}`);
|
|
596
|
+
if (!t.success) return {
|
|
597
|
+
error: t.error || "No active session found",
|
|
598
|
+
notFound: t.statusCode === 404
|
|
599
|
+
};
|
|
600
|
+
let n = t.data;
|
|
601
|
+
return {
|
|
602
|
+
expiresAt: n.expiresAt,
|
|
603
|
+
extensionCount: n.extensionCount,
|
|
604
|
+
remainingExtensions: n.remainingExtensions,
|
|
605
|
+
canExtend: n.canExtend,
|
|
606
|
+
reservationCount: n.reservationCount,
|
|
607
|
+
eventStatus: n.eventStatus
|
|
608
|
+
};
|
|
609
|
+
} catch (e) {
|
|
610
|
+
return N.error("Error getting session status:", e), { error: "Network error getting session status" };
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
async function Ze(e = { eventID: "" }) {
|
|
614
|
+
try {
|
|
615
|
+
let t = await C(`${b()}/orders/create`, {
|
|
616
|
+
...e,
|
|
617
|
+
attribution: j()
|
|
618
|
+
});
|
|
619
|
+
return t.success ? t.data?.uuid ?? null : (N.error("Order initiation failed:", t.error), null);
|
|
620
|
+
} catch (e) {
|
|
621
|
+
return N.error("initiateOrder error:", e), null;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
async function Qe(e) {
|
|
625
|
+
if (typeof window > "u") return;
|
|
626
|
+
let t = xe(new URLSearchParams(window.location.search).get("utm_source")) || "direct";
|
|
627
|
+
try {
|
|
628
|
+
await fetch(`${b()}/utm/${e}/${encodeURIComponent(t)}`);
|
|
629
|
+
} catch (e) {
|
|
630
|
+
N.error("UTM tracking failed:", e);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
//#endregion
|
|
634
|
+
//#region src/lib/api/promo.ts
|
|
635
|
+
var P = e("VC");
|
|
636
|
+
async function $e(e, t) {
|
|
637
|
+
try {
|
|
638
|
+
if (!t || !t.trim()) return {
|
|
639
|
+
valid: !1,
|
|
640
|
+
error: "Promo code is required"
|
|
641
|
+
};
|
|
642
|
+
let n = await S(`/promo-codes/validate/${e}/${encodeURIComponent(t.trim())}`);
|
|
643
|
+
if (!n.success) return n.statusCode === 404 ? {
|
|
644
|
+
valid: !1,
|
|
645
|
+
error: "Invalid promo code"
|
|
646
|
+
} : {
|
|
647
|
+
valid: !1,
|
|
648
|
+
error: "Failed to validate code"
|
|
649
|
+
};
|
|
650
|
+
let r = n.data;
|
|
651
|
+
return {
|
|
652
|
+
valid: r.valid ?? !0,
|
|
653
|
+
revealHiddenTickets: r.revealHiddenTickets,
|
|
654
|
+
revealTicketIds: r.revealTicketIds,
|
|
655
|
+
provideDiscount: r.provideDiscount,
|
|
656
|
+
discountType: r.discountType,
|
|
657
|
+
amount: r.discount ?? r.amount,
|
|
658
|
+
code: r.name || r.code || t,
|
|
659
|
+
appliesToAllTickets: r.appliesToAllTickets,
|
|
660
|
+
applyToTicketIds: r.applyToTicketIds
|
|
661
|
+
};
|
|
662
|
+
} catch (e) {
|
|
663
|
+
return P.error("Error validating promo code:", e), {
|
|
664
|
+
valid: !1,
|
|
665
|
+
error: "Network error validating code"
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
async function et(e) {
|
|
670
|
+
try {
|
|
671
|
+
let t = await S(`/promo-codes/check/${e}`);
|
|
672
|
+
return !t.success || t.data.hasPromoCodes === !0;
|
|
673
|
+
} catch (e) {
|
|
674
|
+
return P.error("Error checking promo codes availability:", e), !0;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
async function tt(e, t, n) {
|
|
678
|
+
try {
|
|
679
|
+
let r = { promoCode: t };
|
|
680
|
+
n && Object.keys(n).length > 0 && (r.productQuantities = n);
|
|
681
|
+
let i = await C(`${x()}/cart/${e}/apply-promo`, r);
|
|
682
|
+
return i.success ? { success: !0 } : {
|
|
683
|
+
success: !1,
|
|
684
|
+
error: i.error || "Failed to apply promo code"
|
|
685
|
+
};
|
|
686
|
+
} catch (e) {
|
|
687
|
+
return P.error("Error applying promo code:", e), {
|
|
688
|
+
success: !1,
|
|
689
|
+
error: "Network error applying code"
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
async function nt(e) {
|
|
694
|
+
try {
|
|
695
|
+
let t = await C(`/orders/${e}/remove-promo`);
|
|
696
|
+
return t.success ? { success: !0 } : {
|
|
697
|
+
success: !1,
|
|
698
|
+
error: t.error || "Failed to remove promo code"
|
|
699
|
+
};
|
|
700
|
+
} catch (e) {
|
|
701
|
+
return P.error("Error removing promo code:", e), {
|
|
702
|
+
success: !1,
|
|
703
|
+
error: "Network error removing code"
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
//#endregion
|
|
708
|
+
//#region src/lib/api/transformers/performer.ts
|
|
709
|
+
function rt(e) {
|
|
710
|
+
let t = e ?? {};
|
|
711
|
+
return {
|
|
712
|
+
performers: Array.isArray(t.performers) ? t.performers : [],
|
|
713
|
+
showPerformers: t.showPerformers === !0
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region src/lib/api/result.ts
|
|
718
|
+
function F(e) {
|
|
719
|
+
return {
|
|
720
|
+
ok: !0,
|
|
721
|
+
data: e
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
function I(e) {
|
|
725
|
+
return {
|
|
726
|
+
ok: !1,
|
|
727
|
+
error: e
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
function L(e) {
|
|
731
|
+
return {
|
|
732
|
+
ok: !1,
|
|
733
|
+
error: e,
|
|
734
|
+
notFound: !0
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
function it(e) {
|
|
738
|
+
return e.ok;
|
|
739
|
+
}
|
|
740
|
+
function at(e) {
|
|
741
|
+
return !e.ok;
|
|
742
|
+
}
|
|
743
|
+
function R(e, t) {
|
|
744
|
+
return e.ok ? e.data : t;
|
|
745
|
+
}
|
|
746
|
+
//#endregion
|
|
747
|
+
//#region src/lib/api/route-manifest.ts
|
|
748
|
+
var z = "/api/v2/public", B = "/api/orders/v2/public", ot = "/api/orders/v2", st = "00000000-0000-0000-0000-000000000000", V = st;
|
|
749
|
+
`${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}`, `${z}`, `${z}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}${V}`, `${z}`, `${z}`, `${z}`, `${z}`, `${z}`, `${z}${V}`, `${B}`, `${B}`, `${B}`, `${B}${V}`, `${B}`, `${B}${V}`, `${B}`, `${B}${V}`, `${B}`, `${B}${V}`, `${B}`, `${B}${V}`, `${B}`, `${B}${V}`, `${B}`, `${B}${V}`, `${B}`, `${B}${V}`, `${ot}`, `${ot}`, `${B}`, `${B}`, `${B}`, `${B}`, `${z}`, `${z}${V}`, `${z}`, `${z}`;
|
|
750
|
+
//#endregion
|
|
751
|
+
//#region src/lib/api/events.ts
|
|
752
|
+
var H = e("VC"), U = /* @__PURE__ */ new Map();
|
|
753
|
+
async function ct(e, t = fetch, n) {
|
|
754
|
+
let r = n ? `${e}:pw` : String(e);
|
|
755
|
+
if (t === fetch) {
|
|
756
|
+
let e = U.get(r);
|
|
757
|
+
if (e) return e;
|
|
758
|
+
}
|
|
759
|
+
let i = (async () => {
|
|
760
|
+
try {
|
|
761
|
+
let r = await t(n ? `${b()}/events/${e}?password=${encodeURIComponent(n)}` : `${b()}/events/${e}`);
|
|
762
|
+
if (!r.ok) return r.status === 404 ? L("event_not_found") : (H.error(`Failed to fetch event details: ${r.status}`), I("event_fetch_failed"));
|
|
763
|
+
let i = await r.json();
|
|
764
|
+
return i ? F(i) : L("event_not_found");
|
|
765
|
+
} catch (e) {
|
|
766
|
+
return H.error("Error fetching event details:", e), I("event_fetch_failed");
|
|
767
|
+
}
|
|
768
|
+
})();
|
|
769
|
+
return t === fetch && (U.set(r, i), i.finally(() => {
|
|
770
|
+
U.get(r) === i && U.delete(r);
|
|
771
|
+
})), i;
|
|
772
|
+
}
|
|
773
|
+
async function lt(e, t = fetch, n) {
|
|
774
|
+
let r = await ct(e, t, n);
|
|
775
|
+
return r.ok ? r.data : null;
|
|
776
|
+
}
|
|
777
|
+
async function W(e, t, n = (e) => e) {
|
|
778
|
+
try {
|
|
779
|
+
let r = await T(e);
|
|
780
|
+
return r ? F(n(r)) : (H.error(`Failed to load (${t}): network or server error`), I(t));
|
|
781
|
+
} catch (e) {
|
|
782
|
+
return H.error(`Error loading (${t}):`, e), I(t);
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
function G(e) {
|
|
786
|
+
return Array.isArray(e) ? e : [];
|
|
787
|
+
}
|
|
788
|
+
async function ut(e, t) {
|
|
789
|
+
let n = t?.trim(), r = n ? `?promoCode=${encodeURIComponent(n)}` : "";
|
|
790
|
+
return W(`${b()}/tickets/event/${e}${r}`, "tickets_fetch_failed", G);
|
|
791
|
+
}
|
|
792
|
+
async function dt(e, t) {
|
|
793
|
+
return R(await ut(e, t), []);
|
|
794
|
+
}
|
|
795
|
+
async function ft(e) {
|
|
796
|
+
return e ? W(`${b()}/events/${e}/performers`, "performers_fetch_failed", (e) => rt(e)) : (H.warn("fetchEventPerformers called without eventId"), I("performers_missing_event_id"));
|
|
797
|
+
}
|
|
798
|
+
async function pt(e) {
|
|
799
|
+
return R(await ft(e), {
|
|
800
|
+
performers: [],
|
|
801
|
+
showPerformers: !1
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
async function mt(e) {
|
|
805
|
+
return e ? W(`${b()}/venues/organization/${e}`, "venues_fetch_failed", G) : (H.warn("fetchAllVenues called without orgId"), I("venues_missing_org_id"));
|
|
806
|
+
}
|
|
807
|
+
async function ht(e) {
|
|
808
|
+
return R(await mt(e), []);
|
|
809
|
+
}
|
|
810
|
+
async function gt(e) {
|
|
811
|
+
return e ? W(`${b()}/events/venue/${e}`, "venue_events_fetch_failed", G) : (H.warn("fetchVenueEvents called without venueId"), I("venue_events_missing_venue_id"));
|
|
812
|
+
}
|
|
813
|
+
async function _t(e) {
|
|
814
|
+
return R(await gt(e), []);
|
|
815
|
+
}
|
|
816
|
+
function vt(e) {
|
|
817
|
+
return Array.isArray(e) ? e : Array.isArray(e.events) ? e.events : [];
|
|
818
|
+
}
|
|
819
|
+
var K = /* @__PURE__ */ new Map();
|
|
820
|
+
function yt(e, t, n) {
|
|
821
|
+
if (!n?.fresh) {
|
|
822
|
+
let t = K.get(e);
|
|
823
|
+
if (t) return t;
|
|
824
|
+
}
|
|
825
|
+
let r = W(e, t, (e) => vt(e));
|
|
826
|
+
return K.set(e, r), r.finally(() => {
|
|
827
|
+
K.get(e) === r && K.delete(e);
|
|
828
|
+
}), r;
|
|
829
|
+
}
|
|
830
|
+
async function bt(e, t, n, r) {
|
|
831
|
+
return yt(`${b()}/events/venue/${e}/month/${t}/${n}`, "month_events_fetch_failed", r);
|
|
832
|
+
}
|
|
833
|
+
async function xt(e, t, n) {
|
|
834
|
+
return R(await bt(e, t, n), []);
|
|
835
|
+
}
|
|
836
|
+
async function St(e, t, n, r) {
|
|
837
|
+
return yt(`${b()}/events/organization/${e}/month/${t}/${n}`, "org_month_events_fetch_failed", r);
|
|
838
|
+
}
|
|
839
|
+
async function Ct(e, t, n) {
|
|
840
|
+
return R(await St(e, t, n), []);
|
|
841
|
+
}
|
|
842
|
+
async function wt(e) {
|
|
843
|
+
return W(`${b()}/series/${e}/occurrences`, "series_occurrences_fetch_failed");
|
|
844
|
+
}
|
|
845
|
+
async function Tt(e) {
|
|
846
|
+
let t = await wt(e);
|
|
847
|
+
return t.ok ? t.data : null;
|
|
848
|
+
}
|
|
849
|
+
async function Et(e, t) {
|
|
850
|
+
return W(`${b()}/series/${e}/occurrences?venueId=${t}`, "series_cta_fetch_failed");
|
|
851
|
+
}
|
|
852
|
+
async function Dt(e, t) {
|
|
853
|
+
let n = await Et(e, t);
|
|
854
|
+
return n.ok ? n.data : null;
|
|
855
|
+
}
|
|
856
|
+
async function Ot(e, t) {
|
|
857
|
+
try {
|
|
858
|
+
let r = t ? `?slug=${encodeURIComponent(t)}` : "", i = await T(`${b()}/resolve/${encodeURIComponent(String(e))}${r}`);
|
|
859
|
+
if (!i || !i.type) throw new n("entity", String(e));
|
|
860
|
+
return i;
|
|
861
|
+
} catch (e) {
|
|
862
|
+
return H.error("Error resolving public entity:", e), null;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
async function kt(e, t) {
|
|
866
|
+
try {
|
|
867
|
+
let r = await T(t ? `${b()}/collections/${e}?password=${encodeURIComponent(t)}` : `${b()}/collections/${e}`);
|
|
868
|
+
if (!r) throw new n("collection", String(e));
|
|
869
|
+
return r;
|
|
870
|
+
} catch (e) {
|
|
871
|
+
return H.error("Error fetching collection:", e), null;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
async function At(e, t) {
|
|
875
|
+
try {
|
|
876
|
+
return (await T(`${b()}/collections/${e}/check-password`, {
|
|
877
|
+
method: "POST",
|
|
878
|
+
headers: { "Content-Type": "application/json" },
|
|
879
|
+
body: JSON.stringify({ password: t })
|
|
880
|
+
}))?.valid === !0;
|
|
881
|
+
} catch (e) {
|
|
882
|
+
return H.error("Error checking collection password:", e), !1;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
async function jt(e, t) {
|
|
886
|
+
try {
|
|
887
|
+
let n = await T(`${b()}/events/${e}/check-password`, {
|
|
888
|
+
method: "POST",
|
|
889
|
+
headers: { "Content-Type": "application/json" },
|
|
890
|
+
body: JSON.stringify({ password: t })
|
|
891
|
+
});
|
|
892
|
+
return typeof n == "boolean" ? { valid: n } : { valid: n?.valid === !0 };
|
|
893
|
+
} catch (e) {
|
|
894
|
+
return H.error("Error checking event password:", e), { valid: !1 };
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
async function Mt(e, t) {
|
|
898
|
+
try {
|
|
899
|
+
let n = t ? `${b()}/events/venue/${t}` : e ? `${b()}/venues/organization/${e}` : `${b()}/venues/${st}`;
|
|
900
|
+
return (await fetch(n, { method: "HEAD" })).status < 500;
|
|
901
|
+
} catch (e) {
|
|
902
|
+
return H.error("Network connection test failed:", e), !1;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
//#endregion
|
|
906
|
+
//#region src/lib/api/venues.ts
|
|
907
|
+
var q = e("VC");
|
|
908
|
+
async function Nt(e) {
|
|
909
|
+
try {
|
|
910
|
+
if (!e) return q.warn("getVenue called without venueId"), null;
|
|
911
|
+
let t = await S(`/venues/${e}`);
|
|
912
|
+
return t.success ? t.data ?? null : (q.error(`Failed to fetch venue: ${t.statusCode}`), null);
|
|
913
|
+
} catch (e) {
|
|
914
|
+
return q.error("Error fetching venue:", e), null;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
async function Pt(e) {
|
|
918
|
+
let t = await Nt(e);
|
|
919
|
+
return t ? {
|
|
920
|
+
serviceFeePercentage: t.serviceFeePercentage ?? 0,
|
|
921
|
+
serviceFeeCents: t.serviceFeeCents == null ? 0 : t.serviceFeeCents,
|
|
922
|
+
taxPercentage: t.taxPercentage ?? 0
|
|
923
|
+
} : null;
|
|
924
|
+
}
|
|
925
|
+
async function Ft(e) {
|
|
926
|
+
try {
|
|
927
|
+
if (!e) return q.warn("getVenueBySlug called without slug"), null;
|
|
928
|
+
let t = await S(`/venues/slug/${encodeURIComponent(e)}`);
|
|
929
|
+
return t.success ? t.data ?? null : (q.error(`Failed to fetch venue by slug: ${t.statusCode}`), null);
|
|
930
|
+
} catch (e) {
|
|
931
|
+
return q.error("Error fetching venue by slug:", e), null;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region src/lib/api/transformers/giftCard.ts
|
|
936
|
+
function J(e, t) {
|
|
937
|
+
return e == null || t(e);
|
|
938
|
+
}
|
|
939
|
+
function It(e) {
|
|
940
|
+
if (typeof e != "object" || !e) return !1;
|
|
941
|
+
let t = e;
|
|
942
|
+
return t.valid === !0 && Number.isInteger(t.appliedAmount) && typeof t.remainingTotal == "number" && Number.isFinite(t.remainingTotal) && J(t.giftCardCode, (e) => typeof e == "string") && J(t.giftCardBalance, (e) => typeof e == "number" && Number.isFinite(e)) && J(t.fullyCoveredByCard, (e) => typeof e == "boolean");
|
|
943
|
+
}
|
|
944
|
+
var Lt = "We couldn't apply that gift card. Please try again.";
|
|
945
|
+
function Rt(e) {
|
|
946
|
+
if (!It(e)) return {
|
|
947
|
+
valid: !1,
|
|
948
|
+
error: Lt
|
|
949
|
+
};
|
|
950
|
+
let t = e, n = i(p(t.appliedAmount)), r = t.remainingTotal, a = t.fullyCoveredByCard ?? r <= 0, o = !a;
|
|
951
|
+
return {
|
|
952
|
+
valid: !0,
|
|
953
|
+
giftCardCode: t.giftCardCode ?? void 0,
|
|
954
|
+
giftCardAmount: n,
|
|
955
|
+
giftCardBalance: t.giftCardBalance ?? void 0,
|
|
956
|
+
paymentType: a ? "gift_card_only" : "split",
|
|
957
|
+
stripeAmount: r,
|
|
958
|
+
orderTotal: n + r,
|
|
959
|
+
requiresStripe: o
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
//#endregion
|
|
963
|
+
//#region src/lib/api/gift-cards.ts
|
|
964
|
+
var Y = e("VC");
|
|
965
|
+
async function zt(e) {
|
|
966
|
+
try {
|
|
967
|
+
let n = await C(`${x()}/gift-cards/purchase/create`, e);
|
|
968
|
+
if (!n.success) throw Y.error("Gift card purchase creation failed:", n.error), new t(n.error || "Failed to create gift card purchase", n.statusCode ?? 0, {
|
|
969
|
+
endpoint: `${x()}/gift-cards/purchase/create`,
|
|
970
|
+
method: "POST"
|
|
971
|
+
});
|
|
972
|
+
return Y.debug("Gift card purchase created:", n.data), n.data;
|
|
973
|
+
} catch (e) {
|
|
974
|
+
return Y.error("Gift card purchase creation error:", e), null;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
async function Bt(e, t) {
|
|
978
|
+
try {
|
|
979
|
+
let n = await C(`${x()}/cart/${e}/apply-gift-card`, { giftCardCode: t });
|
|
980
|
+
if (!n.success) return n.statusCode === 429 ? {
|
|
981
|
+
valid: !1,
|
|
982
|
+
error: "Too many attempts. Please wait a moment and try again."
|
|
983
|
+
} : (Y.error("Apply gift card failed:", n.error), {
|
|
984
|
+
valid: !1,
|
|
985
|
+
error: n.error || "Invalid gift card code"
|
|
986
|
+
});
|
|
987
|
+
let r = Rt(n.data);
|
|
988
|
+
return r.valid || Y.error("Apply gift card returned an unusable payload:", n.data), r;
|
|
989
|
+
} catch (e) {
|
|
990
|
+
return Y.error("applyGiftCard error:", e), {
|
|
991
|
+
valid: !1,
|
|
992
|
+
error: "Network error. Please check your connection and try again."
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
async function Vt(e, t) {
|
|
997
|
+
try {
|
|
998
|
+
let n = t?.giftCardId ? { giftCardId: t.giftCardId } : t?.code ? { giftCardCode: t.code } : null, r = await me(`${x()}/cart/${e}/gift-card`, n ? { body: JSON.stringify(n) } : void 0);
|
|
999
|
+
if (!r.success) return Y.error("Remove gift card failed:", r.error), {
|
|
1000
|
+
success: !1,
|
|
1001
|
+
error: r.error || "Failed to remove gift card"
|
|
1002
|
+
};
|
|
1003
|
+
let i = r.data ?? {}, a = i.newTotal ?? i.NewTotal;
|
|
1004
|
+
return {
|
|
1005
|
+
success: !0,
|
|
1006
|
+
...typeof a == "number" ? { remainingTotal: a } : {}
|
|
1007
|
+
};
|
|
1008
|
+
} catch (e) {
|
|
1009
|
+
return Y.error("removeGiftCard error:", e), {
|
|
1010
|
+
success: !1,
|
|
1011
|
+
error: "Network error. Please check your connection and try again."
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
async function Ht(e, t, n) {
|
|
1016
|
+
let r = M(n);
|
|
1017
|
+
try {
|
|
1018
|
+
let n = await C(`${x()}/cart/${e}/complete-gift-card-payment`, {
|
|
1019
|
+
customerName: s(t.firstName, t.lastName),
|
|
1020
|
+
customerEmail: t.email,
|
|
1021
|
+
firstName: t.firstName,
|
|
1022
|
+
lastName: t.lastName,
|
|
1023
|
+
email: t.email,
|
|
1024
|
+
phoneNumber: t.phoneNumber || null,
|
|
1025
|
+
questionAnswer: t.questionAnswer || "",
|
|
1026
|
+
mailingList: t.mailingList || !1,
|
|
1027
|
+
attribution: j(),
|
|
1028
|
+
...r ? { locale: r } : {}
|
|
1029
|
+
});
|
|
1030
|
+
return n.success ? {
|
|
1031
|
+
success: !0,
|
|
1032
|
+
orderId: n.data?.orderId,
|
|
1033
|
+
confirmationNumber: n.data?.confirmationNumber
|
|
1034
|
+
} : (Y.error("Complete gift card payment failed:", n.error), {
|
|
1035
|
+
success: !1,
|
|
1036
|
+
error: n.error || "Failed to complete payment"
|
|
1037
|
+
});
|
|
1038
|
+
} catch (e) {
|
|
1039
|
+
return Y.error("completeGiftCardPayment error:", e), {
|
|
1040
|
+
success: !1,
|
|
1041
|
+
error: "Network error. Please check your connection and try again."
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
//#endregion
|
|
1046
|
+
//#region src/lib/api/waitlist.ts
|
|
1047
|
+
var X = e("VC");
|
|
1048
|
+
async function Ut(e, t, n = null, r = !1) {
|
|
1049
|
+
try {
|
|
1050
|
+
let i = { email: t };
|
|
1051
|
+
n && r && (i.phone = n, i.smsOptIn = !0);
|
|
1052
|
+
let a = await C(`/events/${e}/waitlist`, i);
|
|
1053
|
+
return a.success ? {
|
|
1054
|
+
success: !0,
|
|
1055
|
+
updated: a.data?.updated,
|
|
1056
|
+
position: a.data?.position
|
|
1057
|
+
} : (X.error("Join waitlist failed:", a.error), {
|
|
1058
|
+
success: !1,
|
|
1059
|
+
errorCode: a.error || "join_failed"
|
|
1060
|
+
});
|
|
1061
|
+
} catch (e) {
|
|
1062
|
+
return X.error("joinWaitlist error:", e), {
|
|
1063
|
+
success: !1,
|
|
1064
|
+
errorCode: "network_error"
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
async function Wt(e, t) {
|
|
1069
|
+
try {
|
|
1070
|
+
let n = await C(`/checkout/validate-token/${e}`, { email: t });
|
|
1071
|
+
return n.success ? {
|
|
1072
|
+
valid: !0,
|
|
1073
|
+
eventId: n.data?.eventId ?? 0,
|
|
1074
|
+
expiresAt: n.data?.expiresAt
|
|
1075
|
+
} : {
|
|
1076
|
+
valid: !1,
|
|
1077
|
+
eventId: 0,
|
|
1078
|
+
errorCode: n.error
|
|
1079
|
+
};
|
|
1080
|
+
} catch (e) {
|
|
1081
|
+
return X.error("validateWaitlistToken error:", e), {
|
|
1082
|
+
valid: !1,
|
|
1083
|
+
eventId: 0,
|
|
1084
|
+
errorCode: "invalid_token"
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
async function Gt(e, t) {
|
|
1089
|
+
try {
|
|
1090
|
+
let n = await C(`/waitlist/requeue/${e}`, { email: t });
|
|
1091
|
+
return n.success ? { success: !0 } : {
|
|
1092
|
+
success: !1,
|
|
1093
|
+
errorCode: n.error
|
|
1094
|
+
};
|
|
1095
|
+
} catch (e) {
|
|
1096
|
+
return X.error("requeueWaitlistToFront error:", e), {
|
|
1097
|
+
success: !1,
|
|
1098
|
+
errorCode: "internal_error"
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
async function Kt(e) {
|
|
1103
|
+
let t = {
|
|
1104
|
+
waitlistEnabled: !1,
|
|
1105
|
+
soldOut: !1,
|
|
1106
|
+
gated: !1
|
|
1107
|
+
};
|
|
1108
|
+
try {
|
|
1109
|
+
let n = await S(`/events/${e}/waitlist/status`);
|
|
1110
|
+
return n.success ? {
|
|
1111
|
+
waitlistEnabled: !!n.data?.waitlistEnabled,
|
|
1112
|
+
soldOut: !!n.data?.soldOut,
|
|
1113
|
+
gated: !!n.data?.gated
|
|
1114
|
+
} : t;
|
|
1115
|
+
} catch (e) {
|
|
1116
|
+
return X.error("getWaitlistStatus error:", e), t;
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
//#endregion
|
|
1120
|
+
//#region src/lib/api/cta.ts
|
|
1121
|
+
function qt(e, t, n = {}) {
|
|
1122
|
+
let { cancelled: r = !1, isRegistration: i = !1, waitlistEnabled: a = !1 } = n, o = ee();
|
|
1123
|
+
if (r) return {
|
|
1124
|
+
text: "Cancelled",
|
|
1125
|
+
disabled: !0,
|
|
1126
|
+
reason: "cancelled"
|
|
1127
|
+
};
|
|
1128
|
+
if ((e?.status || "").trim().toLowerCase() === "postponed") return {
|
|
1129
|
+
text: "Postponed",
|
|
1130
|
+
disabled: !0,
|
|
1131
|
+
reason: "postponed"
|
|
1132
|
+
};
|
|
1133
|
+
let s = g(e.endDateTime || e.startDateTime);
|
|
1134
|
+
if (s && m(s, o) < 0) return {
|
|
1135
|
+
text: "Sales ended",
|
|
1136
|
+
disabled: !0,
|
|
1137
|
+
reason: "event_past"
|
|
1138
|
+
};
|
|
1139
|
+
let c = (e?.salesStatus || "").trim().toLowerCase();
|
|
1140
|
+
if (c === "paused") return {
|
|
1141
|
+
text: "Sales paused",
|
|
1142
|
+
disabled: !0,
|
|
1143
|
+
reason: "sales_paused"
|
|
1144
|
+
};
|
|
1145
|
+
if (c === "ended") return {
|
|
1146
|
+
text: "Sales ended",
|
|
1147
|
+
disabled: !0,
|
|
1148
|
+
reason: "sales_ended"
|
|
1149
|
+
};
|
|
1150
|
+
let l = e?.hasPurchasableHiddenTickets === !0 || Array.isArray(t) && t.some(te), u = () => l ? {
|
|
1151
|
+
text: i ? "Reserve a spot" : "Get tickets",
|
|
1152
|
+
disabled: !1,
|
|
1153
|
+
reason: "hidden_only"
|
|
1154
|
+
} : a ? {
|
|
1155
|
+
text: "Join Waitlist",
|
|
1156
|
+
disabled: !1,
|
|
1157
|
+
reason: "sold_out_waitlist"
|
|
1158
|
+
} : {
|
|
1159
|
+
text: "Sold out",
|
|
1160
|
+
disabled: !0,
|
|
1161
|
+
reason: "sold_out"
|
|
1162
|
+
};
|
|
1163
|
+
if (c === "sold_out") return u();
|
|
1164
|
+
let d = (t || []).filter((e) => e.salesChannel !== 2 && !e.isHidden && !(typeof e.visibility == "number" && e.visibility >= 2));
|
|
1165
|
+
if (d.length === 0) return l ? {
|
|
1166
|
+
text: i ? "Reserve a spot" : "Get tickets",
|
|
1167
|
+
disabled: !1,
|
|
1168
|
+
reason: "hidden_only"
|
|
1169
|
+
} : {
|
|
1170
|
+
text: "No tickets available",
|
|
1171
|
+
disabled: !0,
|
|
1172
|
+
reason: "no_tickets"
|
|
1173
|
+
};
|
|
1174
|
+
let f = !1, p = !0, _ = !0, v = null;
|
|
1175
|
+
for (let e of d) {
|
|
1176
|
+
let t = g(e.salesBegin || e.salesStart || e.saleBegin || e.onSaleStart), n = g(e.salesEnd || e.saleEnd || e.onSaleEnd), r = e.remainingCapacity ?? e.quantityRemaining ?? e.quantity, i = e.soldOut || r != null && r <= 0, a = t ? m(t, o) > 0 : !1, s = n ? m(n, o) < 0 : !1;
|
|
1177
|
+
!i && !a && !s && (f = !0), i || (p = !1), a || (_ = !1), a && t && !i && !s && (!v || m(t, v) < 0) && (v = t);
|
|
1178
|
+
}
|
|
1179
|
+
if (f) return {
|
|
1180
|
+
text: i ? "Reserve a spot" : "Get tickets",
|
|
1181
|
+
disabled: !1,
|
|
1182
|
+
reason: "available"
|
|
1183
|
+
};
|
|
1184
|
+
if (_ && v) {
|
|
1185
|
+
if (l) return {
|
|
1186
|
+
text: i ? "Reserve a spot" : "Get tickets",
|
|
1187
|
+
disabled: !1,
|
|
1188
|
+
reason: "hidden_only"
|
|
1189
|
+
};
|
|
1190
|
+
let e = m(v, o), t = e / 36e5, n = e / 864e5, r = (e) => h(e, {
|
|
1191
|
+
hour: "numeric",
|
|
1192
|
+
minute: "2-digit",
|
|
1193
|
+
hour12: !0
|
|
1194
|
+
}, "en-US"), a;
|
|
1195
|
+
return a = t < 24 ? r(v) : n <= 7 ? h(v, {
|
|
1196
|
+
weekday: "short",
|
|
1197
|
+
hour: "numeric",
|
|
1198
|
+
minute: "2-digit",
|
|
1199
|
+
hour12: !0
|
|
1200
|
+
}, "en-US") : `${h(v, {
|
|
1201
|
+
month: "short",
|
|
1202
|
+
day: "numeric"
|
|
1203
|
+
}, "en-US")} ${r(v)}`, {
|
|
1204
|
+
text: `On sale ${a}`,
|
|
1205
|
+
disabled: !0,
|
|
1206
|
+
reason: "coming_soon"
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
return p ? u() : l ? {
|
|
1210
|
+
text: i ? "Reserve a spot" : "Get tickets",
|
|
1211
|
+
disabled: !1,
|
|
1212
|
+
reason: "hidden_only"
|
|
1213
|
+
} : {
|
|
1214
|
+
text: "Sales ended",
|
|
1215
|
+
disabled: !0,
|
|
1216
|
+
reason: "sales_ended"
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1219
|
+
//#endregion
|
|
1220
|
+
//#region src/lib/api/transformers/order.ts
|
|
1221
|
+
function Jt(e) {
|
|
1222
|
+
let t = e;
|
|
1223
|
+
return {
|
|
1224
|
+
uuid: t.uuid || String(t.id || t.ID || ""),
|
|
1225
|
+
id: t.id || t.ID,
|
|
1226
|
+
ticketNumber: t.ticketNumber || t.ticket_number,
|
|
1227
|
+
orderId: t.orderId || t.order_id,
|
|
1228
|
+
attendeeFirstName: t.attendeeFirstName || t.attendee_first_name || t.firstName,
|
|
1229
|
+
attendeeLastName: t.attendeeLastName || t.attendee_last_name || t.lastName,
|
|
1230
|
+
attendeeEmail: t.attendeeEmail || t.attendee_email || t.email,
|
|
1231
|
+
ticketName: t.ticketName || t.ticket_name || t.name || "",
|
|
1232
|
+
ticketTypeId: t.ticketTypeId || t.ticket_type_id,
|
|
1233
|
+
purchasePrice: t.purchasePrice || t.purchase_price || t.price || 0,
|
|
1234
|
+
status: t.status,
|
|
1235
|
+
checkedIn: t.checkedIn || t.checked_in,
|
|
1236
|
+
checkedInAt: t.checkedInAt || t.checked_in_at
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1239
|
+
function Yt(e) {
|
|
1240
|
+
let t = e, n = t.purchasedTickets || t.tickets || t.purchased_tickets || [];
|
|
1241
|
+
return {
|
|
1242
|
+
uuid: t.uuid || String(t.id || t.ID || ""),
|
|
1243
|
+
id: t.id || t.ID,
|
|
1244
|
+
customerEmail: t.customerEmail || t.email || t.customer_email || "",
|
|
1245
|
+
customerFirstName: t.customerFirstName || t.firstName || t.first_name,
|
|
1246
|
+
customerLastName: t.customerLastName || t.lastName || t.last_name,
|
|
1247
|
+
status: t.status || "unknown",
|
|
1248
|
+
totalAmount: t.totalAmount || t.total || t.total_amount || 0,
|
|
1249
|
+
subtotal: t.subtotal,
|
|
1250
|
+
serviceFeesAmount: t.serviceFeesAmount || t.serviceFee || t.service_fee || t.service_fees_amount || 0,
|
|
1251
|
+
taxAmount: t.taxAmount || t.tax || t.tax_amount || 0,
|
|
1252
|
+
discount: t.discount == null ? 0 : t.discount,
|
|
1253
|
+
paymentIntentId: t.paymentIntentId || t.payment_intent_id,
|
|
1254
|
+
paymentMethod: t.paymentMethod || t.payment_method,
|
|
1255
|
+
purchasedTickets: n.map(Jt),
|
|
1256
|
+
createdAt: t.createdAt || t.created_at,
|
|
1257
|
+
updatedAt: t.updatedAt || t.updated_at
|
|
1258
|
+
};
|
|
1259
|
+
}
|
|
1260
|
+
var Xt = Jt, Zt = Yt;
|
|
1261
|
+
function Qt(e) {
|
|
1262
|
+
let t = Yt(e), n = t.uuid.split("-")[0] || t.uuid, i = Number(t.totalAmount);
|
|
1263
|
+
return {
|
|
1264
|
+
orderId: t.uuid,
|
|
1265
|
+
displayOrderId: n,
|
|
1266
|
+
email: t.customerEmail,
|
|
1267
|
+
customerName: [t.customerFirstName, t.customerLastName].filter(Boolean).join(" "),
|
|
1268
|
+
total: t.totalAmount,
|
|
1269
|
+
formattedTotal: `${o(r(Number.isFinite(i) ? i / 100 : 0))}`,
|
|
1270
|
+
ticketCount: t.purchasedTickets.length,
|
|
1271
|
+
status: t.status
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
//#endregion
|
|
1275
|
+
//#region src/lib/api/transformers/event.ts
|
|
1276
|
+
function $t(e) {
|
|
1277
|
+
return u(e, { cdn: !0 });
|
|
1278
|
+
}
|
|
1279
|
+
function Z(e) {
|
|
1280
|
+
return $t(e.imageUrl || e.imageURL || e.image_url || e.image || "");
|
|
1281
|
+
}
|
|
1282
|
+
function en(e) {
|
|
1283
|
+
switch (e) {
|
|
1284
|
+
case "available":
|
|
1285
|
+
case "sold_out":
|
|
1286
|
+
case "coming_soon":
|
|
1287
|
+
case "ended": return e;
|
|
1288
|
+
default: return null;
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
function Q(e) {
|
|
1292
|
+
let t = e.ctaState || e.cta_state;
|
|
1293
|
+
if (t) {
|
|
1294
|
+
let e = en(t);
|
|
1295
|
+
if (e) return e;
|
|
1296
|
+
}
|
|
1297
|
+
if (e.isCancelled || e.is_cancelled) return "ended";
|
|
1298
|
+
let n = g(e.startDateTime || e.start_date_time || e.date);
|
|
1299
|
+
if (n) {
|
|
1300
|
+
let e = Date.now();
|
|
1301
|
+
if (n.getTime() < e) return "ended";
|
|
1302
|
+
}
|
|
1303
|
+
let r = e.ticketsAvailable ?? e.tickets_available;
|
|
1304
|
+
if (r !== void 0) return r <= 0 ? "sold_out" : "available";
|
|
1305
|
+
let i = e.availableTickets || e.available_tickets || e.tickets || [];
|
|
1306
|
+
return i.length === 0 ? "coming_soon" : i.reduce((e, t) => {
|
|
1307
|
+
let n = t.quantityAvailable ?? t.quantity_available ?? t.quantity ?? 0, r = t.quantitySold ?? t.quantity_sold ?? 0;
|
|
1308
|
+
return e + Math.max(0, n - r);
|
|
1309
|
+
}, 0) <= 0 ? "sold_out" : "available";
|
|
1310
|
+
}
|
|
1311
|
+
function tn(e) {
|
|
1312
|
+
let t = e;
|
|
1313
|
+
return {
|
|
1314
|
+
id: t.id || t.ID,
|
|
1315
|
+
name: t.name || t.ticketName || "",
|
|
1316
|
+
description: t.description,
|
|
1317
|
+
price: t.price == null ? 0 : t.price,
|
|
1318
|
+
quantity: t.quantity || t.totalQuantity || 0,
|
|
1319
|
+
quantitySold: t.quantitySold || t.quantity_sold || 0,
|
|
1320
|
+
quantityAvailable: t.quantityAvailable || t.quantity_available || (t.quantity || 0) - (t.quantitySold || 0),
|
|
1321
|
+
minPerOrder: t.minPerOrder || t.min_per_order || 1,
|
|
1322
|
+
maxPerOrder: t.maxPerOrder || t.max_per_order || 10,
|
|
1323
|
+
saleStartDate: t.saleStartDate || t.sale_start_date,
|
|
1324
|
+
saleEndDate: t.saleEndDate || t.sale_end_date,
|
|
1325
|
+
isHidden: t.isHidden || t.is_hidden || !1,
|
|
1326
|
+
revealWithPromoCode: t.revealWithPromoCode || t.reveal_with_promo_code,
|
|
1327
|
+
ticketType: t.ticketType || t.ticket_type || 0,
|
|
1328
|
+
sectionId: t.sectionId || t.section_id,
|
|
1329
|
+
sortOrder: t.sortOrder || t.sort_order || 0
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
function $(e) {
|
|
1333
|
+
let t = e, n = (t.availableTickets || t.available_tickets || t.tickets || []).map(tn), r = n.map((e) => e.price).filter((e) => e > 0), i = r.length > 0 ? Math.min(...r) : void 0, a = r.length > 0 ? Math.max(...r) : void 0;
|
|
1334
|
+
return {
|
|
1335
|
+
eventID: t.eventID || t.id || t.ID || 0,
|
|
1336
|
+
id: t.id || t.ID,
|
|
1337
|
+
name: t.name || t.title || "",
|
|
1338
|
+
title: t.title || t.name,
|
|
1339
|
+
slug: t.slug,
|
|
1340
|
+
description: t.description,
|
|
1341
|
+
date: t.date || t.startDateTime || t.start_date_time || "",
|
|
1342
|
+
startDateTime: t.startDateTime || t.start_date_time,
|
|
1343
|
+
endDateTime: t.endDateTime || t.end_date_time,
|
|
1344
|
+
doorsOpenTime: t.doorsOpenTime || t.doors_open_time,
|
|
1345
|
+
timezone: t.timezone || t.time_zone,
|
|
1346
|
+
venueId: t.venueId || t.venue_id,
|
|
1347
|
+
venueName: t.venueName || t.venue_name,
|
|
1348
|
+
venueAddress: t.venueAddress || t.venue_address,
|
|
1349
|
+
location: t.location || t.venueAddress || t.venue_address,
|
|
1350
|
+
imageUrl: Z(t),
|
|
1351
|
+
imageURL: Z(t),
|
|
1352
|
+
status: t.status,
|
|
1353
|
+
isPublished: t.isPublished ?? t.is_published,
|
|
1354
|
+
isCancelled: t.isCancelled ?? t.is_cancelled,
|
|
1355
|
+
availableTickets: n,
|
|
1356
|
+
ticketsAvailable: t.ticketsAvailable ?? t.tickets_available ?? n.reduce((e, t) => e + (t.quantityAvailable || 0), 0),
|
|
1357
|
+
ticketsSold: t.ticketsSold ?? t.tickets_sold,
|
|
1358
|
+
minPrice: t.minPrice ?? t.min_price ?? i,
|
|
1359
|
+
maxPrice: t.maxPrice ?? t.max_price ?? a,
|
|
1360
|
+
ctaText: t.ctaText || t.cta_text,
|
|
1361
|
+
ctaState: Q(t),
|
|
1362
|
+
showPerformers: t.showPerformers ?? t.show_performers,
|
|
1363
|
+
eventSeriesId: t.eventSeriesId || t.event_series_id,
|
|
1364
|
+
seriesInstanceNumber: t.seriesInstanceNumber || t.series_instance_number,
|
|
1365
|
+
timeZone: t.timeZone,
|
|
1366
|
+
salesStatus: t.salesStatus || t.sales_status,
|
|
1367
|
+
eventSummary: t.eventSummary,
|
|
1368
|
+
password: t.password,
|
|
1369
|
+
hasPassword: t.hasPassword,
|
|
1370
|
+
disclaimer: t.disclaimer,
|
|
1371
|
+
ticketType: t.ticketType,
|
|
1372
|
+
eventTicketingType: t.eventTicketingType,
|
|
1373
|
+
ageRestriction: t.ageRestriction,
|
|
1374
|
+
displayAgeRestriction: t.displayAgeRestriction,
|
|
1375
|
+
displayStartTime: t.displayStartTime,
|
|
1376
|
+
displayEndTime: t.displayEndTime,
|
|
1377
|
+
displayDoorsTime: t.displayDoorsTime,
|
|
1378
|
+
displayTicketsLeft: t.displayTicketsLeft,
|
|
1379
|
+
postSalesMessage: t.postSalesMessage,
|
|
1380
|
+
collectionId: t.collectionId || t.collection_id,
|
|
1381
|
+
ticketsRemaining: t.ticketsRemaining,
|
|
1382
|
+
ticketsTotal: t.ticketsTotal,
|
|
1383
|
+
hasHiddenTickets: t.hasHiddenTickets,
|
|
1384
|
+
stage: t.stage,
|
|
1385
|
+
stageName: t.stageName,
|
|
1386
|
+
stageId: t.stageId,
|
|
1387
|
+
eventCategoryTypes: t.eventCategoryTypes,
|
|
1388
|
+
publicPerformers: t.publicPerformers,
|
|
1389
|
+
collectionIds: t.collectionIds,
|
|
1390
|
+
venue: t.venue,
|
|
1391
|
+
performers: t.performers,
|
|
1392
|
+
faqs: t.faqs,
|
|
1393
|
+
showtimes: t.showtimes,
|
|
1394
|
+
purchasedTickets: t.purchasedTickets
|
|
1395
|
+
};
|
|
1396
|
+
}
|
|
1397
|
+
var nn = tn, rn = $, an = $;
|
|
1398
|
+
//#endregion
|
|
1399
|
+
//#region src/lib/api/transformers/venue.ts
|
|
1400
|
+
function on(e) {
|
|
1401
|
+
return u(e, { cdn: !0 });
|
|
1402
|
+
}
|
|
1403
|
+
function sn(e) {
|
|
1404
|
+
let t = e, n = t.logoUrl || t.logo_url || t.logo;
|
|
1405
|
+
return {
|
|
1406
|
+
id: t.id || t.ID || 0,
|
|
1407
|
+
name: t.name || "",
|
|
1408
|
+
slug: t.slug,
|
|
1409
|
+
address: t.address,
|
|
1410
|
+
googleLocationNameCache: t.googleLocationNameCache || t.google_location_name_cache,
|
|
1411
|
+
city: t.city,
|
|
1412
|
+
state: t.state,
|
|
1413
|
+
zipCode: t.zipCode || t.zip_code,
|
|
1414
|
+
country: t.country,
|
|
1415
|
+
timezone: t.timezone || t.time_zone,
|
|
1416
|
+
logoUrl: on(n),
|
|
1417
|
+
serviceFeePercentage: t.serviceFeePercentage ?? t.service_fee_percentage ?? 0,
|
|
1418
|
+
serviceFeeCents: t.serviceFeeCents ?? t.service_fee_cents ?? 0,
|
|
1419
|
+
absorbServiceFee: (t.absorbServiceFee ?? t.absorb_service_fee) === !0,
|
|
1420
|
+
taxPercentage: t.taxPercentage ?? t.tax_percentage ?? 0,
|
|
1421
|
+
organizationId: t.organizationId || t.organization_id
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
var cn = sn;
|
|
1425
|
+
function ln(e) {
|
|
1426
|
+
let t = e;
|
|
1427
|
+
return {
|
|
1428
|
+
serviceFeePercentage: t.serviceFeePercentage ?? t.service_fee_percentage ?? 0,
|
|
1429
|
+
serviceFeeCents: t.serviceFeeCents ?? t.service_fee_cents ?? 0,
|
|
1430
|
+
taxPercentage: t.taxPercentage ?? t.tax_percentage ?? 0
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1433
|
+
function un(e) {
|
|
1434
|
+
return [
|
|
1435
|
+
e.address,
|
|
1436
|
+
e.city,
|
|
1437
|
+
e.state,
|
|
1438
|
+
e.zipCode
|
|
1439
|
+
].filter(Boolean).join(", ");
|
|
1440
|
+
}
|
|
1441
|
+
//#endregion
|
|
1442
|
+
export { me as apiDelete, S as apiGet, C as apiPost, pe as apiPut, Bt as applyGiftCard, tt as applyPromoCode, Q as calculateCtaState, Ge as cancelReservation, At as checkCollectionPassword, jt as checkEventPassword, Ht as completeGiftCardPayment, We as completeReservation, qt as computeCtaState, se as configureApi, zt as createGiftCardPurchase, Ke as createOrder, Ve as createPaymentIntent, I as err, L as errNotFound, Ye as extendCheckoutSession, ln as extractVenueFees, ht as fetchAllVenues, mt as fetchAllVenuesResult, lt as fetchEventDetails, ct as fetchEventDetailsResult, pt as fetchEventPerformers, ft as fetchEventPerformersResult, dt as fetchEventTickets, ut as fetchEventTicketsResult, kt as fetchPublicCollection, Dt as fetchSeriesOccurrences, Et as fetchSeriesOccurrencesResult, _t as fetchVenueEvents, gt as fetchVenueEventsResult, un as formatVenueAddress, ce as getApiConfig, $t as getCDNImageUrl, He as getCartByUUID, ue as getClientIP, Z as getEventImageUrl, le as getLegacyPublicUrl, xt as getMonthEvents, bt as getMonthEventsResult, qe as getOrder, x as getOrdersV2Url, Ct as getOrgMonthEvents, St as getOrgMonthEventsResult, b as getPublicBaseUrl, Tt as getSeriesOccurrences, wt as getSeriesOccurrencesResult, Xe as getSessionStatus, Nt as getVenue, Ft as getVenueBySlug, Pt as getVenueFees, Kt as getWaitlistStatus, et as hasPromoCodes, Ze as initiateOrder, at as isErr, it as isOk, Ut as joinWaitlist, F as ok, Vt as removeGiftCard, nt as removePromoCode, Gt as requeueWaitlistToFront, Ot as resolvePublicEntity, Mt as testNetworkConnection, Qe as trackUTMSource, nn as transformAvailableTicket, rn as transformEvent, an as transformEventData, Zt as transformOrder, Qt as transformOrderForDisplay, Xt as transformTicket, cn as transformVenue, R as unwrapOr, Ue as updateCartQuantities, Je as validatePaymentIntent, $e as validatePromoCode, Wt as validateWaitlistToken };
|