@billgangcom/theme-lib 1.72.2 → 1.72.3
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/builder.cjs.js +12 -12
- package/dist/builder.es.js +2015 -2073
- package/dist/{index-BbAjMQE1.cjs → index-BvgD3Jle.cjs} +24 -24
- package/dist/{index-3Xx1ZOJa.js → index-mAhdzwdY.js} +4113 -4078
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/storefront/utils/stable-text.d.ts +20 -0
- package/dist/ui/ProductCardButtons/index.d.ts +1 -0
- package/dist/ui/ProductCardModal/index.d.ts +1 -0
- package/dist/ui/ProductOptions/index.d.ts +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1155 -1147
- package/package.json +1 -1
package/dist/ui.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { j as t, I as
|
|
2
|
-
import { a1 as
|
|
3
|
-
import
|
|
1
|
+
import { j as t, I as j, c as U, d as Nt, e as pt, g as mt, P as gt, S as lt, h as kt, D as ft, i as xt, v as _t, B as dt, k as ot, a as wt, l as Tt, O as ht, m as J, n as yt, C as jt, o as V, p as At, q as Dt, r as bt, t as Et, w as vt, x as W, L as Rt, y as Ct, z as St, A as ct, s as at, f as Q, E as Lt, F as R, G as zt, M as ut, H as Ut, J as rt, K as Mt, N as Ft, Q as Bt, T as Ht, U as $t, V as Vt } from "./index-mAhdzwdY.js";
|
|
2
|
+
import { a1 as si, a5 as ni, $ as ii, Z as ai, a4 as oi, a3 as ci, Y as ri, _ as li, W as di, X as ui, a0 as hi, a2 as pi } from "./index-mAhdzwdY.js";
|
|
3
|
+
import g from "react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
const
|
|
6
|
-
block:
|
|
7
|
-
title:
|
|
8
|
-
subtitle:
|
|
9
|
-
alignmentContent:
|
|
10
|
-
alignments:
|
|
11
|
-
alignment:
|
|
12
|
-
circle:
|
|
13
|
-
paddings:
|
|
14
|
-
padding:
|
|
15
|
-
active:
|
|
16
|
-
},
|
|
5
|
+
const Yt = "_block_kh9z8_8", Gt = "_title_kh9z8_16", Wt = "_subtitle_kh9z8_23", Xt = "_alignmentContent_kh9z8_30", Qt = "_alignments_kh9z8_39", Jt = "_alignment_kh9z8_30", Kt = "_circle_kh9z8_64", Zt = "_paddings_kh9z8_71", te = "_padding_kh9z8_71", ee = "_active_kh9z8_97", G = {
|
|
6
|
+
block: Yt,
|
|
7
|
+
title: Gt,
|
|
8
|
+
subtitle: Wt,
|
|
9
|
+
alignmentContent: Xt,
|
|
10
|
+
alignments: Qt,
|
|
11
|
+
alignment: Jt,
|
|
12
|
+
circle: Kt,
|
|
13
|
+
paddings: Zt,
|
|
14
|
+
padding: te,
|
|
15
|
+
active: ee
|
|
16
|
+
}, se = [
|
|
17
17
|
"topLeft",
|
|
18
18
|
"top",
|
|
19
19
|
"topRight",
|
|
@@ -23,16 +23,16 @@ const Vt = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
|
|
|
23
23
|
"bottomLeft",
|
|
24
24
|
"bottom",
|
|
25
25
|
"bottomRight"
|
|
26
|
-
],
|
|
26
|
+
], ne = ["left", "top", "right", "bottom"], Ln = (h) => {
|
|
27
27
|
const {
|
|
28
|
-
alignment:
|
|
29
|
-
padding:
|
|
28
|
+
alignment: a,
|
|
29
|
+
padding: o,
|
|
30
30
|
setPadding: s,
|
|
31
|
-
setAlignment:
|
|
32
|
-
isAlignment:
|
|
33
|
-
isPadding:
|
|
34
|
-
} =
|
|
35
|
-
function
|
|
31
|
+
setAlignment: c,
|
|
32
|
+
isAlignment: e = !0,
|
|
33
|
+
isPadding: u = !0
|
|
34
|
+
} = h;
|
|
35
|
+
function d(l) {
|
|
36
36
|
switch (l) {
|
|
37
37
|
case "left":
|
|
38
38
|
case "topLeft":
|
|
@@ -50,7 +50,7 @@ const Vt = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
|
|
|
50
50
|
return "TextAlignCenter";
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function f(l) {
|
|
54
54
|
switch (l) {
|
|
55
55
|
case "left":
|
|
56
56
|
return "AlignLeft";
|
|
@@ -62,17 +62,17 @@ const Vt = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
|
|
|
62
62
|
return "AlignBottom";
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
const [
|
|
65
|
+
const [_, T] = g.useState(null), [I, r] = g.useState(null);
|
|
66
66
|
return /* @__PURE__ */ t.jsxs("div", { className: G.layout, children: [
|
|
67
67
|
/* @__PURE__ */ t.jsx("h3", { className: G.title, children: "Layout (for Desktop version)" }),
|
|
68
68
|
/* @__PURE__ */ t.jsxs("div", { className: G.alignmentContent, children: [
|
|
69
|
-
|
|
69
|
+
e && /* @__PURE__ */ t.jsxs("div", { className: G.block, children: [
|
|
70
70
|
/* @__PURE__ */ t.jsx("h5", { className: G.subtitle, children: "Alignment" }),
|
|
71
|
-
/* @__PURE__ */ t.jsx("div", { className: G.alignments, children:
|
|
71
|
+
/* @__PURE__ */ t.jsx("div", { className: G.alignments, children: se.map((l) => /* @__PURE__ */ t.jsxs(
|
|
72
72
|
"div",
|
|
73
73
|
{
|
|
74
74
|
onClick: () => {
|
|
75
|
-
|
|
75
|
+
c(l);
|
|
76
76
|
},
|
|
77
77
|
className: G.alignment,
|
|
78
78
|
onMouseEnter: () => {
|
|
@@ -82,20 +82,20 @@ const Vt = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
|
|
|
82
82
|
T(null);
|
|
83
83
|
},
|
|
84
84
|
children: [
|
|
85
|
-
l !==
|
|
86
|
-
l !==
|
|
87
|
-
|
|
85
|
+
l !== a && _ !== l && /* @__PURE__ */ t.jsx("div", { className: G.circle }),
|
|
86
|
+
l !== a && _ === l && /* @__PURE__ */ t.jsx(
|
|
87
|
+
j,
|
|
88
88
|
{
|
|
89
|
-
name:
|
|
89
|
+
name: d(_),
|
|
90
90
|
fill: "#c2c2c2",
|
|
91
91
|
width: 22,
|
|
92
92
|
height: 22
|
|
93
93
|
}
|
|
94
94
|
),
|
|
95
|
-
l ===
|
|
96
|
-
|
|
95
|
+
l === a && /* @__PURE__ */ t.jsx(
|
|
96
|
+
j,
|
|
97
97
|
{
|
|
98
|
-
name:
|
|
98
|
+
name: d(a),
|
|
99
99
|
fill: "#FF3F19",
|
|
100
100
|
width: 22,
|
|
101
101
|
height: 22
|
|
@@ -106,25 +106,25 @@ const Vt = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
|
|
|
106
106
|
l
|
|
107
107
|
)) })
|
|
108
108
|
] }),
|
|
109
|
-
|
|
109
|
+
u && /* @__PURE__ */ t.jsxs("div", { className: G.block, children: [
|
|
110
110
|
/* @__PURE__ */ t.jsx("h5", { className: G.subtitle, children: "Paddings" }),
|
|
111
|
-
/* @__PURE__ */ t.jsx("div", { className: G.paddings, children:
|
|
111
|
+
/* @__PURE__ */ t.jsx("div", { className: G.paddings, children: ne.map((l) => /* @__PURE__ */ t.jsxs(
|
|
112
112
|
"label",
|
|
113
113
|
{
|
|
114
|
-
className:
|
|
115
|
-
[G.active]:
|
|
114
|
+
className: U(G.padding, {
|
|
115
|
+
[G.active]: I === l
|
|
116
116
|
}),
|
|
117
117
|
onFocus: () => {
|
|
118
|
-
|
|
118
|
+
r(l);
|
|
119
119
|
},
|
|
120
120
|
onBlur: () => {
|
|
121
|
-
|
|
121
|
+
r(null);
|
|
122
122
|
},
|
|
123
123
|
children: [
|
|
124
124
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
125
|
-
|
|
125
|
+
j,
|
|
126
126
|
{
|
|
127
|
-
name:
|
|
127
|
+
name: f(l),
|
|
128
128
|
width: 20,
|
|
129
129
|
height: 20
|
|
130
130
|
}
|
|
@@ -133,10 +133,10 @@ const Vt = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
|
|
|
133
133
|
Nt,
|
|
134
134
|
{
|
|
135
135
|
type: "number",
|
|
136
|
-
value: String(
|
|
137
|
-
onChange: (
|
|
138
|
-
...
|
|
139
|
-
[l]: Math.min(Number(
|
|
136
|
+
value: String(o[l]),
|
|
137
|
+
onChange: (y) => s({
|
|
138
|
+
...o,
|
|
139
|
+
[l]: Math.min(Number(y), 999)
|
|
140
140
|
}),
|
|
141
141
|
max: 999,
|
|
142
142
|
paddingless: !0,
|
|
@@ -150,94 +150,94 @@ const Vt = "_block_kh9z8_8", Yt = "_title_kh9z8_16", Gt = "_subtitle_kh9z8_23",
|
|
|
150
150
|
] })
|
|
151
151
|
] })
|
|
152
152
|
] });
|
|
153
|
-
},
|
|
154
|
-
title:
|
|
155
|
-
subtitle:
|
|
156
|
-
productsBlock:
|
|
157
|
-
top:
|
|
158
|
-
products:
|
|
159
|
-
product:
|
|
160
|
-
button:
|
|
161
|
-
disabled:
|
|
162
|
-
buttons:
|
|
163
|
-
addButton:
|
|
164
|
-
deleteButton:
|
|
153
|
+
}, ie = "_title_82zux_1", ae = "_subtitle_82zux_5", oe = "_productsBlock_82zux_14", ce = "_top_82zux_26", re = "_products_82zux_14", le = "_product_82zux_14", de = "_button_82zux_80", ue = "_disabled_82zux_91", he = "_buttons_82zux_118", pe = "_addButton_82zux_157", me = "_deleteButton_82zux_179", X = {
|
|
154
|
+
title: ie,
|
|
155
|
+
subtitle: ae,
|
|
156
|
+
productsBlock: oe,
|
|
157
|
+
top: ce,
|
|
158
|
+
products: re,
|
|
159
|
+
product: le,
|
|
160
|
+
button: de,
|
|
161
|
+
disabled: ue,
|
|
162
|
+
buttons: he,
|
|
163
|
+
addButton: pe,
|
|
164
|
+
deleteButton: me
|
|
165
165
|
};
|
|
166
|
-
function
|
|
166
|
+
function ge({ id: h, children: a }) {
|
|
167
167
|
const {
|
|
168
|
-
attributes:
|
|
168
|
+
attributes: o,
|
|
169
169
|
listeners: s,
|
|
170
|
-
setNodeRef:
|
|
171
|
-
transform:
|
|
172
|
-
transition:
|
|
173
|
-
isDragging:
|
|
170
|
+
setNodeRef: c,
|
|
171
|
+
transform: e,
|
|
172
|
+
transition: u,
|
|
173
|
+
isDragging: d
|
|
174
174
|
} = yt({
|
|
175
|
-
id:
|
|
176
|
-
}),
|
|
177
|
-
transform: jt.Transform.toString(
|
|
178
|
-
transition:
|
|
175
|
+
id: h
|
|
176
|
+
}), f = {
|
|
177
|
+
transform: jt.Transform.toString(e),
|
|
178
|
+
transition: u
|
|
179
179
|
};
|
|
180
180
|
return /* @__PURE__ */ t.jsx(
|
|
181
181
|
"div",
|
|
182
182
|
{
|
|
183
|
-
ref:
|
|
184
|
-
style:
|
|
185
|
-
className: `${X.product} ${
|
|
186
|
-
...
|
|
183
|
+
ref: c,
|
|
184
|
+
style: f,
|
|
185
|
+
className: `${X.product} ${d ? X.dragging : ""}`,
|
|
186
|
+
...o,
|
|
187
187
|
...s,
|
|
188
|
-
children:
|
|
188
|
+
children: a
|
|
189
189
|
}
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
|
-
const
|
|
192
|
+
const zn = (h) => {
|
|
193
193
|
const {
|
|
194
|
-
isActiveItems:
|
|
195
|
-
setIsActiveItems:
|
|
194
|
+
isActiveItems: a,
|
|
195
|
+
setIsActiveItems: o,
|
|
196
196
|
items: s,
|
|
197
|
-
setItems:
|
|
198
|
-
other:
|
|
199
|
-
tags:
|
|
200
|
-
title:
|
|
201
|
-
subtitle:
|
|
202
|
-
draggable:
|
|
197
|
+
setItems: c,
|
|
198
|
+
other: e,
|
|
199
|
+
tags: u,
|
|
200
|
+
title: d,
|
|
201
|
+
subtitle: f,
|
|
202
|
+
draggable: _ = !1,
|
|
203
203
|
withImage: T = !1,
|
|
204
|
-
addable:
|
|
205
|
-
itemsOptions:
|
|
204
|
+
addable: I = !0,
|
|
205
|
+
itemsOptions: r,
|
|
206
206
|
hasRangeSelector: l = !1,
|
|
207
|
-
rangeSelectorOptions:
|
|
208
|
-
limit:
|
|
209
|
-
autoScrollInterval:
|
|
207
|
+
rangeSelectorOptions: y,
|
|
208
|
+
limit: x,
|
|
209
|
+
autoScrollInterval: p,
|
|
210
210
|
deletable: i,
|
|
211
|
-
aspectRatio:
|
|
211
|
+
aspectRatio: b,
|
|
212
212
|
setAspectRatio: w
|
|
213
|
-
} =
|
|
213
|
+
} = h, q = pt(
|
|
214
214
|
mt(gt, {
|
|
215
215
|
activationConstraint: {
|
|
216
216
|
distance: 5
|
|
217
217
|
}
|
|
218
218
|
})
|
|
219
|
-
),
|
|
220
|
-
const { active:
|
|
221
|
-
if (
|
|
222
|
-
const O = s.findIndex((
|
|
223
|
-
if (O !== -1 &&
|
|
224
|
-
const
|
|
225
|
-
|
|
219
|
+
), E = (n) => {
|
|
220
|
+
const { active: N, over: S } = n;
|
|
221
|
+
if (S && N.id !== S.id) {
|
|
222
|
+
const O = s.findIndex((C) => C === N.id), M = s.findIndex((C) => C === S.id);
|
|
223
|
+
if (O !== -1 && M !== -1) {
|
|
224
|
+
const C = [...s], [v] = C.splice(O, 1);
|
|
225
|
+
C.splice(M, 0, v), c(C);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
|
-
function K(
|
|
229
|
+
function K(n) {
|
|
230
230
|
if (T)
|
|
231
|
-
return
|
|
231
|
+
return n ? /* @__PURE__ */ t.jsx(
|
|
232
232
|
"img",
|
|
233
233
|
{
|
|
234
|
-
src: `https://imagedelivery.net/${
|
|
234
|
+
src: `https://imagedelivery.net/${n[0]}/w=1000`,
|
|
235
235
|
alt: "image",
|
|
236
236
|
width: 16,
|
|
237
237
|
height: 16
|
|
238
238
|
}
|
|
239
239
|
) : /* @__PURE__ */ t.jsx(
|
|
240
|
-
|
|
240
|
+
j,
|
|
241
241
|
{
|
|
242
242
|
name: "Image",
|
|
243
243
|
width: 16,
|
|
@@ -246,12 +246,12 @@ const Ln = (u) => {
|
|
|
246
246
|
}
|
|
247
247
|
);
|
|
248
248
|
}
|
|
249
|
-
const
|
|
250
|
-
const
|
|
251
|
-
if (!
|
|
249
|
+
const F = (n, N = !1) => {
|
|
250
|
+
const S = r.find((M) => M.id === n);
|
|
251
|
+
if (!S) return;
|
|
252
252
|
const O = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
_ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
254
|
+
j,
|
|
255
255
|
{
|
|
256
256
|
name: "DotsSixVertical",
|
|
257
257
|
hoverable: !0,
|
|
@@ -262,36 +262,36 @@ const Ln = (u) => {
|
|
|
262
262
|
/* @__PURE__ */ t.jsx(
|
|
263
263
|
ot,
|
|
264
264
|
{
|
|
265
|
-
onChange: (
|
|
266
|
-
const
|
|
267
|
-
if (!
|
|
268
|
-
const
|
|
269
|
-
|
|
265
|
+
onChange: (M) => {
|
|
266
|
+
const C = [...s], v = r.find((m) => m.name === M);
|
|
267
|
+
if (!v) return;
|
|
268
|
+
const A = v.id, H = C.map((m) => m === n ? A : m);
|
|
269
|
+
c([...H]);
|
|
270
270
|
},
|
|
271
|
-
value:
|
|
272
|
-
options:
|
|
273
|
-
leftAddonOptions:
|
|
274
|
-
value:
|
|
275
|
-
addon: K(
|
|
271
|
+
value: S.name,
|
|
272
|
+
options: r.filter((M) => !s.find((C) => C === M.id)).map((M) => M.name),
|
|
273
|
+
leftAddonOptions: r.map((M) => ({
|
|
274
|
+
value: M.name,
|
|
275
|
+
addon: K(M.images)
|
|
276
276
|
}))
|
|
277
277
|
}
|
|
278
278
|
),
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
N && /* @__PURE__ */ t.jsx("div", { className: X.buttons, children: /* @__PURE__ */ t.jsx("div", { className: X.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
280
|
+
j,
|
|
281
281
|
{
|
|
282
282
|
name: "Trash",
|
|
283
283
|
hoverable: !0,
|
|
284
284
|
width: 20,
|
|
285
285
|
height: 20,
|
|
286
286
|
fill: "#C12A2A",
|
|
287
|
-
onClick: () =>
|
|
287
|
+
onClick: () => c(s.filter((M) => M !== n))
|
|
288
288
|
}
|
|
289
289
|
) }) })
|
|
290
290
|
] });
|
|
291
|
-
return
|
|
292
|
-
|
|
291
|
+
return _ ? /* @__PURE__ */ t.jsx(
|
|
292
|
+
ge,
|
|
293
293
|
{
|
|
294
|
-
id:
|
|
294
|
+
id: n,
|
|
295
295
|
children: O
|
|
296
296
|
},
|
|
297
297
|
J()
|
|
@@ -305,35 +305,35 @@ const Ln = (u) => {
|
|
|
305
305
|
);
|
|
306
306
|
};
|
|
307
307
|
return /* @__PURE__ */ t.jsxs("div", { className: X.productsBlock, children: [
|
|
308
|
-
(
|
|
309
|
-
|
|
310
|
-
|
|
308
|
+
(d || a !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: X.top, children: [
|
|
309
|
+
d && /* @__PURE__ */ t.jsx("h3", { className: X.title, children: d }),
|
|
310
|
+
a !== void 0 && /* @__PURE__ */ t.jsx(
|
|
311
311
|
lt,
|
|
312
312
|
{
|
|
313
|
-
current:
|
|
314
|
-
onChange: (
|
|
313
|
+
current: a,
|
|
314
|
+
onChange: (n) => o == null ? void 0 : o(n)
|
|
315
315
|
}
|
|
316
316
|
)
|
|
317
317
|
] }),
|
|
318
|
-
l &&
|
|
318
|
+
l && y && /* @__PURE__ */ t.jsx(kt, { ...y }),
|
|
319
319
|
/* @__PURE__ */ t.jsxs("div", { className: X.products, children: [
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
f && /* @__PURE__ */ t.jsx("h5", { className: X.subtitle, children: f }),
|
|
321
|
+
_ ? /* @__PURE__ */ t.jsx(
|
|
322
322
|
ft,
|
|
323
323
|
{
|
|
324
324
|
sensors: q,
|
|
325
|
-
onDragEnd:
|
|
325
|
+
onDragEnd: E,
|
|
326
326
|
children: /* @__PURE__ */ t.jsx(
|
|
327
327
|
xt,
|
|
328
328
|
{
|
|
329
329
|
items: s,
|
|
330
330
|
strategy: _t,
|
|
331
|
-
children: s.map((
|
|
331
|
+
children: s.map((n) => F(n, i))
|
|
332
332
|
}
|
|
333
333
|
)
|
|
334
334
|
}
|
|
335
|
-
) : s.map((
|
|
336
|
-
|
|
335
|
+
) : s.map((n) => F(n, i)),
|
|
336
|
+
I && /* @__PURE__ */ t.jsx(
|
|
337
337
|
"div",
|
|
338
338
|
{
|
|
339
339
|
style: {
|
|
@@ -346,22 +346,22 @@ const Ln = (u) => {
|
|
|
346
346
|
dt,
|
|
347
347
|
{
|
|
348
348
|
withoutHover: !0,
|
|
349
|
-
className:
|
|
350
|
-
[X.disabled]: !!(
|
|
349
|
+
className: U(X.button, {
|
|
350
|
+
[X.disabled]: !!(x && x <= s.length || s.length === r.length)
|
|
351
351
|
}),
|
|
352
352
|
size: "s",
|
|
353
|
-
disabled: !!(
|
|
353
|
+
disabled: !!(x && x <= s.length || s.length === r.length),
|
|
354
354
|
onClick: () => {
|
|
355
|
-
const
|
|
356
|
-
let
|
|
357
|
-
if (
|
|
358
|
-
for (let
|
|
359
|
-
if (!s.find((O) => O ===
|
|
360
|
-
|
|
355
|
+
const n = [...s];
|
|
356
|
+
let N = null;
|
|
357
|
+
if (r) {
|
|
358
|
+
for (let S = 0; S < r.length; S++)
|
|
359
|
+
if (!s.find((O) => O === r[S].id)) {
|
|
360
|
+
N = r[S];
|
|
361
361
|
break;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
|
|
364
|
+
n.push((N == null ? void 0 : N.id) || r[0].id), c(n);
|
|
365
365
|
},
|
|
366
366
|
style: {
|
|
367
367
|
width: "fit-content"
|
|
@@ -369,7 +369,7 @@ const Ln = (u) => {
|
|
|
369
369
|
children: /* @__PURE__ */ t.jsxs("div", { className: X.addButton, children: [
|
|
370
370
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
371
371
|
/* @__PURE__ */ t.jsx(
|
|
372
|
-
|
|
372
|
+
j,
|
|
373
373
|
{
|
|
374
374
|
name: "Plus",
|
|
375
375
|
width: 16,
|
|
@@ -382,37 +382,37 @@ const Ln = (u) => {
|
|
|
382
382
|
}
|
|
383
383
|
)
|
|
384
384
|
] }),
|
|
385
|
-
|
|
385
|
+
b && w && /* @__PURE__ */ t.jsx(
|
|
386
386
|
ot,
|
|
387
387
|
{
|
|
388
|
-
value:
|
|
388
|
+
value: b,
|
|
389
389
|
label: "Aspect Ratio",
|
|
390
|
-
options: Object.keys(
|
|
391
|
-
onChange: (
|
|
392
|
-
leftAddonOptions:
|
|
390
|
+
options: Object.keys(Tt),
|
|
391
|
+
onChange: (n) => w(n),
|
|
392
|
+
leftAddonOptions: wt
|
|
393
393
|
}
|
|
394
394
|
),
|
|
395
|
-
|
|
395
|
+
u !== void 0 && /* @__PURE__ */ t.jsx(
|
|
396
396
|
ht,
|
|
397
397
|
{
|
|
398
398
|
tagsTitle: "Tags",
|
|
399
|
-
items:
|
|
399
|
+
items: u
|
|
400
400
|
}
|
|
401
401
|
),
|
|
402
|
-
|
|
402
|
+
e !== void 0 && /* @__PURE__ */ t.jsx(
|
|
403
403
|
ht,
|
|
404
404
|
{
|
|
405
405
|
otherTitle: "Other",
|
|
406
|
-
items:
|
|
406
|
+
items: e
|
|
407
407
|
}
|
|
408
408
|
),
|
|
409
|
-
|
|
409
|
+
p !== void 0 && /* @__PURE__ */ t.jsx(
|
|
410
410
|
Nt,
|
|
411
411
|
{
|
|
412
412
|
label: "Auto scroll interval",
|
|
413
413
|
type: "number",
|
|
414
|
-
value: String(
|
|
415
|
-
onChange: (
|
|
414
|
+
value: String(p.scrollInterval),
|
|
415
|
+
onChange: (n) => p.setScrollInterval(Number(n)),
|
|
416
416
|
min: 0.1,
|
|
417
417
|
max: 100,
|
|
418
418
|
style: {
|
|
@@ -422,96 +422,96 @@ const Ln = (u) => {
|
|
|
422
422
|
}
|
|
423
423
|
)
|
|
424
424
|
] });
|
|
425
|
-
},
|
|
426
|
-
title:
|
|
427
|
-
subtitle:
|
|
428
|
-
productsBlock:
|
|
429
|
-
top:
|
|
430
|
-
products:
|
|
431
|
-
product:
|
|
425
|
+
}, fe = "_title_roi3a_1", xe = "_subtitle_roi3a_5", _e = "_productsBlock_roi3a_14", ye = "_top_roi3a_26", je = "_products_roi3a_14", be = "_product_roi3a_14", ve = "_button_roi3a_80", Ie = "_disabled_roi3a_91", Ne = "_buttons_roi3a_118", Ce = "_addButton_roi3a_164", Se = "_deleteButton_roi3a_179", Y = {
|
|
426
|
+
title: fe,
|
|
427
|
+
subtitle: xe,
|
|
428
|
+
productsBlock: _e,
|
|
429
|
+
top: ye,
|
|
430
|
+
products: je,
|
|
431
|
+
product: be,
|
|
432
432
|
button: ve,
|
|
433
|
-
disabled:
|
|
434
|
-
buttons:
|
|
435
|
-
addButton:
|
|
433
|
+
disabled: Ie,
|
|
434
|
+
buttons: Ne,
|
|
435
|
+
addButton: Ce,
|
|
436
436
|
deleteButton: Se
|
|
437
437
|
};
|
|
438
|
-
function
|
|
438
|
+
function Pe({ product: h, children: a }) {
|
|
439
439
|
const {
|
|
440
|
-
attributes:
|
|
440
|
+
attributes: o,
|
|
441
441
|
listeners: s,
|
|
442
|
-
setNodeRef:
|
|
443
|
-
transform:
|
|
444
|
-
transition:
|
|
445
|
-
isDragging:
|
|
442
|
+
setNodeRef: c,
|
|
443
|
+
transform: e,
|
|
444
|
+
transition: u,
|
|
445
|
+
isDragging: d
|
|
446
446
|
} = yt({
|
|
447
|
-
id:
|
|
448
|
-
}),
|
|
449
|
-
transform: jt.Transform.toString(
|
|
450
|
-
transition:
|
|
447
|
+
id: h.id
|
|
448
|
+
}), f = {
|
|
449
|
+
transform: jt.Transform.toString(e),
|
|
450
|
+
transition: u
|
|
451
451
|
};
|
|
452
452
|
return /* @__PURE__ */ t.jsx(
|
|
453
453
|
"div",
|
|
454
454
|
{
|
|
455
|
-
ref:
|
|
456
|
-
style:
|
|
457
|
-
className: `${Y.product} ${
|
|
458
|
-
...
|
|
455
|
+
ref: c,
|
|
456
|
+
style: f,
|
|
457
|
+
className: `${Y.product} ${d ? Y.dragging : ""}`,
|
|
458
|
+
...o,
|
|
459
459
|
...s,
|
|
460
|
-
children:
|
|
460
|
+
children: a
|
|
461
461
|
}
|
|
462
462
|
);
|
|
463
463
|
}
|
|
464
|
-
const
|
|
464
|
+
const Un = (h) => {
|
|
465
465
|
const {
|
|
466
|
-
isActiveItems:
|
|
467
|
-
setIsActiveItems:
|
|
466
|
+
isActiveItems: a,
|
|
467
|
+
setIsActiveItems: o,
|
|
468
468
|
items: s,
|
|
469
|
-
setItems:
|
|
470
|
-
title:
|
|
471
|
-
subtitle:
|
|
472
|
-
editable:
|
|
473
|
-
draggable:
|
|
474
|
-
deletable:
|
|
469
|
+
setItems: c,
|
|
470
|
+
title: e,
|
|
471
|
+
subtitle: u,
|
|
472
|
+
editable: d = !0,
|
|
473
|
+
draggable: f = !1,
|
|
474
|
+
deletable: _ = !0,
|
|
475
475
|
addable: T = !0,
|
|
476
|
-
itemsType:
|
|
477
|
-
itemsOptions:
|
|
476
|
+
itemsType: I,
|
|
477
|
+
itemsOptions: r,
|
|
478
478
|
addableOptions: l = {},
|
|
479
|
-
limit:
|
|
480
|
-
} =
|
|
479
|
+
limit: y
|
|
480
|
+
} = h, [x, p] = g.useState(null), [i, b] = g.useState(null), w = g.useRef(null), q = pt(
|
|
481
481
|
mt(gt, {
|
|
482
482
|
activationConstraint: {
|
|
483
483
|
distance: 5
|
|
484
484
|
}
|
|
485
485
|
})
|
|
486
486
|
);
|
|
487
|
-
|
|
488
|
-
if (
|
|
489
|
-
const
|
|
490
|
-
|
|
487
|
+
g.useEffect(() => {
|
|
488
|
+
if (x) {
|
|
489
|
+
const n = [...s].map((N) => N.id === x.id ? x : N);
|
|
490
|
+
c(n);
|
|
491
491
|
}
|
|
492
|
-
}, [
|
|
492
|
+
}, [x]), g.useEffect(() => {
|
|
493
493
|
w.current && i && (w.current.getBoundingClientRect().height, i.top);
|
|
494
494
|
}, [w.current, i]);
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
top:
|
|
500
|
-
left:
|
|
501
|
-
}),
|
|
502
|
-
}, K = (
|
|
503
|
-
const { active:
|
|
504
|
-
if (
|
|
505
|
-
const O = s.findIndex((
|
|
506
|
-
if (O !== -1 &&
|
|
507
|
-
const
|
|
508
|
-
|
|
495
|
+
const E = (n, N) => {
|
|
496
|
+
n.stopPropagation();
|
|
497
|
+
const S = n.target.getBoundingClientRect();
|
|
498
|
+
b({
|
|
499
|
+
top: S.top + window.scrollY,
|
|
500
|
+
left: S.left - 30
|
|
501
|
+
}), p(N);
|
|
502
|
+
}, K = (n) => {
|
|
503
|
+
const { active: N, over: S } = n;
|
|
504
|
+
if (S && N.id !== S.id) {
|
|
505
|
+
const O = s.findIndex((C) => C.id === N.id), M = s.findIndex((C) => C.id === S.id);
|
|
506
|
+
if (O !== -1 && M !== -1) {
|
|
507
|
+
const C = [...s], [v] = C.splice(O, 1);
|
|
508
|
+
C.splice(M, 0, v), c(C);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
},
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
|
|
511
|
+
}, F = (n, N) => {
|
|
512
|
+
const S = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
513
|
+
f && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
514
|
+
j,
|
|
515
515
|
{
|
|
516
516
|
name: "DotsSixVertical",
|
|
517
517
|
hoverable: !0,
|
|
@@ -519,84 +519,84 @@ const zn = (u) => {
|
|
|
519
519
|
height: 20
|
|
520
520
|
}
|
|
521
521
|
) }),
|
|
522
|
-
|
|
522
|
+
I === "select" && r && /* @__PURE__ */ t.jsx(
|
|
523
523
|
ot,
|
|
524
524
|
{
|
|
525
525
|
onChange: (O) => {
|
|
526
|
-
const
|
|
527
|
-
if (!
|
|
528
|
-
const
|
|
529
|
-
...
|
|
526
|
+
const M = [...s], C = r.find((A) => A.name === O);
|
|
527
|
+
if (!C) return;
|
|
528
|
+
const v = M.map((A) => A.id === n.id ? {
|
|
529
|
+
...C,
|
|
530
530
|
name: {
|
|
531
531
|
"en-US": O
|
|
532
532
|
}
|
|
533
|
-
} :
|
|
534
|
-
|
|
535
|
-
...
|
|
533
|
+
} : A);
|
|
534
|
+
p({
|
|
535
|
+
...n,
|
|
536
536
|
name: {
|
|
537
537
|
"en-US": O
|
|
538
538
|
}
|
|
539
|
-
}),
|
|
539
|
+
}), c([...v]);
|
|
540
540
|
},
|
|
541
|
-
value:
|
|
542
|
-
options:
|
|
541
|
+
value: n.name,
|
|
542
|
+
options: r.filter((O) => !s.find((M) => M.name === O.name)).map((O) => O.name)
|
|
543
543
|
}
|
|
544
544
|
),
|
|
545
545
|
/* @__PURE__ */ t.jsxs("div", { className: Y.buttons, children: [
|
|
546
|
-
|
|
547
|
-
|
|
546
|
+
d && /* @__PURE__ */ t.jsx("div", { className: Y.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
547
|
+
j,
|
|
548
548
|
{
|
|
549
549
|
name: "Sliders",
|
|
550
550
|
hoverable: !0,
|
|
551
551
|
width: 20,
|
|
552
552
|
height: 20,
|
|
553
|
-
onClick: (O) =>
|
|
553
|
+
onClick: (O) => E(O, n)
|
|
554
554
|
}
|
|
555
555
|
) }),
|
|
556
|
-
|
|
557
|
-
|
|
556
|
+
_ && /* @__PURE__ */ t.jsx("div", { className: Y.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
557
|
+
j,
|
|
558
558
|
{
|
|
559
559
|
name: "Trash",
|
|
560
560
|
hoverable: !0,
|
|
561
561
|
width: 20,
|
|
562
562
|
height: 20,
|
|
563
563
|
fill: "#C12A2A",
|
|
564
|
-
onClick: () =>
|
|
564
|
+
onClick: () => c(s.filter((O) => O.id !== n.id))
|
|
565
565
|
}
|
|
566
566
|
) })
|
|
567
567
|
] })
|
|
568
568
|
] });
|
|
569
|
-
return
|
|
570
|
-
|
|
569
|
+
return f ? /* @__PURE__ */ t.jsx(
|
|
570
|
+
Pe,
|
|
571
571
|
{
|
|
572
|
-
product:
|
|
573
|
-
index:
|
|
574
|
-
children:
|
|
572
|
+
product: n,
|
|
573
|
+
index: N,
|
|
574
|
+
children: S
|
|
575
575
|
},
|
|
576
|
-
|
|
576
|
+
n.id
|
|
577
577
|
) : /* @__PURE__ */ t.jsx(
|
|
578
578
|
"div",
|
|
579
579
|
{
|
|
580
580
|
className: Y.product,
|
|
581
|
-
children:
|
|
581
|
+
children: S
|
|
582
582
|
},
|
|
583
|
-
|
|
583
|
+
n.id
|
|
584
584
|
);
|
|
585
585
|
};
|
|
586
586
|
return /* @__PURE__ */ t.jsxs("div", { className: Y.productsBlock, children: [
|
|
587
|
-
(
|
|
588
|
-
|
|
589
|
-
|
|
587
|
+
(e || a !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: Y.top, children: [
|
|
588
|
+
e && /* @__PURE__ */ t.jsx("h3", { className: Y.title, children: e }),
|
|
589
|
+
a !== void 0 && /* @__PURE__ */ t.jsx(
|
|
590
590
|
lt,
|
|
591
591
|
{
|
|
592
|
-
current:
|
|
593
|
-
onChange: (
|
|
592
|
+
current: a,
|
|
593
|
+
onChange: (n) => o == null ? void 0 : o(n)
|
|
594
594
|
}
|
|
595
595
|
)
|
|
596
596
|
] }),
|
|
597
597
|
/* @__PURE__ */ t.jsxs("div", { className: Y.products, children: [
|
|
598
|
-
|
|
599
|
-
|
|
598
|
+
u && /* @__PURE__ */ t.jsx("h5", { className: Y.subtitle, children: u }),
|
|
599
|
+
f ? /* @__PURE__ */ t.jsx(
|
|
600
600
|
ft,
|
|
601
601
|
{
|
|
602
602
|
sensors: q,
|
|
@@ -604,13 +604,13 @@ const zn = (u) => {
|
|
|
604
604
|
children: /* @__PURE__ */ t.jsx(
|
|
605
605
|
xt,
|
|
606
606
|
{
|
|
607
|
-
items: s.map((
|
|
607
|
+
items: s.map((n) => n.id),
|
|
608
608
|
strategy: _t,
|
|
609
|
-
children: s.map((
|
|
609
|
+
children: s.map((n, N) => F(n, N))
|
|
610
610
|
}
|
|
611
611
|
)
|
|
612
612
|
}
|
|
613
|
-
) : s.map((
|
|
613
|
+
) : s.map((n, N) => F(n, N)),
|
|
614
614
|
T && /* @__PURE__ */ t.jsx(
|
|
615
615
|
"div",
|
|
616
616
|
{
|
|
@@ -623,26 +623,26 @@ const zn = (u) => {
|
|
|
623
623
|
dt,
|
|
624
624
|
{
|
|
625
625
|
withoutHover: !0,
|
|
626
|
-
className:
|
|
627
|
-
[Y.disabled]: !!(
|
|
626
|
+
className: U(Y.button, {
|
|
627
|
+
[Y.disabled]: !!(y && y <= s.length || s.length === (r == null ? void 0 : r.length))
|
|
628
628
|
}),
|
|
629
629
|
size: "s",
|
|
630
|
-
disabled: !!(
|
|
630
|
+
disabled: !!(y && y <= s.length || s.length === (r == null ? void 0 : r.length)),
|
|
631
631
|
onClick: () => {
|
|
632
|
-
const
|
|
633
|
-
let
|
|
634
|
-
if (
|
|
635
|
-
for (let
|
|
636
|
-
if (!s.find((O) => O.id ===
|
|
637
|
-
|
|
632
|
+
const n = [...s];
|
|
633
|
+
let N = null;
|
|
634
|
+
if (r) {
|
|
635
|
+
for (let S = 0; S < r.length; S++)
|
|
636
|
+
if (!s.find((O) => O.id === r[S].id)) {
|
|
637
|
+
N = r[S];
|
|
638
638
|
break;
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
|
-
|
|
642
|
-
name:
|
|
643
|
-
id: (
|
|
641
|
+
I === "select" && r && n.push({
|
|
642
|
+
name: N ? N.name : r[0].name,
|
|
643
|
+
id: (N == null ? void 0 : N.id) || r[0].id,
|
|
644
644
|
...l
|
|
645
|
-
}),
|
|
645
|
+
}), c(n);
|
|
646
646
|
},
|
|
647
647
|
style: {
|
|
648
648
|
width: "fit-content"
|
|
@@ -650,7 +650,7 @@ const zn = (u) => {
|
|
|
650
650
|
children: /* @__PURE__ */ t.jsxs("div", { className: Y.addButton, children: [
|
|
651
651
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
652
652
|
/* @__PURE__ */ t.jsx(
|
|
653
|
-
|
|
653
|
+
j,
|
|
654
654
|
{
|
|
655
655
|
name: "Plus",
|
|
656
656
|
width: 16,
|
|
@@ -665,99 +665,99 @@ const zn = (u) => {
|
|
|
665
665
|
] })
|
|
666
666
|
] });
|
|
667
667
|
};
|
|
668
|
-
function
|
|
669
|
-
const { product:
|
|
670
|
-
id:
|
|
671
|
-
}),
|
|
672
|
-
transform: jt.Transform.toString(
|
|
673
|
-
transition:
|
|
668
|
+
function ke(h) {
|
|
669
|
+
const { product: a, children: o } = h, { attributes: s, listeners: c, setNodeRef: e, transform: u, transition: d, isDragging: f } = yt({
|
|
670
|
+
id: a.id
|
|
671
|
+
}), _ = {
|
|
672
|
+
transform: jt.Transform.toString(u),
|
|
673
|
+
transition: d
|
|
674
674
|
};
|
|
675
675
|
return /* @__PURE__ */ t.jsx(
|
|
676
676
|
"div",
|
|
677
677
|
{
|
|
678
|
-
ref:
|
|
679
|
-
style:
|
|
680
|
-
className: `${V.product} ${
|
|
678
|
+
ref: e,
|
|
679
|
+
style: _,
|
|
680
|
+
className: `${V.product} ${f ? V.dragging : ""}`,
|
|
681
681
|
...s,
|
|
682
|
-
...
|
|
683
|
-
children:
|
|
682
|
+
...c,
|
|
683
|
+
children: o
|
|
684
684
|
}
|
|
685
685
|
);
|
|
686
686
|
}
|
|
687
|
-
const
|
|
687
|
+
const Fn = (h) => {
|
|
688
688
|
const {
|
|
689
|
-
isActiveItems:
|
|
690
|
-
setIsActiveItems:
|
|
689
|
+
isActiveItems: a,
|
|
690
|
+
setIsActiveItems: o,
|
|
691
691
|
items: s,
|
|
692
|
-
setItems:
|
|
693
|
-
other:
|
|
694
|
-
title:
|
|
695
|
-
subtitle:
|
|
696
|
-
editable:
|
|
697
|
-
draggable:
|
|
692
|
+
setItems: c,
|
|
693
|
+
other: e,
|
|
694
|
+
title: u,
|
|
695
|
+
subtitle: d,
|
|
696
|
+
editable: f = !0,
|
|
697
|
+
draggable: _ = !1,
|
|
698
698
|
deletable: T = !0,
|
|
699
|
-
addable:
|
|
700
|
-
itemsType:
|
|
699
|
+
addable: I = !0,
|
|
700
|
+
itemsType: r,
|
|
701
701
|
itemsPlaceholder: l = "",
|
|
702
|
-
itemsOptions:
|
|
703
|
-
hasRangeSelector:
|
|
704
|
-
rangeSelectorOptions:
|
|
702
|
+
itemsOptions: y,
|
|
703
|
+
hasRangeSelector: x = !1,
|
|
704
|
+
rangeSelectorOptions: p,
|
|
705
705
|
modalOptions: i,
|
|
706
|
-
addableOptions:
|
|
706
|
+
addableOptions: b = {},
|
|
707
707
|
limit: w
|
|
708
|
-
} =
|
|
708
|
+
} = h, [q, E] = g.useState(null), [K, F] = g.useState({
|
|
709
709
|
top: 0,
|
|
710
710
|
left: 0
|
|
711
|
-
}), [
|
|
711
|
+
}), [n, N] = g.useState(null), S = g.useRef(null), [O, M] = g.useState(!1), C = pt(
|
|
712
712
|
mt(gt, {
|
|
713
713
|
activationConstraint: {
|
|
714
714
|
distance: 5
|
|
715
715
|
}
|
|
716
716
|
})
|
|
717
717
|
);
|
|
718
|
-
|
|
719
|
-
const
|
|
720
|
-
|
|
718
|
+
g.useEffect(() => {
|
|
719
|
+
const m = () => {
|
|
720
|
+
E(null), M(!1);
|
|
721
721
|
};
|
|
722
|
-
return document.body.addEventListener("click",
|
|
723
|
-
|
|
722
|
+
return document.body.addEventListener("click", m), E(null), M(!1), () => {
|
|
723
|
+
E(null), M(!1), document.body.removeEventListener("click", m);
|
|
724
724
|
};
|
|
725
|
-
}, []),
|
|
725
|
+
}, []), g.useEffect(() => {
|
|
726
726
|
if (q) {
|
|
727
|
-
const
|
|
728
|
-
|
|
727
|
+
const m = [...s].map(($) => $.id === q.id ? q : $);
|
|
728
|
+
c(m);
|
|
729
729
|
}
|
|
730
|
-
}, [q]),
|
|
731
|
-
if (
|
|
732
|
-
const
|
|
733
|
-
let P =
|
|
734
|
-
P +
|
|
730
|
+
}, [q]), g.useEffect(() => {
|
|
731
|
+
if (S.current && n) {
|
|
732
|
+
const m = S.current.getBoundingClientRect().height, $ = window.innerHeight;
|
|
733
|
+
let P = n.top;
|
|
734
|
+
P + m > $ + window.scrollY - 200 && (P = $ + window.scrollY - m - 200), P < 0 && (P = 10), F({
|
|
735
735
|
top: P,
|
|
736
|
-
left:
|
|
736
|
+
left: n.left
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
|
-
}, [
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
const P =
|
|
743
|
-
|
|
739
|
+
}, [S.current, n]);
|
|
740
|
+
const v = (m, $) => {
|
|
741
|
+
m.stopPropagation();
|
|
742
|
+
const P = m.target.getBoundingClientRect();
|
|
743
|
+
N({
|
|
744
744
|
top: P.top + window.scrollY,
|
|
745
745
|
left: P.left - 30
|
|
746
|
-
}),
|
|
747
|
-
},
|
|
748
|
-
const { active: $, over: P } =
|
|
746
|
+
}), E($), M(!0);
|
|
747
|
+
}, A = (m) => {
|
|
748
|
+
const { active: $, over: P } = m;
|
|
749
749
|
if (P && $.id !== P.id) {
|
|
750
|
-
const
|
|
751
|
-
if (
|
|
752
|
-
const
|
|
753
|
-
|
|
750
|
+
const D = s.findIndex((L) => L.id === $.id), et = s.findIndex((L) => L.id === P.id);
|
|
751
|
+
if (D !== -1 && et !== -1) {
|
|
752
|
+
const L = [...s], [Z] = L.splice(D, 1);
|
|
753
|
+
L.splice(et, 0, Z), c(L);
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
|
-
},
|
|
756
|
+
}, H = (m) => {
|
|
757
757
|
var P;
|
|
758
758
|
const $ = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
759
|
-
|
|
760
|
-
|
|
759
|
+
_ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
760
|
+
j,
|
|
761
761
|
{
|
|
762
762
|
name: "DotsSixVertical",
|
|
763
763
|
hoverable: !0,
|
|
@@ -765,139 +765,139 @@ const Un = (u) => {
|
|
|
765
765
|
height: 20
|
|
766
766
|
}
|
|
767
767
|
) }),
|
|
768
|
-
|
|
768
|
+
r === "select" && y && /* @__PURE__ */ t.jsx(
|
|
769
769
|
ot,
|
|
770
770
|
{
|
|
771
|
-
onChange: (
|
|
772
|
-
const
|
|
773
|
-
...
|
|
771
|
+
onChange: (D) => {
|
|
772
|
+
const L = [...s].map((Z) => Z.id === m.id ? {
|
|
773
|
+
...m,
|
|
774
774
|
name: {
|
|
775
|
-
"en-US":
|
|
775
|
+
"en-US": D
|
|
776
776
|
}
|
|
777
777
|
} : Z);
|
|
778
|
-
|
|
779
|
-
...
|
|
778
|
+
E({
|
|
779
|
+
...m,
|
|
780
780
|
name: {
|
|
781
|
-
"en-US":
|
|
781
|
+
"en-US": D
|
|
782
782
|
}
|
|
783
|
-
}),
|
|
783
|
+
}), c([...L]);
|
|
784
784
|
},
|
|
785
|
-
value:
|
|
786
|
-
options:
|
|
787
|
-
(
|
|
785
|
+
value: m.name["en-US"],
|
|
786
|
+
options: y.filter(
|
|
787
|
+
(D) => !s.find((et) => et.name["en-US"] === D)
|
|
788
788
|
)
|
|
789
789
|
}
|
|
790
790
|
),
|
|
791
|
-
|
|
791
|
+
r === "input" && /* @__PURE__ */ t.jsx(
|
|
792
792
|
Nt,
|
|
793
793
|
{
|
|
794
|
-
onChange: (
|
|
795
|
-
const
|
|
796
|
-
...
|
|
794
|
+
onChange: (D) => {
|
|
795
|
+
const L = [...s].map((Z) => Z.id === m.id ? {
|
|
796
|
+
...m,
|
|
797
797
|
name: {
|
|
798
|
-
"en-US":
|
|
798
|
+
"en-US": D
|
|
799
799
|
}
|
|
800
800
|
} : Z);
|
|
801
|
-
|
|
801
|
+
c([...L]);
|
|
802
802
|
},
|
|
803
|
-
value:
|
|
803
|
+
value: m.name["en-US"],
|
|
804
804
|
placeholder: l
|
|
805
805
|
}
|
|
806
806
|
),
|
|
807
|
-
|
|
808
|
-
|
|
807
|
+
r === "image" && /* @__PURE__ */ t.jsx(
|
|
808
|
+
Dt,
|
|
809
809
|
{
|
|
810
|
-
onChange: (
|
|
811
|
-
const
|
|
812
|
-
...
|
|
813
|
-
images:
|
|
810
|
+
onChange: (D) => {
|
|
811
|
+
const L = [...s].map((Z) => Z.id === m.id ? {
|
|
812
|
+
...m,
|
|
813
|
+
images: D
|
|
814
814
|
} : Z);
|
|
815
|
-
|
|
815
|
+
c([...L]);
|
|
816
816
|
},
|
|
817
|
-
activeImage: (P = s.find((
|
|
817
|
+
activeImage: (P = s.find((D) => D.id === m.id)) == null ? void 0 : P.images[0]
|
|
818
818
|
}
|
|
819
819
|
),
|
|
820
820
|
/* @__PURE__ */ t.jsxs("div", { className: V.buttons, children: [
|
|
821
|
-
|
|
822
|
-
|
|
821
|
+
f && /* @__PURE__ */ t.jsx("div", { className: V.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
822
|
+
j,
|
|
823
823
|
{
|
|
824
824
|
name: "Sliders",
|
|
825
825
|
hoverable: !0,
|
|
826
826
|
width: 20,
|
|
827
827
|
height: 20,
|
|
828
|
-
onClick: (
|
|
828
|
+
onClick: (D) => v(D, m)
|
|
829
829
|
}
|
|
830
830
|
) }),
|
|
831
831
|
T && /* @__PURE__ */ t.jsx("div", { className: V.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
832
|
-
|
|
832
|
+
j,
|
|
833
833
|
{
|
|
834
834
|
name: "Trash",
|
|
835
835
|
hoverable: !0,
|
|
836
836
|
width: 20,
|
|
837
837
|
height: 20,
|
|
838
838
|
fill: "#C12A2A",
|
|
839
|
-
onClick: () =>
|
|
839
|
+
onClick: () => c(s.filter((D) => D.id !== m.id))
|
|
840
840
|
}
|
|
841
841
|
) })
|
|
842
842
|
] })
|
|
843
843
|
] });
|
|
844
|
-
return
|
|
845
|
-
|
|
844
|
+
return _ ? /* @__PURE__ */ t.jsx(
|
|
845
|
+
ke,
|
|
846
846
|
{
|
|
847
|
-
product:
|
|
847
|
+
product: m,
|
|
848
848
|
children: $
|
|
849
849
|
},
|
|
850
|
-
|
|
850
|
+
m.id
|
|
851
851
|
) : /* @__PURE__ */ t.jsx(
|
|
852
852
|
"div",
|
|
853
853
|
{
|
|
854
854
|
className: V.product,
|
|
855
855
|
children: $
|
|
856
856
|
},
|
|
857
|
-
|
|
857
|
+
m.id
|
|
858
858
|
);
|
|
859
859
|
};
|
|
860
860
|
return /* @__PURE__ */ t.jsxs("div", { className: V.productsBlock, children: [
|
|
861
|
-
(
|
|
862
|
-
|
|
863
|
-
|
|
861
|
+
(u || a !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: V.top, children: [
|
|
862
|
+
u && /* @__PURE__ */ t.jsx("h3", { className: V.title, children: u }),
|
|
863
|
+
a !== void 0 && /* @__PURE__ */ t.jsx(
|
|
864
864
|
lt,
|
|
865
865
|
{
|
|
866
|
-
current:
|
|
867
|
-
onChange: (
|
|
866
|
+
current: a,
|
|
867
|
+
onChange: (m) => o == null ? void 0 : o(m)
|
|
868
868
|
}
|
|
869
869
|
)
|
|
870
870
|
] }),
|
|
871
|
-
q &&
|
|
872
|
-
|
|
871
|
+
q && f && i && O && /* @__PURE__ */ t.jsx(
|
|
872
|
+
At,
|
|
873
873
|
{
|
|
874
|
-
ref:
|
|
874
|
+
ref: S,
|
|
875
875
|
activeItem: q,
|
|
876
|
-
setActiveItem:
|
|
876
|
+
setActiveItem: E,
|
|
877
877
|
popupPosition: K,
|
|
878
878
|
modalOptions: i,
|
|
879
|
-
setIsOpenModal:
|
|
879
|
+
setIsOpenModal: M
|
|
880
880
|
}
|
|
881
881
|
),
|
|
882
|
-
|
|
882
|
+
x && p && /* @__PURE__ */ t.jsx(kt, { ...p }),
|
|
883
883
|
/* @__PURE__ */ t.jsxs("div", { className: V.products, children: [
|
|
884
|
-
|
|
885
|
-
|
|
884
|
+
d && /* @__PURE__ */ t.jsx("h5", { className: V.subtitle, children: d }),
|
|
885
|
+
_ ? /* @__PURE__ */ t.jsx(
|
|
886
886
|
ft,
|
|
887
887
|
{
|
|
888
|
-
sensors:
|
|
889
|
-
onDragEnd:
|
|
888
|
+
sensors: C,
|
|
889
|
+
onDragEnd: A,
|
|
890
890
|
children: /* @__PURE__ */ t.jsx(
|
|
891
891
|
xt,
|
|
892
892
|
{
|
|
893
|
-
items: s.map((
|
|
893
|
+
items: s.map((m) => m.id),
|
|
894
894
|
strategy: _t,
|
|
895
|
-
children: s.map((
|
|
895
|
+
children: s.map((m) => H(m))
|
|
896
896
|
}
|
|
897
897
|
)
|
|
898
898
|
}
|
|
899
|
-
) : s.map((
|
|
900
|
-
|
|
899
|
+
) : s.map((m) => H(m)),
|
|
900
|
+
I && /* @__PURE__ */ t.jsx(
|
|
901
901
|
"div",
|
|
902
902
|
{
|
|
903
903
|
style: {
|
|
@@ -909,44 +909,44 @@ const Un = (u) => {
|
|
|
909
909
|
dt,
|
|
910
910
|
{
|
|
911
911
|
withoutHover: !0,
|
|
912
|
-
className:
|
|
912
|
+
className: U(V.button, {
|
|
913
913
|
[V.disabled]: !!(w && w <= s.length)
|
|
914
914
|
}),
|
|
915
915
|
size: "s",
|
|
916
916
|
disabled: !!(w && w <= s.length),
|
|
917
917
|
onClick: () => {
|
|
918
|
-
const
|
|
918
|
+
const m = [...s];
|
|
919
919
|
let $ = null;
|
|
920
|
-
if (
|
|
921
|
-
for (let P = 0; P <
|
|
922
|
-
if (!s.find((
|
|
923
|
-
$ =
|
|
920
|
+
if (y) {
|
|
921
|
+
for (let P = 0; P < y.length; P++)
|
|
922
|
+
if (!s.find((D) => D.name["en-US"] === y[P])) {
|
|
923
|
+
$ = y[P];
|
|
924
924
|
break;
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
|
-
|
|
927
|
+
r === "select" && y ? m.push({
|
|
928
928
|
name: {
|
|
929
|
-
"en-US": $ ||
|
|
929
|
+
"en-US": $ || y[0]
|
|
930
930
|
},
|
|
931
931
|
id: J(),
|
|
932
|
-
...
|
|
932
|
+
...b,
|
|
933
933
|
maxSymbols: 100
|
|
934
934
|
// пример значения
|
|
935
|
-
}) :
|
|
935
|
+
}) : r === "input" ? m.push({
|
|
936
936
|
name: {
|
|
937
937
|
"en-US": ""
|
|
938
938
|
},
|
|
939
939
|
id: J(),
|
|
940
|
-
...
|
|
940
|
+
...b,
|
|
941
941
|
maxSymbols: 100
|
|
942
|
-
}) :
|
|
942
|
+
}) : m.push({
|
|
943
943
|
name: {
|
|
944
944
|
"en-US": `Image ${s.length + 1}`
|
|
945
945
|
},
|
|
946
946
|
id: J(),
|
|
947
|
-
...
|
|
947
|
+
...b,
|
|
948
948
|
maxSymbols: 100
|
|
949
|
-
}),
|
|
949
|
+
}), c(m);
|
|
950
950
|
},
|
|
951
951
|
style: {
|
|
952
952
|
width: "fit-content"
|
|
@@ -954,7 +954,7 @@ const Un = (u) => {
|
|
|
954
954
|
children: /* @__PURE__ */ t.jsxs("div", { className: V.addButton, children: [
|
|
955
955
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
956
956
|
/* @__PURE__ */ t.jsx(
|
|
957
|
-
|
|
957
|
+
j,
|
|
958
958
|
{
|
|
959
959
|
name: "Plus",
|
|
960
960
|
width: 16,
|
|
@@ -967,60 +967,60 @@ const Un = (u) => {
|
|
|
967
967
|
}
|
|
968
968
|
)
|
|
969
969
|
] }),
|
|
970
|
-
|
|
970
|
+
e !== void 0 && /* @__PURE__ */ t.jsx(
|
|
971
971
|
ht,
|
|
972
972
|
{
|
|
973
973
|
otherTitle: "Other",
|
|
974
|
-
items:
|
|
974
|
+
items: e
|
|
975
975
|
}
|
|
976
976
|
)
|
|
977
977
|
] });
|
|
978
|
-
},
|
|
979
|
-
subtitle:
|
|
980
|
-
products:
|
|
981
|
-
product:
|
|
982
|
-
button:
|
|
983
|
-
buttons:
|
|
984
|
-
addButton:
|
|
985
|
-
deleteButton:
|
|
986
|
-
},
|
|
987
|
-
const { buttons:
|
|
978
|
+
}, we = "_subtitle_jql1y_1", Te = "_products_jql1y_10", Me = "_product_jql1y_10", Be = "_button_jql1y_11", $e = "_buttons_jql1y_11", Oe = "_addButton_jql1y_150", qe = "_deleteButton_jql1y_165", st = {
|
|
979
|
+
subtitle: we,
|
|
980
|
+
products: Te,
|
|
981
|
+
product: Me,
|
|
982
|
+
button: Be,
|
|
983
|
+
buttons: $e,
|
|
984
|
+
addButton: Oe,
|
|
985
|
+
deleteButton: qe
|
|
986
|
+
}, Ae = (h) => {
|
|
987
|
+
const { buttons: a, setButtons: o, deletable: s = !0, addable: c = !0, editableLink: e = !0 } = h, { pages: u } = bt(), [d, f] = g.useState(null), [_, T] = g.useState({
|
|
988
988
|
top: 0,
|
|
989
989
|
left: 0
|
|
990
|
-
}), [
|
|
991
|
-
|
|
992
|
-
if (
|
|
993
|
-
const
|
|
994
|
-
|
|
990
|
+
}), [I, r] = g.useState(null), l = g.useRef(null);
|
|
991
|
+
g.useEffect(() => {
|
|
992
|
+
if (d) {
|
|
993
|
+
const p = [...a].map((i) => i.id === d.id ? d : i);
|
|
994
|
+
o(p);
|
|
995
995
|
}
|
|
996
|
-
}, [
|
|
997
|
-
if (l.current &&
|
|
998
|
-
const
|
|
999
|
-
let
|
|
1000
|
-
|
|
1001
|
-
top:
|
|
1002
|
-
left:
|
|
996
|
+
}, [d]), g.useEffect(() => {
|
|
997
|
+
if (l.current && I) {
|
|
998
|
+
const p = l.current.getBoundingClientRect().height, i = window.innerHeight;
|
|
999
|
+
let b = I.top;
|
|
1000
|
+
b + p > i + window.scrollY - 200 && (b = i + window.scrollY - p - 200), b < 0 && (b = 10), T({
|
|
1001
|
+
top: b,
|
|
1002
|
+
left: I.left
|
|
1003
1003
|
});
|
|
1004
1004
|
}
|
|
1005
|
-
}, [l.current,
|
|
1006
|
-
const
|
|
1007
|
-
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1010
|
-
top:
|
|
1011
|
-
left:
|
|
1012
|
-
}),
|
|
1013
|
-
},
|
|
1014
|
-
const
|
|
1015
|
-
...
|
|
1005
|
+
}, [l.current, I]);
|
|
1006
|
+
const y = (p, i) => {
|
|
1007
|
+
p.stopPropagation();
|
|
1008
|
+
const b = p.target.getBoundingClientRect();
|
|
1009
|
+
r({
|
|
1010
|
+
top: b.top + window.scrollY - 70,
|
|
1011
|
+
left: b.left - (c ? 30 : 65)
|
|
1012
|
+
}), f(i);
|
|
1013
|
+
}, x = (p, i) => {
|
|
1014
|
+
const b = [...a], w = {
|
|
1015
|
+
...p,
|
|
1016
1016
|
id: Math.random().toString(36).substr(2, 9)
|
|
1017
1017
|
// Генерируем новый уникальный ID
|
|
1018
1018
|
};
|
|
1019
|
-
|
|
1019
|
+
b.splice(i + 1, 0, w), o(b);
|
|
1020
1020
|
};
|
|
1021
1021
|
return /* @__PURE__ */ t.jsxs("div", { className: st.products, children: [
|
|
1022
1022
|
/* @__PURE__ */ t.jsx("h5", { className: st.subtitle, children: "Button Type" }),
|
|
1023
|
-
|
|
1023
|
+
a.map((p, i) => /* @__PURE__ */ t.jsxs(
|
|
1024
1024
|
"div",
|
|
1025
1025
|
{
|
|
1026
1026
|
className: st.product,
|
|
@@ -1028,50 +1028,50 @@ const Un = (u) => {
|
|
|
1028
1028
|
/* @__PURE__ */ t.jsx(
|
|
1029
1029
|
ot,
|
|
1030
1030
|
{
|
|
1031
|
-
onChange: (
|
|
1032
|
-
const q = [...
|
|
1033
|
-
...
|
|
1034
|
-
type:
|
|
1035
|
-
} :
|
|
1036
|
-
|
|
1031
|
+
onChange: (b) => {
|
|
1032
|
+
const q = [...a].map((E) => E.id === p.id ? {
|
|
1033
|
+
...p,
|
|
1034
|
+
type: b
|
|
1035
|
+
} : E);
|
|
1036
|
+
o(q);
|
|
1037
1037
|
},
|
|
1038
|
-
value:
|
|
1038
|
+
value: p.type,
|
|
1039
1039
|
options: ["Primary", "Secondary", "Tertiary"]
|
|
1040
1040
|
}
|
|
1041
1041
|
),
|
|
1042
1042
|
/* @__PURE__ */ t.jsxs("div", { className: st.buttons, children: [
|
|
1043
1043
|
/* @__PURE__ */ t.jsx("div", { className: st.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1044
|
-
|
|
1044
|
+
j,
|
|
1045
1045
|
{
|
|
1046
1046
|
name: "Copy",
|
|
1047
1047
|
hoverable: !0,
|
|
1048
1048
|
width: 20,
|
|
1049
1049
|
height: 20,
|
|
1050
1050
|
onClick: () => {
|
|
1051
|
-
|
|
1051
|
+
x(p, i);
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
1054
|
) }),
|
|
1055
1055
|
/* @__PURE__ */ t.jsx("div", { className: st.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1056
|
-
|
|
1056
|
+
j,
|
|
1057
1057
|
{
|
|
1058
1058
|
name: "Sliders",
|
|
1059
1059
|
hoverable: !0,
|
|
1060
1060
|
width: 20,
|
|
1061
1061
|
height: 20,
|
|
1062
|
-
onClick: (
|
|
1063
|
-
|
|
1062
|
+
onClick: (b) => {
|
|
1063
|
+
y(b, p);
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
1066
|
) }),
|
|
1067
1067
|
s && /* @__PURE__ */ t.jsx("div", { className: st.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1068
|
-
|
|
1068
|
+
j,
|
|
1069
1069
|
{
|
|
1070
1070
|
name: "Trash",
|
|
1071
1071
|
hoverable: !0,
|
|
1072
1072
|
onClick: () => {
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1073
|
+
const b = a.filter((w) => w.id !== p.id);
|
|
1074
|
+
o(b);
|
|
1075
1075
|
},
|
|
1076
1076
|
width: 20,
|
|
1077
1077
|
height: 20,
|
|
@@ -1081,19 +1081,19 @@ const Un = (u) => {
|
|
|
1081
1081
|
] })
|
|
1082
1082
|
]
|
|
1083
1083
|
},
|
|
1084
|
-
|
|
1084
|
+
p.id
|
|
1085
1085
|
)),
|
|
1086
|
-
|
|
1087
|
-
|
|
1086
|
+
d && /* @__PURE__ */ t.jsx(
|
|
1087
|
+
Et,
|
|
1088
1088
|
{
|
|
1089
1089
|
ref: l,
|
|
1090
|
-
activeButton:
|
|
1091
|
-
setActiveButton:
|
|
1092
|
-
popupPosition:
|
|
1093
|
-
editableLink:
|
|
1090
|
+
activeButton: d,
|
|
1091
|
+
setActiveButton: f,
|
|
1092
|
+
popupPosition: _,
|
|
1093
|
+
editableLink: e
|
|
1094
1094
|
}
|
|
1095
1095
|
),
|
|
1096
|
-
|
|
1096
|
+
c && /* @__PURE__ */ t.jsx(
|
|
1097
1097
|
"div",
|
|
1098
1098
|
{
|
|
1099
1099
|
style: {
|
|
@@ -1108,8 +1108,8 @@ const Un = (u) => {
|
|
|
1108
1108
|
className: st.button,
|
|
1109
1109
|
size: "s",
|
|
1110
1110
|
onClick: () => {
|
|
1111
|
-
const
|
|
1112
|
-
|
|
1111
|
+
const p = [...a];
|
|
1112
|
+
e ? p.push({
|
|
1113
1113
|
type: "Primary",
|
|
1114
1114
|
id: J(),
|
|
1115
1115
|
typesText: [],
|
|
@@ -1117,9 +1117,9 @@ const Un = (u) => {
|
|
|
1117
1117
|
"en-US": "Button Name"
|
|
1118
1118
|
},
|
|
1119
1119
|
destination: "Go to Page",
|
|
1120
|
-
page:
|
|
1120
|
+
page: u ? Object.values(u)[0].path : "/",
|
|
1121
1121
|
openInNewTab: !1
|
|
1122
|
-
}) :
|
|
1122
|
+
}) : p.push({
|
|
1123
1123
|
type: "Primary",
|
|
1124
1124
|
id: J(),
|
|
1125
1125
|
typesText: [],
|
|
@@ -1127,9 +1127,9 @@ const Un = (u) => {
|
|
|
1127
1127
|
"en-US": "Create Ticket"
|
|
1128
1128
|
},
|
|
1129
1129
|
destination: "Go to Page",
|
|
1130
|
-
page:
|
|
1130
|
+
page: u ? Object.values(u)[0].path : "/",
|
|
1131
1131
|
openInNewTab: !1
|
|
1132
|
-
}),
|
|
1132
|
+
}), o(p);
|
|
1133
1133
|
},
|
|
1134
1134
|
style: {
|
|
1135
1135
|
width: "fit-content"
|
|
@@ -1137,7 +1137,7 @@ const Un = (u) => {
|
|
|
1137
1137
|
children: /* @__PURE__ */ t.jsxs("div", { className: st.addButton, children: [
|
|
1138
1138
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
1139
1139
|
/* @__PURE__ */ t.jsx(
|
|
1140
|
-
|
|
1140
|
+
j,
|
|
1141
1141
|
{
|
|
1142
1142
|
name: "Plus",
|
|
1143
1143
|
width: 16,
|
|
@@ -1150,123 +1150,123 @@ const Un = (u) => {
|
|
|
1150
1150
|
}
|
|
1151
1151
|
)
|
|
1152
1152
|
] });
|
|
1153
|
-
},
|
|
1153
|
+
}, Hn = (h) => {
|
|
1154
1154
|
const {
|
|
1155
|
-
isActiveButtons:
|
|
1156
|
-
setIsActiveButtons:
|
|
1155
|
+
isActiveButtons: a,
|
|
1156
|
+
setIsActiveButtons: o,
|
|
1157
1157
|
buttons: s,
|
|
1158
|
-
setButtons:
|
|
1159
|
-
editableLink:
|
|
1160
|
-
addable:
|
|
1161
|
-
deletable:
|
|
1162
|
-
} =
|
|
1163
|
-
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
1164
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1165
|
-
/* @__PURE__ */ t.jsx("h3", { className:
|
|
1158
|
+
setButtons: c,
|
|
1159
|
+
editableLink: e = !0,
|
|
1160
|
+
addable: u = !0,
|
|
1161
|
+
deletable: d = !0
|
|
1162
|
+
} = h;
|
|
1163
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: vt.buttonsBlock, children: [
|
|
1164
|
+
/* @__PURE__ */ t.jsxs("div", { className: vt.top, children: [
|
|
1165
|
+
/* @__PURE__ */ t.jsx("h3", { className: vt.title, children: "Buttons" }),
|
|
1166
1166
|
/* @__PURE__ */ t.jsx(
|
|
1167
1167
|
lt,
|
|
1168
1168
|
{
|
|
1169
|
-
current:
|
|
1170
|
-
onChange: (
|
|
1169
|
+
current: a,
|
|
1170
|
+
onChange: (f) => o(f)
|
|
1171
1171
|
}
|
|
1172
1172
|
)
|
|
1173
1173
|
] }),
|
|
1174
|
-
|
|
1175
|
-
|
|
1174
|
+
a && /* @__PURE__ */ t.jsx(
|
|
1175
|
+
Ae,
|
|
1176
1176
|
{
|
|
1177
1177
|
buttons: s,
|
|
1178
|
-
setButtons:
|
|
1179
|
-
editableLink:
|
|
1180
|
-
addable:
|
|
1181
|
-
deletable:
|
|
1178
|
+
setButtons: c,
|
|
1179
|
+
editableLink: e,
|
|
1180
|
+
addable: u,
|
|
1181
|
+
deletable: d
|
|
1182
1182
|
}
|
|
1183
1183
|
)
|
|
1184
1184
|
] }) });
|
|
1185
1185
|
};
|
|
1186
|
-
function
|
|
1187
|
-
const { product:
|
|
1188
|
-
id: String(
|
|
1189
|
-
}),
|
|
1190
|
-
transform: jt.Transform.toString(
|
|
1191
|
-
transition:
|
|
1186
|
+
function De(h) {
|
|
1187
|
+
const { product: a, children: o } = h, { attributes: s, listeners: c, setNodeRef: e, transform: u, transition: d, isDragging: f } = yt({
|
|
1188
|
+
id: String(a.listingId)
|
|
1189
|
+
}), _ = {
|
|
1190
|
+
transform: jt.Transform.toString(u),
|
|
1191
|
+
transition: d
|
|
1192
1192
|
};
|
|
1193
1193
|
return /* @__PURE__ */ t.jsx(
|
|
1194
1194
|
"div",
|
|
1195
1195
|
{
|
|
1196
|
-
ref:
|
|
1197
|
-
style:
|
|
1198
|
-
className: `${W.product} ${
|
|
1196
|
+
ref: e,
|
|
1197
|
+
style: _,
|
|
1198
|
+
className: `${W.product} ${f ? W.dragging : ""}`,
|
|
1199
1199
|
...s,
|
|
1200
|
-
...
|
|
1201
|
-
children:
|
|
1200
|
+
...c,
|
|
1201
|
+
children: o
|
|
1202
1202
|
}
|
|
1203
1203
|
);
|
|
1204
1204
|
}
|
|
1205
|
-
const
|
|
1205
|
+
const Vn = (h) => {
|
|
1206
1206
|
const {
|
|
1207
|
-
isActiveItems:
|
|
1208
|
-
setIsActiveItems:
|
|
1207
|
+
isActiveItems: a,
|
|
1208
|
+
setIsActiveItems: o,
|
|
1209
1209
|
items: s,
|
|
1210
|
-
setItems:
|
|
1211
|
-
other:
|
|
1212
|
-
title:
|
|
1213
|
-
subtitle:
|
|
1214
|
-
editable:
|
|
1215
|
-
draggable:
|
|
1210
|
+
setItems: c,
|
|
1211
|
+
other: e,
|
|
1212
|
+
title: u,
|
|
1213
|
+
subtitle: d,
|
|
1214
|
+
editable: f = !0,
|
|
1215
|
+
draggable: _ = !1,
|
|
1216
1216
|
withImage: T = !1,
|
|
1217
|
-
deletable:
|
|
1218
|
-
addable:
|
|
1217
|
+
deletable: I = !0,
|
|
1218
|
+
addable: r = !0,
|
|
1219
1219
|
itemsType: l,
|
|
1220
|
-
itemsOptions:
|
|
1221
|
-
limit:
|
|
1222
|
-
aspectRatio:
|
|
1220
|
+
itemsOptions: y,
|
|
1221
|
+
limit: x,
|
|
1222
|
+
aspectRatio: p,
|
|
1223
1223
|
setAspectRatio: i
|
|
1224
|
-
} =
|
|
1224
|
+
} = h, [b, w] = g.useState(
|
|
1225
1225
|
null
|
|
1226
|
-
), [q,
|
|
1226
|
+
), [q, E] = g.useState({
|
|
1227
1227
|
top: 0,
|
|
1228
1228
|
left: 0
|
|
1229
|
-
}), [K,
|
|
1229
|
+
}), [K, F] = g.useState(!1), n = pt(
|
|
1230
1230
|
mt(gt, {
|
|
1231
1231
|
activationConstraint: {
|
|
1232
1232
|
distance: 5
|
|
1233
1233
|
}
|
|
1234
1234
|
})
|
|
1235
1235
|
);
|
|
1236
|
-
|
|
1237
|
-
const
|
|
1238
|
-
w(null),
|
|
1236
|
+
g.useEffect(() => {
|
|
1237
|
+
const v = () => {
|
|
1238
|
+
w(null), F(!1);
|
|
1239
1239
|
};
|
|
1240
|
-
return document.body.addEventListener("click",
|
|
1241
|
-
w(null),
|
|
1240
|
+
return document.body.addEventListener("click", v), w(null), F(!1), () => {
|
|
1241
|
+
w(null), F(!1), document.body.removeEventListener("click", v);
|
|
1242
1242
|
};
|
|
1243
|
-
}, []),
|
|
1244
|
-
if (
|
|
1245
|
-
const
|
|
1246
|
-
|
|
1243
|
+
}, []), g.useEffect(() => {
|
|
1244
|
+
if (b) {
|
|
1245
|
+
const v = [...s].map((A) => A.listingId === b.listingId ? b : A);
|
|
1246
|
+
c(v);
|
|
1247
1247
|
}
|
|
1248
|
-
}, [
|
|
1249
|
-
const
|
|
1250
|
-
|
|
1251
|
-
const
|
|
1252
|
-
let P =
|
|
1253
|
-
P +
|
|
1248
|
+
}, [b]);
|
|
1249
|
+
const N = (v, A) => {
|
|
1250
|
+
v.stopPropagation();
|
|
1251
|
+
const H = v.target.getBoundingClientRect(), m = 100, $ = window.innerHeight;
|
|
1252
|
+
let P = H.top + window.scrollY;
|
|
1253
|
+
P + m > $ && (P = $ - m - 20), F(!0), E({
|
|
1254
1254
|
top: P - 80,
|
|
1255
|
-
left:
|
|
1256
|
-
}), w(
|
|
1255
|
+
left: H.left - 30
|
|
1256
|
+
}), w(A);
|
|
1257
1257
|
};
|
|
1258
|
-
function
|
|
1258
|
+
function S(v) {
|
|
1259
1259
|
if (T)
|
|
1260
|
-
return
|
|
1260
|
+
return v ? /* @__PURE__ */ t.jsx(
|
|
1261
1261
|
"img",
|
|
1262
1262
|
{
|
|
1263
|
-
src: `https://imagedelivery.net/${
|
|
1263
|
+
src: `https://imagedelivery.net/${v}/w=1000`,
|
|
1264
1264
|
alt: "image",
|
|
1265
1265
|
width: 16,
|
|
1266
1266
|
height: 16
|
|
1267
1267
|
}
|
|
1268
1268
|
) : /* @__PURE__ */ t.jsx(
|
|
1269
|
-
|
|
1269
|
+
j,
|
|
1270
1270
|
{
|
|
1271
1271
|
name: "Image",
|
|
1272
1272
|
width: 16,
|
|
@@ -1275,21 +1275,21 @@ const Hn = (u) => {
|
|
|
1275
1275
|
}
|
|
1276
1276
|
);
|
|
1277
1277
|
}
|
|
1278
|
-
const O = (
|
|
1279
|
-
const { active:
|
|
1280
|
-
if (
|
|
1281
|
-
const
|
|
1282
|
-
if (
|
|
1283
|
-
const P = [...s], [
|
|
1284
|
-
P.splice($, 0,
|
|
1278
|
+
const O = (v) => {
|
|
1279
|
+
const { active: A, over: H } = v;
|
|
1280
|
+
if (H && A.id !== H.id) {
|
|
1281
|
+
const m = s.findIndex((P) => String(P.listingId) === A.id), $ = s.findIndex((P) => String(P.listingId) === H.id);
|
|
1282
|
+
if (m !== -1 && $ !== -1) {
|
|
1283
|
+
const P = [...s], [D] = P.splice(m, 1);
|
|
1284
|
+
P.splice($, 0, D), c(P);
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
|
-
},
|
|
1288
|
-
const
|
|
1289
|
-
if (!
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1292
|
-
|
|
1287
|
+
}, M = (v) => {
|
|
1288
|
+
const A = y.find((m) => v.listingId === m.id);
|
|
1289
|
+
if (!A) return null;
|
|
1290
|
+
const H = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1291
|
+
_ && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1292
|
+
j,
|
|
1293
1293
|
{
|
|
1294
1294
|
name: "DotsSixVertical",
|
|
1295
1295
|
hoverable: !0,
|
|
@@ -1300,108 +1300,108 @@ const Hn = (u) => {
|
|
|
1300
1300
|
l === "select" && /* @__PURE__ */ t.jsx(
|
|
1301
1301
|
ot,
|
|
1302
1302
|
{
|
|
1303
|
-
onChange: (
|
|
1304
|
-
const $ = [...s], P =
|
|
1303
|
+
onChange: (m) => {
|
|
1304
|
+
const $ = [...s], P = y.find((L) => L.productData.name === m);
|
|
1305
1305
|
if (!P) return;
|
|
1306
|
-
const
|
|
1306
|
+
const D = {
|
|
1307
1307
|
listingId: P.id,
|
|
1308
1308
|
image: P.productData.images.length > 0 ? P.productData.images[0].cfId : ""
|
|
1309
|
-
}, et = $.map((
|
|
1310
|
-
w(
|
|
1309
|
+
}, et = $.map((L) => L.listingId === v.listingId ? D : L);
|
|
1310
|
+
w(D), c([...et]);
|
|
1311
1311
|
},
|
|
1312
|
-
value:
|
|
1312
|
+
value: A.productData.name,
|
|
1313
1313
|
options: [
|
|
1314
|
-
...
|
|
1314
|
+
...y.filter((m) => !s.find(($) => $.listingId === m.id)).map((m) => m.productData.name)
|
|
1315
1315
|
],
|
|
1316
|
-
leftAddonOptions:
|
|
1316
|
+
leftAddonOptions: y.map((m) => {
|
|
1317
1317
|
var $;
|
|
1318
1318
|
return {
|
|
1319
|
-
value:
|
|
1320
|
-
addon:
|
|
1319
|
+
value: m.productData.name,
|
|
1320
|
+
addon: S((($ = m.productData.images[0]) == null ? void 0 : $.cfId) || "")
|
|
1321
1321
|
};
|
|
1322
1322
|
})
|
|
1323
1323
|
}
|
|
1324
1324
|
),
|
|
1325
1325
|
/* @__PURE__ */ t.jsxs("div", { className: W.buttons, children: [
|
|
1326
|
-
|
|
1327
|
-
|
|
1326
|
+
f && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1327
|
+
j,
|
|
1328
1328
|
{
|
|
1329
1329
|
name: "Sliders",
|
|
1330
1330
|
hoverable: !0,
|
|
1331
1331
|
width: 20,
|
|
1332
1332
|
height: 20,
|
|
1333
|
-
onClick: (
|
|
1333
|
+
onClick: (m) => N(m, v)
|
|
1334
1334
|
}
|
|
1335
1335
|
) }),
|
|
1336
|
-
|
|
1337
|
-
|
|
1336
|
+
I && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1337
|
+
j,
|
|
1338
1338
|
{
|
|
1339
1339
|
name: "Trash",
|
|
1340
1340
|
hoverable: !0,
|
|
1341
1341
|
width: 20,
|
|
1342
1342
|
height: 20,
|
|
1343
1343
|
fill: "#C12A2A",
|
|
1344
|
-
onClick: () =>
|
|
1344
|
+
onClick: () => c(s.filter((m) => m !== v))
|
|
1345
1345
|
}
|
|
1346
1346
|
) })
|
|
1347
1347
|
] })
|
|
1348
1348
|
] });
|
|
1349
|
-
return
|
|
1350
|
-
|
|
1349
|
+
return _ ? /* @__PURE__ */ t.jsx(
|
|
1350
|
+
De,
|
|
1351
1351
|
{
|
|
1352
|
-
product:
|
|
1353
|
-
children:
|
|
1352
|
+
product: v,
|
|
1353
|
+
children: H
|
|
1354
1354
|
},
|
|
1355
|
-
|
|
1355
|
+
v.listingId
|
|
1356
1356
|
) : /* @__PURE__ */ t.jsx(
|
|
1357
1357
|
"div",
|
|
1358
1358
|
{
|
|
1359
1359
|
className: W.product,
|
|
1360
|
-
children:
|
|
1360
|
+
children: H
|
|
1361
1361
|
},
|
|
1362
|
-
|
|
1362
|
+
v.listingId
|
|
1363
1363
|
);
|
|
1364
|
-
},
|
|
1364
|
+
}, C = g.useRef(null);
|
|
1365
1365
|
return /* @__PURE__ */ t.jsxs("div", { className: W.productsBlock, children: [
|
|
1366
|
-
(
|
|
1367
|
-
|
|
1368
|
-
|
|
1366
|
+
(u || a !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: W.top, children: [
|
|
1367
|
+
u && /* @__PURE__ */ t.jsx("h3", { className: W.title, children: u }),
|
|
1368
|
+
a !== void 0 && /* @__PURE__ */ t.jsx(
|
|
1369
1369
|
lt,
|
|
1370
1370
|
{
|
|
1371
|
-
current:
|
|
1372
|
-
onChange: (
|
|
1371
|
+
current: a,
|
|
1372
|
+
onChange: (v) => o == null ? void 0 : o(v)
|
|
1373
1373
|
}
|
|
1374
1374
|
)
|
|
1375
1375
|
] }),
|
|
1376
|
-
K &&
|
|
1377
|
-
|
|
1376
|
+
K && b && /* @__PURE__ */ t.jsx(
|
|
1377
|
+
Rt,
|
|
1378
1378
|
{
|
|
1379
|
-
ref:
|
|
1380
|
-
activeItem:
|
|
1379
|
+
ref: C,
|
|
1380
|
+
activeItem: b,
|
|
1381
1381
|
setActiveItem: w,
|
|
1382
|
-
setIsOpenModal:
|
|
1382
|
+
setIsOpenModal: F,
|
|
1383
1383
|
popupPosition: q,
|
|
1384
|
-
itemsOptions:
|
|
1384
|
+
itemsOptions: y
|
|
1385
1385
|
}
|
|
1386
1386
|
),
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1387
|
+
a && /* @__PURE__ */ t.jsxs("div", { className: W.products, children: [
|
|
1388
|
+
d && /* @__PURE__ */ t.jsx("h5", { className: W.subtitle, children: d }),
|
|
1389
|
+
_ ? /* @__PURE__ */ t.jsx(
|
|
1390
1390
|
ft,
|
|
1391
1391
|
{
|
|
1392
|
-
sensors:
|
|
1392
|
+
sensors: n,
|
|
1393
1393
|
onDragEnd: O,
|
|
1394
1394
|
children: /* @__PURE__ */ t.jsx(
|
|
1395
1395
|
xt,
|
|
1396
1396
|
{
|
|
1397
|
-
items: s.map((
|
|
1397
|
+
items: s.map((v) => String(v.listingId)),
|
|
1398
1398
|
strategy: _t,
|
|
1399
|
-
children: s.map((
|
|
1399
|
+
children: s.map((v) => M(v))
|
|
1400
1400
|
}
|
|
1401
1401
|
)
|
|
1402
1402
|
}
|
|
1403
|
-
) : s.map((
|
|
1404
|
-
|
|
1403
|
+
) : s.map((v) => M(v)),
|
|
1404
|
+
r && /* @__PURE__ */ t.jsx(
|
|
1405
1405
|
"div",
|
|
1406
1406
|
{
|
|
1407
1407
|
style: {
|
|
@@ -1416,25 +1416,25 @@ const Hn = (u) => {
|
|
|
1416
1416
|
className: W.button,
|
|
1417
1417
|
size: "s",
|
|
1418
1418
|
onClick: () => {
|
|
1419
|
-
const
|
|
1420
|
-
for (let
|
|
1421
|
-
if (!s.find((
|
|
1422
|
-
|
|
1423
|
-
listingId:
|
|
1424
|
-
image:
|
|
1419
|
+
const v = [...s];
|
|
1420
|
+
for (let A = 0; A < y.length; A++)
|
|
1421
|
+
if (!s.find((H) => H.listingId === y[A].id)) {
|
|
1422
|
+
v.push({
|
|
1423
|
+
listingId: y[A].id,
|
|
1424
|
+
image: y[A].productData.images.length > 0 ? y[A].productData.images[0].cfId : ""
|
|
1425
1425
|
});
|
|
1426
1426
|
break;
|
|
1427
1427
|
}
|
|
1428
|
-
|
|
1428
|
+
c(v);
|
|
1429
1429
|
},
|
|
1430
|
-
disabled: s.length === (
|
|
1430
|
+
disabled: s.length === (x || y.length),
|
|
1431
1431
|
style: {
|
|
1432
1432
|
width: "fit-content"
|
|
1433
1433
|
},
|
|
1434
1434
|
children: /* @__PURE__ */ t.jsxs("div", { className: W.addButton, children: [
|
|
1435
1435
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
1436
1436
|
/* @__PURE__ */ t.jsx(
|
|
1437
|
-
|
|
1437
|
+
j,
|
|
1438
1438
|
{
|
|
1439
1439
|
name: "Plus",
|
|
1440
1440
|
width: 16,
|
|
@@ -1447,64 +1447,64 @@ const Hn = (u) => {
|
|
|
1447
1447
|
}
|
|
1448
1448
|
)
|
|
1449
1449
|
] }),
|
|
1450
|
-
|
|
1450
|
+
p && i && /* @__PURE__ */ t.jsx(
|
|
1451
1451
|
ot,
|
|
1452
1452
|
{
|
|
1453
|
-
value:
|
|
1454
|
-
options: Object.keys(
|
|
1455
|
-
onChange: (
|
|
1456
|
-
leftAddonOptions:
|
|
1453
|
+
value: p,
|
|
1454
|
+
options: Object.keys(Tt),
|
|
1455
|
+
onChange: (v) => i(v),
|
|
1456
|
+
leftAddonOptions: wt
|
|
1457
1457
|
}
|
|
1458
1458
|
),
|
|
1459
|
-
|
|
1459
|
+
a && e !== void 0 && /* @__PURE__ */ t.jsx(
|
|
1460
1460
|
ht,
|
|
1461
1461
|
{
|
|
1462
1462
|
otherTitle: "Other",
|
|
1463
|
-
items:
|
|
1463
|
+
items: e
|
|
1464
1464
|
}
|
|
1465
1465
|
)
|
|
1466
1466
|
] });
|
|
1467
|
-
},
|
|
1468
|
-
options:
|
|
1469
|
-
price:
|
|
1470
|
-
oldPrice:
|
|
1471
|
-
newPrice:
|
|
1472
|
-
animate:
|
|
1473
|
-
meta:
|
|
1474
|
-
info:
|
|
1475
|
-
infoRight:
|
|
1476
|
-
buttons:
|
|
1477
|
-
variants:
|
|
1478
|
-
variant:
|
|
1479
|
-
stock:
|
|
1480
|
-
variantInfo:
|
|
1481
|
-
quantity:
|
|
1482
|
-
button:
|
|
1483
|
-
activeVariant:
|
|
1484
|
-
chargeTypes:
|
|
1485
|
-
charge:
|
|
1486
|
-
chargeActive:
|
|
1487
|
-
title:
|
|
1467
|
+
}, Ee = "_options_s4lx3_1", Re = "_price_s4lx3_18", Le = "_oldPrice_s4lx3_25", ze = "_newPrice_s4lx3_34", Ue = "_animate_s4lx3_42", Fe = "_meta_s4lx3_60", He = "_info_s4lx3_66", Ve = "_infoRight_s4lx3_75", Ye = "_buttons_s4lx3_82", Ge = "_variants_s4lx3_89", We = "_variant_s4lx3_89", Xe = "_stock_s4lx3_107", Qe = "_variantInfo_s4lx3_115", Je = "_quantity_s4lx3_122", Ke = "_button_s4lx3_82", Ze = "_activeVariant_s4lx3_168", ts = "_chargeTypes_s4lx3_172", es = "_charge_s4lx3_172", ss = "_chargeActive_s4lx3_197", ns = "_title_s4lx3_205", B = {
|
|
1468
|
+
options: Ee,
|
|
1469
|
+
price: Re,
|
|
1470
|
+
oldPrice: Le,
|
|
1471
|
+
newPrice: ze,
|
|
1472
|
+
animate: Ue,
|
|
1473
|
+
meta: Fe,
|
|
1474
|
+
info: He,
|
|
1475
|
+
infoRight: Ve,
|
|
1476
|
+
buttons: Ye,
|
|
1477
|
+
variants: Ge,
|
|
1478
|
+
variant: We,
|
|
1479
|
+
stock: Xe,
|
|
1480
|
+
variantInfo: Qe,
|
|
1481
|
+
quantity: Je,
|
|
1482
|
+
button: Ke,
|
|
1483
|
+
activeVariant: Ze,
|
|
1484
|
+
chargeTypes: ts,
|
|
1485
|
+
charge: es,
|
|
1486
|
+
chargeActive: ss,
|
|
1487
|
+
title: ns
|
|
1488
1488
|
};
|
|
1489
|
-
var
|
|
1490
|
-
const
|
|
1491
|
-
var
|
|
1492
|
-
const { product:
|
|
1489
|
+
var Ot = /* @__PURE__ */ ((h) => (h.ONE_TIME = "One-Time", h.RECURRING = "Subscribe & Save", h))(Ot || {});
|
|
1490
|
+
const is = (h) => {
|
|
1491
|
+
var K, F;
|
|
1492
|
+
const { product: a, setIsOpen: o, isCartEnabled: s = !0 } = h, { variants: c } = a, [e, u] = g.useState(c[0]), [d, f] = g.useState(
|
|
1493
1493
|
e.chargeTypes ? e.chargeTypes[0] : "ONE_TIME"
|
|
1494
|
-
), { notifications: _, setNotifications:
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
const
|
|
1498
|
-
return () => clearTimeout(
|
|
1499
|
-
}, [
|
|
1500
|
-
async function
|
|
1494
|
+
), { notifications: _, setNotifications: T } = Ct(), I = St(), [r, l] = g.useState(1), { cart: y, reset: x, addProductToCart: p } = ct(), [i, b] = g.useState(!1);
|
|
1495
|
+
g.useEffect(() => {
|
|
1496
|
+
b(!0);
|
|
1497
|
+
const n = setTimeout(() => b(!1), 600);
|
|
1498
|
+
return () => clearTimeout(n);
|
|
1499
|
+
}, [r]);
|
|
1500
|
+
async function w() {
|
|
1501
1501
|
try {
|
|
1502
|
-
|
|
1503
|
-
productId:
|
|
1502
|
+
p({
|
|
1503
|
+
productId: a.id,
|
|
1504
1504
|
productVariantId: e.id,
|
|
1505
|
-
chargeType:
|
|
1506
|
-
quantity:
|
|
1507
|
-
}),
|
|
1505
|
+
chargeType: d,
|
|
1506
|
+
quantity: r
|
|
1507
|
+
}), T([
|
|
1508
1508
|
..._,
|
|
1509
1509
|
{
|
|
1510
1510
|
id: J(),
|
|
@@ -1512,67 +1512,67 @@ const ns = (u) => {
|
|
|
1512
1512
|
status: "success"
|
|
1513
1513
|
}
|
|
1514
1514
|
]);
|
|
1515
|
-
} catch (
|
|
1516
|
-
|
|
1515
|
+
} catch (n) {
|
|
1516
|
+
T([
|
|
1517
1517
|
..._,
|
|
1518
1518
|
{
|
|
1519
1519
|
id: J(),
|
|
1520
|
-
message: `Product failed to add to cart: ${
|
|
1520
|
+
message: `Product failed to add to cart: ${n}`,
|
|
1521
1521
|
status: "error"
|
|
1522
1522
|
}
|
|
1523
1523
|
]);
|
|
1524
1524
|
}
|
|
1525
|
-
|
|
1525
|
+
o == null || o(!1);
|
|
1526
1526
|
}
|
|
1527
|
-
function
|
|
1528
|
-
|
|
1527
|
+
function q() {
|
|
1528
|
+
x(), w(), I("/checkout");
|
|
1529
1529
|
}
|
|
1530
|
-
function
|
|
1531
|
-
if (
|
|
1532
|
-
const
|
|
1533
|
-
return `${
|
|
1534
|
-
} else if (
|
|
1535
|
-
const
|
|
1536
|
-
return `${
|
|
1537
|
-
} else if (
|
|
1538
|
-
const
|
|
1539
|
-
return `${
|
|
1530
|
+
function E(n) {
|
|
1531
|
+
if (n >= 864e5) {
|
|
1532
|
+
const C = Math.floor(n / 864e5);
|
|
1533
|
+
return `${C} ${C === 1 ? "day" : "days"}`;
|
|
1534
|
+
} else if (n >= 36e5) {
|
|
1535
|
+
const C = Math.floor(n / 36e5);
|
|
1536
|
+
return `${C} ${C === 1 ? "hour" : "hours"}`;
|
|
1537
|
+
} else if (n >= 6e4) {
|
|
1538
|
+
const C = Math.floor(n / 6e4);
|
|
1539
|
+
return `${C} ${C === 1 ? "minute" : "minutes"}`;
|
|
1540
1540
|
} else {
|
|
1541
|
-
const
|
|
1542
|
-
return `${
|
|
1541
|
+
const C = Math.floor(n / 1e3);
|
|
1542
|
+
return `${C} ${C === 1 ? "second" : "seconds"}`;
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
1545
|
-
return
|
|
1546
|
-
e.quantity && e.quantity.available === 0 ?
|
|
1547
|
-
}, [e.quantity.available]),
|
|
1548
|
-
e.chargeTypes &&
|
|
1549
|
-
e.chargeTypes.includes(
|
|
1545
|
+
return g.useEffect(() => {
|
|
1546
|
+
e.quantity && e.quantity.available === 0 ? l(0) : l(1);
|
|
1547
|
+
}, [e.quantity.available]), g.useEffect(() => {
|
|
1548
|
+
e.chargeTypes && f(
|
|
1549
|
+
e.chargeTypes.includes(d) ? d : e.chargeTypes[0]
|
|
1550
1550
|
);
|
|
1551
1551
|
}, [e.chargeTypes]), /* @__PURE__ */ t.jsxs("div", { className: B.options, children: [
|
|
1552
|
-
e.chargeTypes && e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: B.chargeTypes, children: e.chargeTypes.map((
|
|
1552
|
+
e.chargeTypes && e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: B.chargeTypes, children: e.chargeTypes.map((n) => /* @__PURE__ */ t.jsx(
|
|
1553
1553
|
"div",
|
|
1554
1554
|
{
|
|
1555
|
-
className:
|
|
1556
|
-
[B.chargeActive]:
|
|
1555
|
+
className: U(B.charge, {
|
|
1556
|
+
[B.chargeActive]: d === n
|
|
1557
1557
|
}),
|
|
1558
|
-
onClick: () =>
|
|
1559
|
-
children:
|
|
1558
|
+
onClick: () => f(n),
|
|
1559
|
+
children: Ot[n]
|
|
1560
1560
|
},
|
|
1561
|
-
|
|
1561
|
+
n
|
|
1562
1562
|
)) }),
|
|
1563
|
-
/* @__PURE__ */ t.jsx("div", { className: B.variants, children:
|
|
1564
|
-
var
|
|
1565
|
-
return (
|
|
1566
|
-
}).map((
|
|
1567
|
-
var
|
|
1563
|
+
/* @__PURE__ */ t.jsx("div", { className: B.variants, children: c.filter((n) => {
|
|
1564
|
+
var N;
|
|
1565
|
+
return (N = n.chargeTypes) == null ? void 0 : N.includes(d);
|
|
1566
|
+
}).map((n) => {
|
|
1567
|
+
var N, S;
|
|
1568
1568
|
return /* @__PURE__ */ t.jsxs(
|
|
1569
1569
|
"div",
|
|
1570
1570
|
{
|
|
1571
|
-
className:
|
|
1572
|
-
[B.activeVariant]: e.id ===
|
|
1571
|
+
className: U(B.variant, {
|
|
1572
|
+
[B.activeVariant]: e.id === n.id
|
|
1573
1573
|
}),
|
|
1574
1574
|
onClick: () => {
|
|
1575
|
-
|
|
1575
|
+
u(n), l(1);
|
|
1576
1576
|
},
|
|
1577
1577
|
children: [
|
|
1578
1578
|
/* @__PURE__ */ t.jsxs("div", { className: B.variantInfo, children: [
|
|
@@ -1581,25 +1581,25 @@ const ns = (u) => {
|
|
|
1581
1581
|
{
|
|
1582
1582
|
className: B.title,
|
|
1583
1583
|
id: "h4",
|
|
1584
|
-
children: at(
|
|
1584
|
+
children: at(n.name)
|
|
1585
1585
|
}
|
|
1586
1586
|
),
|
|
1587
1587
|
/* @__PURE__ */ t.jsxs("span", { id: "md", children: [
|
|
1588
1588
|
Q({
|
|
1589
|
-
amount:
|
|
1590
|
-
currency:
|
|
1589
|
+
amount: d === "ONE_TIME" ? n.price.amount : n.subscriptionSettings ? n.subscriptionSettings.price.amount : 0,
|
|
1590
|
+
currency: d === "ONE_TIME" ? n.price.currency : n.subscriptionSettings ? n.subscriptionSettings.price.currency : "USD"
|
|
1591
1591
|
}),
|
|
1592
1592
|
" ",
|
|
1593
|
-
|
|
1593
|
+
d === "RECURRING" && n.subscriptionSettings && ` / ${Lt(n.subscriptionSettings.recurringIntervalDays || 0)}`
|
|
1594
1594
|
] })
|
|
1595
1595
|
] }),
|
|
1596
|
-
/* @__PURE__ */ t.jsx("div", { id: "md", children:
|
|
1596
|
+
/* @__PURE__ */ t.jsx("div", { id: "md", children: d === "ONE_TIME" && /* @__PURE__ */ t.jsxs(
|
|
1597
1597
|
"span",
|
|
1598
1598
|
{
|
|
1599
1599
|
className: B.stock,
|
|
1600
1600
|
id: "md",
|
|
1601
1601
|
children: [
|
|
1602
|
-
(
|
|
1602
|
+
(N = n.quantity.restrictions) != null && N.max || n.quantity.available !== void 0 ? ((S = n.quantity.restrictions) == null ? void 0 : S.max) || n.quantity.available : "∞",
|
|
1603
1603
|
" ",
|
|
1604
1604
|
"in stock"
|
|
1605
1605
|
]
|
|
@@ -1607,51 +1607,51 @@ const ns = (u) => {
|
|
|
1607
1607
|
) })
|
|
1608
1608
|
]
|
|
1609
1609
|
},
|
|
1610
|
-
|
|
1610
|
+
n.id
|
|
1611
1611
|
);
|
|
1612
1612
|
}) }),
|
|
1613
|
-
|
|
1613
|
+
d === "ONE_TIME" && /* @__PURE__ */ t.jsxs(
|
|
1614
1614
|
"div",
|
|
1615
1615
|
{
|
|
1616
1616
|
className: B.quantity,
|
|
1617
1617
|
id: "md",
|
|
1618
1618
|
children: [
|
|
1619
1619
|
/* @__PURE__ */ t.jsx(
|
|
1620
|
-
|
|
1620
|
+
R,
|
|
1621
1621
|
{
|
|
1622
1622
|
type: "Secondary",
|
|
1623
1623
|
onClick: () => {
|
|
1624
|
-
|
|
1624
|
+
r > 1 ? l((n) => n - 1) : l(1);
|
|
1625
1625
|
},
|
|
1626
1626
|
className: B.button,
|
|
1627
|
-
disabled: e.quantity.available && e.quantity.restrictions &&
|
|
1628
|
-
children: /* @__PURE__ */ t.jsx(
|
|
1627
|
+
disabled: e.quantity.available && e.quantity.restrictions && r <= e.quantity.restrictions.min || e.quantity.available === 0,
|
|
1628
|
+
children: /* @__PURE__ */ t.jsx(j, { name: "Minus" })
|
|
1629
1629
|
}
|
|
1630
1630
|
),
|
|
1631
1631
|
/* @__PURE__ */ t.jsx(
|
|
1632
|
-
|
|
1632
|
+
zt,
|
|
1633
1633
|
{
|
|
1634
1634
|
type: "number",
|
|
1635
|
-
value: String(
|
|
1636
|
-
onChange: (
|
|
1637
|
-
e.quantity.available && Number(
|
|
1635
|
+
value: String(r),
|
|
1636
|
+
onChange: (n) => {
|
|
1637
|
+
e.quantity.available && Number(n) > e.quantity.available ? l(e.quantity.available) : l(Number(n));
|
|
1638
1638
|
},
|
|
1639
|
-
max: ((
|
|
1640
|
-
min: ((
|
|
1639
|
+
max: ((K = e.quantity.restrictions) == null ? void 0 : K.max) || e.quantity.available || Number.POSITIVE_INFINITY,
|
|
1640
|
+
min: ((F = e.quantity.restrictions) == null ? void 0 : F.min) || 0,
|
|
1641
1641
|
centered: !0,
|
|
1642
|
-
disabled: e.quantity && e.quantity.available === 0 || Object.keys(e.quantity.restrictions || {}).length !== 0 &&
|
|
1642
|
+
disabled: e.quantity && e.quantity.available === 0 || Object.keys(e.quantity.restrictions || {}).length !== 0 && r >= e.quantity.restrictions.max
|
|
1643
1643
|
}
|
|
1644
1644
|
),
|
|
1645
1645
|
/* @__PURE__ */ t.jsx(
|
|
1646
|
-
|
|
1646
|
+
R,
|
|
1647
1647
|
{
|
|
1648
1648
|
type: "Secondary",
|
|
1649
1649
|
onClick: () => {
|
|
1650
|
-
|
|
1650
|
+
l((n) => n + 1);
|
|
1651
1651
|
},
|
|
1652
1652
|
className: B.button,
|
|
1653
|
-
disabled: !!(e.quantity.available && e.quantity.restrictions &&
|
|
1654
|
-
children: /* @__PURE__ */ t.jsx(
|
|
1653
|
+
disabled: !!(e.quantity.available && e.quantity.restrictions && r >= e.quantity.restrictions.max || e.quantity.available === 0 || e.quantity.available && r >= e.quantity.available),
|
|
1654
|
+
children: /* @__PURE__ */ t.jsx(j, { name: "Plus" })
|
|
1655
1655
|
}
|
|
1656
1656
|
)
|
|
1657
1657
|
]
|
|
@@ -1662,7 +1662,7 @@ const ns = (u) => {
|
|
|
1662
1662
|
/* @__PURE__ */ t.jsx("span", { id: "md", children: "Delivery" }),
|
|
1663
1663
|
/* @__PURE__ */ t.jsxs("div", { className: B.infoRight, children: [
|
|
1664
1664
|
/* @__PURE__ */ t.jsx(
|
|
1665
|
-
|
|
1665
|
+
j,
|
|
1666
1666
|
{
|
|
1667
1667
|
name: "Lightning",
|
|
1668
1668
|
fill: "var(--text-action)",
|
|
@@ -1670,19 +1670,19 @@ const ns = (u) => {
|
|
|
1670
1670
|
height: 20
|
|
1671
1671
|
}
|
|
1672
1672
|
),
|
|
1673
|
-
/* @__PURE__ */ t.jsx("span", { id: "md", children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" :
|
|
1673
|
+
/* @__PURE__ */ t.jsx("span", { id: "md", children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" : E(e.deliveryTime) })
|
|
1674
1674
|
] })
|
|
1675
1675
|
] }),
|
|
1676
1676
|
/* @__PURE__ */ t.jsxs("div", { className: B.info, children: [
|
|
1677
1677
|
/* @__PURE__ */ t.jsx("span", { id: "md", children: "Price" }),
|
|
1678
|
-
/* @__PURE__ */ t.jsx("div", { className: B.infoRight, children:
|
|
1678
|
+
/* @__PURE__ */ t.jsx("div", { className: B.infoRight, children: d === "ONE_TIME" ? e.compareAtPrice && (e.compareAtPrice.amount || 0) - (e.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs(
|
|
1679
1679
|
"div",
|
|
1680
1680
|
{
|
|
1681
1681
|
className: B.price,
|
|
1682
1682
|
id: "md",
|
|
1683
1683
|
children: [
|
|
1684
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
1685
|
-
amount: e.price.amount *
|
|
1684
|
+
/* @__PURE__ */ t.jsx("span", { className: U(B.newPrice, { [B.animate]: i }), children: Q({
|
|
1685
|
+
amount: e.price.amount * r,
|
|
1686
1686
|
currency: e.price.currency
|
|
1687
1687
|
}) }),
|
|
1688
1688
|
/* @__PURE__ */ t.jsx(
|
|
@@ -1691,7 +1691,7 @@ const ns = (u) => {
|
|
|
1691
1691
|
className: B.oldPrice,
|
|
1692
1692
|
id: "md",
|
|
1693
1693
|
children: Q({
|
|
1694
|
-
amount: e.compareAtPrice.amount *
|
|
1694
|
+
amount: e.compareAtPrice.amount * r,
|
|
1695
1695
|
currency: e.compareAtPrice.currency
|
|
1696
1696
|
})
|
|
1697
1697
|
}
|
|
@@ -1701,10 +1701,10 @@ const ns = (u) => {
|
|
|
1701
1701
|
) : /* @__PURE__ */ t.jsx(
|
|
1702
1702
|
"span",
|
|
1703
1703
|
{
|
|
1704
|
-
className:
|
|
1704
|
+
className: U(B.newPrice, { [B.animate]: i }),
|
|
1705
1705
|
id: "md",
|
|
1706
1706
|
children: Q({
|
|
1707
|
-
amount: e.price.amount *
|
|
1707
|
+
amount: e.price.amount * r,
|
|
1708
1708
|
currency: e.price.currency
|
|
1709
1709
|
})
|
|
1710
1710
|
}
|
|
@@ -1717,10 +1717,10 @@ const ns = (u) => {
|
|
|
1717
1717
|
/* @__PURE__ */ t.jsx(
|
|
1718
1718
|
"span",
|
|
1719
1719
|
{
|
|
1720
|
-
className:
|
|
1720
|
+
className: U(B.newPrice, { [B.animate]: i }),
|
|
1721
1721
|
id: "md",
|
|
1722
1722
|
children: Q({
|
|
1723
|
-
amount: e.subscriptionSettings.price.amount *
|
|
1723
|
+
amount: e.subscriptionSettings.price.amount * r,
|
|
1724
1724
|
currency: e.subscriptionSettings.price.currency
|
|
1725
1725
|
})
|
|
1726
1726
|
}
|
|
@@ -1731,7 +1731,7 @@ const ns = (u) => {
|
|
|
1731
1731
|
className: B.oldPrice,
|
|
1732
1732
|
id: "md",
|
|
1733
1733
|
children: Q({
|
|
1734
|
-
amount: e.subscriptionSettings.compareAtPrice.amount *
|
|
1734
|
+
amount: e.subscriptionSettings.compareAtPrice.amount * r,
|
|
1735
1735
|
currency: e.subscriptionSettings.compareAtPrice.currency
|
|
1736
1736
|
})
|
|
1737
1737
|
}
|
|
@@ -1741,10 +1741,10 @@ const ns = (u) => {
|
|
|
1741
1741
|
) : e.subscriptionSettings && /* @__PURE__ */ t.jsx(
|
|
1742
1742
|
"span",
|
|
1743
1743
|
{
|
|
1744
|
-
className:
|
|
1744
|
+
className: U(B.newPrice, { [B.animate]: i }),
|
|
1745
1745
|
id: "md",
|
|
1746
1746
|
children: Q({
|
|
1747
|
-
amount: e.subscriptionSettings.price.amount *
|
|
1747
|
+
amount: e.subscriptionSettings.price.amount * r,
|
|
1748
1748
|
currency: e.subscriptionSettings.price.currency
|
|
1749
1749
|
})
|
|
1750
1750
|
}
|
|
@@ -1753,142 +1753,142 @@ const ns = (u) => {
|
|
|
1753
1753
|
] }),
|
|
1754
1754
|
/* @__PURE__ */ t.jsxs("div", { className: B.buttons, children: [
|
|
1755
1755
|
/* @__PURE__ */ t.jsx(
|
|
1756
|
-
|
|
1756
|
+
R,
|
|
1757
1757
|
{
|
|
1758
1758
|
type: "Primary",
|
|
1759
|
-
onClick: () =>
|
|
1759
|
+
onClick: () => q(),
|
|
1760
1760
|
disabled: e.quantity && e.quantity.available === 0,
|
|
1761
|
-
children:
|
|
1761
|
+
children: d === "ONE_TIME" ? "Buy Now" : "Subscribe Now"
|
|
1762
1762
|
}
|
|
1763
1763
|
),
|
|
1764
|
-
|
|
1765
|
-
|
|
1764
|
+
d === "ONE_TIME" && s && /* @__PURE__ */ t.jsx(
|
|
1765
|
+
R,
|
|
1766
1766
|
{
|
|
1767
1767
|
type: "Secondary",
|
|
1768
|
-
onClick: () =>
|
|
1768
|
+
onClick: () => w(),
|
|
1769
1769
|
disabled: e.quantity && e.quantity.available === 0,
|
|
1770
|
-
children:
|
|
1771
|
-
(
|
|
1770
|
+
children: y.parts.some(
|
|
1771
|
+
(n) => n.productId === a.id && n.productVariantId === e.id
|
|
1772
1772
|
) ? "Add More" : "Add to Cart"
|
|
1773
1773
|
}
|
|
1774
1774
|
)
|
|
1775
1775
|
] })
|
|
1776
1776
|
] });
|
|
1777
|
-
},
|
|
1778
|
-
buttons:
|
|
1779
|
-
modal:
|
|
1780
|
-
closing:
|
|
1781
|
-
info:
|
|
1782
|
-
top:
|
|
1783
|
-
title:
|
|
1784
|
-
clear:
|
|
1785
|
-
activeClear:
|
|
1786
|
-
count:
|
|
1787
|
-
cart:
|
|
1788
|
-
empty:
|
|
1789
|
-
product:
|
|
1790
|
-
products:
|
|
1791
|
-
image:
|
|
1792
|
-
productInfo:
|
|
1793
|
-
content:
|
|
1794
|
-
name:
|
|
1777
|
+
}, as = "_buttons_1uy6y_23", os = "_modal_1uy6y_32", cs = "_closing_1uy6y_65", rs = "_info_1uy6y_114", ls = "_top_1uy6y_121", ds = "_title_1uy6y_132", us = "_clear_1uy6y_139", hs = "_activeClear_1uy6y_146", ps = "_count_1uy6y_150", ms = "_cart_1uy6y_165", gs = "_empty_1uy6y_173", fs = "_product_1uy6y_199", xs = "_products_1uy6y_208", _s = "_image_1uy6y_216", ys = "_productInfo_1uy6y_233", js = "_content_1uy6y_240", bs = "_name_1uy6y_246", vs = "_price_1uy6y_252", Is = "_productButtons_1uy6y_258", Ns = "_productButton_1uy6y_258", Cs = "_productCount_1uy6y_275", Ss = "_bottom_1uy6y_292", Ps = "_subtotal_1uy6y_300", ks = "_block_1uy6y_308", ws = "_shoppingCount_1uy6y_315", Ts = "_total_1uy6y_335", Ms = "_link_1uy6y_341", Bs = "_userInfo_1uy6y_348", $s = "_pagesMobileModal_1uy6y_360", Os = "_pagesMobileModalContent_1uy6y_374", qs = "_pagesMobileModalHeader_1uy6y_380", As = "_pagesMobileModalFooter_1uy6y_390", Ds = "_pageLink_1uy6y_397", Es = "_rightButtons_1uy6y_406", k = {
|
|
1778
|
+
buttons: as,
|
|
1779
|
+
modal: os,
|
|
1780
|
+
closing: cs,
|
|
1781
|
+
info: rs,
|
|
1782
|
+
top: ls,
|
|
1783
|
+
title: ds,
|
|
1784
|
+
clear: us,
|
|
1785
|
+
activeClear: hs,
|
|
1786
|
+
count: ps,
|
|
1787
|
+
cart: ms,
|
|
1788
|
+
empty: gs,
|
|
1789
|
+
product: fs,
|
|
1790
|
+
products: xs,
|
|
1791
|
+
image: _s,
|
|
1792
|
+
productInfo: ys,
|
|
1793
|
+
content: js,
|
|
1794
|
+
name: bs,
|
|
1795
1795
|
price: vs,
|
|
1796
|
-
productButtons:
|
|
1797
|
-
productButton:
|
|
1798
|
-
productCount:
|
|
1796
|
+
productButtons: Is,
|
|
1797
|
+
productButton: Ns,
|
|
1798
|
+
productCount: Cs,
|
|
1799
1799
|
bottom: Ss,
|
|
1800
|
-
subtotal:
|
|
1801
|
-
block:
|
|
1802
|
-
shoppingCount:
|
|
1803
|
-
total:
|
|
1804
|
-
link:
|
|
1805
|
-
userInfo:
|
|
1806
|
-
pagesMobileModal:
|
|
1807
|
-
pagesMobileModalContent:
|
|
1808
|
-
pagesMobileModalHeader:
|
|
1809
|
-
pagesMobileModalFooter:
|
|
1810
|
-
pageLink:
|
|
1811
|
-
rightButtons:
|
|
1800
|
+
subtotal: Ps,
|
|
1801
|
+
block: ks,
|
|
1802
|
+
shoppingCount: ws,
|
|
1803
|
+
total: Ts,
|
|
1804
|
+
link: Ms,
|
|
1805
|
+
userInfo: Bs,
|
|
1806
|
+
pagesMobileModal: $s,
|
|
1807
|
+
pagesMobileModalContent: Os,
|
|
1808
|
+
pagesMobileModalHeader: qs,
|
|
1809
|
+
pagesMobileModalFooter: As,
|
|
1810
|
+
pageLink: Ds,
|
|
1811
|
+
rightButtons: Es,
|
|
1812
1812
|
delete: "_delete_1uy6y_413"
|
|
1813
|
-
},
|
|
1814
|
-
const { shopping:
|
|
1815
|
-
return /* @__PURE__ */ t.jsx(t.Fragment, { children: (
|
|
1816
|
-
|
|
1817
|
-
s && /* @__PURE__ */ t.jsx(
|
|
1813
|
+
}, Yn = (h) => {
|
|
1814
|
+
const { shopping: a, signUp: o, isShowUserInfo: s = !0 } = h;
|
|
1815
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: (a || s) && /* @__PURE__ */ t.jsxs("div", { className: k.buttons, children: [
|
|
1816
|
+
a && /* @__PURE__ */ t.jsx(Rs, {}),
|
|
1817
|
+
s && /* @__PURE__ */ t.jsx(qt, { signUp: o })
|
|
1818
1818
|
] }) });
|
|
1819
|
-
},
|
|
1820
|
-
const [
|
|
1821
|
-
|
|
1819
|
+
}, Rs = () => {
|
|
1820
|
+
const [h, a] = g.useState(!1), [o, s] = g.useState([]), [c, e] = g.useState(!1), { cart: u, products: d } = ct();
|
|
1821
|
+
g.useEffect(() => {
|
|
1822
1822
|
(async () => {
|
|
1823
|
-
const
|
|
1824
|
-
const
|
|
1825
|
-
return
|
|
1826
|
-
...
|
|
1827
|
-
activeVariantId:
|
|
1828
|
-
quantity:
|
|
1829
|
-
chargeType:
|
|
1823
|
+
const r = u.parts.map((x) => String(x.productId)), l = d.filter((x) => r.includes(String(x.id))) || [], y = u.parts.map((x) => {
|
|
1824
|
+
const p = l.find((i) => i.id === x.productId);
|
|
1825
|
+
return p ? {
|
|
1826
|
+
...p,
|
|
1827
|
+
activeVariantId: x.productVariantId,
|
|
1828
|
+
quantity: x.quantity,
|
|
1829
|
+
chargeType: x.chargeType
|
|
1830
1830
|
} : null;
|
|
1831
1831
|
}).filter(Boolean);
|
|
1832
|
-
s(
|
|
1832
|
+
s(y);
|
|
1833
1833
|
})();
|
|
1834
|
-
}, [
|
|
1835
|
-
function
|
|
1836
|
-
return !
|
|
1834
|
+
}, [u.parts, d]);
|
|
1835
|
+
function f(I) {
|
|
1836
|
+
return !I || !(I != null && I.variants) ? !1 : I.chargeType === "RECURRING";
|
|
1837
1837
|
}
|
|
1838
|
-
const
|
|
1838
|
+
const _ = u.parts.length > 0 && o.length > 0 && !f(o[0]);
|
|
1839
1839
|
function T() {
|
|
1840
|
-
|
|
1841
|
-
|
|
1840
|
+
e(!1), setTimeout(() => {
|
|
1841
|
+
a(!1);
|
|
1842
1842
|
}, 300);
|
|
1843
1843
|
}
|
|
1844
1844
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1845
1845
|
/* @__PURE__ */ t.jsxs(
|
|
1846
|
-
|
|
1846
|
+
R,
|
|
1847
1847
|
{
|
|
1848
1848
|
type: "Secondary",
|
|
1849
1849
|
style: {
|
|
1850
1850
|
padding: 10,
|
|
1851
1851
|
position: "relative"
|
|
1852
1852
|
},
|
|
1853
|
-
onClick: (
|
|
1854
|
-
|
|
1853
|
+
onClick: (I) => {
|
|
1854
|
+
I.stopPropagation(), window.location.pathname.includes("/admin/builder") || (a(!0), e(!0));
|
|
1855
1855
|
},
|
|
1856
1856
|
children: [
|
|
1857
1857
|
/* @__PURE__ */ t.jsx(
|
|
1858
|
-
|
|
1858
|
+
j,
|
|
1859
1859
|
{
|
|
1860
1860
|
name: "Handbag"
|
|
1861
1861
|
}
|
|
1862
1862
|
),
|
|
1863
|
-
|
|
1863
|
+
_ && /* @__PURE__ */ t.jsx("div", { className: k.shoppingCount, children: u.parts.length })
|
|
1864
1864
|
]
|
|
1865
1865
|
}
|
|
1866
1866
|
),
|
|
1867
|
-
|
|
1867
|
+
h && /* @__PURE__ */ t.jsx(
|
|
1868
1868
|
ut,
|
|
1869
1869
|
{
|
|
1870
1870
|
close: T,
|
|
1871
1871
|
withAnimation: !1,
|
|
1872
1872
|
children: /* @__PURE__ */ t.jsx(
|
|
1873
|
-
|
|
1873
|
+
Ls,
|
|
1874
1874
|
{
|
|
1875
|
-
activeProducts:
|
|
1876
|
-
isCartNotEmpty:
|
|
1877
|
-
isOpen:
|
|
1875
|
+
activeProducts: o,
|
|
1876
|
+
isCartNotEmpty: _,
|
|
1877
|
+
isOpen: c,
|
|
1878
1878
|
close: T
|
|
1879
1879
|
}
|
|
1880
1880
|
)
|
|
1881
1881
|
}
|
|
1882
1882
|
)
|
|
1883
1883
|
] });
|
|
1884
|
-
},
|
|
1885
|
-
var
|
|
1886
|
-
const { activeProducts:
|
|
1887
|
-
function
|
|
1888
|
-
T(i, { replace:
|
|
1884
|
+
}, Ls = (h) => {
|
|
1885
|
+
var x, p;
|
|
1886
|
+
const { activeProducts: a, isCartNotEmpty: o, isOpen: s, close: c } = h, { cart: e, reset: u, getTotalAndDiscount: d, updateQuantityOfProduct: f, removeProduct: _ } = ct(), T = St();
|
|
1887
|
+
function I(i, b) {
|
|
1888
|
+
T(i, { replace: b });
|
|
1889
1889
|
}
|
|
1890
|
-
function
|
|
1891
|
-
i.quantity &&
|
|
1890
|
+
function r(i) {
|
|
1891
|
+
i.quantity && f({
|
|
1892
1892
|
productId: i.id,
|
|
1893
1893
|
productVariantId: i.activeVariantId,
|
|
1894
1894
|
quantity: i.quantity + 1,
|
|
@@ -1896,15 +1896,15 @@ const ns = (u) => {
|
|
|
1896
1896
|
});
|
|
1897
1897
|
}
|
|
1898
1898
|
function l(i) {
|
|
1899
|
-
i.quantity &&
|
|
1899
|
+
i.quantity && f({
|
|
1900
1900
|
productId: i.id,
|
|
1901
1901
|
productVariantId: i.activeVariantId,
|
|
1902
1902
|
quantity: i.quantity - 1,
|
|
1903
1903
|
chargeType: i.chargeType
|
|
1904
1904
|
});
|
|
1905
1905
|
}
|
|
1906
|
-
function
|
|
1907
|
-
|
|
1906
|
+
function y(i) {
|
|
1907
|
+
_({
|
|
1908
1908
|
productId: i.id,
|
|
1909
1909
|
productVariantId: i.activeVariantId,
|
|
1910
1910
|
quantity: i.quantity || 1,
|
|
@@ -1914,7 +1914,7 @@ const ns = (u) => {
|
|
|
1914
1914
|
return /* @__PURE__ */ t.jsxs(
|
|
1915
1915
|
"div",
|
|
1916
1916
|
{
|
|
1917
|
-
className:
|
|
1917
|
+
className: U(k.modal, {
|
|
1918
1918
|
[k.closing]: !s
|
|
1919
1919
|
}),
|
|
1920
1920
|
onClick: (i) => i.stopPropagation(),
|
|
@@ -1929,33 +1929,33 @@ const ns = (u) => {
|
|
|
1929
1929
|
children: "Cart"
|
|
1930
1930
|
}
|
|
1931
1931
|
),
|
|
1932
|
-
|
|
1932
|
+
o && /* @__PURE__ */ t.jsx(
|
|
1933
1933
|
"div",
|
|
1934
1934
|
{
|
|
1935
1935
|
className: k.count,
|
|
1936
1936
|
id: "md",
|
|
1937
|
-
children:
|
|
1937
|
+
children: e.parts.length
|
|
1938
1938
|
}
|
|
1939
1939
|
)
|
|
1940
1940
|
] }),
|
|
1941
1941
|
/* @__PURE__ */ t.jsxs("div", { className: k.rightButtons, children: [
|
|
1942
|
-
|
|
1942
|
+
o && /* @__PURE__ */ t.jsx(
|
|
1943
1943
|
"button",
|
|
1944
1944
|
{
|
|
1945
|
-
className:
|
|
1946
|
-
[k.activeClear]:
|
|
1945
|
+
className: U(k.clear, {
|
|
1946
|
+
[k.activeClear]: o
|
|
1947
1947
|
}),
|
|
1948
|
-
disabled: !
|
|
1949
|
-
onClick:
|
|
1948
|
+
disabled: !o,
|
|
1949
|
+
onClick: u,
|
|
1950
1950
|
id: "md",
|
|
1951
1951
|
children: "Clear all"
|
|
1952
1952
|
}
|
|
1953
1953
|
),
|
|
1954
1954
|
/* @__PURE__ */ t.jsx(
|
|
1955
|
-
|
|
1955
|
+
j,
|
|
1956
1956
|
{
|
|
1957
1957
|
name: "X",
|
|
1958
|
-
onClick:
|
|
1958
|
+
onClick: c,
|
|
1959
1959
|
hoverable: !0,
|
|
1960
1960
|
width: 24,
|
|
1961
1961
|
height: 24,
|
|
@@ -1964,9 +1964,9 @@ const ns = (u) => {
|
|
|
1964
1964
|
)
|
|
1965
1965
|
] })
|
|
1966
1966
|
] }),
|
|
1967
|
-
|
|
1968
|
-
/* @__PURE__ */ t.jsx("div", { className: k.products, children:
|
|
1969
|
-
var
|
|
1967
|
+
o ? /* @__PURE__ */ t.jsxs("div", { className: k.cart, children: [
|
|
1968
|
+
/* @__PURE__ */ t.jsx("div", { className: k.products, children: a.map((i) => {
|
|
1969
|
+
var b, w;
|
|
1970
1970
|
return /* @__PURE__ */ t.jsxs(
|
|
1971
1971
|
"div",
|
|
1972
1972
|
{
|
|
@@ -1983,7 +1983,7 @@ const ns = (u) => {
|
|
|
1983
1983
|
className: k.image
|
|
1984
1984
|
}
|
|
1985
1985
|
) : /* @__PURE__ */ t.jsx("div", { className: k.image, children: /* @__PURE__ */ t.jsx(
|
|
1986
|
-
|
|
1986
|
+
j,
|
|
1987
1987
|
{
|
|
1988
1988
|
name: "Image",
|
|
1989
1989
|
fill: "var(--text-secondary)"
|
|
@@ -1991,7 +1991,7 @@ const ns = (u) => {
|
|
|
1991
1991
|
) }),
|
|
1992
1992
|
/* @__PURE__ */ t.jsxs("div", { className: k.content, children: [
|
|
1993
1993
|
/* @__PURE__ */ t.jsx("div", { className: k.name, children: at(
|
|
1994
|
-
((
|
|
1994
|
+
((b = i.variants.find((q) => q.id === i.activeVariantId)) == null ? void 0 : b.name) || i.name
|
|
1995
1995
|
) }),
|
|
1996
1996
|
/* @__PURE__ */ t.jsx("div", { className: k.price, children: Q({
|
|
1997
1997
|
amount: i.variants.find(
|
|
@@ -2005,7 +2005,7 @@ const ns = (u) => {
|
|
|
2005
2005
|
] }),
|
|
2006
2006
|
/* @__PURE__ */ t.jsxs("div", { className: k.productButtons, children: [
|
|
2007
2007
|
/* @__PURE__ */ t.jsx(
|
|
2008
|
-
|
|
2008
|
+
R,
|
|
2009
2009
|
{
|
|
2010
2010
|
type: "Secondary",
|
|
2011
2011
|
onClick: () => {
|
|
@@ -2014,7 +2014,7 @@ const ns = (u) => {
|
|
|
2014
2014
|
className: k.productButton,
|
|
2015
2015
|
disabled: i.quantity === 1,
|
|
2016
2016
|
children: /* @__PURE__ */ t.jsx(
|
|
2017
|
-
|
|
2017
|
+
j,
|
|
2018
2018
|
{
|
|
2019
2019
|
name: "Minus",
|
|
2020
2020
|
fill: "#757575",
|
|
@@ -2031,14 +2031,14 @@ const ns = (u) => {
|
|
|
2031
2031
|
type: "number",
|
|
2032
2032
|
value: ((w = i.quantity) == null ? void 0 : w.toString()) || "",
|
|
2033
2033
|
onChange: (q) => {
|
|
2034
|
-
const
|
|
2034
|
+
const E = Math.min(
|
|
2035
2035
|
Number(q.target.value),
|
|
2036
2036
|
i.variants.find((K) => K.id === i.activeVariantId).quantity.available || 1 / 0
|
|
2037
2037
|
);
|
|
2038
|
-
|
|
2038
|
+
E < 1 || f({
|
|
2039
2039
|
productId: i.id,
|
|
2040
2040
|
productVariantId: i.activeVariantId,
|
|
2041
|
-
quantity:
|
|
2041
|
+
quantity: E,
|
|
2042
2042
|
chargeType: i.chargeType
|
|
2043
2043
|
});
|
|
2044
2044
|
},
|
|
@@ -2047,14 +2047,14 @@ const ns = (u) => {
|
|
|
2047
2047
|
}
|
|
2048
2048
|
),
|
|
2049
2049
|
/* @__PURE__ */ t.jsx(
|
|
2050
|
-
|
|
2050
|
+
R,
|
|
2051
2051
|
{
|
|
2052
2052
|
type: "Secondary",
|
|
2053
|
-
onClick: () =>
|
|
2053
|
+
onClick: () => r(i),
|
|
2054
2054
|
className: k.productButton,
|
|
2055
2055
|
disabled: i.quantity === i.variants.find((q) => q.id === i.activeVariantId).quantity.available,
|
|
2056
2056
|
children: /* @__PURE__ */ t.jsx(
|
|
2057
|
-
|
|
2057
|
+
j,
|
|
2058
2058
|
{
|
|
2059
2059
|
name: "Plus",
|
|
2060
2060
|
fill: "#757575",
|
|
@@ -2065,13 +2065,13 @@ const ns = (u) => {
|
|
|
2065
2065
|
}
|
|
2066
2066
|
),
|
|
2067
2067
|
/* @__PURE__ */ t.jsx("div", { className: k.delete, children: /* @__PURE__ */ t.jsx(
|
|
2068
|
-
|
|
2068
|
+
j,
|
|
2069
2069
|
{
|
|
2070
2070
|
name: "Trash",
|
|
2071
2071
|
fill: "var(--text-action)",
|
|
2072
2072
|
width: 20,
|
|
2073
2073
|
height: 20,
|
|
2074
|
-
onClick: () =>
|
|
2074
|
+
onClick: () => y(i),
|
|
2075
2075
|
hoverable: !0
|
|
2076
2076
|
}
|
|
2077
2077
|
) })
|
|
@@ -2086,7 +2086,7 @@ const ns = (u) => {
|
|
|
2086
2086
|
/* @__PURE__ */ t.jsxs("div", { className: k.block, children: [
|
|
2087
2087
|
/* @__PURE__ */ t.jsx("span", { children: "Subtotal" }),
|
|
2088
2088
|
/* @__PURE__ */ t.jsx(
|
|
2089
|
-
|
|
2089
|
+
j,
|
|
2090
2090
|
{
|
|
2091
2091
|
name: "Info",
|
|
2092
2092
|
width: 20,
|
|
@@ -2096,19 +2096,19 @@ const ns = (u) => {
|
|
|
2096
2096
|
)
|
|
2097
2097
|
] }),
|
|
2098
2098
|
/* @__PURE__ */ t.jsx("div", { className: k.total, children: Q({
|
|
2099
|
-
amount:
|
|
2100
|
-
currency:
|
|
2099
|
+
amount: d().total,
|
|
2100
|
+
currency: e.parts.length > 0 && ((p = (x = a.find((i) => i.id === e.parts[0].productId)) == null ? void 0 : x.variants.find((i) => i.id === e.parts[0].productVariantId)) == null ? void 0 : p.price.currency) || "USD"
|
|
2101
2101
|
}) })
|
|
2102
2102
|
] }),
|
|
2103
|
-
/* @__PURE__ */ t.jsx(
|
|
2103
|
+
/* @__PURE__ */ t.jsx(R, { onClick: () => I("/checkout", !1), children: "Checkout" })
|
|
2104
2104
|
] })
|
|
2105
|
-
] }) : /* @__PURE__ */ t.jsx(
|
|
2105
|
+
] }) : /* @__PURE__ */ t.jsx(zs, {})
|
|
2106
2106
|
]
|
|
2107
2107
|
}
|
|
2108
2108
|
);
|
|
2109
|
-
},
|
|
2109
|
+
}, zs = () => /* @__PURE__ */ t.jsxs("div", { className: k.empty, children: [
|
|
2110
2110
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
2111
|
-
|
|
2111
|
+
j,
|
|
2112
2112
|
{
|
|
2113
2113
|
name: "Handbag",
|
|
2114
2114
|
fill: "var(--text-secondary)"
|
|
@@ -2128,34 +2128,34 @@ const ns = (u) => {
|
|
|
2128
2128
|
}
|
|
2129
2129
|
)
|
|
2130
2130
|
] })
|
|
2131
|
-
] }),
|
|
2132
|
-
const { token:
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
if (!
|
|
2136
|
-
const
|
|
2137
|
-
|
|
2131
|
+
] }), qt = ({ signUp: h, close: a }) => {
|
|
2132
|
+
const { token: o } = Ut(), s = St(), [c, e] = g.useState("test-email@gmail.com");
|
|
2133
|
+
g.useEffect(() => {
|
|
2134
|
+
o && (async () => {
|
|
2135
|
+
if (!o) return;
|
|
2136
|
+
const f = Ft(o);
|
|
2137
|
+
e(f.email);
|
|
2138
2138
|
})();
|
|
2139
|
-
}, [
|
|
2140
|
-
function
|
|
2141
|
-
window.location.pathname.includes("/admin/builder") || s(
|
|
2139
|
+
}, [o]);
|
|
2140
|
+
function u(d) {
|
|
2141
|
+
window.location.pathname.includes("/admin/builder") || s(d);
|
|
2142
2142
|
}
|
|
2143
|
-
return
|
|
2144
|
-
|
|
2143
|
+
return o ? /* @__PURE__ */ t.jsx(
|
|
2144
|
+
R,
|
|
2145
2145
|
{
|
|
2146
2146
|
type: "Secondary",
|
|
2147
2147
|
className: k.userInfo,
|
|
2148
2148
|
onClick: () => {
|
|
2149
|
-
|
|
2149
|
+
u("/customer-dash"), a == null || a();
|
|
2150
2150
|
},
|
|
2151
|
-
children: /* @__PURE__ */ t.jsx("div", { children:
|
|
2151
|
+
children: /* @__PURE__ */ t.jsx("div", { children: c || "test-email@gmail.com" })
|
|
2152
2152
|
}
|
|
2153
2153
|
) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2154
2154
|
/* @__PURE__ */ t.jsx(
|
|
2155
|
-
|
|
2155
|
+
R,
|
|
2156
2156
|
{
|
|
2157
2157
|
onClick: () => {
|
|
2158
|
-
|
|
2158
|
+
u("/customer-dash"), a == null || a();
|
|
2159
2159
|
},
|
|
2160
2160
|
type: "Secondary",
|
|
2161
2161
|
style: {
|
|
@@ -2164,11 +2164,11 @@ const ns = (u) => {
|
|
|
2164
2164
|
children: "Login"
|
|
2165
2165
|
}
|
|
2166
2166
|
),
|
|
2167
|
-
|
|
2168
|
-
|
|
2167
|
+
h && /* @__PURE__ */ t.jsx(
|
|
2168
|
+
R,
|
|
2169
2169
|
{
|
|
2170
2170
|
onClick: () => {
|
|
2171
|
-
|
|
2171
|
+
u("/customer-dash"), a == null || a();
|
|
2172
2172
|
},
|
|
2173
2173
|
type: "Primary",
|
|
2174
2174
|
style: {
|
|
@@ -2179,120 +2179,120 @@ const ns = (u) => {
|
|
|
2179
2179
|
}
|
|
2180
2180
|
)
|
|
2181
2181
|
] });
|
|
2182
|
-
},
|
|
2183
|
-
logo:
|
|
2184
|
-
setIsOpen:
|
|
2185
|
-
signUp:
|
|
2182
|
+
}, Us = ({
|
|
2183
|
+
logo: h,
|
|
2184
|
+
setIsOpen: a,
|
|
2185
|
+
signUp: o,
|
|
2186
2186
|
pages: s
|
|
2187
2187
|
}) => {
|
|
2188
|
-
const { setIsOpen:
|
|
2189
|
-
|
|
2190
|
-
|
|
2188
|
+
const { setIsOpen: c } = rt(), e = () => {
|
|
2189
|
+
c(!1), setTimeout(() => {
|
|
2190
|
+
a(!1), c(!0);
|
|
2191
2191
|
}, 300);
|
|
2192
2192
|
};
|
|
2193
2193
|
return /* @__PURE__ */ t.jsxs(
|
|
2194
2194
|
"div",
|
|
2195
2195
|
{
|
|
2196
2196
|
className: k.pagesMobileModal,
|
|
2197
|
-
onClick: (
|
|
2197
|
+
onClick: (u) => u.stopPropagation(),
|
|
2198
2198
|
children: [
|
|
2199
2199
|
/* @__PURE__ */ t.jsxs("div", { className: k.pagesMobileModalHeader, children: [
|
|
2200
|
-
/* @__PURE__ */ t.jsx("div", { children:
|
|
2200
|
+
/* @__PURE__ */ t.jsx("div", { children: h }),
|
|
2201
2201
|
/* @__PURE__ */ t.jsx(
|
|
2202
|
-
|
|
2202
|
+
R,
|
|
2203
2203
|
{
|
|
2204
2204
|
type: "Secondary",
|
|
2205
|
-
onClick:
|
|
2206
|
-
children: /* @__PURE__ */ t.jsx(
|
|
2205
|
+
onClick: e,
|
|
2206
|
+
children: /* @__PURE__ */ t.jsx(j, { name: "X" })
|
|
2207
2207
|
}
|
|
2208
2208
|
)
|
|
2209
2209
|
] }),
|
|
2210
|
-
/* @__PURE__ */ t.jsx("div", { className: k.pagesMobileModalContent, children: s.length > 0 && s.map((
|
|
2210
|
+
/* @__PURE__ */ t.jsx("div", { className: k.pagesMobileModalContent, children: s.length > 0 && s.map((u) => /* @__PURE__ */ t.jsx(
|
|
2211
2211
|
"div",
|
|
2212
2212
|
{
|
|
2213
2213
|
className: k.pageLink,
|
|
2214
|
-
onClick:
|
|
2214
|
+
onClick: e,
|
|
2215
2215
|
children: /* @__PURE__ */ t.jsx(
|
|
2216
|
-
|
|
2216
|
+
Mt,
|
|
2217
2217
|
{
|
|
2218
|
-
path:
|
|
2219
|
-
children:
|
|
2218
|
+
path: u.path,
|
|
2219
|
+
children: u.name["en-US"]
|
|
2220
2220
|
},
|
|
2221
|
-
|
|
2221
|
+
u.id
|
|
2222
2222
|
)
|
|
2223
2223
|
}
|
|
2224
2224
|
)) }),
|
|
2225
2225
|
/* @__PURE__ */ t.jsx("div", { className: k.pagesMobileModalFooter, children: /* @__PURE__ */ t.jsx(
|
|
2226
|
-
|
|
2226
|
+
qt,
|
|
2227
2227
|
{
|
|
2228
|
-
signUp:
|
|
2229
|
-
close:
|
|
2228
|
+
signUp: o,
|
|
2229
|
+
close: e
|
|
2230
2230
|
}
|
|
2231
2231
|
) })
|
|
2232
2232
|
]
|
|
2233
2233
|
}
|
|
2234
2234
|
);
|
|
2235
|
-
},
|
|
2236
|
-
const [s,
|
|
2235
|
+
}, Gn = ({ logo: h, signUp: a, pages: o }) => {
|
|
2236
|
+
const [s, c] = g.useState(!1);
|
|
2237
2237
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2238
|
-
/* @__PURE__ */ t.jsx(
|
|
2238
|
+
/* @__PURE__ */ t.jsx(Fs, { setIsOpenModal: c }),
|
|
2239
2239
|
s && /* @__PURE__ */ t.jsx(
|
|
2240
2240
|
ut,
|
|
2241
2241
|
{
|
|
2242
|
-
close: () =>
|
|
2242
|
+
close: () => c(!1),
|
|
2243
2243
|
hasPadding: !1,
|
|
2244
2244
|
children: /* @__PURE__ */ t.jsx(
|
|
2245
|
-
|
|
2245
|
+
Us,
|
|
2246
2246
|
{
|
|
2247
|
-
logo:
|
|
2248
|
-
setIsOpen:
|
|
2249
|
-
signUp:
|
|
2250
|
-
pages:
|
|
2247
|
+
logo: h,
|
|
2248
|
+
setIsOpen: c,
|
|
2249
|
+
signUp: a,
|
|
2250
|
+
pages: o
|
|
2251
2251
|
}
|
|
2252
2252
|
)
|
|
2253
2253
|
}
|
|
2254
2254
|
)
|
|
2255
2255
|
] });
|
|
2256
|
-
},
|
|
2257
|
-
const { setIsOpenModal:
|
|
2256
|
+
}, Fs = (h) => {
|
|
2257
|
+
const { setIsOpenModal: a } = h;
|
|
2258
2258
|
return /* @__PURE__ */ t.jsx(
|
|
2259
|
-
|
|
2259
|
+
R,
|
|
2260
2260
|
{
|
|
2261
2261
|
type: "Secondary",
|
|
2262
2262
|
style: {
|
|
2263
2263
|
padding: 10
|
|
2264
2264
|
},
|
|
2265
|
-
onClick: (
|
|
2266
|
-
|
|
2265
|
+
onClick: (o) => {
|
|
2266
|
+
o.stopPropagation(), window.location.pathname.includes("/admin/builder") || a(!0);
|
|
2267
2267
|
},
|
|
2268
|
-
children: /* @__PURE__ */ t.jsx(
|
|
2268
|
+
children: /* @__PURE__ */ t.jsx(j, { name: "List" })
|
|
2269
2269
|
}
|
|
2270
2270
|
);
|
|
2271
|
-
},
|
|
2272
|
-
share:
|
|
2273
|
-
modal:
|
|
2274
|
-
header:
|
|
2275
|
-
title:
|
|
2276
|
-
copyWrapper:
|
|
2277
|
-
copyText:
|
|
2278
|
-
copyTextMobile:
|
|
2279
|
-
copyTextMiniMobile:
|
|
2280
|
-
},
|
|
2281
|
-
const { isOpenModal:
|
|
2271
|
+
}, Hs = "_share_onabp_1", Vs = "_modal_onabp_8", Ys = "_header_onabp_20", Gs = "_title_onabp_46", Ws = "_copyWrapper_onabp_53", Xs = "_copyText_onabp_62", Qs = "_copyTextMobile_onabp_75", Js = "_copyTextMiniMobile_onabp_94", nt = {
|
|
2272
|
+
share: Hs,
|
|
2273
|
+
modal: Vs,
|
|
2274
|
+
header: Ys,
|
|
2275
|
+
title: Gs,
|
|
2276
|
+
copyWrapper: Ws,
|
|
2277
|
+
copyText: Xs,
|
|
2278
|
+
copyTextMobile: Qs,
|
|
2279
|
+
copyTextMiniMobile: Js
|
|
2280
|
+
}, Wn = ({ title: h = "Copy Product Link" }) => {
|
|
2281
|
+
const { isOpenModal: a, setIsOpenModal: o } = Bt();
|
|
2282
2282
|
function s() {
|
|
2283
|
-
|
|
2283
|
+
o(!0);
|
|
2284
2284
|
}
|
|
2285
2285
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2286
2286
|
/* @__PURE__ */ t.jsx(
|
|
2287
|
-
|
|
2287
|
+
R,
|
|
2288
2288
|
{
|
|
2289
2289
|
className: nt.share,
|
|
2290
|
-
onClick: (
|
|
2291
|
-
|
|
2290
|
+
onClick: (c) => {
|
|
2291
|
+
c.stopPropagation(), s();
|
|
2292
2292
|
},
|
|
2293
2293
|
type: "Secondary",
|
|
2294
2294
|
children: /* @__PURE__ */ t.jsx(
|
|
2295
|
-
|
|
2295
|
+
j,
|
|
2296
2296
|
{
|
|
2297
2297
|
name: "Share",
|
|
2298
2298
|
fill: "#757575",
|
|
@@ -2301,13 +2301,13 @@ const ns = (u) => {
|
|
|
2301
2301
|
)
|
|
2302
2302
|
}
|
|
2303
2303
|
),
|
|
2304
|
-
|
|
2304
|
+
a && /* @__PURE__ */ t.jsx(ut, { close: o, children: /* @__PURE__ */ t.jsx(Ks, { title: h }) })
|
|
2305
2305
|
] });
|
|
2306
|
-
},
|
|
2307
|
-
const { setIsOpenModal:
|
|
2308
|
-
function
|
|
2309
|
-
navigator.clipboard.writeText(
|
|
2310
|
-
...
|
|
2306
|
+
}, Ks = ({ title: h = "Copy Product Link" }) => {
|
|
2307
|
+
const { setIsOpenModal: a } = Bt(), { notifications: o, setNotifications: s } = Ct(), { setIsOpen: c } = rt(), e = window.location.href;
|
|
2308
|
+
function u() {
|
|
2309
|
+
navigator.clipboard.writeText(e), s([
|
|
2310
|
+
...o,
|
|
2311
2311
|
{
|
|
2312
2312
|
id: J(),
|
|
2313
2313
|
message: "Link copied to clipboard",
|
|
@@ -2315,19 +2315,19 @@ const ns = (u) => {
|
|
|
2315
2315
|
}
|
|
2316
2316
|
]);
|
|
2317
2317
|
}
|
|
2318
|
-
function
|
|
2319
|
-
|
|
2320
|
-
|
|
2318
|
+
function d() {
|
|
2319
|
+
c(!1), setTimeout(() => {
|
|
2320
|
+
a(!1), c(!0);
|
|
2321
2321
|
}, 300);
|
|
2322
2322
|
}
|
|
2323
|
-
function _
|
|
2324
|
-
return
|
|
2323
|
+
function f(_, T) {
|
|
2324
|
+
return _.length > T ? _.slice(0, T) + "..." : _;
|
|
2325
2325
|
}
|
|
2326
2326
|
return /* @__PURE__ */ t.jsxs(
|
|
2327
2327
|
"div",
|
|
2328
2328
|
{
|
|
2329
2329
|
className: nt.modal,
|
|
2330
|
-
onClick: (
|
|
2330
|
+
onClick: (_) => _.stopPropagation(),
|
|
2331
2331
|
children: [
|
|
2332
2332
|
/* @__PURE__ */ t.jsxs("div", { className: nt.header, children: [
|
|
2333
2333
|
/* @__PURE__ */ t.jsx(
|
|
@@ -2335,25 +2335,25 @@ const ns = (u) => {
|
|
|
2335
2335
|
{
|
|
2336
2336
|
className: nt.title,
|
|
2337
2337
|
id: "h4",
|
|
2338
|
-
children:
|
|
2338
|
+
children: h
|
|
2339
2339
|
}
|
|
2340
2340
|
),
|
|
2341
2341
|
/* @__PURE__ */ t.jsx(
|
|
2342
|
-
|
|
2342
|
+
j,
|
|
2343
2343
|
{
|
|
2344
2344
|
name: "X",
|
|
2345
2345
|
fill: "#757575",
|
|
2346
|
-
onClick:
|
|
2346
|
+
onClick: d,
|
|
2347
2347
|
hoverable: !0
|
|
2348
2348
|
}
|
|
2349
2349
|
)
|
|
2350
2350
|
] }),
|
|
2351
2351
|
/* @__PURE__ */ t.jsxs("div", { className: nt.copyWrapper, children: [
|
|
2352
2352
|
/* @__PURE__ */ t.jsxs(
|
|
2353
|
-
|
|
2353
|
+
R,
|
|
2354
2354
|
{
|
|
2355
2355
|
type: "Secondary",
|
|
2356
|
-
onClick:
|
|
2356
|
+
onClick: u,
|
|
2357
2357
|
style: {
|
|
2358
2358
|
flex: 1
|
|
2359
2359
|
},
|
|
@@ -2363,7 +2363,7 @@ const ns = (u) => {
|
|
|
2363
2363
|
{
|
|
2364
2364
|
className: nt.copyText,
|
|
2365
2365
|
id: "md",
|
|
2366
|
-
children:
|
|
2366
|
+
children: f(e, 100)
|
|
2367
2367
|
}
|
|
2368
2368
|
),
|
|
2369
2369
|
/* @__PURE__ */ t.jsx(
|
|
@@ -2371,7 +2371,7 @@ const ns = (u) => {
|
|
|
2371
2371
|
{
|
|
2372
2372
|
className: nt.copyTextMobile,
|
|
2373
2373
|
id: "md",
|
|
2374
|
-
children:
|
|
2374
|
+
children: f(e, 40)
|
|
2375
2375
|
}
|
|
2376
2376
|
),
|
|
2377
2377
|
/* @__PURE__ */ t.jsx(
|
|
@@ -2379,101 +2379,107 @@ const ns = (u) => {
|
|
|
2379
2379
|
{
|
|
2380
2380
|
className: nt.copyTextMiniMobile,
|
|
2381
2381
|
id: "md",
|
|
2382
|
-
children:
|
|
2382
|
+
children: f(e, 20)
|
|
2383
2383
|
}
|
|
2384
2384
|
)
|
|
2385
2385
|
]
|
|
2386
2386
|
}
|
|
2387
2387
|
),
|
|
2388
2388
|
/* @__PURE__ */ t.jsx(
|
|
2389
|
-
|
|
2389
|
+
R,
|
|
2390
2390
|
{
|
|
2391
2391
|
type: "Secondary",
|
|
2392
|
-
onClick:
|
|
2393
|
-
children:
|
|
2394
|
-
(
|
|
2395
|
-
) ? /* @__PURE__ */ t.jsx(
|
|
2392
|
+
onClick: u,
|
|
2393
|
+
children: o.find(
|
|
2394
|
+
(_) => _.message === "Link copied to clipboard"
|
|
2395
|
+
) ? /* @__PURE__ */ t.jsx(j, { name: "Check" }) : /* @__PURE__ */ t.jsx(j, { name: "Copy" })
|
|
2396
2396
|
}
|
|
2397
2397
|
)
|
|
2398
2398
|
] })
|
|
2399
2399
|
]
|
|
2400
2400
|
}
|
|
2401
2401
|
);
|
|
2402
|
-
},
|
|
2403
|
-
accordion:
|
|
2404
|
-
header:
|
|
2405
|
-
icon:
|
|
2406
|
-
open:
|
|
2407
|
-
content:
|
|
2408
|
-
contentOpen:
|
|
2409
|
-
contentText:
|
|
2410
|
-
},
|
|
2411
|
-
const [s,
|
|
2412
|
-
|
|
2402
|
+
}, Zs = "_accordion_153d4_1", tn = "_header_153d4_12", en = "_icon_153d4_21", sn = "_open_153d4_24", nn = "_content_153d4_28", an = "_contentOpen_153d4_36", on = "_contentText_153d4_40", it = {
|
|
2403
|
+
accordion: Zs,
|
|
2404
|
+
header: tn,
|
|
2405
|
+
icon: en,
|
|
2406
|
+
open: sn,
|
|
2407
|
+
content: nn,
|
|
2408
|
+
contentOpen: an,
|
|
2409
|
+
contentText: on
|
|
2410
|
+
}, Xn = ({ title: h, content: a, defaultOpen: o = !1 }) => {
|
|
2411
|
+
const [s, c] = g.useState(o), [e, u] = g.useState(0), d = g.useRef(null), f = () => {
|
|
2412
|
+
c(!s);
|
|
2413
2413
|
};
|
|
2414
|
-
return
|
|
2415
|
-
|
|
2414
|
+
return g.useEffect(() => {
|
|
2415
|
+
d.current && u(s ? d.current.scrollHeight : 0);
|
|
2416
2416
|
}, [s]), /* @__PURE__ */ t.jsxs("div", { className: it.accordion, children: [
|
|
2417
2417
|
/* @__PURE__ */ t.jsxs(
|
|
2418
2418
|
"div",
|
|
2419
2419
|
{
|
|
2420
2420
|
className: it.header,
|
|
2421
|
-
onClick:
|
|
2421
|
+
onClick: f,
|
|
2422
2422
|
children: [
|
|
2423
|
-
/* @__PURE__ */ t.jsx("h5", { id: "h5", children:
|
|
2424
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2423
|
+
/* @__PURE__ */ t.jsx("h5", { id: "h5", children: h }),
|
|
2424
|
+
/* @__PURE__ */ t.jsx("div", { className: U(it.icon, { [it.open]: s }), children: /* @__PURE__ */ t.jsx(j, { name: "CaretDown" }) })
|
|
2425
2425
|
]
|
|
2426
2426
|
}
|
|
2427
2427
|
),
|
|
2428
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2428
|
+
/* @__PURE__ */ t.jsx("div", { className: U(it.content, { [it.contentOpen]: s }), children: /* @__PURE__ */ t.jsx(
|
|
2429
2429
|
"p",
|
|
2430
2430
|
{
|
|
2431
2431
|
id: "md",
|
|
2432
2432
|
className: it.contentText,
|
|
2433
|
-
ref:
|
|
2434
|
-
style: { height: `${
|
|
2435
|
-
children:
|
|
2433
|
+
ref: d,
|
|
2434
|
+
style: { height: `${e}px`, marginTop: `${e > 0 ? "20px" : "0px"}` },
|
|
2435
|
+
children: a
|
|
2436
2436
|
}
|
|
2437
2437
|
) })
|
|
2438
2438
|
] });
|
|
2439
|
-
},
|
|
2440
|
-
buttonsBlock:
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2439
|
+
}, cn = "_buttonsBlock_1x6xf_1", rn = "_cartDisabled_1x6xf_25", Pt = {
|
|
2440
|
+
buttonsBlock: cn,
|
|
2441
|
+
cartDisabled: rn
|
|
2442
|
+
}, Qn = (h) => {
|
|
2443
|
+
var T, I;
|
|
2444
|
+
const { setIsOpen: a, setModalType: o, productId: s, isCartEnabled: c = !0 } = h, { cart: e } = ct(), { pageContext: u } = bt(), d = (T = u == null ? void 0 : u.listings) == null ? void 0 : T.find((r) => r.id === s);
|
|
2445
|
+
if (!d)
|
|
2445
2446
|
return null;
|
|
2446
|
-
const
|
|
2447
|
-
(
|
|
2447
|
+
const f = (I = u == null ? void 0 : u.products) == null ? void 0 : I.find(
|
|
2448
|
+
(r) => r.uniquePath === d.productData.uniquePath
|
|
2448
2449
|
);
|
|
2449
|
-
if (!
|
|
2450
|
+
if (!f)
|
|
2450
2451
|
return null;
|
|
2451
|
-
const _ = e.parts.find((
|
|
2452
|
+
const _ = e.parts.find((r) => r.productId === f.id);
|
|
2452
2453
|
return /* @__PURE__ */ t.jsxs(
|
|
2453
2454
|
"div",
|
|
2454
2455
|
{
|
|
2455
|
-
className:
|
|
2456
|
-
|
|
2456
|
+
className: U(Pt.buttonsBlock, {
|
|
2457
|
+
[Pt.cartDisabled]: !c
|
|
2458
|
+
}),
|
|
2459
|
+
onClick: (r) => r.stopPropagation(),
|
|
2457
2460
|
children: [
|
|
2458
|
-
/* @__PURE__ */ t.jsx(
|
|
2459
|
-
|
|
2461
|
+
c && /* @__PURE__ */ t.jsx(
|
|
2462
|
+
R,
|
|
2460
2463
|
{
|
|
2461
2464
|
type: "Secondary",
|
|
2462
2465
|
style: {
|
|
2463
2466
|
width: "100%"
|
|
2464
2467
|
},
|
|
2465
2468
|
onClick: () => {
|
|
2466
|
-
|
|
2469
|
+
o("Add To Cart"), a(!0);
|
|
2467
2470
|
},
|
|
2468
2471
|
children: _ ? "Add More" : "Add To Cart"
|
|
2469
2472
|
}
|
|
2470
2473
|
),
|
|
2471
2474
|
/* @__PURE__ */ t.jsx(
|
|
2472
|
-
|
|
2475
|
+
R,
|
|
2473
2476
|
{
|
|
2474
2477
|
type: "Primary",
|
|
2475
2478
|
onClick: () => {
|
|
2476
|
-
|
|
2479
|
+
o("Buy Now"), a(!0);
|
|
2480
|
+
},
|
|
2481
|
+
style: {
|
|
2482
|
+
width: "100%"
|
|
2477
2483
|
},
|
|
2478
2484
|
children: "Buy"
|
|
2479
2485
|
}
|
|
@@ -2481,15 +2487,15 @@ const ns = (u) => {
|
|
|
2481
2487
|
]
|
|
2482
2488
|
}
|
|
2483
2489
|
);
|
|
2484
|
-
},
|
|
2485
|
-
wrapper:
|
|
2486
|
-
logo:
|
|
2487
|
-
info:
|
|
2488
|
-
},
|
|
2489
|
-
const { general:
|
|
2490
|
-
if (!
|
|
2491
|
-
function
|
|
2492
|
-
const
|
|
2490
|
+
}, ln = "_wrapper_27wzz_1", dn = "_logo_27wzz_8", un = "_info_27wzz_12", It = {
|
|
2491
|
+
wrapper: ln,
|
|
2492
|
+
logo: dn,
|
|
2493
|
+
info: un
|
|
2494
|
+
}, Jn = ({ date: h }) => {
|
|
2495
|
+
const { general: a } = Ht();
|
|
2496
|
+
if (!a) return /* @__PURE__ */ t.jsx(t.Fragment, {});
|
|
2497
|
+
function o(s) {
|
|
2498
|
+
const c = new Date(s), e = {
|
|
2493
2499
|
month: "short",
|
|
2494
2500
|
day: "2-digit",
|
|
2495
2501
|
year: "numeric",
|
|
@@ -2497,18 +2503,18 @@ const ns = (u) => {
|
|
|
2497
2503
|
minute: "2-digit",
|
|
2498
2504
|
hour12: !1
|
|
2499
2505
|
};
|
|
2500
|
-
return
|
|
2506
|
+
return c.toLocaleDateString("en-US", e);
|
|
2501
2507
|
}
|
|
2502
2508
|
return /* @__PURE__ */ t.jsxs("div", { className: It.wrapper, children: [
|
|
2503
|
-
/* @__PURE__ */ t.jsx("div", { className: It.logo, children:
|
|
2509
|
+
/* @__PURE__ */ t.jsx("div", { className: It.logo, children: a.info.logo ? /* @__PURE__ */ t.jsx(
|
|
2504
2510
|
"img",
|
|
2505
2511
|
{
|
|
2506
|
-
src: `https://imagedelivery.net/${
|
|
2512
|
+
src: `https://imagedelivery.net/${a.info.logo.cfId}/w=500,h=500`,
|
|
2507
2513
|
alt: "image",
|
|
2508
2514
|
style: { objectFit: "contain", width: "48px", height: "48px" }
|
|
2509
2515
|
}
|
|
2510
2516
|
) : /* @__PURE__ */ t.jsx(
|
|
2511
|
-
|
|
2517
|
+
j,
|
|
2512
2518
|
{
|
|
2513
2519
|
name: "Image",
|
|
2514
2520
|
width: 48,
|
|
@@ -2516,99 +2522,100 @@ const ns = (u) => {
|
|
|
2516
2522
|
}
|
|
2517
2523
|
) }),
|
|
2518
2524
|
/* @__PURE__ */ t.jsxs("div", { className: It.info, children: [
|
|
2519
|
-
/* @__PURE__ */ t.jsx("h3", { id: "h4", children:
|
|
2520
|
-
/* @__PURE__ */ t.jsx("p", { id: "p", children:
|
|
2525
|
+
/* @__PURE__ */ t.jsx("h3", { id: "h4", children: a.info.name }),
|
|
2526
|
+
/* @__PURE__ */ t.jsx("p", { id: "p", children: o(h) })
|
|
2521
2527
|
] })
|
|
2522
2528
|
] });
|
|
2523
|
-
},
|
|
2524
|
-
variants:
|
|
2525
|
-
variant:
|
|
2526
|
-
stock:
|
|
2527
|
-
variantInfo:
|
|
2528
|
-
title:
|
|
2529
|
-
modal:
|
|
2530
|
-
header:
|
|
2531
|
-
productOptions:
|
|
2532
|
-
loading:
|
|
2533
|
-
},
|
|
2534
|
-
var
|
|
2535
|
-
const { pageContext:
|
|
2529
|
+
}, hn = "_variants_1f6zq_82", pn = "_variant_1f6zq_82", mn = "_stock_1f6zq_100", gn = "_variantInfo_1f6zq_108", fn = "_title_1f6zq_202", xn = "_modal_1f6zq_208", _n = "_header_1f6zq_228", yn = "_productOptions_1f6zq_236", jn = "_loading_1f6zq_240", tt = {
|
|
2530
|
+
variants: hn,
|
|
2531
|
+
variant: pn,
|
|
2532
|
+
stock: mn,
|
|
2533
|
+
variantInfo: gn,
|
|
2534
|
+
title: fn,
|
|
2535
|
+
modal: xn,
|
|
2536
|
+
header: _n,
|
|
2537
|
+
productOptions: yn,
|
|
2538
|
+
loading: jn
|
|
2539
|
+
}, Kn = (h) => {
|
|
2540
|
+
var r;
|
|
2541
|
+
const { pageContext: a } = bt(), o = (r = a == null ? void 0 : a.listings) == null ? void 0 : r.find((l) => l.id === h.productId), [s, c] = g.useState(!0), [e, u] = g.useState(null), d = (e == null ? void 0 : e.variants[0]) || null, [f, _] = g.useState(
|
|
2536
2542
|
"ONE_TIME"
|
|
2537
|
-
), { addProducts: T } = ct(), { setIsOpen:
|
|
2538
|
-
return
|
|
2543
|
+
), { addProducts: T } = ct(), { setIsOpen: I } = rt();
|
|
2544
|
+
return g.useEffect(() => {
|
|
2539
2545
|
(async () => {
|
|
2540
|
-
|
|
2541
|
-
const
|
|
2546
|
+
c(!0);
|
|
2547
|
+
const y = await Vt(
|
|
2542
2548
|
encodeURIComponent(
|
|
2543
|
-
`/product/${
|
|
2549
|
+
`/product/${o.productData.uniquePath}`
|
|
2544
2550
|
)
|
|
2545
2551
|
);
|
|
2546
|
-
T(
|
|
2552
|
+
T(y == null ? void 0 : y.data.products), u(y == null ? void 0 : y.data.products[0]), c(!1);
|
|
2547
2553
|
})();
|
|
2548
|
-
}, []),
|
|
2549
|
-
|
|
2550
|
-
}, []), /* @__PURE__ */ t.jsx(ut, { close:
|
|
2554
|
+
}, []), g.useEffect(() => {
|
|
2555
|
+
I(!0);
|
|
2556
|
+
}, []), /* @__PURE__ */ t.jsx(ut, { close: h.setIsOpen, children: /* @__PURE__ */ t.jsxs(
|
|
2551
2557
|
"div",
|
|
2552
2558
|
{
|
|
2553
2559
|
className: tt.modal,
|
|
2554
2560
|
onClick: (l) => l.stopPropagation(),
|
|
2555
2561
|
children: [
|
|
2556
|
-
s && /* @__PURE__ */ t.jsx("div", { className: tt.loading, children: /* @__PURE__ */ t.jsx(
|
|
2557
|
-
|
|
2558
|
-
|
|
2562
|
+
s && /* @__PURE__ */ t.jsx("div", { className: tt.loading, children: /* @__PURE__ */ t.jsx($t, {}) }),
|
|
2563
|
+
h.type === "Add To Cart" && h.isCartEnabled && e && d && !s && /* @__PURE__ */ t.jsx(
|
|
2564
|
+
bn,
|
|
2559
2565
|
{
|
|
2560
|
-
variants:
|
|
2561
|
-
activeVariant:
|
|
2562
|
-
activeChargeType:
|
|
2563
|
-
setActiveChargeType:
|
|
2564
|
-
productId:
|
|
2565
|
-
setIsOpen:
|
|
2566
|
+
variants: e.variants,
|
|
2567
|
+
activeVariant: d,
|
|
2568
|
+
activeChargeType: f,
|
|
2569
|
+
setActiveChargeType: _,
|
|
2570
|
+
productId: e.id,
|
|
2571
|
+
setIsOpen: h.setIsOpen
|
|
2566
2572
|
}
|
|
2567
2573
|
),
|
|
2568
|
-
|
|
2574
|
+
h.type === "Buy Now" && e && !s && /* @__PURE__ */ t.jsx(
|
|
2569
2575
|
vn,
|
|
2570
2576
|
{
|
|
2571
|
-
product:
|
|
2572
|
-
setIsOpen:
|
|
2577
|
+
product: e,
|
|
2578
|
+
setIsOpen: h.setIsOpen,
|
|
2579
|
+
isCartEnabled: h.isCartEnabled
|
|
2573
2580
|
}
|
|
2574
2581
|
)
|
|
2575
2582
|
]
|
|
2576
2583
|
}
|
|
2577
2584
|
) });
|
|
2578
|
-
},
|
|
2579
|
-
const { variants:
|
|
2580
|
-
|
|
2581
|
-
|
|
2585
|
+
}, bn = (h) => {
|
|
2586
|
+
const { variants: a, activeChargeType: o, productId: s, setIsOpen: c } = h, { cart: e, addProductToCart: u, addProducts: d, updateQuantityOfProduct: f } = ct(), { notifications: _, setNotifications: T } = Ct(), { pageContext: I } = bt(), { setIsOpen: r } = rt(), l = () => {
|
|
2587
|
+
r(!1), setTimeout(() => {
|
|
2588
|
+
c(!1);
|
|
2582
2589
|
}, 300);
|
|
2583
2590
|
};
|
|
2584
|
-
async function
|
|
2585
|
-
const
|
|
2586
|
-
(w) => w.productId ===
|
|
2591
|
+
async function y(x) {
|
|
2592
|
+
const p = a.find((w) => w.id === x), i = e.parts.find(
|
|
2593
|
+
(w) => w.productId === h.productId && w.productVariantId === x
|
|
2587
2594
|
);
|
|
2588
|
-
if ((
|
|
2595
|
+
if ((p == null ? void 0 : p.quantity.available) && (p == null ? void 0 : p.quantity.restrictions) && ((i == null ? void 0 : i.quantity) || 0) + 1 > (p == null ? void 0 : p.quantity.restrictions.max) || (p == null ? void 0 : p.quantity.available) === 0 || (p == null ? void 0 : p.quantity.available) && ((i == null ? void 0 : i.quantity) || 0) + 1 > (p == null ? void 0 : p.quantity.available)) {
|
|
2589
2596
|
T([
|
|
2590
|
-
...
|
|
2597
|
+
..._,
|
|
2591
2598
|
{ id: J(), message: "Product is out of stock", status: "error" }
|
|
2592
2599
|
]);
|
|
2593
2600
|
return;
|
|
2594
2601
|
}
|
|
2595
2602
|
if (i)
|
|
2596
|
-
|
|
2603
|
+
f({
|
|
2597
2604
|
productId: s,
|
|
2598
|
-
productVariantId:
|
|
2605
|
+
productVariantId: x,
|
|
2599
2606
|
quantity: i.quantity + 1,
|
|
2600
|
-
chargeType:
|
|
2607
|
+
chargeType: o
|
|
2601
2608
|
});
|
|
2602
2609
|
else {
|
|
2603
|
-
|
|
2610
|
+
I != null && I.products && d(I.products);
|
|
2604
2611
|
try {
|
|
2605
|
-
|
|
2612
|
+
u({
|
|
2606
2613
|
productId: s,
|
|
2607
|
-
productVariantId:
|
|
2614
|
+
productVariantId: x,
|
|
2608
2615
|
quantity: 1,
|
|
2609
|
-
chargeType:
|
|
2616
|
+
chargeType: o
|
|
2610
2617
|
}), T([
|
|
2611
|
-
...
|
|
2618
|
+
..._,
|
|
2612
2619
|
{
|
|
2613
2620
|
id: J(),
|
|
2614
2621
|
message: "Product added to cart",
|
|
@@ -2617,7 +2624,7 @@ const ns = (u) => {
|
|
|
2617
2624
|
]);
|
|
2618
2625
|
} catch (w) {
|
|
2619
2626
|
T([
|
|
2620
|
-
...
|
|
2627
|
+
..._,
|
|
2621
2628
|
{
|
|
2622
2629
|
id: J(),
|
|
2623
2630
|
message: `Product failed to add to cart: ${w}`,
|
|
@@ -2631,7 +2638,7 @@ const ns = (u) => {
|
|
|
2631
2638
|
/* @__PURE__ */ t.jsxs("div", { className: tt.header, children: [
|
|
2632
2639
|
/* @__PURE__ */ t.jsx("div", { id: "h3", children: "Choose a Variant" }),
|
|
2633
2640
|
/* @__PURE__ */ t.jsx(
|
|
2634
|
-
|
|
2641
|
+
j,
|
|
2635
2642
|
{
|
|
2636
2643
|
name: "X",
|
|
2637
2644
|
width: 24,
|
|
@@ -2642,17 +2649,17 @@ const ns = (u) => {
|
|
|
2642
2649
|
}
|
|
2643
2650
|
)
|
|
2644
2651
|
] }),
|
|
2645
|
-
/* @__PURE__ */ t.jsx("div", { className: tt.variants, children:
|
|
2646
|
-
var
|
|
2647
|
-
return (
|
|
2648
|
-
}).map((
|
|
2649
|
-
var
|
|
2652
|
+
/* @__PURE__ */ t.jsx("div", { className: tt.variants, children: a.filter((x) => {
|
|
2653
|
+
var p;
|
|
2654
|
+
return (p = x.chargeTypes) == null ? void 0 : p.includes(o);
|
|
2655
|
+
}).map((x) => {
|
|
2656
|
+
var p, i, b;
|
|
2650
2657
|
return /* @__PURE__ */ t.jsxs(
|
|
2651
2658
|
"div",
|
|
2652
2659
|
{
|
|
2653
|
-
className:
|
|
2660
|
+
className: U(tt.variant),
|
|
2654
2661
|
onClick: () => {
|
|
2655
|
-
|
|
2662
|
+
y(x.id), c(!1);
|
|
2656
2663
|
},
|
|
2657
2664
|
children: [
|
|
2658
2665
|
/* @__PURE__ */ t.jsxs("div", { className: tt.variantInfo, children: [
|
|
@@ -2661,21 +2668,21 @@ const ns = (u) => {
|
|
|
2661
2668
|
{
|
|
2662
2669
|
className: tt.title,
|
|
2663
2670
|
id: "h4",
|
|
2664
|
-
children:
|
|
2671
|
+
children: x.name
|
|
2665
2672
|
}
|
|
2666
2673
|
),
|
|
2667
2674
|
/* @__PURE__ */ t.jsx("span", { id: "md", children: Q({
|
|
2668
|
-
amount:
|
|
2669
|
-
currency:
|
|
2675
|
+
amount: o === "ONE_TIME" ? x.price.amount : x.subscriptionSettings ? x.subscriptionSettings.price.amount : 0,
|
|
2676
|
+
currency: o === "ONE_TIME" ? x.price.currency : ((p = x.subscriptionSettings) == null ? void 0 : p.price.currency) || "USD"
|
|
2670
2677
|
}) })
|
|
2671
2678
|
] }),
|
|
2672
|
-
/* @__PURE__ */ t.jsx("div", { id: "md", children:
|
|
2679
|
+
/* @__PURE__ */ t.jsx("div", { id: "md", children: o === "ONE_TIME" && /* @__PURE__ */ t.jsxs(
|
|
2673
2680
|
"span",
|
|
2674
2681
|
{
|
|
2675
2682
|
className: tt.stock,
|
|
2676
2683
|
id: "md",
|
|
2677
2684
|
children: [
|
|
2678
|
-
(i =
|
|
2685
|
+
(i = x.quantity.restrictions) != null && i.max || x.quantity.available !== void 0 ? ((b = x.quantity.restrictions) == null ? void 0 : b.max) || x.quantity.available : "∞",
|
|
2679
2686
|
" ",
|
|
2680
2687
|
"in stock"
|
|
2681
2688
|
]
|
|
@@ -2683,24 +2690,24 @@ const ns = (u) => {
|
|
|
2683
2690
|
) })
|
|
2684
2691
|
]
|
|
2685
2692
|
},
|
|
2686
|
-
|
|
2693
|
+
x.id
|
|
2687
2694
|
);
|
|
2688
2695
|
}) })
|
|
2689
2696
|
] });
|
|
2690
|
-
}, vn = (
|
|
2691
|
-
const { product:
|
|
2692
|
-
|
|
2693
|
-
|
|
2697
|
+
}, vn = (h) => {
|
|
2698
|
+
const { product: a, setIsOpen: o, isCartEnabled: s } = h, { setIsOpen: c } = rt(), e = () => {
|
|
2699
|
+
c(!1), setTimeout(() => {
|
|
2700
|
+
o(!1);
|
|
2694
2701
|
}, 300);
|
|
2695
2702
|
};
|
|
2696
2703
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2697
2704
|
/* @__PURE__ */ t.jsxs("div", { className: tt.header, children: [
|
|
2698
2705
|
/* @__PURE__ */ t.jsxs("div", { id: "h3", children: [
|
|
2699
2706
|
"Buy ",
|
|
2700
|
-
at(
|
|
2707
|
+
at(a.name)
|
|
2701
2708
|
] }),
|
|
2702
2709
|
/* @__PURE__ */ t.jsx(
|
|
2703
|
-
|
|
2710
|
+
j,
|
|
2704
2711
|
{
|
|
2705
2712
|
name: "X",
|
|
2706
2713
|
width: 24,
|
|
@@ -2716,81 +2723,82 @@ const ns = (u) => {
|
|
|
2716
2723
|
)
|
|
2717
2724
|
] }),
|
|
2718
2725
|
/* @__PURE__ */ t.jsx("div", { className: tt.productOptions, children: /* @__PURE__ */ t.jsx(
|
|
2719
|
-
|
|
2726
|
+
is,
|
|
2720
2727
|
{
|
|
2721
|
-
product:
|
|
2722
|
-
setIsOpen:
|
|
2728
|
+
product: a,
|
|
2729
|
+
setIsOpen: o,
|
|
2730
|
+
isCartEnabled: s
|
|
2723
2731
|
}
|
|
2724
2732
|
) })
|
|
2725
2733
|
] });
|
|
2726
|
-
},
|
|
2727
|
-
contentModal:
|
|
2728
|
-
modalTop:
|
|
2729
|
-
loading:
|
|
2734
|
+
}, In = "_contentModal_1ptti_1", Nn = "_modalTop_1ptti_13", Cn = "_loading_1ptti_19", Sn = "_modalCards_1ptti_27", Pn = "_modalImage_1ptti_32", kn = "_card_1ptti_37", wn = "_cardInfo_1ptti_49", Tn = "_cardButtons_1ptti_56", Mn = "_title_1ptti_62", Bn = "_blockImage_1ptti_69", $n = "_short_1ptti_78", On = "_price_1ptti_82", qn = "_oldPrice_1ptti_89", An = "_newPrice_1ptti_98", z = {
|
|
2735
|
+
contentModal: In,
|
|
2736
|
+
modalTop: Nn,
|
|
2737
|
+
loading: Cn,
|
|
2730
2738
|
modalCards: Sn,
|
|
2731
|
-
modalImage:
|
|
2732
|
-
card:
|
|
2733
|
-
cardInfo:
|
|
2734
|
-
cardButtons:
|
|
2735
|
-
title:
|
|
2736
|
-
blockImage:
|
|
2737
|
-
short:
|
|
2738
|
-
price:
|
|
2739
|
-
oldPrice:
|
|
2740
|
-
newPrice:
|
|
2741
|
-
},
|
|
2739
|
+
modalImage: Pn,
|
|
2740
|
+
card: kn,
|
|
2741
|
+
cardInfo: wn,
|
|
2742
|
+
cardButtons: Tn,
|
|
2743
|
+
title: Mn,
|
|
2744
|
+
blockImage: Bn,
|
|
2745
|
+
short: $n,
|
|
2746
|
+
price: On,
|
|
2747
|
+
oldPrice: qn,
|
|
2748
|
+
newPrice: An
|
|
2749
|
+
}, Zn = (h) => {
|
|
2742
2750
|
const {
|
|
2743
|
-
setIsOpen:
|
|
2744
|
-
pageContext:
|
|
2751
|
+
setIsOpen: a,
|
|
2752
|
+
pageContext: o,
|
|
2745
2753
|
groupData: s,
|
|
2746
|
-
setProductId:
|
|
2747
|
-
setIsProductModalOpen:
|
|
2748
|
-
setShowDropdown:
|
|
2749
|
-
} =
|
|
2750
|
-
|
|
2751
|
-
var
|
|
2754
|
+
setProductId: c,
|
|
2755
|
+
setIsProductModalOpen: e,
|
|
2756
|
+
setShowDropdown: u
|
|
2757
|
+
} = h, [d, f] = g.useState(null), [_, T] = g.useState(!0), { setIsOpen: I } = rt();
|
|
2758
|
+
g.useEffect(() => {
|
|
2759
|
+
var y;
|
|
2752
2760
|
T(!0);
|
|
2753
|
-
const l = (
|
|
2754
|
-
(
|
|
2761
|
+
const l = (y = o.listings) == null ? void 0 : y.filter(
|
|
2762
|
+
(x) => s.listingIdList.includes(x.id)
|
|
2755
2763
|
);
|
|
2756
|
-
l &&
|
|
2757
|
-
}, [
|
|
2758
|
-
|
|
2764
|
+
l && f([...l]), T(!1);
|
|
2765
|
+
}, [o]), g.useEffect(() => {
|
|
2766
|
+
I(!0);
|
|
2759
2767
|
}, []);
|
|
2760
|
-
const
|
|
2761
|
-
|
|
2762
|
-
|
|
2768
|
+
const r = () => {
|
|
2769
|
+
I(!1), setTimeout(() => {
|
|
2770
|
+
a(!1);
|
|
2763
2771
|
}, 300);
|
|
2764
2772
|
};
|
|
2765
|
-
return /* @__PURE__ */ t.jsx(ut, { close: () =>
|
|
2773
|
+
return /* @__PURE__ */ t.jsx(ut, { close: () => a(!1), children: /* @__PURE__ */ t.jsxs(
|
|
2766
2774
|
"div",
|
|
2767
2775
|
{
|
|
2768
|
-
className:
|
|
2776
|
+
className: z.contentModal,
|
|
2769
2777
|
onClick: (l) => l.stopPropagation(),
|
|
2770
2778
|
children: [
|
|
2771
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2779
|
+
/* @__PURE__ */ t.jsxs("div", { className: z.modalTop, children: [
|
|
2772
2780
|
/* @__PURE__ */ t.jsx(
|
|
2773
2781
|
"span",
|
|
2774
2782
|
{
|
|
2775
|
-
className:
|
|
2783
|
+
className: z.title,
|
|
2776
2784
|
id: "h4",
|
|
2777
2785
|
children: at(s.name)
|
|
2778
2786
|
}
|
|
2779
2787
|
),
|
|
2780
2788
|
/* @__PURE__ */ t.jsx(
|
|
2781
|
-
|
|
2789
|
+
j,
|
|
2782
2790
|
{
|
|
2783
2791
|
name: "X",
|
|
2784
2792
|
hoverable: !0,
|
|
2785
|
-
onClick:
|
|
2793
|
+
onClick: r,
|
|
2786
2794
|
fill: "var(--text-primary)"
|
|
2787
2795
|
}
|
|
2788
2796
|
)
|
|
2789
2797
|
] }),
|
|
2790
|
-
!
|
|
2798
|
+
!_ && d && /* @__PURE__ */ t.jsx("div", { className: z.modalCards, children: d.map((l) => /* @__PURE__ */ t.jsxs(
|
|
2791
2799
|
"div",
|
|
2792
2800
|
{
|
|
2793
|
-
className:
|
|
2801
|
+
className: z.card,
|
|
2794
2802
|
children: [
|
|
2795
2803
|
/* @__PURE__ */ t.jsx("div", { children: l.productData.images[0] ? /* @__PURE__ */ t.jsx(
|
|
2796
2804
|
"img",
|
|
@@ -2799,27 +2807,27 @@ const ns = (u) => {
|
|
|
2799
2807
|
alt: "",
|
|
2800
2808
|
width: 64,
|
|
2801
2809
|
height: 64,
|
|
2802
|
-
className:
|
|
2810
|
+
className: z.modalImage
|
|
2803
2811
|
}
|
|
2804
|
-
) : /* @__PURE__ */ t.jsx("div", { className:
|
|
2805
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2812
|
+
) : /* @__PURE__ */ t.jsx("div", { className: U(z.blockImage, z.modalImage), children: /* @__PURE__ */ t.jsx(j, { name: "Image" }) }) }),
|
|
2813
|
+
/* @__PURE__ */ t.jsxs("div", { className: z.cardInfo, children: [
|
|
2806
2814
|
/* @__PURE__ */ t.jsx(
|
|
2807
2815
|
"div",
|
|
2808
2816
|
{
|
|
2809
|
-
className:
|
|
2817
|
+
className: z.name,
|
|
2810
2818
|
id: "h5",
|
|
2811
2819
|
children: l.productData.compareAtPrice && (l.productData.compareAtPrice.amount || 0) - (l.productData.minPrice.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2812
2820
|
at(l.productData.name),
|
|
2813
2821
|
/* @__PURE__ */ t.jsxs(
|
|
2814
2822
|
"span",
|
|
2815
2823
|
{
|
|
2816
|
-
className:
|
|
2824
|
+
className: z.price,
|
|
2817
2825
|
id: "md",
|
|
2818
2826
|
children: [
|
|
2819
2827
|
/* @__PURE__ */ t.jsx(
|
|
2820
2828
|
"span",
|
|
2821
2829
|
{
|
|
2822
|
-
className:
|
|
2830
|
+
className: z.newPrice,
|
|
2823
2831
|
id: "md",
|
|
2824
2832
|
children: Q({
|
|
2825
2833
|
amount: l.productData.minPrice.amount,
|
|
@@ -2830,7 +2838,7 @@ const ns = (u) => {
|
|
|
2830
2838
|
/* @__PURE__ */ t.jsx(
|
|
2831
2839
|
"span",
|
|
2832
2840
|
{
|
|
2833
|
-
className:
|
|
2841
|
+
className: z.oldPrice,
|
|
2834
2842
|
id: "md",
|
|
2835
2843
|
children: Q({
|
|
2836
2844
|
amount: l.productData.compareAtPrice.amount,
|
|
@@ -2846,7 +2854,7 @@ const ns = (u) => {
|
|
|
2846
2854
|
/* @__PURE__ */ t.jsx(
|
|
2847
2855
|
"span",
|
|
2848
2856
|
{
|
|
2849
|
-
className:
|
|
2857
|
+
className: z.newPrice,
|
|
2850
2858
|
id: "md",
|
|
2851
2859
|
children: Q({
|
|
2852
2860
|
amount: l.productData.minPrice.amount,
|
|
@@ -2860,30 +2868,30 @@ const ns = (u) => {
|
|
|
2860
2868
|
l.productData.shortDescription && /* @__PURE__ */ t.jsx(
|
|
2861
2869
|
"span",
|
|
2862
2870
|
{
|
|
2863
|
-
className:
|
|
2871
|
+
className: z.short,
|
|
2864
2872
|
id: "md",
|
|
2865
2873
|
children: at(l.productData.shortDescription)
|
|
2866
2874
|
}
|
|
2867
2875
|
)
|
|
2868
2876
|
] }),
|
|
2869
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2877
|
+
/* @__PURE__ */ t.jsxs("div", { className: z.cardButtons, children: [
|
|
2870
2878
|
/* @__PURE__ */ t.jsx(
|
|
2871
|
-
|
|
2879
|
+
R,
|
|
2872
2880
|
{
|
|
2873
2881
|
type: "Secondary",
|
|
2874
2882
|
onClick: () => {
|
|
2875
|
-
|
|
2883
|
+
c(l.id), a(!1), e(!0);
|
|
2876
2884
|
},
|
|
2877
2885
|
children: "Buy"
|
|
2878
2886
|
}
|
|
2879
2887
|
),
|
|
2880
|
-
/* @__PURE__ */ t.jsx(
|
|
2881
|
-
|
|
2888
|
+
/* @__PURE__ */ t.jsx(Mt, { path: `/product/${l.productData.uniquePath}`, children: /* @__PURE__ */ t.jsx(
|
|
2889
|
+
R,
|
|
2882
2890
|
{
|
|
2883
2891
|
type: "Primary",
|
|
2884
2892
|
style: { whiteSpace: "nowrap" },
|
|
2885
2893
|
onClick: () => {
|
|
2886
|
-
|
|
2894
|
+
u(!1), r();
|
|
2887
2895
|
},
|
|
2888
2896
|
children: "View Details"
|
|
2889
2897
|
}
|
|
@@ -2893,56 +2901,56 @@ const ns = (u) => {
|
|
|
2893
2901
|
},
|
|
2894
2902
|
l.id
|
|
2895
2903
|
)) }),
|
|
2896
|
-
|
|
2904
|
+
_ && /* @__PURE__ */ t.jsx("div", { className: z.loading, children: /* @__PURE__ */ t.jsx($t, {}) })
|
|
2897
2905
|
]
|
|
2898
2906
|
}
|
|
2899
2907
|
) });
|
|
2900
2908
|
};
|
|
2901
2909
|
export {
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2910
|
+
Xn as Accordion,
|
|
2911
|
+
si as AlignText,
|
|
2912
|
+
Fs as BurgerMenuButton,
|
|
2913
|
+
R as Button,
|
|
2914
|
+
Ae as ButtonTypeSettings,
|
|
2915
|
+
Hn as ButtonsSettings,
|
|
2916
|
+
zn as CategorySettings,
|
|
2917
|
+
Ot as ChargeTypes,
|
|
2918
|
+
Dt as ChooseImage,
|
|
2919
|
+
ni as ChooseImageModal,
|
|
2920
|
+
zs as EmptyCart,
|
|
2921
|
+
Fn as FormSettings,
|
|
2922
|
+
Zn as GroupCardModal,
|
|
2923
|
+
Yn as HeaderButtons,
|
|
2924
|
+
j as Icon,
|
|
2917
2925
|
Nt as InputSettings,
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2926
|
+
zt as InputUI,
|
|
2927
|
+
ii as ItemsSettings,
|
|
2928
|
+
Ln as LayoutSettings,
|
|
2929
|
+
Mt as Link,
|
|
2930
|
+
Vn as ListingSelector,
|
|
2931
|
+
$t as Loader,
|
|
2932
|
+
Jn as MetaInfoPost,
|
|
2925
2933
|
ut as Modal,
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
+
Gn as PagesMobileMenu,
|
|
2935
|
+
Us as PagesMobileModal,
|
|
2936
|
+
Un as PagesSettings,
|
|
2937
|
+
Qn as ProductCardButtons,
|
|
2938
|
+
Kn as ProductCardModal,
|
|
2939
|
+
is as ProductOptions,
|
|
2940
|
+
ai as RadioUI,
|
|
2941
|
+
kt as RangeSelector,
|
|
2934
2942
|
ot as Select,
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2943
|
+
oi as SelectInfiniteList,
|
|
2944
|
+
ci as SelectTypeText,
|
|
2945
|
+
ri as SelectUI,
|
|
2946
|
+
Wn as ShareLink,
|
|
2947
|
+
Rs as ShoppingButton,
|
|
2948
|
+
Ls as ShoppingModalCart,
|
|
2941
2949
|
lt as Switch,
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2950
|
+
li as TextSettings,
|
|
2951
|
+
di as TextareaSettings,
|
|
2952
|
+
ui as TextareaUI,
|
|
2953
|
+
hi as TypesText,
|
|
2954
|
+
qt as UserInfo,
|
|
2955
|
+
pi as Wrapper
|
|
2948
2956
|
};
|