@instockng/storefront-ui 1.0.28 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Checkout.d.ts.map +1 -1
- package/dist/contexts/CartContext.d.ts.map +1 -1
- package/dist/index100.mjs +3 -3
- package/dist/index101.mjs +1 -1
- package/dist/index102.mjs +1 -1
- package/dist/index103.mjs +1 -1
- package/dist/index104.mjs +2 -2
- package/dist/index105.mjs +2 -2
- package/dist/index106.mjs +3 -3
- package/dist/index107.mjs +1 -1
- package/dist/index108.mjs +3 -3
- package/dist/index109.mjs +2 -2
- package/dist/index110.mjs +2 -2
- package/dist/index111.mjs +1 -1
- package/dist/index112.mjs +3 -3
- package/dist/index113.mjs +1 -1
- package/dist/index114.mjs +1 -1
- package/dist/index115.mjs +3 -3
- package/dist/index116.mjs +2 -2
- package/dist/index117.mjs +4 -4
- package/dist/index118.mjs +1 -1
- package/dist/index119.mjs +3 -3
- package/dist/index12.mjs +171 -167
- package/dist/index120.mjs +4 -4
- package/dist/index121.mjs +1 -1
- package/dist/index122.mjs +1 -1
- package/dist/index123.mjs +1 -1
- package/dist/index124.mjs +1 -1
- package/dist/index125.mjs +1 -1
- package/dist/index126.mjs +1 -1
- package/dist/index127.mjs +1 -1
- package/dist/index128.mjs +2 -2
- package/dist/index129.mjs +3 -3
- package/dist/index132.mjs +1 -1
- package/dist/index134.mjs +21 -2
- package/dist/index135.mjs +56 -2
- package/dist/index136.mjs +29 -2
- package/dist/index137.mjs +7 -2
- package/dist/index138.mjs +50 -16
- package/dist/index139.mjs +6 -32
- package/dist/index140.mjs +11 -37
- package/dist/index141.mjs +7 -18
- package/dist/index142.mjs +28 -18
- package/dist/index143.mjs +2 -2
- package/dist/index144.mjs +70 -20
- package/dist/index145.mjs +163 -42
- package/dist/index147.mjs +2 -30
- package/dist/index148.mjs +2 -18
- package/dist/index149.mjs +2 -2
- package/dist/index150.mjs +18 -2
- package/dist/index151.mjs +32 -2
- package/dist/index152.mjs +38 -2
- package/dist/index153.mjs +13 -67
- package/dist/index154.mjs +18 -2
- package/dist/index155.mjs +2 -53
- package/dist/index156.mjs +20 -2
- package/dist/index157.mjs +39 -29
- package/dist/index158.mjs +2 -152
- package/dist/index159.mjs +30 -2
- package/dist/index160.mjs +18 -2
- package/dist/index161.mjs +2 -19
- package/dist/index162.mjs +2 -2
- package/dist/index163.mjs +2 -2
- package/dist/index164.mjs +2 -26
- package/dist/index165.mjs +72 -2
- package/dist/index166.mjs +2 -2
- package/dist/index167.mjs +49 -20
- package/dist/index168.mjs +2 -23
- package/dist/index169.mjs +36 -2
- package/dist/index170.mjs +152 -2
- package/dist/index171.mjs +2 -2
- package/dist/index172.mjs +2 -23
- package/dist/index173.mjs +19 -2
- package/dist/index174.mjs +2 -23
- package/dist/index176.mjs +26 -2
- package/dist/index177.mjs +2 -2
- package/dist/index178.mjs +2 -23
- package/dist/index179.mjs +24 -2
- package/dist/index180.mjs +15 -15
- package/dist/index181.mjs +2 -2
- package/dist/index182.mjs +2 -2
- package/dist/index183.mjs +2 -2
- package/dist/index184.mjs +23 -2
- package/dist/index185.mjs +2 -2
- package/dist/index186.mjs +23 -2
- package/dist/index187.mjs +2 -2
- package/dist/index188.mjs +2 -2
- package/dist/index189.mjs +2 -127
- package/dist/index19.mjs +26 -13
- package/dist/index190.mjs +23 -2
- package/dist/index191.mjs +2 -74
- package/dist/index192.mjs +20 -71
- package/dist/index193.mjs +2 -21
- package/dist/index194.mjs +2 -56
- package/dist/index195.mjs +2 -29
- package/dist/index196.mjs +2 -7
- package/dist/index197.mjs +2 -52
- package/dist/index198.mjs +2 -6
- package/dist/index199.mjs +2 -12
- package/dist/index200.mjs +2 -7
- package/dist/index201.mjs +127 -28
- package/dist/index202.mjs +2 -2
- package/dist/index203.mjs +73 -69
- package/dist/index204.mjs +71 -164
- package/dist/index205.mjs +31 -2
- package/dist/index206.mjs +11 -2
- package/dist/index207.mjs +4 -2
- package/dist/index208.mjs +4 -2
- package/dist/index209.mjs +13 -2
- package/dist/index210.mjs +7 -2
- package/dist/index211.mjs +11 -36
- package/dist/index212.mjs +5 -2
- package/dist/index213.mjs +33 -2
- package/dist/index214.mjs +31 -2
- package/dist/index215.mjs +28 -2
- package/dist/index216.mjs +58 -241
- package/dist/index218.mjs +2 -33
- package/dist/index219.mjs +2 -65
- package/dist/index220.mjs +2 -25
- package/dist/index221.mjs +2 -2
- package/dist/index222.mjs +2 -2
- package/dist/index223.mjs +2 -108
- package/dist/index224.mjs +2 -2
- package/dist/index225.mjs +37 -2
- package/dist/index226.mjs +2 -2
- package/dist/index227.mjs +108 -2
- package/dist/index229.mjs +2 -2
- package/dist/index232.mjs +244 -2
- package/dist/index233.mjs +2 -4
- package/dist/index234.mjs +33 -2
- package/dist/index235.mjs +65 -2
- package/dist/index236.mjs +24 -30
- package/dist/index237.mjs +2 -11
- package/dist/index238.mjs +2 -4
- package/dist/index239.mjs +2 -4
- package/dist/index240.mjs +2 -13
- package/dist/index241.mjs +2 -7
- package/dist/index242.mjs +2 -12
- package/dist/index243.mjs +2 -5
- package/dist/index244.mjs +2 -33
- package/dist/index245.mjs +2 -31
- package/dist/index246.mjs +2 -28
- package/dist/index247.mjs +4 -61
- package/dist/index248.mjs +3 -2
- package/dist/index249.mjs +2 -18
- package/dist/index250.mjs +2 -47
- package/dist/index251.mjs +17 -2
- package/dist/index252.mjs +13 -2
- package/dist/index253.mjs +6 -2
- package/dist/index254.mjs +30 -2
- package/dist/index255.mjs +2 -91
- package/dist/index256.mjs +18 -2
- package/dist/index257.mjs +47 -2
- package/dist/index258.mjs +2 -3
- package/dist/index259.mjs +2 -2
- package/dist/index260.mjs +2 -2
- package/dist/index261.mjs +2 -17
- package/dist/index262.mjs +2 -13
- package/dist/index263.mjs +91 -6
- package/dist/index264.mjs +2 -30
- package/dist/index3.mjs +95 -105
- package/dist/index32.mjs +1 -1
- package/dist/index33.mjs +1 -1
- package/dist/index34.mjs +1 -1
- package/dist/index35.mjs +1 -1
- package/dist/index36.mjs +1 -1
- package/dist/index37.mjs +1 -1
- package/dist/index38.mjs +2 -2
- package/dist/index39.mjs +3 -3
- package/dist/index42.mjs +1 -1
- package/dist/index48.mjs +2 -2
- package/dist/index49.mjs +1 -1
- package/dist/index50.mjs +1 -1
- package/dist/index51.mjs +1 -1
- package/dist/index52.mjs +1 -1
- package/dist/index53.mjs +1 -1
- package/dist/index54.mjs +1 -1
- package/dist/index55.mjs +1 -1
- package/dist/index56.mjs +1 -1
- package/dist/index57.mjs +1 -1
- package/dist/index58.mjs +1 -1
- package/dist/index59.mjs +1 -1
- package/dist/index60.mjs +20 -21
- package/dist/index61.mjs +21 -150
- package/dist/index63.mjs +149 -19
- package/dist/index64.mjs +4 -74
- package/dist/index65.mjs +74 -14
- package/dist/index66.mjs +14 -62
- package/dist/index67.mjs +62 -4
- package/dist/index73.mjs +1 -1
- package/dist/index77.mjs +5 -5
- package/dist/index79.mjs +3 -3
- package/dist/index89.mjs +1 -1
- package/dist/index90.mjs +3 -3
- package/dist/index92.mjs +34 -2
- package/dist/index93.mjs +40 -31
- package/dist/index94.mjs +2 -43
- package/dist/index96.mjs +1 -1
- package/dist/index97.mjs +1 -1
- package/dist/index98.mjs +6 -6
- package/dist/index99.mjs +4 -4
- package/dist/lib/utils.d.ts +8 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Checkout.tsx +11 -1
- package/src/contexts/CartContext.tsx +2 -20
- package/src/lib/utils.ts +20 -0
package/dist/index67.mjs
CHANGED
|
@@ -1,8 +1,66 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { getDefaultExportFromCjs as d } from "./index61.mjs";
|
|
3
|
+
import { __module as v } from "./index94.mjs";
|
|
4
|
+
v.exports = function(n) {
|
|
5
|
+
return g(m(n), n);
|
|
6
|
+
};
|
|
7
|
+
v.exports.array = g;
|
|
8
|
+
function g(n, r) {
|
|
9
|
+
var t = n.length, e = new Array(t), o = {}, u = t, c = y(r), f = E(n);
|
|
10
|
+
for (r.forEach(function(a) {
|
|
11
|
+
if (!f.has(a[0]) || !f.has(a[1]))
|
|
12
|
+
throw new Error("Unknown node. There is an unknown node in the supplied edges.");
|
|
13
|
+
}); u--; )
|
|
14
|
+
o[u] || l(n[u], u, /* @__PURE__ */ new Set());
|
|
15
|
+
return e;
|
|
16
|
+
function l(a, s, i) {
|
|
17
|
+
if (i.has(a)) {
|
|
18
|
+
var w;
|
|
19
|
+
try {
|
|
20
|
+
w = ", node was:" + JSON.stringify(a);
|
|
21
|
+
} catch {
|
|
22
|
+
w = "";
|
|
23
|
+
}
|
|
24
|
+
throw new Error("Cyclic dependency" + w);
|
|
25
|
+
}
|
|
26
|
+
if (!f.has(a))
|
|
27
|
+
throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: " + JSON.stringify(a));
|
|
28
|
+
if (!o[s]) {
|
|
29
|
+
o[s] = !0;
|
|
30
|
+
var h = c.get(a) || /* @__PURE__ */ new Set();
|
|
31
|
+
if (h = Array.from(h), s = h.length) {
|
|
32
|
+
i.add(a);
|
|
33
|
+
do {
|
|
34
|
+
var p = h[--s];
|
|
35
|
+
l(p, f.get(p), i);
|
|
36
|
+
} while (s);
|
|
37
|
+
i.delete(a);
|
|
38
|
+
}
|
|
39
|
+
e[--t] = a;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function m(n) {
|
|
44
|
+
for (var r = /* @__PURE__ */ new Set(), t = 0, e = n.length; t < e; t++) {
|
|
45
|
+
var o = n[t];
|
|
46
|
+
r.add(o[0]), r.add(o[1]);
|
|
47
|
+
}
|
|
48
|
+
return Array.from(r);
|
|
49
|
+
}
|
|
50
|
+
function y(n) {
|
|
51
|
+
for (var r = /* @__PURE__ */ new Map(), t = 0, e = n.length; t < e; t++) {
|
|
52
|
+
var o = n[t];
|
|
53
|
+
r.has(o[0]) || r.set(o[0], /* @__PURE__ */ new Set()), r.has(o[1]) || r.set(o[1], /* @__PURE__ */ new Set()), r.get(o[0]).add(o[1]);
|
|
54
|
+
}
|
|
55
|
+
return r;
|
|
56
|
+
}
|
|
57
|
+
function E(n) {
|
|
58
|
+
for (var r = /* @__PURE__ */ new Map(), t = 0, e = n.length; t < e; t++)
|
|
59
|
+
r.set(n[t], t);
|
|
60
|
+
return r;
|
|
5
61
|
}
|
|
62
|
+
var k = v.exports;
|
|
63
|
+
const A = /* @__PURE__ */ d(k);
|
|
6
64
|
export {
|
|
7
|
-
|
|
65
|
+
A as default
|
|
8
66
|
};
|
package/dist/index73.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { __module as u } from "./index133.mjs";
|
|
3
3
|
import d from "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import { __require as c } from "./
|
|
5
|
+
import { __require as c } from "./index63.mjs";
|
|
6
6
|
var n;
|
|
7
7
|
function y() {
|
|
8
8
|
return n ? u.exports : (n = 1, function(a, e) {
|
package/dist/index77.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import d from "./index75.mjs";
|
|
3
|
-
import U from "./
|
|
4
|
-
import q from "./
|
|
5
|
-
import R from "./
|
|
3
|
+
import U from "./index134.mjs";
|
|
4
|
+
import q from "./index135.mjs";
|
|
5
|
+
import R from "./index136.mjs";
|
|
6
6
|
import w from "./index78.mjs";
|
|
7
|
-
import A from "./
|
|
8
|
-
import m from "./
|
|
7
|
+
import A from "./index137.mjs";
|
|
8
|
+
import m from "./index138.mjs";
|
|
9
9
|
import T from "./index89.mjs";
|
|
10
10
|
const i = m.validators;
|
|
11
11
|
class k {
|
package/dist/index79.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import t from "./index75.mjs";
|
|
3
3
|
import c from "./index86.mjs";
|
|
4
|
-
import u from "./
|
|
4
|
+
import u from "./index139.mjs";
|
|
5
5
|
import S from "./index85.mjs";
|
|
6
|
-
import h from "./
|
|
7
|
-
import a from "./
|
|
6
|
+
import h from "./index140.mjs";
|
|
7
|
+
import a from "./index141.mjs";
|
|
8
8
|
import O from "./index80.mjs";
|
|
9
9
|
function y(i, r, e) {
|
|
10
10
|
if (t.isString(i))
|
package/dist/index89.mjs
CHANGED
package/dist/index90.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import s from "./index75.mjs";
|
|
3
|
-
import m from "./
|
|
4
|
-
import u from "./
|
|
5
|
-
import { getFetch as b } from "./
|
|
3
|
+
import m from "./index143.mjs";
|
|
4
|
+
import u from "./index144.mjs";
|
|
5
|
+
import { getFetch as b } from "./index145.mjs";
|
|
6
6
|
import d from "./index86.mjs";
|
|
7
7
|
const p = {
|
|
8
8
|
http: m,
|
package/dist/index92.mjs
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
var
|
|
2
|
+
var a = (i, t, e = {}) => {
|
|
3
|
+
let r = `${i}=${t}`;
|
|
4
|
+
if (i.startsWith("__Secure-") && !e.secure)
|
|
5
|
+
throw new Error("__Secure- Cookie must have Secure attributes");
|
|
6
|
+
if (i.startsWith("__Host-")) {
|
|
7
|
+
if (!e.secure)
|
|
8
|
+
throw new Error("__Host- Cookie must have Secure attributes");
|
|
9
|
+
if (e.path !== "/")
|
|
10
|
+
throw new Error('__Host- Cookie must have Path attributes with "/"');
|
|
11
|
+
if (e.domain)
|
|
12
|
+
throw new Error("__Host- Cookie must not have Domain attributes");
|
|
13
|
+
}
|
|
14
|
+
if (e && typeof e.maxAge == "number" && e.maxAge >= 0) {
|
|
15
|
+
if (e.maxAge > 3456e4)
|
|
16
|
+
throw new Error(
|
|
17
|
+
"Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration."
|
|
18
|
+
);
|
|
19
|
+
r += `; Max-Age=${e.maxAge | 0}`;
|
|
20
|
+
}
|
|
21
|
+
if (e.domain && e.prefix !== "host" && (r += `; Domain=${e.domain}`), e.path && (r += `; Path=${e.path}`), e.expires) {
|
|
22
|
+
if (e.expires.getTime() - Date.now() > 3456e7)
|
|
23
|
+
throw new Error(
|
|
24
|
+
"Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future."
|
|
25
|
+
);
|
|
26
|
+
r += `; Expires=${e.expires.toUTCString()}`;
|
|
27
|
+
}
|
|
28
|
+
if (e.httpOnly && (r += "; HttpOnly"), e.secure && (r += "; Secure"), e.sameSite && (r += `; SameSite=${e.sameSite.charAt(0).toUpperCase() + e.sameSite.slice(1)}`), e.priority && (r += `; Priority=${e.priority.charAt(0).toUpperCase() + e.priority.slice(1)}`), e.partitioned) {
|
|
29
|
+
if (!e.secure)
|
|
30
|
+
throw new Error("Partitioned Cookie must have Secure attributes");
|
|
31
|
+
r += "; Partitioned";
|
|
32
|
+
}
|
|
33
|
+
return r;
|
|
34
|
+
}, s = (i, t, e) => (t = encodeURIComponent(t), a(i, t, e));
|
|
3
35
|
export {
|
|
4
|
-
|
|
36
|
+
s as serialize
|
|
5
37
|
};
|
package/dist/index93.mjs
CHANGED
|
@@ -1,37 +1,46 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (i.startsWith("__Host-")) {
|
|
7
|
-
if (!e.secure)
|
|
8
|
-
throw new Error("__Host- Cookie must have Secure attributes");
|
|
9
|
-
if (e.path !== "/")
|
|
10
|
-
throw new Error('__Host- Cookie must have Path attributes with "/"');
|
|
11
|
-
if (e.domain)
|
|
12
|
-
throw new Error("__Host- Cookie must not have Domain attributes");
|
|
2
|
+
var s = (e, r) => (e = e.replace(/\/+$/, ""), e = e + "/", r = r.replace(/^\/+/, ""), e + r), p = (e, r) => {
|
|
3
|
+
for (const [n, t] of Object.entries(r)) {
|
|
4
|
+
const c = new RegExp("/:" + n + "(?:{[^/]+})?\\??");
|
|
5
|
+
e = e.replace(c, t ? `/${t}` : "");
|
|
13
6
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
return e;
|
|
8
|
+
}, f = (e) => {
|
|
9
|
+
const r = new URLSearchParams();
|
|
10
|
+
for (const [n, t] of Object.entries(e))
|
|
11
|
+
if (t !== void 0)
|
|
12
|
+
if (Array.isArray(t))
|
|
13
|
+
for (const c of t)
|
|
14
|
+
r.append(n, c);
|
|
15
|
+
else
|
|
16
|
+
r.set(n, t);
|
|
17
|
+
return r;
|
|
18
|
+
}, i = (e, r) => {
|
|
19
|
+
switch (r) {
|
|
20
|
+
case "ws":
|
|
21
|
+
return e.replace(/^http/, "ws");
|
|
22
|
+
case "http":
|
|
23
|
+
return e.replace(/^ws/, "http");
|
|
27
24
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
}, l = (e) => /^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e) ? e.replace(/\/index(?=\?|$)/, "/") : e.replace(/\/index(?=\?|$)/, "");
|
|
26
|
+
function a(e) {
|
|
27
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
28
|
+
}
|
|
29
|
+
function o(e, r) {
|
|
30
|
+
if (!a(e) && !a(r))
|
|
31
|
+
return r;
|
|
32
|
+
const n = { ...e };
|
|
33
|
+
for (const t in r) {
|
|
34
|
+
const c = r[t];
|
|
35
|
+
a(n[t]) && a(c) ? n[t] = o(n[t], c) : n[t] = c;
|
|
32
36
|
}
|
|
33
|
-
return
|
|
34
|
-
}
|
|
37
|
+
return n;
|
|
38
|
+
}
|
|
35
39
|
export {
|
|
36
|
-
|
|
40
|
+
f as buildSearchParams,
|
|
41
|
+
o as deepMerge,
|
|
42
|
+
s as mergePath,
|
|
43
|
+
l as removeIndexString,
|
|
44
|
+
p as replaceUrlParam,
|
|
45
|
+
i as replaceUrlProtocol
|
|
37
46
|
};
|
package/dist/index94.mjs
CHANGED
|
@@ -1,46 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
var
|
|
3
|
-
for (const [n, t] of Object.entries(r)) {
|
|
4
|
-
const c = new RegExp("/:" + n + "(?:{[^/]+})?\\??");
|
|
5
|
-
e = e.replace(c, t ? `/${t}` : "");
|
|
6
|
-
}
|
|
7
|
-
return e;
|
|
8
|
-
}, f = (e) => {
|
|
9
|
-
const r = new URLSearchParams();
|
|
10
|
-
for (const [n, t] of Object.entries(e))
|
|
11
|
-
if (t !== void 0)
|
|
12
|
-
if (Array.isArray(t))
|
|
13
|
-
for (const c of t)
|
|
14
|
-
r.append(n, c);
|
|
15
|
-
else
|
|
16
|
-
r.set(n, t);
|
|
17
|
-
return r;
|
|
18
|
-
}, i = (e, r) => {
|
|
19
|
-
switch (r) {
|
|
20
|
-
case "ws":
|
|
21
|
-
return e.replace(/^http/, "ws");
|
|
22
|
-
case "http":
|
|
23
|
-
return e.replace(/^ws/, "http");
|
|
24
|
-
}
|
|
25
|
-
}, l = (e) => /^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e) ? e.replace(/\/index(?=\?|$)/, "/") : e.replace(/\/index(?=\?|$)/, "");
|
|
26
|
-
function a(e) {
|
|
27
|
-
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
28
|
-
}
|
|
29
|
-
function o(e, r) {
|
|
30
|
-
if (!a(e) && !a(r))
|
|
31
|
-
return r;
|
|
32
|
-
const n = { ...e };
|
|
33
|
-
for (const t in r) {
|
|
34
|
-
const c = r[t];
|
|
35
|
-
a(n[t]) && a(c) ? n[t] = o(n[t], c) : n[t] = c;
|
|
36
|
-
}
|
|
37
|
-
return n;
|
|
38
|
-
}
|
|
2
|
+
var o = { exports: {} };
|
|
39
3
|
export {
|
|
40
|
-
|
|
41
|
-
o as deepMerge,
|
|
42
|
-
s as mergePath,
|
|
43
|
-
l as removeIndexString,
|
|
44
|
-
p as replaceUrlParam,
|
|
45
|
-
i as replaceUrlProtocol
|
|
4
|
+
o as __module
|
|
46
5
|
};
|
package/dist/index96.mjs
CHANGED
package/dist/index97.mjs
CHANGED
package/dist/index98.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { __module as m } from "./
|
|
2
|
+
import { __module as m } from "./index149.mjs";
|
|
3
3
|
import "./index69.mjs";
|
|
4
|
-
import { __require as j } from "./
|
|
5
|
-
import { __require as V } from "./
|
|
6
|
-
import { __require as k } from "./
|
|
7
|
-
import { __require as G } from "./
|
|
8
|
-
import { __require as W } from "./
|
|
4
|
+
import { __require as j } from "./index150.mjs";
|
|
5
|
+
import { __require as V } from "./index151.mjs";
|
|
6
|
+
import { __require as k } from "./index152.mjs";
|
|
7
|
+
import { __require as G } from "./index153.mjs";
|
|
8
|
+
import { __require as W } from "./index154.mjs";
|
|
9
9
|
import { __exports as X } from "./index74.mjs";
|
|
10
10
|
var M;
|
|
11
11
|
function ee() {
|
package/dist/index99.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { __module as L } from "./
|
|
2
|
+
import { __module as L } from "./index155.mjs";
|
|
3
3
|
import "./index69.mjs";
|
|
4
4
|
import { __require as K } from "./index96.mjs";
|
|
5
5
|
import F from "react/jsx-runtime";
|
|
6
6
|
import J from "react-dom";
|
|
7
7
|
import N from "react";
|
|
8
|
-
import { __require as B } from "./
|
|
9
|
-
import { __require as D } from "./
|
|
10
|
-
import { __require as G } from "./
|
|
8
|
+
import { __require as B } from "./index156.mjs";
|
|
9
|
+
import { __require as D } from "./index157.mjs";
|
|
10
|
+
import { __require as G } from "./index152.mjs";
|
|
11
11
|
import { __exports as Q } from "./index74.mjs";
|
|
12
12
|
var w;
|
|
13
13
|
function ie() {
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -4,4 +4,12 @@ export declare function formatCurrency(amount: number): string;
|
|
|
4
4
|
export declare function formatDate(date: string | Date): string;
|
|
5
5
|
export declare function formatDateTime(date: string | Date): string;
|
|
6
6
|
export declare function getStatusColor(status: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Extract Facebook attribution cookies (fbc & fbp) for Meta Pixel CAPI
|
|
9
|
+
* @returns Object with fbc (Facebook Click ID) and fbp (Facebook Browser ID) cookies
|
|
10
|
+
*/
|
|
11
|
+
export declare function getFbCookies(): {
|
|
12
|
+
fbc: string | undefined;
|
|
13
|
+
fbp: string | undefined;
|
|
14
|
+
};
|
|
7
15
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKrD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAOtD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAS1D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAUrD"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKrD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAOtD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAS1D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAUrD;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI;IAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAcnF"}
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
CheckCircle,
|
|
29
29
|
Package,
|
|
30
30
|
} from 'lucide-react';
|
|
31
|
-
import { formatCurrency, cn } from '../lib/utils';
|
|
31
|
+
import { formatCurrency, cn, getFbCookies } from '../lib/utils';
|
|
32
32
|
import PaystackSVG from "../paystack.svg"
|
|
33
33
|
import { usePaystackPayment } from '../hooks/usePaystackPayment';
|
|
34
34
|
|
|
@@ -155,6 +155,9 @@ export function Checkout({
|
|
|
155
155
|
onSuccess: async (response) => {
|
|
156
156
|
|
|
157
157
|
try {
|
|
158
|
+
// Get Facebook attribution cookies for CAPI
|
|
159
|
+
const { fbc, fbp } = getFbCookies();
|
|
160
|
+
|
|
158
161
|
const order = await checkout.mutateAsync({
|
|
159
162
|
firstName: formData.firstName,
|
|
160
163
|
lastName: formData.lastName,
|
|
@@ -165,6 +168,8 @@ export function Checkout({
|
|
|
165
168
|
deliveryZoneId: selectedDeliveryZoneId || formData.deliveryZoneId,
|
|
166
169
|
paymentMethod: formData.paymentMethod,
|
|
167
170
|
paystackReference: response.reference,
|
|
171
|
+
fbc,
|
|
172
|
+
fbp,
|
|
168
173
|
});
|
|
169
174
|
|
|
170
175
|
// Check if response is an error
|
|
@@ -419,6 +424,9 @@ export function Checkout({
|
|
|
419
424
|
|
|
420
425
|
// For COD payment, proceed directly with checkout
|
|
421
426
|
try {
|
|
427
|
+
// Get Facebook attribution cookies for CAPI
|
|
428
|
+
const { fbc, fbp } = getFbCookies();
|
|
429
|
+
|
|
422
430
|
const order = await checkout.mutateAsync({
|
|
423
431
|
firstName: formData.firstName,
|
|
424
432
|
lastName: formData.lastName,
|
|
@@ -428,6 +436,8 @@ export function Checkout({
|
|
|
428
436
|
city: formData.city,
|
|
429
437
|
deliveryZoneId: selectedDeliveryZoneId || formData.deliveryZoneId,
|
|
430
438
|
paymentMethod: formData.paymentMethod,
|
|
439
|
+
fbc,
|
|
440
|
+
fbp,
|
|
431
441
|
});
|
|
432
442
|
|
|
433
443
|
// Check if response is an error
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
} from '@instockng/api-client';
|
|
24
24
|
import { ShoppingCart } from '../components/ShoppingCart';
|
|
25
25
|
import { useMetaPixel } from '../providers/MetaPixelProvider';
|
|
26
|
+
import { getFbCookies } from '../lib/utils';
|
|
26
27
|
|
|
27
28
|
const CART_ID_KEY = 'oms_cart_id';
|
|
28
29
|
|
|
@@ -96,25 +97,6 @@ export function CartProvider({ children, brandSlug, initialCartId, shoppingCartP
|
|
|
96
97
|
// Get Meta Pixel tracking methods
|
|
97
98
|
const { trackAddToCart, trackInitiateCheckout } = useMetaPixel();
|
|
98
99
|
|
|
99
|
-
/**
|
|
100
|
-
* Extract fbc (Facebook Click ID) and fbp (Facebook Browser ID) cookies for attribution
|
|
101
|
-
*/
|
|
102
|
-
const getFbCookies = useCallback(() => {
|
|
103
|
-
if (typeof document === 'undefined') return { fbc: undefined, fbp: undefined };
|
|
104
|
-
|
|
105
|
-
const getCookie = (name: string) => {
|
|
106
|
-
const value = `; ${document.cookie}`;
|
|
107
|
-
const parts = value.split(`; ${name}=`);
|
|
108
|
-
if (parts.length === 2) return parts.pop()?.split(';').shift();
|
|
109
|
-
return undefined;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
return {
|
|
113
|
-
fbc: getCookie('_fbc'),
|
|
114
|
-
fbp: getCookie('_fbp'),
|
|
115
|
-
};
|
|
116
|
-
}, []);
|
|
117
|
-
|
|
118
100
|
// Set mounted flag on client
|
|
119
101
|
useEffect(() => {
|
|
120
102
|
setIsMounted(true);
|
|
@@ -281,7 +263,7 @@ export function CartProvider({ children, brandSlug, initialCartId, shoppingCartP
|
|
|
281
263
|
}
|
|
282
264
|
},
|
|
283
265
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
284
|
-
[cartId, trackAddToCart
|
|
266
|
+
[cartId, trackAddToCart]
|
|
285
267
|
);
|
|
286
268
|
|
|
287
269
|
const updateItem = useCallback(
|
package/src/lib/utils.ts
CHANGED
|
@@ -43,3 +43,23 @@ export function getStatusColor(status: string): string {
|
|
|
43
43
|
}
|
|
44
44
|
return colors[status] || 'bg-gray-100 text-gray-800'
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Extract Facebook attribution cookies (fbc & fbp) for Meta Pixel CAPI
|
|
49
|
+
* @returns Object with fbc (Facebook Click ID) and fbp (Facebook Browser ID) cookies
|
|
50
|
+
*/
|
|
51
|
+
export function getFbCookies(): { fbc: string | undefined; fbp: string | undefined } {
|
|
52
|
+
if (typeof document === 'undefined') return { fbc: undefined, fbp: undefined };
|
|
53
|
+
|
|
54
|
+
const getCookie = (name: string) => {
|
|
55
|
+
const value = `; ${document.cookie}`;
|
|
56
|
+
const parts = value.split(`; ${name}=`);
|
|
57
|
+
if (parts.length === 2) return parts.pop()?.split(';').shift();
|
|
58
|
+
return undefined;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
fbc: getCookie('_fbc'),
|
|
63
|
+
fbp: getCookie('_fbp'),
|
|
64
|
+
};
|
|
65
|
+
}
|