@getmicdrop/venue-calendar 4.3.119 → 4.3.121
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 +818 -818
- package/dist/{AddOnCard-BGFpF6uw.js → AddOnCard-jj59e855.js} +5 -5
- package/dist/{ArrowLeftIcon-pPaJkbnp.js → ArrowLeftIcon-t-CY0sbi.js} +1 -1
- package/dist/{BlockPlaceholder-BgLtwJnm.js → BlockPlaceholder-BmEZ68_q.js} +1 -1
- package/dist/Calendar-hxcQBkTF.js +463 -0
- package/dist/{CalendarFoundryView-CZ36wO24.js → CalendarFoundryView-CSAKDe-F.js} +19 -19
- package/dist/{CalendarIcon-C_6MSRyE.js → CalendarIcon-B5JWs0gm.js} +1 -1
- package/dist/{CartView-9YSoRvTw.js → CartView-CF2y1JDa.js} +719 -716
- package/dist/{CheckIcon-sr8D0z-b.js → CheckIcon-BSwoGox7.js} +1 -1
- package/dist/{Checkout-BLkYIKoR.js → Checkout-2h2K3-bE.js} +378 -378
- package/dist/{Checkout-BS3r4Qii.js → Checkout-BFu5dTw_.js} +328 -328
- package/dist/{CheckoutTimer-DY1NKJXP.js → CheckoutTimer-Bpt5gPyA.js} +2 -2
- package/dist/{ChevronDownIcon-Co6rRQp-.js → ChevronDownIcon-CVZ0usBx.js} +1 -1
- package/dist/{CloseIcon-DpRE5O8y.js → CloseIcon-DUnvWXUY.js} +1 -1
- package/dist/CollectionView-XdNMvMtn.js +141 -0
- package/dist/{Event-DUq4tYBE.js → Event-B_9T21du.js} +684 -680
- package/dist/EventPage-BMnKpciU.js +1201 -0
- package/dist/{Input-CsHb9Z8e.js → Input-BXZmvQ0p.js} +1 -1
- package/dist/{LocationIcon-Dxk7snUC.js → LocationIcon-E-7CQh4E.js} +1 -1
- package/dist/{PasswordInput-BlL0w_yr.js → PasswordInput-DzXNIwRc.js} +1 -1
- package/dist/{RecommendationsRail-Dq9t0T02.js → RecommendationsRail-DrzM8h2r.js} +124 -124
- package/dist/{ScarcityBadge-Bj_YMxz4.js → ScarcityBadge-DjzrzvId.js} +4 -4
- package/dist/{SeriesPage-CaPTQRSo.js → SeriesPage-Ds_FEEZW.js} +2 -2
- package/dist/{Spinner-BgdjQygI.js → Spinner-B2rdbspc.js} +1 -1
- package/dist/{Success-tXgS0BXp.js → Success-Dkak0iM9.js} +201 -201
- package/dist/{TagIcon-Kq7_bapx.js → TagIcon-BY8tK_qA.js} +1 -1
- package/dist/ViewTicketsEmbed-B_fqalQh.js +660 -0
- package/dist/{WarningCircleIcon-BdbAYYi4.js → WarningCircleIcon-C5Lc7qkF.js} +1 -1
- package/dist/{WarningTriIcon-D8otatZe.js → WarningTriIcon-BM8qc9xx.js} +1 -1
- package/dist/api/api.cjs +1 -1
- package/dist/api/api.mjs +258 -252
- package/dist/api/cart-addons.d.ts +2 -1
- package/dist/api/checkout-availability.d.ts +2 -25
- package/dist/api/client.d.ts +4 -7
- package/dist/api/events.d.ts +23 -22
- package/dist/api/gift-cards.d.ts +7 -6
- package/dist/api/orders.d.ts +13 -12
- package/dist/api/promo.d.ts +5 -4
- package/dist/api/surge-queue.d.ts +5 -34
- package/dist/api/venues.d.ts +5 -4
- package/dist/api/waitlist.d.ts +5 -9
- package/dist/{api-DG7ztpYi.js → api-BEYkGabB.js} +174 -169
- package/dist/{copyToClipboard-DSangJpP.js → copyToClipboard-F-akSgaF.js} +1 -1
- package/dist/{createErrorGate.svelte-CEBpRAmr.js → createErrorGate.svelte-CEGaIQeI.js} +1 -1
- package/dist/{datetime-YTw6PkGP.js → datetime-BnKG6Hjm.js} +1 -1
- package/dist/{de-CbwqVvg6.js → de-BHcAXwnM.js} +0 -1
- package/dist/{defaultLabels-CsRGNP7f.js → defaultLabels-BbNEEsF7.js} +0 -1
- package/dist/{defaults-UDvnrGu0.js → defaults-CgsFJvJ2.js} +2 -2
- package/dist/{es-Dxqulvec.js → es-DZ3yceh-.js} +0 -1
- package/dist/{event-CW18bU9h.js → event-DfqUhl5j.js} +1 -1
- package/dist/{event-transform-CyRMeKW_.js → event-transform-Bk1IoYh5.js} +4 -4
- package/dist/{eventStatusStream-Cf7PaLka.js → eventStatusStream-CE0PwO0c.js} +9 -9
- package/dist/{fr-0aCE52FE.js → fr-Dyi163Vk.js} +0 -1
- package/dist/{href-yqxAPbkW.js → href-CfWGAmkP.js} +3 -3
- package/dist/i18n-B705OXZp.js +28 -0
- package/dist/{i18n-MF3q-UBI.js → i18n-BoMUWcCq.js} +4 -4
- package/dist/{id-7ClY2Dwb.js → id-DvFRZVAm.js} +0 -1
- package/dist/{it-z-heX6Hy.js → it-Bh05tcLv.js} +0 -1
- package/dist/{ja-ecBzr5l9.js → ja-CU4PQS4j.js} +0 -1
- package/dist/{ko-Blnq1Wc_.js → ko-DDk6EdWm.js} +0 -1
- package/dist/locales/4.3.121/main/de.js +1 -0
- package/dist/locales/4.3.121/main/es.js +1 -0
- package/dist/locales/4.3.121/main/fr.js +1 -0
- package/dist/locales/4.3.121/main/id.js +1 -0
- package/dist/locales/4.3.121/main/it.js +1 -0
- package/dist/locales/4.3.121/main/ja.js +1 -0
- package/dist/locales/4.3.121/main/ko.js +1 -0
- package/dist/locales/4.3.121/main/nl.js +1 -0
- package/dist/locales/4.3.121/main/pl.js +1 -0
- package/dist/locales/4.3.121/main/pt-br.js +1 -0
- package/dist/locales/4.3.121/main/tr.js +1 -0
- package/dist/locales/4.3.121/main/zh.js +1 -0
- package/dist/{nl-Bm2Lee3j.js → nl-DOSKYHSx.js} +0 -1
- package/dist/{pixels-BAPQbj_Y.js → pixels-Bu5-BISs.js} +8 -8
- package/dist/{pl-DIp-gYhF.js → pl-CkLEymA2.js} +0 -1
- package/dist/{pt-br-BmcVsgbQ.js → pt-br-BHuCQSM-.js} +0 -1
- package/dist/{serverTotals-D57U4Nju.js → serverTotals-B8SJCzxE.js} +1 -1
- package/dist/{showcase-state-options-zfQoPg37.js → showcase-state-options-KO_TYk3I.js} +1 -1
- package/dist/{to-event-card-props-Dn1eDOiJ.js → to-event-card-props-DYIfPN8e.js} +9 -13
- package/dist/{tr-BshxS2DN.js → tr-Bvc34ODh.js} +0 -1
- package/dist/{utils-CdNe7KGe.js → utils-NMx3aPDk.js} +82 -78
- package/dist/venue-calendar.css +1 -1
- package/dist/venue-calendar.es.js +1445 -1445
- package/dist/venue-calendar.iife.js +31 -31
- package/dist/venue-calendar.umd.js +52 -52
- package/dist/{orders-BWVwv3P0.js → widget-key-context-D2zj4sp5.js} +221 -213
- package/dist/{zh-B06ZsUNX.js → zh-K0hOzZ3G.js} +0 -1
- package/package.json +1 -1
- package/src/lib/theme.js +222 -222
- package/dist/Calendar-S2Es6EKK.js +0 -486
- package/dist/CollectionView-DyFDlCmo.js +0 -138
- package/dist/EventPage-m5SlifRu.js +0 -1200
- package/dist/ViewTicketsEmbed-BnuypZ1H.js +0 -660
- package/dist/i18n-B-AwhAMH.js +0 -28
- package/dist/locales/4.3.119/main/de.js +0 -1
- package/dist/locales/4.3.119/main/es.js +0 -1
- package/dist/locales/4.3.119/main/fr.js +0 -1
- package/dist/locales/4.3.119/main/id.js +0 -1
- package/dist/locales/4.3.119/main/it.js +0 -1
- package/dist/locales/4.3.119/main/ja.js +0 -1
- package/dist/locales/4.3.119/main/ko.js +0 -1
- package/dist/locales/4.3.119/main/nl.js +0 -1
- package/dist/locales/4.3.119/main/pl.js +0 -1
- package/dist/locales/4.3.119/main/pt-br.js +0 -1
- package/dist/locales/4.3.119/main/tr.js +0 -1
- package/dist/locales/4.3.119/main/zh.js +0 -1
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/de.js +0 -0
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/es.js +0 -0
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/fr.js +0 -0
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/id.js +0 -0
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/it.js +0 -0
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/ja.js +0 -0
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/ko.js +0 -0
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/nl.js +0 -0
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/pl.js +0 -0
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/pt-br.js +0 -0
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/tr.js +0 -0
- /package/dist/locales/{4.3.119 → 4.3.121}/flow/zh.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as e } from "./sizing-B7ixYndz.js";
|
|
2
|
-
import { $ as t,
|
|
3
|
-
import "./event-transform-
|
|
2
|
+
import { $ as t, I as n, L as r, P as i, V as a, at as o, rt as s, tt as c } from "./widget-key-context-D2zj4sp5.js";
|
|
3
|
+
import "./event-transform-Bk1IoYh5.js";
|
|
4
4
|
//#region node_modules/js-cookie/dist/js.cookie.mjs
|
|
5
5
|
function l(e) {
|
|
6
6
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -82,19 +82,19 @@ function E() {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
function D(e) {
|
|
85
|
-
let n = {}, r = {}, i = [],
|
|
85
|
+
let n = {}, r = {}, i = [], a = "", o = 0, l = {};
|
|
86
86
|
if (typeof window > "u") return {
|
|
87
87
|
quantities: n,
|
|
88
88
|
donationAmounts: r,
|
|
89
89
|
addOnQuantities: l,
|
|
90
|
-
promocode:
|
|
91
|
-
promoDiscountAmount:
|
|
90
|
+
promocode: a,
|
|
91
|
+
promoDiscountAmount: o,
|
|
92
92
|
tickets: i
|
|
93
93
|
};
|
|
94
|
-
let u =
|
|
94
|
+
let u = t(y(e), null);
|
|
95
95
|
if (!u) {
|
|
96
|
-
let n =
|
|
97
|
-
n && (u = n, s(y(e), n),
|
|
96
|
+
let n = t(b(e), null);
|
|
97
|
+
n && (u = n, s(y(e), n), c(b(e)));
|
|
98
98
|
}
|
|
99
99
|
if (u) return {
|
|
100
100
|
quantities: u.quantities || {},
|
|
@@ -114,19 +114,19 @@ function D(e) {
|
|
|
114
114
|
} catch (e) {
|
|
115
115
|
g.warn("Failed to parse checkout tickets cookie:", e), i = [];
|
|
116
116
|
}
|
|
117
|
-
return
|
|
117
|
+
return a = m(`checkout-promocode-${e}`) || "", o = parseFloat(m(`checkout-promo-discount-${e}`) || "0"), (Object.keys(n).length > 0 || i.length > 0 || a) && (A({
|
|
118
118
|
eventID: e,
|
|
119
119
|
quantities: n,
|
|
120
120
|
donationAmounts: r,
|
|
121
|
-
promocode:
|
|
122
|
-
promoDiscountAmount:
|
|
121
|
+
promocode: a,
|
|
122
|
+
promoDiscountAmount: o,
|
|
123
123
|
tickets: i
|
|
124
124
|
}), O(e)), {
|
|
125
125
|
quantities: n,
|
|
126
126
|
donationAmounts: r,
|
|
127
127
|
addOnQuantities: l,
|
|
128
|
-
promocode:
|
|
129
|
-
promoDiscountAmount:
|
|
128
|
+
promocode: a,
|
|
129
|
+
promoDiscountAmount: o,
|
|
130
130
|
tickets: i
|
|
131
131
|
};
|
|
132
132
|
}
|
|
@@ -134,7 +134,7 @@ function O(e) {
|
|
|
134
134
|
h(`checkout-quantities-${e}`), h(`checkout-tickets-${e}`), h(`checkout-promocode-${e}`), h(`checkout-promo-discount-${e}`);
|
|
135
135
|
}
|
|
136
136
|
function k(e) {
|
|
137
|
-
|
|
137
|
+
c(y(e)), c(b(e)), O(e), h(`checkout-promo-discount-type-${e}`), h(`checkout-promo-reveal-${e}`), h(`checkout-promo-reveal-ids-${e}`), h(`checkout-promo-ticket-ids-${e}`);
|
|
138
138
|
}
|
|
139
139
|
function A({ eventID: e, quantities: t, donationAmounts: n, addOnQuantities: r, promocode: i, promoDiscountAmount: a, tickets: o }) {
|
|
140
140
|
if (typeof window > "u") return;
|
|
@@ -158,18 +158,18 @@ function A({ eventID: e, quantities: t, donationAmounts: n, addOnQuantities: r,
|
|
|
158
158
|
}
|
|
159
159
|
function j(e) {
|
|
160
160
|
if (!e) return null;
|
|
161
|
-
let n =
|
|
161
|
+
let n = t(x(e), null);
|
|
162
162
|
if (n != null) return P(n);
|
|
163
|
-
let r =
|
|
163
|
+
let r = t(S(e), null);
|
|
164
164
|
if (r == null) return null;
|
|
165
165
|
let i = P(r);
|
|
166
|
-
return i != null && (s(x(e), i),
|
|
166
|
+
return i != null && (s(x(e), i), c(S(e))), i;
|
|
167
167
|
}
|
|
168
168
|
function M(e, t) {
|
|
169
169
|
!e || !Number.isFinite(t) || s(x(e), t);
|
|
170
170
|
}
|
|
171
171
|
function N(e) {
|
|
172
|
-
e && (
|
|
172
|
+
e && (c(x(e)), c(S(e)));
|
|
173
173
|
}
|
|
174
174
|
function P(e) {
|
|
175
175
|
let t = typeof e == "number" ? e : parseInt(e, 10);
|
|
@@ -187,13 +187,13 @@ async function te(e) {
|
|
|
187
187
|
}
|
|
188
188
|
var F = (e) => _(`queue-token-${e}`);
|
|
189
189
|
function I(e) {
|
|
190
|
-
return
|
|
190
|
+
return t(F(e), null);
|
|
191
191
|
}
|
|
192
192
|
function L(e, t) {
|
|
193
193
|
t && s(F(e), t);
|
|
194
194
|
}
|
|
195
195
|
function R(e) {
|
|
196
|
-
|
|
196
|
+
c(F(e));
|
|
197
197
|
}
|
|
198
198
|
//#endregion
|
|
199
199
|
//#region src/lib/api/surge-queue.ts
|
|
@@ -227,36 +227,36 @@ function J(e) {
|
|
|
227
227
|
expiresAt: typeof e?.expiresAt == "string" ? e.expiresAt : ""
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
|
-
async function Y(e) {
|
|
230
|
+
async function Y(e, t) {
|
|
231
231
|
try {
|
|
232
|
-
let
|
|
233
|
-
return
|
|
234
|
-
armed:
|
|
235
|
-
mode: G(
|
|
236
|
-
waiting: W(
|
|
237
|
-
etaSeconds: W(
|
|
232
|
+
let r = await n(`/events/${e}/queue`, { widgetKey: t?.widgetKey });
|
|
233
|
+
return r.success ? {
|
|
234
|
+
armed: r.data?.armed === !0,
|
|
235
|
+
mode: G(r.data?.mode),
|
|
236
|
+
waiting: W(r.data?.waiting),
|
|
237
|
+
etaSeconds: W(r.data?.etaSeconds)
|
|
238
238
|
} : V;
|
|
239
239
|
} catch (e) {
|
|
240
240
|
return z.error("getQueueState error:", e), V;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
async function X(e) {
|
|
243
|
+
async function X(e, t) {
|
|
244
244
|
try {
|
|
245
|
-
let
|
|
246
|
-
if (!
|
|
245
|
+
let n = await r(`/events/${e}/queue/join`, {}, { widgetKey: t?.widgetKey });
|
|
246
|
+
if (!n.success) return {
|
|
247
247
|
success: !1,
|
|
248
|
-
errorCode:
|
|
249
|
-
statusCode:
|
|
248
|
+
errorCode: n.errorCode || "queue_unavailable",
|
|
249
|
+
statusCode: n.statusCode
|
|
250
250
|
};
|
|
251
|
-
let
|
|
252
|
-
return
|
|
251
|
+
let i = J(n.data);
|
|
252
|
+
return i ? {
|
|
253
253
|
success: !0,
|
|
254
|
-
entry:
|
|
255
|
-
statusCode:
|
|
254
|
+
entry: i,
|
|
255
|
+
statusCode: n.statusCode
|
|
256
256
|
} : {
|
|
257
257
|
success: !1,
|
|
258
258
|
errorCode: B,
|
|
259
|
-
statusCode:
|
|
259
|
+
statusCode: n.statusCode
|
|
260
260
|
};
|
|
261
261
|
} catch (e) {
|
|
262
262
|
return z.error("joinQueue error:", e), {
|
|
@@ -265,27 +265,27 @@ async function X(e) {
|
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
async function Z(e, t) {
|
|
268
|
+
async function Z(e, t, r) {
|
|
269
269
|
if (!t) return {
|
|
270
270
|
success: !1,
|
|
271
271
|
errorCode: B
|
|
272
272
|
};
|
|
273
273
|
try {
|
|
274
|
-
let
|
|
275
|
-
if (!
|
|
274
|
+
let i = await n(`/events/${e}/queue/status?token=${encodeURIComponent(t)}`, { widgetKey: r?.widgetKey });
|
|
275
|
+
if (!i.success) return {
|
|
276
276
|
success: !1,
|
|
277
|
-
errorCode:
|
|
278
|
-
statusCode:
|
|
277
|
+
errorCode: i.errorCode || "queue_unavailable",
|
|
278
|
+
statusCode: i.statusCode
|
|
279
279
|
};
|
|
280
|
-
let
|
|
281
|
-
return
|
|
280
|
+
let a = J(i.data);
|
|
281
|
+
return a ? {
|
|
282
282
|
success: !0,
|
|
283
|
-
entry:
|
|
284
|
-
statusCode:
|
|
283
|
+
entry: a,
|
|
284
|
+
statusCode: i.statusCode
|
|
285
285
|
} : {
|
|
286
286
|
success: !1,
|
|
287
287
|
errorCode: B,
|
|
288
|
-
statusCode:
|
|
288
|
+
statusCode: i.statusCode
|
|
289
289
|
};
|
|
290
290
|
} catch (e) {
|
|
291
291
|
return z.error("getQueueStatus error:", e), {
|
|
@@ -294,12 +294,13 @@ async function Z(e, t) {
|
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
async function ne(e, t) {
|
|
297
|
+
async function ne(e, t, n) {
|
|
298
298
|
if (!t) return { released: !1 };
|
|
299
299
|
try {
|
|
300
|
-
return { released: (await
|
|
300
|
+
return { released: (await r(`/events/${e}/queue/leave`, { token: t }, {
|
|
301
301
|
keepalive: !0,
|
|
302
|
-
suppressOnError: !0
|
|
302
|
+
suppressOnError: !0,
|
|
303
|
+
widgetKey: n?.widgetKey
|
|
303
304
|
})).data?.released === !0 };
|
|
304
305
|
} catch (e) {
|
|
305
306
|
return z.error("leaveQueue error:", e), { released: !1 };
|
|
@@ -328,30 +329,33 @@ function ie(e) {
|
|
|
328
329
|
async function ae() {
|
|
329
330
|
return null;
|
|
330
331
|
}
|
|
331
|
-
async function oe(e) {
|
|
332
|
+
async function oe(e, t) {
|
|
332
333
|
try {
|
|
333
|
-
let
|
|
334
|
-
if (!
|
|
334
|
+
let r = await n(`/venues/${e}`, { widgetKey: t?.widgetKey });
|
|
335
|
+
if (!r.success) throw new o(r.error ?? `API error: ${r.statusCode}`, r.statusCode ?? 0, {
|
|
335
336
|
endpoint: `/venues/${e}`,
|
|
336
337
|
method: "GET"
|
|
337
338
|
});
|
|
338
|
-
return
|
|
339
|
+
return r.data;
|
|
339
340
|
} catch (e) {
|
|
340
341
|
throw Q.error("getVenueDetails error:", e), e;
|
|
341
342
|
}
|
|
342
343
|
}
|
|
343
|
-
async function $(e = {}, t) {
|
|
344
|
+
async function $(e = {}, t, n) {
|
|
344
345
|
try {
|
|
345
|
-
let
|
|
346
|
-
purchaserIP:
|
|
347
|
-
eventID:
|
|
348
|
-
quantities:
|
|
349
|
-
...
|
|
350
|
-
...
|
|
351
|
-
},
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
346
|
+
let i = await ae(), { eventID: a, quantities: o, donationAmounts: s, ...c } = e, l = o ? Object.fromEntries(Object.entries(o).map(([e, t]) => [parseInt(e, 10), t])) : {}, u = s ? Object.fromEntries(Object.entries(s).filter(([, e]) => parseFloat(String(e)) > 0).map(([e, t]) => [parseInt(e, 10), parseFloat(String(t))])) : void 0, d = {
|
|
347
|
+
purchaserIP: i,
|
|
348
|
+
eventID: a ? parseInt(String(a), 10) : void 0,
|
|
349
|
+
quantities: l,
|
|
350
|
+
...u && Object.keys(u).length > 0 ? { donationAmounts: u } : {},
|
|
351
|
+
...c
|
|
352
|
+
}, f = await r("/orders/create", d, t ? {
|
|
353
|
+
headers: { "X-Queue-Token": t },
|
|
354
|
+
widgetKey: n?.widgetKey
|
|
355
|
+
} : { widgetKey: n?.widgetKey }), p = f.data ?? {};
|
|
356
|
+
if (!f.success || p.error) {
|
|
357
|
+
let e = re(p.error) || (typeof p.message == "string" ? p.message : "") || f.error || "Order creation failed";
|
|
358
|
+
if ((f.errorCode || ie(p.error)) === "QUEUE_REQUIRED") return {
|
|
355
359
|
success: !1,
|
|
356
360
|
error: e,
|
|
357
361
|
errorType: "queue"
|
|
@@ -360,14 +364,14 @@ async function $(e = {}, t) {
|
|
|
360
364
|
return {
|
|
361
365
|
success: !1,
|
|
362
366
|
error: e,
|
|
363
|
-
errorType: t.includes("inventory") || t.includes("sold out") || t.includes("not available") || t.includes("insufficient") ||
|
|
367
|
+
errorType: t.includes("inventory") || t.includes("sold out") || t.includes("not available") || t.includes("insufficient") || f.statusCode === 409 ? "inventory" : "server"
|
|
364
368
|
};
|
|
365
369
|
}
|
|
366
|
-
return ee(
|
|
370
|
+
return ee(p.uuid || p.cartUUID), {
|
|
367
371
|
success: !0,
|
|
368
|
-
uuid:
|
|
369
|
-
serviceFee:
|
|
370
|
-
subtotal:
|
|
372
|
+
uuid: p.uuid || p.cartUUID,
|
|
373
|
+
serviceFee: p.serviceFee ?? 0,
|
|
374
|
+
subtotal: p.subtotal ?? 0
|
|
371
375
|
};
|
|
372
376
|
} catch (e) {
|
|
373
377
|
let t = e instanceof Error ? e.message : "Network error";
|
|
@@ -378,17 +382,17 @@ async function $(e = {}, t) {
|
|
|
378
382
|
};
|
|
379
383
|
}
|
|
380
384
|
}
|
|
381
|
-
async function se(e) {
|
|
385
|
+
async function se(e, t) {
|
|
382
386
|
try {
|
|
383
|
-
let
|
|
384
|
-
if (!
|
|
385
|
-
let
|
|
386
|
-
throw Q.error("getOrder error response:",
|
|
387
|
+
let r = await n(`/orders/${e}`, { widgetKey: t?.widgetKey });
|
|
388
|
+
if (!r.success) {
|
|
389
|
+
let t = r.error ?? `Failed to fetch order (${r.statusCode})`;
|
|
390
|
+
throw Q.error("getOrder error response:", t), new o(t, r.statusCode ?? 0, {
|
|
387
391
|
endpoint: `/orders/${e}`,
|
|
388
392
|
method: "GET"
|
|
389
393
|
});
|
|
390
394
|
}
|
|
391
|
-
return
|
|
395
|
+
return r.data;
|
|
392
396
|
} catch (e) {
|
|
393
397
|
throw Q.error("getOrder error:", e), e;
|
|
394
398
|
}
|
|
@@ -397,9 +401,9 @@ async function se(e) {
|
|
|
397
401
|
//#region src/lib/utils/utm.ts
|
|
398
402
|
var ce = e("utm");
|
|
399
403
|
async function le(e) {
|
|
400
|
-
let t = new URLSearchParams(window.location.search), n =
|
|
404
|
+
let t = new URLSearchParams(window.location.search), n = i(t.get("utm_source")) || "direct";
|
|
401
405
|
try {
|
|
402
|
-
await fetch(`${
|
|
406
|
+
await fetch(`${a()}/utm/${e}/${encodeURIComponent(n)}`);
|
|
403
407
|
} catch (e) {
|
|
404
408
|
ce.error("UTM tracking failed:", e);
|
|
405
409
|
}
|