@instockng/storefront-ui 1.0.53 → 1.0.55

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