@levo-so/site-runtime 0.3.19 → 0.3.21

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.
Files changed (55) hide show
  1. package/BillingStep-ByiYjJ0S.js +251 -0
  2. package/BookingCard-DdwLHVGw.js +816 -0
  3. package/CollectionLabel-CmUFfc_7.js +35 -0
  4. package/DateTimeWidget-Bk2tk_CT.js +254 -0
  5. package/{KBChatWidget-GRi6sLpp.js → KBChatWidget-BXRRgelS.js} +223 -223
  6. package/PhoneWidget-FWE3jD_L.js +97 -0
  7. package/{Popover-C29yJ7rz.js → Popover-MSrVDAzg.js} +7 -7
  8. package/PopupBody-DWM55Zh5-B3ysApDM.js +158 -0
  9. package/PopupDialog-DwAAJ8JS-DkxjZaJL.js +260 -0
  10. package/PopupRenderer-BVtV4b9I-Dot4Syse.js +207 -0
  11. package/{RichTextWidget-DfakML79.js → RichTextWidget-KnIKESAD.js} +189 -190
  12. package/{RteThemeProvider-BQmfSXSl.js → RteThemeProvider-DtTXGcCT.js} +2 -3
  13. package/Sonner-BsE4Y_t4.js +21 -0
  14. package/blog-content.js +71 -72
  15. package/dist-BVFCdirT.js +4471 -0
  16. package/dist-DEXGyFeH.js +376 -0
  17. package/index.d.ts +21 -11
  18. package/index.js +1702 -1390
  19. package/{themeVars.cssm-ByhhC2Jm.js → inlineBaseTheme-DcNdMEYp.js} +35 -5
  20. package/{inlineCollectionTheme-CWcMCUti.js → inlineCollectionTheme-DjXuH3bK.js} +1 -1
  21. package/{inlineRteTheme-CRPtkNXy.js → inlineRteTheme-BYGIJM7P.js} +1 -1
  22. package/{kbChat-a2dXSeRc.js → kbChat-eFsau7hG.js} +27 -27
  23. package/package.json +23 -23
  24. package/{pillChrome-CEpWGNZB.js → pillChrome-Dy3ApFI5.js} +5 -5
  25. package/popups.js +1 -1
  26. package/{react-Cj_U6VZQ.js → react-CENbCy5d.js} +6 -5
  27. package/script.esm-D4nvz3-k.js +62 -0
  28. package/script.esm-uVCZU25S.js +62 -0
  29. package/start.js +1 -1
  30. package/styles.css +1 -1
  31. package/theme.cssm-iXnQwMCp.js +238 -0
  32. package/CollectionField-C-6a1ud4.js +0 -270
  33. package/CollectionInput-BJ__qcbk.js +0 -147
  34. package/DateTimeWidget-U3lD0q1q.js +0 -255
  35. package/Dialog-dT7y641z.js +0 -130
  36. package/LevoProvider-Bsjkcwc8.js +0 -20
  37. package/PhoneWidget-DQQa4bL6.js +0 -99
  38. package/PopupBody-BI-MJqmd-DgTQEzda.js +0 -159
  39. package/PopupRenderer-D66Gx63H-Cd9xJv33.js +0 -388
  40. package/ThemeProvider-DutrjSTF.js +0 -116
  41. package/Tooltip-CQB0LyxK.js +0 -67
  42. package/VerifyButton-BUT70lgz.js +0 -192
  43. package/createThemeExtension-4AUn51iJ.js +0 -15
  44. package/dist-6AIgW_iB.js +0 -79
  45. package/dist-CEdznbFW.js +0 -3668
  46. package/inlineBaseTheme-BB9e6h5f.js +0 -9
  47. package/popupState-JmpeKzgM-D_77LiAa.js +0 -229
  48. package/react-B9yvlbH0.js +0 -74
  49. package/theme.cssm-DUzmx76l.js +0 -4
  50. package/usePopupRedirect-CAAdcpaW-Ddjyf4KK.js +0 -82
  51. /package/{content.cssm-XdMsTGIB.js → content.cssm-D_LSloGW.js} +0 -0
  52. /package/{es-ByBbirnH.js → es-CK20DkgT.js} +0 -0
  53. /package/{rolldown-runtime-CAFD8bLK.js → rolldown-runtime-Dy4uBu1J.js} +0 -0
  54. /package/{routes-CyKmkoRM.js → routes-DO1BLfh9.js} +0 -0
  55. /package/{rteTheme.cssm-W4gTOijw.js → rteTheme.cssm-BRxusHY4.js} +0 -0
