@levo-so/studio 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 (70) hide show
  1. package/BillingStep-ioR7mSo5.js +249 -0
  2. package/BookingCard-DEkBXh7O.js +646 -0
  3. package/DateTimeWidget-B-dajfHj.js +253 -0
  4. package/{EntryCard-NCSYl-4A.js → EntryCard-CZfljZAY.js} +4 -4
  5. package/{KBChatWidget-D39Z3HIl.js → KBChatWidget-BXRRgelS.js} +1 -1
  6. package/{LoginCard-BC05UxFH.js → LoginCard-BVjeN1J0.js} +3 -3
  7. package/{LoginForm-kI_b_7Tc.js → LoginForm-DQVwLQCx.js} +19 -19
  8. package/{LoginModal-C-9BhmoO.js → LoginModal-C6TdAh-0.js} +5 -6
  9. package/{MessageCard-Nsxr98n6.js → MessageCard-B5MbVDJ8.js} +2 -2
  10. package/{MessageFooter-K4Zd_eFO.js → MessageFooter-DrlKXE9a.js} +1 -2
  11. package/{PendingApprovalCard-B7sm8CZ_.js → PendingApprovalCard-5iFAeE1s.js} +3 -3
  12. package/{PhoneWidget-BkzFjfKW.js → PhoneWidget-B4KHlFjT.js} +11 -12
  13. package/{Popover-Iis-qOn1.js → Popover-y8XkbYNh.js} +7 -7
  14. package/{PopupBody-BI-MJqmd-C9i44N2h.js → PopupBody-DWM55Zh5-DuOPsCAn.js} +53 -55
  15. package/PopupDialog-DwAAJ8JS-9xm5jrXW.js +261 -0
  16. package/PopupRenderer-BVtV4b9I-BdPryfLY.js +208 -0
  17. package/{ProfileCard-DM1Jspj_.js → ProfileCard-WgFT-T4U.js} +5 -5
  18. package/{RichTextWidget-C3Y-0pNy.js → RichTextWidget-DKYm1cSW.js} +120 -123
  19. package/{Spinner-D5spB_Mv.js → Spinner-LdYfm4S7.js} +1 -1
  20. package/{VerifyButton-BwTbzSwS.js → VerifyButton-CNq78zG4.js} +5 -7
  21. package/collection.d.ts +9 -1
  22. package/collection.js +1 -1
  23. package/dialog-CU5nHKc5.js +119 -0
  24. package/dist-IMRD6dob.js +3858 -0
  25. package/index.d.ts +46 -55
  26. package/index.js +3630 -3243
  27. package/{inlineRteTheme-BOAno9MG.js → inlineRteTheme-DFg69bqP.js} +50 -37
  28. package/{kbChat-zXbn56Zb.js → kbChat-eFsau7hG.js} +2 -2
  29. package/package.json +42 -42
  30. package/{pillChrome-QDjBETmP.js → pillChrome-Dy3ApFI5.js} +5 -5
  31. package/price-BUDkN5Me.js +823 -0
  32. package/script.esm-uVCZU25S.js +62 -0
  33. package/studio.css +1 -1
  34. package/themeMapping-DH_NoXK8-H-EHXbBt.js +156 -0
  35. package/useCheckout-gscmzFLD.js +179 -0
  36. package/useLogin-BYVekOp9.js +237 -0
  37. package/AuthProvider-B5NfFwbG.js +0 -118
  38. package/BillingStep-Cskl5Sbc.js +0 -181
  39. package/Button-D6OAkNtW.js +0 -504
  40. package/CollectionField-BZmxRB5D.js +0 -270
  41. package/CollectionInput-DyNbxIZ8.js +0 -147
  42. package/DateTimeWidget-Bt1UcCnx.js +0 -255
  43. package/Dialog-CPE8yUqK.js +0 -130
  44. package/ModalManager-CzH36UIk.js +0 -32
  45. package/PopupRenderer-D66Gx63H-dYKKhHdA.js +0 -389
  46. package/RteThemeProvider-owl5oajj.js +0 -20
  47. package/StripePaymentModal-C3bQ0jQi.js +0 -56
  48. package/ThemeProvider-CqPHzkW9.js +0 -116
  49. package/Tooltip-DHU1QD-n.js +0 -67
  50. package/authentication-BXQbxiPP.js +0 -36
  51. package/bookingCard-CY0SAnVm.js +0 -637
  52. package/createThemeExtension-C0PSYy0J.js +0 -15
  53. package/dialog-8LH_ihs4.js +0 -92
  54. package/dist-Dq-z9c3T.js +0 -3679
  55. package/generateRadiusScale-RROt8ppa.js +0 -71
  56. package/inlineCollectionTheme-uhBXoF1F.js +0 -19
  57. package/popupState-JmpeKzgM-UECLsSbL.js +0 -100
  58. package/rteTheme.cssm-W4gTOijw.js +0 -4
  59. package/theme.cssm-Czj9sF4X.js +0 -4
  60. package/themeMapping-Bi9Rcr5G-C7UXWE6o.js +0 -61
  61. package/useLogin-CfnGrLdO.js +0 -127
  62. package/usePopupRedirect-CAAdcpaW-DdME0F7f.js +0 -82
  63. /package/{Beams-WJN38XSv.js → Beams-KsU_ixpY.js} +0 -0
  64. /package/{Dots-DggLz5I7.js → Dots-C_ja_PPu.js} +0 -0
  65. /package/{Gradient-BSWJAu0a.js → Gradient-CDGFLaA-.js} +0 -0
  66. /package/{Grid-BFKl0MUt.js → Grid-C22rTkrs.js} +0 -0
  67. /package/{Waves-BPEgTYoO.js → Waves-Cl5rKcFJ.js} +0 -0
  68. /package/{card-5ooLmYSr.js → card-BIebVDA0.js} +0 -0
  69. /package/{cn-B6c1DjO_.js → cn-CzJDhklM.js} +0 -0
  70. /package/{fontSize-B-ba6pvx.js → fontSize-DowUyWe-.js} +0 -0
