@instockng/storefront-ui 1.0.28 → 1.0.30
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/components/Checkout.d.ts.map +1 -1
- package/dist/contexts/CartContext.d.ts.map +1 -1
- package/dist/index100.mjs +3 -3
- package/dist/index101.mjs +1 -1
- package/dist/index102.mjs +1 -1
- package/dist/index103.mjs +1 -1
- package/dist/index104.mjs +2 -2
- package/dist/index105.mjs +2 -2
- package/dist/index106.mjs +3 -3
- package/dist/index107.mjs +1 -1
- package/dist/index108.mjs +3 -3
- package/dist/index109.mjs +2 -2
- package/dist/index110.mjs +2 -2
- package/dist/index111.mjs +1 -1
- package/dist/index112.mjs +3 -3
- package/dist/index113.mjs +1 -1
- package/dist/index114.mjs +1 -1
- package/dist/index115.mjs +3 -3
- package/dist/index116.mjs +2 -2
- package/dist/index117.mjs +4 -4
- package/dist/index118.mjs +1 -1
- package/dist/index119.mjs +3 -3
- package/dist/index12.mjs +191 -183
- package/dist/index120.mjs +4 -4
- package/dist/index121.mjs +1 -1
- package/dist/index122.mjs +1 -1
- package/dist/index123.mjs +1 -1
- package/dist/index124.mjs +1 -1
- package/dist/index125.mjs +1 -1
- package/dist/index126.mjs +1 -1
- package/dist/index127.mjs +1 -1
- package/dist/index128.mjs +2 -2
- package/dist/index129.mjs +3 -3
- package/dist/index132.mjs +1 -1
- package/dist/index134.mjs +21 -2
- package/dist/index135.mjs +56 -2
- package/dist/index136.mjs +29 -2
- package/dist/index137.mjs +7 -2
- package/dist/index138.mjs +50 -16
- package/dist/index139.mjs +6 -32
- package/dist/index140.mjs +11 -37
- package/dist/index141.mjs +7 -18
- package/dist/index142.mjs +28 -18
- package/dist/index143.mjs +2 -2
- package/dist/index144.mjs +70 -20
- package/dist/index145.mjs +163 -42
- package/dist/index147.mjs +2 -30
- package/dist/index148.mjs +2 -18
- package/dist/index149.mjs +2 -2
- package/dist/index150.mjs +18 -2
- package/dist/index151.mjs +32 -2
- package/dist/index152.mjs +38 -2
- package/dist/index153.mjs +13 -67
- package/dist/index154.mjs +18 -2
- package/dist/index155.mjs +2 -53
- package/dist/index156.mjs +20 -2
- package/dist/index157.mjs +39 -29
- package/dist/index158.mjs +2 -152
- package/dist/index159.mjs +30 -2
- package/dist/index160.mjs +18 -2
- package/dist/index161.mjs +2 -19
- package/dist/index162.mjs +2 -2
- package/dist/index163.mjs +2 -2
- package/dist/index164.mjs +2 -26
- package/dist/index165.mjs +72 -2
- package/dist/index166.mjs +2 -2
- package/dist/index167.mjs +49 -20
- package/dist/index168.mjs +2 -23
- package/dist/index169.mjs +36 -2
- package/dist/index170.mjs +152 -2
- package/dist/index171.mjs +2 -2
- package/dist/index172.mjs +2 -23
- package/dist/index173.mjs +19 -2
- package/dist/index174.mjs +2 -23
- package/dist/index176.mjs +26 -2
- package/dist/index177.mjs +2 -2
- package/dist/index178.mjs +2 -23
- package/dist/index179.mjs +24 -2
- package/dist/index180.mjs +15 -15
- package/dist/index181.mjs +2 -2
- package/dist/index182.mjs +2 -2
- package/dist/index183.mjs +2 -2
- package/dist/index184.mjs +23 -2
- package/dist/index185.mjs +2 -2
- package/dist/index186.mjs +23 -2
- package/dist/index187.mjs +2 -2
- package/dist/index188.mjs +2 -2
- package/dist/index189.mjs +2 -127
- package/dist/index19.mjs +26 -13
- package/dist/index190.mjs +23 -2
- package/dist/index191.mjs +2 -74
- package/dist/index192.mjs +20 -71
- package/dist/index193.mjs +2 -21
- package/dist/index194.mjs +2 -56
- package/dist/index195.mjs +2 -29
- package/dist/index196.mjs +2 -7
- package/dist/index197.mjs +2 -52
- package/dist/index198.mjs +2 -6
- package/dist/index199.mjs +2 -12
- package/dist/index200.mjs +2 -7
- package/dist/index201.mjs +127 -28
- package/dist/index202.mjs +2 -2
- package/dist/index203.mjs +73 -69
- package/dist/index204.mjs +71 -164
- package/dist/index205.mjs +13 -2
- package/dist/index206.mjs +7 -2
- package/dist/index207.mjs +31 -2
- package/dist/index208.mjs +11 -2
- package/dist/index209.mjs +4 -2
- package/dist/index210.mjs +4 -2
- package/dist/index211.mjs +11 -36
- package/dist/index212.mjs +5 -2
- package/dist/index213.mjs +33 -2
- package/dist/index214.mjs +31 -2
- package/dist/index215.mjs +28 -2
- package/dist/index216.mjs +58 -241
- package/dist/index217.mjs +2 -2
- package/dist/index218.mjs +2 -33
- package/dist/index219.mjs +2 -65
- package/dist/index220.mjs +2 -25
- package/dist/index223.mjs +1 -1
- package/dist/index226.mjs +37 -2
- package/dist/index227.mjs +2 -2
- package/dist/index228.mjs +2 -2
- package/dist/index229.mjs +2 -2
- package/dist/index232.mjs +244 -2
- package/dist/index233.mjs +2 -4
- package/dist/index234.mjs +33 -2
- package/dist/index235.mjs +65 -2
- package/dist/index236.mjs +24 -30
- package/dist/index237.mjs +2 -11
- package/dist/index238.mjs +2 -4
- package/dist/index239.mjs +2 -4
- package/dist/index240.mjs +2 -13
- package/dist/index241.mjs +2 -7
- package/dist/index242.mjs +2 -12
- package/dist/index243.mjs +2 -5
- package/dist/index244.mjs +2 -33
- package/dist/index245.mjs +2 -31
- package/dist/index246.mjs +2 -28
- package/dist/index247.mjs +4 -61
- package/dist/index248.mjs +3 -2
- package/dist/index249.mjs +2 -18
- package/dist/index250.mjs +2 -47
- package/dist/index251.mjs +17 -2
- package/dist/index252.mjs +13 -2
- package/dist/index253.mjs +6 -2
- package/dist/index254.mjs +30 -2
- package/dist/index255.mjs +2 -91
- package/dist/index256.mjs +18 -2
- package/dist/index257.mjs +47 -2
- package/dist/index258.mjs +2 -3
- package/dist/index259.mjs +2 -2
- package/dist/index260.mjs +2 -2
- package/dist/index261.mjs +2 -17
- package/dist/index262.mjs +2 -13
- package/dist/index263.mjs +91 -6
- package/dist/index264.mjs +2 -30
- package/dist/index29.mjs +1 -1
- package/dist/index3.mjs +95 -105
- package/dist/index32.mjs +1 -1
- package/dist/index33.mjs +1 -1
- package/dist/index34.mjs +1 -1
- package/dist/index35.mjs +1 -1
- package/dist/index36.mjs +1 -1
- package/dist/index37.mjs +1 -1
- package/dist/index38.mjs +1 -1
- package/dist/index39.mjs +3 -3
- package/dist/index42.mjs +1 -1
- package/dist/index48.mjs +2 -2
- package/dist/index49.mjs +45 -45
- package/dist/index50.mjs +1 -1
- package/dist/index51.mjs +1 -1
- package/dist/index52.mjs +1 -1
- package/dist/index53.mjs +1 -1
- package/dist/index54.mjs +1 -1
- package/dist/index55.mjs +1 -1
- package/dist/index56.mjs +1 -1
- package/dist/index57.mjs +1 -1
- package/dist/index58.mjs +1 -1
- package/dist/index59.mjs +1 -1
- package/dist/index61.mjs +2 -153
- package/dist/index62.mjs +153 -2
- package/dist/index63.mjs +4 -22
- package/dist/index64.mjs +21 -73
- package/dist/index65.mjs +74 -14
- package/dist/index66.mjs +14 -62
- package/dist/index67.mjs +62 -4
- package/dist/index73.mjs +1 -1
- package/dist/index77.mjs +5 -5
- package/dist/index79.mjs +3 -3
- package/dist/index89.mjs +1 -1
- package/dist/index90.mjs +3 -3
- package/dist/index92.mjs +34 -2
- package/dist/index93.mjs +40 -31
- package/dist/index94.mjs +2 -43
- package/dist/index96.mjs +1 -1
- package/dist/index97.mjs +1 -1
- package/dist/index98.mjs +6 -6
- package/dist/index99.mjs +4 -4
- package/dist/lib/utils.d.ts +8 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/Checkout.tsx +18 -10
- package/src/contexts/CartContext.tsx +2 -20
- package/src/lib/utils.ts +20 -0
package/dist/index12.mjs
CHANGED
|
@@ -1,72 +1,74 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxs as a, jsx as e, Fragment as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { object as
|
|
2
|
+
import { jsxs as a, jsx as e, Fragment as Ce } from "react/jsx-runtime";
|
|
3
|
+
import { useState as x, useEffect as I, useMemo as O, useCallback as Pe } from "react";
|
|
4
|
+
import { object as G, string as v, ValidationError as ke } from "./index39.mjs";
|
|
5
5
|
import "./index20.mjs";
|
|
6
6
|
import "@tanstack/react-query";
|
|
7
|
-
import { useGetDeliveryZones as
|
|
8
|
-
import { useCart as
|
|
9
|
-
import { Modal as
|
|
7
|
+
import { useGetDeliveryZones as Me } from "./index35.mjs";
|
|
8
|
+
import { useCart as qe } from "./index3.mjs";
|
|
9
|
+
import { Modal as ie } from "./index16.mjs";
|
|
10
10
|
import { FormInput as k } from "./index17.mjs";
|
|
11
|
-
import { FormSelect as
|
|
12
|
-
import { Button as
|
|
13
|
-
import { Loader2 as
|
|
14
|
-
import { formatCurrency as M, cn as C } from "./index19.mjs";
|
|
15
|
-
import
|
|
16
|
-
import { usePaystackPayment as
|
|
17
|
-
const
|
|
18
|
-
firstName:
|
|
19
|
-
lastName:
|
|
20
|
-
email:
|
|
21
|
-
phone:
|
|
22
|
-
if (!
|
|
23
|
-
const q =
|
|
11
|
+
import { FormSelect as ce } from "./index18.mjs";
|
|
12
|
+
import { Button as T } from "./index13.mjs";
|
|
13
|
+
import { Loader2 as K, ChevronLeft as Ie, ChevronRight as je, CheckCircle as Ze, Package as oe, Banknote as me, Mail as Se, Phone as ze, ChevronDown as Fe, Zap as Le } from "lucide-react";
|
|
14
|
+
import { formatCurrency as M, cn as C, getFbCookies as ue } from "./index19.mjs";
|
|
15
|
+
import Te from "./index40.mjs";
|
|
16
|
+
import { usePaystackPayment as Be } from "./index41.mjs";
|
|
17
|
+
const Ae = (i) => i.replace(/\D/g, ""), _e = G({
|
|
18
|
+
firstName: v().required("First name is required").min(2, "First name must be at least 2 characters").max(50, "First name must be less than 50 characters"),
|
|
19
|
+
lastName: v().required("Last name is required").min(2, "Last name must be at least 2 characters").max(50, "Last name must be less than 50 characters"),
|
|
20
|
+
email: v().required("Email is required").email("Please enter a valid email address"),
|
|
21
|
+
phone: v().required("Phone number is required").test("nigerian-phone", "Please enter a valid Nigerian phone number (e.g. 0812 564 8668)", (i) => {
|
|
22
|
+
if (!i) return !1;
|
|
23
|
+
const q = Ae(i);
|
|
24
24
|
return [
|
|
25
25
|
/^0[789]\d{9}$/
|
|
26
26
|
// 0xxxxxxxxx (11 digits total)
|
|
27
|
-
].some((
|
|
27
|
+
].some((N) => N.test(q));
|
|
28
28
|
})
|
|
29
|
-
}),
|
|
30
|
-
address:
|
|
31
|
-
city:
|
|
32
|
-
state:
|
|
33
|
-
deliveryZoneId:
|
|
34
|
-
}),
|
|
35
|
-
paymentMethod:
|
|
29
|
+
}), Re = G({
|
|
30
|
+
address: v().required("Street address is required").min(10, "Please provide a complete address"),
|
|
31
|
+
city: v().required("City is required").min(3, "City name must be at least 3 characters"),
|
|
32
|
+
state: v().required("State is required").test("not-empty", "State is required", (i) => !!i && i.trim() !== ""),
|
|
33
|
+
deliveryZoneId: v().required("Delivery zone is required").test("not-empty", "Delivery zone is required", (i) => !!i && i.trim() !== "")
|
|
34
|
+
}), $e = G({
|
|
35
|
+
paymentMethod: v().oneOf(["cod", "online"], "Please select a payment method").required("Payment method is required")
|
|
36
36
|
});
|
|
37
|
-
function
|
|
38
|
-
isOpen:
|
|
37
|
+
function rt({
|
|
38
|
+
isOpen: i,
|
|
39
39
|
onClose: q,
|
|
40
40
|
initialData: n,
|
|
41
|
-
onSuccess:
|
|
42
|
-
onError:
|
|
43
|
-
submitButtonText:
|
|
41
|
+
onSuccess: N,
|
|
42
|
+
onError: c,
|
|
43
|
+
submitButtonText: he = "Place Order",
|
|
44
44
|
refundPolicy: j
|
|
45
45
|
}) {
|
|
46
|
-
var
|
|
47
|
-
const
|
|
48
|
-
publicKey:
|
|
46
|
+
var D, ee, te, ae, re, se, le, ne, de;
|
|
47
|
+
const [o, b] = x("customer"), [Z, ye] = x(void 0), [f, W] = x(void 0), [p, B] = x(null), { refetch: V, isLoading: Y, cart: s, updateCartMutation: A, checkoutMutation: fe, clearAndCreateNewCart: H } = qe(), U = (D = s == null ? void 0 : s.brand) == null ? void 0 : D.paystackPublicKey, J = Be({
|
|
48
|
+
publicKey: U || "",
|
|
49
49
|
onSuccess: async (t) => {
|
|
50
50
|
try {
|
|
51
|
-
const l = await P.mutateAsync({
|
|
51
|
+
const { fbc: l, fbp: d } = ue(), m = await P.mutateAsync({
|
|
52
52
|
firstName: r.firstName,
|
|
53
53
|
lastName: r.lastName,
|
|
54
54
|
email: r.email,
|
|
55
55
|
phone: r.phone,
|
|
56
56
|
address: r.address,
|
|
57
57
|
city: r.city,
|
|
58
|
-
deliveryZoneId:
|
|
58
|
+
deliveryZoneId: f || r.deliveryZoneId,
|
|
59
59
|
paymentMethod: r.paymentMethod,
|
|
60
|
-
paystackReference: t.reference
|
|
60
|
+
paystackReference: t.reference,
|
|
61
|
+
fbc: l,
|
|
62
|
+
fbp: d
|
|
61
63
|
});
|
|
62
|
-
if ("error" in
|
|
63
|
-
const
|
|
64
|
-
|
|
64
|
+
if ("error" in m) {
|
|
65
|
+
const $ = m.error;
|
|
66
|
+
c == null || c(new Error(($ == null ? void 0 : $.message) || "Checkout failed"));
|
|
65
67
|
return;
|
|
66
68
|
}
|
|
67
|
-
|
|
69
|
+
B(m), H(), N == null || N(m.id);
|
|
68
70
|
} catch (l) {
|
|
69
|
-
|
|
71
|
+
c == null || c(l);
|
|
70
72
|
}
|
|
71
73
|
},
|
|
72
74
|
onClose: () => {
|
|
@@ -74,15 +76,15 @@ function et({
|
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
I(() => {
|
|
77
|
-
|
|
78
|
-
}, [
|
|
79
|
-
const { data:
|
|
80
|
-
enabled: !!((
|
|
81
|
-
}),
|
|
79
|
+
i && V();
|
|
80
|
+
}, [i, V]);
|
|
81
|
+
const { data: w } = Me(((ee = s == null ? void 0 : s.brand) == null ? void 0 : ee.id) || "", {
|
|
82
|
+
enabled: !!((te = s == null ? void 0 : s.brand) != null && te.id)
|
|
83
|
+
}), u = O(() => w == null ? void 0 : w.find((t) => t.id === Z), [w, Z]), y = O(() => u == null ? void 0 : u.zones.find((t) => t.id === f), [u, f]), P = fe;
|
|
82
84
|
I(() => {
|
|
83
|
-
|
|
84
|
-
}, [
|
|
85
|
-
const [r,
|
|
85
|
+
i || (B(null), b("customer"), P.reset());
|
|
86
|
+
}, [i]);
|
|
87
|
+
const [r, _] = x({
|
|
86
88
|
firstName: (n == null ? void 0 : n.firstName) || "",
|
|
87
89
|
lastName: (n == null ? void 0 : n.lastName) || "",
|
|
88
90
|
email: (n == null ? void 0 : n.email) || "",
|
|
@@ -94,11 +96,11 @@ function et({
|
|
|
94
96
|
notes: (n == null ? void 0 : n.notes) || ""
|
|
95
97
|
});
|
|
96
98
|
I(() => {
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
const [
|
|
99
|
+
i && b("customer");
|
|
100
|
+
}, [i]);
|
|
101
|
+
const [Q, X] = x(!1);
|
|
100
102
|
I(() => {
|
|
101
|
-
|
|
103
|
+
i && s && !n && !Q && (_((t) => {
|
|
102
104
|
var l;
|
|
103
105
|
return {
|
|
104
106
|
...t,
|
|
@@ -108,68 +110,72 @@ function et({
|
|
|
108
110
|
phone: s.customerPhone || t.phone,
|
|
109
111
|
deliveryZoneId: ((l = s.deliveryZone) == null ? void 0 : l.id) || t.deliveryZoneId
|
|
110
112
|
};
|
|
111
|
-
}),
|
|
112
|
-
}, [
|
|
113
|
-
if (
|
|
114
|
-
const t =
|
|
115
|
-
t &&
|
|
113
|
+
}), X(!0)), i || X(!1);
|
|
114
|
+
}, [i, s, n, Q]), I(() => {
|
|
115
|
+
if (f) {
|
|
116
|
+
const t = u == null ? void 0 : u.zones.find((l) => l.id === f);
|
|
117
|
+
t && _((l) => ({
|
|
116
118
|
...l,
|
|
117
119
|
paymentMethod: t.allowOnline ? "online" : "cod"
|
|
118
120
|
}));
|
|
119
121
|
}
|
|
120
|
-
}, [
|
|
121
|
-
const [
|
|
122
|
-
const { name: l, value:
|
|
123
|
-
|
|
124
|
-
}, z =
|
|
122
|
+
}, [f, u]);
|
|
123
|
+
const [h, S] = x({}), [R, pe] = x(!1), g = (t) => {
|
|
124
|
+
const { name: l, value: d } = t.target;
|
|
125
|
+
_((m) => ({ ...m, [l]: d })), h[l] && S((m) => ({ ...m, [l]: void 0 }));
|
|
126
|
+
}, z = Pe(
|
|
125
127
|
(t) => {
|
|
126
128
|
const l = r[t];
|
|
127
129
|
if (!l) return;
|
|
128
|
-
const
|
|
129
|
-
t === "firstName" ?
|
|
130
|
+
const d = {};
|
|
131
|
+
t === "firstName" ? d.customerFirstName = l : t === "lastName" ? d.customerLastName = l : t === "email" ? d.customerEmail = l : t === "phone" && (d.customerPhone = l), A.mutate(d);
|
|
130
132
|
},
|
|
131
|
-
[r,
|
|
133
|
+
[r, A]
|
|
132
134
|
), F = (t) => {
|
|
133
135
|
const l = {};
|
|
134
136
|
try {
|
|
135
137
|
if (t === "customer")
|
|
136
|
-
|
|
138
|
+
_e.validateSync(r, { abortEarly: !1 });
|
|
137
139
|
else if (t === "delivery") {
|
|
138
|
-
const
|
|
140
|
+
const d = {
|
|
139
141
|
address: r.address,
|
|
140
142
|
city: r.city,
|
|
141
143
|
state: Z || r.state || "",
|
|
142
|
-
deliveryZoneId:
|
|
144
|
+
deliveryZoneId: f || r.deliveryZoneId || ""
|
|
143
145
|
};
|
|
144
|
-
|
|
145
|
-
} else t === "payment" &&
|
|
146
|
-
} catch (
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
Re.validateSync(d, { abortEarly: !1 });
|
|
147
|
+
} else t === "payment" && $e.validateSync(r, { abortEarly: !1 });
|
|
148
|
+
} catch (d) {
|
|
149
|
+
d instanceof ke && d.inner.forEach((m) => {
|
|
150
|
+
m.path && (l[m.path] = m.message);
|
|
149
151
|
});
|
|
150
152
|
}
|
|
151
153
|
return S(l), Object.keys(l).length === 0;
|
|
152
|
-
},
|
|
153
|
-
F(
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
},
|
|
154
|
+
}, ve = () => {
|
|
155
|
+
F(o) && (o === "customer" ? b("delivery") : o === "delivery" && b("payment"));
|
|
156
|
+
}, Ne = () => {
|
|
157
|
+
o === "payment" ? b("delivery") : o === "delivery" && b("customer");
|
|
158
|
+
}, be = async () => {
|
|
157
159
|
if (!F("customer")) {
|
|
158
|
-
|
|
160
|
+
b("customer");
|
|
159
161
|
return;
|
|
160
162
|
}
|
|
161
163
|
if (!F("delivery")) {
|
|
162
|
-
|
|
164
|
+
b("delivery");
|
|
163
165
|
return;
|
|
164
166
|
}
|
|
165
167
|
if (F("payment")) {
|
|
166
168
|
if (r.paymentMethod === "online") {
|
|
167
|
-
if (!
|
|
168
|
-
|
|
169
|
+
if (!U) {
|
|
170
|
+
c == null || c(new Error("Paystack is not configured. Please contact support."));
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (!J.isLoaded) {
|
|
174
|
+
c == null || c(new Error("Payment system is loading. Please try again."));
|
|
169
175
|
return;
|
|
170
176
|
}
|
|
171
177
|
const t = Math.round(s.pricing.total * 100);
|
|
172
|
-
|
|
178
|
+
J.initializePayment({
|
|
173
179
|
email: r.email || (s == null ? void 0 : s.customerEmail) || "customer@example.com",
|
|
174
180
|
amount: t,
|
|
175
181
|
currency: "NGN",
|
|
@@ -192,107 +198,109 @@ function et({
|
|
|
192
198
|
return;
|
|
193
199
|
}
|
|
194
200
|
try {
|
|
195
|
-
const t = await P.mutateAsync({
|
|
201
|
+
const { fbc: t, fbp: l } = ue(), d = await P.mutateAsync({
|
|
196
202
|
firstName: r.firstName,
|
|
197
203
|
lastName: r.lastName,
|
|
198
204
|
email: r.email,
|
|
199
205
|
phone: r.phone,
|
|
200
206
|
address: r.address,
|
|
201
207
|
city: r.city,
|
|
202
|
-
deliveryZoneId:
|
|
203
|
-
paymentMethod: r.paymentMethod
|
|
208
|
+
deliveryZoneId: f || r.deliveryZoneId,
|
|
209
|
+
paymentMethod: r.paymentMethod,
|
|
210
|
+
fbc: t,
|
|
211
|
+
fbp: l
|
|
204
212
|
});
|
|
205
|
-
if ("error" in
|
|
206
|
-
const
|
|
207
|
-
|
|
213
|
+
if ("error" in d) {
|
|
214
|
+
const m = d.error;
|
|
215
|
+
c == null || c(new Error((m == null ? void 0 : m.message) || "Checkout failed"));
|
|
208
216
|
return;
|
|
209
217
|
}
|
|
210
|
-
|
|
218
|
+
B(d), H(), N == null || N(d.id);
|
|
211
219
|
} catch (t) {
|
|
212
|
-
|
|
220
|
+
c == null || c(t);
|
|
213
221
|
}
|
|
214
222
|
}
|
|
215
|
-
},
|
|
223
|
+
}, ge = {
|
|
216
224
|
customer: "Customer Information",
|
|
217
225
|
delivery: "Delivery Address",
|
|
218
226
|
payment: "Payment Method"
|
|
219
|
-
},
|
|
220
|
-
(
|
|
221
|
-
Y && /* @__PURE__ */ e("div", { className: "absolute flex items-center justify-center inset-0 bg-white opacity-50", children: /* @__PURE__ */ e(
|
|
227
|
+
}, xe = O(() => ge[o], [o]), we = /* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
228
|
+
(o === "payment" || o === "delivery") && ((ae = s == null ? void 0 : s.pricing) == null ? void 0 : ae.total) && /* @__PURE__ */ a("div", { className: "text-sm text-black relative", children: [
|
|
229
|
+
Y && /* @__PURE__ */ e("div", { className: "absolute flex items-center justify-center inset-0 bg-white opacity-50", children: /* @__PURE__ */ e(K, { className: "animate-spin text-accent-500" }) }),
|
|
222
230
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
223
231
|
/* @__PURE__ */ e("span", { children: "Subtotal" }),
|
|
224
|
-
/* @__PURE__ */ e("span", { children: M(((
|
|
232
|
+
/* @__PURE__ */ e("span", { children: M(((re = s == null ? void 0 : s.pricing) == null ? void 0 : re.subtotal) ?? 0) })
|
|
225
233
|
] }),
|
|
226
234
|
s.pricing.discount && /* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
227
235
|
/* @__PURE__ */ e("span", { children: "Discount" }),
|
|
228
236
|
/* @__PURE__ */ a("span", { className: "text-green-600", children: [
|
|
229
237
|
"-",
|
|
230
|
-
M(((
|
|
238
|
+
M(((le = (se = s == null ? void 0 : s.pricing) == null ? void 0 : se.discount) == null ? void 0 : le.amount) ?? 0)
|
|
231
239
|
] })
|
|
232
240
|
] }),
|
|
233
241
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
234
242
|
/* @__PURE__ */ e("span", { children: "Delivery Fee" }),
|
|
235
|
-
/* @__PURE__ */ e("span", { children: M(((
|
|
243
|
+
/* @__PURE__ */ e("span", { children: M(((ne = s == null ? void 0 : s.pricing) == null ? void 0 : ne.deliveryCharge) ?? 0) })
|
|
236
244
|
] }),
|
|
237
245
|
/* @__PURE__ */ e("hr", { className: "border-gray-200 my-2" }),
|
|
238
246
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between font-medium", children: [
|
|
239
247
|
/* @__PURE__ */ e("span", { children: "Total" }),
|
|
240
|
-
/* @__PURE__ */ e("span", { children: M(((
|
|
248
|
+
/* @__PURE__ */ e("span", { children: M(((de = s == null ? void 0 : s.pricing) == null ? void 0 : de.total) ?? 0) })
|
|
241
249
|
] })
|
|
242
250
|
] }),
|
|
243
251
|
/* @__PURE__ */ a("div", { className: "flex gap-3", children: [
|
|
244
|
-
|
|
245
|
-
|
|
252
|
+
o !== "customer" && /* @__PURE__ */ a(
|
|
253
|
+
T,
|
|
246
254
|
{
|
|
247
255
|
type: "button",
|
|
248
256
|
variant: "outline",
|
|
249
|
-
onClick:
|
|
257
|
+
onClick: Ne,
|
|
250
258
|
className: "flex-1 border-gray-400",
|
|
251
259
|
size: "lg",
|
|
252
260
|
children: [
|
|
253
|
-
/* @__PURE__ */ e(
|
|
261
|
+
/* @__PURE__ */ e(Ie, { className: "mr-2 h-4 w-4" }),
|
|
254
262
|
"Back"
|
|
255
263
|
]
|
|
256
264
|
}
|
|
257
265
|
),
|
|
258
|
-
|
|
259
|
-
|
|
266
|
+
o !== "payment" ? /* @__PURE__ */ a(
|
|
267
|
+
T,
|
|
260
268
|
{
|
|
261
269
|
type: "button",
|
|
262
|
-
onClick:
|
|
270
|
+
onClick: ve,
|
|
263
271
|
className: "flex-1 bg-accent-500 text-white hover:bg-accent-600",
|
|
264
272
|
size: "lg",
|
|
265
273
|
children: [
|
|
266
274
|
"Next",
|
|
267
|
-
/* @__PURE__ */ e(
|
|
275
|
+
/* @__PURE__ */ e(je, { className: "ml-2 h-4 w-4" })
|
|
268
276
|
]
|
|
269
277
|
}
|
|
270
278
|
) : /* @__PURE__ */ e(
|
|
271
|
-
|
|
279
|
+
T,
|
|
272
280
|
{
|
|
273
281
|
type: "button",
|
|
274
|
-
onClick:
|
|
282
|
+
onClick: be,
|
|
275
283
|
disabled: P.isPending,
|
|
276
284
|
className: "flex-1 bg-accent-500 text-white hover:bg-accent-600",
|
|
277
285
|
size: "lg",
|
|
278
|
-
children: P.isPending ? /* @__PURE__ */ a(
|
|
279
|
-
/* @__PURE__ */ e(
|
|
286
|
+
children: P.isPending ? /* @__PURE__ */ a(Ce, { children: [
|
|
287
|
+
/* @__PURE__ */ e(K, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
280
288
|
"Processing..."
|
|
281
|
-
] }) :
|
|
289
|
+
] }) : he
|
|
282
290
|
}
|
|
283
291
|
)
|
|
284
292
|
] }),
|
|
285
293
|
P.isError && /* @__PURE__ */ e("div", { className: "rounded-lg bg-red-50 p-3 text-sm text-red-600", children: "Failed to place order. Please check your information and try again." })
|
|
286
294
|
] }), L = (t) => !(s != null && s.availablePaymentMethods.includes(t));
|
|
287
|
-
if (
|
|
295
|
+
if (p)
|
|
288
296
|
return /* @__PURE__ */ e(
|
|
289
|
-
|
|
297
|
+
ie,
|
|
290
298
|
{
|
|
291
|
-
isOpen:
|
|
299
|
+
isOpen: i,
|
|
292
300
|
onClose: q,
|
|
293
301
|
title: "Order Placed Successfully!",
|
|
294
302
|
footer: /* @__PURE__ */ e(
|
|
295
|
-
|
|
303
|
+
T,
|
|
296
304
|
{
|
|
297
305
|
onClick: q,
|
|
298
306
|
className: "w-full bg-accent-500 text-white hover:bg-accent-600",
|
|
@@ -303,43 +311,43 @@ function et({
|
|
|
303
311
|
size: "lg",
|
|
304
312
|
contentClassName: "p-6",
|
|
305
313
|
children: /* @__PURE__ */ a("div", { className: "text-center space-y-6", children: [
|
|
306
|
-
/* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
314
|
+
/* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e("div", { className: "w-20 h-20 bg-green-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ e(Ze, { className: "h-12 w-12 text-green-600" }) }) }),
|
|
307
315
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
308
316
|
/* @__PURE__ */ e("h3", { className: "text-2xl font-bold text-gray-900", children: "Thank You!" }),
|
|
309
317
|
/* @__PURE__ */ e("p", { className: "text-gray-600", children: "Your order has been placed successfully." })
|
|
310
318
|
] }),
|
|
311
319
|
/* @__PURE__ */ a("div", { className: "bg-gray-50 rounded-lg p-6 space-y-4", children: [
|
|
312
320
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-center space-x-2 text-gray-700", children: [
|
|
313
|
-
/* @__PURE__ */ e(
|
|
321
|
+
/* @__PURE__ */ e(oe, { className: "h-5 w-5" }),
|
|
314
322
|
/* @__PURE__ */ a("span", { className: "font-medium", children: [
|
|
315
323
|
"Order #",
|
|
316
|
-
|
|
324
|
+
p.orderNumber
|
|
317
325
|
] })
|
|
318
326
|
] }),
|
|
319
327
|
/* @__PURE__ */ a("div", { className: "border-t border-gray-200 pt-4 space-y-3", children: [
|
|
320
328
|
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
321
329
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Customer" }),
|
|
322
330
|
/* @__PURE__ */ a("span", { className: "font-medium text-gray-900", children: [
|
|
323
|
-
|
|
331
|
+
p.firstName,
|
|
324
332
|
" ",
|
|
325
|
-
|
|
333
|
+
p.lastName
|
|
326
334
|
] })
|
|
327
335
|
] }),
|
|
328
336
|
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
329
337
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Phone" }),
|
|
330
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children:
|
|
338
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: p.phone })
|
|
331
339
|
] }),
|
|
332
|
-
|
|
340
|
+
p.email && /* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
333
341
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Email" }),
|
|
334
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children:
|
|
342
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: p.email })
|
|
335
343
|
] }),
|
|
336
344
|
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
337
345
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Payment Method" }),
|
|
338
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children:
|
|
346
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: p.paymentMethod === "cod" ? "Cash on Delivery" : "Online Payment" })
|
|
339
347
|
] }),
|
|
340
348
|
/* @__PURE__ */ a("div", { className: "flex justify-between text-sm", children: [
|
|
341
349
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Total" }),
|
|
342
|
-
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900", children: M(
|
|
350
|
+
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900", children: M(p.totalPrice) })
|
|
343
351
|
] })
|
|
344
352
|
] })
|
|
345
353
|
] }),
|
|
@@ -351,27 +359,27 @@ function et({
|
|
|
351
359
|
] })
|
|
352
360
|
}
|
|
353
361
|
);
|
|
354
|
-
const
|
|
362
|
+
const E = y && (o === "delivery" || o === "payment") && (y.waybillOnly || !(y != null && y.allowCOD));
|
|
355
363
|
return /* @__PURE__ */ e(
|
|
356
|
-
|
|
364
|
+
ie,
|
|
357
365
|
{
|
|
358
|
-
isOpen:
|
|
366
|
+
isOpen: i,
|
|
359
367
|
onClose: q,
|
|
360
|
-
title:
|
|
361
|
-
footer:
|
|
368
|
+
title: xe,
|
|
369
|
+
footer: we,
|
|
362
370
|
size: "lg",
|
|
363
371
|
contentClassName: "p-0",
|
|
364
|
-
children: Y ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-[300px]", children: /* @__PURE__ */ e(
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
/* @__PURE__ */ e(
|
|
372
|
+
children: Y ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-[300px]", children: /* @__PURE__ */ e(K, { className: "h-8 w-8 animate-spin text-gray-600" }) }) : /* @__PURE__ */ e("div", { className: "w-full overflow-hidden", children: /* @__PURE__ */ a("div", { className: "relative w-full", children: [
|
|
373
|
+
E && /* @__PURE__ */ a("div", { className: "space-y-3 p-4 pb-0", children: [
|
|
374
|
+
y.noteTitle && y.noteContent && /* @__PURE__ */ e("div", { className: "bg-amber-50 border border-amber-200 rounded-lg p-4", children: /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
|
|
375
|
+
/* @__PURE__ */ e(oe, { className: "h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5" }),
|
|
368
376
|
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
369
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-amber-900", children:
|
|
370
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-amber-800", children:
|
|
377
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-amber-900", children: y.noteTitle }),
|
|
378
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-amber-800", children: y.noteContent })
|
|
371
379
|
] })
|
|
372
380
|
] }) }),
|
|
373
|
-
!(
|
|
374
|
-
/* @__PURE__ */ e(
|
|
381
|
+
!(y != null && y.allowCOD) && /* @__PURE__ */ e("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
|
|
382
|
+
/* @__PURE__ */ e(me, { className: "h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5" }),
|
|
375
383
|
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
376
384
|
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-blue-900", children: "Cash on Delivery Unavailable" }),
|
|
377
385
|
/* @__PURE__ */ e("p", { className: "text-sm text-blue-800", children: "We're unable to offer cash on delivery to this location. Please use online payment to complete your order." })
|
|
@@ -383,9 +391,9 @@ function et({
|
|
|
383
391
|
{
|
|
384
392
|
className: C(
|
|
385
393
|
"flex transition-transform duration-300 ease-in-out w-full",
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
394
|
+
o === "customer" && "translate-x-0",
|
|
395
|
+
o === "delivery" && "-translate-x-full",
|
|
396
|
+
o === "payment" && "-translate-x-[200%]"
|
|
389
397
|
),
|
|
390
398
|
children: [
|
|
391
399
|
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */ e("div", { className: "space-y-4", children: /* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
@@ -396,9 +404,9 @@ function et({
|
|
|
396
404
|
type: "text",
|
|
397
405
|
name: "firstName",
|
|
398
406
|
value: r.firstName,
|
|
399
|
-
onChange:
|
|
407
|
+
onChange: g,
|
|
400
408
|
onBlur: () => z("firstName"),
|
|
401
|
-
error:
|
|
409
|
+
error: h.firstName,
|
|
402
410
|
autoCorrect: "off",
|
|
403
411
|
required: !0
|
|
404
412
|
}
|
|
@@ -410,9 +418,9 @@ function et({
|
|
|
410
418
|
type: "text",
|
|
411
419
|
name: "lastName",
|
|
412
420
|
value: r.lastName,
|
|
413
|
-
onChange:
|
|
421
|
+
onChange: g,
|
|
414
422
|
onBlur: () => z("lastName"),
|
|
415
|
-
error:
|
|
423
|
+
error: h.lastName,
|
|
416
424
|
autoCorrect: "off",
|
|
417
425
|
required: !0
|
|
418
426
|
}
|
|
@@ -424,10 +432,10 @@ function et({
|
|
|
424
432
|
type: "email",
|
|
425
433
|
name: "email",
|
|
426
434
|
value: r.email,
|
|
427
|
-
onChange:
|
|
435
|
+
onChange: g,
|
|
428
436
|
onBlur: () => z("email"),
|
|
429
|
-
error:
|
|
430
|
-
icon: /* @__PURE__ */ e(
|
|
437
|
+
error: h.email,
|
|
438
|
+
icon: /* @__PURE__ */ e(Se, { size: 16 }),
|
|
431
439
|
autoCorrect: "off",
|
|
432
440
|
required: !0
|
|
433
441
|
}
|
|
@@ -439,12 +447,12 @@ function et({
|
|
|
439
447
|
type: "tel",
|
|
440
448
|
name: "phone",
|
|
441
449
|
value: r.phone,
|
|
442
|
-
onChange:
|
|
450
|
+
onChange: g,
|
|
443
451
|
onBlur: () => z("phone"),
|
|
444
452
|
placeholder: "e.g. 08012345678",
|
|
445
453
|
maxLength: 18,
|
|
446
|
-
error:
|
|
447
|
-
icon: /* @__PURE__ */ e(
|
|
454
|
+
error: h.phone,
|
|
455
|
+
icon: /* @__PURE__ */ e(ze, { size: 16 }),
|
|
448
456
|
autoCorrect: "off",
|
|
449
457
|
required: !0,
|
|
450
458
|
className: "font-semibold"
|
|
@@ -459,8 +467,8 @@ function et({
|
|
|
459
467
|
type: "text",
|
|
460
468
|
name: "address",
|
|
461
469
|
value: r.address,
|
|
462
|
-
onChange:
|
|
463
|
-
error:
|
|
470
|
+
onChange: g,
|
|
471
|
+
error: h.address,
|
|
464
472
|
autoCorrect: "off",
|
|
465
473
|
required: !0
|
|
466
474
|
}
|
|
@@ -473,46 +481,46 @@ function et({
|
|
|
473
481
|
type: "text",
|
|
474
482
|
name: "city",
|
|
475
483
|
value: r.city,
|
|
476
|
-
onChange:
|
|
477
|
-
error:
|
|
484
|
+
onChange: g,
|
|
485
|
+
error: h.city,
|
|
478
486
|
autoCorrect: "off",
|
|
479
487
|
required: !0
|
|
480
488
|
}
|
|
481
489
|
),
|
|
482
490
|
/* @__PURE__ */ a(
|
|
483
|
-
|
|
491
|
+
ce,
|
|
484
492
|
{
|
|
485
493
|
label: "State",
|
|
486
494
|
name: "state",
|
|
487
495
|
value: Z || "",
|
|
488
496
|
onChange: (t) => {
|
|
489
|
-
|
|
497
|
+
W("");
|
|
490
498
|
const l = t.target.value;
|
|
491
|
-
|
|
499
|
+
ye(l || void 0), h.state && S((d) => ({ ...d, state: void 0 }));
|
|
492
500
|
},
|
|
493
|
-
error:
|
|
501
|
+
error: h.state,
|
|
494
502
|
required: !0,
|
|
495
503
|
children: [
|
|
496
504
|
/* @__PURE__ */ e("option", { disabled: !0, value: "", children: "Select State" }),
|
|
497
|
-
|
|
505
|
+
w == null ? void 0 : w.map((t) => /* @__PURE__ */ e("option", { value: t.id, children: t.name }, t.id))
|
|
498
506
|
]
|
|
499
507
|
}
|
|
500
508
|
),
|
|
501
509
|
/* @__PURE__ */ a(
|
|
502
|
-
|
|
510
|
+
ce,
|
|
503
511
|
{
|
|
504
512
|
label: "Delivery Zone",
|
|
505
|
-
value:
|
|
513
|
+
value: f || "",
|
|
506
514
|
onChange: (t) => {
|
|
507
515
|
const l = t.target.value;
|
|
508
|
-
|
|
516
|
+
W(l || void 0), h.deliveryZoneId && S((d) => ({ ...d, deliveryZoneId: void 0 })), l && A.mutate({ deliveryZoneId: l });
|
|
509
517
|
},
|
|
510
|
-
disabled: !
|
|
511
|
-
error:
|
|
518
|
+
disabled: !u,
|
|
519
|
+
error: h.deliveryZoneId,
|
|
512
520
|
required: !0,
|
|
513
521
|
children: [
|
|
514
|
-
/* @__PURE__ */ e("option", { disabled: !0, value: "", children:
|
|
515
|
-
|
|
522
|
+
/* @__PURE__ */ e("option", { disabled: !0, value: "", children: u ? "Select Delivery Zone" : "Select State First" }),
|
|
523
|
+
u == null ? void 0 : u.zones.map((t) => /* @__PURE__ */ a("option", { value: t.id, children: [
|
|
516
524
|
t.name,
|
|
517
525
|
" (",
|
|
518
526
|
M(t.deliveryCost),
|
|
@@ -524,22 +532,22 @@ function et({
|
|
|
524
532
|
] })
|
|
525
533
|
] }) }),
|
|
526
534
|
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */ a("div", { className: "space-y-6", children: [
|
|
527
|
-
j && /* @__PURE__ */ a("div", { className: `border border-gray-200 rounded-lg ${
|
|
535
|
+
j && /* @__PURE__ */ a("div", { className: `border border-gray-200 rounded-lg ${E ? "mt-4" : ""}`, children: [
|
|
528
536
|
/* @__PURE__ */ a(
|
|
529
537
|
"button",
|
|
530
538
|
{
|
|
531
539
|
type: "button",
|
|
532
|
-
onClick: () =>
|
|
540
|
+
onClick: () => pe(!R),
|
|
533
541
|
className: "overflow-hidden w-full flex items-center overflow-hidden rounded-lg rounded-b-none justify-between p-4 text-left hover:bg-gray-50 transition-colors",
|
|
534
542
|
children: [
|
|
535
543
|
/* @__PURE__ */ e("span", { className: "text-sm font-bold text-accent-700", children: j.title || "🤔 Curious about Refunds?" }),
|
|
536
544
|
/* @__PURE__ */ e(
|
|
537
|
-
|
|
545
|
+
Fe,
|
|
538
546
|
{
|
|
539
547
|
size: 16,
|
|
540
548
|
className: C(
|
|
541
549
|
"transform transition-transform duration-200 text-gray-500",
|
|
542
|
-
|
|
550
|
+
R && "rotate-180"
|
|
543
551
|
)
|
|
544
552
|
}
|
|
545
553
|
)
|
|
@@ -551,7 +559,7 @@ function et({
|
|
|
551
559
|
{
|
|
552
560
|
className: C(
|
|
553
561
|
"overflow-hidden transition-all duration-300 ease-in-out",
|
|
554
|
-
|
|
562
|
+
R ? "max-h-96 opacity-100" : "max-h-0 opacity-0"
|
|
555
563
|
),
|
|
556
564
|
children: /* @__PURE__ */ e("div", { className: "px-4 pb-4 border-t border-gray-100", children: /* @__PURE__ */ e("div", { className: "text-sm text-gray-600 space-y-3 pt-4", children: j.policies && /* @__PURE__ */ a("div", { children: [
|
|
557
565
|
/* @__PURE__ */ e("h4", { className: "font-bold text-gray-800 mb-2", children: "Our Refund Policy" }),
|
|
@@ -581,7 +589,7 @@ function et({
|
|
|
581
589
|
value: "online",
|
|
582
590
|
disabled: L("online"),
|
|
583
591
|
checked: r.paymentMethod === "online",
|
|
584
|
-
onChange:
|
|
592
|
+
onChange: g,
|
|
585
593
|
className: "sr-only"
|
|
586
594
|
}
|
|
587
595
|
),
|
|
@@ -593,7 +601,7 @@ function et({
|
|
|
593
601
|
"p-3 rounded-full",
|
|
594
602
|
r.paymentMethod === "online" ? "bg-accent-100 text-accent-600" : "bg-gray-100 text-gray-600"
|
|
595
603
|
),
|
|
596
|
-
children: /* @__PURE__ */ e(
|
|
604
|
+
children: /* @__PURE__ */ e(Le, { size: 24 })
|
|
597
605
|
}
|
|
598
606
|
),
|
|
599
607
|
/* @__PURE__ */ a("div", { children: [
|
|
@@ -602,7 +610,7 @@ function et({
|
|
|
602
610
|
/* @__PURE__ */ e(
|
|
603
611
|
"img",
|
|
604
612
|
{
|
|
605
|
-
src:
|
|
613
|
+
src: Te,
|
|
606
614
|
alt: "Paystack",
|
|
607
615
|
className: "h-4 w-auto mt-2 mx-auto"
|
|
608
616
|
}
|
|
@@ -630,7 +638,7 @@ function et({
|
|
|
630
638
|
value: "cod",
|
|
631
639
|
disabled: L("cod"),
|
|
632
640
|
checked: r.paymentMethod === "cod",
|
|
633
|
-
onChange:
|
|
641
|
+
onChange: g,
|
|
634
642
|
className: "sr-only"
|
|
635
643
|
}
|
|
636
644
|
),
|
|
@@ -642,7 +650,7 @@ function et({
|
|
|
642
650
|
"p-3 rounded-full",
|
|
643
651
|
r.paymentMethod === "cod" ? "bg-accent-100 text-accent-600" : "bg-gray-100 text-gray-600"
|
|
644
652
|
),
|
|
645
|
-
children: /* @__PURE__ */ e(
|
|
653
|
+
children: /* @__PURE__ */ e(me, { size: 24 })
|
|
646
654
|
}
|
|
647
655
|
),
|
|
648
656
|
/* @__PURE__ */ a("div", { children: [
|
|
@@ -655,7 +663,7 @@ function et({
|
|
|
655
663
|
}
|
|
656
664
|
)
|
|
657
665
|
] }),
|
|
658
|
-
|
|
666
|
+
h.paymentMethod && /* @__PURE__ */ e("p", { className: "text-red-600 text-sm", children: h.paymentMethod })
|
|
659
667
|
] }) })
|
|
660
668
|
]
|
|
661
669
|
}
|
|
@@ -665,5 +673,5 @@ function et({
|
|
|
665
673
|
);
|
|
666
674
|
}
|
|
667
675
|
export {
|
|
668
|
-
|
|
676
|
+
rt as Checkout
|
|
669
677
|
};
|