@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.
Files changed (206) hide show
  1. package/dist/components/Checkout.d.ts.map +1 -1
  2. package/dist/contexts/CartContext.d.ts.map +1 -1
  3. package/dist/index100.mjs +3 -3
  4. package/dist/index101.mjs +1 -1
  5. package/dist/index102.mjs +1 -1
  6. package/dist/index103.mjs +1 -1
  7. package/dist/index104.mjs +2 -2
  8. package/dist/index105.mjs +2 -2
  9. package/dist/index106.mjs +3 -3
  10. package/dist/index107.mjs +1 -1
  11. package/dist/index108.mjs +3 -3
  12. package/dist/index109.mjs +2 -2
  13. package/dist/index110.mjs +2 -2
  14. package/dist/index111.mjs +1 -1
  15. package/dist/index112.mjs +3 -3
  16. package/dist/index113.mjs +1 -1
  17. package/dist/index114.mjs +1 -1
  18. package/dist/index115.mjs +3 -3
  19. package/dist/index116.mjs +2 -2
  20. package/dist/index117.mjs +4 -4
  21. package/dist/index118.mjs +1 -1
  22. package/dist/index119.mjs +3 -3
  23. package/dist/index12.mjs +191 -183
  24. package/dist/index120.mjs +4 -4
  25. package/dist/index121.mjs +1 -1
  26. package/dist/index122.mjs +1 -1
  27. package/dist/index123.mjs +1 -1
  28. package/dist/index124.mjs +1 -1
  29. package/dist/index125.mjs +1 -1
  30. package/dist/index126.mjs +1 -1
  31. package/dist/index127.mjs +1 -1
  32. package/dist/index128.mjs +2 -2
  33. package/dist/index129.mjs +3 -3
  34. package/dist/index132.mjs +1 -1
  35. package/dist/index134.mjs +21 -2
  36. package/dist/index135.mjs +56 -2
  37. package/dist/index136.mjs +29 -2
  38. package/dist/index137.mjs +7 -2
  39. package/dist/index138.mjs +50 -16
  40. package/dist/index139.mjs +6 -32
  41. package/dist/index140.mjs +11 -37
  42. package/dist/index141.mjs +7 -18
  43. package/dist/index142.mjs +28 -18
  44. package/dist/index143.mjs +2 -2
  45. package/dist/index144.mjs +70 -20
  46. package/dist/index145.mjs +163 -42
  47. package/dist/index147.mjs +2 -30
  48. package/dist/index148.mjs +2 -18
  49. package/dist/index149.mjs +2 -2
  50. package/dist/index150.mjs +18 -2
  51. package/dist/index151.mjs +32 -2
  52. package/dist/index152.mjs +38 -2
  53. package/dist/index153.mjs +13 -67
  54. package/dist/index154.mjs +18 -2
  55. package/dist/index155.mjs +2 -53
  56. package/dist/index156.mjs +20 -2
  57. package/dist/index157.mjs +39 -29
  58. package/dist/index158.mjs +2 -152
  59. package/dist/index159.mjs +30 -2
  60. package/dist/index160.mjs +18 -2
  61. package/dist/index161.mjs +2 -19
  62. package/dist/index162.mjs +2 -2
  63. package/dist/index163.mjs +2 -2
  64. package/dist/index164.mjs +2 -26
  65. package/dist/index165.mjs +72 -2
  66. package/dist/index166.mjs +2 -2
  67. package/dist/index167.mjs +49 -20
  68. package/dist/index168.mjs +2 -23
  69. package/dist/index169.mjs +36 -2
  70. package/dist/index170.mjs +152 -2
  71. package/dist/index171.mjs +2 -2
  72. package/dist/index172.mjs +2 -23
  73. package/dist/index173.mjs +19 -2
  74. package/dist/index174.mjs +2 -23
  75. package/dist/index176.mjs +26 -2
  76. package/dist/index177.mjs +2 -2
  77. package/dist/index178.mjs +2 -23
  78. package/dist/index179.mjs +24 -2
  79. package/dist/index180.mjs +15 -15
  80. package/dist/index181.mjs +2 -2
  81. package/dist/index182.mjs +2 -2
  82. package/dist/index183.mjs +2 -2
  83. package/dist/index184.mjs +23 -2
  84. package/dist/index185.mjs +2 -2
  85. package/dist/index186.mjs +23 -2
  86. package/dist/index187.mjs +2 -2
  87. package/dist/index188.mjs +2 -2
  88. package/dist/index189.mjs +2 -127
  89. package/dist/index19.mjs +26 -13
  90. package/dist/index190.mjs +23 -2
  91. package/dist/index191.mjs +2 -74
  92. package/dist/index192.mjs +20 -71
  93. package/dist/index193.mjs +2 -21
  94. package/dist/index194.mjs +2 -56
  95. package/dist/index195.mjs +2 -29
  96. package/dist/index196.mjs +2 -7
  97. package/dist/index197.mjs +2 -52
  98. package/dist/index198.mjs +2 -6
  99. package/dist/index199.mjs +2 -12
  100. package/dist/index200.mjs +2 -7
  101. package/dist/index201.mjs +127 -28
  102. package/dist/index202.mjs +2 -2
  103. package/dist/index203.mjs +73 -69
  104. package/dist/index204.mjs +71 -164
  105. package/dist/index205.mjs +13 -2
  106. package/dist/index206.mjs +7 -2
  107. package/dist/index207.mjs +31 -2
  108. package/dist/index208.mjs +11 -2
  109. package/dist/index209.mjs +4 -2
  110. package/dist/index210.mjs +4 -2
  111. package/dist/index211.mjs +11 -36
  112. package/dist/index212.mjs +5 -2
  113. package/dist/index213.mjs +33 -2
  114. package/dist/index214.mjs +31 -2
  115. package/dist/index215.mjs +28 -2
  116. package/dist/index216.mjs +58 -241
  117. package/dist/index217.mjs +2 -2
  118. package/dist/index218.mjs +2 -33
  119. package/dist/index219.mjs +2 -65
  120. package/dist/index220.mjs +2 -25
  121. package/dist/index223.mjs +1 -1
  122. package/dist/index226.mjs +37 -2
  123. package/dist/index227.mjs +2 -2
  124. package/dist/index228.mjs +2 -2
  125. package/dist/index229.mjs +2 -2
  126. package/dist/index232.mjs +244 -2
  127. package/dist/index233.mjs +2 -4
  128. package/dist/index234.mjs +33 -2
  129. package/dist/index235.mjs +65 -2
  130. package/dist/index236.mjs +24 -30
  131. package/dist/index237.mjs +2 -11
  132. package/dist/index238.mjs +2 -4
  133. package/dist/index239.mjs +2 -4
  134. package/dist/index240.mjs +2 -13
  135. package/dist/index241.mjs +2 -7
  136. package/dist/index242.mjs +2 -12
  137. package/dist/index243.mjs +2 -5
  138. package/dist/index244.mjs +2 -33
  139. package/dist/index245.mjs +2 -31
  140. package/dist/index246.mjs +2 -28
  141. package/dist/index247.mjs +4 -61
  142. package/dist/index248.mjs +3 -2
  143. package/dist/index249.mjs +2 -18
  144. package/dist/index250.mjs +2 -47
  145. package/dist/index251.mjs +17 -2
  146. package/dist/index252.mjs +13 -2
  147. package/dist/index253.mjs +6 -2
  148. package/dist/index254.mjs +30 -2
  149. package/dist/index255.mjs +2 -91
  150. package/dist/index256.mjs +18 -2
  151. package/dist/index257.mjs +47 -2
  152. package/dist/index258.mjs +2 -3
  153. package/dist/index259.mjs +2 -2
  154. package/dist/index260.mjs +2 -2
  155. package/dist/index261.mjs +2 -17
  156. package/dist/index262.mjs +2 -13
  157. package/dist/index263.mjs +91 -6
  158. package/dist/index264.mjs +2 -30
  159. package/dist/index29.mjs +1 -1
  160. package/dist/index3.mjs +95 -105
  161. package/dist/index32.mjs +1 -1
  162. package/dist/index33.mjs +1 -1
  163. package/dist/index34.mjs +1 -1
  164. package/dist/index35.mjs +1 -1
  165. package/dist/index36.mjs +1 -1
  166. package/dist/index37.mjs +1 -1
  167. package/dist/index38.mjs +1 -1
  168. package/dist/index39.mjs +3 -3
  169. package/dist/index42.mjs +1 -1
  170. package/dist/index48.mjs +2 -2
  171. package/dist/index49.mjs +45 -45
  172. package/dist/index50.mjs +1 -1
  173. package/dist/index51.mjs +1 -1
  174. package/dist/index52.mjs +1 -1
  175. package/dist/index53.mjs +1 -1
  176. package/dist/index54.mjs +1 -1
  177. package/dist/index55.mjs +1 -1
  178. package/dist/index56.mjs +1 -1
  179. package/dist/index57.mjs +1 -1
  180. package/dist/index58.mjs +1 -1
  181. package/dist/index59.mjs +1 -1
  182. package/dist/index61.mjs +2 -153
  183. package/dist/index62.mjs +153 -2
  184. package/dist/index63.mjs +4 -22
  185. package/dist/index64.mjs +21 -73
  186. package/dist/index65.mjs +74 -14
  187. package/dist/index66.mjs +14 -62
  188. package/dist/index67.mjs +62 -4
  189. package/dist/index73.mjs +1 -1
  190. package/dist/index77.mjs +5 -5
  191. package/dist/index79.mjs +3 -3
  192. package/dist/index89.mjs +1 -1
  193. package/dist/index90.mjs +3 -3
  194. package/dist/index92.mjs +34 -2
  195. package/dist/index93.mjs +40 -31
  196. package/dist/index94.mjs +2 -43
  197. package/dist/index96.mjs +1 -1
  198. package/dist/index97.mjs +1 -1
  199. package/dist/index98.mjs +6 -6
  200. package/dist/index99.mjs +4 -4
  201. package/dist/lib/utils.d.ts +8 -0
  202. package/dist/lib/utils.d.ts.map +1 -1
  203. package/package.json +2 -2
  204. package/src/components/Checkout.tsx +18 -10
  205. package/src/contexts/CartContext.tsx +2 -20
  206. package/src/lib/utils.ts +20 -0