@@ -0,0 +1,816 @@
1
+ "use client";
2
+ import { c as e, r as t } from "./dist-BVFCdirT.js";
3
+ import { m as n } from "./theme.cssm-iXnQwMCp.js";
4
+ import { a as r } from "./inlineBaseTheme-DcNdMEYp.js";
5
+ import { BillingStep as i } from "./BillingStep-ByiYjJ0S.js";
6
+ import a from "dayjs";
7
+ import { c as o } from "react/compiler-runtime";
8
+ import { useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
9
+ import f from "clsx";
10
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
11
+ import { Calendar as g, CheckCircle2 as _, Clock as v, CreditCard as y, Download as b, Loader2 as x, Pencil as S, RefreshCw as C, ShieldCheck as w, Ticket as T, XCircle as E, XIcon as D } from "lucide-react";
12
+ import { useRazorpay as O } from "react-razorpay";
13
+ import { EmbeddedCheckout as k, EmbeddedCheckoutProvider as A } from "@stripe/react-stripe-js";
14
+ import { createPortal as j } from "react-dom";
15
+ //#region ../../libraries/react-collection/dist/lib/CollectionFormRenderer/booking/checkout/openCashfreeCheckout.js
16
+ var M = async (e) => {
17
+ let { payment_session_id: t, order_id: n } = e;
18
+ if (!t || !n) throw Error("Cashfree payment session missing");
19
+ let { load: r } = await import("./script.esm-uVCZU25S.js"), i = await r({ mode: e.environment || "production" });
20
+ if (!i) throw Error("Cashfree checkout failed to load");
21
+ let a = await i.checkout({
22
+ paymentSessionId: t,
23
+ redirectTarget: "_modal"
24
+ });
25
+ return a.paymentDetails ? {
26
+ status: "completed",
27
+ confirmation: { order_id: n }
28
+ } : a.redirect ? { status: "redirect" } : {
29
+ status: "closed",
30
+ message: a.error?.message
31
+ };
32
+ }, N = () => typeof window < "u" && "Razorpay" in window, P = ({ order: e, onSettled: t, onError: n }) => {
33
+ let { Razorpay: r, isLoading: i, error: a } = O(), o = u({
34
+ onSettled: t,
35
+ onError: n
36
+ });
37
+ o.current = {
38
+ onSettled: t,
39
+ onError: n
40
+ };
41
+ let s = u(!1);
42
+ return c(() => {
43
+ if (s.current) return;
44
+ if (a) {
45
+ s.current = !0, o.current.onError(Error(a));
46
+ return;
47
+ }
48
+ if (!r || !N()) return;
49
+ s.current = !0;
50
+ let t;
51
+ try {
52
+ let n = new r({
53
+ key: e.key,
54
+ amount: e.amount,
55
+ currency: e.currency,
56
+ order_id: e.orderId,
57
+ name: e.merchantName,
58
+ description: e.description,
59
+ prefill: e.prefill,
60
+ theme: e.themeColor ? { color: e.themeColor } : void 0,
61
+ handler: (e) => o.current.onSettled({
62
+ status: "completed",
63
+ confirmation: {
64
+ order_id: e.razorpay_order_id,
65
+ payment_id: e.razorpay_payment_id,
66
+ signature: e.razorpay_signature
67
+ }
68
+ }),
69
+ modal: { ondismiss: () => o.current.onSettled({
70
+ status: "closed",
71
+ message: t
72
+ }) }
73
+ });
74
+ n.on("payment.failed", (e) => {
75
+ t = e?.error?.description;
76
+ }), n.open();
77
+ } catch (e) {
78
+ o.current.onError(e instanceof Error ? e : /* @__PURE__ */ Error("Razorpay checkout failed to open"));
79
+ }
80
+ }, [
81
+ r,
82
+ i,
83
+ a,
84
+ e
85
+ ]), null;
86
+ }, F = "_1fguior1", I = "_1fguior2", L = "_1fguior3", ee = "_1fguior4", te = "_1fguior5", ne = ({ stripePromise: e, clientSecret: t, onClose: n, onComplete: r }) => {
87
+ let i = u(r);
88
+ i.current = r;
89
+ let a = l(() => ({
90
+ clientSecret: t,
91
+ onComplete: () => i.current()
92
+ }), [t]), o = u(null), s = u(null);
93
+ return c(() => {
94
+ let e = document.activeElement, t = o.current;
95
+ s.current?.focus();
96
+ let n = !1, r = (e) => {
97
+ e.key === "Tab" && (n = e.shiftKey);
98
+ }, i = (e) => {
99
+ if (!t || t.contains(e.target)) return;
100
+ let r = t.querySelector("iframe") ?? s.current;
101
+ (n ? r : s.current)?.focus(), n = !1;
102
+ };
103
+ return document.addEventListener("keydown", r, !0), document.addEventListener("focusin", i), () => {
104
+ document.removeEventListener("keydown", r, !0), document.removeEventListener("focusin", i), e?.focus?.();
105
+ };
106
+ }, []), j(/* @__PURE__ */ m("div", {
107
+ className: F,
108
+ children: /* @__PURE__ */ h("div", {
109
+ ref: o,
110
+ role: "dialog",
111
+ "aria-modal": "true",
112
+ "aria-label": "Payment",
113
+ className: I,
114
+ children: [/* @__PURE__ */ m("button", {
115
+ ref: s,
116
+ type: "button",
117
+ onClick: n,
118
+ "aria-label": "Close payment",
119
+ className: L,
120
+ children: /* @__PURE__ */ m(D, { size: 20 })
121
+ }), /* @__PURE__ */ m("div", {
122
+ className: ee,
123
+ children: /* @__PURE__ */ m(A, {
124
+ stripe: e,
125
+ options: a,
126
+ children: /* @__PURE__ */ m(k, { className: f("stripe-embedded-checkout", te) })
127
+ })
128
+ })]
129
+ })
130
+ }), document.body);
131
+ }, re = () => {
132
+ let [e, t] = d(null), n = s(async (e, n) => {
133
+ if (e.provider === "cashfree") return M(e);
134
+ if (e.provider === "stripe") {
135
+ let { client_secret: n, session_id: r } = e;
136
+ if (!n || !r) throw Error("Stripe checkout session missing");
137
+ let { loadStripe: i } = await import("@stripe/stripe-js"), a = i(e.key);
138
+ return new Promise((e, i) => t({
139
+ provider: "stripe",
140
+ stripePromise: a,
141
+ clientSecret: n,
142
+ sessionId: r,
143
+ settle: {
144
+ resolve: e,
145
+ reject: i
146
+ }
147
+ }));
148
+ }
149
+ let { order_id: r } = e;
150
+ if (!r) throw Error("Razorpay order missing");
151
+ return new Promise((i, a) => t({
152
+ provider: "razorpay",
153
+ order: {
154
+ ...n,
155
+ key: e.key,
156
+ currency: e.currency || "INR",
157
+ orderId: r
158
+ },
159
+ settle: {
160
+ resolve: i,
161
+ reject: a
162
+ }
163
+ }));
164
+ }, []), r = (e, n) => {
165
+ t(null), n instanceof Error ? e.settle.reject(n) : e.settle.resolve(n);
166
+ }, i = null;
167
+ return e?.provider === "stripe" ? i = /* @__PURE__ */ m(ne, {
168
+ stripePromise: e.stripePromise,
169
+ clientSecret: e.clientSecret,
170
+ onComplete: () => r(e, {
171
+ status: "completed",
172
+ confirmation: { session_id: e.sessionId }
173
+ }),
174
+ onClose: () => r(e, { status: "closed" })
175
+ }) : e?.provider === "razorpay" && (i = /* @__PURE__ */ m(P, {
176
+ order: e.order,
177
+ onSettled: (t) => r(e, t),
178
+ onError: (t) => r(e, t)
179
+ })), {
180
+ open: n,
181
+ element: i
182
+ };
183
+ }, R = "jsbo1i3", z = "jsbo1i8", B = "jsbo1i9", V = "jsbo1ia", H = "jsbo1ib", U = "jsbo1if", W = "jsbo1ig", ie = "jsbo1ih", ae = {
184
+ cashfree: "Cashfree",
185
+ razorpay: "Razorpay",
186
+ stripe: "Stripe"
187
+ }, G = (e) => {
188
+ let t = o(24), { items: n, textSizeClass: r } = e, i = r === void 0 ? R : r, [a, s] = d(!1), l = u(null), p, g;
189
+ if (t[0] === a ? (p = t[1], g = t[2]) : (p = () => {
190
+ if (!a) return;
191
+ let e = (e) => {
192
+ l.current && !l.current.contains(e.target) && s(!1);
193
+ };
194
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
195
+ }, g = [a], t[0] = a, t[1] = p, t[2] = g), c(p, g), n.length === 0) {
196
+ let e;
197
+ t[3] === i ? e = t[4] : (e = f(z, i), t[3] = i, t[4] = e);
198
+ let n;
199
+ return t[5] === e ? n = t[6] : (n = /* @__PURE__ */ m("span", {
200
+ className: e,
201
+ children: "-"
202
+ }), t[5] = e, t[6] = n), n;
203
+ }
204
+ let _ = String(n[0] ?? "-"), v = n.length - 1, y, b;
205
+ t[7] === Symbol.for("react.memo_cache_sentinel") ? (y = () => s(!0), b = () => s(!1), t[7] = y, t[8] = b) : (y = t[7], b = t[8]);
206
+ let x;
207
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (x = () => s(q), t[9] = x) : x = t[9];
208
+ let S;
209
+ t[10] === i ? S = t[11] : (S = f(H, i), t[10] = i, t[11] = S);
210
+ let C;
211
+ t[12] === v ? C = t[13] : (C = v > 0 && /* @__PURE__ */ h("span", {
212
+ className: "jsbo1ic",
213
+ children: [
214
+ "+",
215
+ v,
216
+ " more"
217
+ ]
218
+ }), t[12] = v, t[13] = C);
219
+ let w;
220
+ t[14] !== _ || t[15] !== S || t[16] !== C ? (w = /* @__PURE__ */ h("button", {
221
+ type: "button",
222
+ onClick: x,
223
+ className: S,
224
+ children: [_, C]
225
+ }), t[14] = _, t[15] = S, t[16] = C, t[17] = w) : w = t[17];
226
+ let T;
227
+ t[18] !== n || t[19] !== a ? (T = a && /* @__PURE__ */ m("div", {
228
+ className: "jsbo1id",
229
+ children: /* @__PURE__ */ m("ul", {
230
+ className: "jsbo1ie",
231
+ children: n.map(J)
232
+ })
233
+ }), t[18] = n, t[19] = a, t[20] = T) : T = t[20];
234
+ let E;
235
+ return t[21] !== T || t[22] !== w ? (E = /* @__PURE__ */ h("div", {
236
+ ref: l,
237
+ className: V,
238
+ onMouseEnter: y,
239
+ onMouseLeave: b,
240
+ children: [w, T]
241
+ }), t[21] = T, t[22] = w, t[23] = E) : E = t[23], E;
242
+ }, K = ({ summary: o, billingDetails: s, onBillingEdit: c, onComplete: l, className: u, workspaceId: D, workspaceName: O }) => {
243
+ let k = r(), A = re(), [j, M] = d("summary"), [N, P] = d(null), [F, I] = d(!1), [L, ee] = d(null), [te, ne] = d("razorpay"), R = (e, t) => {
244
+ let n = t && t.trim() ? t : "INR", r = e / 100;
245
+ return new Intl.NumberFormat("en-IN", {
246
+ style: "currency",
247
+ currency: n,
248
+ minimumFractionDigits: 0
249
+ }).format(r);
250
+ }, z = (e) => e ? a(e).format("D MMM YYYY") : null, B = (e) => e ? a(e).format("h:mm A") : null, V = (e) => e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (e) => e.toUpperCase()), H = (e) => e == null ? "-" : typeof e == "boolean" ? e ? "Yes" : "No" : Array.isArray(e) ? e.join(", ") : typeof e == "object" ? JSON.stringify(e) : String(e), U = () => {
251
+ try {
252
+ Object.keys(localStorage).forEach((e) => {
253
+ e.startsWith("levo_collection_cart_") && localStorage.removeItem(e);
254
+ }), window.dispatchEvent(new Event("levo_cart_updated"));
255
+ } catch (t) {
256
+ e(t);
257
+ }
258
+ }, W = Object.entries(o.form_data || {}).filter(([e, t]) => t != null && t !== ""), K = async () => {
259
+ M("processing"), P(null);
260
+ try {
261
+ let e = s || o.billing_details, n = e ? { billing_details: e } : {}, r = await k?.fetch?.url(`/v1/payment/booking/${o._id}/pay`)?.options(t(D))?.post(n).json(), i = r?.content?.meta;
262
+ if (!r?.status || !i?.key) {
263
+ P("Unable to initiate payment. Please try again."), M("failed");
264
+ return;
265
+ }
266
+ ne(i.provider || "razorpay");
267
+ let a = await A.open(i, {
268
+ amount: i.amount ?? 0,
269
+ merchantName: O ?? "",
270
+ description: Q || "Booking Payment",
271
+ prefill: {
272
+ name: "",
273
+ email: "",
274
+ contact: ""
275
+ },
276
+ themeColor: "#FC751A"
277
+ });
278
+ a.status === "completed" ? await q(a.confirmation) : a.status === "closed" && (a.message ? (P(a.message), M("failed")) : M("summary"));
279
+ } catch (t) {
280
+ console.error("Initiate payment error:", t), e(t), P("Unable to initiate payment. Please check your connection and try again."), M("failed");
281
+ }
282
+ }, q = async (n) => {
283
+ try {
284
+ let e = await k?.fetch?.url(`/v1/payment/booking/${o._id}/confirm`)?.options(t(D))?.post(n).json();
285
+ e?.status && e?.content?.data ? (ee(e.content.data), M("confirmed"), U()) : (P("Payment received but confirmation failed. Please contact support."), M("failed"));
286
+ } catch (t) {
287
+ console.error("Confirm payment error:", t), e(t), P("Payment received but confirmation failed. Please contact support."), M("failed");
288
+ }
289
+ }, J = !o.total_amount || o.total_amount === 0, Y = o.line_items || [], X = Y[0], Z = Y.length > 1, Q = Z ? o.context_label || "Booking" : X?.instance_label || o.context_label || "Booking", oe = X?.cover_image?.location || null, $ = X?.starts_at || null, se = X?.ends_at || null;
290
+ return /* @__PURE__ */ h(p, { children: [
291
+ /* @__PURE__ */ h("div", {
292
+ className: f(ie, u),
293
+ children: [
294
+ j === "summary" && /* @__PURE__ */ h("div", {
295
+ className: "jsbo1i4",
296
+ children: [oe && /* @__PURE__ */ h("div", {
297
+ className: "jsbo1ij",
298
+ children: [/* @__PURE__ */ m("img", {
299
+ src: oe,
300
+ alt: Q,
301
+ className: "jsbo1ik"
302
+ }), /* @__PURE__ */ m("div", { className: "jsbo1il" })]
303
+ }), /* @__PURE__ */ h("div", {
304
+ className: f("jsbo1i4", "jsbo1ii"),
305
+ children: [
306
+ /* @__PURE__ */ h("div", {
307
+ className: "jsbo1im",
308
+ children: [/* @__PURE__ */ m("p", {
309
+ className: "jsbo1in",
310
+ children: "Booking Summary"
311
+ }), /* @__PURE__ */ m("h3", {
312
+ className: "jsbo1io",
313
+ children: Q
314
+ })]
315
+ }),
316
+ !Z && ($ || se) && /* @__PURE__ */ h("div", {
317
+ className: "jsbo1ip",
318
+ children: [$ && /* @__PURE__ */ h("div", {
319
+ className: "jsbo1iq",
320
+ children: [/* @__PURE__ */ m(g, {
321
+ size: 16,
322
+ className: "jsbo1ir"
323
+ }), /* @__PURE__ */ m("span", { children: z($) })]
324
+ }), $ && /* @__PURE__ */ h("div", {
325
+ className: "jsbo1iq",
326
+ children: [/* @__PURE__ */ m(v, {
327
+ size: 16,
328
+ className: "jsbo1ir"
329
+ }), /* @__PURE__ */ m("span", { children: B($) })]
330
+ })]
331
+ }),
332
+ W.length > 0 && /* @__PURE__ */ h("div", {
333
+ className: "jsbo1it",
334
+ children: [/* @__PURE__ */ m("h4", {
335
+ className: "jsbo1iu",
336
+ children: "Your Details"
337
+ }), /* @__PURE__ */ m("div", {
338
+ className: "jsbo1iy",
339
+ children: /* @__PURE__ */ m("div", {
340
+ className: "jsbo1iz",
341
+ children: W.map(([e, t]) => /* @__PURE__ */ h("div", {
342
+ className: "jsbo1i10",
343
+ children: [/* @__PURE__ */ m("span", {
344
+ className: "jsbo1i11",
345
+ children: V(e)
346
+ }), Array.isArray(t) ? /* @__PURE__ */ m(G, {
347
+ items: t,
348
+ textSizeClass: "jsbo1i3"
349
+ }) : /* @__PURE__ */ m("span", {
350
+ className: "jsbo1i12",
351
+ children: H(t)
352
+ })]
353
+ }, e))
354
+ })
355
+ })]
356
+ }),
357
+ (() => {
358
+ let e = s || o.billing_details;
359
+ return e ? /* @__PURE__ */ h("div", {
360
+ className: "jsbo1it",
361
+ children: [/* @__PURE__ */ h("div", {
362
+ className: "jsbo1iv",
363
+ children: [/* @__PURE__ */ m("h4", {
364
+ className: "jsbo1iw",
365
+ children: "Billing Details"
366
+ }), c && /* @__PURE__ */ m("button", {
367
+ type: "button",
368
+ onClick: () => I(!0),
369
+ className: "jsbo1ix",
370
+ children: /* @__PURE__ */ m(S, { size: 14 })
371
+ })]
372
+ }), /* @__PURE__ */ m("div", {
373
+ className: "jsbo1iy",
374
+ children: /* @__PURE__ */ h("div", {
375
+ className: "jsbo1iz",
376
+ children: [
377
+ /* @__PURE__ */ h("div", {
378
+ className: "jsbo1i10",
379
+ children: [/* @__PURE__ */ m("span", {
380
+ className: "jsbo1i11",
381
+ children: "Name"
382
+ }), /* @__PURE__ */ m("span", {
383
+ className: "jsbo1i12",
384
+ children: e.name
385
+ })]
386
+ }),
387
+ e.tax_id && /* @__PURE__ */ h("div", {
388
+ className: "jsbo1i10",
389
+ children: [/* @__PURE__ */ m("span", {
390
+ className: "jsbo1i11",
391
+ children: "Tax ID"
392
+ }), /* @__PURE__ */ m("span", {
393
+ className: "jsbo1i12",
394
+ children: e.tax_id
395
+ })]
396
+ }),
397
+ /* @__PURE__ */ h("div", {
398
+ className: "jsbo1i10",
399
+ children: [/* @__PURE__ */ m("span", {
400
+ className: "jsbo1i11",
401
+ children: "Address"
402
+ }), /* @__PURE__ */ m("span", {
403
+ className: "jsbo1i12",
404
+ children: [
405
+ e.address.line1,
406
+ e.address.line2,
407
+ e.address.city,
408
+ e.address.state,
409
+ e.address.postal_code,
410
+ e.address.country
411
+ ].filter(Boolean).join(", ")
412
+ })]
413
+ })
414
+ ]
415
+ })
416
+ })]
417
+ }) : null;
418
+ })(),
419
+ /* @__PURE__ */ h("div", {
420
+ className: "jsbo1it",
421
+ children: [/* @__PURE__ */ m("h4", {
422
+ className: "jsbo1iu",
423
+ children: "Payment"
424
+ }), /* @__PURE__ */ h("div", {
425
+ className: "jsbo1i13",
426
+ children: [/* @__PURE__ */ h("div", {
427
+ className: "jsbo1i14",
428
+ children: [
429
+ Y.map((e) => /* @__PURE__ */ h("div", {
430
+ className: "jsbo1i15",
431
+ children: [/* @__PURE__ */ h("span", {
432
+ className: "jsbo1i16",
433
+ children: [/* @__PURE__ */ m("span", {
434
+ className: "jsbo1i9",
435
+ children: e.instance_label
436
+ }), e.quantity > 1 && /* @__PURE__ */ h("span", {
437
+ className: "jsbo1i17",
438
+ children: ["×", e.quantity]
439
+ })]
440
+ }), /* @__PURE__ */ m("span", {
441
+ className: "jsbo1i18",
442
+ children: R(e.line_subtotal, o.currency)
443
+ })]
444
+ }, e.resource_instance)),
445
+ typeof o.discount == "number" && o.discount > 0 && /* @__PURE__ */ h("div", {
446
+ className: f("jsbo1i6", "jsbo1i3"),
447
+ children: [/* @__PURE__ */ m("span", {
448
+ className: "jsbo1i7",
449
+ children: "Discount"
450
+ }), /* @__PURE__ */ h("span", {
451
+ className: "jsbo1i19",
452
+ children: ["-", R(o.discount, o.currency)]
453
+ })]
454
+ }),
455
+ o.taxes && o.taxes.length > 0 && o.taxes.map((e) => /* @__PURE__ */ h("div", {
456
+ className: f("jsbo1i6", "jsbo1i3"),
457
+ children: [/* @__PURE__ */ m("span", {
458
+ className: "jsbo1i7",
459
+ children: e.label
460
+ }), /* @__PURE__ */ m("span", {
461
+ className: "jsbo1i8",
462
+ children: R(e.amount, o.currency)
463
+ })]
464
+ }, e.id))
465
+ ]
466
+ }), /* @__PURE__ */ h("div", {
467
+ className: "jsbo1i1a",
468
+ children: [/* @__PURE__ */ m("span", {
469
+ className: "jsbo1i1b",
470
+ children: "Total"
471
+ }), /* @__PURE__ */ m("span", {
472
+ className: "jsbo1i1c",
473
+ children: J ? "Free" : R(o.total_amount, o.currency)
474
+ })]
475
+ })]
476
+ })]
477
+ }),
478
+ /* @__PURE__ */ m(n, {
479
+ type: "button",
480
+ size: "lg",
481
+ onClick: J ? () => {
482
+ M("confirmed"), U();
483
+ } : K,
484
+ className: "jsbo1i1d",
485
+ children: /* @__PURE__ */ m("span", {
486
+ className: "jsbo1i1e",
487
+ children: J ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(_, { size: 20 }), /* @__PURE__ */ m("span", { children: "Confirm Booking" })] }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(y, { size: 20 }), /* @__PURE__ */ h("span", { children: ["Pay ", R(o.total_amount, o.currency)] })] })
488
+ })
489
+ }),
490
+ !J && /* @__PURE__ */ h("div", {
491
+ className: "jsbo1i1f",
492
+ children: [/* @__PURE__ */ m(w, { size: 14 }), /* @__PURE__ */ m("span", { children: "Secure payment" })]
493
+ })
494
+ ]
495
+ })]
496
+ }),
497
+ j === "processing" && /* @__PURE__ */ h("div", {
498
+ className: "jsbo1i1g",
499
+ children: [
500
+ /* @__PURE__ */ h("div", {
501
+ className: "jsbo1i1h",
502
+ children: [/* @__PURE__ */ m("div", { className: "jsbo1i1i" }), /* @__PURE__ */ m("div", {
503
+ className: "jsbo1i1j",
504
+ children: /* @__PURE__ */ m(x, {
505
+ size: 32,
506
+ className: "jsbo1i1k"
507
+ })
508
+ })]
509
+ }),
510
+ /* @__PURE__ */ m("h3", {
511
+ className: "jsbo1i1l",
512
+ children: "Processing Payment"
513
+ }),
514
+ /* @__PURE__ */ m("p", {
515
+ className: "jsbo1i1m",
516
+ children: "Please wait while we confirm your payment..."
517
+ }),
518
+ /* @__PURE__ */ m("div", {
519
+ className: "jsbo1i1n",
520
+ children: /* @__PURE__ */ h("p", {
521
+ className: "jsbo1i1m",
522
+ children: [
523
+ "Amount:",
524
+ " ",
525
+ /* @__PURE__ */ m("span", {
526
+ className: "jsbo1i1o",
527
+ children: R(o.total_amount, o.currency)
528
+ })
529
+ ]
530
+ })
531
+ })
532
+ ]
533
+ }),
534
+ j === "failed" && /* @__PURE__ */ h("div", {
535
+ className: "jsbo1i4",
536
+ children: [/* @__PURE__ */ m("div", {
537
+ className: "jsbo1i1p",
538
+ children: /* @__PURE__ */ h("div", {
539
+ className: "jsbo1i5",
540
+ children: [
541
+ /* @__PURE__ */ m("div", {
542
+ className: "jsbo1i1q",
543
+ children: /* @__PURE__ */ m(E, { size: 32 })
544
+ }),
545
+ /* @__PURE__ */ m("h3", {
546
+ className: "jsbo1i1l",
547
+ children: "Payment Failed"
548
+ }),
549
+ /* @__PURE__ */ m("p", {
550
+ className: "jsbo1i1m",
551
+ children: N || "Something went wrong. Please try again."
552
+ })
553
+ ]
554
+ })
555
+ }), /* @__PURE__ */ h("div", {
556
+ className: f("jsbo1i4", "jsbo1ii"),
557
+ children: [
558
+ /* @__PURE__ */ m("div", {
559
+ className: "jsbo1i1r",
560
+ children: /* @__PURE__ */ m("h4", {
561
+ className: "jsbo1i1s",
562
+ children: Q
563
+ })
564
+ }),
565
+ !Z && ($ || se) && /* @__PURE__ */ h("div", {
566
+ className: "jsbo1i1t",
567
+ children: [$ && /* @__PURE__ */ h("div", {
568
+ className: "jsbo1iq",
569
+ children: [/* @__PURE__ */ m(g, {
570
+ size: 16,
571
+ className: "jsbo1is"
572
+ }), /* @__PURE__ */ m("span", { children: z($) })]
573
+ }), $ && /* @__PURE__ */ h("div", {
574
+ className: "jsbo1iq",
575
+ children: [/* @__PURE__ */ m(v, {
576
+ size: 16,
577
+ className: "jsbo1is"
578
+ }), /* @__PURE__ */ m("span", { children: B($) })]
579
+ })]
580
+ }),
581
+ W.length > 0 && /* @__PURE__ */ m("div", {
582
+ className: "jsbo1i1u",
583
+ children: /* @__PURE__ */ h("div", {
584
+ className: "jsbo1i1v",
585
+ children: [W.slice(0, 3).map(([e, t]) => /* @__PURE__ */ h("div", {
586
+ className: "jsbo1i1w",
587
+ children: [/* @__PURE__ */ m("span", {
588
+ className: "jsbo1i7",
589
+ children: V(e)
590
+ }), Array.isArray(t) ? /* @__PURE__ */ m(G, {
591
+ items: t,
592
+ textSizeClass: "jsbo1i3"
593
+ }) : /* @__PURE__ */ m("span", {
594
+ className: "jsbo1i1x",
595
+ children: H(t)
596
+ })]
597
+ }, e)), W.length > 3 && /* @__PURE__ */ h("p", {
598
+ className: "jsbo1i1y",
599
+ children: [
600
+ "+",
601
+ W.length - 3,
602
+ " more"
603
+ ]
604
+ })]
605
+ })
606
+ }),
607
+ /* @__PURE__ */ m("div", {
608
+ className: "jsbo1i1z",
609
+ children: /* @__PURE__ */ h("div", {
610
+ className: "jsbo1i6",
611
+ children: [/* @__PURE__ */ m("span", {
612
+ className: "jsbo1i20",
613
+ children: "Amount to Pay"
614
+ }), /* @__PURE__ */ m("span", {
615
+ className: "jsbo1i1c",
616
+ children: R(o.total_amount, o.currency)
617
+ })]
618
+ })
619
+ }),
620
+ /* @__PURE__ */ m(n, {
621
+ type: "button",
622
+ size: "lg",
623
+ onClick: () => {
624
+ P(null), K();
625
+ },
626
+ className: "jsbo1i1d",
627
+ children: /* @__PURE__ */ h("span", {
628
+ className: "jsbo1i1e",
629
+ children: [/* @__PURE__ */ m(C, { size: 20 }), /* @__PURE__ */ m("span", { children: "Try Again" })]
630
+ })
631
+ }),
632
+ /* @__PURE__ */ h("div", {
633
+ className: "jsbo1i1f",
634
+ children: [/* @__PURE__ */ m(w, { size: 14 }), /* @__PURE__ */ h("span", { children: ["Secured by ", ae[te]] })]
635
+ }),
636
+ /* @__PURE__ */ m("p", {
637
+ className: "jsbo1i21",
638
+ children: "If the problem persists, please contact support"
639
+ })
640
+ ]
641
+ })]
642
+ }),
643
+ j === "confirmed" && /* @__PURE__ */ h("div", {
644
+ className: "jsbo1i4",
645
+ children: [/* @__PURE__ */ m("div", {
646
+ className: "jsbo1i22",
647
+ children: /* @__PURE__ */ h("div", {
648
+ className: "jsbo1i5",
649
+ children: [
650
+ /* @__PURE__ */ h("div", {
651
+ className: "jsbo1i23",
652
+ children: [/* @__PURE__ */ m("div", { className: "jsbo1i24" }), /* @__PURE__ */ m("div", {
653
+ className: "jsbo1i25",
654
+ children: /* @__PURE__ */ m(_, { size: 36 })
655
+ })]
656
+ }),
657
+ /* @__PURE__ */ m("h3", {
658
+ className: "jsbo1i26",
659
+ children: J ? "Booking Confirmed!" : "Payment Successful!"
660
+ }),
661
+ /* @__PURE__ */ m("p", {
662
+ className: "jsbo1i1m",
663
+ children: J ? "Your booking has been confirmed" : "Your payment has been processed successfully"
664
+ })
665
+ ]
666
+ })
667
+ }), /* @__PURE__ */ h("div", {
668
+ className: "jsbo1ii",
669
+ children: [
670
+ /* @__PURE__ */ h("div", {
671
+ className: "jsbo1i27",
672
+ children: [
673
+ /* @__PURE__ */ m("div", { className: "jsbo1i28" }),
674
+ /* @__PURE__ */ m("div", { className: "jsbo1i29" }),
675
+ /* @__PURE__ */ h("div", {
676
+ className: "jsbo1i2a",
677
+ children: [
678
+ /* @__PURE__ */ h("div", {
679
+ className: "jsbo1i2b",
680
+ children: [/* @__PURE__ */ m("div", {
681
+ className: "jsbo1i2c",
682
+ children: /* @__PURE__ */ m(T, { size: 20 })
683
+ }), /* @__PURE__ */ m("div", {
684
+ className: "jsbo1i2d",
685
+ children: /* @__PURE__ */ m("p", {
686
+ className: "jsbo1i2e",
687
+ children: Q
688
+ })
689
+ })]
690
+ }),
691
+ o.qr_image?.location && /* @__PURE__ */ m("div", {
692
+ className: "jsbo1i2f",
693
+ children: /* @__PURE__ */ m("div", {
694
+ className: "jsbo1i2g",
695
+ children: /* @__PURE__ */ m("img", {
696
+ src: o.qr_image.location,
697
+ alt: "Booking QR Code",
698
+ className: "jsbo1i2h"
699
+ })
700
+ })
701
+ }),
702
+ /* @__PURE__ */ h("div", {
703
+ className: "jsbo1i2i",
704
+ children: [/* @__PURE__ */ m("span", {
705
+ className: "jsbo1i2j",
706
+ children: "Booking ID"
707
+ }), /* @__PURE__ */ m("span", {
708
+ className: "jsbo1i2k",
709
+ children: o._id
710
+ })]
711
+ }),
712
+ /* @__PURE__ */ m("div", { className: "jsbo1i2l" }),
713
+ /* @__PURE__ */ h("div", {
714
+ className: "jsbo1iz",
715
+ children: [!Z && $ && /* @__PURE__ */ h("div", {
716
+ className: "jsbo1i6",
717
+ children: [/* @__PURE__ */ h("div", {
718
+ className: "jsbo1iq",
719
+ children: [/* @__PURE__ */ m(g, { size: 16 }), /* @__PURE__ */ m("span", { children: "Date & Time" })]
720
+ }), /* @__PURE__ */ h("p", {
721
+ className: "jsbo1i2m",
722
+ children: [
723
+ z($),
724
+ ", ",
725
+ B($)
726
+ ]
727
+ })]
728
+ }), W.slice(0, 3).map(([e, t]) => /* @__PURE__ */ h("div", {
729
+ className: "jsbo1i6",
730
+ children: [/* @__PURE__ */ m("span", {
731
+ className: "jsbo1i11",
732
+ children: V(e)
733
+ }), Array.isArray(t) ? /* @__PURE__ */ m(G, {
734
+ items: t,
735
+ textSizeClass: "jsbo1i3"
736
+ }) : /* @__PURE__ */ m("span", {
737
+ className: "jsbo1i1x",
738
+ children: H(t)
739
+ })]
740
+ }, e))]
741
+ }),
742
+ /* @__PURE__ */ m("div", { className: "jsbo1i2l" }),
743
+ /* @__PURE__ */ h("div", {
744
+ className: "jsbo1i6",
745
+ children: [/* @__PURE__ */ m("span", {
746
+ className: "jsbo1i20",
747
+ children: J ? "Total" : "Amount Paid"
748
+ }), /* @__PURE__ */ m("span", {
749
+ className: "jsbo1i2n",
750
+ children: J ? "Free" : R(o.total_amount, o.currency)
751
+ })]
752
+ }),
753
+ (() => {
754
+ let e = L?.invoice?.location || o.invoice?.location;
755
+ return e ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", { className: "jsbo1i2l" }), /* @__PURE__ */ h("a", {
756
+ href: e,
757
+ target: "_blank",
758
+ rel: "noopener noreferrer",
759
+ className: "jsbo1i2o",
760
+ children: [/* @__PURE__ */ m(b, { size: 16 }), "Download Invoice"]
761
+ })] }) : null;
762
+ })()
763
+ ]
764
+ })
765
+ ]
766
+ }),
767
+ l && /* @__PURE__ */ m("div", {
768
+ className: "jsbo1i2p",
769
+ children: /* @__PURE__ */ m(n, {
770
+ type: "button",
771
+ size: "lg",
772
+ onClick: l,
773
+ className: "jsbo1i1d",
774
+ children: "Done"
775
+ })
776
+ }),
777
+ /* @__PURE__ */ m("p", {
778
+ className: "jsbo1i2q",
779
+ children: "A confirmation has been sent to your email"
780
+ })
781
+ ]
782
+ })]
783
+ })
784
+ ]
785
+ }),
786
+ F && c && /* @__PURE__ */ m("div", {
787
+ className: "jsbo1i2r",
788
+ children: /* @__PURE__ */ m("div", {
789
+ className: "jsbo1i2s",
790
+ children: /* @__PURE__ */ m(i, {
791
+ isEdit: !0,
792
+ prefillData: s || o.billing_details,
793
+ onSubmit: (e) => {
794
+ c(e), I(!1);
795
+ },
796
+ onClose: () => I(!1)
797
+ })
798
+ })
799
+ }),
800
+ A.element
801
+ ] });
802
+ };
803
+ function q(e) {
804
+ return !e;
805
+ }
806
+ function J(e, t) {
807
+ return /* @__PURE__ */ h("li", {
808
+ className: U,
809
+ children: [/* @__PURE__ */ m("span", { className: W }), /* @__PURE__ */ m("span", {
810
+ className: B,
811
+ children: String(e ?? "-")
812
+ })]
813
+ }, t);
814
+ }
815
+ //#endregion
816
+ export { K as BookingCard };