@instockng/storefront-ui 1.0.80 → 1.0.82
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/index100.mjs +3 -3
- package/dist/index142.mjs +1 -1
- package/dist/index144.mjs +21 -2
- package/dist/index145.mjs +54 -19
- package/dist/index146.mjs +28 -55
- package/dist/index147.mjs +6 -28
- package/dist/index148.mjs +51 -6
- package/dist/index149.mjs +5 -51
- package/dist/index150.mjs +12 -6
- package/dist/index151.mjs +7 -12
- package/dist/index152.mjs +27 -6
- package/dist/index153.mjs +2 -28
- package/dist/index154.mjs +70 -2
- package/dist/index155.mjs +164 -67
- package/dist/index156.mjs +2 -167
- package/dist/index16.mjs +223 -219
- package/dist/index160.mjs +1 -1
- package/dist/index161.mjs +1 -1
- package/dist/index162.mjs +1 -1
- package/dist/index163.mjs +1 -1
- package/dist/index164.mjs +1 -1
- package/dist/index166.mjs +1 -1
- package/dist/index167.mjs +1 -1
- package/dist/index169.mjs +2 -2
- package/dist/index170.mjs +1 -1
- package/dist/index175.mjs +2 -2
- package/dist/index177.mjs +1 -1
- package/dist/index179.mjs +2 -2
- package/dist/index180.mjs +5 -5
- package/dist/index183.mjs +1 -1
- package/dist/index186.mjs +1 -1
- package/dist/index189.mjs +1 -1
- package/dist/index190.mjs +1 -1
- package/dist/index194.mjs +1 -1
- package/dist/index196.mjs +1 -1
- package/dist/index200.mjs +1 -1
- package/dist/index202.mjs +1 -1
- package/dist/index211.mjs +2 -2
- package/dist/index213.mjs +1 -1
- package/dist/index214.mjs +1 -1
- package/dist/index215.mjs +31 -2
- package/dist/index216.mjs +11 -2
- package/dist/index217.mjs +4 -2
- package/dist/index218.mjs +4 -2
- package/dist/index219.mjs +13 -2
- package/dist/index220.mjs +7 -2
- package/dist/index221.mjs +11 -107
- package/dist/index222.mjs +5 -2
- package/dist/index223.mjs +33 -2
- package/dist/index224.mjs +31 -2
- package/dist/index225.mjs +28 -2
- package/dist/index226.mjs +58 -34
- package/dist/index227.mjs +2 -2
- package/dist/index228.mjs +2 -244
- package/dist/index229.mjs +2 -2
- package/dist/index230.mjs +2 -33
- package/dist/index231.mjs +2 -65
- package/dist/index232.mjs +2 -25
- package/dist/index233.mjs +108 -2
- package/dist/index234.mjs +2 -2
- package/dist/index235.mjs +2 -2
- package/dist/index236.mjs +2 -2
- package/dist/index238.mjs +37 -2
- package/dist/index240.mjs +244 -2
- package/dist/index242.mjs +32 -30
- package/dist/index243.mjs +64 -10
- package/dist/index244.mjs +24 -3
- package/dist/index245.mjs +2 -4
- package/dist/index246.mjs +2 -13
- package/dist/index247.mjs +2 -7
- package/dist/index248.mjs +2 -12
- package/dist/index249.mjs +2 -5
- package/dist/index250.mjs +2 -33
- package/dist/index251.mjs +2 -31
- package/dist/index252.mjs +2 -28
- package/dist/index253.mjs +2 -61
- package/dist/index254.mjs +2 -2
- package/dist/index255.mjs +4 -2
- package/dist/index256.mjs +2 -2
- package/dist/index257.mjs +2 -4
- package/dist/index258.mjs +3 -2
- package/dist/index259.mjs +2 -2
- package/dist/index260.mjs +2 -18
- package/dist/index261.mjs +16 -46
- package/dist/index262.mjs +13 -2
- package/dist/index263.mjs +6 -2
- package/dist/index264.mjs +30 -2
- package/dist/index266.mjs +2 -91
- package/dist/index267.mjs +18 -3
- package/dist/index268.mjs +47 -2
- package/dist/index269.mjs +2 -2
- package/dist/index270.mjs +2 -17
- package/dist/index271.mjs +2 -13
- package/dist/index272.mjs +2 -6
- package/dist/index273.mjs +91 -30
- package/dist/index36.mjs +1 -1
- package/dist/index37.mjs +1 -1
- package/dist/index38.mjs +1 -1
- package/dist/index39.mjs +1 -1
- package/dist/index40.mjs +1 -1
- package/dist/index41.mjs +2 -2
- package/dist/index43.mjs +2 -2
- package/dist/index46.mjs +3 -3
- package/dist/index50.mjs +1 -1
- package/dist/index57.mjs +1 -1
- package/dist/index58.mjs +1 -1
- package/dist/index59.mjs +1 -1
- package/dist/index60.mjs +1 -1
- package/dist/index61.mjs +1 -1
- package/dist/index62.mjs +1 -1
- package/dist/index63.mjs +1 -1
- package/dist/index64.mjs +1 -1
- package/dist/index65.mjs +1 -1
- package/dist/index66.mjs +1 -1
- package/dist/index67.mjs +1 -1
- package/dist/index68.mjs +1 -1
- package/dist/index69.mjs +1 -1
- package/dist/index70.mjs +4 -23
- package/dist/index71.mjs +19 -149
- package/dist/index72.mjs +24 -2
- package/dist/index73.mjs +2 -23
- package/dist/index74.mjs +149 -71
- package/dist/index75.mjs +74 -14
- package/dist/index76.mjs +14 -62
- package/dist/index77.mjs +62 -4
- package/dist/index83.mjs +1 -1
- package/dist/index87.mjs +5 -5
- package/dist/index89.mjs +3 -3
- package/dist/index99.mjs +1 -1
- package/package.json +1 -1
- package/src/components/Checkout.tsx +19 -3
package/dist/index16.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as w, useEffect as
|
|
4
|
-
import { object as
|
|
2
|
+
import { jsxs as r, jsx as e, Fragment as K } from "react/jsx-runtime";
|
|
3
|
+
import { useState as w, useEffect as Z, useMemo as G, useCallback as Se } from "react";
|
|
4
|
+
import { object as Y, string as N, ValidationError as je } from "./index46.mjs";
|
|
5
5
|
import "./index24.mjs";
|
|
6
6
|
import "@tanstack/react-query";
|
|
7
|
-
import { useGetDeliveryZones as
|
|
8
|
-
import { useCart as
|
|
9
|
-
import { Modal as
|
|
7
|
+
import { useGetDeliveryZones as Ze } from "./index40.mjs";
|
|
8
|
+
import { useCart as _e } from "./index3.mjs";
|
|
9
|
+
import { Modal as ye } from "./index20.mjs";
|
|
10
10
|
import { FormInput as I } from "./index21.mjs";
|
|
11
|
-
import { FormSelect as
|
|
12
|
-
import { Button as
|
|
13
|
-
import { Loader2 as
|
|
14
|
-
import { PostPurchaseUpsell as
|
|
15
|
-
import { formatCurrency as
|
|
16
|
-
import
|
|
17
|
-
import { usePaystackPayment as
|
|
18
|
-
const
|
|
11
|
+
import { FormSelect as fe } from "./index22.mjs";
|
|
12
|
+
import { Button as W } from "./index17.mjs";
|
|
13
|
+
import { Loader2 as $, ChevronLeft as Le, ChevronRight as Fe, Package as ve, Banknote as Ne, Mail as Te, Phone as ze, ChevronDown as Ae, Zap as Be } from "lucide-react";
|
|
14
|
+
import { PostPurchaseUpsell as We } from "./index47.mjs";
|
|
15
|
+
import { formatCurrency as _, cn as k, getFbCookies as O, getTikTokCookies as V } from "./index23.mjs";
|
|
16
|
+
import $e from "./index48.mjs";
|
|
17
|
+
import { usePaystackPayment as Re } from "./index49.mjs";
|
|
18
|
+
const Ue = "2348125648668", He = `https://wa.me/${Ue}`, Ke = (d) => d.replace(/\D/g, ""), Ge = Y({
|
|
19
19
|
firstName: N().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"),
|
|
20
20
|
lastName: N().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"),
|
|
21
21
|
email: N().required("Email is required").email("Please enter a valid email address"),
|
|
@@ -27,50 +27,50 @@ const Re = "2348125648668", He = `https://wa.me/${Re}`, Ke = (d) => d.replace(/\
|
|
|
27
27
|
// 0xxxxxxxxx (11 digits total)
|
|
28
28
|
].some((g) => g.test(q));
|
|
29
29
|
})
|
|
30
|
-
}),
|
|
30
|
+
}), Oe = Y({
|
|
31
31
|
address: N().required("Street address is required").min(10, "Please provide a complete address"),
|
|
32
32
|
city: N().required("City is required").min(3, "City name must be at least 3 characters"),
|
|
33
33
|
state: N().required("State is required").test("not-empty", "State is required", (d) => !!d && d.trim() !== ""),
|
|
34
34
|
deliveryZoneId: N().required("Delivery zone is required").test("not-empty", "Delivery zone is required", (d) => !!d && d.trim() !== "")
|
|
35
|
-
}),
|
|
35
|
+
}), Ve = Y({
|
|
36
36
|
paymentMethod: N().oneOf(["cod", "online"], "Please select a payment method").required("Payment method is required")
|
|
37
37
|
});
|
|
38
|
-
function
|
|
38
|
+
function mt({
|
|
39
39
|
isOpen: d,
|
|
40
40
|
onClose: q,
|
|
41
41
|
initialData: l,
|
|
42
42
|
onSuccess: g,
|
|
43
43
|
onError: o,
|
|
44
|
-
submitButtonText:
|
|
45
|
-
refundPolicy:
|
|
44
|
+
submitButtonText: ge = "Place Order",
|
|
45
|
+
refundPolicy: L
|
|
46
46
|
}) {
|
|
47
|
-
var
|
|
48
|
-
const [c, b] = w("customer"), [
|
|
47
|
+
var se, ne, le, ie, de, oe, ce, me, he, ue, pe;
|
|
48
|
+
const [c, b] = w("customer"), [F, be] = w(void 0), [p, J] = w(void 0), [y, R] = w(null), { refetch: Q, isLoading: X, cart: a, updateCartMutation: S, checkoutMutation: xe, clearAndCreateNewCart: E } = _e(), D = (se = a == null ? void 0 : a.brand) == null ? void 0 : se.paystackPublicKey, ee = Re({
|
|
49
49
|
isOpen: d,
|
|
50
|
-
publicKey:
|
|
51
|
-
onSuccess: async (
|
|
50
|
+
publicKey: D || "",
|
|
51
|
+
onSuccess: async (s) => {
|
|
52
52
|
try {
|
|
53
|
-
const { fbc: n, fbp: i } =
|
|
53
|
+
const { fbc: n, fbp: i } = O(), { ttp: m, ttclid: j } = V(), v = await M.mutateAsync({
|
|
54
54
|
firstName: t.firstName,
|
|
55
55
|
lastName: t.lastName,
|
|
56
56
|
email: t.email,
|
|
57
57
|
phone: t.phone,
|
|
58
58
|
address: t.address,
|
|
59
59
|
city: t.city,
|
|
60
|
-
deliveryZoneId:
|
|
60
|
+
deliveryZoneId: p || t.deliveryZoneId,
|
|
61
61
|
paymentMethod: t.paymentMethod,
|
|
62
|
-
paystackReference:
|
|
62
|
+
paystackReference: s.reference,
|
|
63
63
|
fbc: n,
|
|
64
64
|
fbp: i,
|
|
65
65
|
ttp: m,
|
|
66
|
-
ttclid:
|
|
66
|
+
ttclid: j
|
|
67
67
|
});
|
|
68
68
|
if ("error" in v) {
|
|
69
69
|
const P = v.error;
|
|
70
70
|
o == null || o(new Error((P == null ? void 0 : P.message) || "Checkout failed"));
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
R(v), E(), g == null || g(v);
|
|
74
74
|
} catch (n) {
|
|
75
75
|
o == null || o(n);
|
|
76
76
|
}
|
|
@@ -79,16 +79,16 @@ function ct({
|
|
|
79
79
|
console.log("Payment popup closed by user");
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
|
-
|
|
83
|
-
d &&
|
|
84
|
-
}, [d,
|
|
85
|
-
const { data: C } =
|
|
86
|
-
enabled: !!((
|
|
87
|
-
}), h =
|
|
88
|
-
|
|
89
|
-
d || (
|
|
82
|
+
Z(() => {
|
|
83
|
+
d && Q();
|
|
84
|
+
}, [d, Q]);
|
|
85
|
+
const { data: C } = Ze(((ne = a == null ? void 0 : a.brand) == null ? void 0 : ne.id) || "", {
|
|
86
|
+
enabled: !!((le = a == null ? void 0 : a.brand) != null && le.id)
|
|
87
|
+
}), h = G(() => C == null ? void 0 : C.find((s) => s.id === F), [C, F]), f = G(() => h == null ? void 0 : h.zones.find((s) => s.id === p), [h, p]), M = xe;
|
|
88
|
+
Z(() => {
|
|
89
|
+
d || (R(null), b("customer"), M.reset());
|
|
90
90
|
}, [d]);
|
|
91
|
-
const [t,
|
|
91
|
+
const [t, U] = w({
|
|
92
92
|
firstName: (l == null ? void 0 : l.firstName) || "",
|
|
93
93
|
lastName: (l == null ? void 0 : l.lastName) || "",
|
|
94
94
|
email: (l == null ? void 0 : l.email) || "",
|
|
@@ -99,104 +99,104 @@ function ct({
|
|
|
99
99
|
paymentMethod: (l == null ? void 0 : l.paymentMethod) || "online",
|
|
100
100
|
notes: (l == null ? void 0 : l.notes) || ""
|
|
101
101
|
});
|
|
102
|
-
|
|
102
|
+
Z(() => {
|
|
103
103
|
d && b("customer");
|
|
104
104
|
}, [d]);
|
|
105
|
-
const [
|
|
106
|
-
|
|
107
|
-
d &&
|
|
105
|
+
const [te, ae] = w(!1);
|
|
106
|
+
Z(() => {
|
|
107
|
+
d && a && !l && !te && (U((s) => {
|
|
108
108
|
var n;
|
|
109
109
|
return {
|
|
110
|
-
...
|
|
111
|
-
firstName:
|
|
112
|
-
lastName:
|
|
113
|
-
email:
|
|
114
|
-
phone:
|
|
115
|
-
deliveryZoneId: ((n =
|
|
110
|
+
...s,
|
|
111
|
+
firstName: a.customerFirstName || s.firstName,
|
|
112
|
+
lastName: a.customerLastName || s.lastName,
|
|
113
|
+
email: a.customerEmail || s.email,
|
|
114
|
+
phone: a.customerPhone || s.phone,
|
|
115
|
+
deliveryZoneId: ((n = a.deliveryZone) == null ? void 0 : n.id) || s.deliveryZoneId
|
|
116
116
|
};
|
|
117
|
-
}),
|
|
118
|
-
}, [d,
|
|
119
|
-
if (
|
|
120
|
-
const
|
|
121
|
-
|
|
117
|
+
}), ae(!0)), d || ae(!1);
|
|
118
|
+
}, [d, a, l, te]), Z(() => {
|
|
119
|
+
if (p) {
|
|
120
|
+
const s = h == null ? void 0 : h.zones.find((n) => n.id === p);
|
|
121
|
+
s && U((n) => ({
|
|
122
122
|
...n,
|
|
123
|
-
paymentMethod:
|
|
123
|
+
paymentMethod: s.allowOnline ? "online" : "cod"
|
|
124
124
|
}));
|
|
125
125
|
}
|
|
126
|
-
}, [
|
|
127
|
-
const [u, T] = w({}), [H,
|
|
128
|
-
const { name: n, value: i } =
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
(
|
|
132
|
-
const n = t[
|
|
126
|
+
}, [p, h]);
|
|
127
|
+
const [u, T] = w({}), [H, we] = w(!1), x = (s) => {
|
|
128
|
+
const { name: n, value: i } = s.target;
|
|
129
|
+
U((m) => ({ ...m, [n]: i })), u[n] && T((m) => ({ ...m, [n]: void 0 }));
|
|
130
|
+
}, z = Se(
|
|
131
|
+
(s) => {
|
|
132
|
+
const n = t[s];
|
|
133
133
|
if (!n) return;
|
|
134
134
|
const i = {};
|
|
135
|
-
|
|
135
|
+
s === "firstName" ? i.customerFirstName = n : s === "lastName" ? i.customerLastName = n : s === "email" ? i.customerEmail = n : s === "phone" && (i.customerPhone = n), S.mutate(i);
|
|
136
136
|
},
|
|
137
|
-
[t,
|
|
138
|
-
),
|
|
137
|
+
[t, S]
|
|
138
|
+
), A = (s) => {
|
|
139
139
|
const n = {};
|
|
140
140
|
try {
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
else if (
|
|
141
|
+
if (s === "customer")
|
|
142
|
+
Ge.validateSync(t, { abortEarly: !1 });
|
|
143
|
+
else if (s === "delivery") {
|
|
144
144
|
const i = {
|
|
145
145
|
address: t.address,
|
|
146
146
|
city: t.city,
|
|
147
|
-
state:
|
|
148
|
-
deliveryZoneId:
|
|
147
|
+
state: F || t.state || "",
|
|
148
|
+
deliveryZoneId: p || t.deliveryZoneId || ""
|
|
149
149
|
};
|
|
150
|
-
|
|
151
|
-
} else
|
|
150
|
+
Oe.validateSync(i, { abortEarly: !1 });
|
|
151
|
+
} else s === "payment" && Ve.validateSync(t, { abortEarly: !1 });
|
|
152
152
|
} catch (i) {
|
|
153
|
-
i instanceof
|
|
153
|
+
i instanceof je && i.inner.forEach((m) => {
|
|
154
154
|
m.path && (n[m.path] = m.message);
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
return T(n), Object.keys(n).length === 0;
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
},
|
|
158
|
+
}, Ce = () => {
|
|
159
|
+
A(c) && (c === "customer" ? b("delivery") : c === "delivery" && b("payment"));
|
|
160
|
+
}, Pe = () => {
|
|
161
161
|
c === "payment" ? b("delivery") : c === "delivery" && b("customer");
|
|
162
|
-
},
|
|
163
|
-
var
|
|
164
|
-
if (!
|
|
162
|
+
}, ke = async () => {
|
|
163
|
+
var s;
|
|
164
|
+
if (!A("customer")) {
|
|
165
165
|
b("customer");
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
|
-
if (!
|
|
168
|
+
if (!A("delivery")) {
|
|
169
169
|
b("delivery");
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
if (
|
|
172
|
+
if (A("payment")) {
|
|
173
173
|
if (t.paymentMethod === "online") {
|
|
174
|
-
if (!
|
|
174
|
+
if (!D) {
|
|
175
175
|
o == null || o(new Error("Paystack is not configured. Please contact support."));
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
|
-
if (!
|
|
178
|
+
if (!ee.isLoaded) {
|
|
179
179
|
o == null || o(new Error("Payment system is loading. Please try again."));
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
const n = Math.round(
|
|
183
|
-
|
|
184
|
-
email: t.email || (
|
|
182
|
+
const n = Math.round(a.pricing.total * 100), { fbc: i, fbp: m } = O(), { ttp: j, ttclid: v } = V();
|
|
183
|
+
ee.initializePayment({
|
|
184
|
+
email: t.email || (a == null ? void 0 : a.customerEmail) || "customer@example.com",
|
|
185
185
|
amount: n,
|
|
186
186
|
currency: "NGN",
|
|
187
187
|
metadata: {
|
|
188
|
-
cartId:
|
|
189
|
-
brandSlug: (
|
|
188
|
+
cartId: a == null ? void 0 : a.id,
|
|
189
|
+
brandSlug: (s = a == null ? void 0 : a.brand) == null ? void 0 : s.slug,
|
|
190
190
|
address: t.address,
|
|
191
191
|
city: t.city,
|
|
192
|
-
delivery_zone_id:
|
|
192
|
+
delivery_zone_id: p || t.deliveryZoneId,
|
|
193
193
|
firstName: t.firstName,
|
|
194
194
|
lastName: t.lastName,
|
|
195
195
|
email: t.email,
|
|
196
196
|
phone: t.phone,
|
|
197
197
|
fbc: i,
|
|
198
198
|
fbp: m,
|
|
199
|
-
ttp:
|
|
199
|
+
ttp: j,
|
|
200
200
|
ttclid: v,
|
|
201
201
|
custom_fields: [
|
|
202
202
|
{
|
|
@@ -222,7 +222,7 @@ function ct({
|
|
|
222
222
|
{
|
|
223
223
|
display_name: "Delivery Zone ID",
|
|
224
224
|
variable_name: "delivery_zone_id",
|
|
225
|
-
value:
|
|
225
|
+
value: p || t.deliveryZoneId
|
|
226
226
|
}
|
|
227
227
|
]
|
|
228
228
|
}
|
|
@@ -230,118 +230,122 @@ function ct({
|
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
232
|
try {
|
|
233
|
-
const { fbc: n, fbp: i } =
|
|
233
|
+
const { fbc: n, fbp: i } = O(), { ttp: m, ttclid: j } = V(), v = await M.mutateAsync({
|
|
234
234
|
firstName: t.firstName,
|
|
235
235
|
lastName: t.lastName,
|
|
236
236
|
email: t.email,
|
|
237
237
|
phone: t.phone,
|
|
238
238
|
address: t.address,
|
|
239
239
|
city: t.city,
|
|
240
|
-
deliveryZoneId:
|
|
240
|
+
deliveryZoneId: p || t.deliveryZoneId,
|
|
241
241
|
paymentMethod: t.paymentMethod,
|
|
242
242
|
fbc: n,
|
|
243
243
|
fbp: i,
|
|
244
244
|
ttp: m,
|
|
245
|
-
ttclid:
|
|
245
|
+
ttclid: j
|
|
246
246
|
});
|
|
247
247
|
if ("error" in v) {
|
|
248
248
|
const P = v.error;
|
|
249
249
|
o == null || o(new Error((P == null ? void 0 : P.message) || "Checkout failed"));
|
|
250
250
|
return;
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
R(v), E(), g == null || g(v);
|
|
253
253
|
} catch (n) {
|
|
254
254
|
o == null || o(n);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
},
|
|
257
|
+
}, Me = {
|
|
258
258
|
customer: "Customer Information",
|
|
259
259
|
delivery: "Delivery Address",
|
|
260
260
|
payment: "Payment Method"
|
|
261
|
-
},
|
|
262
|
-
(c === "payment" || c === "delivery") && ((
|
|
263
|
-
|
|
264
|
-
/* @__PURE__ */
|
|
261
|
+
}, Ie = G(() => Me[c], [c]), qe = /* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
262
|
+
(c === "payment" || c === "delivery") && ((ie = a == null ? void 0 : a.pricing) == null ? void 0 : ie.total) && /* @__PURE__ */ r("div", { className: "text-sm text-black relative", children: [
|
|
263
|
+
X && /* @__PURE__ */ e("div", { className: "absolute flex items-center justify-center inset-0 bg-white opacity-50", children: /* @__PURE__ */ e($, { className: "animate-spin text-accent-500" }) }),
|
|
264
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between font-medium", children: [
|
|
265
265
|
/* @__PURE__ */ e("span", { children: "Subtotal" }),
|
|
266
|
-
/* @__PURE__ */ e("span", { children:
|
|
266
|
+
/* @__PURE__ */ e("span", { children: _(((de = a == null ? void 0 : a.pricing) == null ? void 0 : de.subtotal) ?? 0) })
|
|
267
267
|
] }),
|
|
268
|
-
|
|
268
|
+
a.pricing.discount && /* @__PURE__ */ r("div", { className: "flex items-center justify-between font-medium", children: [
|
|
269
269
|
/* @__PURE__ */ e("span", { children: "Discount" }),
|
|
270
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ r("span", { className: "text-green-600", children: [
|
|
271
271
|
"-",
|
|
272
|
-
|
|
272
|
+
_(((ce = (oe = a == null ? void 0 : a.pricing) == null ? void 0 : oe.discount) == null ? void 0 : ce.amount) ?? 0)
|
|
273
273
|
] })
|
|
274
274
|
] }),
|
|
275
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between font-medium", children: [
|
|
276
276
|
/* @__PURE__ */ e("span", { children: "Delivery Fee" }),
|
|
277
|
-
/* @__PURE__ */ e("span", { children:
|
|
277
|
+
/* @__PURE__ */ e("span", { children: p ? ((me = a == null ? void 0 : a.pricing) == null ? void 0 : me.deliveryCharge) === 0 ? /* @__PURE__ */ e("span", { className: "text-green-600", children: "Free" }) : _(((he = a == null ? void 0 : a.pricing) == null ? void 0 : he.deliveryCharge) ?? 0) : /* @__PURE__ */ e("span", { className: "text-gray-400 text-xs", children: "Select zone first" }) })
|
|
278
278
|
] }),
|
|
279
279
|
/* @__PURE__ */ e("hr", { className: "border-gray-200 my-2" }),
|
|
280
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between font-medium", children: [
|
|
281
281
|
/* @__PURE__ */ e("span", { children: "Total" }),
|
|
282
|
-
/* @__PURE__ */ e("span", { children:
|
|
282
|
+
/* @__PURE__ */ e("span", { children: _(((ue = a == null ? void 0 : a.pricing) == null ? void 0 : ue.total) ?? 0) })
|
|
283
283
|
] })
|
|
284
284
|
] }),
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
c !== "customer" && /* @__PURE__ */
|
|
287
|
-
|
|
285
|
+
/* @__PURE__ */ r("div", { className: "flex gap-3", children: [
|
|
286
|
+
c !== "customer" && /* @__PURE__ */ r(
|
|
287
|
+
W,
|
|
288
288
|
{
|
|
289
289
|
type: "button",
|
|
290
290
|
variant: "outline",
|
|
291
|
-
onClick:
|
|
291
|
+
onClick: Pe,
|
|
292
292
|
className: "flex-1 border-gray-400",
|
|
293
293
|
size: "lg",
|
|
294
294
|
children: [
|
|
295
|
-
/* @__PURE__ */ e(
|
|
295
|
+
/* @__PURE__ */ e(Le, { className: "mr-2 h-4 w-4" }),
|
|
296
296
|
"Back"
|
|
297
297
|
]
|
|
298
298
|
}
|
|
299
299
|
),
|
|
300
|
-
c !== "payment" ? /* @__PURE__ */
|
|
301
|
-
|
|
300
|
+
c !== "payment" ? /* @__PURE__ */ e(
|
|
301
|
+
W,
|
|
302
302
|
{
|
|
303
303
|
type: "button",
|
|
304
|
-
onClick:
|
|
304
|
+
onClick: Ce,
|
|
305
|
+
disabled: c === "delivery" && S.isPending,
|
|
305
306
|
className: "flex-1 bg-accent-500 text-white hover:bg-accent-600",
|
|
306
307
|
size: "lg",
|
|
307
|
-
children: [
|
|
308
|
+
children: c === "delivery" && S.isPending ? /* @__PURE__ */ r(K, { children: [
|
|
309
|
+
/* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
310
|
+
"Updating..."
|
|
311
|
+
] }) : /* @__PURE__ */ r(K, { children: [
|
|
308
312
|
"Next",
|
|
309
|
-
/* @__PURE__ */ e(
|
|
310
|
-
]
|
|
313
|
+
/* @__PURE__ */ e(Fe, { className: "ml-2 h-4 w-4" })
|
|
314
|
+
] })
|
|
311
315
|
}
|
|
312
316
|
) : /* @__PURE__ */ e(
|
|
313
|
-
|
|
317
|
+
W,
|
|
314
318
|
{
|
|
315
319
|
type: "button",
|
|
316
|
-
onClick:
|
|
320
|
+
onClick: ke,
|
|
317
321
|
disabled: M.isPending,
|
|
318
322
|
className: "flex-1 bg-accent-500 text-white hover:bg-accent-600",
|
|
319
323
|
size: "lg",
|
|
320
|
-
children: M.isPending ? /* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */ e(
|
|
324
|
+
children: M.isPending ? /* @__PURE__ */ r(K, { children: [
|
|
325
|
+
/* @__PURE__ */ e($, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
322
326
|
"Processing..."
|
|
323
|
-
] }) :
|
|
327
|
+
] }) : ge
|
|
324
328
|
}
|
|
325
329
|
)
|
|
326
330
|
] }),
|
|
327
331
|
M.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." })
|
|
328
|
-
] }),
|
|
329
|
-
if (
|
|
332
|
+
] }), B = (s) => !(a != null && a.availablePaymentMethods.includes(s));
|
|
333
|
+
if (y)
|
|
330
334
|
return /* @__PURE__ */ e(
|
|
331
|
-
|
|
335
|
+
ye,
|
|
332
336
|
{
|
|
333
337
|
isOpen: d,
|
|
334
338
|
onClose: q,
|
|
335
|
-
title: /* @__PURE__ */
|
|
339
|
+
title: /* @__PURE__ */ r("span", { className: "flex items-center gap-3", children: [
|
|
336
340
|
/* @__PURE__ */ e("span", { className: "w-10 h-10 bg-green-100 rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ e("svg", { className: "h-6 w-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }) }),
|
|
337
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ r("span", { children: [
|
|
338
342
|
"Thank You!",
|
|
339
343
|
/* @__PURE__ */ e("br", {}),
|
|
340
344
|
"We'll contact you shortly"
|
|
341
345
|
] })
|
|
342
346
|
] }),
|
|
343
347
|
footer: /* @__PURE__ */ e(
|
|
344
|
-
|
|
348
|
+
W,
|
|
345
349
|
{
|
|
346
350
|
onClick: q,
|
|
347
351
|
className: "w-full bg-accent-500 text-white hover:bg-accent-600",
|
|
@@ -351,82 +355,82 @@ function ct({
|
|
|
351
355
|
),
|
|
352
356
|
size: "lg",
|
|
353
357
|
contentClassName: "p-4",
|
|
354
|
-
children: /* @__PURE__ */
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
/* @__PURE__ */ e(
|
|
358
|
-
/* @__PURE__ */
|
|
358
|
+
children: /* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
359
|
+
/* @__PURE__ */ r("div", { className: "bg-gray-50 rounded-lg p-4 space-y-2", children: [
|
|
360
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-center space-x-2 text-gray-700", children: [
|
|
361
|
+
/* @__PURE__ */ e(ve, { className: "h-4 w-4" }),
|
|
362
|
+
/* @__PURE__ */ r("span", { className: "text-sm font-medium", children: [
|
|
359
363
|
"Order #",
|
|
360
|
-
|
|
364
|
+
y.orderNumber
|
|
361
365
|
] })
|
|
362
366
|
] }),
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ r("div", { className: "border-t border-gray-200 pt-2 space-y-1.5", children: [
|
|
368
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between text-sm", children: [
|
|
365
369
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Customer" }),
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
-
|
|
370
|
+
/* @__PURE__ */ r("span", { className: "font-medium text-gray-900", children: [
|
|
371
|
+
y.firstName,
|
|
368
372
|
" ",
|
|
369
|
-
|
|
373
|
+
y.lastName
|
|
370
374
|
] })
|
|
371
375
|
] }),
|
|
372
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between text-sm", children: [
|
|
373
377
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Phone" }),
|
|
374
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children:
|
|
378
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: y.phone })
|
|
375
379
|
] }),
|
|
376
|
-
|
|
380
|
+
y.email && /* @__PURE__ */ r("div", { className: "flex justify-between text-sm", children: [
|
|
377
381
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Email" }),
|
|
378
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children:
|
|
382
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: y.email })
|
|
379
383
|
] }),
|
|
380
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between text-sm", children: [
|
|
381
385
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Payment" }),
|
|
382
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children:
|
|
386
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-gray-900", children: y.paymentMethod === "cod" ? "Cash on Delivery" : "Online" })
|
|
383
387
|
] }),
|
|
384
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between text-sm", children: [
|
|
385
389
|
/* @__PURE__ */ e("span", { className: "text-gray-600", children: "Total" }),
|
|
386
|
-
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900", children:
|
|
390
|
+
/* @__PURE__ */ e("span", { className: "font-bold text-gray-900", children: _(y.totalPrice) })
|
|
387
391
|
] })
|
|
388
392
|
] })
|
|
389
393
|
] }),
|
|
390
394
|
/* @__PURE__ */ e(
|
|
391
|
-
|
|
395
|
+
We,
|
|
392
396
|
{
|
|
393
|
-
orderId:
|
|
394
|
-
token:
|
|
397
|
+
orderId: y.id,
|
|
398
|
+
token: y.userActionToken,
|
|
395
399
|
limit: 4,
|
|
396
|
-
brandSiteUrl: (
|
|
400
|
+
brandSiteUrl: (pe = y.brand) == null ? void 0 : pe.siteUrl
|
|
397
401
|
}
|
|
398
402
|
)
|
|
399
403
|
] })
|
|
400
404
|
}
|
|
401
405
|
);
|
|
402
|
-
const
|
|
406
|
+
const re = f && (c === "delivery" || c === "payment") && (f.waybillOnly || !(f != null && f.allowCOD));
|
|
403
407
|
return /* @__PURE__ */ e(
|
|
404
|
-
|
|
408
|
+
ye,
|
|
405
409
|
{
|
|
406
410
|
isOpen: d,
|
|
407
411
|
onClose: q,
|
|
408
|
-
title:
|
|
409
|
-
footer:
|
|
412
|
+
title: Ie,
|
|
413
|
+
footer: qe,
|
|
410
414
|
size: "lg",
|
|
411
415
|
contentClassName: "p-0",
|
|
412
|
-
children:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
/* @__PURE__ */ e(
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-amber-900 whitespace-pre-wrap", children:
|
|
418
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-amber-800 whitespace-pre-wrap", children:
|
|
416
|
+
children: X ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-[300px]", children: /* @__PURE__ */ e($, { className: "h-8 w-8 animate-spin text-gray-600" }) }) : /* @__PURE__ */ e("div", { className: "w-full overflow-hidden", children: /* @__PURE__ */ r("div", { className: "relative w-full", children: [
|
|
417
|
+
re && /* @__PURE__ */ r("div", { className: "space-y-3 p-4 pb-0", children: [
|
|
418
|
+
f.noteTitle && f.noteContent && /* @__PURE__ */ e("div", { className: "bg-amber-50 border border-amber-200 rounded-lg p-4", children: /* @__PURE__ */ r("div", { className: "flex items-start gap-3", children: [
|
|
419
|
+
/* @__PURE__ */ e(ve, { className: "h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5" }),
|
|
420
|
+
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
421
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-amber-900 whitespace-pre-wrap", children: f.noteTitle }),
|
|
422
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-amber-800 whitespace-pre-wrap", children: f.noteContent })
|
|
419
423
|
] })
|
|
420
424
|
] }) }),
|
|
421
|
-
!(
|
|
422
|
-
/* @__PURE__ */ e(
|
|
423
|
-
/* @__PURE__ */
|
|
425
|
+
!(f != null && f.allowCOD) && /* @__PURE__ */ e("div", { className: "bg-blue-50 border border-blue-200 rounded-lg p-4", children: /* @__PURE__ */ r("div", { className: "flex items-start gap-3", children: [
|
|
426
|
+
/* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5" }),
|
|
427
|
+
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
424
428
|
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-blue-900", children: "Cash on Delivery Unavailable" }),
|
|
425
429
|
/* @__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." })
|
|
426
430
|
] })
|
|
427
431
|
] }) })
|
|
428
432
|
] }),
|
|
429
|
-
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ r(
|
|
430
434
|
"a",
|
|
431
435
|
{
|
|
432
436
|
href: He,
|
|
@@ -446,7 +450,7 @@ function ct({
|
|
|
446
450
|
]
|
|
447
451
|
}
|
|
448
452
|
) }),
|
|
449
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ r(
|
|
450
454
|
"div",
|
|
451
455
|
{
|
|
452
456
|
className: k(
|
|
@@ -456,7 +460,7 @@ function ct({
|
|
|
456
460
|
c === "payment" && "-translate-x-[200%]"
|
|
457
461
|
),
|
|
458
462
|
children: [
|
|
459
|
-
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */ e("div", { className: "space-y-4", children: /* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */ e("div", { className: "space-y-4", children: /* @__PURE__ */ r("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
460
464
|
/* @__PURE__ */ e(
|
|
461
465
|
I,
|
|
462
466
|
{
|
|
@@ -465,7 +469,7 @@ function ct({
|
|
|
465
469
|
name: "firstName",
|
|
466
470
|
value: t.firstName,
|
|
467
471
|
onChange: x,
|
|
468
|
-
onBlur: () =>
|
|
472
|
+
onBlur: () => z("firstName"),
|
|
469
473
|
error: u.firstName,
|
|
470
474
|
autoCorrect: "off",
|
|
471
475
|
required: !0
|
|
@@ -479,7 +483,7 @@ function ct({
|
|
|
479
483
|
name: "lastName",
|
|
480
484
|
value: t.lastName,
|
|
481
485
|
onChange: x,
|
|
482
|
-
onBlur: () =>
|
|
486
|
+
onBlur: () => z("lastName"),
|
|
483
487
|
error: u.lastName,
|
|
484
488
|
autoCorrect: "off",
|
|
485
489
|
required: !0
|
|
@@ -493,7 +497,7 @@ function ct({
|
|
|
493
497
|
name: "email",
|
|
494
498
|
value: t.email,
|
|
495
499
|
onChange: x,
|
|
496
|
-
onBlur: () =>
|
|
500
|
+
onBlur: () => z("email"),
|
|
497
501
|
error: u.email,
|
|
498
502
|
icon: /* @__PURE__ */ e(Te, { size: 16 }),
|
|
499
503
|
autoCorrect: "off",
|
|
@@ -508,18 +512,18 @@ function ct({
|
|
|
508
512
|
name: "phone",
|
|
509
513
|
value: t.phone,
|
|
510
514
|
onChange: x,
|
|
511
|
-
onBlur: () =>
|
|
515
|
+
onBlur: () => z("phone"),
|
|
512
516
|
placeholder: "e.g. 08012345678",
|
|
513
517
|
maxLength: 18,
|
|
514
518
|
error: u.phone,
|
|
515
|
-
icon: /* @__PURE__ */ e(
|
|
519
|
+
icon: /* @__PURE__ */ e(ze, { size: 16 }),
|
|
516
520
|
autoCorrect: "off",
|
|
517
521
|
required: !0,
|
|
518
522
|
className: "font-semibold"
|
|
519
523
|
}
|
|
520
524
|
)
|
|
521
525
|
] }) }) }),
|
|
522
|
-
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
523
527
|
/* @__PURE__ */ e(
|
|
524
528
|
I,
|
|
525
529
|
{
|
|
@@ -533,7 +537,7 @@ function ct({
|
|
|
533
537
|
required: !0
|
|
534
538
|
}
|
|
535
539
|
),
|
|
536
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
537
541
|
/* @__PURE__ */ e(
|
|
538
542
|
I,
|
|
539
543
|
{
|
|
@@ -547,64 +551,64 @@ function ct({
|
|
|
547
551
|
required: !0
|
|
548
552
|
}
|
|
549
553
|
),
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
|
|
554
|
+
/* @__PURE__ */ r(
|
|
555
|
+
fe,
|
|
552
556
|
{
|
|
553
557
|
label: "State",
|
|
554
558
|
name: "state",
|
|
555
|
-
value:
|
|
556
|
-
onChange: (
|
|
557
|
-
|
|
558
|
-
const n =
|
|
559
|
-
|
|
559
|
+
value: F || "",
|
|
560
|
+
onChange: (s) => {
|
|
561
|
+
J("");
|
|
562
|
+
const n = s.target.value;
|
|
563
|
+
be(n || void 0), u.state && T((i) => ({ ...i, state: void 0 }));
|
|
560
564
|
},
|
|
561
565
|
error: u.state,
|
|
562
566
|
required: !0,
|
|
563
567
|
children: [
|
|
564
568
|
/* @__PURE__ */ e("option", { disabled: !0, value: "", children: "Select State" }),
|
|
565
|
-
C == null ? void 0 : C.map((
|
|
569
|
+
C == null ? void 0 : C.map((s) => /* @__PURE__ */ e("option", { value: s.id, children: s.name }, s.id))
|
|
566
570
|
]
|
|
567
571
|
}
|
|
568
572
|
),
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
|
|
573
|
+
/* @__PURE__ */ r(
|
|
574
|
+
fe,
|
|
571
575
|
{
|
|
572
576
|
label: "Delivery Zone",
|
|
573
|
-
value:
|
|
574
|
-
onChange: (
|
|
575
|
-
const n =
|
|
576
|
-
|
|
577
|
+
value: p || "",
|
|
578
|
+
onChange: (s) => {
|
|
579
|
+
const n = s.target.value;
|
|
580
|
+
J(n || void 0), u.deliveryZoneId && T((i) => ({ ...i, deliveryZoneId: void 0 })), n && S.mutate({ deliveryZoneId: n });
|
|
577
581
|
},
|
|
578
582
|
disabled: !h,
|
|
579
583
|
error: u.deliveryZoneId,
|
|
580
584
|
required: !0,
|
|
581
585
|
children: [
|
|
582
586
|
/* @__PURE__ */ e("option", { disabled: !0, value: "", children: h ? "Select Delivery Zone" : "Select State First" }),
|
|
583
|
-
h == null ? void 0 : h.zones.map((
|
|
587
|
+
h == null ? void 0 : h.zones.map((s) => {
|
|
584
588
|
var m;
|
|
585
|
-
const n = ((m =
|
|
586
|
-
return /* @__PURE__ */
|
|
587
|
-
|
|
588
|
-
i ? "" : ` (₦${
|
|
589
|
-
] },
|
|
589
|
+
const n = ((m = a == null ? void 0 : a.pricing) == null ? void 0 : m.subtotal) ?? 0, i = s.freeShippingThreshold && n >= s.freeShippingThreshold;
|
|
590
|
+
return /* @__PURE__ */ r("option", { value: s.id, children: [
|
|
591
|
+
s.name,
|
|
592
|
+
i ? "" : ` (₦${s.deliveryCost})`
|
|
593
|
+
] }, s.id);
|
|
590
594
|
})
|
|
591
595
|
]
|
|
592
596
|
}
|
|
593
597
|
)
|
|
594
598
|
] })
|
|
595
599
|
] }) }),
|
|
596
|
-
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */
|
|
597
|
-
|
|
598
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ e("div", { className: "w-full min-w-full flex-shrink-0 p-4", children: /* @__PURE__ */ r("div", { className: "space-y-6", children: [
|
|
601
|
+
L && /* @__PURE__ */ r("div", { className: `border border-gray-200 rounded-lg ${re ? "mt-4" : ""}`, children: [
|
|
602
|
+
/* @__PURE__ */ r(
|
|
599
603
|
"button",
|
|
600
604
|
{
|
|
601
605
|
type: "button",
|
|
602
|
-
onClick: () =>
|
|
606
|
+
onClick: () => we(!H),
|
|
603
607
|
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",
|
|
604
608
|
children: [
|
|
605
|
-
/* @__PURE__ */ e("span", { className: "text-sm font-bold text-accent-700", children:
|
|
609
|
+
/* @__PURE__ */ e("span", { className: "text-sm font-bold text-accent-700", children: L.title || "🤔 Curious about Refunds?" }),
|
|
606
610
|
/* @__PURE__ */ e(
|
|
607
|
-
|
|
611
|
+
Ae,
|
|
608
612
|
{
|
|
609
613
|
size: 16,
|
|
610
614
|
className: k(
|
|
@@ -623,24 +627,24 @@ function ct({
|
|
|
623
627
|
"overflow-hidden transition-all duration-300 ease-in-out",
|
|
624
628
|
H ? "max-h-96 opacity-100" : "max-h-0 opacity-0"
|
|
625
629
|
),
|
|
626
|
-
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:
|
|
630
|
+
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: L.policies && /* @__PURE__ */ r("div", { children: [
|
|
627
631
|
/* @__PURE__ */ e("h4", { className: "font-bold text-gray-800 mb-2", children: "Our Refund Policy" }),
|
|
628
|
-
/* @__PURE__ */ e("ul", { className: "space-y-1", children:
|
|
632
|
+
/* @__PURE__ */ e("ul", { className: "space-y-1", children: L.policies.map((s, n) => /* @__PURE__ */ r("li", { className: "flex items-start", children: [
|
|
629
633
|
/* @__PURE__ */ e("span", { className: "text-green-600 mr-2", children: "✓" }),
|
|
630
|
-
/* @__PURE__ */ e("span", { children:
|
|
634
|
+
/* @__PURE__ */ e("span", { children: s })
|
|
631
635
|
] }, n)) })
|
|
632
636
|
] }) }) })
|
|
633
637
|
}
|
|
634
638
|
)
|
|
635
639
|
] }),
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
641
|
+
/* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ r(
|
|
638
642
|
"label",
|
|
639
643
|
{
|
|
640
644
|
className: k(
|
|
641
645
|
"flex items-center justify-center relative p-4 border-2 rounded-xl cursor-pointer transition-all duration-200",
|
|
642
646
|
t.paymentMethod === "online" ? "border-accent-500 bg-accent-50" : "border-gray-200 hover:border-gray-300",
|
|
643
|
-
|
|
647
|
+
B("online") && "opacity-50 cursor-not-allowed"
|
|
644
648
|
),
|
|
645
649
|
children: [
|
|
646
650
|
/* @__PURE__ */ e(
|
|
@@ -649,13 +653,13 @@ function ct({
|
|
|
649
653
|
type: "radio",
|
|
650
654
|
name: "paymentMethod",
|
|
651
655
|
value: "online",
|
|
652
|
-
disabled:
|
|
656
|
+
disabled: B("online"),
|
|
653
657
|
checked: t.paymentMethod === "online",
|
|
654
658
|
onChange: x,
|
|
655
659
|
className: "sr-only"
|
|
656
660
|
}
|
|
657
661
|
),
|
|
658
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ r("div", { className: "flex flex-col items-center text-center space-y-3", children: [
|
|
659
663
|
/* @__PURE__ */ e(
|
|
660
664
|
"div",
|
|
661
665
|
{
|
|
@@ -663,16 +667,16 @@ function ct({
|
|
|
663
667
|
"p-3 rounded-full",
|
|
664
668
|
t.paymentMethod === "online" ? "bg-accent-100 text-accent-600" : "bg-gray-100 text-gray-600"
|
|
665
669
|
),
|
|
666
|
-
children: /* @__PURE__ */ e(
|
|
670
|
+
children: /* @__PURE__ */ e(Be, { size: 24 })
|
|
667
671
|
}
|
|
668
672
|
),
|
|
669
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ r("div", { children: [
|
|
670
674
|
/* @__PURE__ */ e("div", { className: "font-semibold text-gray-900", children: "Pay Online" }),
|
|
671
675
|
/* @__PURE__ */ e("div", { className: "text-sm text-gray-500 mt-1", children: "Bank transfer" }),
|
|
672
676
|
/* @__PURE__ */ e(
|
|
673
677
|
"img",
|
|
674
678
|
{
|
|
675
|
-
src:
|
|
679
|
+
src: $e,
|
|
676
680
|
alt: "Paystack",
|
|
677
681
|
className: "h-4 w-auto mt-2 mx-auto"
|
|
678
682
|
}
|
|
@@ -683,13 +687,13 @@ function ct({
|
|
|
683
687
|
]
|
|
684
688
|
}
|
|
685
689
|
) }),
|
|
686
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ r(
|
|
687
691
|
"label",
|
|
688
692
|
{
|
|
689
693
|
className: k(
|
|
690
694
|
"flex items-center justify-center relative p-4 border-2 rounded-xl cursor-pointer transition-all duration-200",
|
|
691
695
|
t.paymentMethod === "cod" ? "border-accent-500 bg-accent-50" : "border-gray-200 hover:border-gray-300",
|
|
692
|
-
|
|
696
|
+
B("cod") && "opacity-50 cursor-not-allowed"
|
|
693
697
|
),
|
|
694
698
|
children: [
|
|
695
699
|
/* @__PURE__ */ e(
|
|
@@ -698,13 +702,13 @@ function ct({
|
|
|
698
702
|
type: "radio",
|
|
699
703
|
name: "paymentMethod",
|
|
700
704
|
value: "cod",
|
|
701
|
-
disabled:
|
|
705
|
+
disabled: B("cod"),
|
|
702
706
|
checked: t.paymentMethod === "cod",
|
|
703
707
|
onChange: x,
|
|
704
708
|
className: "sr-only"
|
|
705
709
|
}
|
|
706
710
|
),
|
|
707
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ r("div", { className: "flex flex-col items-center text-center space-y-3", children: [
|
|
708
712
|
/* @__PURE__ */ e(
|
|
709
713
|
"div",
|
|
710
714
|
{
|
|
@@ -712,10 +716,10 @@ function ct({
|
|
|
712
716
|
"p-3 rounded-full",
|
|
713
717
|
t.paymentMethod === "cod" ? "bg-accent-100 text-accent-600" : "bg-gray-100 text-gray-600"
|
|
714
718
|
),
|
|
715
|
-
children: /* @__PURE__ */ e(
|
|
719
|
+
children: /* @__PURE__ */ e(Ne, { size: 24 })
|
|
716
720
|
}
|
|
717
721
|
),
|
|
718
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ r("div", { children: [
|
|
719
723
|
/* @__PURE__ */ e("div", { className: "font-semibold text-gray-900", children: "Pay on Delivery" }),
|
|
720
724
|
/* @__PURE__ */ e("div", { className: "text-sm text-gray-500 mt-1", children: "Pay when item arrives" })
|
|
721
725
|
] })
|
|
@@ -735,5 +739,5 @@ function ct({
|
|
|
735
739
|
);
|
|
736
740
|
}
|
|
737
741
|
export {
|
|
738
|
-
|
|
742
|
+
mt as Checkout
|
|
739
743
|
};
|