package/dist/index3.mjs CHANGED
@@ -1,170 +1,160 @@
1
1
  'use client';
2
- import { jsxs as nt, jsx as ct } from "react/jsx-runtime";
3
- import { createContext as st, useState as k, useRef as S, useCallback as o, useEffect as d, useContext as at } from "react";
2
+ import { jsxs as ot, jsx as nt } from "react/jsx-runtime";
3
+ import { createContext as ct, useState as A, useRef as M, useEffect as f, useCallback as o, useContext as st } from "react";
4
4
  import "./index20.mjs";
5
- import { useGetCart as ut, useCreateCart as it, useAddCartItem as ft, useUpdateCartItem as dt, useRemoveCartItem as mt, useApplyDiscount as lt, useRemoveDiscount as pt, useUpdateCart as Ct, useCheckoutCart as wt } from "./index32.mjs";
5
+ import { useGetCart as at, useCreateCart as ut, useAddCartItem as it, useUpdateCartItem as mt, useRemoveCartItem as ft, useApplyDiscount as dt, useRemoveDiscount as lt, useUpdateCart as Ct, useCheckoutCart as wt } from "./index32.mjs";
6
6
  import "@tanstack/react-query";
7
7
  import { ShoppingCart as It } from "./index10.mjs";
8
- import { useMetaPixel as ht } from "./index4.mjs";
9
- const m = "oms_cart_id", U = st(null);
10
- function Mt({ children: l, brandSlug: u, initialCartId: p, shoppingCartProps: L }) {
11
- const [t, i] = k(p || null), [A, M] = k(!1), [j, O] = k(!1), _ = S(!1), E = S(!1), I = S(!1), { trackAddToCart: h, trackInitiateCheckout: b } = ht(), x = o(() => {
12
- if (typeof document > "u") return { fbc: void 0, fbp: void 0 };
13
- const e = (r) => {
14
- var n;
15
- const s = `; ${document.cookie}`.split(`; ${r}=`);
16
- if (s.length === 2) return (n = s.pop()) == null ? void 0 : n.split(";").shift();
17
- };
18
- return {
19
- fbc: e("_fbc"),
20
- fbp: e("_fbp")
21
- };
22
- }, []);
23
- d(() => {
24
- O(!0);
25
- }, []), d(() => {
26
- if (p || _.current) return;
27
- _.current = !0;
8
+ import { useMetaPixel as pt } from "./index4.mjs";
9
+ import { getFbCookies as ht } from "./index19.mjs";
10
+ const d = "oms_cart_id", b = ct(null);
11
+ function Et({ children: l, brandSlug: a, initialCartId: C, shoppingCartProps: L }) {
12
+ const [t, u] = A(C || null), [g, k] = A(!1), [$, j] = A(!1), E = M(!1), _ = M(!1), p = M(!1), { trackAddToCart: h, trackInitiateCheckout: x } = pt();
13
+ f(() => {
14
+ j(!0);
15
+ }, []), f(() => {
16
+ if (C || E.current) return;
17
+ E.current = !0;
28
18
  const r = new URLSearchParams(window.location.search).get("cartId");
29
19
  if (r) {
30
- i(r);
20
+ u(r);
31
21
  return;
32
22
  }
33
- const c = localStorage.getItem(m);
34
- c && i(c);
35
- }, [p]);
36
- const { data: f, isLoading: G, error: C, refetch: a } = ut(t || "", {
23
+ const c = localStorage.getItem(d);
24
+ c && u(c);
25
+ }, [C]);
26
+ const { data: i, isLoading: O, error: w, refetch: n } = at(t || "", {
37
27
  enabled: !!t,
38
28
  retry: !1
39
29
  // Don't retry on failure - cart might be invalid/expired
40
- }), v = it({
30
+ }), y = ut({
41
31
  onSuccess: (e) => {
42
32
  if ("error" in e) {
43
33
  console.error("Failed to create cart:", e.error);
44
34
  return;
45
35
  }
46
- i(e.id);
36
+ u(e.id);
47
37
  },
48
38
  onError: (e) => {
49
39
  console.error("Failed to create cart:", e);
50
40
  },
51
41
  retry: 10
52
42
  });
53
- d(() => {
54
- if (E.current) return;
55
- E.current = !0;
43
+ f(() => {
44
+ if (_.current) return;
45
+ _.current = !0;
56
46
  const e = setTimeout(() => {
57
- !(typeof window < "u" ? localStorage.getItem(m) : null) && !p && v.mutate(u);
47
+ !(typeof window < "u" ? localStorage.getItem(d) : null) && !C && y.mutate(a);
58
48
  }, 150);
59
49
  return () => clearTimeout(e);
60
- }, []), d(() => {
61
- C && t && !I.current && (I.current = !0, console.warn("Cart fetch failed, creating new cart:", C), i(null), typeof window < "u" && localStorage.removeItem(m), setTimeout(() => {
62
- v.mutate(u), I.current = !1;
50
+ }, []), f(() => {
51
+ w && t && !p.current && (p.current = !0, console.warn("Cart fetch failed, creating new cart:", w), u(null), typeof window < "u" && localStorage.removeItem(d), setTimeout(() => {
52
+ y.mutate(a), p.current = !1;
63
53
  }, 100));
64
- }, [C, t, u]);
65
- const H = ft(t || "", {
66
- onSuccess: () => a()
67
- }), K = dt(t || "", {
68
- onSuccess: () => a()
69
- }), Y = mt(t || "", {
70
- onSuccess: () => a()
54
+ }, [w, t, a]);
55
+ const G = it(t || "", {
56
+ onSuccess: () => n()
57
+ }), H = mt(t || "", {
58
+ onSuccess: () => n()
59
+ }), K = ft(t || "", {
60
+ onSuccess: () => n()
61
+ }), Y = dt(t || "", {
62
+ onSuccess: () => n()
71
63
  }), z = lt(t || "", {
72
- onSuccess: () => a()
73
- }), B = pt(t || "", {
74
- onSuccess: () => a()
75
- }), J = Ct(t || "", {
76
- onSuccess: () => a(),
64
+ onSuccess: () => n()
65
+ }), B = Ct(t || "", {
66
+ onSuccess: () => n(),
77
67
  retry: 3
78
- }), Q = wt(t || "", {
68
+ }), J = wt(t || "", {
79
69
  onSuccess: () => {
80
70
  }
81
71
  });
82
- d(() => {
83
- t && typeof window < "u" && localStorage.setItem(m, t);
72
+ f(() => {
73
+ t && typeof window < "u" && localStorage.setItem(d, t);
84
74
  }, [t]);
85
- const V = o(
86
- async (e, r, c, s, n) => {
75
+ const Q = o(
76
+ async (e, r, c, m, s) => {
87
77
  var F;
88
78
  if (!t) throw new Error("No cart ID");
89
- const { fbc: y, fbp: D } = x(), N = await H.mutateAsync({ sku: s, quantity: n, fbc: y, fbp: D });
79
+ const { fbc: v, fbp: D } = ht(), N = await G.mutateAsync({ sku: m, quantity: s, fbc: v, fbp: D });
90
80
  if ("error" in N) return;
91
- const w = (F = N.items) == null ? void 0 : F.filter(
92
- (g) => {
93
- var $;
94
- return (($ = g.variant) == null ? void 0 : $.sku) === s;
81
+ const I = (F = N.items) == null ? void 0 : F.filter(
82
+ (S) => {
83
+ var U;
84
+ return ((U = S.variant) == null ? void 0 : U.sku) === m;
95
85
  }
96
- ), T = w == null ? void 0 : w[w.length - 1];
86
+ ), T = I == null ? void 0 : I[I.length - 1];
97
87
  if (T) {
98
- const g = `cart_${t}_item_${T.id}`;
99
- h(e, r, c, n, g);
88
+ const S = `cart_${t}_item_${T.id}`;
89
+ h(e, r, c, s, S);
100
90
  } else
101
- h(e, r, c, n);
91
+ h(e, r, c, s);
102
92
  },
103
93
  // eslint-disable-next-line react-hooks/exhaustive-deps
104
- [t, h, x]
105
- ), W = o(
94
+ [t, h]
95
+ ), V = o(
106
96
  async (e, r) => {
107
97
  if (!t) throw new Error("No cart ID");
108
- await K.mutateAsync({ itemId: e, quantity: r });
98
+ await H.mutateAsync({ itemId: e, quantity: r });
109
99
  },
110
100
  // eslint-disable-next-line react-hooks/exhaustive-deps
111
101
  [t]
112
- ), X = o(
102
+ ), W = o(
113
103
  async (e) => {
114
104
  if (!t) throw new Error("No cart ID");
115
- await Y.mutateAsync(e);
105
+ await K.mutateAsync(e);
116
106
  },
117
107
  // eslint-disable-next-line react-hooks/exhaustive-deps
118
108
  [t]
119
- ), Z = o(
109
+ ), X = o(
120
110
  async (e) => {
121
111
  if (!t) throw new Error("No cart ID");
122
- await z.mutateAsync({ code: e });
112
+ await Y.mutateAsync({ code: e });
123
113
  },
124
114
  // eslint-disable-next-line react-hooks/exhaustive-deps
125
115
  [t]
126
- ), q = o(async () => {
116
+ ), Z = o(async () => {
127
117
  if (!t) throw new Error("No cart ID");
128
- await B.mutateAsync();
118
+ await z.mutateAsync();
129
119
  }, [t]), R = o(() => {
130
- i(null), typeof window < "u" && localStorage.removeItem(m);
131
- }, []), tt = o(() => {
132
- R(), v.mutate(u);
133
- }, [u]), et = o(() => {
134
- M(!0);
120
+ u(null), typeof window < "u" && localStorage.removeItem(d);
121
+ }, []), q = o(() => {
122
+ R(), y.mutate(a);
123
+ }, [a]), tt = o(() => {
124
+ k(!0);
135
125
  }, []), P = o(() => {
136
- M(!1);
137
- }, []), rt = o(() => {
138
- var s, n;
139
- if (!f || !t) return;
140
- const e = Number(((s = f.pricing) == null ? void 0 : s.total) || 0), r = ((n = f.items) == null ? void 0 : n.reduce((y, D) => y + D.quantity, 0)) || 0, c = `cart_${t}_checkout`;
141
- b(e, r, c);
142
- }, [f, t, b]), ot = {
143
- cart: f || null,
126
+ k(!1);
127
+ }, []), et = o(() => {
128
+ var m, s;
129
+ if (!i || !t) return;
130
+ const e = Number(((m = i.pricing) == null ? void 0 : m.total) || 0), r = ((s = i.items) == null ? void 0 : s.reduce((v, D) => v + D.quantity, 0)) || 0, c = `cart_${t}_checkout`;
131
+ x(e, r, c);
132
+ }, [i, t, x]), rt = {
133
+ cart: i || null,
144
134
  cartId: t,
145
- isLoading: G,
146
- error: C,
147
- updateCartMutation: J,
148
- checkoutMutation: Q,
149
- addItem: V,
150
- updateItem: W,
151
- removeItem: X,
152
- applyDiscount: Z,
153
- removeDiscount: q,
154
- trackCheckoutInitiated: rt,
135
+ isLoading: O,
136
+ error: w,
137
+ updateCartMutation: B,
138
+ checkoutMutation: J,
139
+ addItem: Q,
140
+ updateItem: V,
141
+ removeItem: W,
142
+ applyDiscount: X,
143
+ removeDiscount: Z,
144
+ trackCheckoutInitiated: et,
155
145
  clearCart: R,
156
- clearAndCreateNewCart: tt,
157
- refetch: a,
158
- isOpen: A,
159
- open: et,
146
+ clearAndCreateNewCart: q,
147
+ refetch: n,
148
+ isOpen: g,
149
+ open: tt,
160
150
  close: P
161
151
  };
162
- return /* @__PURE__ */ nt(U.Provider, { value: ot, children: [
152
+ return /* @__PURE__ */ ot(b.Provider, { value: rt, children: [
163
153
  l,
164
- j && /* @__PURE__ */ ct(
154
+ $ && /* @__PURE__ */ nt(
165
155
  It,
166
156
  {
167
- isOpen: A,
157
+ isOpen: g,
168
158
  onClose: P,
169
159
  ...L
170
160
  }
@@ -172,13 +162,13 @@ function Mt({ children: l, brandSlug: u, initialCartId: p, shoppingCartProps: L
172
162
  ] });
173
163
  }
174
164
  function _t() {
175
- const l = at(U);
165
+ const l = st(b);
176
166
  if (!l)
177
167
  throw new Error("useCart must be used within CartProvider");
178
168
  return l;
179
169
  }
180
170
  export {
181
- U as CartContext,
182
- Mt as CartProvider,
171
+ b as CartContext,
172
+ Et as CartProvider,
183
173
  _t as useCart
184
174
  };
package/dist/index32.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as s, useMutation as i } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as a } from "./index67.mjs";
3
+ import { useQueryUnwrapped as a } from "./index63.mjs";
4
4
  import { queryKeys as r } from "./index29.mjs";
5
5
  import { updateCart as c, createCart as l, applyDiscount as y, removeDiscount as m, addCartItem as p, updateCartItem as C, removeCartItem as q, checkoutCart as f, fetchCart as d } from "./index25.mjs";
6
6
  function Q(e, t) {
package/dist/index33.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useMutation as t } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as u } from "./index67.mjs";
3
+ import { useQueryUnwrapped as u } from "./index63.mjs";
4
4
  import { queryKeys as n } from "./index29.mjs";
5
5
  import { confirmOrder as i, fetchOrder as m } from "./index26.mjs";
6
6
  function y(e, r, o) {
package/dist/index34.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as u } from "./index67.mjs";
2
+ import { useQueryUnwrapped as u } from "./index63.mjs";
3
3
  import { queryKeys as t } from "./index29.mjs";
4
4
  import { fetchProductsByBrand as o, fetchProductBySlug as c } from "./index24.mjs";
5
5
  function n(r, e) {
package/dist/index35.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as o } from "./index67.mjs";
2
+ import { useQueryUnwrapped as o } from "./index63.mjs";
3
3
  import { queryKeys as i } from "./index29.mjs";
4
4
  import { fetchDeliveryZones as t } from "./index27.mjs";
5
5
  function p(e, r) {
package/dist/index36.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as t } from "./index67.mjs";
2
+ import { useQueryUnwrapped as t } from "./index63.mjs";
3
3
  import { queryKeys as u } from "./index29.mjs";
4
4
  import { fetchBrandBySlug as n } from "./index28.mjs";
5
5
  function i(r, e) {
package/dist/index37.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { getDefaultExportFromCjs as x } from "./index60.mjs";
3
- import { __module as q } from "./index62.mjs";
3
+ import { __module as q } from "./index61.mjs";
4
4
  function S(b, p) {
5
5
  for (var s = 0; s < p.length; s++) {
6
6
  const c = p[s];
package/dist/index38.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { getDefaultExportFromCjs as n } from "./index60.mjs";
3
- import { __require as i } from "./index61.mjs";
3
+ import { __require as i } from "./index62.mjs";
4
4
  function s(t, a) {
5
5
  for (var o = 0; o < a.length; o++) {
6
6
  const e = a[o];
package/dist/index39.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- import { p as S } from "./index64.mjs";
3
- import { t as U } from "./index65.mjs";
4
- import he from "./index66.mjs";
2
+ import { p as S } from "./index65.mjs";
3
+ import { t as U } from "./index66.mjs";
4
+ import he from "./index67.mjs";
5
5
  const fe = Object.prototype.toString, de = Error.prototype.toString, pe = RegExp.prototype.toString, me = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", ye = /^Symbol\((.*)\)(.*)$/;
6
6
  function ge(n) {
7
7
  return n != +n ? "NaN" : n === 0 && 1 / n < 0 ? "-0" : "" + n;
package/dist/index42.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import * as l from "react";
3
- import { composeRefs as m } from "./index63.mjs";
3
+ import { composeRefs as m } from "./index64.mjs";
4
4
  import { jsx as u } from "react/jsx-runtime";
5
5
  // @__NO_SIDE_EFFECTS__
6
6
  function y(e) {
package/dist/index48.mjs CHANGED
@@ -2,8 +2,8 @@
2
2
  var p = Object.defineProperty;
3
3
  var k = (r, e, i) => e in r ? p(r, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[e] = i;
4
4
  var h = (r, e, i) => k(r, typeof e != "symbol" ? e + "" : e, i);
5
- import { serialize as j } from "./index93.mjs";
6
- import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index94.mjs";
5
+ import { serialize as j } from "./index92.mjs";
6
+ import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index93.mjs";
7
7
  var v = (r, e) => new Proxy(() => {
8
8
  }, {
9
9
  get(t, s) {
package/dist/index49.mjs CHANGED
@@ -1,31 +1,31 @@
1
1
  'use client';
2
2
  import { useQueryClient as m, useMutation as w } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as p } from "./index67.mjs";
3
+ import { useQueryUnwrapped as f } from "./index63.mjs";
4
4
  import { createAdminRpcClients as d, authHeaders as l } from "./index23.mjs";
5
- import { queryKeys as u } from "./index29.mjs";
5
+ import { queryKeys as c } from "./index29.mjs";
6
6
  import { useApiConfig as y } from "./index21.mjs";
7
- function T(e) {
8
- const { baseURL: n, getAuthToken: s } = y();
9
- return p({
10
- queryKey: u.admin.orders.list(),
7
+ function $(e, n) {
8
+ const { baseURL: s, getAuthToken: o } = y();
9
+ return f({
10
+ queryKey: c.admin.orders.list(e),
11
11
  queryFn: async () => {
12
- const o = await s(), r = await d(n).orders.index.$get({}, l(o));
12
+ const t = await o(), a = d(s), i = e ? Object.fromEntries(Object.entries(e).filter(([u, p]) => p !== void 0)) : void 0, r = await a.orders.index.$get({ query: i }, l(t));
13
13
  if (!r.ok)
14
14
  throw new Error(`Failed to fetch orders: ${r.statusText}`);
15
15
  return r.json();
16
16
  },
17
- ...e
17
+ ...n
18
18
  });
19
19
  }
20
- function $(e, n) {
20
+ function j(e, n) {
21
21
  const { baseURL: s, getAuthToken: o } = y();
22
- return p({
23
- queryKey: u.admin.orders.detail(e),
22
+ return f({
23
+ queryKey: c.admin.orders.detail(e),
24
24
  queryFn: async () => {
25
- const t = await o(), a = await d(s).orders[":id"].$get({ param: { id: e } }, l(t));
26
- if (!a.ok)
27
- throw new Error(`Failed to fetch order: ${a.statusText}`);
28
- return a.json();
25
+ const t = await o(), i = await d(s).orders[":id"].$get({ param: { id: e } }, l(t));
26
+ if (!i.ok)
27
+ throw new Error(`Failed to fetch order: ${i.statusText}`);
28
+ return i.json();
29
29
  },
30
30
  ...n
31
31
  });
@@ -34,67 +34,67 @@ function g(e) {
34
34
  const { baseURL: n, getAuthToken: s } = y(), o = m();
35
35
  return w({
36
36
  mutationFn: async (t) => {
37
- const r = await s(), i = await d(n).orders.index.$post({ json: t }, l(r));
38
- if (!i.ok)
39
- throw new Error(`Failed to create order: ${i.statusText}`);
40
- return i.json();
37
+ const a = await s(), r = await d(n).orders.index.$post({ json: t }, l(a));
38
+ if (!r.ok)
39
+ throw new Error(`Failed to create order: ${r.statusText}`);
40
+ return r.json();
41
41
  },
42
42
  onSuccess: () => {
43
- o.invalidateQueries({ queryKey: u.admin.orders.all });
43
+ o.invalidateQueries({ queryKey: c.admin.orders.all });
44
44
  },
45
45
  ...e
46
46
  });
47
47
  }
48
- function j(e, n) {
48
+ function x(e, n) {
49
49
  const { baseURL: s, getAuthToken: o } = y(), t = m();
50
50
  return w({
51
- mutationFn: async (r) => {
52
- const a = await o(), c = await d(s).orders[":id"].$patch({ param: { id: e }, json: r }, l(a));
53
- if (!c.ok)
54
- throw new Error(`Failed to update order: ${c.statusText}`);
55
- return c.json();
51
+ mutationFn: async (a) => {
52
+ const i = await o(), u = await d(s).orders[":id"].$patch({ param: { id: e }, json: a }, l(i));
53
+ if (!u.ok)
54
+ throw new Error(`Failed to update order: ${u.statusText}`);
55
+ return u.json();
56
56
  },
57
57
  onSuccess: () => {
58
- t.invalidateQueries({ queryKey: u.admin.orders.detail(e) }), t.invalidateQueries({ queryKey: u.admin.orders.all });
58
+ t.invalidateQueries({ queryKey: c.admin.orders.detail(e) }), t.invalidateQueries({ queryKey: c.admin.orders.all });
59
59
  },
60
60
  ...n
61
61
  });
62
62
  }
63
- function x(e, n) {
63
+ function K(e, n) {
64
64
  const { baseURL: s, getAuthToken: o } = y(), t = m();
65
65
  return w({
66
- mutationFn: async (r) => {
67
- const a = await o(), c = await d(s).orders[":id"].status.$patch({ param: { id: e }, json: r }, l(a));
68
- if (!c.ok)
69
- throw new Error(`Failed to update order status: ${c.statusText}`);
70
- return c.json();
66
+ mutationFn: async (a) => {
67
+ const i = await o(), u = await d(s).orders[":id"].status.$patch({ param: { id: e }, json: a }, l(i));
68
+ if (!u.ok)
69
+ throw new Error(`Failed to update order status: ${u.statusText}`);
70
+ return u.json();
71
71
  },
72
72
  onSuccess: () => {
73
- t.invalidateQueries({ queryKey: u.admin.orders.detail(e) }), t.invalidateQueries({ queryKey: u.admin.orders.all });
73
+ t.invalidateQueries({ queryKey: c.admin.orders.detail(e) }), t.invalidateQueries({ queryKey: c.admin.orders.all });
74
74
  },
75
75
  ...n
76
76
  });
77
77
  }
78
- function K(e, n) {
78
+ function U(e, n) {
79
79
  const { baseURL: s, getAuthToken: o } = y(), t = m();
80
80
  return w({
81
81
  mutationFn: async () => {
82
- const r = await o(), i = await d(s).orders[":id"].$delete({ param: { id: e } }, l(r));
83
- if (!i.ok)
84
- throw new Error(`Failed to delete order: ${i.statusText}`);
85
- return i.json();
82
+ const a = await o(), r = await d(s).orders[":id"].$delete({ param: { id: e } }, l(a));
83
+ if (!r.ok)
84
+ throw new Error(`Failed to delete order: ${r.statusText}`);
85
+ return r.json();
86
86
  },
87
87
  onSuccess: () => {
88
- t.invalidateQueries({ queryKey: u.admin.orders.all });
88
+ t.invalidateQueries({ queryKey: c.admin.orders.all });
89
89
  },
90
90
  ...n
91
91
  });
92
92
  }
93
93
  export {
94
94
  g as useCreateOrder,
95
- K as useDeleteOrder,
96
- $ as useGetOrder,
97
- T as useListOrders,
98
- j as useUpdateOrder,
99
- x as useUpdateOrderStatus
95
+ U as useDeleteOrder,
96
+ j as useGetOrder,
97
+ $ as useListOrders,
98
+ x as useUpdateOrder,
99
+ K as useUpdateOrderStatus
100
100
  };
package/dist/index50.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as m, useMutation as w } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as b } from "./index67.mjs";
3
+ import { useQueryUnwrapped as b } from "./index63.mjs";
4
4
  import { createAdminRpcClients as c, authHeaders as d } from "./index23.mjs";
5
5
  import { queryKeys as u } from "./index29.mjs";
6
6
  import { useApiConfig as l } from "./index21.mjs";
package/dist/index51.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as y, useMutation as m } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as w } from "./index67.mjs";
3
+ import { useQueryUnwrapped as w } from "./index63.mjs";
4
4
  import { createAdminRpcClients as c, authHeaders as d } from "./index23.mjs";
5
5
  import { queryKeys as a } from "./index29.mjs";
6
6
  import { useApiConfig as l } from "./index21.mjs";
package/dist/index52.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as v, useMutation as m } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as w } from "./index67.mjs";
3
+ import { useQueryUnwrapped as w } from "./index63.mjs";
4
4
  import { createAdminRpcClients as c, authHeaders as d } from "./index23.mjs";
5
5
  import { queryKeys as o } from "./index29.mjs";
6
6
  import { useApiConfig as l } from "./index21.mjs";
package/dist/index53.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as y, useMutation as d } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as m } from "./index67.mjs";
3
+ import { useQueryUnwrapped as m } from "./index63.mjs";
4
4
  import { createAdminRpcClients as c, authHeaders as l } from "./index23.mjs";
5
5
  import { queryKeys as u } from "./index29.mjs";
6
6
  import { useApiConfig as w } from "./index21.mjs";
package/dist/index54.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as w, useMutation as v } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as d } from "./index67.mjs";
3
+ import { useQueryUnwrapped as d } from "./index63.mjs";
4
4
  import { createAdminRpcClients as c, authHeaders as y } from "./index23.mjs";
5
5
  import { queryKeys as i } from "./index29.mjs";
6
6
  import { useApiConfig as l } from "./index21.mjs";
package/dist/index55.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as n } from "./index67.mjs";
2
+ import { useQueryUnwrapped as n } from "./index63.mjs";
3
3
  import { createAdminRpcClients as u, authHeaders as a } from "./index23.mjs";
4
4
  import { queryKeys as c } from "./index29.mjs";
5
5
  import { useApiConfig as m } from "./index21.mjs";
package/dist/index56.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { useQueryUnwrapped as i } from "./index67.mjs";
2
+ import { useQueryUnwrapped as i } from "./index63.mjs";
3
3
  import { createAdminRpcClients as u, authHeaders as c } from "./index23.mjs";
4
4
  import { queryKeys as a } from "./index29.mjs";
5
5
  import { useApiConfig as d } from "./index21.mjs";
package/dist/index57.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as y, useMutation as b } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as l } from "./index67.mjs";
3
+ import { useQueryUnwrapped as l } from "./index63.mjs";
4
4
  import { createAdminRpcClients as r, authHeaders as i } from "./index23.mjs";
5
5
  import { queryKeys as u } from "./index29.mjs";
6
6
  import { useApiConfig as d } from "./index21.mjs";
package/dist/index58.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as y, useMutation as w } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as C } from "./index67.mjs";
3
+ import { useQueryUnwrapped as C } from "./index63.mjs";
4
4
  import { createAdminRpcClients as a, authHeaders as d } from "./index23.mjs";
5
5
  import { queryKeys as r } from "./index29.mjs";
6
6
  import { useApiConfig as l } from "./index21.mjs";
package/dist/index59.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { useQueryClient as v, useMutation as w } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as m } from "./index67.mjs";
3
+ import { useQueryUnwrapped as m } from "./index63.mjs";
4
4
  import { createAdminRpcClients as l, authHeaders as c } from "./index23.mjs";
5
5
  import { queryKeys as a } from "./index29.mjs";
6
6
  import { useApiConfig as d } from "./index21.mjs";