@levo-so/studio 0.1.64 → 0.1.66
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/{Beams-I4aWHPVY.js → Beams-nmNmDhrm.js} +1 -1
- package/dist/BillingStep-CUrykLb4.js +203 -0
- package/dist/{Dots-CUmk_uHm.js → Dots-dNvykqVn.js} +1 -1
- package/dist/{Gradient-ClJiEr54.js → Gradient-Ciw_vJDx.js} +1 -1
- package/dist/{Grid-BgVIobRt.js → Grid-BqYjfOaX.js} +1 -1
- package/dist/{MessageCard-CiE4ZR7i.js → MessageCard-B4szjq4V.js} +1 -1
- package/dist/{Waves-B8-qCWtJ.js → Waves-BJBLHT4h.js} +1 -1
- package/dist/components/LoginForm/GoogleOAuth.d.ts.map +1 -1
- package/dist/components/bookingCard/BillingStep.d.ts +35 -0
- package/dist/components/bookingCard/BillingStep.d.ts.map +1 -0
- package/dist/components/bookingCard/BookingCard.d.ts +20 -0
- package/dist/components/bookingCard/BookingCard.d.ts.map +1 -1
- package/dist/components/bookingCard/index.d.ts +1 -0
- package/dist/components/bookingCard/index.d.ts.map +1 -1
- package/dist/components/bookingModal/BookingConfirmation.d.ts +4 -0
- package/dist/components/bookingModal/BookingConfirmation.d.ts.map +1 -1
- package/dist/components/bookingModal/BookingModal.d.ts.map +1 -1
- package/dist/components/globalSearch/GlobalSearch.d.ts +7 -0
- package/dist/components/globalSearch/GlobalSearch.d.ts.map +1 -0
- package/dist/components/globalSearch/GlobalSearchDialog.d.ts +6 -0
- package/dist/components/globalSearch/GlobalSearchDialog.d.ts.map +1 -0
- package/dist/components/globalSearch/index.d.ts +2 -0
- package/dist/components/globalSearch/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/registerModal/AttendeeForm.d.ts +1 -1
- package/dist/components/registerModal/AttendeeForm.d.ts.map +1 -1
- package/dist/components/registerModal/RegisterModal.d.ts.map +1 -1
- package/dist/components/registerModal/RegistrationConfirmationModal.d.ts.map +1 -1
- package/dist/components/stripePaymentModal/StripePaymentModal.d.ts.map +1 -1
- package/dist/components/stripePaymentModal/index.d.ts +1 -1
- package/dist/components/stripePaymentModal/index.d.ts.map +1 -1
- package/dist/components/ui/base/index.d.ts +1 -0
- package/dist/components/ui/base/index.d.ts.map +1 -1
- package/dist/components/ui/base/kbd.d.ts +4 -0
- package/dist/components/ui/base/kbd.d.ts.map +1 -0
- package/dist/contentEngine/useContentEngine.d.ts.map +1 -1
- package/dist/contentEngine/useContextEngine.d.ts.map +1 -1
- package/dist/core/AccessManager/index.d.ts.map +1 -1
- package/dist/elements/Form.d.ts.map +1 -1
- package/dist/elements/Heading.d.ts.map +1 -1
- package/dist/elements/forum/categoryFilter/CategoryFilter.d.ts.map +1 -1
- package/dist/elements/forum/comments/Comment.d.ts.map +1 -1
- package/dist/elements/forum/comments/Comments.d.ts.map +1 -1
- package/dist/elements/forum/comments/ReplyBox.d.ts.map +1 -1
- package/dist/elements/forum/comments/commentUtility.d.ts.map +1 -1
- package/dist/elements/forum/createForumPost/CreateForumPost.d.ts.map +1 -1
- package/dist/elements/forum/createForumPost/CreateForumPostModal.d.ts.map +1 -1
- package/dist/elements/forum/utility/Video.d.ts.map +1 -1
- package/dist/elements/forum/utility/index.d.ts.map +1 -1
- package/dist/{elements-C0sYbYML.js → elements-BFZyX9xz.js} +1 -1
- package/dist/hooks/useLogin.d.ts.map +1 -1
- package/dist/{index-Cf4jJOnE.js → index-BxyIkcWw.js} +236 -160
- package/dist/{index-D_r8laYN.js → index-C75foZeA.js} +4523 -4229
- package/dist/{index-Ccv1uVOU.js → index-CpNa1Kv5.js} +2 -2
- package/dist/{index-DtRAKt_V.js → index-DDc-37FN.js} +2 -2
- package/dist/{index-DJS7RFvk.js → index-DWpliAOR.js} +1 -1
- package/dist/{index-BUgkYYcp.js → index-djT9Bhvi.js} +1 -1
- package/dist/{index-BqEvx8Yg.js → index-gIohjnj8.js} +152 -152
- package/dist/index.js +115 -112
- package/package.json +6 -6
|
@@ -1,69 +1,76 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as a, Fragment as
|
|
3
|
-
import { useLevo as
|
|
4
|
-
import
|
|
5
|
-
import { Calendar as
|
|
6
|
-
import { useState as
|
|
7
|
-
import { useRazorpay as
|
|
8
|
-
import { u as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { jsxs as a, Fragment as h, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useLevo as ee, cn as te, errorHandler as C } from "@levo-so/react";
|
|
4
|
+
import T from "dayjs";
|
|
5
|
+
import { Calendar as S, Clock as U, Pencil as ae, CheckCircle2 as $, CreditCard as ne, ShieldCheck as q, Loader2 as re, XCircle as se, RefreshCw as le, Ticket as ie, Download as ce } from "lucide-react";
|
|
6
|
+
import { useState as x, useRef as B } from "react";
|
|
7
|
+
import { useRazorpay as oe } from "react-razorpay";
|
|
8
|
+
import { u as de, a as me, B as D, S as ge } from "./index-C75foZeA.js";
|
|
9
|
+
import { BillingStep as xe } from "./BillingStep-CUrykLb4.js";
|
|
10
|
+
const we = ({
|
|
11
|
+
summary: n,
|
|
12
|
+
billingDetails: u,
|
|
13
|
+
onBillingEdit: y,
|
|
14
|
+
onComplete: A,
|
|
15
|
+
className: K
|
|
16
|
+
}) => {
|
|
17
|
+
const b = ee(), { workspace: f } = de(), { Razorpay: E } = oe(), {
|
|
18
|
+
stripePromise: L,
|
|
12
19
|
config: F,
|
|
13
|
-
isOpen:
|
|
14
|
-
openStripeCheckout:
|
|
15
|
-
closeStripeCheckout:
|
|
16
|
-
setOnComplete:
|
|
17
|
-
} =
|
|
18
|
-
const
|
|
20
|
+
isOpen: I,
|
|
21
|
+
openStripeCheckout: M,
|
|
22
|
+
closeStripeCheckout: N,
|
|
23
|
+
setOnComplete: Q
|
|
24
|
+
} = me(), [p, l] = x("summary"), [H, i] = x(null), [J, v] = x(!1), [V, O] = x(null), [X, Z] = x("razorpay"), w = B(!1), _ = B(null), g = B(null), c = (t, r) => {
|
|
25
|
+
const d = r && r.trim() ? r : "INR", s = t / 100;
|
|
19
26
|
return new Intl.NumberFormat("en-IN", {
|
|
20
27
|
style: "currency",
|
|
21
|
-
currency:
|
|
28
|
+
currency: d,
|
|
22
29
|
minimumFractionDigits: 0
|
|
23
|
-
}).format(
|
|
24
|
-
},
|
|
25
|
-
([
|
|
26
|
-
),
|
|
27
|
-
if (!
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
r?.content?.data ?
|
|
30
|
+
}).format(s);
|
|
31
|
+
}, j = (t) => t ? T(t).format("D MMM YYYY") : null, k = (t) => t ? T(t).format("h:mm A") : null, P = (t) => t.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (r) => r.toUpperCase()), z = (t) => t == null ? "-" : typeof t == "boolean" ? t ? "Yes" : "No" : Array.isArray(t) ? t.join(", ") : typeof t == "object" ? JSON.stringify(t) : String(t), m = Object.entries(n.form_data || {}).filter(
|
|
32
|
+
([t, r]) => r != null && r !== ""
|
|
33
|
+
), R = () => {
|
|
34
|
+
if (!g.current) return;
|
|
35
|
+
const t = g.current;
|
|
36
|
+
b?.fetch?.url(`/v1/payment/booking/${n._id}/confirm`)?.options({ headers: { Origin: f?.id || "" } })?.post({ session_id: t })?.json().then((r) => {
|
|
37
|
+
r?.content?.data ? (O(r.content.data), l("confirmed")) : (i("Payment received but confirmation failed. Please contact support."), l("failed")), N(), g.current = null;
|
|
31
38
|
}).catch((r) => {
|
|
32
|
-
console.error("Failed to confirm booking after Stripe payment:", r),
|
|
39
|
+
console.error("Failed to confirm booking after Stripe payment:", r), C(r), i("Payment received but confirmation failed. Please contact support."), N(), g.current = null, l("failed");
|
|
33
40
|
});
|
|
34
|
-
},
|
|
35
|
-
|
|
41
|
+
}, Y = async () => {
|
|
42
|
+
l("processing"), i(null);
|
|
36
43
|
try {
|
|
37
|
-
const n = await
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
key:
|
|
42
|
-
client_secret:
|
|
43
|
-
amount:
|
|
44
|
-
currency:
|
|
44
|
+
const t = u || n.billing_details, r = t ? { billing_details: t } : {}, d = await b?.fetch?.url(`/v1/payment/booking/${n._id}/pay`)?.options({ headers: { Origin: f?.id || "" } })?.post(r).json();
|
|
45
|
+
if (d?.status && d?.content?.meta?.key) {
|
|
46
|
+
const s = d.content.meta;
|
|
47
|
+
Z(s.provider || "razorpay"), s.provider === "stripe" && s.client_secret ? (g.current = s.session_id || null, Q(R), await M({
|
|
48
|
+
key: s.key,
|
|
49
|
+
client_secret: s.client_secret,
|
|
50
|
+
amount: s.amount,
|
|
51
|
+
currency: s.currency,
|
|
45
52
|
provider: "stripe",
|
|
46
|
-
reference_id:
|
|
47
|
-
})) :
|
|
53
|
+
reference_id: s.reference_id
|
|
54
|
+
})) : G(s);
|
|
48
55
|
} else
|
|
49
|
-
|
|
50
|
-
} catch (
|
|
51
|
-
console.error("Initiate payment error:",
|
|
56
|
+
i("Unable to initiate payment. Please try again."), l("failed");
|
|
57
|
+
} catch (t) {
|
|
58
|
+
console.error("Initiate payment error:", t), C(t), i("Unable to initiate payment. Please check your connection and try again."), l("failed");
|
|
52
59
|
}
|
|
53
|
-
},
|
|
54
|
-
|
|
60
|
+
}, G = (t) => {
|
|
61
|
+
w.current = !1, _.current = null;
|
|
55
62
|
const r = {
|
|
56
|
-
key:
|
|
57
|
-
amount:
|
|
58
|
-
currency:
|
|
59
|
-
order_id:
|
|
60
|
-
name:
|
|
61
|
-
description:
|
|
62
|
-
handler: (
|
|
63
|
-
|
|
64
|
-
order_id:
|
|
65
|
-
payment_id:
|
|
66
|
-
signature:
|
|
63
|
+
key: t.key,
|
|
64
|
+
amount: t.amount,
|
|
65
|
+
currency: t.currency,
|
|
66
|
+
order_id: t.order_id,
|
|
67
|
+
name: f?.name ?? "",
|
|
68
|
+
description: n.instance_label || "Booking Payment",
|
|
69
|
+
handler: (s) => {
|
|
70
|
+
W({
|
|
71
|
+
order_id: s.razorpay_order_id,
|
|
72
|
+
payment_id: s.razorpay_payment_id,
|
|
73
|
+
signature: s.razorpay_signature
|
|
67
74
|
});
|
|
68
75
|
},
|
|
69
76
|
theme: {
|
|
@@ -72,37 +79,37 @@ const xe = ({ summary: t, onComplete: S, className: T }) => {
|
|
|
72
79
|
};
|
|
73
80
|
r.modal = {
|
|
74
81
|
ondismiss: () => {
|
|
75
|
-
|
|
82
|
+
w.current ? (i(_.current || "Payment failed. Please try again."), l("failed")) : l("summary");
|
|
76
83
|
}
|
|
77
84
|
};
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}),
|
|
82
|
-
},
|
|
85
|
+
const d = new E(r);
|
|
86
|
+
d.on("payment.failed", () => {
|
|
87
|
+
w.current = !0, _.current = "Payment was declined. Please try a different payment method.";
|
|
88
|
+
}), d.open();
|
|
89
|
+
}, W = async (t) => {
|
|
83
90
|
try {
|
|
84
|
-
const r = await
|
|
85
|
-
r?.status && r?.content?.data ?
|
|
91
|
+
const r = await b?.fetch?.url(`/v1/payment/booking/${n._id}/confirm`)?.options({ headers: { Origin: f?.id || "" } })?.post(t).json();
|
|
92
|
+
r?.status && r?.content?.data ? (O(r.content.data), l("confirmed")) : (i("Payment received but confirmation failed. Please contact support."), l("failed"));
|
|
86
93
|
} catch (r) {
|
|
87
|
-
console.error("Confirm payment error:", r),
|
|
94
|
+
console.error("Confirm payment error:", r), C(r), i("Payment received but confirmation failed. Please contact support."), l("failed");
|
|
88
95
|
}
|
|
89
|
-
},
|
|
90
|
-
return /* @__PURE__ */ a(
|
|
96
|
+
}, o = !n.unit_amount || n.unit_amount === 0;
|
|
97
|
+
return /* @__PURE__ */ a(h, { children: [
|
|
91
98
|
/* @__PURE__ */ a(
|
|
92
99
|
"div",
|
|
93
100
|
{
|
|
94
|
-
className:
|
|
101
|
+
className: te(
|
|
95
102
|
"overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",
|
|
96
|
-
|
|
103
|
+
K
|
|
97
104
|
),
|
|
98
105
|
children: [
|
|
99
|
-
|
|
100
|
-
|
|
106
|
+
p === "summary" && /* @__PURE__ */ a("div", { className: "flex flex-col", children: [
|
|
107
|
+
n.cover_image?.location && /* @__PURE__ */ a("div", { className: "relative h-44 w-full overflow-hidden bg-gray-100", children: [
|
|
101
108
|
/* @__PURE__ */ e(
|
|
102
109
|
"img",
|
|
103
110
|
{
|
|
104
|
-
src:
|
|
105
|
-
alt:
|
|
111
|
+
src: n.cover_image.location,
|
|
112
|
+
alt: n.instance_label,
|
|
106
113
|
className: "h-full w-full object-cover"
|
|
107
114
|
}
|
|
108
115
|
),
|
|
@@ -111,160 +118,198 @@ const xe = ({ summary: t, onComplete: S, className: T }) => {
|
|
|
111
118
|
/* @__PURE__ */ a("div", { className: "flex flex-col px-6 py-5 sm:px-8", children: [
|
|
112
119
|
/* @__PURE__ */ a("div", { className: "mx-auto mb-5 w-full max-w-lg text-center", children: [
|
|
113
120
|
/* @__PURE__ */ e("p", { className: "mb-1 font-medium text-gray-500 text-xs uppercase tracking-wider", children: "Booking Summary" }),
|
|
114
|
-
/* @__PURE__ */ e("h3", { className: "font-semibold text-gray-900 text-xl leading-tight", children:
|
|
121
|
+
/* @__PURE__ */ e("h3", { className: "font-semibold text-gray-900 text-xl leading-tight", children: n.instance_label || n.context_label || "Booking" })
|
|
115
122
|
] }),
|
|
116
|
-
(
|
|
117
|
-
|
|
118
|
-
/* @__PURE__ */ e(
|
|
119
|
-
/* @__PURE__ */ e("span", { children:
|
|
123
|
+
(n.starts_at || n.ends_at) && /* @__PURE__ */ a("div", { 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", children: [
|
|
124
|
+
n.starts_at && /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-gray-700 text-sm", children: [
|
|
125
|
+
/* @__PURE__ */ e(S, { className: "size-4 text-orange-500" }),
|
|
126
|
+
/* @__PURE__ */ e("span", { children: j(n.starts_at) })
|
|
120
127
|
] }),
|
|
121
|
-
|
|
122
|
-
/* @__PURE__ */ e(
|
|
123
|
-
/* @__PURE__ */ e("span", { children:
|
|
128
|
+
n.starts_at && /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-gray-700 text-sm", children: [
|
|
129
|
+
/* @__PURE__ */ e(U, { className: "size-4 text-orange-500" }),
|
|
130
|
+
/* @__PURE__ */ e("span", { children: k(n.starts_at) })
|
|
124
131
|
] })
|
|
125
132
|
] }),
|
|
126
|
-
|
|
133
|
+
m.length > 0 && /* @__PURE__ */ a("div", { className: "mx-auto mb-5 w-full max-w-lg", children: [
|
|
127
134
|
/* @__PURE__ */ e("h4", { className: "mb-3 text-center font-medium text-gray-500 text-xs uppercase tracking-wider", children: "Your Details" }),
|
|
128
|
-
/* @__PURE__ */ e("div", { className: "rounded-lg border border-gray-100 bg-gray-50/50 p-4", children: /* @__PURE__ */ e("div", { className: "space-y-2.5", children:
|
|
129
|
-
/* @__PURE__ */ e("span", { className: "text-gray-500 text-sm", children:
|
|
130
|
-
/* @__PURE__ */ e("span", { className: "text-right font-medium text-gray-900 text-sm", children:
|
|
131
|
-
] },
|
|
135
|
+
/* @__PURE__ */ e("div", { className: "rounded-lg border border-gray-100 bg-gray-50/50 p-4", children: /* @__PURE__ */ e("div", { className: "space-y-2.5", children: m.map(([t, r]) => /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-3", children: [
|
|
136
|
+
/* @__PURE__ */ e("span", { className: "text-gray-500 text-sm", children: P(t) }),
|
|
137
|
+
/* @__PURE__ */ e("span", { className: "text-right font-medium text-gray-900 text-sm", children: z(r) })
|
|
138
|
+
] }, t)) }) })
|
|
132
139
|
] }),
|
|
140
|
+
(() => {
|
|
141
|
+
const t = u || n.billing_details;
|
|
142
|
+
return t ? /* @__PURE__ */ a("div", { className: "mx-auto mb-5 w-full max-w-lg", children: [
|
|
143
|
+
/* @__PURE__ */ a("div", { className: "mb-3 flex items-center justify-center gap-2", children: [
|
|
144
|
+
/* @__PURE__ */ e("h4", { className: "text-center font-medium text-gray-500 text-xs uppercase tracking-wider", children: "Billing Details" }),
|
|
145
|
+
y && /* @__PURE__ */ e(
|
|
146
|
+
"button",
|
|
147
|
+
{
|
|
148
|
+
type: "button",
|
|
149
|
+
onClick: () => v(!0),
|
|
150
|
+
className: "text-orange-500 hover:text-orange-600",
|
|
151
|
+
children: /* @__PURE__ */ e(ae, { className: "size-3.5" })
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
] }),
|
|
155
|
+
/* @__PURE__ */ e("div", { className: "rounded-lg border border-gray-100 bg-gray-50/50 p-4", children: /* @__PURE__ */ a("div", { className: "space-y-2.5", children: [
|
|
156
|
+
/* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-3", children: [
|
|
157
|
+
/* @__PURE__ */ e("span", { className: "text-gray-500 text-sm", children: "Name" }),
|
|
158
|
+
/* @__PURE__ */ e("span", { className: "text-right font-medium text-gray-900 text-sm", children: t.name })
|
|
159
|
+
] }),
|
|
160
|
+
t.tax_id && /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-3", children: [
|
|
161
|
+
/* @__PURE__ */ e("span", { className: "text-gray-500 text-sm", children: "Tax ID" }),
|
|
162
|
+
/* @__PURE__ */ e("span", { className: "text-right font-medium text-gray-900 text-sm", children: t.tax_id })
|
|
163
|
+
] }),
|
|
164
|
+
/* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-3", children: [
|
|
165
|
+
/* @__PURE__ */ e("span", { className: "text-gray-500 text-sm", children: "Address" }),
|
|
166
|
+
/* @__PURE__ */ e("span", { className: "text-right font-medium text-gray-900 text-sm", children: [
|
|
167
|
+
t.address.line1,
|
|
168
|
+
t.address.line2,
|
|
169
|
+
t.address.city,
|
|
170
|
+
t.address.state,
|
|
171
|
+
t.address.postal_code,
|
|
172
|
+
t.address.country
|
|
173
|
+
].filter(Boolean).join(", ") })
|
|
174
|
+
] })
|
|
175
|
+
] }) })
|
|
176
|
+
] }) : null;
|
|
177
|
+
})(),
|
|
133
178
|
/* @__PURE__ */ a("div", { className: "mx-auto mb-5 w-full max-w-lg", children: [
|
|
134
179
|
/* @__PURE__ */ e("h4", { className: "mb-3 text-center font-medium text-gray-500 text-xs uppercase tracking-wider", children: "Payment" }),
|
|
135
180
|
/* @__PURE__ */ a("div", { className: "rounded-lg border border-gray-200 bg-white p-4", children: [
|
|
136
181
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
137
182
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between text-sm", children: [
|
|
138
183
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Unit Price" }),
|
|
139
|
-
/* @__PURE__ */ e("span", { className: "text-gray-900", children:
|
|
184
|
+
/* @__PURE__ */ e("span", { className: "text-gray-900", children: c(n.unit_amount, n.currency) })
|
|
140
185
|
] }),
|
|
141
|
-
|
|
186
|
+
n.quantity > 1 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between text-sm", children: [
|
|
142
187
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Quantity" }),
|
|
143
188
|
/* @__PURE__ */ a("span", { className: "text-gray-900", children: [
|
|
144
189
|
"×",
|
|
145
|
-
|
|
190
|
+
n.quantity
|
|
146
191
|
] })
|
|
147
192
|
] }),
|
|
148
|
-
typeof
|
|
193
|
+
typeof n.discount == "number" && n.discount > 0 && /* @__PURE__ */ a("div", { className: "flex items-center justify-between text-sm", children: [
|
|
149
194
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Discount" }),
|
|
150
195
|
/* @__PURE__ */ a("span", { className: "text-green-600", children: [
|
|
151
196
|
"-",
|
|
152
|
-
|
|
197
|
+
c(n.discount, n.currency)
|
|
153
198
|
] })
|
|
154
199
|
] }),
|
|
155
|
-
|
|
156
|
-
/* @__PURE__ */ e("span", { className: "text-gray-600", children:
|
|
157
|
-
/* @__PURE__ */ e("span", { className: "text-gray-900", children:
|
|
158
|
-
] },
|
|
200
|
+
n.taxes && n.taxes.length > 0 && n.taxes.map((t) => /* @__PURE__ */ a("div", { className: "flex items-center justify-between text-sm", children: [
|
|
201
|
+
/* @__PURE__ */ e("span", { className: "text-gray-600", children: t.label }),
|
|
202
|
+
/* @__PURE__ */ e("span", { className: "text-gray-900", children: c(t.amount, n.currency) })
|
|
203
|
+
] }, t.id))
|
|
159
204
|
] }),
|
|
160
205
|
/* @__PURE__ */ a("div", { className: "mt-3 flex items-center justify-between border-gray-100 border-t pt-3", children: [
|
|
161
206
|
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: "Total" }),
|
|
162
|
-
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900 text-xl", children:
|
|
207
|
+
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900 text-xl", children: o ? "Free" : c(n.total_amount, n.currency) })
|
|
163
208
|
] })
|
|
164
209
|
] })
|
|
165
210
|
] }),
|
|
166
211
|
/* @__PURE__ */ e(
|
|
167
|
-
|
|
212
|
+
D,
|
|
168
213
|
{
|
|
169
214
|
elementKey: "booking-pay-btn",
|
|
170
|
-
onClick:
|
|
215
|
+
onClick: o ? () => l("confirmed") : Y,
|
|
171
216
|
className: "mx-auto w-full max-w-lg rounded-lg px-4 py-3.5 font-semibold",
|
|
172
|
-
children: /* @__PURE__ */ e("span", { className: "flex items-center justify-center gap-2", children:
|
|
173
|
-
/* @__PURE__ */ e(
|
|
217
|
+
children: /* @__PURE__ */ e("span", { className: "flex items-center justify-center gap-2", children: o ? /* @__PURE__ */ a(h, { children: [
|
|
218
|
+
/* @__PURE__ */ e($, { className: "size-5" }),
|
|
174
219
|
/* @__PURE__ */ e("span", { children: "Confirm Booking" })
|
|
175
|
-
] }) : /* @__PURE__ */ a(
|
|
176
|
-
/* @__PURE__ */ e(
|
|
220
|
+
] }) : /* @__PURE__ */ a(h, { children: [
|
|
221
|
+
/* @__PURE__ */ e(ne, { className: "size-5" }),
|
|
177
222
|
/* @__PURE__ */ a("span", { children: [
|
|
178
223
|
"Pay ",
|
|
179
|
-
|
|
224
|
+
c(n.total_amount, n.currency)
|
|
180
225
|
] })
|
|
181
226
|
] }) })
|
|
182
227
|
}
|
|
183
228
|
),
|
|
184
|
-
!
|
|
185
|
-
/* @__PURE__ */ e(
|
|
229
|
+
!o && /* @__PURE__ */ a("div", { className: "mx-auto mt-4 flex w-full max-w-lg items-center justify-center gap-1.5 text-gray-400 text-xs", children: [
|
|
230
|
+
/* @__PURE__ */ e(q, { className: "size-3.5" }),
|
|
186
231
|
/* @__PURE__ */ e("span", { children: "Secure payment" })
|
|
187
232
|
] })
|
|
188
233
|
] })
|
|
189
234
|
] }),
|
|
190
|
-
|
|
235
|
+
p === "processing" && /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center px-6 py-16", children: [
|
|
191
236
|
/* @__PURE__ */ a("div", { className: "relative mb-6", children: [
|
|
192
237
|
/* @__PURE__ */ e("div", { className: "absolute inset-0 animate-ping rounded-full bg-orange-200 opacity-75" }),
|
|
193
|
-
/* @__PURE__ */ e("div", { className: "relative flex size-16 items-center justify-center rounded-full bg-orange-100", children: /* @__PURE__ */ e(
|
|
238
|
+
/* @__PURE__ */ e("div", { className: "relative flex size-16 items-center justify-center rounded-full bg-orange-100", children: /* @__PURE__ */ e(re, { className: "size-8 animate-spin text-orange-500" }) })
|
|
194
239
|
] }),
|
|
195
240
|
/* @__PURE__ */ e("h3", { className: "mb-1 font-semibold text-gray-900 text-lg", children: "Processing Payment" }),
|
|
196
241
|
/* @__PURE__ */ e("p", { className: "text-center text-gray-500 text-sm", children: "Please wait while we confirm your payment..." }),
|
|
197
242
|
/* @__PURE__ */ e("div", { className: "mt-6 rounded-lg bg-gray-50 px-6 py-3", children: /* @__PURE__ */ a("p", { className: "text-center text-gray-600 text-sm", children: [
|
|
198
243
|
"Amount:",
|
|
199
244
|
" ",
|
|
200
|
-
/* @__PURE__ */ e("span", { className: "font-semibold text-gray-900", children:
|
|
245
|
+
/* @__PURE__ */ e("span", { className: "font-semibold text-gray-900", children: c(n.total_amount, n.currency) })
|
|
201
246
|
] }) })
|
|
202
247
|
] }),
|
|
203
|
-
|
|
248
|
+
p === "failed" && /* @__PURE__ */ a("div", { className: "flex flex-col", children: [
|
|
204
249
|
/* @__PURE__ */ e("div", { className: "bg-gradient-to-br from-red-50 to-orange-50 px-6 py-6", children: /* @__PURE__ */ a("div", { className: "flex flex-col items-center", children: [
|
|
205
|
-
/* @__PURE__ */ e("div", { className: "mb-3 flex size-14 items-center justify-center rounded-full bg-red-100", children: /* @__PURE__ */ e(
|
|
250
|
+
/* @__PURE__ */ e("div", { className: "mb-3 flex size-14 items-center justify-center rounded-full bg-red-100", children: /* @__PURE__ */ e(se, { className: "size-8 text-red-500" }) }),
|
|
206
251
|
/* @__PURE__ */ e("h3", { className: "mb-1 font-semibold text-gray-900 text-lg", children: "Payment Failed" }),
|
|
207
|
-
/* @__PURE__ */ e("p", { className: "text-center text-gray-600 text-sm", children:
|
|
252
|
+
/* @__PURE__ */ e("p", { className: "text-center text-gray-600 text-sm", children: H || "Something went wrong. Please try again." })
|
|
208
253
|
] }) }),
|
|
209
254
|
/* @__PURE__ */ a("div", { className: "flex flex-col px-6 py-5 sm:px-8", children: [
|
|
210
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-full max-w-lg text-center", children: /* @__PURE__ */ e("h4", { className: "font-semibold text-base text-gray-900", children:
|
|
211
|
-
(
|
|
212
|
-
|
|
213
|
-
/* @__PURE__ */ e(
|
|
214
|
-
/* @__PURE__ */ e("span", { children:
|
|
255
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-full max-w-lg text-center", children: /* @__PURE__ */ e("h4", { className: "font-semibold text-base text-gray-900", children: n.instance_label || n.context_label || "Booking" }) }),
|
|
256
|
+
(n.starts_at || n.ends_at) && /* @__PURE__ */ a("div", { 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", children: [
|
|
257
|
+
n.starts_at && /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-gray-600 text-sm", children: [
|
|
258
|
+
/* @__PURE__ */ e(S, { className: "size-4 text-gray-400" }),
|
|
259
|
+
/* @__PURE__ */ e("span", { children: j(n.starts_at) })
|
|
215
260
|
] }),
|
|
216
|
-
|
|
217
|
-
/* @__PURE__ */ e(
|
|
218
|
-
/* @__PURE__ */ e("span", { children:
|
|
261
|
+
n.starts_at && /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-gray-600 text-sm", children: [
|
|
262
|
+
/* @__PURE__ */ e(U, { className: "size-4 text-gray-400" }),
|
|
263
|
+
/* @__PURE__ */ e("span", { children: k(n.starts_at) })
|
|
219
264
|
] })
|
|
220
265
|
] }),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
/* @__PURE__ */ e("span", { className: "text-gray-500", children:
|
|
224
|
-
/* @__PURE__ */ e("span", { className: "max-w-[50%] truncate font-medium text-gray-900", children:
|
|
225
|
-
] },
|
|
226
|
-
|
|
266
|
+
m.length > 0 && /* @__PURE__ */ e("div", { className: "mx-auto mb-4 w-full max-w-lg rounded-lg border border-gray-100 bg-gray-50/50 p-3", children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
267
|
+
m.slice(0, 3).map(([t, r]) => /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-3 text-sm", children: [
|
|
268
|
+
/* @__PURE__ */ e("span", { className: "text-gray-500", children: P(t) }),
|
|
269
|
+
/* @__PURE__ */ e("span", { className: "max-w-[50%] truncate font-medium text-gray-900", children: z(r) })
|
|
270
|
+
] }, t)),
|
|
271
|
+
m.length > 3 && /* @__PURE__ */ a("p", { className: "pt-1 text-center text-gray-400 text-xs", children: [
|
|
227
272
|
"+",
|
|
228
|
-
|
|
273
|
+
m.length - 3,
|
|
229
274
|
" more"
|
|
230
275
|
] })
|
|
231
276
|
] }) }),
|
|
232
277
|
/* @__PURE__ */ e("div", { className: "mx-auto mb-5 w-full max-w-lg rounded-lg border border-gray-200 bg-white p-4", children: /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
233
278
|
/* @__PURE__ */ e("span", { className: "font-medium text-gray-700", children: "Amount to Pay" }),
|
|
234
|
-
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900 text-xl", children:
|
|
279
|
+
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900 text-xl", children: c(n.total_amount, n.currency) })
|
|
235
280
|
] }) }),
|
|
236
281
|
/* @__PURE__ */ e(
|
|
237
|
-
|
|
282
|
+
D,
|
|
238
283
|
{
|
|
239
284
|
elementKey: "booking-retry-btn",
|
|
240
285
|
onClick: () => {
|
|
241
|
-
|
|
286
|
+
i(null), Y();
|
|
242
287
|
},
|
|
243
288
|
className: "mx-auto w-full max-w-lg rounded-lg px-4 py-3.5 font-semibold",
|
|
244
289
|
children: /* @__PURE__ */ a("span", { className: "flex items-center justify-center gap-2", children: [
|
|
245
|
-
/* @__PURE__ */ e(
|
|
290
|
+
/* @__PURE__ */ e(le, { className: "size-5" }),
|
|
246
291
|
/* @__PURE__ */ e("span", { children: "Try Again" })
|
|
247
292
|
] })
|
|
248
293
|
}
|
|
249
294
|
),
|
|
250
295
|
/* @__PURE__ */ a("div", { className: "mx-auto mt-4 flex w-full max-w-lg items-center justify-center gap-1.5 text-gray-400 text-xs", children: [
|
|
251
|
-
/* @__PURE__ */ e(
|
|
296
|
+
/* @__PURE__ */ e(q, { className: "size-3.5" }),
|
|
252
297
|
/* @__PURE__ */ a("span", { children: [
|
|
253
298
|
"Secured by ",
|
|
254
|
-
|
|
299
|
+
X === "stripe" ? "Stripe" : "Razorpay"
|
|
255
300
|
] })
|
|
256
301
|
] }),
|
|
257
302
|
/* @__PURE__ */ e("p", { className: "mx-auto mt-3 w-full max-w-lg text-center text-gray-400 text-xs", children: "If the problem persists, please contact support" })
|
|
258
303
|
] })
|
|
259
304
|
] }),
|
|
260
|
-
|
|
305
|
+
p === "confirmed" && /* @__PURE__ */ a("div", { className: "flex flex-col", children: [
|
|
261
306
|
/* @__PURE__ */ e("div", { className: "bg-gradient-to-br from-green-50 to-emerald-50 px-6 py-8", children: /* @__PURE__ */ a("div", { className: "flex flex-col items-center", children: [
|
|
262
307
|
/* @__PURE__ */ a("div", { className: "relative mb-4", children: [
|
|
263
308
|
/* @__PURE__ */ e("div", { className: "absolute -inset-2 animate-pulse rounded-full bg-green-200/50" }),
|
|
264
|
-
/* @__PURE__ */ e("div", { className: "relative flex size-16 items-center justify-center rounded-full bg-green-100 ring-4 ring-green-50", children: /* @__PURE__ */ e(
|
|
309
|
+
/* @__PURE__ */ e("div", { className: "relative flex size-16 items-center justify-center rounded-full bg-green-100 ring-4 ring-green-50", children: /* @__PURE__ */ e($, { className: "size-9 text-green-600" }) })
|
|
265
310
|
] }),
|
|
266
|
-
/* @__PURE__ */ e("h3", { className: "mb-1 font-bold text-gray-900 text-xl", children:
|
|
267
|
-
/* @__PURE__ */ e("p", { className: "text-center text-gray-600 text-sm", children:
|
|
311
|
+
/* @__PURE__ */ e("h3", { className: "mb-1 font-bold text-gray-900 text-xl", children: o ? "Booking Confirmed!" : "Payment Successful!" }),
|
|
312
|
+
/* @__PURE__ */ e("p", { className: "text-center text-gray-600 text-sm", children: o ? "Your booking has been confirmed" : "Your payment has been processed successfully" })
|
|
268
313
|
] }) }),
|
|
269
314
|
/* @__PURE__ */ a("div", { className: "px-6 py-5 sm:px-8", children: [
|
|
270
315
|
/* @__PURE__ */ a("div", { className: "relative mx-auto max-w-lg overflow-hidden rounded-xl border border-gray-200 bg-white", children: [
|
|
@@ -272,51 +317,70 @@ const xe = ({ summary: t, onComplete: S, className: T }) => {
|
|
|
272
317
|
/* @__PURE__ */ e("div", { className: "absolute top-1/2 -right-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
|
|
273
318
|
/* @__PURE__ */ a("div", { className: "px-5 py-4", children: [
|
|
274
319
|
/* @__PURE__ */ a("div", { className: "mb-4 flex items-start gap-3", children: [
|
|
275
|
-
/* @__PURE__ */ e("div", { className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-orange-100", children: /* @__PURE__ */ e(
|
|
276
|
-
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("p", { className: "font-semibold text-gray-900 leading-tight", children:
|
|
320
|
+
/* @__PURE__ */ e("div", { className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-orange-100", children: /* @__PURE__ */ e(ie, { className: "size-5 text-orange-600" }) }),
|
|
321
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e("p", { className: "font-semibold text-gray-900 leading-tight", children: n.instance_label || n.context_label || "Booking" }) })
|
|
277
322
|
] }),
|
|
278
|
-
|
|
323
|
+
n.qr_image?.location && /* @__PURE__ */ e("div", { className: "mb-4 flex flex-col items-center", children: /* @__PURE__ */ e("div", { className: "rounded-lg border border-gray-200 bg-white p-2", children: /* @__PURE__ */ e(
|
|
279
324
|
"img",
|
|
280
325
|
{
|
|
281
|
-
src:
|
|
326
|
+
src: n.qr_image.location,
|
|
282
327
|
alt: "Booking QR Code",
|
|
283
328
|
className: "size-24"
|
|
284
329
|
}
|
|
285
330
|
) }) }),
|
|
286
331
|
/* @__PURE__ */ a("div", { className: "mb-4 flex items-center justify-between rounded-lg bg-gray-50 px-3 py-2.5", children: [
|
|
287
332
|
/* @__PURE__ */ e("span", { className: "font-medium text-gray-500 text-xs uppercase tracking-wide", children: "Booking ID" }),
|
|
288
|
-
/* @__PURE__ */ e("span", { className: "font-mono font-semibold text-gray-900 text-sm", children:
|
|
333
|
+
/* @__PURE__ */ e("span", { className: "font-mono font-semibold text-gray-900 text-sm", children: n._id })
|
|
289
334
|
] }),
|
|
290
335
|
/* @__PURE__ */ e("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
|
|
291
336
|
/* @__PURE__ */ a("div", { className: "space-y-2.5", children: [
|
|
292
|
-
|
|
337
|
+
n.starts_at && /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
293
338
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-gray-500 text-sm", children: [
|
|
294
|
-
/* @__PURE__ */ e(
|
|
339
|
+
/* @__PURE__ */ e(S, { className: "size-4" }),
|
|
295
340
|
/* @__PURE__ */ e("span", { children: "Date & Time" })
|
|
296
341
|
] }),
|
|
297
342
|
/* @__PURE__ */ a("p", { className: "font-medium text-gray-900 text-sm", children: [
|
|
298
|
-
|
|
343
|
+
j(n.starts_at),
|
|
299
344
|
", ",
|
|
300
|
-
|
|
345
|
+
k(n.starts_at)
|
|
301
346
|
] })
|
|
302
347
|
] }),
|
|
303
|
-
|
|
304
|
-
/* @__PURE__ */ e("span", { className: "text-gray-500 text-sm", children:
|
|
305
|
-
/* @__PURE__ */ e("span", { className: "max-w-[50%] truncate font-medium text-gray-900 text-sm", children:
|
|
306
|
-
] },
|
|
348
|
+
m.slice(0, 3).map(([t, r]) => /* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
349
|
+
/* @__PURE__ */ e("span", { className: "text-gray-500 text-sm", children: P(t) }),
|
|
350
|
+
/* @__PURE__ */ e("span", { className: "max-w-[50%] truncate font-medium text-gray-900 text-sm", children: z(r) })
|
|
351
|
+
] }, t))
|
|
307
352
|
] }),
|
|
308
353
|
/* @__PURE__ */ e("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
|
|
309
354
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between", children: [
|
|
310
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-gray-700", children:
|
|
311
|
-
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900 text-lg", children:
|
|
312
|
-
] })
|
|
355
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-700", children: o ? "Total" : "Amount Paid" }),
|
|
356
|
+
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900 text-lg", children: o ? "Free" : c(n.total_amount, n.currency) })
|
|
357
|
+
] }),
|
|
358
|
+
(() => {
|
|
359
|
+
const t = V?.invoice?.location || n.invoice?.location;
|
|
360
|
+
return t ? /* @__PURE__ */ a(h, { children: [
|
|
361
|
+
/* @__PURE__ */ e("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
|
|
362
|
+
/* @__PURE__ */ a(
|
|
363
|
+
"a",
|
|
364
|
+
{
|
|
365
|
+
href: t,
|
|
366
|
+
target: "_blank",
|
|
367
|
+
rel: "noopener noreferrer",
|
|
368
|
+
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",
|
|
369
|
+
children: [
|
|
370
|
+
/* @__PURE__ */ e(ce, { className: "size-4" }),
|
|
371
|
+
"Download Invoice"
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
)
|
|
375
|
+
] }) : null;
|
|
376
|
+
})()
|
|
313
377
|
] })
|
|
314
378
|
] }),
|
|
315
|
-
|
|
316
|
-
|
|
379
|
+
A && /* @__PURE__ */ e("div", { className: "mx-auto mt-5 max-w-lg", children: /* @__PURE__ */ e(
|
|
380
|
+
D,
|
|
317
381
|
{
|
|
318
382
|
elementKey: "booking-done-btn",
|
|
319
|
-
onClick:
|
|
383
|
+
onClick: A,
|
|
320
384
|
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",
|
|
321
385
|
children: "Done"
|
|
322
386
|
}
|
|
@@ -327,20 +391,32 @@ const xe = ({ summary: t, onComplete: S, className: T }) => {
|
|
|
327
391
|
]
|
|
328
392
|
}
|
|
329
393
|
),
|
|
330
|
-
|
|
331
|
-
|
|
394
|
+
J && y && /* @__PURE__ */ e("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4", children: /* @__PURE__ */ e("div", { className: "max-h-[90vh] w-full max-w-lg overflow-auto rounded-xl bg-white shadow-xl", children: /* @__PURE__ */ e(
|
|
395
|
+
xe,
|
|
396
|
+
{
|
|
397
|
+
isEdit: !0,
|
|
398
|
+
prefillData: u || n.billing_details,
|
|
399
|
+
onSubmit: (t) => {
|
|
400
|
+
y(t), v(!1);
|
|
401
|
+
},
|
|
402
|
+
onClose: () => v(!1)
|
|
403
|
+
}
|
|
404
|
+
) }) }),
|
|
405
|
+
I && F && /* @__PURE__ */ e(
|
|
406
|
+
ge,
|
|
332
407
|
{
|
|
333
|
-
isOpen:
|
|
408
|
+
isOpen: I,
|
|
334
409
|
onClose: () => {
|
|
335
|
-
|
|
410
|
+
N(), l("summary");
|
|
336
411
|
},
|
|
337
|
-
stripePromise:
|
|
412
|
+
stripePromise: L,
|
|
338
413
|
clientSecret: F.clientSecret,
|
|
339
|
-
onComplete:
|
|
414
|
+
onComplete: R
|
|
340
415
|
}
|
|
341
416
|
)
|
|
342
417
|
] });
|
|
343
418
|
};
|
|
344
419
|
export {
|
|
345
|
-
xe as
|
|
420
|
+
xe as BillingStep,
|
|
421
|
+
we as BookingCard
|
|
346
422
|
};
|