@instockng/storefront-ui 1.0.20 → 1.0.22

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 (117) hide show
  1. package/dist/components/ui/modal.d.ts +1 -1
  2. package/dist/components/ui/modal.d.ts.map +1 -1
  3. package/dist/contexts/CartContext.d.ts +2 -0
  4. package/dist/contexts/CartContext.d.ts.map +1 -1
  5. package/dist/index134.mjs +2 -2
  6. package/dist/index135.mjs +1 -1
  7. package/dist/index136.mjs +6 -6
  8. package/dist/index137.mjs +2 -2
  9. package/dist/index138.mjs +2 -2
  10. package/dist/index140.mjs +2 -2
  11. package/dist/index141.mjs +2 -2
  12. package/dist/index142.mjs +1 -1
  13. package/dist/index144.mjs +8 -8
  14. package/dist/index145.mjs +8 -8
  15. package/dist/index150.mjs +1 -1
  16. package/dist/index151.mjs +1 -1
  17. package/dist/index152.mjs +1 -1
  18. package/dist/index153.mjs +1 -1
  19. package/dist/index154.mjs +1 -1
  20. package/dist/index156.mjs +1 -1
  21. package/dist/index157.mjs +1 -1
  22. package/dist/index159.mjs +2 -2
  23. package/dist/index160.mjs +1 -1
  24. package/dist/index167.mjs +1 -1
  25. package/dist/index169.mjs +2 -2
  26. package/dist/index170.mjs +5 -5
  27. package/dist/index173.mjs +1 -1
  28. package/dist/index186.mjs +1 -1
  29. package/dist/index190.mjs +1 -1
  30. package/dist/index192.mjs +1 -1
  31. package/dist/index203.mjs +1 -1
  32. package/dist/index204.mjs +1 -1
  33. package/dist/index205.mjs +2 -2
  34. package/dist/index206.mjs +2 -108
  35. package/dist/index207.mjs +2 -2
  36. package/dist/index208.mjs +2 -2
  37. package/dist/index209.mjs +2 -2
  38. package/dist/index210.mjs +2 -2
  39. package/dist/index211.mjs +2 -2
  40. package/dist/index212.mjs +2 -2
  41. package/dist/index213.mjs +108 -2
  42. package/dist/index214.mjs +2 -2
  43. package/dist/index216.mjs +3 -3
  44. package/dist/index217.mjs +2 -2
  45. package/dist/index218.mjs +244 -2
  46. package/dist/index219.mjs +2 -244
  47. package/dist/index220.mjs +33 -2
  48. package/dist/index221.mjs +60 -28
  49. package/dist/index222.mjs +20 -60
  50. package/dist/index223.mjs +2 -25
  51. package/dist/index224.mjs +2 -2
  52. package/dist/index229.mjs +2 -2
  53. package/dist/index230.mjs +2 -2
  54. package/dist/index234.mjs +2 -31
  55. package/dist/index235.mjs +2 -11
  56. package/dist/index236.mjs +30 -3
  57. package/dist/index237.mjs +10 -3
  58. package/dist/index238.mjs +4 -13
  59. package/dist/index239.mjs +4 -7
  60. package/dist/index240.mjs +13 -12
  61. package/dist/index241.mjs +7 -5
  62. package/dist/index242.mjs +12 -33
  63. package/dist/index243.mjs +5 -31
  64. package/dist/index244.mjs +32 -27
  65. package/dist/index245.mjs +28 -58
  66. package/dist/index246.mjs +28 -2
  67. package/dist/index247.mjs +61 -2
  68. package/dist/index248.mjs +2 -2
  69. package/dist/index249.mjs +18 -2
  70. package/dist/index25.mjs +48 -48
  71. package/dist/index250.mjs +42 -13
  72. package/dist/index251.mjs +2 -47
  73. package/dist/index252.mjs +2 -2
  74. package/dist/index253.mjs +2 -2
  75. package/dist/index254.mjs +2 -2
  76. package/dist/index255.mjs +91 -2
  77. package/dist/index256.mjs +2 -91
  78. package/dist/index258.mjs +1 -1
  79. package/dist/index264.mjs +1 -1
  80. package/dist/index3.mjs +133 -102
  81. package/dist/index32.mjs +26 -26
  82. package/dist/index37.mjs +72 -52
  83. package/dist/index38.mjs +1 -1
  84. package/dist/index4.mjs +53 -48
  85. package/dist/index42.mjs +1 -1
  86. package/dist/index47.mjs +17 -17
  87. package/dist/index48.mjs +2 -2
  88. package/dist/index62.mjs +19 -149
  89. package/dist/index63.mjs +149 -19
  90. package/dist/index66.mjs +1 -1
  91. package/dist/index73.mjs +1 -1
  92. package/dist/index75.mjs +2 -235
  93. package/dist/index76.mjs +233 -4
  94. package/dist/index77.mjs +5 -133
  95. package/dist/index78.mjs +129 -63
  96. package/dist/index79.mjs +67 -86
  97. package/dist/index80.mjs +85 -27
  98. package/dist/index81.mjs +28 -8
  99. package/dist/index82.mjs +8 -74
  100. package/dist/index83.mjs +74 -3
  101. package/dist/index84.mjs +4 -2
  102. package/dist/index85.mjs +2 -83
  103. package/dist/index86.mjs +81 -52
  104. package/dist/index87.mjs +53 -5
  105. package/dist/index88.mjs +5 -4
  106. package/dist/index89.mjs +4 -178
  107. package/dist/index90.mjs +174 -48
  108. package/dist/index91.mjs +51 -67
  109. package/dist/index92.mjs +69 -34
  110. package/dist/index93.mjs +31 -40
  111. package/dist/index94.mjs +43 -2
  112. package/dist/providers/MetaPixelProvider.d.ts +10 -5
  113. package/dist/providers/MetaPixelProvider.d.ts.map +1 -1
  114. package/package.json +9 -10
  115. package/src/components/ui/modal.tsx +1 -1
  116. package/src/contexts/CartContext.tsx +69 -6
  117. package/src/providers/MetaPixelProvider.tsx +46 -30