@@ -1,637 +0,0 @@
1
- "use client";
2
- import { t as e } from "./Button-D6OAkNtW.js";
3
- import { n as t } from "./AuthProvider-B5NfFwbG.js";
4
- import { t as n } from "./cn-B6c1DjO_.js";
5
- import { n as r, t as i } from "./StripePaymentModal-C3bQ0jQi.js";
6
- import { BillingStep as a } from "./BillingStep-Cskl5Sbc.js";
7
- import { errorHandler as o, useLevo as s } from "@levo-so/react";
8
- import { useEffect as c, useRef as l, useState as u } from "react";
9
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
10
- import { Calendar as m, CheckCircle2 as h, Clock as g, CreditCard as ee, Download as te, Loader2 as ne, Pencil as re, RefreshCw as ie, ShieldCheck as _, Ticket as ae, XCircle as oe } from "lucide-react";
11
- import v from "dayjs";
12
- import { useRazorpay as se } from "react-razorpay";
13
- //#region src/components/bookingCard/BookingCard.tsx
14
- var y = ({ items: e, textSizeClass: t = "text-sm" }) => {
15
- let [r, i] = u(!1), a = l(null);
16
- if (c(() => {
17
- if (!r) return;
18
- let e = (e) => {
19
- a.current && !a.current.contains(e.target) && i(!1);
20
- };
21
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
22
- }, [r]), e.length === 0) return /* @__PURE__ */ f("span", {
23
- className: n("text-gray-900", t),
24
- children: "-"
25
- });
26
- let o = String(e[0] ?? "-"), s = e.length - 1;
27
- return /* @__PURE__ */ p("div", {
28
- ref: a,
29
- className: "relative inline-block",
30
- onMouseEnter: () => i(!0),
31
- onMouseLeave: () => i(!1),
32
- children: [/* @__PURE__ */ p("button", {
33
- type: "button",
34
- onClick: () => i((e) => !e),
35
- className: n("cursor-pointer text-right font-medium text-gray-900 underline decoration-gray-300 decoration-dotted underline-offset-2 hover:decoration-gray-500", t),
36
- children: [o, s > 0 && /* @__PURE__ */ p("span", {
37
- className: "ml-1 font-normal text-gray-500",
38
- children: [
39
- "+",
40
- s,
41
- " more"
42
- ]
43
- })]
44
- }), r && /* @__PURE__ */ f("div", {
45
- className: "absolute right-0 z-20 mt-1.5 min-w-[200px] max-w-[280px] rounded-md border border-gray-200 bg-white p-2.5 shadow-lg",
46
- children: /* @__PURE__ */ f("ul", {
47
- className: "space-y-1.5 text-left",
48
- children: e.map((e, t) => /* @__PURE__ */ p("li", {
49
- className: "flex items-start gap-2 text-gray-700 text-xs leading-snug",
50
- children: [/* @__PURE__ */ f("span", { className: "mt-1.5 size-1 shrink-0 rounded-full bg-orange-400" }), /* @__PURE__ */ f("span", {
51
- className: "break-words",
52
- children: String(e ?? "-")
53
- })]
54
- }, t))
55
- })
56
- })]
57
- });
58
- }, b = ({ summary: c, billingDetails: b, onBillingEdit: x, onComplete: S, className: ce }) => {
59
- let C = s(), { workspace: w } = t(), { Razorpay: le } = se(), { stripePromise: ue, config: T, isOpen: E, openStripeCheckout: de, closeStripeCheckout: D, setOnComplete: fe } = r(), [O, k] = u("summary"), [A, j] = u(null), [pe, M] = u(!1), [me, N] = u(null), [he, ge] = u("razorpay"), P = l(!1), F = l(null), I = l(null), L = (e, t) => {
60
- let n = t && t.trim() ? t : "INR", r = e / 100;
61
- return new Intl.NumberFormat("en-IN", {
62
- style: "currency",
63
- currency: n,
64
- minimumFractionDigits: 0
65
- }).format(r);
66
- }, R = (e) => e ? v(e).format("D MMM YYYY") : null, z = (e) => e ? v(e).format("h:mm A") : null, B = (e) => e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (e) => e.toUpperCase()), V = (e) => e == null ? "-" : typeof e == "boolean" ? e ? "Yes" : "No" : Array.isArray(e) ? e.join(", ") : typeof e == "object" ? JSON.stringify(e) : String(e), H = () => {
67
- try {
68
- Object.keys(localStorage).forEach((e) => {
69
- e.startsWith("levo_collection_cart_") && localStorage.removeItem(e);
70
- }), window.dispatchEvent(new Event("levo_cart_updated"));
71
- } catch (e) {
72
- o(e);
73
- }
74
- }, U = Object.entries(c.form_data || {}).filter(([e, t]) => t != null && t !== ""), W = () => {
75
- if (!I.current) return;
76
- let e = I.current;
77
- C?.fetch?.url(`/v1/payment/booking/${c._id}/confirm`)?.options({ headers: { Origin: w?.id || "" } })?.post({ session_id: e })?.json().then((e) => {
78
- e?.content?.data ? (N(e.content.data), k("confirmed"), H()) : (j("Payment received but confirmation failed. Please contact support."), k("failed")), D(), I.current = null;
79
- }).catch((e) => {
80
- console.error("Failed to confirm booking after Stripe payment:", e), o(e), j("Payment received but confirmation failed. Please contact support."), D(), I.current = null, k("failed");
81
- });
82
- }, G = async () => {
83
- k("processing"), j(null);
84
- try {
85
- let e = b || c.billing_details, t = e ? { billing_details: e } : {}, n = await C?.fetch?.url(`/v1/payment/booking/${c._id}/pay`)?.options({ headers: { Origin: w?.id || "" } })?.post(t).json();
86
- if (n?.status && n?.content?.meta?.key) {
87
- let e = n.content.meta;
88
- ge(e.provider || "razorpay"), e.provider === "stripe" && e.client_secret ? (I.current = e.session_id || null, fe(W), await de({
89
- key: e.key,
90
- client_secret: e.client_secret,
91
- amount: e.amount,
92
- currency: e.currency,
93
- provider: "stripe",
94
- reference_id: e.reference_id
95
- })) : _e(e);
96
- } else j("Unable to initiate payment. Please try again."), k("failed");
97
- } catch (e) {
98
- console.error("Initiate payment error:", e), o(e), j("Unable to initiate payment. Please check your connection and try again."), k("failed");
99
- }
100
- }, _e = (e) => {
101
- P.current = !1, F.current = null;
102
- let t = {
103
- key: e.key,
104
- amount: e.amount,
105
- currency: e.currency,
106
- order_id: e.order_id,
107
- name: w?.name ?? "",
108
- description: X || "Booking Payment",
109
- handler: (e) => {
110
- ve({
111
- order_id: e.razorpay_order_id,
112
- payment_id: e.razorpay_payment_id,
113
- signature: e.razorpay_signature
114
- });
115
- },
116
- theme: { color: "#FC751A" }
117
- };
118
- t.modal = { ondismiss: () => {
119
- P.current ? (j(F.current || "Payment failed. Please try again."), k("failed")) : k("summary");
120
- } };
121
- let n = new le(t);
122
- n.on("payment.failed", () => {
123
- P.current = !0, F.current = "Payment was declined. Please try a different payment method.";
124
- }), n.open();
125
- }, ve = async (e) => {
126
- try {
127
- let t = await C?.fetch?.url(`/v1/payment/booking/${c._id}/confirm`)?.options({ headers: { Origin: w?.id || "" } })?.post(e).json();
128
- t?.status && t?.content?.data ? (N(t.content.data), k("confirmed"), H()) : (j("Payment received but confirmation failed. Please contact support."), k("failed"));
129
- } catch (e) {
130
- console.error("Confirm payment error:", e), o(e), j("Payment received but confirmation failed. Please contact support."), k("failed");
131
- }
132
- }, K = !c.total_amount || c.total_amount === 0, q = c.line_items || [], J = q[0], Y = q.length > 1, X = Y ? c.context_label || "Booking" : J?.instance_label || c.context_label || "Booking", Z = J?.cover_image?.location || null, Q = J?.starts_at || null, $ = J?.ends_at || null;
133
- return /* @__PURE__ */ p(d, { children: [
134
- /* @__PURE__ */ p("div", {
135
- className: n("overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm", ce),
136
- children: [
137
- O === "summary" && /* @__PURE__ */ p("div", {
138
- className: "flex flex-col",
139
- children: [Z && /* @__PURE__ */ p("div", {
140
- className: "relative h-44 w-full overflow-hidden bg-gray-100",
141
- children: [/* @__PURE__ */ f("img", {
142
- src: Z,
143
- alt: X,
144
- className: "h-full w-full object-cover"
145
- }), /* @__PURE__ */ f("div", { className: "absolute inset-0 bg-gradient-to-t from-black/30 to-transparent" })]
146
- }), /* @__PURE__ */ p("div", {
147
- className: "flex flex-col px-6 py-5 sm:px-8",
148
- children: [
149
- /* @__PURE__ */ p("div", {
150
- className: "mx-auto mb-5 w-full max-w-lg text-center",
151
- children: [/* @__PURE__ */ f("p", {
152
- className: "mb-1 font-medium text-gray-500 text-xs uppercase tracking-wider",
153
- children: "Booking Summary"
154
- }), /* @__PURE__ */ f("h3", {
155
- className: "font-semibold text-gray-900 text-xl leading-tight",
156
- children: X
157
- })]
158
- }),
159
- !Y && (Q || $) && /* @__PURE__ */ p("div", {
160
- className: "mx-auto mb-5 flex w-full max-w-lg flex-wrap justify-center gap-4 rounded-lg bg-orange-50 px-4 py-3",
161
- children: [Q && /* @__PURE__ */ p("div", {
162
- className: "flex items-center gap-2 text-gray-700 text-sm",
163
- children: [/* @__PURE__ */ f(m, { className: "size-4 text-orange-500" }), /* @__PURE__ */ f("span", { children: R(Q) })]
164
- }), Q && /* @__PURE__ */ p("div", {
165
- className: "flex items-center gap-2 text-gray-700 text-sm",
166
- children: [/* @__PURE__ */ f(g, { className: "size-4 text-orange-500" }), /* @__PURE__ */ f("span", { children: z(Q) })]
167
- })]
168
- }),
169
- U.length > 0 && /* @__PURE__ */ p("div", {
170
- className: "mx-auto mb-5 w-full max-w-lg",
171
- children: [/* @__PURE__ */ f("h4", {
172
- className: "mb-3 text-center font-medium text-gray-500 text-xs uppercase tracking-wider",
173
- children: "Your Details"
174
- }), /* @__PURE__ */ f("div", {
175
- className: "rounded-lg border border-gray-100 bg-gray-50/50 p-4",
176
- children: /* @__PURE__ */ f("div", {
177
- className: "space-y-2.5",
178
- children: U.map(([e, t]) => /* @__PURE__ */ p("div", {
179
- className: "flex items-start justify-between gap-3",
180
- children: [/* @__PURE__ */ f("span", {
181
- className: "text-gray-500 text-sm",
182
- children: B(e)
183
- }), Array.isArray(t) ? /* @__PURE__ */ f(y, {
184
- items: t,
185
- textSizeClass: "text-sm"
186
- }) : /* @__PURE__ */ f("span", {
187
- className: "text-right font-medium text-gray-900 text-sm",
188
- children: V(t)
189
- })]
190
- }, e))
191
- })
192
- })]
193
- }),
194
- (() => {
195
- let e = b || c.billing_details;
196
- return e ? /* @__PURE__ */ p("div", {
197
- className: "mx-auto mb-5 w-full max-w-lg",
198
- children: [/* @__PURE__ */ p("div", {
199
- className: "mb-3 flex items-center justify-center gap-2",
200
- children: [/* @__PURE__ */ f("h4", {
201
- className: "text-center font-medium text-gray-500 text-xs uppercase tracking-wider",
202
- children: "Billing Details"
203
- }), x && /* @__PURE__ */ f("button", {
204
- type: "button",
205
- onClick: () => M(!0),
206
- className: "text-orange-500 hover:text-orange-600",
207
- children: /* @__PURE__ */ f(re, { className: "size-3.5" })
208
- })]
209
- }), /* @__PURE__ */ f("div", {
210
- className: "rounded-lg border border-gray-100 bg-gray-50/50 p-4",
211
- children: /* @__PURE__ */ p("div", {
212
- className: "space-y-2.5",
213
- children: [
214
- /* @__PURE__ */ p("div", {
215
- className: "flex items-start justify-between gap-3",
216
- children: [/* @__PURE__ */ f("span", {
217
- className: "text-gray-500 text-sm",
218
- children: "Name"
219
- }), /* @__PURE__ */ f("span", {
220
- className: "text-right font-medium text-gray-900 text-sm",
221
- children: e.name
222
- })]
223
- }),
224
- e.tax_id && /* @__PURE__ */ p("div", {
225
- className: "flex items-start justify-between gap-3",
226
- children: [/* @__PURE__ */ f("span", {
227
- className: "text-gray-500 text-sm",
228
- children: "Tax ID"
229
- }), /* @__PURE__ */ f("span", {
230
- className: "text-right font-medium text-gray-900 text-sm",
231
- children: e.tax_id
232
- })]
233
- }),
234
- /* @__PURE__ */ p("div", {
235
- className: "flex items-start justify-between gap-3",
236
- children: [/* @__PURE__ */ f("span", {
237
- className: "text-gray-500 text-sm",
238
- children: "Address"
239
- }), /* @__PURE__ */ f("span", {
240
- className: "text-right font-medium text-gray-900 text-sm",
241
- children: [
242
- e.address.line1,
243
- e.address.line2,
244
- e.address.city,
245
- e.address.state,
246
- e.address.postal_code,
247
- e.address.country
248
- ].filter(Boolean).join(", ")
249
- })]
250
- })
251
- ]
252
- })
253
- })]
254
- }) : null;
255
- })(),
256
- /* @__PURE__ */ p("div", {
257
- className: "mx-auto mb-5 w-full max-w-lg",
258
- children: [/* @__PURE__ */ f("h4", {
259
- className: "mb-3 text-center font-medium text-gray-500 text-xs uppercase tracking-wider",
260
- children: "Payment"
261
- }), /* @__PURE__ */ p("div", {
262
- className: "rounded-lg border border-gray-200 bg-white p-4",
263
- children: [/* @__PURE__ */ p("div", {
264
- className: "space-y-2",
265
- children: [
266
- q.map((e) => /* @__PURE__ */ p("div", {
267
- className: "flex items-start justify-between gap-3 text-sm",
268
- children: [/* @__PURE__ */ p("span", {
269
- className: "min-w-0 flex-1 text-gray-600",
270
- children: [/* @__PURE__ */ f("span", {
271
- className: "break-words",
272
- children: e.instance_label
273
- }), e.quantity > 1 && /* @__PURE__ */ p("span", {
274
- className: "ml-1 text-gray-400",
275
- children: ["×", e.quantity]
276
- })]
277
- }), /* @__PURE__ */ f("span", {
278
- className: "shrink-0 text-gray-900",
279
- children: L(e.line_subtotal, c.currency)
280
- })]
281
- }, e.resource_instance)),
282
- typeof c.discount == "number" && c.discount > 0 && /* @__PURE__ */ p("div", {
283
- className: "flex items-center justify-between text-sm",
284
- children: [/* @__PURE__ */ f("span", {
285
- className: "text-gray-600",
286
- children: "Discount"
287
- }), /* @__PURE__ */ p("span", {
288
- className: "text-green-600",
289
- children: ["-", L(c.discount, c.currency)]
290
- })]
291
- }),
292
- c.taxes && c.taxes.length > 0 && c.taxes.map((e) => /* @__PURE__ */ p("div", {
293
- className: "flex items-center justify-between text-sm",
294
- children: [/* @__PURE__ */ f("span", {
295
- className: "text-gray-600",
296
- children: e.label
297
- }), /* @__PURE__ */ f("span", {
298
- className: "text-gray-900",
299
- children: L(e.amount, c.currency)
300
- })]
301
- }, e.id))
302
- ]
303
- }), /* @__PURE__ */ p("div", {
304
- className: "mt-3 flex items-center justify-between border-gray-100 border-t pt-3",
305
- children: [/* @__PURE__ */ f("span", {
306
- className: "font-medium text-gray-900",
307
- children: "Total"
308
- }), /* @__PURE__ */ f("span", {
309
- className: "font-bold text-gray-900 text-xl",
310
- children: K ? "Free" : L(c.total_amount, c.currency)
311
- })]
312
- })]
313
- })]
314
- }),
315
- /* @__PURE__ */ f(e, {
316
- elementKey: "booking-pay-btn",
317
- onClick: K ? () => {
318
- k("confirmed"), H();
319
- } : G,
320
- className: "mx-auto w-full max-w-lg rounded-lg px-4 py-3.5 font-semibold",
321
- children: /* @__PURE__ */ f("span", {
322
- className: "flex items-center justify-center gap-2",
323
- children: K ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(h, { className: "size-5" }), /* @__PURE__ */ f("span", { children: "Confirm Booking" })] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(ee, { className: "size-5" }), /* @__PURE__ */ p("span", { children: ["Pay ", L(c.total_amount, c.currency)] })] })
324
- })
325
- }),
326
- !K && /* @__PURE__ */ p("div", {
327
- className: "mx-auto mt-4 flex w-full max-w-lg items-center justify-center gap-1.5 text-gray-400 text-xs",
328
- children: [/* @__PURE__ */ f(_, { className: "size-3.5" }), /* @__PURE__ */ f("span", { children: "Secure payment" })]
329
- })
330
- ]
331
- })]
332
- }),
333
- O === "processing" && /* @__PURE__ */ p("div", {
334
- className: "flex flex-col items-center justify-center px-6 py-16",
335
- children: [
336
- /* @__PURE__ */ p("div", {
337
- className: "relative mb-6",
338
- children: [/* @__PURE__ */ f("div", { className: "absolute inset-0 animate-ping rounded-full bg-orange-200 opacity-75" }), /* @__PURE__ */ f("div", {
339
- className: "relative flex size-16 items-center justify-center rounded-full bg-orange-100",
340
- children: /* @__PURE__ */ f(ne, { className: "size-8 animate-spin text-orange-500" })
341
- })]
342
- }),
343
- /* @__PURE__ */ f("h3", {
344
- className: "mb-1 font-semibold text-gray-900 text-lg",
345
- children: "Processing Payment"
346
- }),
347
- /* @__PURE__ */ f("p", {
348
- className: "text-center text-gray-500 text-sm",
349
- children: "Please wait while we confirm your payment..."
350
- }),
351
- /* @__PURE__ */ f("div", {
352
- className: "mt-6 rounded-lg bg-gray-50 px-6 py-3",
353
- children: /* @__PURE__ */ p("p", {
354
- className: "text-center text-gray-600 text-sm",
355
- children: [
356
- "Amount:",
357
- " ",
358
- /* @__PURE__ */ f("span", {
359
- className: "font-semibold text-gray-900",
360
- children: L(c.total_amount, c.currency)
361
- })
362
- ]
363
- })
364
- })
365
- ]
366
- }),
367
- O === "failed" && /* @__PURE__ */ p("div", {
368
- className: "flex flex-col",
369
- children: [/* @__PURE__ */ f("div", {
370
- className: "bg-gradient-to-br from-red-50 to-orange-50 px-6 py-6",
371
- children: /* @__PURE__ */ p("div", {
372
- className: "flex flex-col items-center",
373
- children: [
374
- /* @__PURE__ */ f("div", {
375
- className: "mb-3 flex size-14 items-center justify-center rounded-full bg-red-100",
376
- children: /* @__PURE__ */ f(oe, { className: "size-8 text-red-500" })
377
- }),
378
- /* @__PURE__ */ f("h3", {
379
- className: "mb-1 font-semibold text-gray-900 text-lg",
380
- children: "Payment Failed"
381
- }),
382
- /* @__PURE__ */ f("p", {
383
- className: "text-center text-gray-600 text-sm",
384
- children: A || "Something went wrong. Please try again."
385
- })
386
- ]
387
- })
388
- }), /* @__PURE__ */ p("div", {
389
- className: "flex flex-col px-6 py-5 sm:px-8",
390
- children: [
391
- /* @__PURE__ */ f("div", {
392
- className: "mx-auto mb-4 w-full max-w-lg text-center",
393
- children: /* @__PURE__ */ f("h4", {
394
- className: "font-semibold text-base text-gray-900",
395
- children: X
396
- })
397
- }),
398
- !Y && (Q || $) && /* @__PURE__ */ p("div", {
399
- className: "mx-auto mb-4 flex w-full max-w-lg flex-wrap justify-center gap-4 rounded-lg bg-gray-50 px-4 py-2.5",
400
- children: [Q && /* @__PURE__ */ p("div", {
401
- className: "flex items-center gap-2 text-gray-600 text-sm",
402
- children: [/* @__PURE__ */ f(m, { className: "size-4 text-gray-400" }), /* @__PURE__ */ f("span", { children: R(Q) })]
403
- }), Q && /* @__PURE__ */ p("div", {
404
- className: "flex items-center gap-2 text-gray-600 text-sm",
405
- children: [/* @__PURE__ */ f(g, { className: "size-4 text-gray-400" }), /* @__PURE__ */ f("span", { children: z(Q) })]
406
- })]
407
- }),
408
- U.length > 0 && /* @__PURE__ */ f("div", {
409
- className: "mx-auto mb-4 w-full max-w-lg rounded-lg border border-gray-100 bg-gray-50/50 p-3",
410
- children: /* @__PURE__ */ p("div", {
411
- className: "space-y-1.5",
412
- children: [U.slice(0, 3).map(([e, t]) => /* @__PURE__ */ p("div", {
413
- className: "flex items-center justify-between gap-3 text-sm",
414
- children: [/* @__PURE__ */ f("span", {
415
- className: "text-gray-500",
416
- children: B(e)
417
- }), Array.isArray(t) ? /* @__PURE__ */ f(y, {
418
- items: t,
419
- textSizeClass: "text-sm"
420
- }) : /* @__PURE__ */ f("span", {
421
- className: "max-w-[50%] truncate font-medium text-gray-900",
422
- children: V(t)
423
- })]
424
- }, e)), U.length > 3 && /* @__PURE__ */ p("p", {
425
- className: "pt-1 text-center text-gray-400 text-xs",
426
- children: [
427
- "+",
428
- U.length - 3,
429
- " more"
430
- ]
431
- })]
432
- })
433
- }),
434
- /* @__PURE__ */ f("div", {
435
- className: "mx-auto mb-5 w-full max-w-lg rounded-lg border border-gray-200 bg-white p-4",
436
- children: /* @__PURE__ */ p("div", {
437
- className: "flex items-center justify-between",
438
- children: [/* @__PURE__ */ f("span", {
439
- className: "font-medium text-gray-700",
440
- children: "Amount to Pay"
441
- }), /* @__PURE__ */ f("span", {
442
- className: "font-bold text-gray-900 text-xl",
443
- children: L(c.total_amount, c.currency)
444
- })]
445
- })
446
- }),
447
- /* @__PURE__ */ f(e, {
448
- elementKey: "booking-retry-btn",
449
- onClick: () => {
450
- j(null), G();
451
- },
452
- className: "mx-auto w-full max-w-lg rounded-lg px-4 py-3.5 font-semibold",
453
- children: /* @__PURE__ */ p("span", {
454
- className: "flex items-center justify-center gap-2",
455
- children: [/* @__PURE__ */ f(ie, { className: "size-5" }), /* @__PURE__ */ f("span", { children: "Try Again" })]
456
- })
457
- }),
458
- /* @__PURE__ */ p("div", {
459
- className: "mx-auto mt-4 flex w-full max-w-lg items-center justify-center gap-1.5 text-gray-400 text-xs",
460
- children: [/* @__PURE__ */ f(_, { className: "size-3.5" }), /* @__PURE__ */ p("span", { children: ["Secured by ", he === "stripe" ? "Stripe" : "Razorpay"] })]
461
- }),
462
- /* @__PURE__ */ f("p", {
463
- className: "mx-auto mt-3 w-full max-w-lg text-center text-gray-400 text-xs",
464
- children: "If the problem persists, please contact support"
465
- })
466
- ]
467
- })]
468
- }),
469
- O === "confirmed" && /* @__PURE__ */ p("div", {
470
- className: "flex flex-col",
471
- children: [/* @__PURE__ */ f("div", {
472
- className: "bg-gradient-to-br from-green-50 to-emerald-50 px-6 py-8",
473
- children: /* @__PURE__ */ p("div", {
474
- className: "flex flex-col items-center",
475
- children: [
476
- /* @__PURE__ */ p("div", {
477
- className: "relative mb-4",
478
- children: [/* @__PURE__ */ f("div", { className: "absolute -inset-2 animate-pulse rounded-full bg-green-200/50" }), /* @__PURE__ */ f("div", {
479
- className: "relative flex size-16 items-center justify-center rounded-full bg-green-100 ring-4 ring-green-50",
480
- children: /* @__PURE__ */ f(h, { className: "size-9 text-green-600" })
481
- })]
482
- }),
483
- /* @__PURE__ */ f("h3", {
484
- className: "mb-1 font-bold text-gray-900 text-xl",
485
- children: K ? "Booking Confirmed!" : "Payment Successful!"
486
- }),
487
- /* @__PURE__ */ f("p", {
488
- className: "text-center text-gray-600 text-sm",
489
- children: K ? "Your booking has been confirmed" : "Your payment has been processed successfully"
490
- })
491
- ]
492
- })
493
- }), /* @__PURE__ */ p("div", {
494
- className: "px-6 py-5 sm:px-8",
495
- children: [
496
- /* @__PURE__ */ p("div", {
497
- className: "relative mx-auto max-w-lg overflow-hidden rounded-xl border border-gray-200 bg-white",
498
- children: [
499
- /* @__PURE__ */ f("div", { className: "absolute top-1/2 -left-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
500
- /* @__PURE__ */ f("div", { className: "absolute top-1/2 -right-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
501
- /* @__PURE__ */ p("div", {
502
- className: "px-5 py-4",
503
- children: [
504
- /* @__PURE__ */ p("div", {
505
- className: "mb-4 flex items-start gap-3",
506
- children: [/* @__PURE__ */ f("div", {
507
- className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-orange-100",
508
- children: /* @__PURE__ */ f(ae, { className: "size-5 text-orange-600" })
509
- }), /* @__PURE__ */ f("div", {
510
- className: "min-w-0 flex-1",
511
- children: /* @__PURE__ */ f("p", {
512
- className: "font-semibold text-gray-900 leading-tight",
513
- children: X
514
- })
515
- })]
516
- }),
517
- c.qr_image?.location && /* @__PURE__ */ f("div", {
518
- className: "mb-4 flex flex-col items-center",
519
- children: /* @__PURE__ */ f("div", {
520
- className: "rounded-lg border border-gray-200 bg-white p-2",
521
- children: /* @__PURE__ */ f("img", {
522
- src: c.qr_image.location,
523
- alt: "Booking QR Code",
524
- className: "size-24"
525
- })
526
- })
527
- }),
528
- /* @__PURE__ */ p("div", {
529
- className: "mb-4 flex items-center justify-between rounded-lg bg-gray-50 px-3 py-2.5",
530
- children: [/* @__PURE__ */ f("span", {
531
- className: "font-medium text-gray-500 text-xs uppercase tracking-wide",
532
- children: "Booking ID"
533
- }), /* @__PURE__ */ f("span", {
534
- className: "font-mono font-semibold text-gray-900 text-sm",
535
- children: c._id
536
- })]
537
- }),
538
- /* @__PURE__ */ f("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
539
- /* @__PURE__ */ p("div", {
540
- className: "space-y-2.5",
541
- children: [!Y && Q && /* @__PURE__ */ p("div", {
542
- className: "flex items-center justify-between",
543
- children: [/* @__PURE__ */ p("div", {
544
- className: "flex items-center gap-2 text-gray-500 text-sm",
545
- children: [/* @__PURE__ */ f(m, { className: "size-4" }), /* @__PURE__ */ f("span", { children: "Date & Time" })]
546
- }), /* @__PURE__ */ p("p", {
547
- className: "font-medium text-gray-900 text-sm",
548
- children: [
549
- R(Q),
550
- ", ",
551
- z(Q)
552
- ]
553
- })]
554
- }), U.slice(0, 3).map(([e, t]) => /* @__PURE__ */ p("div", {
555
- className: "flex items-center justify-between",
556
- children: [/* @__PURE__ */ f("span", {
557
- className: "text-gray-500 text-sm",
558
- children: B(e)
559
- }), Array.isArray(t) ? /* @__PURE__ */ f(y, {
560
- items: t,
561
- textSizeClass: "text-sm"
562
- }) : /* @__PURE__ */ f("span", {
563
- className: "max-w-[50%] truncate font-medium text-gray-900 text-sm",
564
- children: V(t)
565
- })]
566
- }, e))]
567
- }),
568
- /* @__PURE__ */ f("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
569
- /* @__PURE__ */ p("div", {
570
- className: "flex items-center justify-between",
571
- children: [/* @__PURE__ */ f("span", {
572
- className: "font-medium text-gray-700",
573
- children: K ? "Total" : "Amount Paid"
574
- }), /* @__PURE__ */ f("span", {
575
- className: "font-bold text-gray-900 text-lg",
576
- children: K ? "Free" : L(c.total_amount, c.currency)
577
- })]
578
- }),
579
- (() => {
580
- let e = me?.invoice?.location || c.invoice?.location;
581
- return e ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", { className: "my-4 border-gray-200 border-t border-dashed" }), /* @__PURE__ */ p("a", {
582
- href: e,
583
- target: "_blank",
584
- rel: "noopener noreferrer",
585
- className: "flex w-full items-center justify-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-2.5 font-medium text-gray-700 text-sm transition-colors hover:bg-gray-100",
586
- children: [/* @__PURE__ */ f(te, { className: "size-4" }), "Download Invoice"]
587
- })] }) : null;
588
- })()
589
- ]
590
- })
591
- ]
592
- }),
593
- S && /* @__PURE__ */ f("div", {
594
- className: "mx-auto mt-5 max-w-lg",
595
- children: /* @__PURE__ */ f(e, {
596
- elementKey: "booking-done-btn",
597
- onClick: S,
598
- className: "flex w-full items-center justify-center gap-2 rounded-lg bg-gray-900 px-4 py-3.5 font-semibold text-white transition-colors hover:bg-gray-800",
599
- children: "Done"
600
- })
601
- }),
602
- /* @__PURE__ */ f("p", {
603
- className: "mt-4 text-center text-gray-400 text-xs",
604
- children: "A confirmation has been sent to your email"
605
- })
606
- ]
607
- })]
608
- })
609
- ]
610
- }),
611
- pe && x && /* @__PURE__ */ f("div", {
612
- className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
613
- children: /* @__PURE__ */ f("div", {
614
- className: "max-h-[90vh] w-full max-w-lg overflow-auto rounded-xl bg-white shadow-xl",
615
- children: /* @__PURE__ */ f(a, {
616
- isEdit: !0,
617
- prefillData: b || c.billing_details,
618
- onSubmit: (e) => {
619
- x(e), M(!1);
620
- },
621
- onClose: () => M(!1)
622
- })
623
- })
624
- }),
625
- E && T && /* @__PURE__ */ f(i, {
626
- isOpen: E,
627
- onClose: () => {
628
- D(), k("summary");
629
- },
630
- stripePromise: ue,
631
- clientSecret: T.clientSecret,
632
- onComplete: W
633
- })
634
- ] });
635
- };
636
- //#endregion
637
- export { b as BookingCard };
@@ -1,15 +0,0 @@
1
- import { assignInlineVars as e } from "@vanilla-extract/dynamic";
2
- //#region ../../libraries/levocn/dist/theme/utils/createThemeExtension.js
3
- var t = (e, n) => {
4
- let r = {};
5
- for (let i of Object.keys(n)) {
6
- let a = n[i], o = e[i];
7
- if (!(a === void 0 || o === void 0)) if (typeof a == "object" && a && !Array.isArray(a)) {
8
- let e = t(o, a);
9
- Object.assign(r, e);
10
- } else typeof o == "string" && (r[o] = String(a));
11
- }
12
- return r;
13
- }, n = (n) => (r) => r ? e(t(n, r)) : {};
14
- //#endregion
15
- export { n as t };