@billgangcom/theme-lib 1.63.0 → 1.65.0
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/abstractions/PageContext.d.ts +2 -1
- package/dist/builder/constants/theme-settings.d.ts +6 -5
- package/dist/builder/store/useThemeSettingsStore.d.ts +4 -4
- package/dist/builder.cjs.js +4 -4
- package/dist/builder.es.js +899 -883
- package/dist/{index-DV89YV-L.js → index-BPn2qi_o.js} +4276 -4242
- package/dist/{index-DnpjVF1z.cjs → index-Dc4CgFbD.cjs} +21 -21
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/ui/ItemsSettings/index.d.ts +1 -1
- package/dist/ui/ProductCardButtons/index.d.ts +9 -1
- package/dist/ui/ProductCardModal/index.d.ts +9 -0
- package/dist/ui/ProductOptions/index.d.ts +4 -0
- package/dist/ui/TextSettings/index.d.ts +2 -2
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1358 -1051
- package/package.json +2 -2
package/dist/ui.es.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { j as t, I as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { j as t, I as j, c as V, a as yt, u as ut, d as mt, P as ht, S as ot, R as St, D as pt, e as _t, v as gt, B as ct, O as It, f as rt, g as ft, C as xt, h as H, i as Pt, k as at, l as Tt, m as lt, n as Mt, o as jt, p as G, L as At, r as vt, t as dt, s as Nt, w as F, x as Ot, M as kt, y as $t, z as Et, A as wt, E as qt, F as Dt, G as Rt } from "./index-BPn2qi_o.js";
|
|
2
|
+
import { Q as Zi, J as ta, N as ea, H as na, T as sa, K as ia } from "./index-BPn2qi_o.js";
|
|
3
|
+
import x from "react";
|
|
4
4
|
import "@phosphor-icons/react";
|
|
5
|
-
const
|
|
6
|
-
wrapper:
|
|
7
|
-
alignmentBlock:
|
|
8
|
-
title:
|
|
9
|
-
subtitle:
|
|
10
|
-
alignmentContent:
|
|
11
|
-
alignments:
|
|
12
|
-
alignment:
|
|
13
|
-
circle:
|
|
14
|
-
paddings:
|
|
15
|
-
padding:
|
|
16
|
-
active:
|
|
17
|
-
input:
|
|
18
|
-
},
|
|
5
|
+
const Lt = "_wrapper_1vmyb_2", zt = "_alignmentBlock_1vmyb_8", Ft = "_title_1vmyb_15", Vt = "_subtitle_1vmyb_22", Ut = "_alignmentContent_1vmyb_29", Ht = "_alignments_1vmyb_37", Yt = "_alignment_1vmyb_8", Wt = "_circle_1vmyb_60", Gt = "_paddings_1vmyb_67", Qt = "_padding_1vmyb_67", Xt = "_active_1vmyb_91", Jt = "_input_1vmyb_98", J = {
|
|
6
|
+
wrapper: Lt,
|
|
7
|
+
alignmentBlock: zt,
|
|
8
|
+
title: Ft,
|
|
9
|
+
subtitle: Vt,
|
|
10
|
+
alignmentContent: Ut,
|
|
11
|
+
alignments: Ht,
|
|
12
|
+
alignment: Yt,
|
|
13
|
+
circle: Wt,
|
|
14
|
+
paddings: Gt,
|
|
15
|
+
padding: Qt,
|
|
16
|
+
active: Xt,
|
|
17
|
+
input: Jt
|
|
18
|
+
}, Kt = [
|
|
19
19
|
"topLeft",
|
|
20
20
|
"top",
|
|
21
21
|
"topRight",
|
|
@@ -25,10 +25,10 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
25
25
|
"bottomLeft",
|
|
26
26
|
"bottom",
|
|
27
27
|
"bottomRight"
|
|
28
|
-
],
|
|
29
|
-
const { alignment: s, padding: e, setPadding: n, setAlignment: i } =
|
|
30
|
-
function
|
|
31
|
-
switch (
|
|
28
|
+
], Zt = ["left", "top", "right", "bottom"], Oi = (o) => {
|
|
29
|
+
const { alignment: s, padding: e, setPadding: n, setAlignment: i } = o;
|
|
30
|
+
function c(l) {
|
|
31
|
+
switch (l) {
|
|
32
32
|
case "left":
|
|
33
33
|
case "topLeft":
|
|
34
34
|
case "bottomLeft":
|
|
@@ -45,8 +45,8 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
45
45
|
return "TextAlignCenter";
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
function u(
|
|
49
|
-
switch (
|
|
48
|
+
function u(l) {
|
|
49
|
+
switch (l) {
|
|
50
50
|
case "left":
|
|
51
51
|
return "AlignLeft";
|
|
52
52
|
case "right":
|
|
@@ -57,40 +57,40 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
57
57
|
return "AlignBottom";
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
const [
|
|
60
|
+
const [r, m] = x.useState(null), [p, B] = x.useState(null);
|
|
61
61
|
return /* @__PURE__ */ t.jsxs("div", { className: J.layout, children: [
|
|
62
62
|
/* @__PURE__ */ t.jsx("h3", { className: J.title, children: "Layout (for Desktop version)" }),
|
|
63
63
|
/* @__PURE__ */ t.jsxs("div", { className: J.alignmentBlock, children: [
|
|
64
64
|
/* @__PURE__ */ t.jsx("h5", { className: J.subtitle, children: "Alignment" }),
|
|
65
65
|
/* @__PURE__ */ t.jsxs("div", { className: J.alignmentContent, children: [
|
|
66
|
-
/* @__PURE__ */ t.jsx("div", { className: J.alignments, children:
|
|
66
|
+
/* @__PURE__ */ t.jsx("div", { className: J.alignments, children: Kt.map((l) => /* @__PURE__ */ t.jsxs(
|
|
67
67
|
"div",
|
|
68
68
|
{
|
|
69
69
|
onClick: () => {
|
|
70
|
-
i(
|
|
70
|
+
i(l);
|
|
71
71
|
},
|
|
72
72
|
className: J.alignment,
|
|
73
73
|
onMouseEnter: () => {
|
|
74
|
-
m(
|
|
74
|
+
m(l);
|
|
75
75
|
},
|
|
76
76
|
onMouseLeave: () => {
|
|
77
77
|
m(null);
|
|
78
78
|
},
|
|
79
79
|
children: [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
l !== s && r !== l && /* @__PURE__ */ t.jsx("div", { className: J.circle }),
|
|
81
|
+
l !== s && r === l && /* @__PURE__ */ t.jsx(
|
|
82
|
+
j,
|
|
83
83
|
{
|
|
84
|
-
name:
|
|
84
|
+
name: c(r),
|
|
85
85
|
fill: "#c2c2c2",
|
|
86
86
|
width: 22,
|
|
87
87
|
height: 22
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
l === s && /* @__PURE__ */ t.jsx(
|
|
91
|
+
j,
|
|
92
92
|
{
|
|
93
|
-
name:
|
|
93
|
+
name: c(s),
|
|
94
94
|
fill: "#FF3F19",
|
|
95
95
|
width: 22,
|
|
96
96
|
height: 22
|
|
@@ -98,37 +98,37 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
98
98
|
)
|
|
99
99
|
]
|
|
100
100
|
},
|
|
101
|
-
|
|
101
|
+
l
|
|
102
102
|
)) }),
|
|
103
|
-
/* @__PURE__ */ t.jsx("div", { className: J.paddings, children:
|
|
103
|
+
/* @__PURE__ */ t.jsx("div", { className: J.paddings, children: Zt.map((l) => /* @__PURE__ */ t.jsxs(
|
|
104
104
|
"label",
|
|
105
105
|
{
|
|
106
|
-
className:
|
|
107
|
-
[J.active]:
|
|
106
|
+
className: V(J.padding, {
|
|
107
|
+
[J.active]: p === l
|
|
108
108
|
}),
|
|
109
109
|
onFocus: () => {
|
|
110
|
-
|
|
110
|
+
B(l);
|
|
111
111
|
},
|
|
112
112
|
onBlur: () => {
|
|
113
|
-
|
|
113
|
+
B(null);
|
|
114
114
|
},
|
|
115
115
|
children: [
|
|
116
116
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
117
|
-
|
|
117
|
+
j,
|
|
118
118
|
{
|
|
119
|
-
name: u(
|
|
119
|
+
name: u(l),
|
|
120
120
|
width: 20,
|
|
121
121
|
height: 20
|
|
122
122
|
}
|
|
123
123
|
) }),
|
|
124
124
|
/* @__PURE__ */ t.jsx(
|
|
125
|
-
|
|
125
|
+
yt,
|
|
126
126
|
{
|
|
127
127
|
type: "number",
|
|
128
|
-
value: String(e[
|
|
129
|
-
onChange: (
|
|
128
|
+
value: String(e[l]),
|
|
129
|
+
onChange: (a) => n({
|
|
130
130
|
...e,
|
|
131
|
-
[
|
|
131
|
+
[l]: Math.min(Number(a), 999)
|
|
132
132
|
}),
|
|
133
133
|
max: 999,
|
|
134
134
|
paddingless: !0,
|
|
@@ -137,66 +137,109 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
137
137
|
)
|
|
138
138
|
]
|
|
139
139
|
},
|
|
140
|
-
|
|
140
|
+
l
|
|
141
141
|
)) })
|
|
142
142
|
] })
|
|
143
143
|
] })
|
|
144
144
|
] });
|
|
145
|
-
},
|
|
146
|
-
title:
|
|
147
|
-
subtitle:
|
|
148
|
-
header:
|
|
149
|
-
text:
|
|
150
|
-
productsBlock:
|
|
151
|
-
top:
|
|
152
|
-
itemsBlock:
|
|
153
|
-
typeTexts:
|
|
154
|
-
block:
|
|
155
|
-
active:
|
|
156
|
-
products:
|
|
157
|
-
product:
|
|
158
|
-
button:
|
|
159
|
-
disabled:
|
|
160
|
-
image:
|
|
161
|
-
info:
|
|
162
|
-
name:
|
|
163
|
-
buttons:
|
|
164
|
-
modal:
|
|
165
|
-
link:
|
|
166
|
-
modalOptions:
|
|
167
|
-
addButton:
|
|
168
|
-
deleteButton:
|
|
169
|
-
}
|
|
145
|
+
}, te = "_title_82zux_1", ee = "_subtitle_82zux_5", ne = "_header_82zux_12", se = "_text_82zux_13", ie = "_productsBlock_82zux_14", ae = "_top_82zux_26", oe = "_itemsBlock_82zux_35", ce = "_typeTexts_82zux_41", re = "_block_82zux_48", le = "_active_82zux_61", de = "_products_82zux_14", ue = "_product_82zux_14", me = "_button_82zux_80", he = "_disabled_82zux_91", pe = "_image_82zux_95", _e = "_info_82zux_102", ge = "_name_82zux_114", fe = "_buttons_82zux_118", xe = "_modal_82zux_125", ve = "_link_82zux_145", je = "_modalOptions_82zux_151", be = "_addButton_82zux_157", ye = "_deleteButton_82zux_179", Q = {
|
|
146
|
+
title: te,
|
|
147
|
+
subtitle: ee,
|
|
148
|
+
header: ne,
|
|
149
|
+
text: se,
|
|
150
|
+
productsBlock: ie,
|
|
151
|
+
top: ae,
|
|
152
|
+
itemsBlock: oe,
|
|
153
|
+
typeTexts: ce,
|
|
154
|
+
block: re,
|
|
155
|
+
active: le,
|
|
156
|
+
products: de,
|
|
157
|
+
product: ue,
|
|
158
|
+
button: me,
|
|
159
|
+
disabled: he,
|
|
160
|
+
image: pe,
|
|
161
|
+
info: _e,
|
|
162
|
+
name: ge,
|
|
163
|
+
buttons: fe,
|
|
164
|
+
modal: xe,
|
|
165
|
+
link: ve,
|
|
166
|
+
modalOptions: je,
|
|
167
|
+
addButton: be,
|
|
168
|
+
deleteButton: ye
|
|
169
|
+
};
|
|
170
|
+
function Ie({ id: o, children: s }) {
|
|
171
|
+
const {
|
|
172
|
+
attributes: e,
|
|
173
|
+
listeners: n,
|
|
174
|
+
setNodeRef: i,
|
|
175
|
+
transform: c,
|
|
176
|
+
transition: u,
|
|
177
|
+
isDragging: r
|
|
178
|
+
} = ft({
|
|
179
|
+
id: o
|
|
180
|
+
}), m = {
|
|
181
|
+
transform: xt.Transform.toString(c),
|
|
182
|
+
transition: u
|
|
183
|
+
};
|
|
184
|
+
return /* @__PURE__ */ t.jsx(
|
|
185
|
+
"div",
|
|
186
|
+
{
|
|
187
|
+
ref: i,
|
|
188
|
+
style: m,
|
|
189
|
+
className: `${Q.product} ${r ? Q.dragging : ""}`,
|
|
190
|
+
...e,
|
|
191
|
+
...n,
|
|
192
|
+
children: s
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
const Ei = (o) => {
|
|
170
197
|
const {
|
|
171
198
|
isActiveItems: s,
|
|
172
199
|
setIsActiveItems: e,
|
|
173
200
|
items: n,
|
|
174
201
|
setItems: i,
|
|
175
|
-
other:
|
|
202
|
+
other: c,
|
|
176
203
|
title: u,
|
|
177
|
-
subtitle:
|
|
204
|
+
subtitle: r,
|
|
178
205
|
draggable: m = !1,
|
|
179
|
-
withImage:
|
|
180
|
-
addable:
|
|
181
|
-
itemsOptions:
|
|
182
|
-
hasRangeSelector:
|
|
183
|
-
rangeSelectorOptions:
|
|
184
|
-
limit:
|
|
185
|
-
autoScrollInterval:
|
|
186
|
-
deletable:
|
|
187
|
-
} =
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
206
|
+
withImage: p = !1,
|
|
207
|
+
addable: B = !0,
|
|
208
|
+
itemsOptions: l,
|
|
209
|
+
hasRangeSelector: a = !1,
|
|
210
|
+
rangeSelectorOptions: b,
|
|
211
|
+
limit: d,
|
|
212
|
+
autoScrollInterval: S,
|
|
213
|
+
deletable: g
|
|
214
|
+
} = o, k = ut(
|
|
215
|
+
mt(ht, {
|
|
216
|
+
activationConstraint: {
|
|
217
|
+
distance: 5
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
), q = (v) => {
|
|
221
|
+
console.log("Trigger?");
|
|
222
|
+
const { active: M, over: O } = v;
|
|
223
|
+
if (O && M.id !== O.id) {
|
|
224
|
+
const I = n.findIndex(($) => $ === M.id), h = n.findIndex(($) => $ === O.id);
|
|
225
|
+
if (I !== -1 && h !== -1) {
|
|
226
|
+
const $ = [...n], [P] = $.splice(I, 1);
|
|
227
|
+
$.splice(h, 0, P), i($);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
function E(v) {
|
|
232
|
+
if (p)
|
|
233
|
+
return v ? /* @__PURE__ */ t.jsx(
|
|
191
234
|
"img",
|
|
192
235
|
{
|
|
193
|
-
src: `https://imagedelivery.net/${
|
|
236
|
+
src: `https://imagedelivery.net/${v[0]}/w=1000`,
|
|
194
237
|
alt: "image",
|
|
195
238
|
width: 16,
|
|
196
239
|
height: 16
|
|
197
240
|
}
|
|
198
241
|
) : /* @__PURE__ */ t.jsx(
|
|
199
|
-
|
|
242
|
+
j,
|
|
200
243
|
{
|
|
201
244
|
name: "Image",
|
|
202
245
|
width: 16,
|
|
@@ -205,12 +248,12 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
205
248
|
}
|
|
206
249
|
);
|
|
207
250
|
}
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
if (!
|
|
211
|
-
const
|
|
251
|
+
const f = (v, M = !1) => {
|
|
252
|
+
const O = l.find((h) => h.id === v);
|
|
253
|
+
if (!O) return;
|
|
254
|
+
const I = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
212
255
|
m && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
213
|
-
|
|
256
|
+
j,
|
|
214
257
|
{
|
|
215
258
|
name: "DotsSixVertical",
|
|
216
259
|
hoverable: !0,
|
|
@@ -219,56 +262,77 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
219
262
|
}
|
|
220
263
|
) }),
|
|
221
264
|
/* @__PURE__ */ t.jsx(
|
|
222
|
-
|
|
265
|
+
rt,
|
|
223
266
|
{
|
|
224
|
-
onChange: (
|
|
225
|
-
const
|
|
226
|
-
if (!
|
|
227
|
-
const
|
|
228
|
-
i([...
|
|
267
|
+
onChange: (h) => {
|
|
268
|
+
const $ = [...n], P = l.find((A) => A.name === h);
|
|
269
|
+
if (!P) return;
|
|
270
|
+
const y = P.id, N = $.map((A) => A === v ? y : A);
|
|
271
|
+
i([...N]);
|
|
229
272
|
},
|
|
230
|
-
value:
|
|
231
|
-
options:
|
|
232
|
-
leftAddon:
|
|
273
|
+
value: O.name,
|
|
274
|
+
options: l.filter((h) => !n.find(($) => $ === h.id)).map((h) => h.name),
|
|
275
|
+
leftAddon: E(O.images)
|
|
233
276
|
}
|
|
234
277
|
),
|
|
235
|
-
|
|
236
|
-
|
|
278
|
+
M && /* @__PURE__ */ t.jsx("div", { className: Q.buttons, children: /* @__PURE__ */ t.jsx("div", { className: Q.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
279
|
+
j,
|
|
237
280
|
{
|
|
238
281
|
name: "Trash",
|
|
239
282
|
hoverable: !0,
|
|
240
283
|
width: 20,
|
|
241
284
|
height: 20,
|
|
242
285
|
fill: "#C12A2A",
|
|
243
|
-
onClick: () => i(n.filter((
|
|
286
|
+
onClick: () => i(n.filter((h) => h !== v))
|
|
244
287
|
}
|
|
245
288
|
) }) })
|
|
246
289
|
] });
|
|
247
|
-
return /* @__PURE__ */ t.jsx(
|
|
290
|
+
return m ? /* @__PURE__ */ t.jsx(
|
|
291
|
+
Ie,
|
|
292
|
+
{
|
|
293
|
+
id: v,
|
|
294
|
+
children: I
|
|
295
|
+
},
|
|
296
|
+
v
|
|
297
|
+
) : /* @__PURE__ */ t.jsx(
|
|
248
298
|
"div",
|
|
249
299
|
{
|
|
250
|
-
className:
|
|
251
|
-
children:
|
|
300
|
+
className: Q.product,
|
|
301
|
+
children: I
|
|
252
302
|
},
|
|
253
|
-
|
|
303
|
+
v
|
|
254
304
|
);
|
|
255
305
|
};
|
|
256
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
257
|
-
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className:
|
|
258
|
-
u && /* @__PURE__ */ t.jsx("h3", { className:
|
|
306
|
+
return /* @__PURE__ */ t.jsxs("div", { className: Q.productsBlock, children: [
|
|
307
|
+
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: Q.top, children: [
|
|
308
|
+
u && /* @__PURE__ */ t.jsx("h3", { className: Q.title, children: u }),
|
|
259
309
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
260
|
-
|
|
310
|
+
ot,
|
|
261
311
|
{
|
|
262
312
|
current: s,
|
|
263
|
-
onChange: (
|
|
313
|
+
onChange: (v) => e == null ? void 0 : e(v)
|
|
264
314
|
}
|
|
265
315
|
)
|
|
266
316
|
] }),
|
|
267
|
-
|
|
268
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
317
|
+
a && b && /* @__PURE__ */ t.jsx(St, { ...b }),
|
|
318
|
+
/* @__PURE__ */ t.jsxs("div", { className: Q.products, children: [
|
|
319
|
+
r && /* @__PURE__ */ t.jsx("h5", { className: Q.subtitle, children: r }),
|
|
320
|
+
m ? /* @__PURE__ */ t.jsx(
|
|
321
|
+
pt,
|
|
322
|
+
{
|
|
323
|
+
sensors: k,
|
|
324
|
+
onDragEnd: q,
|
|
325
|
+
children: /* @__PURE__ */ t.jsx(
|
|
326
|
+
_t,
|
|
327
|
+
{
|
|
328
|
+
items: n,
|
|
329
|
+
strategy: gt,
|
|
330
|
+
children: n.map((v) => f(v, g))
|
|
331
|
+
}
|
|
332
|
+
)
|
|
333
|
+
}
|
|
334
|
+
) : n.map((v) => f(v, g)),
|
|
335
|
+
B && /* @__PURE__ */ t.jsx(
|
|
272
336
|
"div",
|
|
273
337
|
{
|
|
274
338
|
style: {
|
|
@@ -278,33 +342,33 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
278
342
|
gap: 5
|
|
279
343
|
},
|
|
280
344
|
children: /* @__PURE__ */ t.jsx(
|
|
281
|
-
|
|
345
|
+
ct,
|
|
282
346
|
{
|
|
283
347
|
withoutHover: !0,
|
|
284
|
-
className:
|
|
285
|
-
[
|
|
348
|
+
className: V(Q.button, {
|
|
349
|
+
[Q.disabled]: !!(d && d <= n.length || n.length === l.length)
|
|
286
350
|
}),
|
|
287
351
|
size: "s",
|
|
288
|
-
disabled: !!(
|
|
352
|
+
disabled: !!(d && d <= n.length || n.length === l.length),
|
|
289
353
|
onClick: () => {
|
|
290
|
-
const
|
|
291
|
-
let
|
|
292
|
-
if (
|
|
293
|
-
for (let
|
|
294
|
-
if (!n.find((
|
|
295
|
-
|
|
354
|
+
const v = [...n];
|
|
355
|
+
let M = null;
|
|
356
|
+
if (l) {
|
|
357
|
+
for (let O = 0; O < l.length; O++)
|
|
358
|
+
if (!n.find((I) => I === l[O].id)) {
|
|
359
|
+
M = l[O];
|
|
296
360
|
break;
|
|
297
361
|
}
|
|
298
362
|
}
|
|
299
|
-
|
|
363
|
+
v.push((M == null ? void 0 : M.id) || l[0].id), i(v);
|
|
300
364
|
},
|
|
301
365
|
style: {
|
|
302
366
|
width: "fit-content"
|
|
303
367
|
},
|
|
304
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
368
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: Q.addButton, children: [
|
|
305
369
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
306
370
|
/* @__PURE__ */ t.jsx(
|
|
307
|
-
|
|
371
|
+
j,
|
|
308
372
|
{
|
|
309
373
|
name: "Plus",
|
|
310
374
|
width: 16,
|
|
@@ -317,14 +381,14 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
317
381
|
}
|
|
318
382
|
)
|
|
319
383
|
] }),
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
384
|
+
c !== void 0 && /* @__PURE__ */ t.jsx(It, { items: c }),
|
|
385
|
+
S !== void 0 && /* @__PURE__ */ t.jsx(
|
|
386
|
+
yt,
|
|
323
387
|
{
|
|
324
388
|
label: "Auto scroll interval",
|
|
325
389
|
type: "number",
|
|
326
|
-
value: String(
|
|
327
|
-
onChange: (
|
|
390
|
+
value: String(S.scrollInterval),
|
|
391
|
+
onChange: (v) => S.setScrollInterval(Number(v)),
|
|
328
392
|
min: 0.1,
|
|
329
393
|
max: 100,
|
|
330
394
|
style: {
|
|
@@ -334,44 +398,44 @@ const Et = "_wrapper_1vmyb_2", Dt = "_alignmentBlock_1vmyb_8", Rt = "_title_1vmy
|
|
|
334
398
|
}
|
|
335
399
|
)
|
|
336
400
|
] });
|
|
337
|
-
},
|
|
338
|
-
title:
|
|
339
|
-
subtitle:
|
|
340
|
-
header:
|
|
341
|
-
text:
|
|
342
|
-
productsBlock:
|
|
343
|
-
top:
|
|
344
|
-
itemsBlock:
|
|
345
|
-
typeTexts:
|
|
346
|
-
block:
|
|
347
|
-
active:
|
|
348
|
-
products:
|
|
349
|
-
product:
|
|
350
|
-
button:
|
|
351
|
-
disabled:
|
|
352
|
-
image:
|
|
353
|
-
info:
|
|
354
|
-
name:
|
|
355
|
-
buttons:
|
|
356
|
-
modal:
|
|
357
|
-
link:
|
|
358
|
-
modalOptions:
|
|
359
|
-
addButton:
|
|
360
|
-
deleteButton:
|
|
361
|
-
closeIcon:
|
|
401
|
+
}, Ne = "_title_roi3a_1", ke = "_subtitle_roi3a_5", Ce = "_header_roi3a_12", Se = "_text_roi3a_13", $e = "_productsBlock_roi3a_14", we = "_top_roi3a_26", qe = "_itemsBlock_roi3a_35", Be = "_typeTexts_roi3a_41", Pe = "_block_roi3a_48", Te = "_active_roi3a_61", Me = "_products_roi3a_14", Ae = "_product_roi3a_14", Oe = "_button_roi3a_80", Ee = "_disabled_roi3a_91", De = "_image_roi3a_95", Re = "_info_roi3a_102", Le = "_name_roi3a_114", ze = "_buttons_roi3a_118", Fe = "_modal_roi3a_125", Ve = "_link_roi3a_145", Ue = "_modalOptions_roi3a_151", He = "_addButton_roi3a_164", Ye = "_deleteButton_roi3a_179", We = "_closeIcon_roi3a_191", Y = {
|
|
402
|
+
title: Ne,
|
|
403
|
+
subtitle: ke,
|
|
404
|
+
header: Ce,
|
|
405
|
+
text: Se,
|
|
406
|
+
productsBlock: $e,
|
|
407
|
+
top: we,
|
|
408
|
+
itemsBlock: qe,
|
|
409
|
+
typeTexts: Be,
|
|
410
|
+
block: Pe,
|
|
411
|
+
active: Te,
|
|
412
|
+
products: Me,
|
|
413
|
+
product: Ae,
|
|
414
|
+
button: Oe,
|
|
415
|
+
disabled: Ee,
|
|
416
|
+
image: De,
|
|
417
|
+
info: Re,
|
|
418
|
+
name: Le,
|
|
419
|
+
buttons: ze,
|
|
420
|
+
modal: Fe,
|
|
421
|
+
link: Ve,
|
|
422
|
+
modalOptions: Ue,
|
|
423
|
+
addButton: He,
|
|
424
|
+
deleteButton: Ye,
|
|
425
|
+
closeIcon: We
|
|
362
426
|
};
|
|
363
|
-
function
|
|
427
|
+
function Ge({ product: o, children: s }) {
|
|
364
428
|
const {
|
|
365
429
|
attributes: e,
|
|
366
430
|
listeners: n,
|
|
367
431
|
setNodeRef: i,
|
|
368
|
-
transform:
|
|
432
|
+
transform: c,
|
|
369
433
|
transition: u,
|
|
370
|
-
isDragging:
|
|
371
|
-
} =
|
|
372
|
-
id:
|
|
434
|
+
isDragging: r
|
|
435
|
+
} = ft({
|
|
436
|
+
id: o.id
|
|
373
437
|
}), m = {
|
|
374
|
-
transform:
|
|
438
|
+
transform: xt.Transform.toString(c),
|
|
375
439
|
transition: u
|
|
376
440
|
};
|
|
377
441
|
return /* @__PURE__ */ t.jsx(
|
|
@@ -379,64 +443,64 @@ function Fe({ product: r, children: s }) {
|
|
|
379
443
|
{
|
|
380
444
|
ref: i,
|
|
381
445
|
style: m,
|
|
382
|
-
className: `${
|
|
446
|
+
className: `${Y.product} ${r ? Y.dragging : ""}`,
|
|
383
447
|
...e,
|
|
384
448
|
...n,
|
|
385
449
|
children: s
|
|
386
450
|
}
|
|
387
451
|
);
|
|
388
452
|
}
|
|
389
|
-
const
|
|
453
|
+
const Di = (o) => {
|
|
390
454
|
const {
|
|
391
455
|
isActiveItems: s,
|
|
392
456
|
setIsActiveItems: e,
|
|
393
457
|
items: n,
|
|
394
458
|
setItems: i,
|
|
395
|
-
title:
|
|
459
|
+
title: c,
|
|
396
460
|
subtitle: u,
|
|
397
|
-
editable:
|
|
461
|
+
editable: r = !0,
|
|
398
462
|
draggable: m = !1,
|
|
399
|
-
deletable:
|
|
400
|
-
addable:
|
|
401
|
-
itemsType:
|
|
402
|
-
itemsOptions:
|
|
403
|
-
addableOptions:
|
|
404
|
-
limit:
|
|
405
|
-
} =
|
|
406
|
-
|
|
463
|
+
deletable: p = !0,
|
|
464
|
+
addable: B = !0,
|
|
465
|
+
itemsType: l,
|
|
466
|
+
itemsOptions: a,
|
|
467
|
+
addableOptions: b = {},
|
|
468
|
+
limit: d
|
|
469
|
+
} = o, [S, g] = x.useState(null), [k, q] = x.useState(null), E = x.useRef(null), f = ut(
|
|
470
|
+
mt(ht, {
|
|
407
471
|
activationConstraint: {
|
|
408
472
|
distance: 5
|
|
409
473
|
}
|
|
410
474
|
})
|
|
411
475
|
);
|
|
412
|
-
|
|
413
|
-
if (
|
|
414
|
-
const
|
|
415
|
-
i(
|
|
476
|
+
x.useEffect(() => {
|
|
477
|
+
if (S) {
|
|
478
|
+
const I = [...n].map((h) => h.id === S.id ? S : h);
|
|
479
|
+
i(I);
|
|
416
480
|
}
|
|
417
|
-
}, [
|
|
418
|
-
|
|
419
|
-
}, [
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
top:
|
|
425
|
-
left:
|
|
426
|
-
}),
|
|
427
|
-
},
|
|
428
|
-
const { active:
|
|
429
|
-
if (
|
|
430
|
-
const
|
|
431
|
-
if (
|
|
432
|
-
const
|
|
433
|
-
|
|
481
|
+
}, [S]), x.useEffect(() => {
|
|
482
|
+
E.current && k && (E.current.getBoundingClientRect().height, k.top);
|
|
483
|
+
}, [E.current, k]);
|
|
484
|
+
const v = (I, h) => {
|
|
485
|
+
I.stopPropagation();
|
|
486
|
+
const $ = I.target.getBoundingClientRect();
|
|
487
|
+
q({
|
|
488
|
+
top: $.top + window.scrollY,
|
|
489
|
+
left: $.left - 30
|
|
490
|
+
}), g(h);
|
|
491
|
+
}, M = (I) => {
|
|
492
|
+
const { active: h, over: $ } = I;
|
|
493
|
+
if ($ && h.id !== $.id) {
|
|
494
|
+
const P = n.findIndex((N) => N.id === h.id), y = n.findIndex((N) => N.id === $.id);
|
|
495
|
+
if (P !== -1 && y !== -1) {
|
|
496
|
+
const N = [...n], [A] = N.splice(P, 1);
|
|
497
|
+
N.splice(y, 0, A), i(N);
|
|
434
498
|
}
|
|
435
499
|
}
|
|
436
|
-
},
|
|
437
|
-
const
|
|
500
|
+
}, O = (I, h) => {
|
|
501
|
+
const $ = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
438
502
|
m && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
439
|
-
|
|
503
|
+
j,
|
|
440
504
|
{
|
|
441
505
|
name: "DotsSixVertical",
|
|
442
506
|
hoverable: !0,
|
|
@@ -444,99 +508,99 @@ const ii = (r) => {
|
|
|
444
508
|
height: 20
|
|
445
509
|
}
|
|
446
510
|
) }),
|
|
447
|
-
|
|
448
|
-
|
|
511
|
+
l === "select" && a && /* @__PURE__ */ t.jsx(
|
|
512
|
+
rt,
|
|
449
513
|
{
|
|
450
|
-
onChange: (
|
|
451
|
-
const
|
|
452
|
-
if (!
|
|
453
|
-
const A =
|
|
454
|
-
...
|
|
514
|
+
onChange: (P) => {
|
|
515
|
+
const y = [...n], N = a.find((U) => U.name === P);
|
|
516
|
+
if (!N) return;
|
|
517
|
+
const A = y.map((U) => U.id === I.id ? {
|
|
518
|
+
...N,
|
|
455
519
|
name: {
|
|
456
|
-
"en-US":
|
|
520
|
+
"en-US": P
|
|
457
521
|
}
|
|
458
522
|
} : U);
|
|
459
|
-
|
|
460
|
-
...
|
|
523
|
+
g({
|
|
524
|
+
...I,
|
|
461
525
|
name: {
|
|
462
|
-
"en-US":
|
|
526
|
+
"en-US": P
|
|
463
527
|
}
|
|
464
528
|
}), i([...A]);
|
|
465
529
|
},
|
|
466
|
-
value:
|
|
467
|
-
options:
|
|
530
|
+
value: I.name,
|
|
531
|
+
options: a.filter((P) => !n.find((y) => y.name === P.name)).map((P) => P.name)
|
|
468
532
|
}
|
|
469
533
|
),
|
|
470
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
471
|
-
|
|
472
|
-
|
|
534
|
+
/* @__PURE__ */ t.jsxs("div", { className: Y.buttons, children: [
|
|
535
|
+
r && /* @__PURE__ */ t.jsx("div", { className: Y.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
536
|
+
j,
|
|
473
537
|
{
|
|
474
538
|
name: "Sliders",
|
|
475
539
|
hoverable: !0,
|
|
476
540
|
width: 20,
|
|
477
541
|
height: 20,
|
|
478
|
-
onClick: (
|
|
542
|
+
onClick: (P) => v(P, I)
|
|
479
543
|
}
|
|
480
544
|
) }),
|
|
481
|
-
|
|
482
|
-
|
|
545
|
+
p && /* @__PURE__ */ t.jsx("div", { className: Y.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
546
|
+
j,
|
|
483
547
|
{
|
|
484
548
|
name: "Trash",
|
|
485
549
|
hoverable: !0,
|
|
486
550
|
width: 20,
|
|
487
551
|
height: 20,
|
|
488
552
|
fill: "#C12A2A",
|
|
489
|
-
onClick: () => i(n.filter((
|
|
553
|
+
onClick: () => i(n.filter((P) => P.id !== I.id))
|
|
490
554
|
}
|
|
491
555
|
) })
|
|
492
556
|
] })
|
|
493
557
|
] });
|
|
494
558
|
return m ? /* @__PURE__ */ t.jsx(
|
|
495
|
-
|
|
559
|
+
Ge,
|
|
496
560
|
{
|
|
497
|
-
product:
|
|
498
|
-
index:
|
|
499
|
-
children:
|
|
561
|
+
product: I,
|
|
562
|
+
index: h,
|
|
563
|
+
children: $
|
|
500
564
|
},
|
|
501
|
-
|
|
565
|
+
I.id
|
|
502
566
|
) : /* @__PURE__ */ t.jsx(
|
|
503
567
|
"div",
|
|
504
568
|
{
|
|
505
|
-
className:
|
|
506
|
-
children:
|
|
569
|
+
className: Y.product,
|
|
570
|
+
children: $
|
|
507
571
|
},
|
|
508
|
-
|
|
572
|
+
I.id
|
|
509
573
|
);
|
|
510
574
|
};
|
|
511
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
512
|
-
(
|
|
513
|
-
|
|
575
|
+
return /* @__PURE__ */ t.jsxs("div", { className: Y.productsBlock, children: [
|
|
576
|
+
(c || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: Y.top, children: [
|
|
577
|
+
c && /* @__PURE__ */ t.jsx("h3", { className: Y.title, children: c }),
|
|
514
578
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
515
|
-
|
|
579
|
+
ot,
|
|
516
580
|
{
|
|
517
581
|
current: s,
|
|
518
|
-
onChange: (
|
|
582
|
+
onChange: (I) => e == null ? void 0 : e(I)
|
|
519
583
|
}
|
|
520
584
|
)
|
|
521
585
|
] }),
|
|
522
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
523
|
-
u && /* @__PURE__ */ t.jsx("h5", { className:
|
|
586
|
+
/* @__PURE__ */ t.jsxs("div", { className: Y.products, children: [
|
|
587
|
+
u && /* @__PURE__ */ t.jsx("h5", { className: Y.subtitle, children: u }),
|
|
524
588
|
m ? /* @__PURE__ */ t.jsx(
|
|
525
|
-
|
|
589
|
+
pt,
|
|
526
590
|
{
|
|
527
|
-
sensors:
|
|
528
|
-
onDragEnd:
|
|
591
|
+
sensors: f,
|
|
592
|
+
onDragEnd: M,
|
|
529
593
|
children: /* @__PURE__ */ t.jsx(
|
|
530
|
-
|
|
594
|
+
_t,
|
|
531
595
|
{
|
|
532
|
-
items: n.map((
|
|
533
|
-
strategy:
|
|
534
|
-
children: n.map((
|
|
596
|
+
items: n.map((I) => I.id),
|
|
597
|
+
strategy: gt,
|
|
598
|
+
children: n.map((I, h) => O(I, h))
|
|
535
599
|
}
|
|
536
600
|
)
|
|
537
601
|
}
|
|
538
|
-
) : n.map((
|
|
539
|
-
|
|
602
|
+
) : n.map((I, h) => O(I, h)),
|
|
603
|
+
B && /* @__PURE__ */ t.jsx(
|
|
540
604
|
"div",
|
|
541
605
|
{
|
|
542
606
|
style: {
|
|
@@ -545,37 +609,37 @@ const ii = (r) => {
|
|
|
545
609
|
justifyContent: "center"
|
|
546
610
|
},
|
|
547
611
|
children: /* @__PURE__ */ t.jsx(
|
|
548
|
-
|
|
612
|
+
ct,
|
|
549
613
|
{
|
|
550
614
|
withoutHover: !0,
|
|
551
|
-
className:
|
|
552
|
-
[
|
|
615
|
+
className: V(Y.button, {
|
|
616
|
+
[Y.disabled]: !!(d && d <= n.length || n.length === (a == null ? void 0 : a.length))
|
|
553
617
|
}),
|
|
554
618
|
size: "s",
|
|
555
|
-
disabled: !!(
|
|
619
|
+
disabled: !!(d && d <= n.length || n.length === (a == null ? void 0 : a.length)),
|
|
556
620
|
onClick: () => {
|
|
557
|
-
const
|
|
558
|
-
let
|
|
559
|
-
if (
|
|
560
|
-
for (let
|
|
561
|
-
if (!n.find((
|
|
562
|
-
|
|
621
|
+
const I = [...n];
|
|
622
|
+
let h = null;
|
|
623
|
+
if (a) {
|
|
624
|
+
for (let $ = 0; $ < a.length; $++)
|
|
625
|
+
if (!n.find((P) => P.id === a[$].id)) {
|
|
626
|
+
h = a[$];
|
|
563
627
|
break;
|
|
564
628
|
}
|
|
565
629
|
}
|
|
566
|
-
|
|
567
|
-
name:
|
|
568
|
-
id: (
|
|
569
|
-
...
|
|
570
|
-
}), i(
|
|
630
|
+
l === "select" && a && I.push({
|
|
631
|
+
name: h ? h.name : a[0].name,
|
|
632
|
+
id: (h == null ? void 0 : h.id) || a[0].id,
|
|
633
|
+
...b
|
|
634
|
+
}), i(I);
|
|
571
635
|
},
|
|
572
636
|
style: {
|
|
573
637
|
width: "fit-content"
|
|
574
638
|
},
|
|
575
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
639
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: Y.addButton, children: [
|
|
576
640
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
577
641
|
/* @__PURE__ */ t.jsx(
|
|
578
|
-
|
|
642
|
+
j,
|
|
579
643
|
{
|
|
580
644
|
name: "Plus",
|
|
581
645
|
width: 16,
|
|
@@ -590,99 +654,99 @@ const ii = (r) => {
|
|
|
590
654
|
] })
|
|
591
655
|
] });
|
|
592
656
|
};
|
|
593
|
-
function
|
|
594
|
-
const { product: s, children: e } =
|
|
657
|
+
function Qe(o) {
|
|
658
|
+
const { product: s, children: e } = o, { attributes: n, listeners: i, setNodeRef: c, transform: u, transition: r, isDragging: m } = ft({
|
|
595
659
|
id: s.id
|
|
596
|
-
}),
|
|
597
|
-
transform:
|
|
598
|
-
transition:
|
|
660
|
+
}), p = {
|
|
661
|
+
transform: xt.Transform.toString(u),
|
|
662
|
+
transition: r
|
|
599
663
|
};
|
|
600
664
|
return /* @__PURE__ */ t.jsx(
|
|
601
665
|
"div",
|
|
602
666
|
{
|
|
603
|
-
ref:
|
|
604
|
-
style:
|
|
605
|
-
className: `${
|
|
667
|
+
ref: c,
|
|
668
|
+
style: p,
|
|
669
|
+
className: `${H.product} ${m ? H.dragging : ""}`,
|
|
606
670
|
...n,
|
|
607
671
|
...i,
|
|
608
672
|
children: e
|
|
609
673
|
}
|
|
610
674
|
);
|
|
611
675
|
}
|
|
612
|
-
const
|
|
676
|
+
const Ri = (o) => {
|
|
613
677
|
const {
|
|
614
678
|
isActiveItems: s,
|
|
615
679
|
setIsActiveItems: e,
|
|
616
680
|
items: n,
|
|
617
681
|
setItems: i,
|
|
618
|
-
other:
|
|
682
|
+
other: c,
|
|
619
683
|
title: u,
|
|
620
|
-
subtitle:
|
|
684
|
+
subtitle: r,
|
|
621
685
|
editable: m = !0,
|
|
622
|
-
draggable:
|
|
623
|
-
withImage:
|
|
624
|
-
deletable:
|
|
625
|
-
addable:
|
|
626
|
-
itemsType:
|
|
627
|
-
itemsPlaceholder:
|
|
628
|
-
itemsOptions:
|
|
629
|
-
hasRangeSelector:
|
|
630
|
-
rangeSelectorOptions:
|
|
631
|
-
modalOptions:
|
|
632
|
-
addableOptions:
|
|
633
|
-
limit:
|
|
634
|
-
} =
|
|
686
|
+
draggable: p = !1,
|
|
687
|
+
withImage: B = !1,
|
|
688
|
+
deletable: l = !0,
|
|
689
|
+
addable: a = !0,
|
|
690
|
+
itemsType: b,
|
|
691
|
+
itemsPlaceholder: d = "",
|
|
692
|
+
itemsOptions: S,
|
|
693
|
+
hasRangeSelector: g = !1,
|
|
694
|
+
rangeSelectorOptions: k,
|
|
695
|
+
modalOptions: q,
|
|
696
|
+
addableOptions: E = {},
|
|
697
|
+
limit: f
|
|
698
|
+
} = o, [v, M] = x.useState(null), [O, I] = x.useState({
|
|
635
699
|
top: 0,
|
|
636
700
|
left: 0
|
|
637
|
-
}), [
|
|
638
|
-
|
|
701
|
+
}), [h, $] = x.useState(null), P = x.useRef(null), [y, N] = x.useState(!1), A = ut(
|
|
702
|
+
mt(ht, {
|
|
639
703
|
activationConstraint: {
|
|
640
704
|
distance: 5
|
|
641
705
|
}
|
|
642
706
|
})
|
|
643
707
|
);
|
|
644
|
-
|
|
645
|
-
const
|
|
646
|
-
|
|
708
|
+
x.useEffect(() => {
|
|
709
|
+
const _ = () => {
|
|
710
|
+
M(null), N(!1);
|
|
647
711
|
};
|
|
648
|
-
return document.body.addEventListener("click",
|
|
649
|
-
|
|
712
|
+
return document.body.addEventListener("click", _), M(null), N(!1), () => {
|
|
713
|
+
M(null), N(!1), document.body.removeEventListener("click", _);
|
|
650
714
|
};
|
|
651
|
-
}, []),
|
|
652
|
-
if (
|
|
653
|
-
const
|
|
654
|
-
i(
|
|
715
|
+
}, []), x.useEffect(() => {
|
|
716
|
+
if (v) {
|
|
717
|
+
const _ = [...n].map((R) => R.id === v.id ? v : R);
|
|
718
|
+
i(_);
|
|
655
719
|
}
|
|
656
|
-
}, [
|
|
657
|
-
if (
|
|
658
|
-
const
|
|
659
|
-
let
|
|
660
|
-
|
|
661
|
-
top:
|
|
662
|
-
left:
|
|
720
|
+
}, [v]), x.useEffect(() => {
|
|
721
|
+
if (P.current && h) {
|
|
722
|
+
const _ = P.current.getBoundingClientRect().height, R = window.innerHeight;
|
|
723
|
+
let T = h.top;
|
|
724
|
+
T + _ > R + window.scrollY - 200 && (T = R + window.scrollY - _ - 200), T < 0 && (T = 10), I({
|
|
725
|
+
top: T,
|
|
726
|
+
left: h.left
|
|
663
727
|
});
|
|
664
728
|
}
|
|
665
|
-
}, [
|
|
666
|
-
const U = (
|
|
667
|
-
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
top:
|
|
671
|
-
left:
|
|
672
|
-
}),
|
|
729
|
+
}, [P.current, h]);
|
|
730
|
+
const U = (_, R) => {
|
|
731
|
+
_.stopPropagation();
|
|
732
|
+
const T = _.target.getBoundingClientRect();
|
|
733
|
+
$({
|
|
734
|
+
top: T.top + window.scrollY,
|
|
735
|
+
left: T.left - 30
|
|
736
|
+
}), M(R), N(!0);
|
|
673
737
|
};
|
|
674
|
-
function
|
|
675
|
-
if (
|
|
676
|
-
return
|
|
738
|
+
function D(_) {
|
|
739
|
+
if (B)
|
|
740
|
+
return _ ? /* @__PURE__ */ t.jsx(
|
|
677
741
|
"img",
|
|
678
742
|
{
|
|
679
|
-
src: `https://imagedelivery.net/${
|
|
743
|
+
src: `https://imagedelivery.net/${_[0]}/w=1000`,
|
|
680
744
|
alt: "image",
|
|
681
745
|
width: 16,
|
|
682
746
|
height: 16
|
|
683
747
|
}
|
|
684
748
|
) : /* @__PURE__ */ t.jsx(
|
|
685
|
-
|
|
749
|
+
j,
|
|
686
750
|
{
|
|
687
751
|
name: "Image",
|
|
688
752
|
width: 16,
|
|
@@ -691,20 +755,20 @@ const oi = (r) => {
|
|
|
691
755
|
}
|
|
692
756
|
);
|
|
693
757
|
}
|
|
694
|
-
const
|
|
695
|
-
const { active:
|
|
696
|
-
if (
|
|
697
|
-
const
|
|
698
|
-
if (
|
|
699
|
-
const
|
|
700
|
-
|
|
758
|
+
const z = (_) => {
|
|
759
|
+
const { active: R, over: T } = _;
|
|
760
|
+
if (T && R.id !== T.id) {
|
|
761
|
+
const L = n.findIndex((W) => W.id === R.id), nt = n.findIndex((W) => W.id === T.id);
|
|
762
|
+
if (L !== -1 && nt !== -1) {
|
|
763
|
+
const W = [...n], [K] = W.splice(L, 1);
|
|
764
|
+
W.splice(nt, 0, K), i(W);
|
|
701
765
|
}
|
|
702
766
|
}
|
|
703
|
-
},
|
|
704
|
-
var
|
|
705
|
-
const
|
|
706
|
-
|
|
707
|
-
|
|
767
|
+
}, Z = (_) => {
|
|
768
|
+
var T;
|
|
769
|
+
const R = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
770
|
+
p && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
771
|
+
j,
|
|
708
772
|
{
|
|
709
773
|
name: "DotsSixVertical",
|
|
710
774
|
hoverable: !0,
|
|
@@ -712,140 +776,140 @@ const oi = (r) => {
|
|
|
712
776
|
height: 20
|
|
713
777
|
}
|
|
714
778
|
) }),
|
|
715
|
-
|
|
716
|
-
|
|
779
|
+
b === "select" && S && /* @__PURE__ */ t.jsx(
|
|
780
|
+
rt,
|
|
717
781
|
{
|
|
718
|
-
onChange: (
|
|
719
|
-
const
|
|
720
|
-
...
|
|
782
|
+
onChange: (L) => {
|
|
783
|
+
const W = [...n].map((K) => K.id === _.id ? {
|
|
784
|
+
..._,
|
|
721
785
|
name: {
|
|
722
|
-
"en-US":
|
|
786
|
+
"en-US": L
|
|
723
787
|
}
|
|
724
788
|
} : K);
|
|
725
|
-
|
|
726
|
-
...
|
|
789
|
+
M({
|
|
790
|
+
..._,
|
|
727
791
|
name: {
|
|
728
|
-
"en-US":
|
|
792
|
+
"en-US": L
|
|
729
793
|
}
|
|
730
|
-
}), i([...
|
|
794
|
+
}), i([...W]);
|
|
731
795
|
},
|
|
732
|
-
value:
|
|
733
|
-
options:
|
|
734
|
-
(
|
|
796
|
+
value: _.name["en-US"],
|
|
797
|
+
options: S.filter(
|
|
798
|
+
(L) => !n.find((nt) => nt.name["en-US"] === L)
|
|
735
799
|
),
|
|
736
|
-
leftAddon:
|
|
800
|
+
leftAddon: D(_.images)
|
|
737
801
|
}
|
|
738
802
|
),
|
|
739
|
-
|
|
740
|
-
|
|
803
|
+
b === "input" && /* @__PURE__ */ t.jsx(
|
|
804
|
+
yt,
|
|
741
805
|
{
|
|
742
|
-
onChange: (
|
|
743
|
-
const
|
|
744
|
-
...
|
|
806
|
+
onChange: (L) => {
|
|
807
|
+
const W = [...n].map((K) => K.id === _.id ? {
|
|
808
|
+
..._,
|
|
745
809
|
name: {
|
|
746
|
-
"en-US":
|
|
810
|
+
"en-US": L
|
|
747
811
|
}
|
|
748
812
|
} : K);
|
|
749
|
-
i([...
|
|
813
|
+
i([...W]);
|
|
750
814
|
},
|
|
751
|
-
value:
|
|
752
|
-
placeholder:
|
|
815
|
+
value: _.name["en-US"],
|
|
816
|
+
placeholder: d
|
|
753
817
|
}
|
|
754
818
|
),
|
|
755
|
-
|
|
756
|
-
|
|
819
|
+
b === "image" && /* @__PURE__ */ t.jsx(
|
|
820
|
+
Tt,
|
|
757
821
|
{
|
|
758
|
-
onChange: (
|
|
759
|
-
const
|
|
760
|
-
...
|
|
761
|
-
images:
|
|
822
|
+
onChange: (L) => {
|
|
823
|
+
const W = [...n].map((K) => K.id === _.id ? {
|
|
824
|
+
..._,
|
|
825
|
+
images: L
|
|
762
826
|
} : K);
|
|
763
|
-
i([...
|
|
827
|
+
i([...W]);
|
|
764
828
|
},
|
|
765
|
-
activeImage: (
|
|
829
|
+
activeImage: (T = n.find((L) => L.id === _.id)) == null ? void 0 : T.images[0]
|
|
766
830
|
}
|
|
767
831
|
),
|
|
768
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
769
|
-
m && /* @__PURE__ */ t.jsx("div", { className:
|
|
770
|
-
|
|
832
|
+
/* @__PURE__ */ t.jsxs("div", { className: H.buttons, children: [
|
|
833
|
+
m && /* @__PURE__ */ t.jsx("div", { className: H.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
834
|
+
j,
|
|
771
835
|
{
|
|
772
836
|
name: "Sliders",
|
|
773
837
|
hoverable: !0,
|
|
774
838
|
width: 20,
|
|
775
839
|
height: 20,
|
|
776
|
-
onClick: (
|
|
840
|
+
onClick: (L) => U(L, _)
|
|
777
841
|
}
|
|
778
842
|
) }),
|
|
779
|
-
|
|
780
|
-
|
|
843
|
+
l && /* @__PURE__ */ t.jsx("div", { className: H.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
844
|
+
j,
|
|
781
845
|
{
|
|
782
846
|
name: "Trash",
|
|
783
847
|
hoverable: !0,
|
|
784
848
|
width: 20,
|
|
785
849
|
height: 20,
|
|
786
850
|
fill: "#C12A2A",
|
|
787
|
-
onClick: () => i(n.filter((
|
|
851
|
+
onClick: () => i(n.filter((L) => L.id !== _.id))
|
|
788
852
|
}
|
|
789
853
|
) })
|
|
790
854
|
] })
|
|
791
855
|
] });
|
|
792
|
-
return
|
|
793
|
-
|
|
856
|
+
return p ? /* @__PURE__ */ t.jsx(
|
|
857
|
+
Qe,
|
|
794
858
|
{
|
|
795
|
-
product:
|
|
796
|
-
children:
|
|
859
|
+
product: _,
|
|
860
|
+
children: R
|
|
797
861
|
},
|
|
798
|
-
|
|
862
|
+
_.id
|
|
799
863
|
) : /* @__PURE__ */ t.jsx(
|
|
800
864
|
"div",
|
|
801
865
|
{
|
|
802
|
-
className:
|
|
803
|
-
children:
|
|
866
|
+
className: H.product,
|
|
867
|
+
children: R
|
|
804
868
|
},
|
|
805
|
-
|
|
869
|
+
_.id
|
|
806
870
|
);
|
|
807
871
|
};
|
|
808
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
809
|
-
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className:
|
|
810
|
-
u && /* @__PURE__ */ t.jsx("h3", { className:
|
|
872
|
+
return /* @__PURE__ */ t.jsxs("div", { className: H.productsBlock, children: [
|
|
873
|
+
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: H.top, children: [
|
|
874
|
+
u && /* @__PURE__ */ t.jsx("h3", { className: H.title, children: u }),
|
|
811
875
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
812
|
-
|
|
876
|
+
ot,
|
|
813
877
|
{
|
|
814
878
|
current: s,
|
|
815
|
-
onChange: (
|
|
879
|
+
onChange: (_) => e == null ? void 0 : e(_)
|
|
816
880
|
}
|
|
817
881
|
)
|
|
818
882
|
] }),
|
|
819
|
-
|
|
820
|
-
|
|
883
|
+
v && m && q && y && /* @__PURE__ */ t.jsx(
|
|
884
|
+
Pt,
|
|
821
885
|
{
|
|
822
|
-
ref:
|
|
823
|
-
activeItem:
|
|
824
|
-
setActiveItem:
|
|
825
|
-
popupPosition:
|
|
826
|
-
modalOptions:
|
|
827
|
-
setIsOpenModal:
|
|
886
|
+
ref: P,
|
|
887
|
+
activeItem: v,
|
|
888
|
+
setActiveItem: M,
|
|
889
|
+
popupPosition: O,
|
|
890
|
+
modalOptions: q,
|
|
891
|
+
setIsOpenModal: N
|
|
828
892
|
}
|
|
829
893
|
),
|
|
830
|
-
|
|
831
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
894
|
+
g && k && /* @__PURE__ */ t.jsx(St, { ...k }),
|
|
895
|
+
/* @__PURE__ */ t.jsxs("div", { className: H.products, children: [
|
|
896
|
+
r && /* @__PURE__ */ t.jsx("h5", { className: H.subtitle, children: r }),
|
|
897
|
+
p ? /* @__PURE__ */ t.jsx(
|
|
898
|
+
pt,
|
|
835
899
|
{
|
|
836
900
|
sensors: A,
|
|
837
|
-
onDragEnd:
|
|
901
|
+
onDragEnd: z,
|
|
838
902
|
children: /* @__PURE__ */ t.jsx(
|
|
839
|
-
|
|
903
|
+
_t,
|
|
840
904
|
{
|
|
841
|
-
items: n.map((
|
|
842
|
-
strategy:
|
|
843
|
-
children: n.map((
|
|
905
|
+
items: n.map((_) => _.id),
|
|
906
|
+
strategy: gt,
|
|
907
|
+
children: n.map((_) => Z(_))
|
|
844
908
|
}
|
|
845
909
|
)
|
|
846
910
|
}
|
|
847
|
-
) : n.map((
|
|
848
|
-
|
|
911
|
+
) : n.map((_) => Z(_)),
|
|
912
|
+
a && /* @__PURE__ */ t.jsx(
|
|
849
913
|
"div",
|
|
850
914
|
{
|
|
851
915
|
style: {
|
|
@@ -854,55 +918,55 @@ const oi = (r) => {
|
|
|
854
918
|
justifyContent: "center"
|
|
855
919
|
},
|
|
856
920
|
children: /* @__PURE__ */ t.jsx(
|
|
857
|
-
|
|
921
|
+
ct,
|
|
858
922
|
{
|
|
859
923
|
withoutHover: !0,
|
|
860
|
-
className:
|
|
861
|
-
[
|
|
924
|
+
className: V(H.button, {
|
|
925
|
+
[H.disabled]: !!(f && f <= n.length)
|
|
862
926
|
}),
|
|
863
927
|
size: "s",
|
|
864
|
-
disabled: !!(
|
|
928
|
+
disabled: !!(f && f <= n.length),
|
|
865
929
|
onClick: () => {
|
|
866
|
-
const
|
|
867
|
-
let
|
|
868
|
-
if (
|
|
869
|
-
for (let
|
|
870
|
-
if (!n.find((
|
|
871
|
-
|
|
930
|
+
const _ = [...n];
|
|
931
|
+
let R = null;
|
|
932
|
+
if (S) {
|
|
933
|
+
for (let T = 0; T < S.length; T++)
|
|
934
|
+
if (!n.find((L) => L.name["en-US"] === S[T])) {
|
|
935
|
+
R = S[T];
|
|
872
936
|
break;
|
|
873
937
|
}
|
|
874
938
|
}
|
|
875
|
-
|
|
939
|
+
b === "select" && S ? _.push({
|
|
876
940
|
name: {
|
|
877
|
-
"en-US":
|
|
941
|
+
"en-US": R || S[0]
|
|
878
942
|
},
|
|
879
|
-
id:
|
|
880
|
-
...
|
|
943
|
+
id: at(),
|
|
944
|
+
...E,
|
|
881
945
|
maxSymbols: 100
|
|
882
946
|
// пример значения
|
|
883
|
-
}) :
|
|
947
|
+
}) : b === "input" ? _.push({
|
|
884
948
|
name: {
|
|
885
949
|
"en-US": ""
|
|
886
950
|
},
|
|
887
|
-
id:
|
|
888
|
-
...
|
|
951
|
+
id: at(),
|
|
952
|
+
...E,
|
|
889
953
|
maxSymbols: 100
|
|
890
|
-
}) :
|
|
954
|
+
}) : _.push({
|
|
891
955
|
name: {
|
|
892
956
|
"en-US": `Image ${n.length + 1}`
|
|
893
957
|
},
|
|
894
|
-
id:
|
|
895
|
-
...
|
|
958
|
+
id: at(),
|
|
959
|
+
...E,
|
|
896
960
|
maxSymbols: 100
|
|
897
|
-
}), i(
|
|
961
|
+
}), i(_);
|
|
898
962
|
},
|
|
899
963
|
style: {
|
|
900
964
|
width: "fit-content"
|
|
901
965
|
},
|
|
902
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
966
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: H.addButton, children: [
|
|
903
967
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
904
968
|
/* @__PURE__ */ t.jsx(
|
|
905
|
-
|
|
969
|
+
j,
|
|
906
970
|
{
|
|
907
971
|
name: "Plus",
|
|
908
972
|
width: 16,
|
|
@@ -915,120 +979,120 @@ const oi = (r) => {
|
|
|
915
979
|
}
|
|
916
980
|
)
|
|
917
981
|
] }),
|
|
918
|
-
|
|
982
|
+
c !== void 0 && /* @__PURE__ */ t.jsx(It, { items: c })
|
|
919
983
|
] });
|
|
920
|
-
},
|
|
921
|
-
subtitle:
|
|
922
|
-
header:
|
|
923
|
-
text:
|
|
924
|
-
productsBlock:
|
|
925
|
-
buttonsBlock:
|
|
926
|
-
top:
|
|
927
|
-
itemsBlock:
|
|
928
|
-
typeTexts:
|
|
929
|
-
block:
|
|
930
|
-
active:
|
|
931
|
-
products:
|
|
932
|
-
product:
|
|
933
|
-
button:
|
|
934
|
-
image:
|
|
935
|
-
info:
|
|
936
|
-
name:
|
|
937
|
-
buttons:
|
|
938
|
-
modal:
|
|
939
|
-
other:
|
|
940
|
-
options:
|
|
941
|
-
addButton:
|
|
942
|
-
deleteButton:
|
|
943
|
-
},
|
|
944
|
-
const { buttons: s, setButtons: e, deletable: n = !0, addable: i = !0, editableLink:
|
|
984
|
+
}, Xe = "_subtitle_jql1y_1", Je = "_header_jql1y_8", Ke = "_text_jql1y_9", Ze = "_productsBlock_jql1y_10", tn = "_buttonsBlock_jql1y_11", en = "_top_jql1y_23", nn = "_itemsBlock_jql1y_32", sn = "_typeTexts_jql1y_38", an = "_block_jql1y_45", on = "_active_jql1y_58", cn = "_products_jql1y_10", rn = "_product_jql1y_10", ln = "_button_jql1y_11", dn = "_image_jql1y_88", un = "_info_jql1y_95", mn = "_name_jql1y_107", hn = "_buttons_jql1y_11", pn = "_modal_jql1y_118", _n = "_other_jql1y_138", gn = "_options_jql1y_144", fn = "_addButton_jql1y_150", xn = "_deleteButton_jql1y_165", tt = {
|
|
985
|
+
subtitle: Xe,
|
|
986
|
+
header: Je,
|
|
987
|
+
text: Ke,
|
|
988
|
+
productsBlock: Ze,
|
|
989
|
+
buttonsBlock: tn,
|
|
990
|
+
top: en,
|
|
991
|
+
itemsBlock: nn,
|
|
992
|
+
typeTexts: sn,
|
|
993
|
+
block: an,
|
|
994
|
+
active: on,
|
|
995
|
+
products: cn,
|
|
996
|
+
product: rn,
|
|
997
|
+
button: ln,
|
|
998
|
+
image: dn,
|
|
999
|
+
info: un,
|
|
1000
|
+
name: mn,
|
|
1001
|
+
buttons: hn,
|
|
1002
|
+
modal: pn,
|
|
1003
|
+
other: _n,
|
|
1004
|
+
options: gn,
|
|
1005
|
+
addButton: fn,
|
|
1006
|
+
deleteButton: xn
|
|
1007
|
+
}, vn = (o) => {
|
|
1008
|
+
const { buttons: s, setButtons: e, deletable: n = !0, addable: i = !0, editableLink: c = !0 } = o, { pages: u } = lt(), [r, m] = x.useState(null), [p, B] = x.useState({
|
|
945
1009
|
top: 0,
|
|
946
1010
|
left: 0
|
|
947
|
-
}), [
|
|
948
|
-
|
|
949
|
-
if (
|
|
950
|
-
const
|
|
951
|
-
e(
|
|
1011
|
+
}), [l, a] = x.useState(null), b = x.useRef(null);
|
|
1012
|
+
x.useEffect(() => {
|
|
1013
|
+
if (r) {
|
|
1014
|
+
const g = [...s].map((k) => k.id === r.id ? r : k);
|
|
1015
|
+
e(g);
|
|
952
1016
|
}
|
|
953
|
-
}, [
|
|
954
|
-
if (
|
|
955
|
-
const
|
|
956
|
-
let
|
|
957
|
-
|
|
958
|
-
top:
|
|
959
|
-
left:
|
|
1017
|
+
}, [r]), x.useEffect(() => {
|
|
1018
|
+
if (b.current && l) {
|
|
1019
|
+
const g = b.current.getBoundingClientRect().height, k = window.innerHeight;
|
|
1020
|
+
let q = l.top;
|
|
1021
|
+
q + g > k + window.scrollY - 200 && (q = k + window.scrollY - g - 200), q < 0 && (q = 10), B({
|
|
1022
|
+
top: q,
|
|
1023
|
+
left: l.left
|
|
960
1024
|
});
|
|
961
1025
|
}
|
|
962
|
-
}, [
|
|
963
|
-
const
|
|
964
|
-
|
|
965
|
-
const
|
|
966
|
-
|
|
967
|
-
top:
|
|
968
|
-
left:
|
|
969
|
-
}), m(
|
|
970
|
-
},
|
|
971
|
-
const
|
|
972
|
-
...
|
|
1026
|
+
}, [b.current, l]);
|
|
1027
|
+
const d = (g, k) => {
|
|
1028
|
+
g.stopPropagation();
|
|
1029
|
+
const q = g.target.getBoundingClientRect();
|
|
1030
|
+
a({
|
|
1031
|
+
top: q.top + window.scrollY - 70,
|
|
1032
|
+
left: q.left - (i ? 30 : 65)
|
|
1033
|
+
}), m(k);
|
|
1034
|
+
}, S = (g, k) => {
|
|
1035
|
+
const q = [...s], E = {
|
|
1036
|
+
...g,
|
|
973
1037
|
id: Math.random().toString(36).substr(2, 9)
|
|
974
1038
|
// Генерируем новый уникальный ID
|
|
975
1039
|
};
|
|
976
|
-
|
|
1040
|
+
q.splice(k + 1, 0, E), e(q);
|
|
977
1041
|
};
|
|
978
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
979
|
-
/* @__PURE__ */ t.jsx("h5", { className:
|
|
980
|
-
s.map((
|
|
1042
|
+
return /* @__PURE__ */ t.jsxs("div", { className: tt.products, children: [
|
|
1043
|
+
/* @__PURE__ */ t.jsx("h5", { className: tt.subtitle, children: "Button Type" }),
|
|
1044
|
+
s.map((g, k) => /* @__PURE__ */ t.jsxs(
|
|
981
1045
|
"div",
|
|
982
1046
|
{
|
|
983
|
-
className:
|
|
1047
|
+
className: tt.product,
|
|
984
1048
|
children: [
|
|
985
1049
|
/* @__PURE__ */ t.jsx(
|
|
986
|
-
|
|
1050
|
+
rt,
|
|
987
1051
|
{
|
|
988
|
-
onChange: (
|
|
989
|
-
const
|
|
990
|
-
...
|
|
991
|
-
type:
|
|
992
|
-
} :
|
|
993
|
-
e(
|
|
1052
|
+
onChange: (q) => {
|
|
1053
|
+
const f = [...s].map((v) => v.id === g.id ? {
|
|
1054
|
+
...g,
|
|
1055
|
+
type: q
|
|
1056
|
+
} : v);
|
|
1057
|
+
e(f);
|
|
994
1058
|
},
|
|
995
|
-
value:
|
|
1059
|
+
value: g.type,
|
|
996
1060
|
options: ["Primary", "Secondary", "Tertiary"]
|
|
997
1061
|
}
|
|
998
1062
|
),
|
|
999
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1000
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1001
|
-
|
|
1063
|
+
/* @__PURE__ */ t.jsxs("div", { className: tt.buttons, children: [
|
|
1064
|
+
/* @__PURE__ */ t.jsx("div", { className: tt.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1065
|
+
j,
|
|
1002
1066
|
{
|
|
1003
1067
|
name: "Copy",
|
|
1004
1068
|
hoverable: !0,
|
|
1005
1069
|
width: 20,
|
|
1006
1070
|
height: 20,
|
|
1007
1071
|
onClick: () => {
|
|
1008
|
-
|
|
1072
|
+
S(g, k);
|
|
1009
1073
|
}
|
|
1010
1074
|
}
|
|
1011
1075
|
) }),
|
|
1012
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1013
|
-
|
|
1076
|
+
/* @__PURE__ */ t.jsx("div", { className: tt.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1077
|
+
j,
|
|
1014
1078
|
{
|
|
1015
1079
|
name: "Sliders",
|
|
1016
1080
|
hoverable: !0,
|
|
1017
1081
|
width: 20,
|
|
1018
1082
|
height: 20,
|
|
1019
|
-
onClick: (
|
|
1020
|
-
|
|
1083
|
+
onClick: (q) => {
|
|
1084
|
+
d(q, g);
|
|
1021
1085
|
}
|
|
1022
1086
|
}
|
|
1023
1087
|
) }),
|
|
1024
|
-
n && /* @__PURE__ */ t.jsx("div", { className:
|
|
1025
|
-
|
|
1088
|
+
n && /* @__PURE__ */ t.jsx("div", { className: tt.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1089
|
+
j,
|
|
1026
1090
|
{
|
|
1027
1091
|
name: "Trash",
|
|
1028
1092
|
hoverable: !0,
|
|
1029
1093
|
onClick: () => {
|
|
1030
|
-
const
|
|
1031
|
-
e(
|
|
1094
|
+
const q = s.filter((E) => E.id !== g.id);
|
|
1095
|
+
e(q);
|
|
1032
1096
|
},
|
|
1033
1097
|
width: 20,
|
|
1034
1098
|
height: 20,
|
|
@@ -1038,16 +1102,16 @@ const oi = (r) => {
|
|
|
1038
1102
|
] })
|
|
1039
1103
|
]
|
|
1040
1104
|
},
|
|
1041
|
-
|
|
1105
|
+
g.id
|
|
1042
1106
|
)),
|
|
1043
|
-
|
|
1044
|
-
|
|
1107
|
+
r && /* @__PURE__ */ t.jsx(
|
|
1108
|
+
Mt,
|
|
1045
1109
|
{
|
|
1046
|
-
ref:
|
|
1047
|
-
activeButton:
|
|
1110
|
+
ref: b,
|
|
1111
|
+
activeButton: r,
|
|
1048
1112
|
setActiveButton: m,
|
|
1049
|
-
popupPosition:
|
|
1050
|
-
editableLink:
|
|
1113
|
+
popupPosition: p,
|
|
1114
|
+
editableLink: c
|
|
1051
1115
|
}
|
|
1052
1116
|
),
|
|
1053
1117
|
i && /* @__PURE__ */ t.jsx(
|
|
@@ -1059,16 +1123,16 @@ const oi = (r) => {
|
|
|
1059
1123
|
justifyContent: "center"
|
|
1060
1124
|
},
|
|
1061
1125
|
children: /* @__PURE__ */ t.jsx(
|
|
1062
|
-
|
|
1126
|
+
ct,
|
|
1063
1127
|
{
|
|
1064
1128
|
withoutHover: !0,
|
|
1065
|
-
className:
|
|
1129
|
+
className: tt.button,
|
|
1066
1130
|
size: "s",
|
|
1067
1131
|
onClick: () => {
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1132
|
+
const g = [...s];
|
|
1133
|
+
c ? g.push({
|
|
1070
1134
|
type: "Primary",
|
|
1071
|
-
id:
|
|
1135
|
+
id: at(),
|
|
1072
1136
|
typesText: [],
|
|
1073
1137
|
text: {
|
|
1074
1138
|
"en-US": "Button Name"
|
|
@@ -1076,9 +1140,9 @@ const oi = (r) => {
|
|
|
1076
1140
|
destination: "Go to Page",
|
|
1077
1141
|
page: u ? Object.values(u)[0].path : "/",
|
|
1078
1142
|
openInNewTab: !1
|
|
1079
|
-
}) :
|
|
1143
|
+
}) : g.push({
|
|
1080
1144
|
type: "Primary",
|
|
1081
|
-
id:
|
|
1145
|
+
id: at(),
|
|
1082
1146
|
typesText: [],
|
|
1083
1147
|
text: {
|
|
1084
1148
|
"en-US": "Create Ticket"
|
|
@@ -1086,15 +1150,15 @@ const oi = (r) => {
|
|
|
1086
1150
|
destination: "Go to Page",
|
|
1087
1151
|
page: u ? Object.values(u)[0].path : "/",
|
|
1088
1152
|
openInNewTab: !1
|
|
1089
|
-
}), e(
|
|
1153
|
+
}), e(g);
|
|
1090
1154
|
},
|
|
1091
1155
|
style: {
|
|
1092
1156
|
width: "fit-content"
|
|
1093
1157
|
},
|
|
1094
|
-
children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
1158
|
+
children: /* @__PURE__ */ t.jsxs("div", { className: tt.addButton, children: [
|
|
1095
1159
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
1096
1160
|
/* @__PURE__ */ t.jsx(
|
|
1097
|
-
|
|
1161
|
+
j,
|
|
1098
1162
|
{
|
|
1099
1163
|
name: "Plus",
|
|
1100
1164
|
width: 16,
|
|
@@ -1107,21 +1171,21 @@ const oi = (r) => {
|
|
|
1107
1171
|
}
|
|
1108
1172
|
)
|
|
1109
1173
|
] });
|
|
1110
|
-
},
|
|
1174
|
+
}, Li = (o) => {
|
|
1111
1175
|
const {
|
|
1112
1176
|
isActiveButtons: s,
|
|
1113
1177
|
setIsActiveButtons: e,
|
|
1114
1178
|
buttons: n,
|
|
1115
1179
|
setButtons: i,
|
|
1116
|
-
editableLink:
|
|
1180
|
+
editableLink: c = !0,
|
|
1117
1181
|
addable: u = !0,
|
|
1118
|
-
deletable:
|
|
1119
|
-
} =
|
|
1120
|
-
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className:
|
|
1121
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1122
|
-
/* @__PURE__ */ t.jsx("h3", { className:
|
|
1182
|
+
deletable: r = !0
|
|
1183
|
+
} = o;
|
|
1184
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: jt.buttonsBlock, children: [
|
|
1185
|
+
/* @__PURE__ */ t.jsxs("div", { className: jt.top, children: [
|
|
1186
|
+
/* @__PURE__ */ t.jsx("h3", { className: jt.title, children: "Buttons" }),
|
|
1123
1187
|
/* @__PURE__ */ t.jsx(
|
|
1124
|
-
|
|
1188
|
+
ot,
|
|
1125
1189
|
{
|
|
1126
1190
|
current: s,
|
|
1127
1191
|
onChange: (m) => e(m)
|
|
@@ -1129,29 +1193,29 @@ const oi = (r) => {
|
|
|
1129
1193
|
)
|
|
1130
1194
|
] }),
|
|
1131
1195
|
s && /* @__PURE__ */ t.jsx(
|
|
1132
|
-
|
|
1196
|
+
vn,
|
|
1133
1197
|
{
|
|
1134
1198
|
buttons: n,
|
|
1135
1199
|
setButtons: i,
|
|
1136
|
-
editableLink:
|
|
1200
|
+
editableLink: c,
|
|
1137
1201
|
addable: u,
|
|
1138
|
-
deletable:
|
|
1202
|
+
deletable: r
|
|
1139
1203
|
}
|
|
1140
1204
|
)
|
|
1141
1205
|
] }) });
|
|
1142
1206
|
};
|
|
1143
|
-
function
|
|
1144
|
-
const { product: s, children: e } =
|
|
1207
|
+
function jn(o) {
|
|
1208
|
+
const { product: s, children: e } = o, { attributes: n, listeners: i, setNodeRef: c, transform: u, transition: r, isDragging: m } = ft({
|
|
1145
1209
|
id: String(s.listingId)
|
|
1146
|
-
}),
|
|
1147
|
-
transform:
|
|
1148
|
-
transition:
|
|
1210
|
+
}), p = {
|
|
1211
|
+
transform: xt.Transform.toString(u),
|
|
1212
|
+
transition: r
|
|
1149
1213
|
};
|
|
1150
1214
|
return /* @__PURE__ */ t.jsx(
|
|
1151
1215
|
"div",
|
|
1152
1216
|
{
|
|
1153
|
-
ref:
|
|
1154
|
-
style:
|
|
1217
|
+
ref: c,
|
|
1218
|
+
style: p,
|
|
1155
1219
|
className: `${G.product} ${m ? G.dragging : ""}`,
|
|
1156
1220
|
...n,
|
|
1157
1221
|
...i,
|
|
@@ -1159,69 +1223,69 @@ function gn(r) {
|
|
|
1159
1223
|
}
|
|
1160
1224
|
);
|
|
1161
1225
|
}
|
|
1162
|
-
const
|
|
1226
|
+
const zi = (o) => {
|
|
1163
1227
|
const {
|
|
1164
1228
|
isActiveItems: s,
|
|
1165
1229
|
setIsActiveItems: e,
|
|
1166
1230
|
items: n,
|
|
1167
1231
|
setItems: i,
|
|
1168
|
-
other:
|
|
1232
|
+
other: c,
|
|
1169
1233
|
title: u,
|
|
1170
|
-
subtitle:
|
|
1234
|
+
subtitle: r,
|
|
1171
1235
|
editable: m = !0,
|
|
1172
|
-
draggable:
|
|
1173
|
-
withImage:
|
|
1174
|
-
deletable:
|
|
1175
|
-
addable:
|
|
1176
|
-
itemsType:
|
|
1177
|
-
itemsOptions:
|
|
1178
|
-
limit:
|
|
1179
|
-
} =
|
|
1236
|
+
draggable: p = !1,
|
|
1237
|
+
withImage: B = !1,
|
|
1238
|
+
deletable: l = !0,
|
|
1239
|
+
addable: a = !0,
|
|
1240
|
+
itemsType: b,
|
|
1241
|
+
itemsOptions: d,
|
|
1242
|
+
limit: S
|
|
1243
|
+
} = o, [g, k] = x.useState(
|
|
1180
1244
|
null
|
|
1181
|
-
), [
|
|
1245
|
+
), [q, E] = x.useState({
|
|
1182
1246
|
top: 0,
|
|
1183
1247
|
left: 0
|
|
1184
|
-
}), [
|
|
1185
|
-
|
|
1248
|
+
}), [f, v] = x.useState(!1), M = ut(
|
|
1249
|
+
mt(ht, {
|
|
1186
1250
|
activationConstraint: {
|
|
1187
1251
|
distance: 5
|
|
1188
1252
|
}
|
|
1189
1253
|
})
|
|
1190
1254
|
);
|
|
1191
|
-
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1255
|
+
x.useEffect(() => {
|
|
1256
|
+
const y = () => {
|
|
1257
|
+
k(null), v(!1);
|
|
1194
1258
|
};
|
|
1195
|
-
return document.body.addEventListener("click",
|
|
1196
|
-
|
|
1259
|
+
return document.body.addEventListener("click", y), k(null), v(!1), () => {
|
|
1260
|
+
k(null), v(!1), document.body.removeEventListener("click", y);
|
|
1197
1261
|
};
|
|
1198
|
-
}, []),
|
|
1199
|
-
if (
|
|
1200
|
-
const
|
|
1201
|
-
i(
|
|
1262
|
+
}, []), x.useEffect(() => {
|
|
1263
|
+
if (g) {
|
|
1264
|
+
const y = [...n].map((N) => N.listingId === g.listingId ? g : N);
|
|
1265
|
+
i(y);
|
|
1202
1266
|
}
|
|
1203
|
-
}, [
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1206
|
-
const A =
|
|
1207
|
-
let
|
|
1208
|
-
|
|
1209
|
-
top:
|
|
1267
|
+
}, [g]);
|
|
1268
|
+
const O = (y, N) => {
|
|
1269
|
+
y.stopPropagation();
|
|
1270
|
+
const A = y.target.getBoundingClientRect(), U = 100, D = window.innerHeight;
|
|
1271
|
+
let z = A.top + window.scrollY;
|
|
1272
|
+
z + U > D && (z = D - U - 20), v(!0), E({
|
|
1273
|
+
top: z - 80,
|
|
1210
1274
|
left: A.left - 30
|
|
1211
|
-
}), N
|
|
1275
|
+
}), k(N);
|
|
1212
1276
|
};
|
|
1213
|
-
function
|
|
1214
|
-
if (
|
|
1215
|
-
return
|
|
1277
|
+
function I(y) {
|
|
1278
|
+
if (B)
|
|
1279
|
+
return y ? /* @__PURE__ */ t.jsx(
|
|
1216
1280
|
"img",
|
|
1217
1281
|
{
|
|
1218
|
-
src: `https://imagedelivery.net/${
|
|
1282
|
+
src: `https://imagedelivery.net/${y}/w=1000`,
|
|
1219
1283
|
alt: "image",
|
|
1220
1284
|
width: 16,
|
|
1221
1285
|
height: 16
|
|
1222
1286
|
}
|
|
1223
1287
|
) : /* @__PURE__ */ t.jsx(
|
|
1224
|
-
|
|
1288
|
+
j,
|
|
1225
1289
|
{
|
|
1226
1290
|
name: "Image",
|
|
1227
1291
|
width: 16,
|
|
@@ -1230,21 +1294,21 @@ const ci = (r) => {
|
|
|
1230
1294
|
}
|
|
1231
1295
|
);
|
|
1232
1296
|
}
|
|
1233
|
-
const
|
|
1234
|
-
const { active:
|
|
1235
|
-
if (A &&
|
|
1236
|
-
const U = n.findIndex((
|
|
1237
|
-
if (U !== -1 &&
|
|
1238
|
-
const
|
|
1239
|
-
|
|
1297
|
+
const h = (y) => {
|
|
1298
|
+
const { active: N, over: A } = y;
|
|
1299
|
+
if (A && N.id !== A.id) {
|
|
1300
|
+
const U = n.findIndex((z) => String(z.listingId) === N.id), D = n.findIndex((z) => String(z.listingId) === A.id);
|
|
1301
|
+
if (U !== -1 && D !== -1) {
|
|
1302
|
+
const z = [...n], [Z] = z.splice(U, 1);
|
|
1303
|
+
z.splice(D, 0, Z), i(z);
|
|
1240
1304
|
}
|
|
1241
1305
|
}
|
|
1242
|
-
},
|
|
1243
|
-
const A =
|
|
1306
|
+
}, $ = (y, N) => {
|
|
1307
|
+
const A = d.find((D) => y.listingId === D.id);
|
|
1244
1308
|
if (!A) return null;
|
|
1245
1309
|
const U = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1246
|
-
|
|
1247
|
-
|
|
1310
|
+
p && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1311
|
+
j,
|
|
1248
1312
|
{
|
|
1249
1313
|
name: "DotsSixVertical",
|
|
1250
1314
|
hoverable: !0,
|
|
@@ -1252,108 +1316,108 @@ const ci = (r) => {
|
|
|
1252
1316
|
height: 20
|
|
1253
1317
|
}
|
|
1254
1318
|
) }),
|
|
1255
|
-
|
|
1256
|
-
|
|
1319
|
+
b === "select" && /* @__PURE__ */ t.jsx(
|
|
1320
|
+
rt,
|
|
1257
1321
|
{
|
|
1258
|
-
onChange: (
|
|
1259
|
-
const
|
|
1260
|
-
if (!
|
|
1261
|
-
const
|
|
1262
|
-
listingId:
|
|
1263
|
-
image:
|
|
1264
|
-
},
|
|
1265
|
-
|
|
1322
|
+
onChange: (D) => {
|
|
1323
|
+
const z = [...n], Z = d.find((T) => T.productData.name === D);
|
|
1324
|
+
if (!Z) return;
|
|
1325
|
+
const _ = {
|
|
1326
|
+
listingId: Z.id,
|
|
1327
|
+
image: Z.productData.images.length > 0 ? Z.productData.images[0].cfId : ""
|
|
1328
|
+
}, R = z.map((T) => T.listingId === y.listingId ? _ : T);
|
|
1329
|
+
k(_), i([...R]);
|
|
1266
1330
|
},
|
|
1267
1331
|
value: A.productData.name,
|
|
1268
1332
|
options: [
|
|
1269
|
-
|
|
1333
|
+
...d.filter((D) => !n.find((z) => z.listingId === D.id)).map((D) => D.productData.name)
|
|
1270
1334
|
],
|
|
1271
|
-
leftAddon:
|
|
1272
|
-
|
|
1335
|
+
leftAddon: I(
|
|
1336
|
+
y.image || A.productData.images.length > 0 && A.productData.images[0].cfId || ""
|
|
1273
1337
|
)
|
|
1274
1338
|
},
|
|
1275
|
-
|
|
1339
|
+
N
|
|
1276
1340
|
),
|
|
1277
1341
|
/* @__PURE__ */ t.jsxs("div", { className: G.buttons, children: [
|
|
1278
1342
|
m && /* @__PURE__ */ t.jsx("div", { className: G.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1279
|
-
|
|
1343
|
+
j,
|
|
1280
1344
|
{
|
|
1281
1345
|
name: "Sliders",
|
|
1282
1346
|
hoverable: !0,
|
|
1283
1347
|
width: 20,
|
|
1284
1348
|
height: 20,
|
|
1285
|
-
onClick: (
|
|
1349
|
+
onClick: (D) => O(D, y)
|
|
1286
1350
|
}
|
|
1287
1351
|
) }),
|
|
1288
|
-
|
|
1289
|
-
|
|
1352
|
+
l && /* @__PURE__ */ t.jsx("div", { className: G.deleteButton, children: /* @__PURE__ */ t.jsx(
|
|
1353
|
+
j,
|
|
1290
1354
|
{
|
|
1291
1355
|
name: "Trash",
|
|
1292
1356
|
hoverable: !0,
|
|
1293
1357
|
width: 20,
|
|
1294
1358
|
height: 20,
|
|
1295
1359
|
fill: "#C12A2A",
|
|
1296
|
-
onClick: () => i(n.filter((
|
|
1360
|
+
onClick: () => i(n.filter((D) => D !== y))
|
|
1297
1361
|
}
|
|
1298
1362
|
) })
|
|
1299
1363
|
] })
|
|
1300
1364
|
] });
|
|
1301
|
-
return
|
|
1302
|
-
|
|
1365
|
+
return p ? /* @__PURE__ */ t.jsx(
|
|
1366
|
+
jn,
|
|
1303
1367
|
{
|
|
1304
|
-
product:
|
|
1368
|
+
product: y,
|
|
1305
1369
|
children: U
|
|
1306
1370
|
},
|
|
1307
|
-
|
|
1371
|
+
y.listingId
|
|
1308
1372
|
) : /* @__PURE__ */ t.jsx(
|
|
1309
1373
|
"div",
|
|
1310
1374
|
{
|
|
1311
1375
|
className: G.product,
|
|
1312
1376
|
children: U
|
|
1313
1377
|
},
|
|
1314
|
-
|
|
1378
|
+
y.listingId
|
|
1315
1379
|
);
|
|
1316
|
-
},
|
|
1380
|
+
}, P = x.useRef(null);
|
|
1317
1381
|
return /* @__PURE__ */ t.jsxs("div", { className: G.productsBlock, children: [
|
|
1318
1382
|
(u || s !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: G.top, children: [
|
|
1319
1383
|
u && /* @__PURE__ */ t.jsx("h3", { className: G.title, children: u }),
|
|
1320
1384
|
s !== void 0 && /* @__PURE__ */ t.jsx(
|
|
1321
|
-
|
|
1385
|
+
ot,
|
|
1322
1386
|
{
|
|
1323
1387
|
current: s,
|
|
1324
|
-
onChange: (
|
|
1388
|
+
onChange: (y) => e == null ? void 0 : e(y)
|
|
1325
1389
|
}
|
|
1326
1390
|
)
|
|
1327
1391
|
] }),
|
|
1328
|
-
|
|
1329
|
-
|
|
1392
|
+
f && g && /* @__PURE__ */ t.jsx(
|
|
1393
|
+
At,
|
|
1330
1394
|
{
|
|
1331
|
-
ref:
|
|
1332
|
-
activeItem:
|
|
1333
|
-
setActiveItem:
|
|
1334
|
-
setIsOpenModal:
|
|
1335
|
-
popupPosition:
|
|
1336
|
-
itemsOptions:
|
|
1395
|
+
ref: P,
|
|
1396
|
+
activeItem: g,
|
|
1397
|
+
setActiveItem: k,
|
|
1398
|
+
setIsOpenModal: v,
|
|
1399
|
+
popupPosition: q,
|
|
1400
|
+
itemsOptions: d
|
|
1337
1401
|
}
|
|
1338
1402
|
),
|
|
1339
1403
|
s && /* @__PURE__ */ t.jsxs("div", { className: G.products, children: [
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1404
|
+
r && /* @__PURE__ */ t.jsx("h5", { className: G.subtitle, children: r }),
|
|
1405
|
+
p ? /* @__PURE__ */ t.jsx(
|
|
1406
|
+
pt,
|
|
1343
1407
|
{
|
|
1344
|
-
sensors:
|
|
1345
|
-
onDragEnd:
|
|
1408
|
+
sensors: M,
|
|
1409
|
+
onDragEnd: h,
|
|
1346
1410
|
children: /* @__PURE__ */ t.jsx(
|
|
1347
|
-
|
|
1411
|
+
_t,
|
|
1348
1412
|
{
|
|
1349
|
-
items: n.map((
|
|
1350
|
-
strategy:
|
|
1351
|
-
children: n.map((
|
|
1413
|
+
items: n.map((y) => String(y.listingId)),
|
|
1414
|
+
strategy: gt,
|
|
1415
|
+
children: n.map((y, N) => $(y, N))
|
|
1352
1416
|
}
|
|
1353
1417
|
)
|
|
1354
1418
|
}
|
|
1355
|
-
) : n.map((
|
|
1356
|
-
|
|
1419
|
+
) : n.map((y, N) => $(y, N)),
|
|
1420
|
+
a && /* @__PURE__ */ t.jsx(
|
|
1357
1421
|
"div",
|
|
1358
1422
|
{
|
|
1359
1423
|
style: {
|
|
@@ -1362,31 +1426,31 @@ const ci = (r) => {
|
|
|
1362
1426
|
justifyContent: "center"
|
|
1363
1427
|
},
|
|
1364
1428
|
children: /* @__PURE__ */ t.jsx(
|
|
1365
|
-
|
|
1429
|
+
ct,
|
|
1366
1430
|
{
|
|
1367
1431
|
withoutHover: !0,
|
|
1368
1432
|
className: G.button,
|
|
1369
1433
|
size: "s",
|
|
1370
1434
|
onClick: () => {
|
|
1371
|
-
const
|
|
1372
|
-
for (let
|
|
1373
|
-
if (!n.find((A) => A.listingId ===
|
|
1374
|
-
|
|
1375
|
-
listingId:
|
|
1376
|
-
image:
|
|
1435
|
+
const y = [...n];
|
|
1436
|
+
for (let N = 0; N < d.length; N++)
|
|
1437
|
+
if (!n.find((A) => A.listingId === d[N].id)) {
|
|
1438
|
+
y.push({
|
|
1439
|
+
listingId: d[N].id,
|
|
1440
|
+
image: d[N].productData.images.length > 0 ? d[N].productData.images[0].cfId : ""
|
|
1377
1441
|
});
|
|
1378
1442
|
break;
|
|
1379
1443
|
}
|
|
1380
|
-
i(
|
|
1444
|
+
i(y);
|
|
1381
1445
|
},
|
|
1382
|
-
disabled: n.length === (
|
|
1446
|
+
disabled: n.length === (S || d.length),
|
|
1383
1447
|
style: {
|
|
1384
1448
|
width: "fit-content"
|
|
1385
1449
|
},
|
|
1386
1450
|
children: /* @__PURE__ */ t.jsxs("div", { className: G.addButton, children: [
|
|
1387
1451
|
/* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
|
|
1388
1452
|
/* @__PURE__ */ t.jsx(
|
|
1389
|
-
|
|
1453
|
+
j,
|
|
1390
1454
|
{
|
|
1391
1455
|
name: "Plus",
|
|
1392
1456
|
width: 16,
|
|
@@ -1399,151 +1463,154 @@ const ci = (r) => {
|
|
|
1399
1463
|
}
|
|
1400
1464
|
)
|
|
1401
1465
|
] }),
|
|
1402
|
-
s &&
|
|
1466
|
+
s && c !== void 0 && /* @__PURE__ */ t.jsx(It, { items: c })
|
|
1403
1467
|
] });
|
|
1404
|
-
},
|
|
1405
|
-
options:
|
|
1406
|
-
price:
|
|
1407
|
-
oldPrice:
|
|
1408
|
-
newPrice:
|
|
1409
|
-
animate:
|
|
1410
|
-
appearAndBounce:
|
|
1411
|
-
meta:
|
|
1412
|
-
info:
|
|
1413
|
-
infoRight:
|
|
1414
|
-
buttons:
|
|
1415
|
-
variants:
|
|
1416
|
-
variant:
|
|
1417
|
-
stock:
|
|
1418
|
-
variantInfo:
|
|
1419
|
-
quantity:
|
|
1420
|
-
count:
|
|
1421
|
-
focused:
|
|
1422
|
-
button:
|
|
1423
|
-
activeVariant:
|
|
1424
|
-
chargeTypes:
|
|
1425
|
-
charge:
|
|
1426
|
-
chargeActive:
|
|
1427
|
-
title:
|
|
1468
|
+
}, bn = "_options_1vlf9_1", yn = "_price_1vlf9_13", In = "_oldPrice_1vlf9_20", Nn = "_newPrice_1vlf9_28", kn = "_animate_1vlf9_35", Cn = "_appearAndBounce_1vlf9_1", Sn = "_meta_1vlf9_53", $n = "_info_1vlf9_59", wn = "_infoRight_1vlf9_67", qn = "_buttons_1vlf9_74", Bn = "_variants_1vlf9_81", Pn = "_variant_1vlf9_81", Tn = "_stock_1vlf9_99", Mn = "_variantInfo_1vlf9_106", An = "_quantity_1vlf9_112", On = "_count_1vlf9_119", En = "_focused_1vlf9_136", Dn = "_button_1vlf9_74", Rn = "_activeVariant_1vlf9_162", Ln = "_chargeTypes_1vlf9_166", zn = "_charge_1vlf9_166", Fn = "_chargeActive_1vlf9_191", Vn = "_title_1vlf9_199", w = {
|
|
1469
|
+
options: bn,
|
|
1470
|
+
price: yn,
|
|
1471
|
+
oldPrice: In,
|
|
1472
|
+
newPrice: Nn,
|
|
1473
|
+
animate: kn,
|
|
1474
|
+
appearAndBounce: Cn,
|
|
1475
|
+
meta: Sn,
|
|
1476
|
+
info: $n,
|
|
1477
|
+
infoRight: wn,
|
|
1478
|
+
buttons: qn,
|
|
1479
|
+
variants: Bn,
|
|
1480
|
+
variant: Pn,
|
|
1481
|
+
stock: Tn,
|
|
1482
|
+
variantInfo: Mn,
|
|
1483
|
+
quantity: An,
|
|
1484
|
+
count: On,
|
|
1485
|
+
focused: En,
|
|
1486
|
+
button: Dn,
|
|
1487
|
+
activeVariant: Rn,
|
|
1488
|
+
chargeTypes: Ln,
|
|
1489
|
+
charge: zn,
|
|
1490
|
+
chargeActive: Fn,
|
|
1491
|
+
title: Vn
|
|
1428
1492
|
};
|
|
1429
|
-
var
|
|
1430
|
-
const
|
|
1431
|
-
var
|
|
1432
|
-
const { variants: s } =
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1493
|
+
var Ct = /* @__PURE__ */ ((o) => (o.ONE_TIME = "One-Time", o.RECURRING = "Subscribe & Save", o))(Ct || {});
|
|
1494
|
+
const Un = (o) => {
|
|
1495
|
+
var q, E;
|
|
1496
|
+
const { variants: s } = o, [e, n] = x.useState(s[0]), [i, c] = x.useState(
|
|
1497
|
+
e.chargeTypes ? e.chargeTypes[0] : "ONE_TIME"
|
|
1498
|
+
), u = vt(), [r, m] = x.useState(1), { products: p, cart: B, reset: l, addProductToCart: a } = dt(), [b, d] = x.useState(!1);
|
|
1499
|
+
console.log(B), x.useEffect(() => {
|
|
1500
|
+
d(!0);
|
|
1501
|
+
const f = setTimeout(() => d(!1), 600);
|
|
1502
|
+
return () => clearTimeout(f);
|
|
1503
|
+
}, [r]);
|
|
1504
|
+
async function S() {
|
|
1505
|
+
console.log("Products P", p), await a({
|
|
1506
|
+
productId: o.id,
|
|
1441
1507
|
productVariantId: e.id,
|
|
1442
|
-
quantity:
|
|
1508
|
+
quantity: r
|
|
1443
1509
|
});
|
|
1444
1510
|
}
|
|
1445
|
-
function
|
|
1446
|
-
|
|
1511
|
+
function g() {
|
|
1512
|
+
l(), S(), u("/checkout");
|
|
1447
1513
|
}
|
|
1448
|
-
function
|
|
1449
|
-
if (
|
|
1450
|
-
const
|
|
1451
|
-
return `${
|
|
1452
|
-
} else if (
|
|
1453
|
-
const
|
|
1454
|
-
return `${
|
|
1455
|
-
} else if (
|
|
1456
|
-
const
|
|
1457
|
-
return `${
|
|
1514
|
+
function k(f) {
|
|
1515
|
+
if (f >= 864e5) {
|
|
1516
|
+
const h = Math.floor(f / 864e5);
|
|
1517
|
+
return `${h} ${h === 1 ? "day" : "days"}`;
|
|
1518
|
+
} else if (f >= 36e5) {
|
|
1519
|
+
const h = Math.floor(f / 36e5);
|
|
1520
|
+
return `${h} ${h === 1 ? "hour" : "hours"}`;
|
|
1521
|
+
} else if (f >= 6e4) {
|
|
1522
|
+
const h = Math.floor(f / 6e4);
|
|
1523
|
+
return `${h} ${h === 1 ? "minute" : "minutes"}`;
|
|
1458
1524
|
} else {
|
|
1459
|
-
const
|
|
1460
|
-
return `${
|
|
1525
|
+
const h = Math.floor(f / 1e3);
|
|
1526
|
+
return `${h} ${h === 1 ? "second" : "seconds"}`;
|
|
1461
1527
|
}
|
|
1462
1528
|
}
|
|
1463
|
-
return
|
|
1464
|
-
|
|
1465
|
-
}, [e.quantity.available]), /* @__PURE__ */ t.jsxs("div", { className:
|
|
1466
|
-
e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className:
|
|
1529
|
+
return x.useEffect(() => {
|
|
1530
|
+
e.quantity && e.quantity.available === 0 && m(0);
|
|
1531
|
+
}, [e.quantity.available]), /* @__PURE__ */ t.jsxs("div", { className: w.options, children: [
|
|
1532
|
+
e.chargeTypes && e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: w.chargeTypes, children: e.chargeTypes.map((f) => /* @__PURE__ */ t.jsx(
|
|
1467
1533
|
"div",
|
|
1468
1534
|
{
|
|
1469
|
-
className:
|
|
1470
|
-
[
|
|
1535
|
+
className: V(w.charge, {
|
|
1536
|
+
[w.chargeActive]: i === f
|
|
1471
1537
|
}),
|
|
1472
|
-
onClick: () =>
|
|
1473
|
-
children:
|
|
1538
|
+
onClick: () => c(f),
|
|
1539
|
+
children: Ct[f]
|
|
1474
1540
|
},
|
|
1475
|
-
|
|
1541
|
+
f
|
|
1476
1542
|
)) }),
|
|
1477
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1478
|
-
var
|
|
1543
|
+
/* @__PURE__ */ t.jsx("div", { className: w.variants, children: s.map((f) => {
|
|
1544
|
+
var v, M;
|
|
1479
1545
|
return /* @__PURE__ */ t.jsxs(
|
|
1480
1546
|
"div",
|
|
1481
1547
|
{
|
|
1482
|
-
className:
|
|
1483
|
-
[
|
|
1548
|
+
className: V(w.variant, {
|
|
1549
|
+
[w.activeVariant]: e.id === f.id
|
|
1484
1550
|
}),
|
|
1485
|
-
onClick: () => n(
|
|
1551
|
+
onClick: () => n(f),
|
|
1486
1552
|
children: [
|
|
1487
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1488
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
1553
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.variantInfo, children: [
|
|
1554
|
+
/* @__PURE__ */ t.jsx("span", { className: w.title, children: Nt(f.name) }),
|
|
1489
1555
|
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
1490
1556
|
"$",
|
|
1491
|
-
i === "ONE_TIME" ?
|
|
1557
|
+
i === "ONE_TIME" ? f.price.amount : f.subscriptionSettings ? f.subscriptionSettings.price.amount : "Price Not Found"
|
|
1492
1558
|
] })
|
|
1493
1559
|
] }),
|
|
1494
|
-
/* @__PURE__ */ t.jsx("div", { children: i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className:
|
|
1495
|
-
((
|
|
1496
|
-
"
|
|
1560
|
+
/* @__PURE__ */ t.jsx("div", { children: i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: w.stock, children: [
|
|
1561
|
+
(v = f.quantity.restrictions) != null && v.max || f.quantity.available !== void 0 ? ((M = f.quantity.restrictions) == null ? void 0 : M.max) || f.quantity.available : "∞",
|
|
1562
|
+
" ",
|
|
1563
|
+
"in stock"
|
|
1497
1564
|
] }) })
|
|
1498
1565
|
]
|
|
1499
1566
|
},
|
|
1500
|
-
|
|
1567
|
+
f.id
|
|
1501
1568
|
);
|
|
1502
1569
|
}) }),
|
|
1503
|
-
i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className:
|
|
1570
|
+
i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className: w.quantity, children: [
|
|
1504
1571
|
/* @__PURE__ */ t.jsx(
|
|
1505
|
-
|
|
1572
|
+
F,
|
|
1506
1573
|
{
|
|
1507
1574
|
type: "Secondary",
|
|
1508
1575
|
onClick: () => {
|
|
1509
|
-
|
|
1576
|
+
r > 1 ? m((f) => f - 1) : m(1);
|
|
1510
1577
|
},
|
|
1511
|
-
className:
|
|
1512
|
-
disabled: e.quantity.available
|
|
1513
|
-
children: /* @__PURE__ */ t.jsx(
|
|
1578
|
+
className: w.button,
|
|
1579
|
+
disabled: e.quantity.available && e.quantity.restrictions && r <= e.quantity.restrictions.min || e.quantity.available === 0,
|
|
1580
|
+
children: /* @__PURE__ */ t.jsx(j, { name: "Minus" })
|
|
1514
1581
|
}
|
|
1515
1582
|
),
|
|
1516
1583
|
/* @__PURE__ */ t.jsx(
|
|
1517
|
-
|
|
1584
|
+
Ot,
|
|
1518
1585
|
{
|
|
1519
1586
|
type: "number",
|
|
1520
|
-
value: String(
|
|
1521
|
-
onChange: (
|
|
1522
|
-
max: ((
|
|
1523
|
-
min: ((
|
|
1587
|
+
value: String(r),
|
|
1588
|
+
onChange: (f) => m(Number(f)),
|
|
1589
|
+
max: ((q = e.quantity.restrictions) == null ? void 0 : q.max) || e.quantity.available || Number.POSITIVE_INFINITY,
|
|
1590
|
+
min: ((E = e.quantity.restrictions) == null ? void 0 : E.min) || 0,
|
|
1524
1591
|
centered: !0,
|
|
1525
|
-
disabled: e.quantity
|
|
1592
|
+
disabled: e.quantity && e.quantity.available === 0 || Object.keys(e.quantity.restrictions || {}).length !== 0 && r >= e.quantity.restrictions.max
|
|
1526
1593
|
}
|
|
1527
1594
|
),
|
|
1528
1595
|
/* @__PURE__ */ t.jsx(
|
|
1529
|
-
|
|
1596
|
+
F,
|
|
1530
1597
|
{
|
|
1531
1598
|
type: "Secondary",
|
|
1532
1599
|
onClick: () => {
|
|
1533
|
-
m((
|
|
1600
|
+
m((f) => f + 1);
|
|
1534
1601
|
},
|
|
1535
|
-
className:
|
|
1536
|
-
disabled: !!(e.quantity.
|
|
1537
|
-
children: /* @__PURE__ */ t.jsx(
|
|
1602
|
+
className: w.button,
|
|
1603
|
+
disabled: !!(e.quantity.available && e.quantity.restrictions && r >= e.quantity.restrictions.max || e.quantity.available === 0),
|
|
1604
|
+
children: /* @__PURE__ */ t.jsx(j, { name: "Plus" })
|
|
1538
1605
|
}
|
|
1539
1606
|
)
|
|
1540
1607
|
] }),
|
|
1541
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1542
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1608
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.meta, children: [
|
|
1609
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.info, children: [
|
|
1543
1610
|
/* @__PURE__ */ t.jsx("span", { children: "Delivery" }),
|
|
1544
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1611
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.infoRight, children: [
|
|
1545
1612
|
/* @__PURE__ */ t.jsx(
|
|
1546
|
-
|
|
1613
|
+
j,
|
|
1547
1614
|
{
|
|
1548
1615
|
name: "Lightning",
|
|
1549
1616
|
fill: "#FF3F19",
|
|
@@ -1551,234 +1618,269 @@ const li = (r) => {
|
|
|
1551
1618
|
height: 20
|
|
1552
1619
|
}
|
|
1553
1620
|
),
|
|
1554
|
-
/* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" :
|
|
1621
|
+
/* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" : k(e.deliveryTime) })
|
|
1555
1622
|
] })
|
|
1556
1623
|
] }),
|
|
1557
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1624
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.info, children: [
|
|
1558
1625
|
/* @__PURE__ */ t.jsx("span", { children: "Price" }),
|
|
1559
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1560
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1626
|
+
/* @__PURE__ */ t.jsx("div", { className: w.infoRight, children: i === "ONE_TIME" ? e.compareAtPrice && (e.compareAtPrice.amount || 0) - (e.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: w.price, children: [
|
|
1627
|
+
/* @__PURE__ */ t.jsxs("span", { className: V(w.newPrice, { [w.animate]: b }), children: [
|
|
1561
1628
|
"$ ",
|
|
1562
|
-
(e.price.amount || 0) *
|
|
1629
|
+
(e.price.amount || 0) * r
|
|
1563
1630
|
] }),
|
|
1564
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1631
|
+
/* @__PURE__ */ t.jsxs("span", { className: w.oldPrice, children: [
|
|
1565
1632
|
"$ ",
|
|
1566
|
-
(e.compareAtPrice.amount || 0) *
|
|
1633
|
+
(e.compareAtPrice.amount || 0) * r
|
|
1567
1634
|
] })
|
|
1568
|
-
] }) : /* @__PURE__ */ t.jsxs("span", { className:
|
|
1635
|
+
] }) : /* @__PURE__ */ t.jsxs("span", { className: V(w.newPrice, { [w.animate]: b }), children: [
|
|
1569
1636
|
"$ ",
|
|
1570
|
-
(e.price.amount || 0) *
|
|
1571
|
-
] }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className:
|
|
1572
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1637
|
+
(e.price.amount || 0) * r
|
|
1638
|
+
] }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: w.price, children: [
|
|
1639
|
+
/* @__PURE__ */ t.jsxs("span", { className: V(w.newPrice, { [w.animate]: b }), children: [
|
|
1573
1640
|
"$ ",
|
|
1574
1641
|
e.subscriptionSettings.price.amount || 0
|
|
1575
1642
|
] }),
|
|
1576
|
-
/* @__PURE__ */ t.jsxs("span", { className:
|
|
1643
|
+
/* @__PURE__ */ t.jsxs("span", { className: w.oldPrice, children: [
|
|
1577
1644
|
"$ ",
|
|
1578
1645
|
e.subscriptionSettings.compareAtPrice.amount || 0
|
|
1579
1646
|
] })
|
|
1580
|
-
] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsxs("span", { className:
|
|
1647
|
+
] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsxs("span", { className: V(w.newPrice, { [w.animate]: b }), children: [
|
|
1581
1648
|
"$ ",
|
|
1582
1649
|
e.subscriptionSettings.price.amount || 0
|
|
1583
1650
|
] }) })
|
|
1584
1651
|
] })
|
|
1585
1652
|
] }),
|
|
1586
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1653
|
+
/* @__PURE__ */ t.jsxs("div", { className: w.buttons, children: [
|
|
1587
1654
|
/* @__PURE__ */ t.jsx(
|
|
1588
|
-
|
|
1655
|
+
F,
|
|
1589
1656
|
{
|
|
1590
1657
|
type: "Primary",
|
|
1591
|
-
onClick: () =>
|
|
1592
|
-
disabled: e.quantity
|
|
1658
|
+
onClick: () => g(),
|
|
1659
|
+
disabled: e.quantity && e.quantity.available === 0,
|
|
1593
1660
|
children: i === "ONE_TIME" ? "Buy Now" : "Subscribe Now"
|
|
1594
1661
|
}
|
|
1595
1662
|
),
|
|
1596
1663
|
i === "ONE_TIME" && /* @__PURE__ */ t.jsx(
|
|
1597
|
-
|
|
1664
|
+
F,
|
|
1598
1665
|
{
|
|
1599
1666
|
type: "Secondary",
|
|
1600
|
-
onClick: () =>
|
|
1601
|
-
disabled: e.quantity
|
|
1667
|
+
onClick: () => S(),
|
|
1668
|
+
disabled: e.quantity && e.quantity.available === 0,
|
|
1602
1669
|
children: "Add to Cart"
|
|
1603
1670
|
}
|
|
1604
1671
|
)
|
|
1605
1672
|
] })
|
|
1606
1673
|
] });
|
|
1607
|
-
},
|
|
1608
|
-
button:
|
|
1609
|
-
login:
|
|
1610
|
-
signUp:
|
|
1611
|
-
buttons:
|
|
1612
|
-
modal:
|
|
1613
|
-
"slide-in-fade": "_slide-in-
|
|
1614
|
-
"mobile-slide-in-fade": "_mobile-slide-in-
|
|
1615
|
-
closing:
|
|
1616
|
-
"mobile-slide-out-fade": "_mobile-slide-out-
|
|
1617
|
-
"slide-out-fade": "_slide-out-
|
|
1618
|
-
info:
|
|
1619
|
-
top:
|
|
1620
|
-
title:
|
|
1621
|
-
clear:
|
|
1622
|
-
activeClear:
|
|
1623
|
-
count:
|
|
1624
|
-
cart:
|
|
1625
|
-
empty:
|
|
1626
|
-
product:
|
|
1627
|
-
products:
|
|
1628
|
-
image:
|
|
1629
|
-
productInfo:
|
|
1630
|
-
content:
|
|
1631
|
-
name:
|
|
1632
|
-
price:
|
|
1633
|
-
productButtons:
|
|
1634
|
-
productButton:
|
|
1635
|
-
productCount:
|
|
1636
|
-
bottom:
|
|
1637
|
-
subtotal:
|
|
1638
|
-
block:
|
|
1639
|
-
shoppingCount:
|
|
1640
|
-
total:
|
|
1641
|
-
link:
|
|
1642
|
-
userInfo:
|
|
1643
|
-
pagesMobileModal:
|
|
1644
|
-
pagesMobileModalContent:
|
|
1645
|
-
pagesMobileModalHeader:
|
|
1646
|
-
pagesMobileModalFooter:
|
|
1647
|
-
},
|
|
1648
|
-
const { shopping: s, signUp: e, isShowUserInfo: n = !0 } =
|
|
1649
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
1650
|
-
s && /* @__PURE__ */ t.jsx(
|
|
1651
|
-
n && /* @__PURE__ */ t.jsx(
|
|
1674
|
+
}, Hn = "_button_14q75_1", Yn = "_login_14q75_14", Wn = "_signUp_14q75_18", Gn = "_buttons_14q75_23", Qn = "_modal_14q75_32", Xn = "_closing_14q75_64", Jn = "_info_14q75_113", Kn = "_top_14q75_120", Zn = "_title_14q75_131", ts = "_clear_14q75_138", es = "_activeClear_14q75_145", ns = "_count_14q75_149", ss = "_cart_14q75_164", is = "_empty_14q75_172", as = "_product_14q75_198", os = "_products_14q75_207", cs = "_image_14q75_215", rs = "_productInfo_14q75_230", ls = "_content_14q75_237", ds = "_name_14q75_243", us = "_price_14q75_249", ms = "_productButtons_14q75_255", hs = "_productButton_14q75_255", ps = "_productCount_14q75_272", _s = "_bottom_14q75_289", gs = "_subtotal_14q75_297", fs = "_block_14q75_305", xs = "_shoppingCount_14q75_312", vs = "_total_14q75_332", js = "_link_14q75_338", bs = "_userInfo_14q75_345", ys = "_pagesMobileModal_14q75_356", Is = "_pagesMobileModalContent_14q75_370", Ns = "_pagesMobileModalHeader_14q75_376", ks = "_pagesMobileModalFooter_14q75_386", C = {
|
|
1675
|
+
button: Hn,
|
|
1676
|
+
login: Yn,
|
|
1677
|
+
signUp: Wn,
|
|
1678
|
+
buttons: Gn,
|
|
1679
|
+
modal: Qn,
|
|
1680
|
+
"slide-in-fade": "_slide-in-fade_14q75_1",
|
|
1681
|
+
"mobile-slide-in-fade": "_mobile-slide-in-fade_14q75_1",
|
|
1682
|
+
closing: Xn,
|
|
1683
|
+
"mobile-slide-out-fade": "_mobile-slide-out-fade_14q75_1",
|
|
1684
|
+
"slide-out-fade": "_slide-out-fade_14q75_1",
|
|
1685
|
+
info: Jn,
|
|
1686
|
+
top: Kn,
|
|
1687
|
+
title: Zn,
|
|
1688
|
+
clear: ts,
|
|
1689
|
+
activeClear: es,
|
|
1690
|
+
count: ns,
|
|
1691
|
+
cart: ss,
|
|
1692
|
+
empty: is,
|
|
1693
|
+
product: as,
|
|
1694
|
+
products: os,
|
|
1695
|
+
image: cs,
|
|
1696
|
+
productInfo: rs,
|
|
1697
|
+
content: ls,
|
|
1698
|
+
name: ds,
|
|
1699
|
+
price: us,
|
|
1700
|
+
productButtons: ms,
|
|
1701
|
+
productButton: hs,
|
|
1702
|
+
productCount: ps,
|
|
1703
|
+
bottom: _s,
|
|
1704
|
+
subtotal: gs,
|
|
1705
|
+
block: fs,
|
|
1706
|
+
shoppingCount: xs,
|
|
1707
|
+
total: vs,
|
|
1708
|
+
link: js,
|
|
1709
|
+
userInfo: bs,
|
|
1710
|
+
pagesMobileModal: ys,
|
|
1711
|
+
pagesMobileModalContent: Is,
|
|
1712
|
+
pagesMobileModalHeader: Ns,
|
|
1713
|
+
pagesMobileModalFooter: ks
|
|
1714
|
+
}, Fi = (o) => {
|
|
1715
|
+
const { shopping: s, signUp: e, isShowUserInfo: n = !0 } = o;
|
|
1716
|
+
return /* @__PURE__ */ t.jsxs("div", { className: C.buttons, children: [
|
|
1717
|
+
s && /* @__PURE__ */ t.jsx(Cs, {}),
|
|
1718
|
+
n && /* @__PURE__ */ t.jsx(Bt, { signUp: e })
|
|
1652
1719
|
] });
|
|
1653
|
-
},
|
|
1654
|
-
const [
|
|
1655
|
-
function
|
|
1656
|
-
|
|
1657
|
-
|
|
1720
|
+
}, Cs = () => {
|
|
1721
|
+
const [o, s] = x.useState(!1), [e, n] = x.useState([]), { cart: i } = dt(), { pageContext: c } = lt();
|
|
1722
|
+
function u(a) {
|
|
1723
|
+
if (a.variants.length > 0) {
|
|
1724
|
+
for (let b = 0; b < i.parts.length; b++)
|
|
1725
|
+
for (let d = 0; d < a.variants.length; d++)
|
|
1726
|
+
if (a.variants[d] && i.parts[b].productVariantId === a.variants[d].id)
|
|
1727
|
+
return i.parts[b].productVariantId;
|
|
1728
|
+
}
|
|
1729
|
+
return a.variants[0].id;
|
|
1730
|
+
}
|
|
1731
|
+
function r(a) {
|
|
1732
|
+
for (let b = 0; b < i.parts.length; b++)
|
|
1733
|
+
for (let d = 0; d < a.variants.length; d++)
|
|
1734
|
+
if (a.variants[d] && i.parts[b].productVariantId === a.variants[d].id)
|
|
1735
|
+
return i.parts[b].quantity;
|
|
1658
1736
|
}
|
|
1659
|
-
|
|
1737
|
+
x.useEffect(() => {
|
|
1738
|
+
(async () => {
|
|
1739
|
+
var g;
|
|
1740
|
+
const b = i.parts.map((k) => String(k.productId)), S = (((g = c == null ? void 0 : c.products) == null ? void 0 : g.filter((k) => b.includes(String(k.id)))) || []).map((k) => ({
|
|
1741
|
+
...k,
|
|
1742
|
+
activeVariantId: u(k),
|
|
1743
|
+
quantity: r(k)
|
|
1744
|
+
}));
|
|
1745
|
+
n(S);
|
|
1746
|
+
})();
|
|
1747
|
+
}, [i.parts]);
|
|
1748
|
+
function m(a) {
|
|
1749
|
+
var b;
|
|
1750
|
+
return !a || !(a != null && a.variants) ? !1 : (b = a.variants.find((d) => d.id === a.activeVariantId)) == null ? void 0 : b.subscriptionSettings;
|
|
1751
|
+
}
|
|
1752
|
+
const p = i.parts.length > 0 && e.length > 0 && !m(e[0]), [B, l] = x.useState(!1);
|
|
1660
1753
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1661
1754
|
/* @__PURE__ */ t.jsxs(
|
|
1662
|
-
|
|
1755
|
+
F,
|
|
1663
1756
|
{
|
|
1664
1757
|
type: "Secondary",
|
|
1665
1758
|
style: {
|
|
1666
|
-
padding: 10
|
|
1759
|
+
padding: 10,
|
|
1760
|
+
position: "relative"
|
|
1667
1761
|
},
|
|
1668
|
-
onClick: (
|
|
1669
|
-
|
|
1762
|
+
onClick: (a) => {
|
|
1763
|
+
a.stopPropagation(), window.location.pathname.includes("/admin/builder") || (s(!0), l(!0));
|
|
1670
1764
|
},
|
|
1671
1765
|
children: [
|
|
1672
1766
|
/* @__PURE__ */ t.jsx(
|
|
1673
|
-
|
|
1767
|
+
j,
|
|
1674
1768
|
{
|
|
1675
1769
|
name: "Handbag",
|
|
1676
1770
|
fill: "var(--text-primary)"
|
|
1677
1771
|
}
|
|
1678
1772
|
),
|
|
1679
|
-
|
|
1773
|
+
p && /* @__PURE__ */ t.jsx("div", { className: C.shoppingCount, children: i.parts.length })
|
|
1680
1774
|
]
|
|
1681
1775
|
}
|
|
1682
1776
|
),
|
|
1683
|
-
|
|
1684
|
-
|
|
1777
|
+
o && /* @__PURE__ */ t.jsx(
|
|
1778
|
+
kt,
|
|
1685
1779
|
{
|
|
1686
1780
|
close: () => {
|
|
1687
|
-
|
|
1781
|
+
l(!1), setTimeout(() => {
|
|
1688
1782
|
s(!1);
|
|
1689
1783
|
}, 300);
|
|
1690
1784
|
},
|
|
1691
1785
|
withAnimation: !1,
|
|
1692
1786
|
children: /* @__PURE__ */ t.jsx(
|
|
1693
|
-
|
|
1787
|
+
Ss,
|
|
1694
1788
|
{
|
|
1695
1789
|
activeProducts: e,
|
|
1696
|
-
isCartNotEmpty:
|
|
1697
|
-
isOpen:
|
|
1790
|
+
isCartNotEmpty: p,
|
|
1791
|
+
isOpen: B
|
|
1698
1792
|
}
|
|
1699
1793
|
)
|
|
1700
1794
|
}
|
|
1701
1795
|
)
|
|
1702
1796
|
] });
|
|
1703
|
-
},
|
|
1704
|
-
const { activeProducts: s, isCartNotEmpty: e, isOpen: n } =
|
|
1705
|
-
function
|
|
1706
|
-
m(
|
|
1797
|
+
}, Ss = (o) => {
|
|
1798
|
+
const { activeProducts: s, isCartNotEmpty: e, isOpen: n } = o, { cart: i, reset: c, getTotalAndDiscount: u, updateQuantityOfProduct: r } = dt(), m = vt();
|
|
1799
|
+
function p(a) {
|
|
1800
|
+
m(a);
|
|
1707
1801
|
}
|
|
1708
|
-
function
|
|
1709
|
-
|
|
1710
|
-
productId:
|
|
1711
|
-
productVariantId:
|
|
1712
|
-
quantity:
|
|
1802
|
+
function B(a) {
|
|
1803
|
+
a.quantity && r({
|
|
1804
|
+
productId: a.id,
|
|
1805
|
+
productVariantId: a.activeVariantId,
|
|
1806
|
+
quantity: a.quantity + 1
|
|
1713
1807
|
});
|
|
1714
1808
|
}
|
|
1715
|
-
function
|
|
1716
|
-
|
|
1717
|
-
productId:
|
|
1718
|
-
productVariantId:
|
|
1719
|
-
quantity:
|
|
1809
|
+
function l(a) {
|
|
1810
|
+
a.quantity && r({
|
|
1811
|
+
productId: a.id,
|
|
1812
|
+
productVariantId: a.activeVariantId,
|
|
1813
|
+
quantity: a.quantity - 1
|
|
1720
1814
|
});
|
|
1721
1815
|
}
|
|
1722
1816
|
return /* @__PURE__ */ t.jsxs(
|
|
1723
1817
|
"div",
|
|
1724
1818
|
{
|
|
1725
|
-
className:
|
|
1726
|
-
[
|
|
1819
|
+
className: V(C.modal, {
|
|
1820
|
+
[C.closing]: !n
|
|
1727
1821
|
}),
|
|
1728
|
-
onClick: (
|
|
1822
|
+
onClick: (a) => a.stopPropagation(),
|
|
1729
1823
|
children: [
|
|
1730
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1731
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1732
|
-
/* @__PURE__ */ t.jsx("span", { className:
|
|
1733
|
-
e && /* @__PURE__ */ t.jsx("div", { className:
|
|
1824
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.top, children: [
|
|
1825
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.info, children: [
|
|
1826
|
+
/* @__PURE__ */ t.jsx("span", { className: C.title, children: "Cart" }),
|
|
1827
|
+
e && /* @__PURE__ */ t.jsx("div", { className: C.count, children: i.parts.length })
|
|
1734
1828
|
] }),
|
|
1735
1829
|
/* @__PURE__ */ t.jsx(
|
|
1736
1830
|
"button",
|
|
1737
1831
|
{
|
|
1738
|
-
className:
|
|
1739
|
-
[
|
|
1832
|
+
className: V(C.clear, {
|
|
1833
|
+
[C.activeClear]: e
|
|
1740
1834
|
}),
|
|
1741
1835
|
disabled: !e,
|
|
1742
|
-
onClick:
|
|
1836
|
+
onClick: c,
|
|
1743
1837
|
children: "Clear all"
|
|
1744
1838
|
}
|
|
1745
1839
|
)
|
|
1746
1840
|
] }),
|
|
1747
|
-
e ? /* @__PURE__ */ t.jsxs("div", { className:
|
|
1748
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1841
|
+
e ? /* @__PURE__ */ t.jsxs("div", { className: C.cart, children: [
|
|
1842
|
+
/* @__PURE__ */ t.jsx("div", { className: C.products, children: s.map((a) => /* @__PURE__ */ t.jsxs(
|
|
1749
1843
|
"div",
|
|
1750
1844
|
{
|
|
1751
|
-
className:
|
|
1845
|
+
className: C.product,
|
|
1752
1846
|
children: [
|
|
1753
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1754
|
-
/* @__PURE__ */ t.jsx(
|
|
1847
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.productInfo, children: [
|
|
1848
|
+
a.images.length > 0 ? /* @__PURE__ */ t.jsx(
|
|
1755
1849
|
"img",
|
|
1756
1850
|
{
|
|
1757
|
-
src: `https://imagedelivery.net/${
|
|
1851
|
+
src: `https://imagedelivery.net/${a.images[0].cfId}/w=500`,
|
|
1758
1852
|
alt: "image",
|
|
1759
1853
|
width: "100%",
|
|
1760
1854
|
height: "100%",
|
|
1761
|
-
className:
|
|
1855
|
+
className: C.image
|
|
1762
1856
|
}
|
|
1763
|
-
),
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1857
|
+
) : /* @__PURE__ */ t.jsx("div", { className: C.image, children: /* @__PURE__ */ t.jsx(
|
|
1858
|
+
j,
|
|
1859
|
+
{
|
|
1860
|
+
name: "Image",
|
|
1861
|
+
fill: "var(--text-secondary)"
|
|
1862
|
+
}
|
|
1863
|
+
) }),
|
|
1864
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.content, children: [
|
|
1865
|
+
/* @__PURE__ */ t.jsx("div", { className: C.name, children: Nt(a.name) }),
|
|
1866
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.price, children: [
|
|
1767
1867
|
"$",
|
|
1768
|
-
|
|
1868
|
+
a.variants.find((b) => b.id === a.activeVariantId).price.amount * ((a == null ? void 0 : a.quantity) || 1)
|
|
1769
1869
|
] })
|
|
1770
1870
|
] })
|
|
1771
1871
|
] }),
|
|
1772
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1872
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.productButtons, children: [
|
|
1773
1873
|
/* @__PURE__ */ t.jsx(
|
|
1774
|
-
|
|
1874
|
+
F,
|
|
1775
1875
|
{
|
|
1876
|
+
type: "Secondary",
|
|
1776
1877
|
onClick: () => {
|
|
1777
|
-
|
|
1878
|
+
a.quantity !== 1 && l(a);
|
|
1778
1879
|
},
|
|
1779
|
-
className:
|
|
1880
|
+
className: C.productButton,
|
|
1881
|
+
disabled: a.quantity === 1,
|
|
1780
1882
|
children: /* @__PURE__ */ t.jsx(
|
|
1781
|
-
|
|
1883
|
+
j,
|
|
1782
1884
|
{
|
|
1783
1885
|
name: "Minus",
|
|
1784
1886
|
fill: "#757575",
|
|
@@ -1788,14 +1890,16 @@ const li = (r) => {
|
|
|
1788
1890
|
)
|
|
1789
1891
|
}
|
|
1790
1892
|
),
|
|
1791
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1893
|
+
/* @__PURE__ */ t.jsx("div", { className: C.productCount, children: a.quantity }),
|
|
1792
1894
|
/* @__PURE__ */ t.jsx(
|
|
1793
|
-
|
|
1895
|
+
F,
|
|
1794
1896
|
{
|
|
1795
|
-
|
|
1796
|
-
|
|
1897
|
+
type: "Secondary",
|
|
1898
|
+
onClick: () => B(a),
|
|
1899
|
+
className: C.productButton,
|
|
1900
|
+
disabled: a.quantity === a.variants.find((b) => b.id === a.activeVariantId).quantity.available,
|
|
1797
1901
|
children: /* @__PURE__ */ t.jsx(
|
|
1798
|
-
|
|
1902
|
+
j,
|
|
1799
1903
|
{
|
|
1800
1904
|
name: "Plus",
|
|
1801
1905
|
fill: "#757575",
|
|
@@ -1808,14 +1912,14 @@ const li = (r) => {
|
|
|
1808
1912
|
] })
|
|
1809
1913
|
]
|
|
1810
1914
|
},
|
|
1811
|
-
|
|
1915
|
+
a.id
|
|
1812
1916
|
)) }),
|
|
1813
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1814
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1815
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1917
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.bottom, children: [
|
|
1918
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.subtotal, children: [
|
|
1919
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.block, children: [
|
|
1816
1920
|
/* @__PURE__ */ t.jsx("span", { children: "Subtotal" }),
|
|
1817
1921
|
/* @__PURE__ */ t.jsx(
|
|
1818
|
-
|
|
1922
|
+
j,
|
|
1819
1923
|
{
|
|
1820
1924
|
name: "Info",
|
|
1821
1925
|
width: 20,
|
|
@@ -1824,20 +1928,20 @@ const li = (r) => {
|
|
|
1824
1928
|
}
|
|
1825
1929
|
)
|
|
1826
1930
|
] }),
|
|
1827
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
1931
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.total, children: [
|
|
1828
1932
|
"$",
|
|
1829
1933
|
u().total
|
|
1830
1934
|
] })
|
|
1831
1935
|
] }),
|
|
1832
|
-
/* @__PURE__ */ t.jsx(
|
|
1936
|
+
/* @__PURE__ */ t.jsx(F, { onClick: () => p("/checkout"), children: "Checkout" })
|
|
1833
1937
|
] })
|
|
1834
|
-
] }) : /* @__PURE__ */ t.jsx(
|
|
1938
|
+
] }) : /* @__PURE__ */ t.jsx($s, {})
|
|
1835
1939
|
]
|
|
1836
1940
|
}
|
|
1837
1941
|
);
|
|
1838
|
-
},
|
|
1942
|
+
}, $s = () => /* @__PURE__ */ t.jsxs("div", { className: C.empty, children: [
|
|
1839
1943
|
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1840
|
-
|
|
1944
|
+
j,
|
|
1841
1945
|
{
|
|
1842
1946
|
name: "Handbag",
|
|
1843
1947
|
fill: "var(--text-secondary)"
|
|
@@ -1851,23 +1955,23 @@ const li = (r) => {
|
|
|
1851
1955
|
"a",
|
|
1852
1956
|
{
|
|
1853
1957
|
href: "/products",
|
|
1854
|
-
className:
|
|
1958
|
+
className: C.link,
|
|
1855
1959
|
children: "view products"
|
|
1856
1960
|
}
|
|
1857
1961
|
)
|
|
1858
1962
|
] })
|
|
1859
|
-
] }),
|
|
1860
|
-
const e = JSON.parse(localStorage.getItem("token") || "{}"), { data: n } = e, i =
|
|
1861
|
-
function
|
|
1963
|
+
] }), Bt = ({ signUp: o, close: s }) => {
|
|
1964
|
+
const e = JSON.parse(localStorage.getItem("token") || "{}"), { data: n } = e, i = vt();
|
|
1965
|
+
function c(m) {
|
|
1862
1966
|
window.location.pathname.includes("/admin/builder") || i(m);
|
|
1863
1967
|
}
|
|
1864
1968
|
if (!n)
|
|
1865
1969
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1866
1970
|
/* @__PURE__ */ t.jsx(
|
|
1867
|
-
|
|
1971
|
+
F,
|
|
1868
1972
|
{
|
|
1869
1973
|
onClick: () => {
|
|
1870
|
-
|
|
1974
|
+
c("/customer-dash"), s == null || s();
|
|
1871
1975
|
},
|
|
1872
1976
|
type: "Secondary",
|
|
1873
1977
|
style: {
|
|
@@ -1876,11 +1980,11 @@ const li = (r) => {
|
|
|
1876
1980
|
children: "Login"
|
|
1877
1981
|
}
|
|
1878
1982
|
),
|
|
1879
|
-
|
|
1880
|
-
|
|
1983
|
+
o && /* @__PURE__ */ t.jsx(
|
|
1984
|
+
F,
|
|
1881
1985
|
{
|
|
1882
1986
|
onClick: () => {
|
|
1883
|
-
|
|
1987
|
+
c("/customer-dash"), s == null || s();
|
|
1884
1988
|
},
|
|
1885
1989
|
type: "Primary",
|
|
1886
1990
|
style: {
|
|
@@ -1891,29 +1995,29 @@ const li = (r) => {
|
|
|
1891
1995
|
}
|
|
1892
1996
|
)
|
|
1893
1997
|
] });
|
|
1894
|
-
const [u,
|
|
1895
|
-
return
|
|
1998
|
+
const [u, r] = x.useState("test-email@gmail.com");
|
|
1999
|
+
return x.useEffect(() => {
|
|
1896
2000
|
(async () => {
|
|
1897
|
-
const
|
|
1898
|
-
|
|
2001
|
+
const p = Et(n);
|
|
2002
|
+
r(p.email);
|
|
1899
2003
|
})();
|
|
1900
2004
|
}, [n]), /* @__PURE__ */ t.jsx(
|
|
1901
2005
|
"div",
|
|
1902
2006
|
{
|
|
1903
|
-
className:
|
|
2007
|
+
className: C.userInfo,
|
|
1904
2008
|
onClick: () => {
|
|
1905
|
-
|
|
2009
|
+
c("/customer-dash"), s == null || s();
|
|
1906
2010
|
},
|
|
1907
2011
|
children: /* @__PURE__ */ t.jsx("div", { children: u || "test-email@gmail.com" })
|
|
1908
2012
|
}
|
|
1909
2013
|
);
|
|
1910
|
-
},
|
|
1911
|
-
children:
|
|
2014
|
+
}, ws = ({
|
|
2015
|
+
children: o,
|
|
1912
2016
|
logo: s,
|
|
1913
2017
|
setIsOpen: e,
|
|
1914
2018
|
signUp: n
|
|
1915
2019
|
}) => {
|
|
1916
|
-
const { setIsOpen: i } =
|
|
2020
|
+
const { setIsOpen: i } = $t(), c = () => {
|
|
1917
2021
|
i(!1), setTimeout(() => {
|
|
1918
2022
|
e(!1), i(!0);
|
|
1919
2023
|
}, 300);
|
|
@@ -1921,18 +2025,18 @@ const li = (r) => {
|
|
|
1921
2025
|
return /* @__PURE__ */ t.jsxs(
|
|
1922
2026
|
"div",
|
|
1923
2027
|
{
|
|
1924
|
-
className:
|
|
2028
|
+
className: C.pagesMobileModal,
|
|
1925
2029
|
onClick: (u) => u.stopPropagation(),
|
|
1926
2030
|
children: [
|
|
1927
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2031
|
+
/* @__PURE__ */ t.jsxs("div", { className: C.pagesMobileModalHeader, children: [
|
|
1928
2032
|
/* @__PURE__ */ t.jsx("div", { children: s }),
|
|
1929
2033
|
/* @__PURE__ */ t.jsx(
|
|
1930
|
-
|
|
2034
|
+
F,
|
|
1931
2035
|
{
|
|
1932
2036
|
type: "Secondary",
|
|
1933
|
-
onClick:
|
|
2037
|
+
onClick: c,
|
|
1934
2038
|
children: /* @__PURE__ */ t.jsx(
|
|
1935
|
-
|
|
2039
|
+
j,
|
|
1936
2040
|
{
|
|
1937
2041
|
name: "X",
|
|
1938
2042
|
fill: "var(--text-primary)"
|
|
@@ -1941,39 +2045,39 @@ const li = (r) => {
|
|
|
1941
2045
|
}
|
|
1942
2046
|
)
|
|
1943
2047
|
] }),
|
|
1944
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1945
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
1946
|
-
|
|
2048
|
+
/* @__PURE__ */ t.jsx("div", { className: C.pagesMobileModalContent, children: o }),
|
|
2049
|
+
/* @__PURE__ */ t.jsx("div", { className: C.pagesMobileModalFooter, children: /* @__PURE__ */ t.jsx(
|
|
2050
|
+
Bt,
|
|
1947
2051
|
{
|
|
1948
2052
|
signUp: n,
|
|
1949
|
-
close:
|
|
2053
|
+
close: c
|
|
1950
2054
|
}
|
|
1951
2055
|
) })
|
|
1952
2056
|
]
|
|
1953
2057
|
}
|
|
1954
2058
|
);
|
|
1955
|
-
},
|
|
1956
|
-
children:
|
|
2059
|
+
}, Vi = ({
|
|
2060
|
+
children: o,
|
|
1957
2061
|
logo: s,
|
|
1958
2062
|
signUp: e
|
|
1959
2063
|
}) => {
|
|
1960
|
-
const [n, i] =
|
|
2064
|
+
const [n, i] = x.useState(!1);
|
|
1961
2065
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1962
|
-
/* @__PURE__ */ t.jsx(
|
|
1963
|
-
n && /* @__PURE__ */ t.jsx(
|
|
1964
|
-
|
|
2066
|
+
/* @__PURE__ */ t.jsx(qs, { setIsOpenModal: i }),
|
|
2067
|
+
n && /* @__PURE__ */ t.jsx(kt, { close: () => i(!1), children: /* @__PURE__ */ t.jsx(
|
|
2068
|
+
ws,
|
|
1965
2069
|
{
|
|
1966
2070
|
logo: s,
|
|
1967
2071
|
setIsOpen: i,
|
|
1968
2072
|
signUp: e,
|
|
1969
|
-
children:
|
|
2073
|
+
children: o
|
|
1970
2074
|
}
|
|
1971
2075
|
) })
|
|
1972
2076
|
] });
|
|
1973
|
-
},
|
|
1974
|
-
const { setIsOpenModal: s } =
|
|
2077
|
+
}, qs = (o) => {
|
|
2078
|
+
const { setIsOpenModal: s } = o;
|
|
1975
2079
|
return /* @__PURE__ */ t.jsx(
|
|
1976
|
-
|
|
2080
|
+
F,
|
|
1977
2081
|
{
|
|
1978
2082
|
type: "Secondary",
|
|
1979
2083
|
style: {
|
|
@@ -1983,7 +2087,7 @@ const li = (r) => {
|
|
|
1983
2087
|
e.stopPropagation(), window.location.pathname.includes("/admin/builder") || s(!0);
|
|
1984
2088
|
},
|
|
1985
2089
|
children: /* @__PURE__ */ t.jsx(
|
|
1986
|
-
|
|
2090
|
+
j,
|
|
1987
2091
|
{
|
|
1988
2092
|
name: "List",
|
|
1989
2093
|
fill: "var(--text-primary)"
|
|
@@ -1991,34 +2095,34 @@ const li = (r) => {
|
|
|
1991
2095
|
)
|
|
1992
2096
|
}
|
|
1993
2097
|
);
|
|
1994
|
-
},
|
|
1995
|
-
share:
|
|
1996
|
-
modal:
|
|
1997
|
-
header:
|
|
1998
|
-
socials:
|
|
1999
|
-
social:
|
|
2000
|
-
copy:
|
|
2001
|
-
title:
|
|
2002
|
-
copyWrapper:
|
|
2003
|
-
copyText:
|
|
2004
|
-
copyTextMobile:
|
|
2005
|
-
copyTextMiniMobile:
|
|
2006
|
-
},
|
|
2007
|
-
const { isOpenModal: s, setIsOpenModal: e } =
|
|
2098
|
+
}, Bs = "_share_10urc_1", Ps = "_modal_10urc_9", Ts = "_header_10urc_21", Ms = "_socials_10urc_31", As = "_social_10urc_31", Os = "_copy_10urc_41", Es = "_title_10urc_48", Ds = "_copyWrapper_10urc_54", Rs = "_copyText_10urc_63", Ls = "_copyTextMobile_10urc_76", zs = "_copyTextMiniMobile_10urc_95", et = {
|
|
2099
|
+
share: Bs,
|
|
2100
|
+
modal: Ps,
|
|
2101
|
+
header: Ts,
|
|
2102
|
+
socials: Ms,
|
|
2103
|
+
social: As,
|
|
2104
|
+
copy: Os,
|
|
2105
|
+
title: Es,
|
|
2106
|
+
copyWrapper: Ds,
|
|
2107
|
+
copyText: Rs,
|
|
2108
|
+
copyTextMobile: Ls,
|
|
2109
|
+
copyTextMiniMobile: zs
|
|
2110
|
+
}, Ui = ({ title: o = "Copy Product Link" }) => {
|
|
2111
|
+
const { isOpenModal: s, setIsOpenModal: e } = wt();
|
|
2008
2112
|
function n() {
|
|
2009
2113
|
e(!0);
|
|
2010
2114
|
}
|
|
2011
2115
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2012
2116
|
/* @__PURE__ */ t.jsx(
|
|
2013
|
-
|
|
2117
|
+
F,
|
|
2014
2118
|
{
|
|
2015
|
-
className:
|
|
2119
|
+
className: et.share,
|
|
2016
2120
|
onClick: (i) => {
|
|
2017
2121
|
i.stopPropagation(), n();
|
|
2018
2122
|
},
|
|
2019
2123
|
type: "Secondary",
|
|
2020
2124
|
children: /* @__PURE__ */ t.jsx(
|
|
2021
|
-
|
|
2125
|
+
j,
|
|
2022
2126
|
{
|
|
2023
2127
|
name: "Share",
|
|
2024
2128
|
fill: "#757575",
|
|
@@ -2027,45 +2131,45 @@ const li = (r) => {
|
|
|
2027
2131
|
)
|
|
2028
2132
|
}
|
|
2029
2133
|
),
|
|
2030
|
-
s && /* @__PURE__ */ t.jsx(
|
|
2134
|
+
s && /* @__PURE__ */ t.jsx(kt, { close: e, children: /* @__PURE__ */ t.jsx(Fs, { title: o }) })
|
|
2031
2135
|
] });
|
|
2032
|
-
},
|
|
2033
|
-
const { setIsOpenModal: s } =
|
|
2136
|
+
}, Fs = ({ title: o = "Copy Product Link" }) => {
|
|
2137
|
+
const { setIsOpenModal: s } = wt(), { notification: e, setNotification: n } = qt(), { setIsOpen: i } = $t(), c = window.location.href;
|
|
2034
2138
|
function u() {
|
|
2035
|
-
navigator.clipboard.writeText(
|
|
2139
|
+
navigator.clipboard.writeText(c), n({
|
|
2036
2140
|
message: "Link copied to clipboard",
|
|
2037
2141
|
status: "success"
|
|
2038
2142
|
});
|
|
2039
2143
|
}
|
|
2040
|
-
function
|
|
2144
|
+
function r() {
|
|
2041
2145
|
i(!1), setTimeout(() => {
|
|
2042
2146
|
s(!1), i(!0);
|
|
2043
2147
|
}, 300);
|
|
2044
2148
|
}
|
|
2045
|
-
function m(
|
|
2046
|
-
return
|
|
2149
|
+
function m(p, B) {
|
|
2150
|
+
return p.length > B ? p.slice(0, B) + "..." : p;
|
|
2047
2151
|
}
|
|
2048
2152
|
return /* @__PURE__ */ t.jsxs(
|
|
2049
2153
|
"div",
|
|
2050
2154
|
{
|
|
2051
|
-
className:
|
|
2052
|
-
onClick: (
|
|
2155
|
+
className: et.modal,
|
|
2156
|
+
onClick: (p) => p.stopPropagation(),
|
|
2053
2157
|
children: [
|
|
2054
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2055
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2158
|
+
/* @__PURE__ */ t.jsxs("div", { className: et.header, children: [
|
|
2159
|
+
/* @__PURE__ */ t.jsx("div", { className: et.title, children: o }),
|
|
2056
2160
|
/* @__PURE__ */ t.jsx(
|
|
2057
|
-
|
|
2161
|
+
j,
|
|
2058
2162
|
{
|
|
2059
2163
|
name: "X",
|
|
2060
2164
|
fill: "#757575",
|
|
2061
|
-
onClick:
|
|
2165
|
+
onClick: r,
|
|
2062
2166
|
hoverable: !0
|
|
2063
2167
|
}
|
|
2064
2168
|
)
|
|
2065
2169
|
] }),
|
|
2066
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2170
|
+
/* @__PURE__ */ t.jsxs("div", { className: et.copyWrapper, children: [
|
|
2067
2171
|
/* @__PURE__ */ t.jsxs(
|
|
2068
|
-
|
|
2172
|
+
F,
|
|
2069
2173
|
{
|
|
2070
2174
|
type: "Secondary",
|
|
2071
2175
|
onClick: u,
|
|
@@ -2073,59 +2177,59 @@ const li = (r) => {
|
|
|
2073
2177
|
flex: 1
|
|
2074
2178
|
},
|
|
2075
2179
|
children: [
|
|
2076
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2077
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2078
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2180
|
+
/* @__PURE__ */ t.jsx("div", { className: et.copyText, children: m(c, 100) }),
|
|
2181
|
+
/* @__PURE__ */ t.jsx("div", { className: et.copyTextMobile, children: m(c, 40) }),
|
|
2182
|
+
/* @__PURE__ */ t.jsx("div", { className: et.copyTextMiniMobile, children: m(c, 20) })
|
|
2079
2183
|
]
|
|
2080
2184
|
}
|
|
2081
2185
|
),
|
|
2082
2186
|
/* @__PURE__ */ t.jsx(
|
|
2083
|
-
|
|
2187
|
+
F,
|
|
2084
2188
|
{
|
|
2085
2189
|
type: "Secondary",
|
|
2086
2190
|
onClick: u,
|
|
2087
|
-
children: e ? /* @__PURE__ */ t.jsx(
|
|
2191
|
+
children: e ? /* @__PURE__ */ t.jsx(j, { name: "Check" }) : /* @__PURE__ */ t.jsx(j, { name: "Copy" })
|
|
2088
2192
|
}
|
|
2089
2193
|
)
|
|
2090
2194
|
] })
|
|
2091
2195
|
]
|
|
2092
2196
|
}
|
|
2093
2197
|
);
|
|
2094
|
-
},
|
|
2095
|
-
accordion:
|
|
2096
|
-
header:
|
|
2097
|
-
icon:
|
|
2098
|
-
open:
|
|
2099
|
-
content:
|
|
2100
|
-
},
|
|
2101
|
-
const [n, i] =
|
|
2198
|
+
}, Vs = "_accordion_1s1lq_1", Us = "_header_1s1lq_9", Hs = "_icon_1s1lq_18", Ys = "_open_1s1lq_21", Ws = "_content_1s1lq_25", it = {
|
|
2199
|
+
accordion: Vs,
|
|
2200
|
+
header: Us,
|
|
2201
|
+
icon: Hs,
|
|
2202
|
+
open: Ys,
|
|
2203
|
+
content: Ws
|
|
2204
|
+
}, Hi = ({ title: o, content: s, defaultOpen: e = !1 }) => {
|
|
2205
|
+
const [n, i] = x.useState(e), [c, u] = x.useState(0), r = x.useRef(null), m = () => {
|
|
2102
2206
|
i(!n);
|
|
2103
2207
|
};
|
|
2104
|
-
return
|
|
2105
|
-
|
|
2106
|
-
}, [n]), /* @__PURE__ */ t.jsxs("div", { className:
|
|
2208
|
+
return x.useEffect(() => {
|
|
2209
|
+
r.current && u(n ? r.current.scrollHeight : 0);
|
|
2210
|
+
}, [n]), /* @__PURE__ */ t.jsxs("div", { className: it.accordion, children: [
|
|
2107
2211
|
/* @__PURE__ */ t.jsxs(
|
|
2108
2212
|
"div",
|
|
2109
2213
|
{
|
|
2110
|
-
className:
|
|
2214
|
+
className: it.header,
|
|
2111
2215
|
onClick: m,
|
|
2112
2216
|
children: [
|
|
2113
|
-
/* @__PURE__ */ t.jsx("h5", { id: "h5", children:
|
|
2114
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2217
|
+
/* @__PURE__ */ t.jsx("h5", { id: "h5", children: o }),
|
|
2218
|
+
/* @__PURE__ */ t.jsx("div", { className: V(it.icon, { [it.open]: n }), children: /* @__PURE__ */ t.jsx(j, { name: "CaretDown" }) })
|
|
2115
2219
|
]
|
|
2116
2220
|
}
|
|
2117
2221
|
),
|
|
2118
2222
|
/* @__PURE__ */ t.jsx(
|
|
2119
2223
|
"div",
|
|
2120
2224
|
{
|
|
2121
|
-
ref:
|
|
2122
|
-
className:
|
|
2123
|
-
style: { height: `${
|
|
2225
|
+
ref: r,
|
|
2226
|
+
className: it.content,
|
|
2227
|
+
style: { height: `${c}px` },
|
|
2124
2228
|
children: /* @__PURE__ */ t.jsx("p", { id: "p", children: s })
|
|
2125
2229
|
}
|
|
2126
2230
|
)
|
|
2127
2231
|
] });
|
|
2128
|
-
},
|
|
2232
|
+
}, Yi = ({ children: o, path: s, className: e, target: n = "_self", id: i }) => {
|
|
2129
2233
|
if (window.location.pathname.includes("/admin/builder"))
|
|
2130
2234
|
return /* @__PURE__ */ t.jsx(
|
|
2131
2235
|
"div",
|
|
@@ -2134,47 +2238,78 @@ const li = (r) => {
|
|
|
2134
2238
|
role: "link",
|
|
2135
2239
|
style: { cursor: "pointer" },
|
|
2136
2240
|
id: i,
|
|
2137
|
-
children:
|
|
2241
|
+
children: o
|
|
2138
2242
|
}
|
|
2139
2243
|
);
|
|
2140
|
-
const
|
|
2141
|
-
u || n === "_blank" ? n === "_blank" ? window.open(s, "_blank") : window.
|
|
2244
|
+
const c = vt(), u = /^https?:\/\//.test(s), r = (m) => {
|
|
2245
|
+
u || n === "_blank" ? n === "_blank" ? window.open(s, "_blank") : window.open(s, "_self") : (m.preventDefault(), c(s));
|
|
2142
2246
|
};
|
|
2143
2247
|
return /* @__PURE__ */ t.jsx(
|
|
2144
2248
|
"div",
|
|
2145
2249
|
{
|
|
2146
|
-
onClick:
|
|
2250
|
+
onClick: r,
|
|
2147
2251
|
className: e,
|
|
2148
2252
|
role: "link",
|
|
2149
2253
|
style: { cursor: "pointer" },
|
|
2150
2254
|
id: i,
|
|
2151
|
-
children:
|
|
2255
|
+
children: o
|
|
2152
2256
|
}
|
|
2153
2257
|
);
|
|
2154
|
-
},
|
|
2155
|
-
buttonsBlock:
|
|
2156
|
-
slideUp:
|
|
2157
|
-
},
|
|
2158
|
-
|
|
2159
|
-
|
|
2258
|
+
}, Gs = "_buttonsBlock_1b2rb_1", Qs = "_slideUp_1b2rb_1", Xs = {
|
|
2259
|
+
buttonsBlock: Gs,
|
|
2260
|
+
slideUp: Qs
|
|
2261
|
+
}, Wi = (o) => {
|
|
2262
|
+
var p, B;
|
|
2263
|
+
const { setIsOpen: s, setModalType: e, productId: n } = o, { cart: i } = dt(), { pageContext: c } = lt(), u = (p = c == null ? void 0 : c.listings) == null ? void 0 : p.find((l) => l.id === n);
|
|
2264
|
+
if (!u)
|
|
2265
|
+
return null;
|
|
2266
|
+
const r = (B = c == null ? void 0 : c.products) == null ? void 0 : B.find(
|
|
2267
|
+
(l) => l.uniquePath === u.productData.uniquePath
|
|
2268
|
+
);
|
|
2269
|
+
if (!r)
|
|
2270
|
+
return null;
|
|
2271
|
+
const m = i.parts.find((l) => l.productId === r.id);
|
|
2272
|
+
return /* @__PURE__ */ t.jsxs(
|
|
2273
|
+
"div",
|
|
2160
2274
|
{
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2275
|
+
className: Xs.buttonsBlock,
|
|
2276
|
+
onClick: (l) => l.stopPropagation(),
|
|
2277
|
+
children: [
|
|
2278
|
+
/* @__PURE__ */ t.jsx(
|
|
2279
|
+
F,
|
|
2280
|
+
{
|
|
2281
|
+
type: "Secondary",
|
|
2282
|
+
style: {
|
|
2283
|
+
width: "100%"
|
|
2284
|
+
},
|
|
2285
|
+
onClick: () => {
|
|
2286
|
+
e("Add To Cart"), s(!0);
|
|
2287
|
+
},
|
|
2288
|
+
children: m ? "Add More" : "Add To Cart"
|
|
2289
|
+
}
|
|
2290
|
+
),
|
|
2291
|
+
/* @__PURE__ */ t.jsx(
|
|
2292
|
+
F,
|
|
2293
|
+
{
|
|
2294
|
+
type: "Primary",
|
|
2295
|
+
onClick: () => {
|
|
2296
|
+
e("Buy Now"), s(!0);
|
|
2297
|
+
},
|
|
2298
|
+
children: "Buy"
|
|
2299
|
+
}
|
|
2300
|
+
)
|
|
2301
|
+
]
|
|
2166
2302
|
}
|
|
2167
|
-
)
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
const { general: s } = Ot();
|
|
2303
|
+
);
|
|
2304
|
+
}, Js = "_wrapper_27wzz_1", Ks = "_logo_27wzz_8", Zs = "_info_27wzz_12", bt = {
|
|
2305
|
+
wrapper: Js,
|
|
2306
|
+
logo: Ks,
|
|
2307
|
+
info: Zs
|
|
2308
|
+
}, Gi = ({ date: o }) => {
|
|
2309
|
+
const { general: s } = Dt();
|
|
2175
2310
|
if (!s) return /* @__PURE__ */ t.jsx(t.Fragment, {});
|
|
2176
2311
|
function e(n) {
|
|
2177
|
-
const i = new Date(n),
|
|
2312
|
+
const i = new Date(n), c = {
|
|
2178
2313
|
month: "short",
|
|
2179
2314
|
day: "2-digit",
|
|
2180
2315
|
year: "numeric",
|
|
@@ -2182,10 +2317,10 @@ const li = (r) => {
|
|
|
2182
2317
|
minute: "2-digit",
|
|
2183
2318
|
hour12: !1
|
|
2184
2319
|
};
|
|
2185
|
-
return i.toLocaleDateString("en-US",
|
|
2320
|
+
return i.toLocaleDateString("en-US", c);
|
|
2186
2321
|
}
|
|
2187
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
2188
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
2322
|
+
return /* @__PURE__ */ t.jsxs("div", { className: bt.wrapper, children: [
|
|
2323
|
+
/* @__PURE__ */ t.jsx("div", { className: bt.logo, children: s.info.logo ? /* @__PURE__ */ t.jsx(
|
|
2189
2324
|
"img",
|
|
2190
2325
|
{
|
|
2191
2326
|
src: `https://imagedelivery.net/${s.info.logo.cfId}/w=500,h=500`,
|
|
@@ -2193,40 +2328,207 @@ const li = (r) => {
|
|
|
2193
2328
|
style: { objectFit: "contain", width: "48px", height: "48px" }
|
|
2194
2329
|
}
|
|
2195
2330
|
) : /* @__PURE__ */ t.jsx(
|
|
2196
|
-
|
|
2331
|
+
j,
|
|
2197
2332
|
{
|
|
2198
2333
|
name: "Image",
|
|
2199
2334
|
width: 48,
|
|
2200
2335
|
height: 48
|
|
2201
2336
|
}
|
|
2202
2337
|
) }),
|
|
2203
|
-
/* @__PURE__ */ t.jsxs("div", { className:
|
|
2338
|
+
/* @__PURE__ */ t.jsxs("div", { className: bt.info, children: [
|
|
2204
2339
|
/* @__PURE__ */ t.jsx("h3", { id: "h4", children: s.info.name }),
|
|
2205
|
-
/* @__PURE__ */ t.jsx("p", { id: "p", children: e(
|
|
2340
|
+
/* @__PURE__ */ t.jsx("p", { id: "p", children: e(o) })
|
|
2206
2341
|
] })
|
|
2207
2342
|
] });
|
|
2208
|
-
},
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2343
|
+
}, ti = "_options_mju90_1", ei = "_price_mju90_12", ni = "_oldPrice_mju90_19", si = "_newPrice_mju90_27", ii = "_animate_mju90_34", ai = "_appearAndBounce_mju90_1", oi = "_meta_mju90_52", ci = "_info_mju90_58", ri = "_infoRight_mju90_66", li = "_buttons_mju90_73", di = "_variants_mju90_80", ui = "_variant_mju90_80", mi = "_stock_mju90_98", hi = "_variantInfo_mju90_105", pi = "_quantity_mju90_111", _i = "_count_mju90_118", gi = "_focused_mju90_135", fi = "_button_mju90_73", xi = "_activeVariant_mju90_161", vi = "_chargeTypes_mju90_165", ji = "_charge_mju90_165", bi = "_chargeActive_mju90_190", yi = "_title_mju90_198", Ii = "_modal_mju90_204", Ni = "_header_mju90_218", X = {
|
|
2344
|
+
options: ti,
|
|
2345
|
+
price: ei,
|
|
2346
|
+
oldPrice: ni,
|
|
2347
|
+
newPrice: si,
|
|
2348
|
+
animate: ii,
|
|
2349
|
+
appearAndBounce: ai,
|
|
2350
|
+
meta: oi,
|
|
2351
|
+
info: ci,
|
|
2352
|
+
infoRight: ri,
|
|
2353
|
+
buttons: li,
|
|
2354
|
+
variants: di,
|
|
2355
|
+
variant: ui,
|
|
2356
|
+
stock: mi,
|
|
2357
|
+
variantInfo: hi,
|
|
2358
|
+
quantity: pi,
|
|
2359
|
+
count: _i,
|
|
2360
|
+
focused: gi,
|
|
2361
|
+
button: fi,
|
|
2362
|
+
activeVariant: xi,
|
|
2363
|
+
chargeTypes: vi,
|
|
2364
|
+
charge: ji,
|
|
2365
|
+
chargeActive: bi,
|
|
2366
|
+
title: yi,
|
|
2367
|
+
modal: Ii,
|
|
2368
|
+
header: Ni
|
|
2369
|
+
}, Qi = (o) => {
|
|
2370
|
+
var r, m;
|
|
2371
|
+
const { pageContext: s } = lt(), e = (r = s == null ? void 0 : s.listings) == null ? void 0 : r.find((p) => p.id === o.productId);
|
|
2372
|
+
if (!e)
|
|
2373
|
+
return;
|
|
2374
|
+
const n = (m = s == null ? void 0 : s.products) == null ? void 0 : m.find(
|
|
2375
|
+
(p) => p.uniquePath === e.productData.uniquePath
|
|
2376
|
+
);
|
|
2377
|
+
if (!n)
|
|
2378
|
+
return;
|
|
2379
|
+
const i = n.variants[0], [c, u] = x.useState(
|
|
2380
|
+
i.chargeTypes && i.chargeTypes.length > 1 ? i.chargeTypes[0] : "ONE_TIME"
|
|
2381
|
+
);
|
|
2382
|
+
return /* @__PURE__ */ t.jsxs(
|
|
2383
|
+
"div",
|
|
2384
|
+
{
|
|
2385
|
+
className: X.modal,
|
|
2386
|
+
onClick: (p) => p.stopPropagation(),
|
|
2387
|
+
children: [
|
|
2388
|
+
o.type === "Add To Cart" && /* @__PURE__ */ t.jsx(
|
|
2389
|
+
ki,
|
|
2390
|
+
{
|
|
2391
|
+
variants: n.variants,
|
|
2392
|
+
activeVariant: i,
|
|
2393
|
+
activeChargeType: c,
|
|
2394
|
+
setActiveChargeType: u,
|
|
2395
|
+
productId: n.id,
|
|
2396
|
+
setIsOpen: o.setIsOpen
|
|
2397
|
+
}
|
|
2398
|
+
),
|
|
2399
|
+
o.type === "Buy Now" && /* @__PURE__ */ t.jsx(
|
|
2400
|
+
Ci,
|
|
2401
|
+
{
|
|
2402
|
+
product: n,
|
|
2403
|
+
setIsOpen: o.setIsOpen
|
|
2404
|
+
}
|
|
2405
|
+
)
|
|
2406
|
+
]
|
|
2407
|
+
}
|
|
2408
|
+
);
|
|
2409
|
+
}, ki = (o) => {
|
|
2410
|
+
const { variants: s, activeChargeType: e, setActiveChargeType: n, activeVariant: i, productId: c, setIsOpen: u } = o, { cart: r, addProductToCart: m, addProducts: p, updateQuantityOfProduct: B } = dt(), { setNotification: l } = qt(), { pageContext: a } = lt();
|
|
2411
|
+
async function b(d) {
|
|
2412
|
+
const S = r.parts.find(
|
|
2413
|
+
(g) => g.productId === o.productId && g.productVariantId === d
|
|
2414
|
+
);
|
|
2415
|
+
S ? B({
|
|
2416
|
+
productId: c,
|
|
2417
|
+
productVariantId: d,
|
|
2418
|
+
quantity: S.quantity + 1
|
|
2419
|
+
}) : (a != null && a.products && await p(a.products), await m({
|
|
2420
|
+
productId: c,
|
|
2421
|
+
productVariantId: d,
|
|
2422
|
+
quantity: 1
|
|
2423
|
+
})), l({
|
|
2424
|
+
message: "Product added to cart",
|
|
2425
|
+
status: "success"
|
|
2426
|
+
});
|
|
2427
|
+
}
|
|
2428
|
+
return /* @__PURE__ */ t.jsxs("div", { className: X.modal, children: [
|
|
2429
|
+
/* @__PURE__ */ t.jsxs("div", { className: X.header, children: [
|
|
2430
|
+
/* @__PURE__ */ t.jsx("div", { id: "h3", children: "Choose a variant" }),
|
|
2431
|
+
/* @__PURE__ */ t.jsx(
|
|
2432
|
+
j,
|
|
2433
|
+
{
|
|
2434
|
+
name: "X",
|
|
2435
|
+
width: 24,
|
|
2436
|
+
height: 24,
|
|
2437
|
+
fill: "var(--text-secondary)",
|
|
2438
|
+
hoverable: !0,
|
|
2439
|
+
onClick: () => u(!1)
|
|
2440
|
+
}
|
|
2441
|
+
)
|
|
2442
|
+
] }),
|
|
2443
|
+
i.chargeTypes && i.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: X.chargeTypes, children: i.chargeTypes.map((d) => /* @__PURE__ */ t.jsx(
|
|
2444
|
+
"div",
|
|
2445
|
+
{
|
|
2446
|
+
className: V(X.charge, {
|
|
2447
|
+
[X.chargeActive]: e === d
|
|
2448
|
+
}),
|
|
2449
|
+
onClick: () => n(d),
|
|
2450
|
+
children: Ct[d]
|
|
2451
|
+
},
|
|
2452
|
+
d
|
|
2453
|
+
)) }),
|
|
2454
|
+
/* @__PURE__ */ t.jsx("div", { className: X.variants, children: s.map((d) => {
|
|
2455
|
+
var S, g;
|
|
2456
|
+
return /* @__PURE__ */ t.jsxs(
|
|
2457
|
+
"div",
|
|
2458
|
+
{
|
|
2459
|
+
className: V(X.variant),
|
|
2460
|
+
onClick: () => {
|
|
2461
|
+
b(d.id), u(!1);
|
|
2462
|
+
},
|
|
2463
|
+
children: [
|
|
2464
|
+
/* @__PURE__ */ t.jsxs("div", { className: X.variantInfo, children: [
|
|
2465
|
+
/* @__PURE__ */ t.jsx("span", { className: X.title, children: d.name }),
|
|
2466
|
+
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
2467
|
+
"$",
|
|
2468
|
+
e === "ONE_TIME" ? d.price.amount : d.subscriptionSettings ? d.subscriptionSettings.price.amount : "Price Not Found"
|
|
2469
|
+
] })
|
|
2470
|
+
] }),
|
|
2471
|
+
/* @__PURE__ */ t.jsx("div", { children: e === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: X.stock, children: [
|
|
2472
|
+
(S = d.quantity.restrictions) != null && S.max || d.quantity.available !== void 0 ? ((g = d.quantity.restrictions) == null ? void 0 : g.max) || d.quantity.available : "∞",
|
|
2473
|
+
" ",
|
|
2474
|
+
"in stock"
|
|
2475
|
+
] }) })
|
|
2476
|
+
]
|
|
2477
|
+
},
|
|
2478
|
+
d.id
|
|
2479
|
+
);
|
|
2480
|
+
}) })
|
|
2481
|
+
] });
|
|
2482
|
+
}, Ci = (o) => {
|
|
2483
|
+
const { product: s, setIsOpen: e } = o;
|
|
2484
|
+
return /* @__PURE__ */ t.jsxs("div", { className: X.modal, children: [
|
|
2485
|
+
/* @__PURE__ */ t.jsxs("div", { className: X.header, children: [
|
|
2486
|
+
/* @__PURE__ */ t.jsxs("div", { id: "h3", children: [
|
|
2487
|
+
"Buy ",
|
|
2488
|
+
Nt(s.name)
|
|
2489
|
+
] }),
|
|
2490
|
+
/* @__PURE__ */ t.jsx(
|
|
2491
|
+
j,
|
|
2492
|
+
{
|
|
2493
|
+
name: "X",
|
|
2494
|
+
width: 24,
|
|
2495
|
+
height: 24,
|
|
2496
|
+
fill: "var(--text-secondary)",
|
|
2497
|
+
hoverable: !0,
|
|
2498
|
+
onClick: () => e(!1),
|
|
2499
|
+
style: {
|
|
2500
|
+
minWidth: 24,
|
|
2501
|
+
minHeight: 24
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
)
|
|
2505
|
+
] }),
|
|
2506
|
+
/* @__PURE__ */ t.jsx(Un, { ...s })
|
|
2507
|
+
] });
|
|
2508
|
+
}, Si = "_wrapper_1efqk_1", $i = "_label_1efqk_10", wi = "_contentBorder_1efqk_19", qi = "_contentField_1efqk_23", Bi = "_textarea_1efqk_27", Pi = "_length_1efqk_42", st = {
|
|
2509
|
+
wrapper: Si,
|
|
2510
|
+
label: $i,
|
|
2511
|
+
contentBorder: wi,
|
|
2512
|
+
contentField: qi,
|
|
2513
|
+
textarea: Bi,
|
|
2514
|
+
length: Pi
|
|
2515
|
+
}, Xi = (o) => {
|
|
2214
2516
|
const {
|
|
2215
2517
|
onChange: s,
|
|
2216
2518
|
label: e,
|
|
2217
2519
|
value: n,
|
|
2218
2520
|
maxLength: i,
|
|
2219
|
-
placeholder:
|
|
2521
|
+
placeholder: c = "Type something...",
|
|
2220
2522
|
type: u = "text"
|
|
2221
|
-
} =
|
|
2222
|
-
function
|
|
2223
|
-
return u === "number" ?
|
|
2523
|
+
} = o, [r, m] = x.useState(n.length), { themeSettings: p } = Rt();
|
|
2524
|
+
function B(l) {
|
|
2525
|
+
return u === "number" ? l.replace(/[^\d\n]+/g, "") : l;
|
|
2224
2526
|
}
|
|
2225
|
-
return /* @__PURE__ */ t.jsxs("div", { className:
|
|
2527
|
+
return /* @__PURE__ */ t.jsxs("div", { className: st.wrapper, children: [
|
|
2226
2528
|
e && /* @__PURE__ */ t.jsx(
|
|
2227
2529
|
"label",
|
|
2228
2530
|
{
|
|
2229
|
-
className:
|
|
2531
|
+
className: st.label,
|
|
2230
2532
|
htmlFor: e,
|
|
2231
2533
|
children: e
|
|
2232
2534
|
}
|
|
@@ -2236,58 +2538,63 @@ const li = (r) => {
|
|
|
2236
2538
|
{
|
|
2237
2539
|
id: e,
|
|
2238
2540
|
value: n,
|
|
2239
|
-
onChange: (
|
|
2240
|
-
const
|
|
2241
|
-
m(
|
|
2541
|
+
onChange: (l) => {
|
|
2542
|
+
const a = B(l.target.value);
|
|
2543
|
+
m(a.length), s(a);
|
|
2242
2544
|
},
|
|
2243
|
-
placeholder:
|
|
2244
|
-
className:
|
|
2545
|
+
placeholder: c,
|
|
2546
|
+
className: V(st.textarea, {
|
|
2547
|
+
[st.contentBorder]: p.inputs.border.active,
|
|
2548
|
+
[st.contentField]: p.inputs.field.active
|
|
2549
|
+
}),
|
|
2245
2550
|
maxLength: i
|
|
2246
2551
|
}
|
|
2247
2552
|
),
|
|
2248
|
-
i && /* @__PURE__ */ t.jsxs("div", { className:
|
|
2249
|
-
|
|
2553
|
+
i && /* @__PURE__ */ t.jsxs("div", { className: st.length, children: [
|
|
2554
|
+
r,
|
|
2250
2555
|
"/",
|
|
2251
2556
|
i
|
|
2252
2557
|
] })
|
|
2253
2558
|
] });
|
|
2254
2559
|
};
|
|
2255
2560
|
export {
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2561
|
+
Hi as Accordion,
|
|
2562
|
+
qs as BurgerMenuButton,
|
|
2563
|
+
F as Button,
|
|
2564
|
+
vn as ButtonTypeSettings,
|
|
2565
|
+
Li as ButtonsSettings,
|
|
2566
|
+
Ei as CategorySettings,
|
|
2567
|
+
Ct as ChargeTypes,
|
|
2568
|
+
Tt as ChooseImage,
|
|
2569
|
+
Zi as ChooseImageModal,
|
|
2570
|
+
$s as EmptyCart,
|
|
2571
|
+
Ri as FormSettings,
|
|
2572
|
+
Fi as HeaderButtons,
|
|
2573
|
+
j as Icon,
|
|
2574
|
+
yt as InputSettings,
|
|
2575
|
+
Ot as InputUI,
|
|
2576
|
+
ta as ItemsSettings,
|
|
2577
|
+
Oi as LayoutSettings,
|
|
2578
|
+
Yi as Link,
|
|
2579
|
+
zi as ListingSelector,
|
|
2580
|
+
ea as Loader,
|
|
2581
|
+
Gi as MetaInfoPost,
|
|
2582
|
+
kt as Modal,
|
|
2583
|
+
Vi as PagesMobileMenu,
|
|
2584
|
+
ws as PagesMobileModal,
|
|
2585
|
+
Di as PagesSettings,
|
|
2586
|
+
Wi as ProductCardButtons,
|
|
2587
|
+
Qi as ProductCardModal,
|
|
2588
|
+
Un as ProductOptions,
|
|
2589
|
+
St as RangeSelector,
|
|
2590
|
+
rt as Select,
|
|
2591
|
+
Ui as ShareLink,
|
|
2592
|
+
Cs as ShoppingButton,
|
|
2593
|
+
Ss as ShoppingModalCart,
|
|
2594
|
+
ot as Switch,
|
|
2595
|
+
na as TextSettings,
|
|
2596
|
+
sa as TextareaSettings,
|
|
2597
|
+
Xi as TextareaUI,
|
|
2598
|
+
ia as TypesText,
|
|
2599
|
+
Bt as UserInfo
|
|
2293
2600
|
};
|