package/dist/index3.mjs CHANGED
@@ -1,170 +1,201 @@
1
1
  'use client';
2
- import { jsxs as Q, jsx as V } from "react/jsx-runtime";
3
- import { createContext as W, useState as I, useRef as y, useEffect as m, useCallback as o, useContext as X } from "react";
2
+ import { jsxs as nt, jsx as ct } from "react/jsx-runtime";
3
+ import { createContext as st, useState as k, useRef as _, useCallback as c, useEffect as d, useContext as at } from "react";
4
4
  import "./index20.mjs";
5
- import { useGetCart as Z, useCreateCart as $, useAddCartItem as tt, useUpdateCartItem as et, useRemoveCartItem as rt, useApplyDiscount as ot, useRemoveDiscount as nt, useUpdateCart as st, useCheckoutCart as at } from "./index32.mjs";
5
+ import { useGetCart as ut, useCreateCart as it, useAddCartItem as ft, useUpdateCartItem as mt, useRemoveCartItem as dt, useApplyDiscount as lt, useRemoveDiscount as pt, useUpdateCart as Ct, useCheckoutCart as It } from "./index32.mjs";
6
6
  import "@tanstack/react-query";
7
- import { ShoppingCart as ct } from "./index10.mjs";
8
- import { useMetaPixel as ut } from "./index4.mjs";
9
- const f = "oms_cart_id", N = W(null);
10
- function Ct({ children: l, brandSlug: a, initialCartId: d, shoppingCartProps: P }) {
11
- const [t, c] = I(d || null), [h, v] = I(!1), [g, x] = I(!1), S = y(!1), A = y(!1), p = y(!1), { trackAddToCart: D, trackPurchase: R } = ut();
12
- m(() => {
13
- x(!0);
14
- }, []), m(() => {
15
- if (d || S.current) return;
7
+ import { ShoppingCart as wt } from "./index10.mjs";
8
+ import { useMetaPixel as ht } from "./index4.mjs";
9
+ const l = "oms_cart_id", F = st(null);
10
+ function St({ children: p, brandSlug: i, initialCartId: C, shoppingCartProps: L }) {
11
+ const [t, f] = k(C || null), [g, A] = k(!1), [U, j] = k(!1), S = _(!1), b = _(!1), w = _(!1), { trackAddToCart: h, trackInitiateCheckout: M, trackPurchase: G } = ht(), E = c(() => {
12
+ if (typeof document > "u") return { fbc: void 0, fbp: void 0 };
13
+ const e = (r) => {
14
+ var o;
15
+ const n = `; ${document.cookie}`.split(`; ${r}=`);
16
+ if (n.length === 2) return (o = n.pop()) == null ? void 0 : o.split(";").shift();
17
+ };
18
+ return {
19
+ fbc: e("_fbc"),
20
+ fbp: e("_fbp")
21
+ };
22
+ }, []);
23
+ d(() => {
24
+ j(!0);
25
+ }, []), d(() => {
26
+ if (C || S.current) return;
16
27
  S.current = !0;
17
28
  const r = new URLSearchParams(window.location.search).get("cartId");
18
29
  if (r) {
19
- c(r);
30
+ f(r);
20
31
  return;
21
32
  }
22
- const s = localStorage.getItem(f);
23
- s && c(s);
24
- }, [d]);
25
- const { data: k, isLoading: T, error: w, refetch: n } = Z(t || "", {
33
+ const s = localStorage.getItem(l);
34
+ s && f(s);
35
+ }, [C]);
36
+ const { data: m, isLoading: O, error: I, refetch: a } = ut(t || "", {
26
37
  enabled: !!t,
27
38
  retry: !1
28
39
  // Don't retry on failure - cart might be invalid/expired
29
- }), C = $({
40
+ }), v = it({
30
41
  onSuccess: (e) => {
31
42
  if ("error" in e) {
32
43
  console.error("Failed to create cart:", e.error);
33
44
  return;
34
45
  }
35
- c(e.id);
46
+ f(e.id);
36
47
  },
37
48
  onError: (e) => {
38
49
  console.error("Failed to create cart:", e);
39
50
  },
40
51
  retry: 10
41
52
  });
42
- m(() => {
43
- if (A.current) return;
44
- A.current = !0;
53
+ d(() => {
54
+ if (b.current) return;
55
+ b.current = !0;
45
56
  const e = setTimeout(() => {
46
- !(typeof window < "u" ? localStorage.getItem(f) : null) && !d && C.mutate(a);
57
+ !(typeof window < "u" ? localStorage.getItem(l) : null) && !C && v.mutate(i);
47
58
  }, 150);
48
59
  return () => clearTimeout(e);
49
- }, []), m(() => {
50
- w && t && !p.current && (p.current = !0, console.warn("Cart fetch failed, creating new cart:", w), c(null), typeof window < "u" && localStorage.removeItem(f), setTimeout(() => {
51
- C.mutate(a), p.current = !1;
60
+ }, []), d(() => {
61
+ I && t && !w.current && (w.current = !0, console.warn("Cart fetch failed, creating new cart:", I), f(null), typeof window < "u" && localStorage.removeItem(l), setTimeout(() => {
62
+ v.mutate(i), w.current = !1;
52
63
  }, 100));
53
- }, [w, t, a]);
54
- const _ = tt(t || "", {
55
- onSuccess: () => n()
56
- }), F = et(t || "", {
57
- onSuccess: () => n()
58
- }), U = rt(t || "", {
59
- onSuccess: () => n()
60
- }), L = ot(t || "", {
61
- onSuccess: () => n()
62
- }), j = nt(t || "", {
63
- onSuccess: () => n()
64
- }), G = st(t || "", {
65
- onSuccess: () => n(),
64
+ }, [I, t, i]);
65
+ const q = ft(t || "", {
66
+ onSuccess: () => a()
67
+ }), H = mt(t || "", {
68
+ onSuccess: () => a()
69
+ }), K = dt(t || "", {
70
+ onSuccess: () => a()
71
+ }), Y = lt(t || "", {
72
+ onSuccess: () => a()
73
+ }), z = pt(t || "", {
74
+ onSuccess: () => a()
75
+ }), B = Ct(t || "", {
76
+ onSuccess: () => a(),
66
77
  retry: 3
67
- }), O = at(t || "", {
78
+ }), J = It(t || "", {
68
79
  onSuccess: (e) => {
69
- var s;
80
+ var n;
70
81
  if ("error" in e) return;
71
- const r = ((s = e.items) == null ? void 0 : s.map((u) => {
72
- var i;
82
+ const r = ((n = e.items) == null ? void 0 : n.map((o) => {
83
+ var u;
73
84
  return {
74
- id: ((i = u.variant) == null ? void 0 : i.sku) || "",
75
- quantity: u.quantity,
76
- item_price: Number(u.priceAtPurchase)
85
+ id: ((u = o.variant) == null ? void 0 : u.sku) || "",
86
+ quantity: o.quantity,
87
+ item_price: Number(o.priceAtPurchase)
77
88
  };
78
- })) || [];
79
- R(
89
+ })) || [], s = `order_${e.id}`;
90
+ G(
80
91
  Number(e.totalPrice),
81
92
  "NGN",
82
93
  e.id,
83
- r
94
+ r,
95
+ s
84
96
  );
85
97
  }
86
98
  });
87
- m(() => {
88
- t && typeof window < "u" && localStorage.setItem(f, t);
99
+ d(() => {
100
+ t && typeof window < "u" && localStorage.setItem(l, t);
89
101
  }, [t]);
90
- const b = o(
91
- async (e, r, s, u, i) => {
102
+ const Q = c(
103
+ async (e, r, s, n, o) => {
104
+ var T;
92
105
  if (!t) throw new Error("No cart ID");
93
- await _.mutateAsync({ sku: u, quantity: i }), D(e, r, s, i);
106
+ const { fbc: u, fbp: y } = E(), x = await q.mutateAsync({ sku: n, quantity: o, fbc: u, fbp: y });
107
+ if ("error" in x) return;
108
+ const R = (T = x.items) == null ? void 0 : T.findLast(
109
+ (D) => {
110
+ var $;
111
+ return (($ = D.variant) == null ? void 0 : $.sku) === n;
112
+ }
113
+ );
114
+ if (R) {
115
+ const D = `cart_${t}_item_${R.id}`;
116
+ h(e, r, s, o, D);
117
+ } else
118
+ h(e, r, s, o);
94
119
  },
95
120
  // eslint-disable-next-line react-hooks/exhaustive-deps
96
- [t, D]
97
- ), q = o(
121
+ [t, h, E]
122
+ ), V = c(
98
123
  async (e, r) => {
99
124
  if (!t) throw new Error("No cart ID");
100
- await F.mutateAsync({ itemId: e, quantity: r });
125
+ await H.mutateAsync({ itemId: e, quantity: r });
101
126
  },
102
127
  // eslint-disable-next-line react-hooks/exhaustive-deps
103
128
  [t]
104
- ), H = o(
129
+ ), W = c(
105
130
  async (e) => {
106
131
  if (!t) throw new Error("No cart ID");
107
- await U.mutateAsync(e);
132
+ await K.mutateAsync(e);
108
133
  },
109
134
  // eslint-disable-next-line react-hooks/exhaustive-deps
110
135
  [t]
111
- ), K = o(
136
+ ), X = c(
112
137
  async (e) => {
113
138
  if (!t) throw new Error("No cart ID");
114
- await L.mutateAsync({ code: e });
139
+ await Y.mutateAsync({ code: e });
115
140
  },
116
141
  // eslint-disable-next-line react-hooks/exhaustive-deps
117
142
  [t]
118
- ), Y = o(async () => {
143
+ ), Z = c(async () => {
119
144
  if (!t) throw new Error("No cart ID");
120
- await j.mutateAsync();
121
- }, [t]), M = o(() => {
122
- c(null), typeof window < "u" && localStorage.removeItem(f);
123
- }, []), z = o(() => {
124
- M(), C.mutate(a);
125
- }, [a]), B = o(() => {
126
- v(!0);
127
- }, []), E = o(() => {
128
- v(!1);
129
- }, []), J = {
130
- cart: k || null,
145
+ await z.mutateAsync();
146
+ }, [t]), N = c(() => {
147
+ f(null), typeof window < "u" && localStorage.removeItem(l);
148
+ }, []), tt = c(() => {
149
+ N(), v.mutate(i);
150
+ }, [i]), et = c(() => {
151
+ A(!0);
152
+ }, []), P = c(() => {
153
+ A(!1);
154
+ }, []), rt = c(() => {
155
+ var n, o;
156
+ if (!m || !t) return;
157
+ const e = Number(((n = m.pricing) == null ? void 0 : n.total) || 0), r = ((o = m.items) == null ? void 0 : o.reduce((u, y) => u + y.quantity, 0)) || 0, s = `cart_${t}_checkout`;
158
+ M(e, r, s);
159
+ }, [m, t, M]), ot = {
160
+ cart: m || null,
131
161
  cartId: t,
132
- isLoading: T,
133
- error: w,
134
- updateCartMutation: G,
135
- checkoutMutation: O,
136
- addItem: b,
137
- updateItem: q,
138
- removeItem: H,
139
- applyDiscount: K,
140
- removeDiscount: Y,
141
- clearCart: M,
142
- clearAndCreateNewCart: z,
143
- refetch: n,
144
- isOpen: h,
145
- open: B,
146
- close: E
162
+ isLoading: O,
163
+ error: I,
164
+ updateCartMutation: B,
165
+ checkoutMutation: J,
166
+ addItem: Q,
167
+ updateItem: V,
168
+ removeItem: W,
169
+ applyDiscount: X,
170
+ removeDiscount: Z,
171
+ trackCheckoutInitiated: rt,
172
+ clearCart: N,
173
+ clearAndCreateNewCart: tt,
174
+ refetch: a,
175
+ isOpen: g,
176
+ open: et,
177
+ close: P
147
178
  };
148
- return /* @__PURE__ */ Q(N.Provider, { value: J, children: [
149
- l,
150
- g && /* @__PURE__ */ V(
151
- ct,
179
+ return /* @__PURE__ */ nt(F.Provider, { value: ot, children: [
180
+ p,
181
+ U && /* @__PURE__ */ ct(
182
+ wt,
152
183
  {
153
- isOpen: h,
154
- onClose: E,
155
- ...P
184
+ isOpen: g,
185
+ onClose: P,
186
+ ...L
156
187
  }
157
188
  )
158
189
  ] });
159
190
  }
160
- function It() {
161
- const l = X(N);
162
- if (!l)
191
+ function bt() {
192
+ const p = at(F);
193
+ if (!p)
163
194
  throw new Error("useCart must be used within CartProvider");
164
- return l;
195
+ return p;
165
196
  }
166
197
  export {
167
- N as CartContext,
168
- Ct as CartProvider,
169
- It as useCart
198
+ F as CartContext,
199
+ St as CartProvider,
200
+ bt as useCart
170
201
  };
package/dist/index32.mjs CHANGED
@@ -1,21 +1,21 @@
1
1
  'use client';
2
2
  import { useQueryClient as s, useMutation as i } from "@tanstack/react-query";
3
- import { useQueryUnwrapped as o } from "./index67.mjs";
3
+ import { useQueryUnwrapped as a } from "./index67.mjs";
4
4
  import { queryKeys as r } from "./index29.mjs";
5
- import { updateCart as c, createCart as l, applyDiscount as y, removeDiscount as m, addCartItem as C, updateCartItem as p, removeCartItem as q, checkoutCart as d, fetchCart as f } from "./index25.mjs";
6
- function b(e, t) {
7
- return o({
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
+ function Q(e, t) {
7
+ return a({
8
8
  queryKey: r.public.carts.detail(e),
9
- queryFn: () => f(e),
9
+ queryFn: () => d(e),
10
10
  ...t
11
11
  });
12
12
  }
13
13
  function S(e, t) {
14
- const u = s();
14
+ const n = s();
15
15
  return i({
16
- mutationFn: (n) => c(e, n),
16
+ mutationFn: (u) => c(e, u),
17
17
  onSuccess: () => {
18
- u.invalidateQueries({ queryKey: r.public.carts.detail(e) });
18
+ n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
19
19
  },
20
20
  ...t
21
21
  });
@@ -27,61 +27,61 @@ function D(e) {
27
27
  });
28
28
  }
29
29
  function h(e, t) {
30
- const u = s();
30
+ const n = s();
31
31
  return i({
32
- mutationFn: (n) => y(e, n.code),
32
+ mutationFn: (u) => y(e, u.code),
33
33
  onSuccess: () => {
34
- u.invalidateQueries({ queryKey: r.public.carts.detail(e) });
34
+ n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
35
35
  },
36
36
  ...t
37
37
  });
38
38
  }
39
39
  function k(e, t) {
40
- const u = s();
40
+ const n = s();
41
41
  return i({
42
42
  mutationFn: () => m(e),
43
43
  onSuccess: () => {
44
- u.invalidateQueries({ queryKey: r.public.carts.detail(e) });
44
+ n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
45
45
  },
46
46
  ...t
47
47
  });
48
48
  }
49
49
  function U(e, t) {
50
- const u = s();
50
+ const n = s();
51
51
  return i({
52
- mutationFn: (n) => C(e, n.sku, n.quantity),
52
+ mutationFn: (u) => p(e, u.sku, u.quantity, u.fbc, u.fbp),
53
53
  onSuccess: () => {
54
- u.invalidateQueries({ queryKey: r.public.carts.detail(e) });
54
+ n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
55
55
  },
56
56
  ...t
57
57
  });
58
58
  }
59
59
  function A(e, t) {
60
- const u = s();
60
+ const n = s();
61
61
  return i({
62
- mutationFn: ({ itemId: n, quantity: a }) => p(e, n, a),
62
+ mutationFn: ({ itemId: u, quantity: o }) => C(e, u, o),
63
63
  onSuccess: () => {
64
- u.invalidateQueries({ queryKey: r.public.carts.detail(e) });
64
+ n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
65
65
  },
66
66
  ...t
67
67
  });
68
68
  }
69
69
  function R(e, t) {
70
- const u = s();
70
+ const n = s();
71
71
  return i({
72
- mutationFn: (n) => q(e, n),
72
+ mutationFn: (u) => q(e, u),
73
73
  onSuccess: () => {
74
- u.invalidateQueries({ queryKey: r.public.carts.detail(e) });
74
+ n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
75
75
  },
76
76
  ...t
77
77
  });
78
78
  }
79
79
  function w(e, t) {
80
- const u = s();
80
+ const n = s();
81
81
  return i({
82
- mutationFn: (n) => d(e, n),
82
+ mutationFn: (u) => f(e, u),
83
83
  onSuccess: () => {
84
- u.invalidateQueries({ queryKey: r.public.carts.detail(e) });
84
+ n.invalidateQueries({ queryKey: r.public.carts.detail(e) });
85
85
  },
86
86
  ...t
87
87
  });
@@ -91,7 +91,7 @@ export {
91
91
  h as useApplyDiscount,
92
92
  w as useCheckoutCart,
93
93
  D as useCreateCart,
94
- b as useGetCart,
94
+ Q as useGetCart,
95
95
  R as useRemoveCartItem,
96
96
  k as useRemoveDiscount,
97
97
  S as useUpdateCart,
package/dist/index37.mjs CHANGED
@@ -1,46 +1,62 @@
1
1
  'use client';
2
- import { getDefaultExportFromCjs as h } from "./index60.mjs";
3
- import { __module as y } from "./index61.mjs";
4
- (function(q, x) {
5
- (function(g, l) {
6
- q.exports = l();
2
+ import { getDefaultExportFromCjs as x } from "./index60.mjs";
3
+ import { __module as q } from "./index61.mjs";
4
+ function S(b, p) {
5
+ for (var s = 0; s < p.length; s++) {
6
+ const c = p[s];
7
+ if (typeof c != "string" && !Array.isArray(c)) {
8
+ for (const o in c)
9
+ if (o !== "default" && !(o in b)) {
10
+ const t = Object.getOwnPropertyDescriptor(c, o);
11
+ t && Object.defineProperty(b, o, t.get ? t : {
12
+ enumerable: !0,
13
+ get: () => c[o]
14
+ });
15
+ }
16
+ }
17
+ }
18
+ return Object.freeze(Object.defineProperty(b, Symbol.toStringTag, { value: "Module" }));
19
+ }
20
+ (function(b, p) {
21
+ (function(s, c) {
22
+ b.exports = c();
7
23
  })(window, function() {
8
- return function(g) {
9
- var l = {};
10
- function a(t) {
11
- if (l[t]) return l[t].exports;
12
- var o = l[t] = { i: t, l: !1, exports: {} };
13
- return g[t].call(o.exports, o, o.exports, a), o.l = !0, o.exports;
24
+ return function(s) {
25
+ var c = {};
26
+ function o(t) {
27
+ if (c[t]) return c[t].exports;
28
+ var a = c[t] = { i: t, l: !1, exports: {} };
29
+ return s[t].call(a.exports, a, a.exports, o), a.l = !0, a.exports;
14
30
  }
15
- return a.m = g, a.c = l, a.d = function(t, o, i) {
16
- a.o(t, o) || Object.defineProperty(t, o, { enumerable: !0, get: i });
17
- }, a.r = function(t) {
31
+ return o.m = s, o.c = c, o.d = function(t, a, i) {
32
+ o.o(t, a) || Object.defineProperty(t, a, { enumerable: !0, get: i });
33
+ }, o.r = function(t) {
18
34
  typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 });
19
- }, a.t = function(t, o) {
20
- if (1 & o && (t = a(t)), 8 & o || 4 & o && typeof t == "object" && t && t.__esModule) return t;
35
+ }, o.t = function(t, a) {
36
+ if (1 & a && (t = o(t)), 8 & a || 4 & a && typeof t == "object" && t && t.__esModule) return t;
21
37
  var i = /* @__PURE__ */ Object.create(null);
22
- if (a.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: t }), 2 & o && typeof t != "string") for (var d in t) a.d(i, d, (function(u) {
38
+ if (o.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: t }), 2 & a && typeof t != "string") for (var d in t) o.d(i, d, (function(u) {
23
39
  return t[u];
24
40
  }).bind(null, d));
25
41
  return i;
26
- }, a.n = function(t) {
27
- var o = t && t.__esModule ? function() {
42
+ }, o.n = function(t) {
43
+ var a = t && t.__esModule ? function() {
28
44
  return t.default;
29
45
  } : function() {
30
46
  return t;
31
47
  };
32
- return a.d(o, "a", o), o;
33
- }, a.o = function(t, o) {
34
- return Object.prototype.hasOwnProperty.call(t, o);
35
- }, a.p = "", a(a.s = 0);
36
- }([function(g, l, a) {
37
- g.exports = a(1);
38
- }, function(g, l, a) {
48
+ return o.d(a, "a", a), a;
49
+ }, o.o = function(t, a) {
50
+ return Object.prototype.hasOwnProperty.call(t, a);
51
+ }, o.p = "", o(o.s = 0);
52
+ }([function(s, c, o) {
53
+ s.exports = o(1);
54
+ }, function(s, c, o) {
39
55
  function t(n) {
40
56
  return function(e) {
41
57
  if (Array.isArray(e)) {
42
- for (var r = 0, c = new Array(e.length); r < e.length; r++) c[r] = e[r];
43
- return c;
58
+ for (var r = 0, f = new Array(e.length); r < e.length; r++) f[r] = e[r];
59
+ return f;
44
60
  }
45
61
  }(n) || function(e) {
46
62
  if (Symbol.iterator in Object(e) || Object.prototype.toString.call(e) === "[object Arguments]") return Array.from(e);
@@ -48,41 +64,41 @@ import { __module as y } from "./index61.mjs";
48
64
  throw new TypeError("Invalid attempt to spread non-iterable instance");
49
65
  }();
50
66
  }
51
- a.r(l);
52
- var o = !!window.fbq, i = !1, d = function() {
67
+ o.r(c);
68
+ var a = !!window.fbq, i = !1, d = function() {
53
69
  var n;
54
70
  if (i) {
55
- for (var e = arguments.length, r = new Array(e), c = 0; c < e; c++) r[c] = arguments[c];
71
+ for (var e = arguments.length, r = new Array(e), f = 0; f < e; f++) r[f] = arguments[f];
56
72
  (n = console).info.apply(n, t(["[react-facebook-pixel]"].concat(r)));
57
73
  }
58
74
  }, u = function() {
59
75
  var n;
60
76
  if (i) {
61
- for (var e = arguments.length, r = new Array(e), c = 0; c < e; c++) r[c] = arguments[c];
77
+ for (var e = arguments.length, r = new Array(e), f = 0; f < e; f++) r[f] = arguments[f];
62
78
  (n = console).info.apply(n, t(["[react-facebook-pixel]"].concat(r)));
63
79
  }
64
- }, s = function() {
65
- return o || d("Pixel not initialized before using call ReactPixel.init with required params"), o;
66
- }, v = { autoConfig: !0, debug: !1 };
67
- l.default = { init: function(n) {
68
- var e, r, c, f, b, p, w = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : v;
69
- e = window, r = document, c = "script", e.fbq || (f = e.fbq = function() {
70
- f.callMethod ? f.callMethod.apply(f, arguments) : f.queue.push(arguments);
71
- }, e._fbq || (e._fbq = f), f.push = f, f.loaded = !0, f.version = "2.0", f.queue = [], (b = r.createElement(c)).async = !0, b.src = "https://connect.facebook.net/en_US/fbevents.js", (p = r.getElementsByTagName(c)[0]).parentNode.insertBefore(b, p)), n ? (m.autoConfig === !1 && fbq("set", "autoConfig", !1, n), fbq("init", n, w), o = !0, i = m.debug) : d("Please insert pixel id for initializing");
80
+ }, g = function() {
81
+ return a || d("Pixel not initialized before using call ReactPixel.init with required params"), a;
82
+ }, h = { autoConfig: !0, debug: !1 };
83
+ c.default = { init: function(n) {
84
+ var e, r, f, l, m, y, k = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, v = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : h;
85
+ e = window, r = document, f = "script", e.fbq || (l = e.fbq = function() {
86
+ l.callMethod ? l.callMethod.apply(l, arguments) : l.queue.push(arguments);
87
+ }, e._fbq || (e._fbq = l), l.push = l, l.loaded = !0, l.version = "2.0", l.queue = [], (m = r.createElement(f)).async = !0, m.src = "https://connect.facebook.net/en_US/fbevents.js", (y = r.getElementsByTagName(f)[0]).parentNode.insertBefore(m, y)), n ? (v.autoConfig === !1 && fbq("set", "autoConfig", !1, n), fbq("init", n, k), a = !0, i = v.debug) : d("Please insert pixel id for initializing");
72
88
  }, pageView: function() {
73
- s() && (fbq("track", "PageView"), i && u("called fbq('track', 'PageView');"));
89
+ g() && (fbq("track", "PageView"), i && u("called fbq('track', 'PageView');"));
74
90
  }, track: function(n, e) {
75
- s() && (fbq("track", n, e), i && (u("called fbq('track', '".concat(n, "');")), e && u("with data", e)));
91
+ g() && (fbq("track", n, e), i && (u("called fbq('track', '".concat(n, "');")), e && u("with data", e)));
76
92
  }, trackSingle: function(n, e, r) {
77
- s() && (fbq("trackSingle", n, e, r), i && (u("called fbq('trackSingle', '".concat(n, "', '").concat(e, "');")), r && u("with data", r)));
93
+ g() && (fbq("trackSingle", n, e, r), i && (u("called fbq('trackSingle', '".concat(n, "', '").concat(e, "');")), r && u("with data", r)));
78
94
  }, trackCustom: function(n, e) {
79
- s() && (fbq("trackCustom", n, e), i && (u("called fbq('trackCustom', '".concat(n, "');")), e && u("with data", e)));
95
+ g() && (fbq("trackCustom", n, e), i && (u("called fbq('trackCustom', '".concat(n, "');")), e && u("with data", e)));
80
96
  }, trackSingleCustom: function(n, e, r) {
81
- s() && (fbq("trackSingle", n, e, r), i && (u("called fbq('trackSingleCustom', '".concat(n, "', '").concat(e, "');")), r && u("with data", r)));
97
+ g() && (fbq("trackSingle", n, e, r), i && (u("called fbq('trackSingleCustom', '".concat(n, "', '").concat(e, "');")), r && u("with data", r)));
82
98
  }, grantConsent: function() {
83
- s() && (fbq("consent", "grant"), i && u("called fbq('consent', 'grant');"));
99
+ g() && (fbq("consent", "grant"), i && u("called fbq('consent', 'grant');"));
84
100
  }, revokeConsent: function() {
85
- s() && (fbq("consent", "revoke"), i && u("called fbq('consent', 'revoke');"));
101
+ g() && (fbq("consent", "revoke"), i && u("called fbq('consent', 'revoke');"));
86
102
  }, fbq: function(n) {
87
103
  function e() {
88
104
  return n.apply(this, arguments);
@@ -91,16 +107,20 @@ import { __module as y } from "./index61.mjs";
91
107
  return n.toString();
92
108
  }, e;
93
109
  }(function() {
94
- if (s()) {
110
+ if (g()) {
95
111
  for (var n = arguments.length, e = new Array(n), r = 0; r < n; r++) e[r] = arguments[r];
96
112
  fbq.apply(void 0, e), i && (u("called fbq('".concat(e.slice(0, 2).join("', '"), "')")), e[2] && u("with data", e[2]));
97
113
  }
98
114
  }) };
99
115
  }]);
100
116
  });
101
- })(y);
102
- var k = y.exports;
103
- const P = /* @__PURE__ */ h(k);
117
+ })(q);
118
+ var w = q.exports;
119
+ const j = /* @__PURE__ */ x(w), O = /* @__PURE__ */ S({
120
+ __proto__: null,
121
+ default: j
122
+ }, [w]);
104
123
  export {
105
- P as default
124
+ j as default,
125
+ O as f
106
126
  };
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 "./index62.mjs";
3
+ import { __require as i } from "./index63.mjs";
4
4
  function s(t, a) {
5
5
  for (var o = 0; o < a.length; o++) {
6
6
  const e = a[o];