@instockng/storefront-ui 1.0.75 → 1.0.76
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/ProductAddOns.d.ts +3 -1
- package/dist/components/ProductAddOns.d.ts.map +1 -1
- package/dist/components/RecommendedProducts.d.ts.map +1 -1
- package/dist/components/VariantPickerModal.d.ts +28 -0
- package/dist/components/VariantPickerModal.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +104 -102
- package/dist/index10.mjs +162 -121
- package/dist/index100.mjs +20 -69
- package/dist/index101.mjs +55 -34
- package/dist/index102.mjs +32 -42
- package/dist/index103.mjs +2 -2
- package/dist/index104.mjs +2 -28
- package/dist/index105.mjs +20 -17
- package/dist/index106.mjs +54 -213
- package/dist/index107.mjs +28 -179
- package/dist/index108.mjs +6 -21
- package/dist/index109.mjs +50 -21
- package/dist/index11.mjs +116 -88
- package/dist/index110.mjs +6 -33
- package/dist/index111.mjs +11 -155
- package/dist/index112.mjs +7 -20
- package/dist/index113.mjs +28 -31
- package/dist/index114.mjs +2 -84
- package/dist/index115.mjs +68 -36
- package/dist/index116.mjs +163 -141
- package/dist/index117.mjs +2 -55
- package/dist/index118.mjs +26 -21
- package/dist/index119.mjs +11 -20
- package/dist/index12.mjs +86 -90
- package/dist/index120.mjs +211 -19
- package/dist/index121.mjs +174 -19
- package/dist/index122.mjs +15 -14
- package/dist/index123.mjs +16 -15
- package/dist/index124.mjs +26 -14
- package/dist/index125.mjs +147 -56
- package/dist/index126.mjs +10 -8
- package/dist/index127.mjs +22 -30
- package/dist/index128.mjs +77 -17
- package/dist/index129.mjs +30 -26
- package/dist/index13.mjs +83 -185
- package/dist/index130.mjs +140 -22
- package/dist/index131.mjs +50 -14
- package/dist/index132.mjs +17 -15
- package/dist/index133.mjs +18 -38
- package/dist/index134.mjs +17 -17
- package/dist/index135.mjs +19 -262
- package/dist/index136.mjs +13 -62
- package/dist/index137.mjs +21 -7
- package/dist/index138.mjs +21 -2
- package/dist/index139.mjs +65 -2
- package/dist/index14.mjs +196 -94
- package/dist/index140.mjs +12 -27
- package/dist/index141.mjs +39 -2
- package/dist/index142.mjs +24 -2
- package/dist/index143.mjs +33 -20
- package/dist/index144.mjs +25 -54
- package/dist/index145.mjs +18 -28
- package/dist/index146.mjs +20 -6
- package/dist/index147.mjs +44 -49
- package/dist/index148.mjs +23 -6
- package/dist/index149.mjs +267 -11
- package/dist/index15.mjs +82 -713
- package/dist/index150.mjs +70 -7
- package/dist/index151.mjs +8 -28
- package/dist/index152.mjs +2 -2
- package/dist/index153.mjs +2 -70
- package/dist/index154.mjs +30 -164
- package/dist/index155.mjs +2 -2
- package/dist/index159.mjs +1 -1
- package/dist/index16.mjs +722 -53
- package/dist/index160.mjs +1 -1
- package/dist/index161.mjs +1 -1
- package/dist/index162.mjs +1 -1
- package/dist/index163.mjs +1 -1
- package/dist/index165.mjs +3 -3
- package/dist/index166.mjs +1 -1
- package/dist/index168.mjs +3 -3
- package/dist/index169.mjs +1 -1
- package/dist/index17.mjs +58 -60
- package/dist/index174.mjs +2 -2
- package/dist/index176.mjs +1 -1
- package/dist/index18.mjs +60 -22
- package/dist/index182.mjs +1 -1
- package/dist/index185.mjs +1 -1
- package/dist/index188.mjs +3 -3
- package/dist/index189.mjs +1 -1
- package/dist/index19.mjs +22 -107
- package/dist/index193.mjs +2 -2
- package/dist/index195.mjs +2 -2
- package/dist/index199.mjs +1 -1
- package/dist/index2.mjs +2 -2
- package/dist/index20.mjs +105 -38
- package/dist/index201.mjs +1 -1
- package/dist/index21.mjs +37 -37
- package/dist/index210.mjs +2 -2
- package/dist/index212.mjs +1 -1
- package/dist/index213.mjs +1 -1
- package/dist/index214.mjs +1 -1
- package/dist/index215.mjs +3 -3
- package/dist/index218.mjs +3 -3
- package/dist/index22.mjs +42 -71
- package/dist/index220.mjs +1 -1
- package/dist/index222.mjs +3 -3
- package/dist/index223.mjs +8 -8
- package/dist/index224.mjs +3 -3
- package/dist/index226.mjs +2 -2
- package/dist/index227.mjs +2 -108
- package/dist/index228.mjs +2 -2
- package/dist/index229.mjs +2 -2
- package/dist/index23.mjs +67 -28
- package/dist/index230.mjs +2 -37
- package/dist/index231.mjs +2 -2
- package/dist/index232.mjs +2 -2
- package/dist/index233.mjs +37 -2
- package/dist/index234.mjs +2 -2
- package/dist/index237.mjs +1 -1
- package/dist/index239.mjs +2 -2
- package/dist/index24.mjs +29 -6
- package/dist/index240.mjs +1 -1
- package/dist/index241.mjs +2 -2
- package/dist/index242.mjs +2 -2
- package/dist/index243.mjs +2 -2
- package/dist/index244.mjs +108 -2
- package/dist/index245.mjs +2 -2
- package/dist/index246.mjs +2 -2
- package/dist/index247.mjs +2 -2
- package/dist/index248.mjs +2 -2
- package/dist/index249.mjs +2 -2
- package/dist/index25.mjs +8 -21
- package/dist/index250.mjs +2 -2
- package/dist/index251.mjs +2 -2
- package/dist/index253.mjs +2 -2
- package/dist/index254.mjs +2 -2
- package/dist/index255.mjs +2 -2
- package/dist/index256.mjs +2 -4
- package/dist/index257.mjs +4 -2
- package/dist/index258.mjs +3 -2
- package/dist/index259.mjs +2 -18
- package/dist/index26.mjs +19 -34
- package/dist/index260.mjs +2 -47
- package/dist/index261.mjs +17 -2
- package/dist/index262.mjs +13 -2
- package/dist/index263.mjs +6 -2
- package/dist/index264.mjs +30 -2
- package/dist/index265.mjs +2 -91
- package/dist/index266.mjs +2 -3
- package/dist/index267.mjs +18 -2
- package/dist/index268.mjs +47 -2
- package/dist/index269.mjs +2 -17
- package/dist/index27.mjs +34 -37
- package/dist/index270.mjs +2 -13
- package/dist/index271.mjs +2 -6
- package/dist/index272.mjs +91 -30
- package/dist/index273.mjs +2 -2
- package/dist/index274.mjs +2 -2
- package/dist/index276.mjs +2 -2
- package/dist/index277.mjs +5 -0
- package/dist/index28.mjs +28 -103
- package/dist/index29.mjs +104 -20
- package/dist/index3.mjs +5 -5
- package/dist/index30.mjs +29 -9
- package/dist/index31.mjs +9 -9
- package/dist/index32.mjs +11 -116
- package/dist/index33.mjs +116 -25
- package/dist/index34.mjs +25 -81
- package/dist/index35.mjs +81 -112
- package/dist/index36.mjs +109 -8
- package/dist/index37.mjs +9 -33
- package/dist/index38.mjs +26 -19
- package/dist/index39.mjs +26 -9
- package/dist/index4.mjs +1 -1
- package/dist/index40.mjs +10 -122
- package/dist/index41.mjs +114 -380
- package/dist/index42.mjs +384 -20
- package/dist/index43.mjs +24 -31
- package/dist/index44.mjs +32 -7
- package/dist/index45.mjs +6 -1432
- package/dist/index46.mjs +1432 -69
- package/dist/index47.mjs +70 -2
- package/dist/index48.mjs +2 -60
- package/dist/index49.mjs +57 -48
- package/dist/index5.mjs +1 -1
- package/dist/index50.mjs +51 -33
- package/dist/index51.mjs +33 -15
- package/dist/index52.mjs +12 -2260
- package/dist/index53.mjs +2263 -36
- package/dist/index54.mjs +36 -44
- package/dist/index55.mjs +44 -99
- package/dist/index56.mjs +99 -81
- package/dist/index57.mjs +75 -13
- package/dist/index58.mjs +15 -125
- package/dist/index59.mjs +93 -89
- package/dist/index6.mjs +1 -1
- package/dist/index60.mjs +102 -56
- package/dist/index61.mjs +55 -89
- package/dist/index62.mjs +82 -76
- package/dist/index63.mjs +100 -13
- package/dist/index64.mjs +17 -92
- package/dist/index65.mjs +70 -56
- package/dist/index66.mjs +62 -44
- package/dist/index67.mjs +47 -46
- package/dist/index68.mjs +48 -121
- package/dist/index69.mjs +133 -22
- package/dist/index7.mjs +6 -6
- package/dist/index70.mjs +21 -150
- package/dist/index71.mjs +2 -23
- package/dist/index73.mjs +23 -2
- package/dist/index74.mjs +149 -71
- package/dist/index75.mjs +74 -14
- package/dist/index76.mjs +14 -62
- package/dist/index77.mjs +63 -2
- package/dist/index78.mjs +234 -5
- package/dist/index79.mjs +5 -1133
- package/dist/index8.mjs +4 -4
- package/dist/index80.mjs +131 -17
- package/dist/index81.mjs +67 -54
- package/dist/index82.mjs +84 -30
- package/dist/index83.mjs +29 -2
- package/dist/index84.mjs +9 -235
- package/dist/index85.mjs +74 -5
- package/dist/index86.mjs +3 -133
- package/dist/index87.mjs +2 -68
- package/dist/index88.mjs +79 -83
- package/dist/index89.mjs +52 -27
- package/dist/index9.mjs +3 -3
- package/dist/index90.mjs +5 -8
- package/dist/index91.mjs +4 -74
- package/dist/index92.mjs +178 -3
- package/dist/index93.mjs +53 -2
- package/dist/index94.mjs +68 -82
- package/dist/index95.mjs +33 -53
- package/dist/index96.mjs +42 -5
- package/dist/index97.mjs +2 -5
- package/dist/index98.mjs +5 -178
- package/dist/index99.mjs +1134 -53
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ProductAddOns.stories.tsx +10 -3
- package/src/components/ProductAddOns.tsx +167 -112
- package/src/components/RecommendedProducts.tsx +130 -88
- package/src/components/VariantPickerModal.tsx +154 -0
- package/src/index.ts +3 -0
package/dist/index107.mjs
CHANGED
|
@@ -1,183 +1,32 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
handleClientScriptLoad: function() {
|
|
30
|
-
return C;
|
|
31
|
-
},
|
|
32
|
-
initScriptLoader: function() {
|
|
33
|
-
return $;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
const j = Q, P = K(), O = F, h = /* @__PURE__ */ j._(J), g = /* @__PURE__ */ P._(N), R = B(), k = D(), I = G(), v = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Set(), A = (t) => {
|
|
37
|
-
if (h.default.preinit) {
|
|
38
|
-
t.forEach((e) => {
|
|
39
|
-
h.default.preinit(e, {
|
|
40
|
-
as: "style"
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (typeof window < "u") {
|
|
46
|
-
let e = document.head;
|
|
47
|
-
t.forEach((n) => {
|
|
48
|
-
let s = document.createElement("link");
|
|
49
|
-
s.type = "text/css", s.rel = "stylesheet", s.href = n, e.appendChild(s);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}, y = (t) => {
|
|
53
|
-
const { src: e, id: n, onLoad: s = () => {
|
|
54
|
-
}, onReady: l = null, dangerouslySetInnerHTML: i, children: _ = "", strategy: S = "afterInteractive", onError: r, stylesheets: q } = t, c = n || e;
|
|
55
|
-
if (c && p.has(c))
|
|
56
|
-
return;
|
|
57
|
-
if (v.has(e)) {
|
|
58
|
-
p.add(c), v.get(e).then(s, r);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const d = () => {
|
|
62
|
-
l && l(), p.add(c);
|
|
63
|
-
}, a = document.createElement("script"), u = new Promise((m, b) => {
|
|
64
|
-
a.addEventListener("load", function(f) {
|
|
65
|
-
m(), s && s.call(this, f), d();
|
|
66
|
-
}), a.addEventListener("error", function(f) {
|
|
67
|
-
b(f);
|
|
68
|
-
});
|
|
69
|
-
}).catch(function(m) {
|
|
70
|
-
r && r(m);
|
|
71
|
-
});
|
|
72
|
-
i ? (a.innerHTML = i.__html || "", d()) : _ ? (a.textContent = typeof _ == "string" ? _ : Array.isArray(_) ? _.join("") : "", d()) : e && (a.src = e, v.set(e, u)), (0, k.setAttributesFromProps)(a, t), S === "worker" && a.setAttribute("type", "text/partytown"), a.setAttribute("data-nscript", S), q && A(q), document.body.appendChild(a);
|
|
73
|
-
};
|
|
74
|
-
function C(t) {
|
|
75
|
-
const { strategy: e = "afterInteractive" } = t;
|
|
76
|
-
e === "lazyOnload" ? window.addEventListener("load", () => {
|
|
77
|
-
(0, I.requestIdleCallback)(() => y(t));
|
|
78
|
-
}) : y(t);
|
|
79
|
-
}
|
|
80
|
-
function H(t) {
|
|
81
|
-
document.readyState === "complete" ? (0, I.requestIdleCallback)(() => y(t)) : window.addEventListener("load", () => {
|
|
82
|
-
(0, I.requestIdleCallback)(() => y(t));
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
function T() {
|
|
86
|
-
[
|
|
87
|
-
...document.querySelectorAll('[data-nscript="beforeInteractive"]'),
|
|
88
|
-
...document.querySelectorAll('[data-nscript="beforePageRender"]')
|
|
89
|
-
].forEach((e) => {
|
|
90
|
-
const n = e.id || e.getAttribute("src");
|
|
91
|
-
p.add(n);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
function $(t) {
|
|
95
|
-
t.forEach(C), T();
|
|
96
|
-
}
|
|
97
|
-
function E(t) {
|
|
98
|
-
const { id: e, src: n = "", onLoad: s = () => {
|
|
99
|
-
}, onReady: l = null, strategy: i = "afterInteractive", onError: _, stylesheets: S, ...r } = t, { updateScripts: q, scripts: c, getIsSsr: d, appDir: a, nonce: u } = (0, g.useContext)(R.HeadManagerContext), m = (0, g.useRef)(!1);
|
|
100
|
-
(0, g.useEffect)(() => {
|
|
101
|
-
const f = e || n;
|
|
102
|
-
m.current || (l && f && p.has(f) && l(), m.current = !0);
|
|
103
|
-
}, [
|
|
104
|
-
l,
|
|
105
|
-
e,
|
|
106
|
-
n
|
|
107
|
-
]);
|
|
108
|
-
const b = (0, g.useRef)(!1);
|
|
109
|
-
if ((0, g.useEffect)(() => {
|
|
110
|
-
b.current || (i === "afterInteractive" ? y(t) : i === "lazyOnload" && H(t), b.current = !0);
|
|
111
|
-
}, [
|
|
112
|
-
t,
|
|
113
|
-
i
|
|
114
|
-
]), (i === "beforeInteractive" || i === "worker") && (q ? (c[i] = (c[i] || []).concat([
|
|
115
|
-
{
|
|
116
|
-
id: e,
|
|
117
|
-
src: n,
|
|
118
|
-
onLoad: s,
|
|
119
|
-
onReady: l,
|
|
120
|
-
onError: _,
|
|
121
|
-
...r
|
|
122
|
-
}
|
|
123
|
-
]), q(c)) : d && d() ? p.add(e || n) : d && !d() && y(t)), a) {
|
|
124
|
-
if (S && S.forEach((f) => {
|
|
125
|
-
h.default.preinit(f, {
|
|
126
|
-
as: "style"
|
|
127
|
-
});
|
|
128
|
-
}), i === "beforeInteractive")
|
|
129
|
-
return n ? (h.default.preload(n, r.integrity ? {
|
|
130
|
-
as: "script",
|
|
131
|
-
integrity: r.integrity,
|
|
132
|
-
nonce: u,
|
|
133
|
-
crossOrigin: r.crossOrigin
|
|
134
|
-
} : {
|
|
135
|
-
as: "script",
|
|
136
|
-
nonce: u,
|
|
137
|
-
crossOrigin: r.crossOrigin
|
|
138
|
-
}), /* @__PURE__ */ (0, O.jsx)("script", {
|
|
139
|
-
nonce: u,
|
|
140
|
-
dangerouslySetInnerHTML: {
|
|
141
|
-
__html: "(self.__next_s=self.__next_s||[]).push(" + JSON.stringify([
|
|
142
|
-
n,
|
|
143
|
-
{
|
|
144
|
-
...r,
|
|
145
|
-
id: e
|
|
146
|
-
}
|
|
147
|
-
]) + ")"
|
|
148
|
-
}
|
|
149
|
-
})) : (r.dangerouslySetInnerHTML && (r.children = r.dangerouslySetInnerHTML.__html, delete r.dangerouslySetInnerHTML), /* @__PURE__ */ (0, O.jsx)("script", {
|
|
150
|
-
nonce: u,
|
|
151
|
-
dangerouslySetInnerHTML: {
|
|
152
|
-
__html: "(self.__next_s=self.__next_s||[]).push(" + JSON.stringify([
|
|
153
|
-
0,
|
|
154
|
-
{
|
|
155
|
-
...r,
|
|
156
|
-
id: e
|
|
157
|
-
}
|
|
158
|
-
]) + ")"
|
|
159
|
-
}
|
|
160
|
-
}));
|
|
161
|
-
i === "afterInteractive" && n && h.default.preload(n, r.integrity ? {
|
|
162
|
-
as: "script",
|
|
163
|
-
integrity: r.integrity,
|
|
164
|
-
nonce: u,
|
|
165
|
-
crossOrigin: r.crossOrigin
|
|
166
|
-
} : {
|
|
167
|
-
as: "script",
|
|
168
|
-
nonce: u,
|
|
169
|
-
crossOrigin: r.crossOrigin
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
Object.defineProperty(E, "__nextScript", {
|
|
175
|
-
value: !0
|
|
176
|
-
});
|
|
177
|
-
const z = E;
|
|
178
|
-
(typeof o.default == "function" || typeof o.default == "object" && o.default !== null) && typeof o.default.__esModule > "u" && (Object.defineProperty(o.default, "__esModule", { value: !0 }), Object.assign(o.default, o), x.exports = o.default);
|
|
179
|
-
}(L, L.exports), L.exports);
|
|
2
|
+
import r from "./index215.mjs";
|
|
3
|
+
import p from "./index86.mjs";
|
|
4
|
+
import l from "./index82.mjs";
|
|
5
|
+
import m from "./index84.mjs";
|
|
6
|
+
import a from "./index92.mjs";
|
|
7
|
+
import o from "./index93.mjs";
|
|
8
|
+
function d(e) {
|
|
9
|
+
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
10
|
+
throw new m(null, e);
|
|
11
|
+
}
|
|
12
|
+
function q(e) {
|
|
13
|
+
return d(e), e.headers = a.from(e.headers), e.data = r.call(
|
|
14
|
+
e,
|
|
15
|
+
e.transformRequest
|
|
16
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), o.getAdapter(e.adapter || l.adapter, e)(e).then(function(t) {
|
|
17
|
+
return d(e), t.data = r.call(
|
|
18
|
+
e,
|
|
19
|
+
e.transformResponse,
|
|
20
|
+
t
|
|
21
|
+
), t.headers = a.from(t.headers), t;
|
|
22
|
+
}, function(t) {
|
|
23
|
+
return p(t) || (d(e), t && t.response && (t.response.data = r.call(
|
|
24
|
+
e,
|
|
25
|
+
e.transformResponse,
|
|
26
|
+
t.response
|
|
27
|
+
), t.response.headers = a.from(t.response.headers))), Promise.reject(t);
|
|
28
|
+
});
|
|
180
29
|
}
|
|
181
30
|
export {
|
|
182
|
-
|
|
31
|
+
q as default
|
|
183
32
|
};
|
package/dist/index108.mjs
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return i ? r : (i = 1, function(t) {
|
|
8
|
-
Object.defineProperty(t, "__esModule", {
|
|
9
|
-
value: !0
|
|
10
|
-
}), Object.defineProperty(t, "denormalizePagePath", {
|
|
11
|
-
enumerable: !0,
|
|
12
|
-
get: function() {
|
|
13
|
-
return o;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
const a = m(), n = l();
|
|
17
|
-
function o(u) {
|
|
18
|
-
let e = (0, n.normalizePathSep)(u);
|
|
19
|
-
return e.startsWith("/index/") && !(0, a.isDynamicRoute)(e) ? e.slice(6) : e !== "/index" ? e : "/";
|
|
20
|
-
}
|
|
21
|
-
}(r), r);
|
|
2
|
+
import r from "./index216.mjs";
|
|
3
|
+
import f from "./index217.mjs";
|
|
4
|
+
function u(l, i, t) {
|
|
5
|
+
let o = !r(i);
|
|
6
|
+
return l && (o || t == !1) ? f(l, i) : i;
|
|
22
7
|
}
|
|
23
8
|
export {
|
|
24
|
-
|
|
9
|
+
u as default
|
|
25
10
|
};
|
package/dist/index109.mjs
CHANGED
|
@@ -1,26 +1,55 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
import { VERSION as w } from "./index87.mjs";
|
|
3
|
+
import s from "./index89.mjs";
|
|
4
|
+
const l = {};
|
|
5
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((n, t) => {
|
|
6
|
+
l[n] = function(o) {
|
|
7
|
+
return typeof o === n || "a" + (t < 1 ? "n " : " ") + n;
|
|
8
|
+
};
|
|
9
|
+
});
|
|
10
|
+
const f = {};
|
|
11
|
+
l.transitional = function(t, i, o) {
|
|
12
|
+
function a(r, e) {
|
|
13
|
+
return "[Axios v" + w + "] Transitional option '" + r + "'" + e + (o ? ". " + o : "");
|
|
14
|
+
}
|
|
15
|
+
return (r, e, u) => {
|
|
16
|
+
if (t === !1)
|
|
17
|
+
throw new s(
|
|
18
|
+
a(e, " has been removed" + (i ? " in " + i : "")),
|
|
19
|
+
s.ERR_DEPRECATED
|
|
20
|
+
);
|
|
21
|
+
return i && !f[e] && (f[e] = !0, console.warn(
|
|
22
|
+
a(
|
|
23
|
+
e,
|
|
24
|
+
" has been deprecated since v" + i + " and will be removed in the near future"
|
|
25
|
+
)
|
|
26
|
+
)), t ? t(r, e, u) : !0;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
l.spelling = function(t) {
|
|
30
|
+
return (i, o) => (console.warn(`${o} is likely a misspelling of ${t}`), !0);
|
|
31
|
+
};
|
|
32
|
+
function b(n, t, i) {
|
|
33
|
+
if (typeof n != "object")
|
|
34
|
+
throw new s("options must be an object", s.ERR_BAD_OPTION_VALUE);
|
|
35
|
+
const o = Object.keys(n);
|
|
36
|
+
let a = o.length;
|
|
37
|
+
for (; a-- > 0; ) {
|
|
38
|
+
const r = o[a], e = t[r];
|
|
39
|
+
if (e) {
|
|
40
|
+
const u = n[r], c = u === void 0 || e(u, r, n);
|
|
41
|
+
if (c !== !0)
|
|
42
|
+
throw new s("option " + r + " must be " + c, s.ERR_BAD_OPTION_VALUE);
|
|
43
|
+
continue;
|
|
21
44
|
}
|
|
22
|
-
|
|
45
|
+
if (i !== !0)
|
|
46
|
+
throw new s("Unknown option " + r, s.ERR_BAD_OPTION);
|
|
47
|
+
}
|
|
23
48
|
}
|
|
49
|
+
const m = {
|
|
50
|
+
assertOptions: b,
|
|
51
|
+
validators: l
|
|
52
|
+
};
|
|
24
53
|
export {
|
|
25
|
-
|
|
54
|
+
m as default
|
|
26
55
|
};
|
package/dist/index11.mjs
CHANGED
|
@@ -1,106 +1,134 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as i, jsxs as
|
|
3
|
-
import "./
|
|
4
|
-
import { useGetCartRecommendations as
|
|
2
|
+
import { jsx as i, jsxs as s, Fragment as f } from "react/jsx-runtime";
|
|
3
|
+
import "./index24.mjs";
|
|
4
|
+
import { useGetCartRecommendations as U } from "./index36.mjs";
|
|
5
5
|
import "@tanstack/react-query";
|
|
6
|
-
import { useCart as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { Button as
|
|
9
|
-
import { Loader2 as
|
|
10
|
-
import { useState as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import { useCart as q } from "./index3.mjs";
|
|
7
|
+
import { cn as p, formatCurrency as z } from "./index23.mjs";
|
|
8
|
+
import { Button as B } from "./index17.mjs";
|
|
9
|
+
import { Loader2 as b, Package as D, ShoppingCart as E } from "lucide-react";
|
|
10
|
+
import { useState as r, useEffect as G } from "react";
|
|
11
|
+
import { VariantPickerModal as H } from "./index12.mjs";
|
|
12
|
+
function _({
|
|
13
|
+
limit: P,
|
|
14
|
+
className: C
|
|
14
15
|
}) {
|
|
15
|
-
const { cart:
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
}, [
|
|
16
|
+
const { cart: o, addItem: k } = q(), { data: c, isLoading: I, error: A } = U(o == null ? void 0 : o.id, P), [j, h] = r([]), [F, u] = r([]), [V, g] = r([]), [L, x] = r([]), [v, m] = r(null), [M, w] = r(!1);
|
|
17
|
+
if (G(() => {
|
|
18
|
+
x([]), u([]), g([]);
|
|
19
|
+
}, [c]), !o)
|
|
19
20
|
return null;
|
|
20
|
-
if (
|
|
21
|
-
return /* @__PURE__ */ i("div", { className: "py-6", children: /* @__PURE__ */ i("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ i(
|
|
22
|
-
const
|
|
23
|
-
(e) => !
|
|
21
|
+
if (I)
|
|
22
|
+
return /* @__PURE__ */ i("div", { className: "py-6", children: /* @__PURE__ */ i("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ i(b, { className: "h-6 w-6 animate-spin text-accent-500" }) }) });
|
|
23
|
+
const a = c == null ? void 0 : c.filter(
|
|
24
|
+
(e) => !L.includes(e.id)
|
|
24
25
|
);
|
|
25
|
-
if (
|
|
26
|
+
if (A || !a || a.length === 0)
|
|
26
27
|
return null;
|
|
27
|
-
const
|
|
28
|
-
|
|
28
|
+
const N = async (e, t) => {
|
|
29
|
+
h((n) => [...n, e.id]);
|
|
29
30
|
try {
|
|
30
|
-
await
|
|
31
|
-
|
|
31
|
+
await k(e.slug, e.name, t.price, t.sku, 1), u((n) => [...n, e.id]), setTimeout(() => {
|
|
32
|
+
g((n) => [...n, e.id]);
|
|
32
33
|
}, 500), setTimeout(() => {
|
|
33
|
-
|
|
34
|
+
x((n) => [...n, e.id]);
|
|
34
35
|
}, 1e3);
|
|
35
36
|
} finally {
|
|
36
|
-
|
|
37
|
+
h((n) => n.filter((l) => l !== e.id));
|
|
38
|
+
}
|
|
39
|
+
}, T = (e) => {
|
|
40
|
+
if (e.variants.length > 1) {
|
|
41
|
+
m(e);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const t = e.variants[0];
|
|
45
|
+
t && N(e, t);
|
|
46
|
+
}, S = async (e, t) => {
|
|
47
|
+
w(!0);
|
|
48
|
+
try {
|
|
49
|
+
const n = a.find((d) => d.id === e.id), l = n == null ? void 0 : n.variants.find((d) => d.id === t.id);
|
|
50
|
+
n && l && await N(n, l), m(null);
|
|
51
|
+
} finally {
|
|
52
|
+
w(!1);
|
|
37
53
|
}
|
|
38
54
|
};
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
/* @__PURE__ */ i("div", { className: "flex-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
src: e.thumbnailUrl,
|
|
65
|
-
alt: e.name,
|
|
66
|
-
className: "w-full h-full object-cover"
|
|
67
|
-
}
|
|
68
|
-
) : /* @__PURE__ */ i("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ i(U, { className: "h-8 w-8 text-gray-300" }) }) }),
|
|
69
|
-
/* @__PURE__ */ t("div", { className: "p-2 flex flex-col flex-1 justify-between", children: [
|
|
70
|
-
/* @__PURE__ */ t("div", { children: [
|
|
71
|
-
/* @__PURE__ */ i("h4", { className: "text-xs font-medium text-gray-900 line-clamp-2 leading-tight", children: e.name }),
|
|
72
|
-
/* @__PURE__ */ i("p", { className: "text-xs font-semibold text-accent-600 mt-0.5", children: L(l.price) })
|
|
73
|
-
] }),
|
|
74
|
-
/* @__PURE__ */ i(
|
|
75
|
-
S,
|
|
55
|
+
return /* @__PURE__ */ s(f, { children: [
|
|
56
|
+
/* @__PURE__ */ s("div", { className: p("pt-2", C), children: [
|
|
57
|
+
/* @__PURE__ */ i("div", { className: "mb-2 px-4", children: /* @__PURE__ */ i("h3", { className: "text-lg font-semibold text-gray-900", children: "Frequently bought together" }) }),
|
|
58
|
+
/* @__PURE__ */ i("div", { className: "overflow-x-auto", children: /* @__PURE__ */ s("div", { className: "flex gap-4 pb-2 transition-all duration-500", children: [
|
|
59
|
+
/* @__PURE__ */ i("div", { className: "flex-shrink-0 w-1" }),
|
|
60
|
+
a == null ? void 0 : a.map((e) => {
|
|
61
|
+
const t = e.variants[0];
|
|
62
|
+
if (!t) return null;
|
|
63
|
+
const n = j.includes(e.id), l = F.includes(e.id), d = V.includes(e.id);
|
|
64
|
+
return /* @__PURE__ */ i(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: p(
|
|
68
|
+
"flex flex-row flex-shrink-0 w-64 h-24 bg-white border border-gray-300 rounded-lg overflow-hidden transition-all duration-500",
|
|
69
|
+
l && "opacity-0 blur-sm scale-95 pointer-events-none",
|
|
70
|
+
d && "w-0 h-0 mr-[-1rem] overflow-hidden"
|
|
71
|
+
),
|
|
72
|
+
children: /* @__PURE__ */ s(
|
|
73
|
+
"a",
|
|
74
|
+
{
|
|
75
|
+
href: `/product/${e.slug}`,
|
|
76
|
+
className: "flex flex-row flex-1 hover:bg-gray-50 transition-colors",
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ i("div", { className: "relative w-20 h-full flex-shrink-0 bg-gray-100", children: e.thumbnailUrl ? /* @__PURE__ */ i(
|
|
79
|
+
"img",
|
|
76
80
|
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
disabled: s,
|
|
82
|
-
className: "w-full bg-accent-500 hover:bg-accent-600 text-white text-xs h-6 mt-1",
|
|
83
|
-
children: s ? /* @__PURE__ */ t(g, { children: [
|
|
84
|
-
/* @__PURE__ */ i(N, { className: "h-3 w-3 animate-spin" }),
|
|
85
|
-
"Adding..."
|
|
86
|
-
] }) : /* @__PURE__ */ t(g, { children: [
|
|
87
|
-
/* @__PURE__ */ i(q, { className: "h-3 w-3" }),
|
|
88
|
-
"Add"
|
|
89
|
-
] })
|
|
81
|
+
src: e.thumbnailUrl,
|
|
82
|
+
alt: e.name,
|
|
83
|
+
className: "w-full h-full object-cover"
|
|
90
84
|
}
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
85
|
+
) : /* @__PURE__ */ i("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ i(D, { className: "h-8 w-8 text-gray-300" }) }) }),
|
|
86
|
+
/* @__PURE__ */ s("div", { className: "p-2 flex flex-col flex-1 justify-between", children: [
|
|
87
|
+
/* @__PURE__ */ s("div", { children: [
|
|
88
|
+
/* @__PURE__ */ i("h4", { className: "text-xs font-medium text-gray-900 line-clamp-2 leading-tight", children: e.name }),
|
|
89
|
+
/* @__PURE__ */ i("p", { className: "text-xs font-semibold text-accent-600 mt-0.5", children: z(t.price) })
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ i(
|
|
92
|
+
B,
|
|
93
|
+
{
|
|
94
|
+
size: "sm",
|
|
95
|
+
onClick: (y) => {
|
|
96
|
+
y.preventDefault(), y.stopPropagation(), T(e);
|
|
97
|
+
},
|
|
98
|
+
disabled: n,
|
|
99
|
+
className: "w-full bg-accent-500 hover:bg-accent-600 text-white text-xs h-6 mt-1",
|
|
100
|
+
children: n ? /* @__PURE__ */ s(f, { children: [
|
|
101
|
+
/* @__PURE__ */ i(b, { className: "h-3 w-3 animate-spin" }),
|
|
102
|
+
"Adding..."
|
|
103
|
+
] }) : /* @__PURE__ */ s(f, { children: [
|
|
104
|
+
/* @__PURE__ */ i(E, { className: "h-3 w-3" }),
|
|
105
|
+
"Add"
|
|
106
|
+
] })
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
] })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
},
|
|
114
|
+
e.id
|
|
115
|
+
);
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ i("div", { className: "flex-shrink-0 w-1" })
|
|
118
|
+
] }) })
|
|
119
|
+
] }),
|
|
120
|
+
/* @__PURE__ */ i(
|
|
121
|
+
H,
|
|
122
|
+
{
|
|
123
|
+
isOpen: !!v,
|
|
124
|
+
onClose: () => m(null),
|
|
125
|
+
product: v,
|
|
126
|
+
onConfirm: S,
|
|
127
|
+
isLoading: M
|
|
128
|
+
}
|
|
129
|
+
)
|
|
102
130
|
] });
|
|
103
131
|
}
|
|
104
132
|
export {
|
|
105
|
-
|
|
133
|
+
_ as RecommendedProducts
|
|
106
134
|
};
|
package/dist/index110.mjs
CHANGED
|
@@ -1,36 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
value: !0
|
|
8
|
-
}), Object.defineProperty(i, "default", {
|
|
9
|
-
enumerable: !0,
|
|
10
|
-
get: function() {
|
|
11
|
-
return o;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
function o() {
|
|
15
|
-
const t = /* @__PURE__ */ Object.create(null);
|
|
16
|
-
return {
|
|
17
|
-
on(e, r) {
|
|
18
|
-
(t[e] || (t[e] = [])).push(r);
|
|
19
|
-
},
|
|
20
|
-
off(e, r) {
|
|
21
|
-
t[e] && t[e].splice(t[e].indexOf(r) >>> 0, 1);
|
|
22
|
-
},
|
|
23
|
-
emit(e) {
|
|
24
|
-
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
25
|
-
a[n - 1] = arguments[n];
|
|
26
|
-
(t[e] || []).slice().map((c) => {
|
|
27
|
-
c(...a);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}(u), u);
|
|
33
|
-
}
|
|
2
|
+
const r = {
|
|
3
|
+
silentJSONParsing: !0,
|
|
4
|
+
forcedJSONParsing: !0,
|
|
5
|
+
clarifyTimeoutError: !1
|
|
6
|
+
};
|
|
34
7
|
export {
|
|
35
|
-
|
|
8
|
+
r as default
|
|
36
9
|
};
|