@burdenoff/microfe-adaptercloud 2026.625.1 → 2026.625.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adaptercloud/components/PageLayout.js +24 -17
- package/dist/adaptercloud/components/PageLayout.js.map +1 -1
- package/dist/adaptercloud/pages/HomePage.js +18 -16
- package/dist/adaptercloud/pages/HomePage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js +90 -82
- package/dist/adaptercloud/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminDashboard.js +70 -44
- package/dist/adaptercloud/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js +60 -55
- package/dist/adaptercloud/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js +97 -92
- package/dist/adaptercloud/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js +59 -57
- package/dist/adaptercloud/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js +118 -104
- package/dist/adaptercloud/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/CartManagementPage.js +145 -140
- package/dist/adaptercloud/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/admin/UserManagementPage.js +152 -147
- package/dist/adaptercloud/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js +87 -81
- package/dist/adaptercloud/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js +179 -165
- package/dist/adaptercloud/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js +73 -48
- package/dist/adaptercloud/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js +95 -93
- package/dist/adaptercloud/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js +110 -107
- package/dist/adaptercloud/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js +293 -299
- package/dist/adaptercloud/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js +218 -224
- package/dist/adaptercloud/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js +122 -128
- package/dist/adaptercloud/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/adaptercloud/pages/common/HelpSupportPage.js +248 -244
- package/dist/adaptercloud/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js +96 -91
- package/dist/adaptercloud/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/adaptercloud/pages/common/SettingsPage.js +754 -736
- package/dist/adaptercloud/pages/common/SettingsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js +63 -61
- package/dist/adaptercloud/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CartDetailPage.js +110 -108
- package/dist/adaptercloud/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js +221 -217
- package/dist/adaptercloud/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CheckoutPage.js +89 -87
- package/dist/adaptercloud/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js +410 -381
- package/dist/adaptercloud/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js +120 -118
- package/dist/adaptercloud/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js +86 -81
- package/dist/adaptercloud/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/FavoritesPage.js +53 -51
- package/dist/adaptercloud/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js +114 -109
- package/dist/adaptercloud/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js +60 -58
- package/dist/adaptercloud/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js +87 -72
- package/dist/adaptercloud/pages/customer/PaymentMethodsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/ReviewsPage.js +65 -63
- package/dist/adaptercloud/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js +68 -53
- package/dist/adaptercloud/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js +63 -61
- package/dist/adaptercloud/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js +86 -84
- package/dist/adaptercloud/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js +57 -55
- package/dist/adaptercloud/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js +341 -308
- package/dist/adaptercloud/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js +34 -32
- package/dist/adaptercloud/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js +48 -46
- package/dist/adaptercloud/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js +383 -381
- package/dist/adaptercloud/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js +348 -319
- package/dist/adaptercloud/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js +84 -59
- package/dist/adaptercloud/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js +73 -71
- package/dist/adaptercloud/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js +76 -74
- package/dist/adaptercloud/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js +70 -68
- package/dist/adaptercloud/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +3 -3
|
@@ -6,8 +6,9 @@ import { formatCurrency as a } from "../../utils/formatters.js";
|
|
|
6
6
|
import { useMemo as o, useState as s } from "react";
|
|
7
7
|
import { AlertCircle as c, ArrowLeft as l, Banknote as u, CheckCircle2 as d, CreditCard as f, Heart as p, Loader2 as m, MapPin as h, ShoppingBag as g, Smartphone as _, Wallet as v } from "lucide-react";
|
|
8
8
|
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
9
|
+
import { EmphasisPanel as x } from "@burdenoff/fe-libs/ui";
|
|
9
10
|
//#region src/adaptercloud/pages/customer/CheckoutPage.tsx
|
|
10
|
-
var
|
|
11
|
+
var S = [
|
|
11
12
|
{
|
|
12
13
|
id: "cash",
|
|
13
14
|
label: "Cash on Delivery",
|
|
@@ -32,66 +33,66 @@ var x = [
|
|
|
32
33
|
icon: v,
|
|
33
34
|
description: "AdapterCloud Wallet Balance"
|
|
34
35
|
}
|
|
35
|
-
],
|
|
36
|
+
], C = [
|
|
36
37
|
0,
|
|
37
38
|
10,
|
|
38
39
|
20,
|
|
39
40
|
30
|
|
40
41
|
];
|
|
41
|
-
function
|
|
42
|
-
let { navigateTo: u, currentUser: _ } = e(), { data: v = [], isLoading:
|
|
42
|
+
function w() {
|
|
43
|
+
let { navigateTo: u, currentUser: _ } = e(), { data: v = [], isLoading: w } = r({ customerId: _?.id }), T = i(), E = o(() => v.find((e) => e.status === "pending") || v[0], [v]), [D, O] = s({
|
|
43
44
|
addressLine1: "",
|
|
44
45
|
addressLine2: "",
|
|
45
46
|
city: "Bangalore",
|
|
46
47
|
state: "Karnataka",
|
|
47
48
|
pincode: ""
|
|
48
|
-
}), [
|
|
49
|
+
}), [k, A] = s("cash"), [j, M] = s({
|
|
49
50
|
cardNumber: "",
|
|
50
51
|
expiryDate: "",
|
|
51
52
|
cvv: "",
|
|
52
53
|
upiId: ""
|
|
53
|
-
}), [
|
|
54
|
-
if (!
|
|
54
|
+
}), [N, P] = s(0), [F, I] = s(""), [L, R] = s(""), [z, B] = s(!1), V = o(() => {
|
|
55
|
+
if (!E) return {
|
|
55
56
|
subtotal: 0,
|
|
56
57
|
deliveryFee: 0,
|
|
57
58
|
tax: 0,
|
|
58
59
|
total: 0
|
|
59
60
|
};
|
|
60
|
-
let e =
|
|
61
|
+
let e = E.subtotal, t = E.deliveryFee, n = E.taxes, r = E.discount ?? 0;
|
|
61
62
|
return {
|
|
62
63
|
subtotal: e,
|
|
63
64
|
deliveryFee: t,
|
|
64
65
|
tax: n,
|
|
65
66
|
discount: r,
|
|
66
|
-
total: e + t + n +
|
|
67
|
+
total: e + t + n + N - r
|
|
67
68
|
};
|
|
68
|
-
}, [
|
|
69
|
-
|
|
69
|
+
}, [E, N]), H = o(() => E ? E.items.reduce((e, t) => e + t.quantity, 0) : 0, [E]), U = (e, t) => {
|
|
70
|
+
O((n) => ({
|
|
70
71
|
...n,
|
|
71
72
|
[e]: t
|
|
72
73
|
}));
|
|
73
|
-
},
|
|
74
|
-
|
|
74
|
+
}, W = (e, t) => {
|
|
75
|
+
M((n) => ({
|
|
75
76
|
...n,
|
|
76
77
|
[e]: t
|
|
77
78
|
}));
|
|
78
|
-
},
|
|
79
|
-
if (!
|
|
80
|
-
if (!
|
|
81
|
-
if (
|
|
82
|
-
if (!
|
|
83
|
-
if (!
|
|
84
|
-
if (!
|
|
79
|
+
}, G = () => {
|
|
80
|
+
if (!D.addressLine1.trim()) return alert("Please enter delivery address"), !1;
|
|
81
|
+
if (!D.pincode.trim() || D.pincode.length !== 6) return alert("Please enter a valid 6-digit pincode"), !1;
|
|
82
|
+
if (k === "card") {
|
|
83
|
+
if (!j.cardNumber || j.cardNumber.length < 16) return alert("Please enter a valid 16-digit card number"), !1;
|
|
84
|
+
if (!j.expiryDate) return alert("Please enter card expiry date"), !1;
|
|
85
|
+
if (!j.cvv || j.cvv.length < 3) return alert("Please enter a valid 3-digit CVV"), !1;
|
|
85
86
|
}
|
|
86
|
-
return
|
|
87
|
+
return k === "upi" && !j.upiId.trim() ? (alert("Please enter UPI ID"), !1) : !0;
|
|
87
88
|
};
|
|
88
|
-
return
|
|
89
|
+
return w ? /* @__PURE__ */ y(n, {
|
|
89
90
|
title: "Checkout",
|
|
90
91
|
children: /* @__PURE__ */ y("div", {
|
|
91
92
|
className: "flex h-[60vh] items-center justify-center",
|
|
92
93
|
children: /* @__PURE__ */ y(m, { className: "h-8 w-8 animate-spin text-primary" })
|
|
93
94
|
})
|
|
94
|
-
}) :
|
|
95
|
+
}) : E ? /* @__PURE__ */ y(n, {
|
|
95
96
|
title: /* @__PURE__ */ b("div", {
|
|
96
97
|
className: "flex items-center gap-3",
|
|
97
98
|
children: [/* @__PURE__ */ y("button", {
|
|
@@ -102,6 +103,7 @@ function C() {
|
|
|
102
103
|
}), /* @__PURE__ */ y("span", { children: "Checkout" })]
|
|
103
104
|
}),
|
|
104
105
|
description: "Review your order and complete payment",
|
|
106
|
+
purpose: "The final step before your order is placed — confirm what's in your cart, choose a delivery address and payment method, and pay securely. Check the totals here so there are no surprises.",
|
|
105
107
|
children: /* @__PURE__ */ b("div", {
|
|
106
108
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
107
109
|
children: [/* @__PURE__ */ b("div", {
|
|
@@ -124,8 +126,8 @@ function C() {
|
|
|
124
126
|
}), /* @__PURE__ */ y("input", {
|
|
125
127
|
type: "text",
|
|
126
128
|
placeholder: "Building, Street, Area",
|
|
127
|
-
value:
|
|
128
|
-
onChange: (e) =>
|
|
129
|
+
value: D.addressLine1,
|
|
130
|
+
onChange: (e) => U("addressLine1", e.target.value),
|
|
129
131
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
130
132
|
})] }),
|
|
131
133
|
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
@@ -134,8 +136,8 @@ function C() {
|
|
|
134
136
|
}), /* @__PURE__ */ y("input", {
|
|
135
137
|
type: "text",
|
|
136
138
|
placeholder: "Apartment, Suite, Floor (Optional)",
|
|
137
|
-
value:
|
|
138
|
-
onChange: (e) =>
|
|
139
|
+
value: D.addressLine2,
|
|
140
|
+
onChange: (e) => U("addressLine2", e.target.value),
|
|
139
141
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
140
142
|
})] }),
|
|
141
143
|
/* @__PURE__ */ b("div", {
|
|
@@ -148,8 +150,8 @@ function C() {
|
|
|
148
150
|
})]
|
|
149
151
|
}), /* @__PURE__ */ y("input", {
|
|
150
152
|
type: "text",
|
|
151
|
-
value:
|
|
152
|
-
onChange: (e) =>
|
|
153
|
+
value: D.city,
|
|
154
|
+
onChange: (e) => U("city", e.target.value),
|
|
153
155
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
154
156
|
})] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("label", {
|
|
155
157
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
@@ -159,8 +161,8 @@ function C() {
|
|
|
159
161
|
})]
|
|
160
162
|
}), /* @__PURE__ */ y("input", {
|
|
161
163
|
type: "text",
|
|
162
|
-
value:
|
|
163
|
-
onChange: (e) =>
|
|
164
|
+
value: D.state,
|
|
165
|
+
onChange: (e) => U("state", e.target.value),
|
|
164
166
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
165
167
|
})] })]
|
|
166
168
|
}),
|
|
@@ -174,8 +176,8 @@ function C() {
|
|
|
174
176
|
type: "text",
|
|
175
177
|
placeholder: "560001",
|
|
176
178
|
maxLength: 6,
|
|
177
|
-
value:
|
|
178
|
-
onChange: (e) =>
|
|
179
|
+
value: D.pincode,
|
|
180
|
+
onChange: (e) => U("pincode", e.target.value.replace(/\D/g, "")),
|
|
179
181
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
180
182
|
})] })
|
|
181
183
|
]
|
|
@@ -190,12 +192,12 @@ function C() {
|
|
|
190
192
|
}),
|
|
191
193
|
/* @__PURE__ */ y("div", {
|
|
192
194
|
className: "space-y-2",
|
|
193
|
-
children:
|
|
195
|
+
children: S.map((e) => {
|
|
194
196
|
let n = e.icon;
|
|
195
197
|
return /* @__PURE__ */ b("button", {
|
|
196
198
|
type: "button",
|
|
197
|
-
onClick: () =>
|
|
198
|
-
className: t("flex w-full items-center gap-4 rounded-lg border p-3 transition-colors text-left",
|
|
199
|
+
onClick: () => A(e.id),
|
|
200
|
+
className: t("flex w-full items-center gap-4 rounded-lg border p-3 transition-colors text-left", k === e.id ? "border-foreground bg-accent" : "border-border-subtle bg-bg-surface hover:bg-accent"),
|
|
199
201
|
children: [
|
|
200
202
|
/* @__PURE__ */ y("div", {
|
|
201
203
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-bg-sunken",
|
|
@@ -211,12 +213,12 @@ function C() {
|
|
|
211
213
|
children: e.description
|
|
212
214
|
})]
|
|
213
215
|
}),
|
|
214
|
-
|
|
216
|
+
k === e.id && /* @__PURE__ */ y(d, { className: "h-5 w-5 text-text-primary shrink-0" })
|
|
215
217
|
]
|
|
216
218
|
}, e.id);
|
|
217
219
|
})
|
|
218
220
|
}),
|
|
219
|
-
|
|
221
|
+
k === "card" && /* @__PURE__ */ b("div", {
|
|
220
222
|
className: "mt-4 space-y-4 border-t border-border-subtle pt-4",
|
|
221
223
|
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("label", {
|
|
222
224
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
@@ -228,8 +230,8 @@ function C() {
|
|
|
228
230
|
type: "text",
|
|
229
231
|
placeholder: "1234 5678 9012 3456",
|
|
230
232
|
maxLength: 16,
|
|
231
|
-
value:
|
|
232
|
-
onChange: (e) =>
|
|
233
|
+
value: j.cardNumber,
|
|
234
|
+
onChange: (e) => W("cardNumber", e.target.value.replace(/\D/g, "")),
|
|
233
235
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
234
236
|
})] }), /* @__PURE__ */ b("div", {
|
|
235
237
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
@@ -243,10 +245,10 @@ function C() {
|
|
|
243
245
|
type: "text",
|
|
244
246
|
placeholder: "MM/YY",
|
|
245
247
|
maxLength: 5,
|
|
246
|
-
value:
|
|
248
|
+
value: j.expiryDate,
|
|
247
249
|
onChange: (e) => {
|
|
248
250
|
let t = e.target.value.replace(/\D/g, "");
|
|
249
|
-
t.length >= 2 && (t = t.slice(0, 2) + "/" + t.slice(2, 4)),
|
|
251
|
+
t.length >= 2 && (t = t.slice(0, 2) + "/" + t.slice(2, 4)), W("expiryDate", t);
|
|
250
252
|
},
|
|
251
253
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
252
254
|
})] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("label", {
|
|
@@ -259,13 +261,13 @@ function C() {
|
|
|
259
261
|
type: "text",
|
|
260
262
|
placeholder: "123",
|
|
261
263
|
maxLength: 3,
|
|
262
|
-
value:
|
|
263
|
-
onChange: (e) =>
|
|
264
|
+
value: j.cvv,
|
|
265
|
+
onChange: (e) => W("cvv", e.target.value.replace(/\D/g, "")),
|
|
264
266
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
265
267
|
})] })]
|
|
266
268
|
})]
|
|
267
269
|
}),
|
|
268
|
-
|
|
270
|
+
k === "upi" && /* @__PURE__ */ b("div", {
|
|
269
271
|
className: "mt-4 border-t border-border-subtle pt-4",
|
|
270
272
|
children: [/* @__PURE__ */ b("label", {
|
|
271
273
|
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
@@ -276,12 +278,12 @@ function C() {
|
|
|
276
278
|
}), /* @__PURE__ */ y("input", {
|
|
277
279
|
type: "text",
|
|
278
280
|
placeholder: "user@paytm",
|
|
279
|
-
value:
|
|
280
|
-
onChange: (e) =>
|
|
281
|
+
value: j.upiId,
|
|
282
|
+
onChange: (e) => W("upiId", e.target.value),
|
|
281
283
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
282
284
|
})]
|
|
283
285
|
}),
|
|
284
|
-
|
|
286
|
+
k === "wallet" && /* @__PURE__ */ b("div", {
|
|
285
287
|
className: "mt-4 flex items-start gap-3 rounded-lg bg-accent-blue-subtle/10 p-4 border border-accent-blue-subtle/20",
|
|
286
288
|
children: [/* @__PURE__ */ y(c, { className: "h-4 w-4 text-accent-blue mt-0.5 shrink-0" }), /* @__PURE__ */ y("p", {
|
|
287
289
|
className: "text-sm text-accent-blue",
|
|
@@ -304,22 +306,22 @@ function C() {
|
|
|
304
306
|
}),
|
|
305
307
|
/* @__PURE__ */ y("div", {
|
|
306
308
|
className: "flex flex-wrap gap-2 mb-3",
|
|
307
|
-
children:
|
|
309
|
+
children: C.map((e) => /* @__PURE__ */ y("button", {
|
|
308
310
|
type: "button",
|
|
309
311
|
onClick: () => {
|
|
310
|
-
|
|
312
|
+
P(e), I("");
|
|
311
313
|
},
|
|
312
|
-
className: t("flex-1 min-w-[64px] rounded-lg px-3 py-2.5 text-sm font-medium transition-colors",
|
|
314
|
+
className: t("flex-1 min-w-[64px] rounded-lg px-3 py-2.5 text-sm font-medium transition-colors", N === e && F === "" ? "bg-foreground text-background" : "bg-bg-sunken text-text-secondary hover:bg-accent hover:text-text-primary"),
|
|
313
315
|
children: e === 0 ? "No Tip" : `₹${e}`
|
|
314
316
|
}, e))
|
|
315
317
|
}),
|
|
316
318
|
/* @__PURE__ */ y("input", {
|
|
317
319
|
type: "number",
|
|
318
320
|
placeholder: "Custom tip amount",
|
|
319
|
-
value:
|
|
321
|
+
value: F,
|
|
320
322
|
onChange: (e) => {
|
|
321
323
|
let t = e.target.value;
|
|
322
|
-
|
|
324
|
+
I(t), P(parseInt(t) || 0);
|
|
323
325
|
},
|
|
324
326
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
325
327
|
})
|
|
@@ -329,8 +331,8 @@ function C() {
|
|
|
329
331
|
}), /* @__PURE__ */ y("textarea", {
|
|
330
332
|
rows: 3,
|
|
331
333
|
placeholder: "Any special requests for your order...",
|
|
332
|
-
value:
|
|
333
|
-
onChange: (e) =>
|
|
334
|
+
value: L,
|
|
335
|
+
onChange: (e) => R(e.target.value),
|
|
334
336
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none"
|
|
335
337
|
})] })]
|
|
336
338
|
})]
|
|
@@ -338,8 +340,8 @@ function C() {
|
|
|
338
340
|
]
|
|
339
341
|
}), /* @__PURE__ */ y("div", {
|
|
340
342
|
className: "lg:col-span-1",
|
|
341
|
-
children: /* @__PURE__ */ b(
|
|
342
|
-
className: "sticky top-6
|
|
343
|
+
children: /* @__PURE__ */ b(x, {
|
|
344
|
+
className: "sticky top-6 p-5",
|
|
343
345
|
children: [
|
|
344
346
|
/* @__PURE__ */ y("h2", {
|
|
345
347
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
@@ -350,25 +352,25 @@ function C() {
|
|
|
350
352
|
children: [/* @__PURE__ */ y("div", {
|
|
351
353
|
className: "h-12 w-12 rounded-md bg-bg-sunken overflow-hidden",
|
|
352
354
|
children: /* @__PURE__ */ y("img", {
|
|
353
|
-
src:
|
|
354
|
-
alt:
|
|
355
|
+
src: E.cartImage,
|
|
356
|
+
alt: E.cartName,
|
|
355
357
|
className: "h-full w-full object-cover"
|
|
356
358
|
})
|
|
357
359
|
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
358
360
|
className: "text-sm font-medium text-text-primary",
|
|
359
|
-
children:
|
|
361
|
+
children: E.cartName
|
|
360
362
|
}), /* @__PURE__ */ b("p", {
|
|
361
363
|
className: "text-xs text-text-secondary",
|
|
362
364
|
children: [
|
|
363
|
-
|
|
365
|
+
E.items.length,
|
|
364
366
|
" item",
|
|
365
|
-
|
|
367
|
+
E.items.length === 1 ? "" : "s"
|
|
366
368
|
]
|
|
367
369
|
})] })]
|
|
368
370
|
}),
|
|
369
371
|
/* @__PURE__ */ y("div", {
|
|
370
372
|
className: "space-y-2 mb-4",
|
|
371
|
-
children:
|
|
373
|
+
children: E.items.map((e) => /* @__PURE__ */ b("div", {
|
|
372
374
|
className: "flex justify-between items-start",
|
|
373
375
|
children: [/* @__PURE__ */ b("div", {
|
|
374
376
|
className: "flex-1 min-w-0",
|
|
@@ -405,12 +407,12 @@ function C() {
|
|
|
405
407
|
className: "text-text-secondary",
|
|
406
408
|
children: [
|
|
407
409
|
"Subtotal (",
|
|
408
|
-
|
|
410
|
+
H,
|
|
409
411
|
" items)"
|
|
410
412
|
]
|
|
411
413
|
}), /* @__PURE__ */ y("span", {
|
|
412
414
|
className: "text-text-primary",
|
|
413
|
-
children: a(
|
|
415
|
+
children: a(V.subtotal, { minimumFractionDigits: 0 })
|
|
414
416
|
})]
|
|
415
417
|
}),
|
|
416
418
|
/* @__PURE__ */ b("div", {
|
|
@@ -420,7 +422,7 @@ function C() {
|
|
|
420
422
|
children: "Delivery Fee"
|
|
421
423
|
}), /* @__PURE__ */ y("span", {
|
|
422
424
|
className: "text-text-primary",
|
|
423
|
-
children:
|
|
425
|
+
children: V.deliveryFee === 0 ? "FREE" : a(V.deliveryFee, { minimumFractionDigits: 0 })
|
|
424
426
|
})]
|
|
425
427
|
}),
|
|
426
428
|
/* @__PURE__ */ b("div", {
|
|
@@ -430,27 +432,27 @@ function C() {
|
|
|
430
432
|
children: "Tax"
|
|
431
433
|
}), /* @__PURE__ */ y("span", {
|
|
432
434
|
className: "text-text-primary",
|
|
433
|
-
children: a(
|
|
435
|
+
children: a(V.tax, { minimumFractionDigits: 0 })
|
|
434
436
|
})]
|
|
435
437
|
}),
|
|
436
|
-
|
|
438
|
+
N > 0 && /* @__PURE__ */ b("div", {
|
|
437
439
|
className: "flex justify-between",
|
|
438
440
|
children: [/* @__PURE__ */ y("span", {
|
|
439
441
|
className: "text-text-secondary",
|
|
440
442
|
children: "Tip"
|
|
441
443
|
}), /* @__PURE__ */ y("span", {
|
|
442
444
|
className: "text-text-primary",
|
|
443
|
-
children: a(
|
|
445
|
+
children: a(N, { minimumFractionDigits: 0 })
|
|
444
446
|
})]
|
|
445
447
|
}),
|
|
446
|
-
|
|
448
|
+
V.discount && V.discount > 0 && /* @__PURE__ */ b("div", {
|
|
447
449
|
className: "flex justify-between",
|
|
448
450
|
children: [/* @__PURE__ */ y("span", {
|
|
449
451
|
className: "text-status-success-text",
|
|
450
452
|
children: "Discount"
|
|
451
453
|
}), /* @__PURE__ */ b("span", {
|
|
452
454
|
className: "text-status-success-text",
|
|
453
|
-
children: ["-", a(
|
|
455
|
+
children: ["-", a(V.discount, { minimumFractionDigits: 0 })]
|
|
454
456
|
})]
|
|
455
457
|
})
|
|
456
458
|
]
|
|
@@ -462,37 +464,37 @@ function C() {
|
|
|
462
464
|
children: "Total"
|
|
463
465
|
}), /* @__PURE__ */ y("span", {
|
|
464
466
|
className: "text-base font-bold text-text-primary",
|
|
465
|
-
children: a(
|
|
467
|
+
children: a(V.total, { minimumFractionDigits: 0 })
|
|
466
468
|
})]
|
|
467
469
|
}),
|
|
468
470
|
/* @__PURE__ */ b("button", {
|
|
469
471
|
type: "button",
|
|
470
472
|
onClick: async () => {
|
|
471
|
-
if (!(!
|
|
472
|
-
let e = await
|
|
473
|
-
providerId:
|
|
473
|
+
if (!(!G() || !E)) try {
|
|
474
|
+
let e = await T.mutateAsync({
|
|
475
|
+
providerId: E.cartId,
|
|
474
476
|
customerId: _?.id,
|
|
475
|
-
items:
|
|
477
|
+
items: E.items.map((e) => ({
|
|
476
478
|
offeringId: e.id,
|
|
477
479
|
quantity: e.quantity,
|
|
478
480
|
customizations: e.customizations
|
|
479
481
|
})),
|
|
480
|
-
deliveryAddress: `${
|
|
481
|
-
paymentMethod:
|
|
482
|
-
notes:
|
|
483
|
-
deliveryFee:
|
|
484
|
-
tax:
|
|
485
|
-
tip:
|
|
486
|
-
total:
|
|
482
|
+
deliveryAddress: `${D.addressLine1}, ${D.addressLine2}, ${D.city}, ${D.state} - ${D.pincode}`,
|
|
483
|
+
paymentMethod: k.toUpperCase(),
|
|
484
|
+
notes: L,
|
|
485
|
+
deliveryFee: V.deliveryFee,
|
|
486
|
+
tax: V.tax,
|
|
487
|
+
tip: N,
|
|
488
|
+
total: V.total
|
|
487
489
|
});
|
|
488
490
|
alert("Order placed successfully!"), u(`/customer/order/${e.id}`);
|
|
489
491
|
} catch {
|
|
490
492
|
alert("Failed to place order. Please try again.");
|
|
491
493
|
}
|
|
492
494
|
},
|
|
493
|
-
disabled:
|
|
494
|
-
className: t("mt-6 flex w-full items-center justify-center gap-2 rounded-lg py-3 text-sm font-medium transition-opacity", "bg-foreground text-background",
|
|
495
|
-
children: [
|
|
495
|
+
disabled: T.isPending,
|
|
496
|
+
className: t("mt-6 flex w-full items-center justify-center gap-2 rounded-lg py-3 text-sm font-medium transition-opacity", "bg-foreground text-background", T.isPending ? "opacity-60 cursor-not-allowed" : "hover:opacity-90"),
|
|
497
|
+
children: [T.isPending ? /* @__PURE__ */ y(m, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ y(g, { className: "h-4 w-4" }), T.isPending ? "Placing Order..." : `Place Order - ${a(V.total, { minimumFractionDigits: 0 })}`]
|
|
496
498
|
}),
|
|
497
499
|
/* @__PURE__ */ y("p", {
|
|
498
500
|
className: "mt-3 text-center text-xs text-text-secondary",
|
|
@@ -527,6 +529,6 @@ function C() {
|
|
|
527
529
|
});
|
|
528
530
|
}
|
|
529
531
|
//#endregion
|
|
530
|
-
export {
|
|
532
|
+
export { w as CheckoutPage };
|
|
531
533
|
|
|
532
534
|
//# sourceMappingURL=CheckoutPage.js.map
|