@billgangcom/theme-lib 1.35.0 → 1.36.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/ui.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { j as t, I as v, c as V, a as X, S as tt, T as Ot, C as gt, b as et, u as $t, d as It, D as Nt, e as wt, v as Ct, B as at, f as mt, P as Bt, g as St, h as Tt, i as Ht, k as bt, l as Pt, m as qt, M as Et, n as Dt, o as zt } from "./index-fMRXTmQw.js";
2
- import { p as fa, L as xa } from "./index-fMRXTmQw.js";
1
+ import { j as t, I as v, c as F, a as X, S as tt, T as Ot, C as gt, b as et, u as $t, d as It, D as Nt, e as wt, v as Ct, B as at, f as mt, P as Bt, g as St, h as Tt, i as Ht, k as bt, l as Pt, m as qt, M as Et, n as Dt, o as zt } from "./index-DwwDB4Kw.js";
2
+ import { p as fa, L as xa } from "./index-DwwDB4Kw.js";
3
3
  import g from "react";
4
4
  import "@phosphor-icons/react";
5
5
  const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibiw_15", Yt = "_subtitle_3ibiw_22", Gt = "_alignmentContent_3ibiw_29", Wt = "_alignments_3ibiw_37", Xt = "_alignment_3ibiw_8", Jt = "_circle_3ibiw_63", Qt = "_paddings_3ibiw_70", Kt = "_padding_3ibiw_70", Zt = "_active_3ibiw_94", te = "_input_3ibiw_101", J = {
@@ -57,7 +57,7 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
57
57
  return "AlignBottom";
58
58
  }
59
59
  }
60
- const [h, n] = g.useState(null);
60
+ const [m, n] = g.useState(null);
61
61
  return /* @__PURE__ */ t.jsxs("div", { className: J.layout, children: [
62
62
  /* @__PURE__ */ t.jsx("h3", { className: J.title, children: "Layout" }),
63
63
  /* @__PURE__ */ t.jsxs("div", { className: J.alignmentBlock, children: [
@@ -88,8 +88,8 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
88
88
  /* @__PURE__ */ t.jsx("div", { className: J.paddings, children: se.map((o) => /* @__PURE__ */ t.jsxs(
89
89
  "label",
90
90
  {
91
- className: V(J.padding, {
92
- [J.active]: h === o
91
+ className: F(J.padding, {
92
+ [J.active]: m === o
93
93
  }),
94
94
  onFocus: () => {
95
95
  n(o);
@@ -156,13 +156,13 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
156
156
  return /* @__PURE__ */ t.jsx("div", { className: vt.typeTexts, children: me.map((i) => /* @__PURE__ */ t.jsx(
157
157
  "div",
158
158
  {
159
- className: V(vt.block, {
159
+ className: F(vt.block, {
160
160
  [vt.active]: c.includes(i)
161
161
  }),
162
162
  onClick: () => {
163
163
  const a = [...c];
164
164
  if (a.includes(i)) {
165
- const l = a.filter((h) => h !== i);
165
+ const l = a.filter((m) => m !== i);
166
166
  e(l);
167
167
  } else
168
168
  a.push(i), e(a);
@@ -187,12 +187,12 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
187
187
  text: i,
188
188
  setText: a,
189
189
  setTypesText: l,
190
- title: h,
190
+ title: m,
191
191
  subtitle: n = "Items"
192
192
  } = r;
193
193
  return /* @__PURE__ */ t.jsxs("div", { className: ht.text, children: [
194
- (h || e !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: ht.top, children: [
195
- h && /* @__PURE__ */ t.jsx("h3", { className: ht.title, children: h }),
194
+ (m || e !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: ht.top, children: [
195
+ m && /* @__PURE__ */ t.jsx("h3", { className: ht.title, children: m }),
196
196
  e !== void 0 && s && /* @__PURE__ */ t.jsx(
197
197
  tt,
198
198
  {
@@ -220,7 +220,7 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
220
220
  )
221
221
  ] })
222
222
  ] });
223
- }, he = "_title_157lh_1", _e = "_subtitle_157lh_5", pe = "_header_157lh_12", ge = "_text_157lh_13", fe = "_productsBlock_157lh_14", xe = "_top_157lh_26", be = "_itemsBlock_157lh_35", je = "_typeTexts_157lh_41", ve = "_block_157lh_48", ye = "_active_157lh_61", ke = "_products_157lh_14", $e = "_product_157lh_14", Ie = "_button_157lh_80", Ne = "_disabled_157lh_91", we = "_image_157lh_95", Ce = "_info_157lh_102", Be = "_name_157lh_114", Se = "_buttons_157lh_118", Te = "_modal_157lh_125", Pe = "_link_157lh_145", Ae = "_modalOptions_157lh_151", Oe = "_addButton_157lh_163", qe = "_deleteButton_157lh_178", z = {
223
+ }, he = "_title_157lh_1", _e = "_subtitle_157lh_5", pe = "_header_157lh_12", ge = "_text_157lh_13", fe = "_productsBlock_157lh_14", xe = "_top_157lh_26", be = "_itemsBlock_157lh_35", je = "_typeTexts_157lh_41", ve = "_block_157lh_48", ye = "_active_157lh_61", ke = "_products_157lh_14", $e = "_product_157lh_14", Ie = "_button_157lh_80", Ne = "_disabled_157lh_91", we = "_image_157lh_95", Ce = "_info_157lh_102", Be = "_name_157lh_114", Se = "_buttons_157lh_118", Te = "_modal_157lh_125", Pe = "_link_157lh_145", Ae = "_modalOptions_157lh_151", Oe = "_addButton_157lh_163", qe = "_deleteButton_157lh_178", H = {
224
224
  title: he,
225
225
  subtitle: _e,
226
226
  header: pe,
@@ -247,14 +247,14 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
247
247
  }, Ee = g.forwardRef(
248
248
  (r, c) => {
249
249
  const { activeItem: e, setActiveItem: s, popupPosition: i, modalOptions: a, setIsOpenModal: l } = r;
250
- function h(n, o) {
250
+ function m(n, o) {
251
251
  return n.length > o ? `${n.slice(0, o)}...` : n;
252
252
  }
253
253
  return /* @__PURE__ */ t.jsxs(
254
254
  "div",
255
255
  {
256
256
  ref: c,
257
- className: z.modal,
257
+ className: H.modal,
258
258
  onClick: (n) => {
259
259
  n.stopPropagation();
260
260
  },
@@ -263,8 +263,8 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
263
263
  left: `${i.left}px`
264
264
  },
265
265
  children: [
266
- /* @__PURE__ */ t.jsxs("div", { className: z.top, children: [
267
- /* @__PURE__ */ t.jsx("h3", { className: z.title, children: h(e.name, 20) }),
266
+ /* @__PURE__ */ t.jsxs("div", { className: H.top, children: [
267
+ /* @__PURE__ */ t.jsx("h3", { className: H.title, children: m(e.name, 20) }),
268
268
  /* @__PURE__ */ t.jsx(
269
269
  v,
270
270
  {
@@ -278,7 +278,7 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
278
278
  }
279
279
  )
280
280
  ] }),
281
- /* @__PURE__ */ t.jsx("div", { className: z.modalOptions, children: a.map((n) => {
281
+ /* @__PURE__ */ t.jsx("div", { className: H.modalOptions, children: a.map((n) => {
282
282
  if (n.type === "image")
283
283
  return /* @__PURE__ */ t.jsx(
284
284
  gt,
@@ -335,7 +335,7 @@ const Ft = "_wrapper_3ibiw_2", Vt = "_alignmentBlock_3ibiw_8", Ut = "_title_3ibi
335
335
  }
336
336
  );
337
337
  if (n.type === "inputSwitch")
338
- return /* @__PURE__ */ t.jsxs("div", { className: z.link, children: [
338
+ return /* @__PURE__ */ t.jsxs("div", { className: H.link, children: [
339
339
  /* @__PURE__ */ t.jsx(
340
340
  X,
341
341
  {
@@ -437,7 +437,7 @@ function Me({ product: r, children: c }) {
437
437
  setNodeRef: i,
438
438
  transform: a,
439
439
  transition: l,
440
- isDragging: h
440
+ isDragging: m
441
441
  } = St({
442
442
  id: r.id
443
443
  }), n = {
@@ -449,7 +449,7 @@ function Me({ product: r, children: c }) {
449
449
  {
450
450
  ref: i,
451
451
  style: n,
452
- className: `${z.product} ${h ? z.dragging : ""}`,
452
+ className: `${H.product} ${m ? H.dragging : ""}`,
453
453
  ...e,
454
454
  ...s,
455
455
  children: c
@@ -464,25 +464,25 @@ const He = (r) => {
464
464
  setItems: i,
465
465
  other: a,
466
466
  title: l,
467
- subtitle: h,
467
+ subtitle: m,
468
468
  editable: n = !0,
469
469
  draggable: o = !1,
470
470
  withImage: f = !1,
471
- deletable: I = !0,
472
- addable: p = !0,
473
- itemsType: _,
474
- itemsPlaceholder: x = "",
471
+ deletable: N = !0,
472
+ addable: _ = !0,
473
+ itemsType: h,
474
+ itemsPlaceholder: p = "",
475
475
  itemsOptions: d,
476
- hasRangeSelector: w = !1,
477
- rangeSelectorOptions: E,
476
+ hasRangeSelector: C = !1,
477
+ rangeSelectorOptions: D,
478
478
  modalOptions: y,
479
479
  addableOptions: L = {},
480
480
  limit: B,
481
- autoScrollInterval: S
482
- } = r, [M, u] = g.useState(null), [D, K] = g.useState({
481
+ autoScrollInterval: T
482
+ } = r, [x, k] = g.useState(null), [V, K] = g.useState({
483
483
  top: 0,
484
484
  left: 0
485
- }), [b, T] = g.useState(null), $ = g.useRef(null), [U, O] = g.useState(!1), H = $t(
485
+ }), [b, I] = g.useState(null), P = g.useRef(null), [U, q] = g.useState(!1), M = $t(
486
486
  It(Bt, {
487
487
  activationConstraint: {
488
488
  distance: 5
@@ -490,41 +490,41 @@ const He = (r) => {
490
490
  })
491
491
  );
492
492
  g.useEffect(() => {
493
- const m = () => {
494
- u(null), O(!1);
493
+ const u = () => {
494
+ k(null), q(!1);
495
495
  };
496
- return document.body.addEventListener("click", m), u(null), O(!1), () => {
497
- u(null), O(!1), document.body.removeEventListener("click", m);
496
+ return document.body.addEventListener("click", u), k(null), q(!1), () => {
497
+ k(null), q(!1), document.body.removeEventListener("click", u);
498
498
  };
499
499
  }, []), g.useEffect(() => {
500
- if (M) {
501
- const m = [...s].map((k) => k.id === M.id ? M : k);
502
- i(m);
500
+ if (x) {
501
+ const u = [...s].map(($) => $.id === x.id ? x : $);
502
+ i(u);
503
503
  }
504
- }, [M]), g.useEffect(() => {
505
- if ($.current && b) {
506
- const m = $.current.getBoundingClientRect().height, k = window.innerHeight;
507
- let P = b.top;
508
- P + m > k + window.scrollY - 200 && (P = k + window.scrollY - m - 200), P < 0 && (P = 10), K({
509
- top: P,
504
+ }, [x]), g.useEffect(() => {
505
+ if (P.current && b) {
506
+ const u = P.current.getBoundingClientRect().height, $ = window.innerHeight;
507
+ let A = b.top;
508
+ A + u > $ + window.scrollY - 200 && (A = $ + window.scrollY - u - 200), A < 0 && (A = 10), K({
509
+ top: A,
510
510
  left: b.left
511
511
  });
512
512
  }
513
- }, [$.current, b]);
514
- const Z = (m, k) => {
515
- m.stopPropagation();
516
- const P = m.target.getBoundingClientRect();
517
- T({
518
- top: P.top + window.scrollY,
519
- left: P.left - 30
520
- }), u(k), O(!0);
513
+ }, [P.current, b]);
514
+ const Z = (u, $) => {
515
+ u.stopPropagation();
516
+ const A = u.target.getBoundingClientRect();
517
+ I({
518
+ top: A.top + window.scrollY,
519
+ left: A.left - 30
520
+ }), k($), q(!0);
521
521
  };
522
- function ct(m) {
522
+ function ct(u) {
523
523
  if (f)
524
- return m ? /* @__PURE__ */ t.jsx(
524
+ return u ? /* @__PURE__ */ t.jsx(
525
525
  "img",
526
526
  {
527
- src: `https://imagedelivery.net/${m[0]}/w=1000`,
527
+ src: `https://imagedelivery.net/${u[0]}/w=1000`,
528
528
  alt: "image",
529
529
  width: 16,
530
530
  height: 16
@@ -539,18 +539,18 @@ const He = (r) => {
539
539
  }
540
540
  );
541
541
  }
542
- const j = (m) => {
543
- const { active: k, over: P } = m;
544
- if (P && k.id !== P.id) {
545
- const R = s.findIndex((A) => A.id === k.id), Y = s.findIndex((A) => A.id === P.id);
542
+ const j = (u) => {
543
+ const { active: $, over: A } = u;
544
+ if (A && $.id !== A.id) {
545
+ const R = s.findIndex((O) => O.id === $.id), Y = s.findIndex((O) => O.id === A.id);
546
546
  if (R !== -1 && Y !== -1) {
547
- const A = [...s], [lt] = A.splice(R, 1);
548
- A.splice(Y, 0, lt), i(A);
547
+ const O = [...s], [lt] = O.splice(R, 1);
548
+ O.splice(Y, 0, lt), i(O);
549
549
  }
550
550
  }
551
- }, q = (m, k) => {
551
+ }, E = (u, $) => {
552
552
  var R, Y;
553
- const P = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
553
+ const A = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
554
554
  o && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
555
555
  v,
556
556
  {
@@ -560,65 +560,65 @@ const He = (r) => {
560
560
  height: 20
561
561
  }
562
562
  ) }),
563
- _ === "select" && d && /* @__PURE__ */ t.jsx(
563
+ h === "select" && d && /* @__PURE__ */ t.jsx(
564
564
  et,
565
565
  {
566
- onChange: (A) => {
567
- const lt = [...s], ut = d.find((ft) => ft.name === A);
566
+ onChange: (O) => {
567
+ const lt = [...s], ut = d.find((ft) => ft.name === O);
568
568
  if (!ut) return;
569
- const rt = lt.map((ft) => ft.id === m.id ? {
569
+ const rt = lt.map((ft) => ft.id === u.id ? {
570
570
  ...ut,
571
- name: A
571
+ name: O
572
572
  } : ft);
573
- u({
574
- ...m,
575
- name: A
573
+ k({
574
+ ...u,
575
+ name: O
576
576
  }), i([...rt]);
577
577
  },
578
- value: m.name,
579
- options: d.filter((A) => !s.find((lt) => lt.name === A.name)).map((A) => A.name),
580
- leftAddon: ct(m.images)
578
+ value: u.name,
579
+ options: d.filter((O) => !s.find((lt) => lt.name === O.name)).map((O) => O.name),
580
+ leftAddon: ct(u.images)
581
581
  }
582
582
  ),
583
- _ === "input" && /* @__PURE__ */ t.jsx(
583
+ h === "input" && /* @__PURE__ */ t.jsx(
584
584
  X,
585
585
  {
586
- onChange: (A) => {
587
- const ut = [...s].map((rt) => rt.id === m.id ? {
588
- ...m,
589
- name: A
586
+ onChange: (O) => {
587
+ const ut = [...s].map((rt) => rt.id === u.id ? {
588
+ ...u,
589
+ name: O
590
590
  } : rt);
591
591
  i([...ut]);
592
592
  },
593
- value: m.name,
594
- placeholder: x
593
+ value: u.name,
594
+ placeholder: p
595
595
  }
596
596
  ),
597
- _ === "image" && /* @__PURE__ */ t.jsx(
597
+ h === "image" && /* @__PURE__ */ t.jsx(
598
598
  gt,
599
599
  {
600
- onChange: (A) => {
601
- const ut = [...s].map((rt) => rt.id === m.id ? {
602
- ...m,
603
- images: A
600
+ onChange: (O) => {
601
+ const ut = [...s].map((rt) => rt.id === u.id ? {
602
+ ...u,
603
+ images: O
604
604
  } : rt);
605
605
  i([...ut]);
606
606
  },
607
- activeImage: (R = s.find((A) => A.id === m.id)) != null && R.images ? (Y = s.find((A) => A.id === m.id)) == null ? void 0 : Y.images[0] : void 0
607
+ activeImage: (R = s.find((O) => O.id === u.id)) != null && R.images ? (Y = s.find((O) => O.id === u.id)) == null ? void 0 : Y.images[0] : void 0
608
608
  }
609
609
  ),
610
- /* @__PURE__ */ t.jsxs("div", { className: z.buttons, children: [
611
- n && /* @__PURE__ */ t.jsx("div", { className: z.deleteButton, children: /* @__PURE__ */ t.jsx(
610
+ /* @__PURE__ */ t.jsxs("div", { className: H.buttons, children: [
611
+ n && /* @__PURE__ */ t.jsx("div", { className: H.deleteButton, children: /* @__PURE__ */ t.jsx(
612
612
  v,
613
613
  {
614
614
  name: "Sliders",
615
615
  hoverable: !0,
616
616
  width: 20,
617
617
  height: 20,
618
- onClick: (A) => Z(A, m)
618
+ onClick: (O) => Z(O, u)
619
619
  }
620
620
  ) }),
621
- I && /* @__PURE__ */ t.jsx("div", { className: z.deleteButton, children: /* @__PURE__ */ t.jsx(
621
+ N && /* @__PURE__ */ t.jsx("div", { className: H.deleteButton, children: /* @__PURE__ */ t.jsx(
622
622
  v,
623
623
  {
624
624
  name: "Trash",
@@ -626,7 +626,7 @@ const He = (r) => {
626
626
  width: 20,
627
627
  height: 20,
628
628
  fill: "#C12A2A",
629
- onClick: () => i(s.filter((A) => A.id !== m.id))
629
+ onClick: () => i(s.filter((O) => O.id !== u.id))
630
630
  }
631
631
  ) })
632
632
  ] })
@@ -634,61 +634,61 @@ const He = (r) => {
634
634
  return o ? /* @__PURE__ */ t.jsx(
635
635
  Me,
636
636
  {
637
- product: m,
638
- index: k,
639
- children: P
637
+ product: u,
638
+ index: $,
639
+ children: A
640
640
  },
641
- m.id
641
+ u.id
642
642
  ) : /* @__PURE__ */ t.jsx(
643
643
  "div",
644
644
  {
645
- className: z.product,
646
- children: P
645
+ className: H.product,
646
+ children: A
647
647
  },
648
- m.id
648
+ u.id
649
649
  );
650
650
  };
651
- return /* @__PURE__ */ t.jsxs("div", { className: z.productsBlock, children: [
652
- (l || c !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: z.top, children: [
653
- l && /* @__PURE__ */ t.jsx("h3", { className: z.title, children: l }),
651
+ return /* @__PURE__ */ t.jsxs("div", { className: H.productsBlock, children: [
652
+ (l || c !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: H.top, children: [
653
+ l && /* @__PURE__ */ t.jsx("h3", { className: H.title, children: l }),
654
654
  c !== void 0 && /* @__PURE__ */ t.jsx(
655
655
  tt,
656
656
  {
657
657
  current: c,
658
- onChange: (m) => e == null ? void 0 : e(m)
658
+ onChange: (u) => e == null ? void 0 : e(u)
659
659
  }
660
660
  )
661
661
  ] }),
662
- M && n && y && U && /* @__PURE__ */ t.jsx(
662
+ x && n && y && U && /* @__PURE__ */ t.jsx(
663
663
  Ee,
664
664
  {
665
- ref: $,
666
- activeItem: M,
667
- setActiveItem: u,
668
- popupPosition: D,
665
+ ref: P,
666
+ activeItem: x,
667
+ setActiveItem: k,
668
+ popupPosition: V,
669
669
  modalOptions: y,
670
- setIsOpenModal: O
670
+ setIsOpenModal: q
671
671
  }
672
672
  ),
673
- w && E && /* @__PURE__ */ t.jsx(At, { ...E }),
674
- /* @__PURE__ */ t.jsxs("div", { className: z.products, children: [
675
- h && /* @__PURE__ */ t.jsx("h5", { className: z.subtitle, children: h }),
673
+ C && D && /* @__PURE__ */ t.jsx(At, { ...D }),
674
+ /* @__PURE__ */ t.jsxs("div", { className: H.products, children: [
675
+ m && /* @__PURE__ */ t.jsx("h5", { className: H.subtitle, children: m }),
676
676
  o ? /* @__PURE__ */ t.jsx(
677
677
  Nt,
678
678
  {
679
- sensors: H,
679
+ sensors: M,
680
680
  onDragEnd: j,
681
681
  children: /* @__PURE__ */ t.jsx(
682
682
  wt,
683
683
  {
684
- items: s.map((m) => m.id),
684
+ items: s.map((u) => u.id),
685
685
  strategy: Ct,
686
- children: s.map((m, k) => q(m, k))
686
+ children: s.map((u, $) => E(u, $))
687
687
  }
688
688
  )
689
689
  }
690
- ) : s.map((m, k) => q(m, k)),
691
- p && /* @__PURE__ */ t.jsx(
690
+ ) : s.map((u, $) => E(u, $)),
691
+ _ && /* @__PURE__ */ t.jsx(
692
692
  "div",
693
693
  {
694
694
  style: {
@@ -700,39 +700,39 @@ const He = (r) => {
700
700
  at,
701
701
  {
702
702
  withoutHover: !0,
703
- className: V(z.button, {
704
- [z.disabled]: !!(B && B <= s.length || s.length === (d == null ? void 0 : d.length))
703
+ className: F(H.button, {
704
+ [H.disabled]: !!(B && B <= s.length || s.length === (d == null ? void 0 : d.length))
705
705
  }),
706
706
  size: "s",
707
707
  disabled: !!(B && B <= s.length || s.length === (d == null ? void 0 : d.length)),
708
708
  onClick: () => {
709
- const m = [...s];
710
- let k = null;
709
+ const u = [...s];
710
+ let $ = null;
711
711
  if (d) {
712
- for (let P = 0; P < d.length; P++)
713
- if (!s.find((R) => R.id === d[P].id)) {
714
- k = d[P];
712
+ for (let A = 0; A < d.length; A++)
713
+ if (!s.find((R) => R.id === d[A].id)) {
714
+ $ = d[A];
715
715
  break;
716
716
  }
717
717
  }
718
- _ === "select" && d ? m.push({
719
- name: k ? k.name : d[0].name,
720
- id: (k == null ? void 0 : k.id) || d[0].id,
718
+ h === "select" && d ? u.push({
719
+ name: $ ? $.name : d[0].name,
720
+ id: ($ == null ? void 0 : $.id) || d[0].id,
721
721
  ...L
722
- }) : _ === "input" ? m.push({
722
+ }) : h === "input" ? u.push({
723
723
  name: "",
724
724
  id: mt(),
725
725
  ...L
726
- }) : m.push({
726
+ }) : u.push({
727
727
  name: `Image ${s.length + 1}`,
728
728
  id: mt(),
729
729
  ...L
730
- }), i(m);
730
+ }), i(u);
731
731
  },
732
732
  style: {
733
733
  width: "fit-content"
734
734
  },
735
- children: /* @__PURE__ */ t.jsxs("div", { className: z.addButton, children: [
735
+ children: /* @__PURE__ */ t.jsxs("div", { className: H.addButton, children: [
736
736
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
737
737
  /* @__PURE__ */ t.jsx(
738
738
  v,
@@ -749,13 +749,13 @@ const He = (r) => {
749
749
  )
750
750
  ] }),
751
751
  a !== void 0 && /* @__PURE__ */ t.jsx(jt, { items: a }),
752
- S !== void 0 && /* @__PURE__ */ t.jsx(
752
+ T !== void 0 && /* @__PURE__ */ t.jsx(
753
753
  X,
754
754
  {
755
755
  label: "Auto scroll interval",
756
756
  type: "number",
757
- value: String(S.scrollInterval),
758
- onChange: (m) => S.setScrollInterval(Number(m)),
757
+ value: String(T.scrollInterval),
758
+ onChange: (u) => T.setScrollInterval(Number(u)),
759
759
  min: 0.1,
760
760
  max: 100,
761
761
  style: {
@@ -797,17 +797,17 @@ const He = (r) => {
797
797
  setItems: i,
798
798
  other: a,
799
799
  title: l,
800
- subtitle: h,
800
+ subtitle: m,
801
801
  draggable: n = !1,
802
802
  withImage: o = !1,
803
803
  addable: f = !0,
804
- itemsOptions: I,
805
- hasRangeSelector: p = !1,
806
- rangeSelectorOptions: _,
807
- limit: x,
804
+ itemsOptions: N,
805
+ hasRangeSelector: _ = !1,
806
+ rangeSelectorOptions: h,
807
+ limit: p,
808
808
  autoScrollInterval: d
809
809
  } = r;
810
- function w(y) {
810
+ function C(y) {
811
811
  if (o)
812
812
  return y ? /* @__PURE__ */ t.jsx(
813
813
  "img",
@@ -827,8 +827,8 @@ const He = (r) => {
827
827
  }
828
828
  );
829
829
  }
830
- const E = (y) => {
831
- const L = I.find((S) => S.id === y);
830
+ const D = (y) => {
831
+ const L = N.find((T) => T.id === y);
832
832
  if (!L) return;
833
833
  const B = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
834
834
  n && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
@@ -843,15 +843,15 @@ const He = (r) => {
843
843
  /* @__PURE__ */ t.jsx(
844
844
  et,
845
845
  {
846
- onChange: (S) => {
847
- const M = [...s], u = I.find((b) => b.name === S);
848
- if (!u) return;
849
- const D = u.id, K = M.map((b) => b === y ? D : b);
846
+ onChange: (T) => {
847
+ const x = [...s], k = N.find((b) => b.name === T);
848
+ if (!k) return;
849
+ const V = k.id, K = x.map((b) => b === y ? V : b);
850
850
  i([...K]);
851
851
  },
852
852
  value: L.name,
853
- options: I.filter((S) => !s.find((M) => M === S.id)).map((S) => S.name),
854
- leftAddon: w(L.images)
853
+ options: N.filter((T) => !s.find((x) => x === T.id)).map((T) => T.name),
854
+ leftAddon: C(L.images)
855
855
  }
856
856
  ),
857
857
  /* @__PURE__ */ t.jsx("div", { className: Q.buttons, children: /* @__PURE__ */ t.jsx("div", { className: Q.deleteButton, children: /* @__PURE__ */ t.jsx(
@@ -862,7 +862,7 @@ const He = (r) => {
862
862
  width: 20,
863
863
  height: 20,
864
864
  fill: "#C12A2A",
865
- onClick: () => i(s.filter((S) => S !== y))
865
+ onClick: () => i(s.filter((T) => T !== y))
866
866
  }
867
867
  ) }) })
868
868
  ] });
@@ -886,10 +886,10 @@ const He = (r) => {
886
886
  }
887
887
  )
888
888
  ] }),
889
- p && _ && /* @__PURE__ */ t.jsx(At, { ..._ }),
889
+ _ && h && /* @__PURE__ */ t.jsx(At, { ...h }),
890
890
  /* @__PURE__ */ t.jsxs("div", { className: Q.products, children: [
891
- h && /* @__PURE__ */ t.jsx("h5", { className: Q.subtitle, children: h }),
892
- s.map((y) => E(y)),
891
+ m && /* @__PURE__ */ t.jsx("h5", { className: Q.subtitle, children: m }),
892
+ s.map((y) => D(y)),
893
893
  f && /* @__PURE__ */ t.jsx(
894
894
  "div",
895
895
  {
@@ -903,22 +903,22 @@ const He = (r) => {
903
903
  at,
904
904
  {
905
905
  withoutHover: !0,
906
- className: V(Q.button, {
907
- [Q.disabled]: !!(x && x <= s.length || s.length === I.length)
906
+ className: F(Q.button, {
907
+ [Q.disabled]: !!(p && p <= s.length || s.length === N.length)
908
908
  }),
909
909
  size: "s",
910
- disabled: !!(x && x <= s.length || s.length === I.length),
910
+ disabled: !!(p && p <= s.length || s.length === N.length),
911
911
  onClick: () => {
912
912
  const y = [...s];
913
913
  let L = null;
914
- if (I) {
915
- for (let B = 0; B < I.length; B++)
916
- if (!s.find((S) => S === I[B].id)) {
917
- L = I[B];
914
+ if (N) {
915
+ for (let B = 0; B < N.length; B++)
916
+ if (!s.find((T) => T === N[B].id)) {
917
+ L = N[B];
918
918
  break;
919
919
  }
920
920
  }
921
- y.push((L == null ? void 0 : L.id) || I[0].id), i(y);
921
+ y.push((L == null ? void 0 : L.id) || N[0].id), i(y);
922
922
  },
923
923
  style: {
924
924
  width: "fit-content"
@@ -956,7 +956,7 @@ const He = (r) => {
956
956
  }
957
957
  )
958
958
  ] });
959
- }, us = "_title_1wm9m_1", ms = "_subtitle_1wm9m_5", hs = "_header_1wm9m_12", _s = "_text_1wm9m_13", ps = "_productsBlock_1wm9m_14", gs = "_top_1wm9m_26", fs = "_itemsBlock_1wm9m_35", xs = "_typeTexts_1wm9m_41", bs = "_block_1wm9m_48", js = "_active_1wm9m_61", vs = "_products_1wm9m_14", ys = "_product_1wm9m_14", ks = "_button_1wm9m_80", $s = "_disabled_1wm9m_91", Is = "_image_1wm9m_95", Ns = "_info_1wm9m_102", ws = "_name_1wm9m_114", Cs = "_buttons_1wm9m_118", Bs = "_modal_1wm9m_125", Ss = "_link_1wm9m_146", Ts = "_modalOptions_1wm9m_152", Ps = "_addButton_1wm9m_164", As = "_deleteButton_1wm9m_179", F = {
959
+ }, us = "_title_1wm9m_1", ms = "_subtitle_1wm9m_5", hs = "_header_1wm9m_12", _s = "_text_1wm9m_13", ps = "_productsBlock_1wm9m_14", gs = "_top_1wm9m_26", fs = "_itemsBlock_1wm9m_35", xs = "_typeTexts_1wm9m_41", bs = "_block_1wm9m_48", js = "_active_1wm9m_61", vs = "_products_1wm9m_14", ys = "_product_1wm9m_14", ks = "_button_1wm9m_80", $s = "_disabled_1wm9m_91", Is = "_image_1wm9m_95", Ns = "_info_1wm9m_102", ws = "_name_1wm9m_114", Cs = "_buttons_1wm9m_118", Bs = "_modal_1wm9m_125", Ss = "_link_1wm9m_146", Ts = "_modalOptions_1wm9m_152", Ps = "_addButton_1wm9m_164", As = "_deleteButton_1wm9m_179", z = {
960
960
  title: us,
961
961
  subtitle: ms,
962
962
  header: hs,
@@ -983,14 +983,14 @@ const He = (r) => {
983
983
  }, Os = g.forwardRef(
984
984
  (r, c) => {
985
985
  const { activeItem: e, setActiveItem: s, popupPosition: i, modalOptions: a, setIsOpenModal: l } = r;
986
- function h(n, o) {
986
+ function m(n, o) {
987
987
  return n.length > o ? `${n.slice(0, o)}...` : n;
988
988
  }
989
989
  return /* @__PURE__ */ t.jsxs(
990
990
  "div",
991
991
  {
992
992
  ref: c,
993
- className: F.modal,
993
+ className: z.modal,
994
994
  onClick: (n) => {
995
995
  n.stopPropagation();
996
996
  },
@@ -999,8 +999,8 @@ const He = (r) => {
999
999
  left: `${i.left}px`
1000
1000
  },
1001
1001
  children: [
1002
- /* @__PURE__ */ t.jsxs("div", { className: F.top, children: [
1003
- /* @__PURE__ */ t.jsx("h3", { className: F.title, children: h(e.name, 20) }),
1002
+ /* @__PURE__ */ t.jsxs("div", { className: z.top, children: [
1003
+ /* @__PURE__ */ t.jsx("h3", { className: z.title, children: m(e.name, 20) }),
1004
1004
  /* @__PURE__ */ t.jsx(
1005
1005
  v,
1006
1006
  {
@@ -1014,7 +1014,7 @@ const He = (r) => {
1014
1014
  }
1015
1015
  )
1016
1016
  ] }),
1017
- /* @__PURE__ */ t.jsx("div", { className: F.modalOptions, children: a.map((n) => {
1017
+ /* @__PURE__ */ t.jsx("div", { className: z.modalOptions, children: a.map((n) => {
1018
1018
  if (n.type === "image")
1019
1019
  return /* @__PURE__ */ t.jsx(
1020
1020
  gt,
@@ -1071,7 +1071,7 @@ const He = (r) => {
1071
1071
  }
1072
1072
  );
1073
1073
  if (n.type === "inputSwitch")
1074
- return /* @__PURE__ */ t.jsxs("div", { className: F.link, children: [
1074
+ return /* @__PURE__ */ t.jsxs("div", { className: z.link, children: [
1075
1075
  /* @__PURE__ */ t.jsx(
1076
1076
  X,
1077
1077
  {
@@ -1126,18 +1126,18 @@ const He = (r) => {
1126
1126
  }
1127
1127
  );
1128
1128
  function qs(r) {
1129
- const { product: c, children: e } = r, { attributes: s, listeners: i, setNodeRef: a, transform: l, transition: h, isDragging: n } = St({
1129
+ const { product: c, children: e } = r, { attributes: s, listeners: i, setNodeRef: a, transform: l, transition: m, isDragging: n } = St({
1130
1130
  id: c.id
1131
1131
  }), o = {
1132
1132
  transform: Tt.Transform.toString(l),
1133
- transition: h
1133
+ transition: m
1134
1134
  };
1135
1135
  return /* @__PURE__ */ t.jsx(
1136
1136
  "div",
1137
1137
  {
1138
1138
  ref: a,
1139
1139
  style: o,
1140
- className: `${F.product} ${n ? F.dragging : ""}`,
1140
+ className: `${z.product} ${n ? z.dragging : ""}`,
1141
1141
  ...s,
1142
1142
  ...i,
1143
1143
  children: e
@@ -1152,23 +1152,23 @@ const aa = (r) => {
1152
1152
  setItems: i,
1153
1153
  other: a,
1154
1154
  title: l,
1155
- subtitle: h,
1155
+ subtitle: m,
1156
1156
  editable: n = !0,
1157
1157
  draggable: o = !1,
1158
1158
  withImage: f = !1,
1159
- deletable: I = !0,
1160
- addable: p = !0,
1161
- itemsType: _,
1162
- itemsPlaceholder: x = "",
1159
+ deletable: N = !0,
1160
+ addable: _ = !0,
1161
+ itemsType: h,
1162
+ itemsPlaceholder: p = "",
1163
1163
  itemsOptions: d,
1164
- hasRangeSelector: w = !1,
1165
- rangeSelectorOptions: E,
1164
+ hasRangeSelector: C = !1,
1165
+ rangeSelectorOptions: D,
1166
1166
  modalOptions: y,
1167
1167
  addableOptions: L = {}
1168
- } = r, [B, S] = g.useState(null), [M, u] = g.useState({
1168
+ } = r, [B, T] = g.useState(null), [x, k] = g.useState({
1169
1169
  top: 0,
1170
1170
  left: 0
1171
- }), [D, K] = g.useState(null), b = g.useRef(null), [T, $] = g.useState(!1), U = $t(
1171
+ }), [V, K] = g.useState(null), b = g.useRef(null), [I, P] = g.useState(!1), U = $t(
1172
1172
  It(Bt, {
1173
1173
  activationConstraint: {
1174
1174
  distance: 5
@@ -1177,35 +1177,35 @@ const aa = (r) => {
1177
1177
  );
1178
1178
  g.useEffect(() => {
1179
1179
  const j = () => {
1180
- S(null), $(!1);
1180
+ T(null), P(!1);
1181
1181
  };
1182
- return document.body.addEventListener("click", j), S(null), $(!1), () => {
1183
- S(null), $(!1), document.body.removeEventListener("click", j);
1182
+ return document.body.addEventListener("click", j), T(null), P(!1), () => {
1183
+ T(null), P(!1), document.body.removeEventListener("click", j);
1184
1184
  };
1185
1185
  }, []), g.useEffect(() => {
1186
1186
  if (B) {
1187
- const j = [...s].map((q) => q.id === B.id ? B : q);
1187
+ const j = [...s].map((E) => E.id === B.id ? B : E);
1188
1188
  i(j);
1189
1189
  }
1190
1190
  }, [B]), g.useEffect(() => {
1191
- if (b.current && D) {
1192
- const j = b.current.getBoundingClientRect().height, q = window.innerHeight;
1193
- let m = D.top;
1194
- m + j > q + window.scrollY - 200 && (m = q + window.scrollY - j - 200), m < 0 && (m = 10), u({
1195
- top: m,
1196
- left: D.left
1191
+ if (b.current && V) {
1192
+ const j = b.current.getBoundingClientRect().height, E = window.innerHeight;
1193
+ let u = V.top;
1194
+ u + j > E + window.scrollY - 200 && (u = E + window.scrollY - j - 200), u < 0 && (u = 10), k({
1195
+ top: u,
1196
+ left: V.left
1197
1197
  });
1198
1198
  }
1199
- }, [b.current, D]);
1200
- const O = (j, q) => {
1199
+ }, [b.current, V]);
1200
+ const q = (j, E) => {
1201
1201
  j.stopPropagation();
1202
- const m = j.target.getBoundingClientRect();
1202
+ const u = j.target.getBoundingClientRect();
1203
1203
  K({
1204
- top: m.top + window.scrollY,
1205
- left: m.left - 30
1206
- }), S(q), $(!0);
1204
+ top: u.top + window.scrollY,
1205
+ left: u.left - 30
1206
+ }), T(E), P(!0);
1207
1207
  };
1208
- function H(j) {
1208
+ function M(j) {
1209
1209
  if (f)
1210
1210
  return j ? /* @__PURE__ */ t.jsx(
1211
1211
  "img",
@@ -1226,17 +1226,17 @@ const aa = (r) => {
1226
1226
  );
1227
1227
  }
1228
1228
  const Z = (j) => {
1229
- const { active: q, over: m } = j;
1230
- if (m && q.id !== m.id) {
1231
- const k = s.findIndex((R) => R.id === q.id), P = s.findIndex((R) => R.id === m.id);
1232
- if (k !== -1 && P !== -1) {
1233
- const R = [...s], [Y] = R.splice(k, 1);
1234
- R.splice(P, 0, Y), i(R);
1229
+ const { active: E, over: u } = j;
1230
+ if (u && E.id !== u.id) {
1231
+ const $ = s.findIndex((R) => R.id === E.id), A = s.findIndex((R) => R.id === u.id);
1232
+ if ($ !== -1 && A !== -1) {
1233
+ const R = [...s], [Y] = R.splice($, 1);
1234
+ R.splice(A, 0, Y), i(R);
1235
1235
  }
1236
1236
  }
1237
1237
  }, ct = (j) => {
1238
- var m;
1239
- const q = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1238
+ var u;
1239
+ const E = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1240
1240
  o && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
1241
1241
  v,
1242
1242
  {
@@ -1246,63 +1246,63 @@ const aa = (r) => {
1246
1246
  height: 20
1247
1247
  }
1248
1248
  ) }),
1249
- _ === "select" && d && /* @__PURE__ */ t.jsx(
1249
+ h === "select" && d && /* @__PURE__ */ t.jsx(
1250
1250
  et,
1251
1251
  {
1252
- onChange: (k) => {
1252
+ onChange: ($) => {
1253
1253
  const R = [...s].map((Y) => Y.id === j.id ? {
1254
1254
  ...j,
1255
- name: k
1255
+ name: $
1256
1256
  } : Y);
1257
- S({
1257
+ T({
1258
1258
  ...j,
1259
- name: k
1259
+ name: $
1260
1260
  }), i([...R]);
1261
1261
  },
1262
1262
  value: j.name,
1263
- options: d.filter((k) => !s.find((P) => P.name === k)),
1264
- leftAddon: H(j.images)
1263
+ options: d.filter(($) => !s.find((A) => A.name === $)),
1264
+ leftAddon: M(j.images)
1265
1265
  }
1266
1266
  ),
1267
- _ === "input" && /* @__PURE__ */ t.jsx(
1267
+ h === "input" && /* @__PURE__ */ t.jsx(
1268
1268
  X,
1269
1269
  {
1270
- onChange: (k) => {
1270
+ onChange: ($) => {
1271
1271
  const R = [...s].map((Y) => Y.id === j.id ? {
1272
1272
  ...j,
1273
- name: k
1273
+ name: $
1274
1274
  } : Y);
1275
1275
  i([...R]);
1276
1276
  },
1277
1277
  value: j.name,
1278
- placeholder: x
1278
+ placeholder: p
1279
1279
  }
1280
1280
  ),
1281
- _ === "image" && /* @__PURE__ */ t.jsx(
1281
+ h === "image" && /* @__PURE__ */ t.jsx(
1282
1282
  gt,
1283
1283
  {
1284
- onChange: (k) => {
1284
+ onChange: ($) => {
1285
1285
  const R = [...s].map((Y) => Y.id === j.id ? {
1286
1286
  ...j,
1287
- images: k
1287
+ images: $
1288
1288
  } : Y);
1289
1289
  i([...R]);
1290
1290
  },
1291
- activeImage: (m = s.find((k) => k.id === j.id)) == null ? void 0 : m.images[0]
1291
+ activeImage: (u = s.find(($) => $.id === j.id)) == null ? void 0 : u.images[0]
1292
1292
  }
1293
1293
  ),
1294
- /* @__PURE__ */ t.jsxs("div", { className: F.buttons, children: [
1295
- n && /* @__PURE__ */ t.jsx("div", { className: F.deleteButton, children: /* @__PURE__ */ t.jsx(
1294
+ /* @__PURE__ */ t.jsxs("div", { className: z.buttons, children: [
1295
+ n && /* @__PURE__ */ t.jsx("div", { className: z.deleteButton, children: /* @__PURE__ */ t.jsx(
1296
1296
  v,
1297
1297
  {
1298
1298
  name: "Sliders",
1299
1299
  hoverable: !0,
1300
1300
  width: 20,
1301
1301
  height: 20,
1302
- onClick: (k) => O(k, j)
1302
+ onClick: ($) => q($, j)
1303
1303
  }
1304
1304
  ) }),
1305
- I && /* @__PURE__ */ t.jsx("div", { className: F.deleteButton, children: /* @__PURE__ */ t.jsx(
1305
+ N && /* @__PURE__ */ t.jsx("div", { className: z.deleteButton, children: /* @__PURE__ */ t.jsx(
1306
1306
  v,
1307
1307
  {
1308
1308
  name: "Trash",
@@ -1310,7 +1310,7 @@ const aa = (r) => {
1310
1310
  width: 20,
1311
1311
  height: 20,
1312
1312
  fill: "#C12A2A",
1313
- onClick: () => i(s.filter((k) => k.id !== j.id))
1313
+ onClick: () => i(s.filter(($) => $.id !== j.id))
1314
1314
  }
1315
1315
  ) })
1316
1316
  ] })
@@ -1319,21 +1319,21 @@ const aa = (r) => {
1319
1319
  qs,
1320
1320
  {
1321
1321
  product: j,
1322
- children: q
1322
+ children: E
1323
1323
  },
1324
1324
  j.id
1325
1325
  ) : /* @__PURE__ */ t.jsx(
1326
1326
  "div",
1327
1327
  {
1328
- className: F.product,
1329
- children: q
1328
+ className: z.product,
1329
+ children: E
1330
1330
  },
1331
1331
  j.id
1332
1332
  );
1333
1333
  };
1334
- return /* @__PURE__ */ t.jsxs("div", { className: F.productsBlock, children: [
1335
- (l || c !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: F.top, children: [
1336
- l && /* @__PURE__ */ t.jsx("h3", { className: F.title, children: l }),
1334
+ return /* @__PURE__ */ t.jsxs("div", { className: z.productsBlock, children: [
1335
+ (l || c !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: z.top, children: [
1336
+ l && /* @__PURE__ */ t.jsx("h3", { className: z.title, children: l }),
1337
1337
  c !== void 0 && /* @__PURE__ */ t.jsx(
1338
1338
  tt,
1339
1339
  {
@@ -1342,20 +1342,20 @@ const aa = (r) => {
1342
1342
  }
1343
1343
  )
1344
1344
  ] }),
1345
- B && n && y && T && /* @__PURE__ */ t.jsx(
1345
+ B && n && y && I && /* @__PURE__ */ t.jsx(
1346
1346
  Os,
1347
1347
  {
1348
1348
  ref: b,
1349
1349
  activeItem: B,
1350
- setActiveItem: S,
1351
- popupPosition: M,
1350
+ setActiveItem: T,
1351
+ popupPosition: x,
1352
1352
  modalOptions: y,
1353
- setIsOpenModal: $
1353
+ setIsOpenModal: P
1354
1354
  }
1355
1355
  ),
1356
- w && E && /* @__PURE__ */ t.jsx(At, { ...E }),
1357
- /* @__PURE__ */ t.jsxs("div", { className: F.products, children: [
1358
- h && /* @__PURE__ */ t.jsx("h5", { className: F.subtitle, children: h }),
1356
+ C && D && /* @__PURE__ */ t.jsx(At, { ...D }),
1357
+ /* @__PURE__ */ t.jsxs("div", { className: z.products, children: [
1358
+ m && /* @__PURE__ */ t.jsx("h5", { className: z.subtitle, children: m }),
1359
1359
  o ? /* @__PURE__ */ t.jsx(
1360
1360
  Nt,
1361
1361
  {
@@ -1371,7 +1371,7 @@ const aa = (r) => {
1371
1371
  )
1372
1372
  }
1373
1373
  ) : s.map((j) => ct(j)),
1374
- p && /* @__PURE__ */ t.jsx(
1374
+ _ && /* @__PURE__ */ t.jsx(
1375
1375
  "div",
1376
1376
  {
1377
1377
  style: {
@@ -1383,25 +1383,25 @@ const aa = (r) => {
1383
1383
  at,
1384
1384
  {
1385
1385
  withoutHover: !0,
1386
- className: F.button,
1386
+ className: z.button,
1387
1387
  size: "s",
1388
1388
  onClick: () => {
1389
1389
  const j = [...s];
1390
- let q = null;
1390
+ let E = null;
1391
1391
  if (d) {
1392
- for (let m = 0; m < d.length; m++)
1393
- if (!s.find((k) => k.name === d[m])) {
1394
- q = d[m];
1392
+ for (let u = 0; u < d.length; u++)
1393
+ if (!s.find(($) => $.name === d[u])) {
1394
+ E = d[u];
1395
1395
  break;
1396
1396
  }
1397
1397
  }
1398
- _ === "select" && d ? j.push({
1399
- name: q || d[0],
1398
+ h === "select" && d ? j.push({
1399
+ name: E || d[0],
1400
1400
  id: mt(),
1401
1401
  ...L,
1402
1402
  maxSymbols: 100
1403
1403
  // пример значения
1404
- }) : _ === "input" ? j.push({
1404
+ }) : h === "input" ? j.push({
1405
1405
  name: "",
1406
1406
  id: mt(),
1407
1407
  ...L,
@@ -1416,7 +1416,7 @@ const aa = (r) => {
1416
1416
  style: {
1417
1417
  width: "fit-content"
1418
1418
  },
1419
- children: /* @__PURE__ */ t.jsxs("div", { className: F.addButton, children: [
1419
+ children: /* @__PURE__ */ t.jsxs("div", { className: z.addButton, children: [
1420
1420
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
1421
1421
  /* @__PURE__ */ t.jsx(
1422
1422
  v,
@@ -1457,20 +1457,20 @@ const aa = (r) => {
1457
1457
  other: en,
1458
1458
  options: sn
1459
1459
  }, nn = g.forwardRef((r, c) => {
1460
- const { activeButton: e, setActiveButton: s, popupPosition: i } = r, [a, l] = g.useState(e.typesText), [h, n] = g.useState(e.destination), [o, f] = g.useState(e.page), [I, p] = g.useState(e.link || ""), [_, x] = g.useState(e.text || ""), [d, w] = g.useState(e.openInNewTab), { pages: E } = Ht();
1460
+ const { activeButton: e, setActiveButton: s, popupPosition: i } = r, [a, l] = g.useState(e.typesText), [m, n] = g.useState(e.destination), [o, f] = g.useState(e.page), [N, _] = g.useState(e.link || ""), [h, p] = g.useState(e.text || ""), [d, C] = g.useState(e.openInNewTab), { pages: D } = Ht();
1461
1461
  return g.useEffect(() => {
1462
1462
  s({
1463
1463
  ...e,
1464
1464
  ...{
1465
- text: _,
1466
- link: I,
1467
- destination: h,
1465
+ text: h,
1466
+ link: N,
1467
+ destination: m,
1468
1468
  typesText: a,
1469
1469
  page: o,
1470
1470
  openInNewTab: d
1471
1471
  }
1472
1472
  });
1473
- }, [a, h, I, _, o, d]), /* @__PURE__ */ t.jsxs(
1473
+ }, [a, m, N, h, o, d]), /* @__PURE__ */ t.jsxs(
1474
1474
  "div",
1475
1475
  {
1476
1476
  className: dt.modal,
@@ -1502,23 +1502,23 @@ const aa = (r) => {
1502
1502
  {
1503
1503
  label: "Destination",
1504
1504
  onChange: (y) => n(y),
1505
- options: ["Go to Page", "Open Link"].filter((y) => y !== h),
1506
- value: h
1505
+ options: ["Go to Page", "Open Link"].filter((y) => y !== m),
1506
+ value: m
1507
1507
  }
1508
1508
  ),
1509
- h === "Go to Page" ? /* @__PURE__ */ t.jsx(
1509
+ m === "Go to Page" ? /* @__PURE__ */ t.jsx(
1510
1510
  et,
1511
1511
  {
1512
1512
  label: "Go to",
1513
1513
  onChange: (y) => f(y),
1514
- options: E ? Object.values(E).filter((y) => y.name !== o).map((y) => y.name) : [],
1514
+ options: D ? Object.values(D).filter((y) => y.name !== o).map((y) => y.name) : [],
1515
1515
  value: o
1516
1516
  }
1517
1517
  ) : /* @__PURE__ */ t.jsx(
1518
1518
  X,
1519
1519
  {
1520
- onChange: (y) => p(y),
1521
- value: I,
1520
+ onChange: (y) => _(y),
1521
+ value: N,
1522
1522
  placeholder: "https://",
1523
1523
  label: "Link"
1524
1524
  }
@@ -1528,14 +1528,14 @@ const aa = (r) => {
1528
1528
  {
1529
1529
  current: e.openInNewTab,
1530
1530
  label: "Open in new tab",
1531
- onChange: (y) => w(y)
1531
+ onChange: (y) => C(y)
1532
1532
  }
1533
1533
  ),
1534
1534
  /* @__PURE__ */ t.jsx(
1535
1535
  Ot,
1536
1536
  {
1537
- onChange: (y) => x(y),
1538
- value: _,
1537
+ onChange: (y) => p(y),
1538
+ value: h,
1539
1539
  label: "Text",
1540
1540
  maxLength: 150
1541
1541
  }
@@ -1575,43 +1575,43 @@ const aa = (r) => {
1575
1575
  addButton: In,
1576
1576
  deleteButton: Nn
1577
1577
  }, wn = (r) => {
1578
- const { buttons: c, setButtons: e, deletable: s = !0, addable: i = !0 } = r, [a, l] = g.useState(null), [h, n] = g.useState({
1578
+ const { buttons: c, setButtons: e, deletable: s = !0, addable: i = !0 } = r, [a, l] = g.useState(null), [m, n] = g.useState({
1579
1579
  top: 0,
1580
1580
  left: 0
1581
- }), [o, f] = g.useState(null), I = g.useRef(null);
1581
+ }), [o, f] = g.useState(null), N = g.useRef(null);
1582
1582
  g.useEffect(() => {
1583
- const _ = () => {
1583
+ const h = () => {
1584
1584
  l(null);
1585
1585
  };
1586
- return document.body.addEventListener("click", _), l(null), () => {
1587
- l(null), document.body.removeEventListener("click", _);
1586
+ return document.body.addEventListener("click", h), l(null), () => {
1587
+ l(null), document.body.removeEventListener("click", h);
1588
1588
  };
1589
1589
  }, []), g.useEffect(() => {
1590
1590
  if (a) {
1591
- const _ = [...c].map((x) => x.id === a.id ? a : x);
1592
- e(_);
1591
+ const h = [...c].map((p) => p.id === a.id ? a : p);
1592
+ e(h);
1593
1593
  }
1594
1594
  }, [a]), g.useEffect(() => {
1595
- if (I.current && o) {
1596
- const _ = I.current.getBoundingClientRect().height, x = window.innerHeight;
1595
+ if (N.current && o) {
1596
+ const h = N.current.getBoundingClientRect().height, p = window.innerHeight;
1597
1597
  let d = o.top;
1598
- d + _ > x + window.scrollY - 200 && (d = x + window.scrollY - _ - 200), d < 0 && (d = 10), n({
1598
+ d + h > p + window.scrollY - 200 && (d = p + window.scrollY - h - 200), d < 0 && (d = 10), n({
1599
1599
  top: d,
1600
1600
  left: o.left
1601
1601
  });
1602
1602
  }
1603
- }, [I.current, o]);
1604
- const p = (_, x) => {
1605
- _.stopPropagation();
1606
- const d = _.target.getBoundingClientRect();
1603
+ }, [N.current, o]);
1604
+ const _ = (h, p) => {
1605
+ h.stopPropagation();
1606
+ const d = h.target.getBoundingClientRect();
1607
1607
  f({
1608
1608
  top: d.top + window.scrollY,
1609
1609
  left: d.left - 30
1610
- }), l(x);
1610
+ }), l(p);
1611
1611
  };
1612
1612
  return /* @__PURE__ */ t.jsxs("div", { className: st.products, children: [
1613
1613
  /* @__PURE__ */ t.jsx("h5", { className: st.subtitle, children: "Button Type" }),
1614
- c.map((_) => /* @__PURE__ */ t.jsxs(
1614
+ c.map((h) => /* @__PURE__ */ t.jsxs(
1615
1615
  "div",
1616
1616
  {
1617
1617
  className: st.product,
@@ -1619,14 +1619,14 @@ const aa = (r) => {
1619
1619
  /* @__PURE__ */ t.jsx(
1620
1620
  et,
1621
1621
  {
1622
- onChange: (x) => {
1623
- const w = [...c].map((E) => E.id === _.id ? {
1624
- ..._,
1625
- type: x
1626
- } : E);
1627
- e(w);
1622
+ onChange: (p) => {
1623
+ const C = [...c].map((D) => D.id === h.id ? {
1624
+ ...h,
1625
+ type: p
1626
+ } : D);
1627
+ e(C);
1628
1628
  },
1629
- value: _.type,
1629
+ value: h.type,
1630
1630
  options: ["Primary", "Secondary", "Tertiary"]
1631
1631
  }
1632
1632
  ),
@@ -1638,8 +1638,8 @@ const aa = (r) => {
1638
1638
  hoverable: !0,
1639
1639
  width: 20,
1640
1640
  height: 20,
1641
- onClick: (x) => {
1642
- p(x, _);
1641
+ onClick: (p) => {
1642
+ _(p, h);
1643
1643
  }
1644
1644
  }
1645
1645
  ) }),
@@ -1649,8 +1649,8 @@ const aa = (r) => {
1649
1649
  name: "Trash",
1650
1650
  hoverable: !0,
1651
1651
  onClick: () => {
1652
- const x = c.filter((d) => d.id !== _.id);
1653
- e(x);
1652
+ const p = c.filter((d) => d.id !== h.id);
1653
+ e(p);
1654
1654
  },
1655
1655
  width: 20,
1656
1656
  height: 20,
@@ -1660,15 +1660,15 @@ const aa = (r) => {
1660
1660
  ] })
1661
1661
  ]
1662
1662
  },
1663
- _.id
1663
+ h.id
1664
1664
  )),
1665
1665
  a && /* @__PURE__ */ t.jsx(
1666
1666
  nn,
1667
1667
  {
1668
- ref: I,
1668
+ ref: N,
1669
1669
  activeButton: a,
1670
1670
  setActiveButton: l,
1671
- popupPosition: h
1671
+ popupPosition: m
1672
1672
  }
1673
1673
  ),
1674
1674
  i && /* @__PURE__ */ t.jsx(
@@ -1686,8 +1686,8 @@ const aa = (r) => {
1686
1686
  className: st.button,
1687
1687
  size: "s",
1688
1688
  onClick: () => {
1689
- const _ = [...c];
1690
- _.push({
1689
+ const h = [...c];
1690
+ h.push({
1691
1691
  type: "Primary",
1692
1692
  id: mt(),
1693
1693
  typesText: [],
@@ -1695,7 +1695,7 @@ const aa = (r) => {
1695
1695
  text: "Button Name",
1696
1696
  page: "home",
1697
1697
  openInNewTab: !0
1698
- }), e(_);
1698
+ }), e(h);
1699
1699
  },
1700
1700
  style: {
1701
1701
  width: "fit-content"
@@ -1753,12 +1753,12 @@ const aa = (r) => {
1753
1753
  controls: Mn,
1754
1754
  button: Hn
1755
1755
  }, At = (r) => {
1756
- const { label: c, min: e = 1, max: s = 4, step: i = 1, count: a, setCount: l } = r, [h, n] = g.useState(!1), o = Array.from({ length: (s - e) / i + 1 }), f = (a - e) / (s - e) * 100, I = () => {
1756
+ const { label: c, min: e = 1, max: s = 4, step: i = 1, count: a, setCount: l } = r, [m, n] = g.useState(!1), o = Array.from({ length: (s - e) / i + 1 }), f = (a - e) / (s - e) * 100, N = () => {
1757
1757
  a < s && l(a + i);
1758
- }, p = () => {
1758
+ }, _ = () => {
1759
1759
  a > e && l(a - i);
1760
- }, _ = (x) => {
1761
- const d = e + x * i;
1760
+ }, h = (p) => {
1761
+ const d = e + p * i;
1762
1762
  l(d);
1763
1763
  };
1764
1764
  return /* @__PURE__ */ t.jsxs("div", { className: G.wrapper, children: [
@@ -1773,16 +1773,16 @@ const aa = (r) => {
1773
1773
  style: { width: `${f}%` }
1774
1774
  }
1775
1775
  ),
1776
- /* @__PURE__ */ t.jsx("div", { className: G.dots, children: o.map((x, d) => {
1777
- const w = d <= (a - e) / i;
1776
+ /* @__PURE__ */ t.jsx("div", { className: G.dots, children: o.map((p, d) => {
1777
+ const C = d <= (a - e) / i;
1778
1778
  return /* @__PURE__ */ t.jsx(
1779
1779
  "button",
1780
1780
  {
1781
- onClick: () => _(d),
1782
- className: V(G.dot, {
1783
- [G.active]: w,
1784
- [G.inactive]: !w,
1785
- [G.dragging]: h
1781
+ onClick: () => h(d),
1782
+ className: F(G.dot, {
1783
+ [G.active]: C,
1784
+ [G.inactive]: !C,
1785
+ [G.dragging]: m
1786
1786
  }),
1787
1787
  "aria-label": `Set value to ${e + d * i}`
1788
1788
  },
@@ -1797,7 +1797,7 @@ const aa = (r) => {
1797
1797
  max: s,
1798
1798
  step: i,
1799
1799
  value: a,
1800
- onChange: (x) => l(Number(x.target.value)),
1800
+ onChange: (p) => l(Number(p.target.value)),
1801
1801
  onMouseDown: () => n(!0),
1802
1802
  onMouseUp: () => n(!1),
1803
1803
  onTouchStart: () => n(!0),
@@ -1814,8 +1814,8 @@ const aa = (r) => {
1814
1814
  min: e,
1815
1815
  max: s,
1816
1816
  paddingless: !0,
1817
- onChange: (x) => {
1818
- const d = Number(x);
1817
+ onChange: (p) => {
1818
+ const d = Number(p);
1819
1819
  d > s ? l(s) : d < e ? l(e) : l(d);
1820
1820
  },
1821
1821
  value: String(a)
@@ -1825,7 +1825,7 @@ const aa = (r) => {
1825
1825
  /* @__PURE__ */ t.jsx(
1826
1826
  "button",
1827
1827
  {
1828
- onClick: I,
1828
+ onClick: N,
1829
1829
  disabled: a >= s,
1830
1830
  className: G.button,
1831
1831
  "aria-label": "Increment count",
@@ -1842,7 +1842,7 @@ const aa = (r) => {
1842
1842
  /* @__PURE__ */ t.jsx(
1843
1843
  "button",
1844
1844
  {
1845
- onClick: p,
1845
+ onClick: _,
1846
1846
  disabled: a <= e,
1847
1847
  className: G.button,
1848
1848
  "aria-label": "Decrement count",
@@ -1886,7 +1886,7 @@ const aa = (r) => {
1886
1886
  }, di = (r) => {
1887
1887
  const { activeItem: c, setActiveItem: e, popupPosition: s, setIsOpenModal: i, itemsOptions: a } = r, l = a.find((n) => n.id === c.listingId);
1888
1888
  if (!l) return null;
1889
- function h(n, o) {
1889
+ function m(n, o) {
1890
1890
  return n.length > o ? `${n.slice(0, o)}...` : n;
1891
1891
  }
1892
1892
  return /* @__PURE__ */ t.jsxs(
@@ -1902,7 +1902,7 @@ const aa = (r) => {
1902
1902
  },
1903
1903
  children: [
1904
1904
  /* @__PURE__ */ t.jsxs("div", { className: W.top, children: [
1905
- /* @__PURE__ */ t.jsx("h3", { children: h(l.productData.name, 20) }),
1905
+ /* @__PURE__ */ t.jsx("h3", { children: m(l.productData.name, 20) }),
1906
1906
  /* @__PURE__ */ t.jsx(
1907
1907
  v,
1908
1908
  {
@@ -1935,11 +1935,11 @@ const aa = (r) => {
1935
1935
  );
1936
1936
  };
1937
1937
  function ui(r) {
1938
- const { product: c, children: e } = r, { attributes: s, listeners: i, setNodeRef: a, transform: l, transition: h, isDragging: n } = St({
1938
+ const { product: c, children: e } = r, { attributes: s, listeners: i, setNodeRef: a, transform: l, transition: m, isDragging: n } = St({
1939
1939
  id: String(c.listingId)
1940
1940
  }), o = {
1941
1941
  transform: Tt.Transform.toString(l),
1942
- transition: h
1942
+ transition: m
1943
1943
  };
1944
1944
  return /* @__PURE__ */ t.jsx(
1945
1945
  "div",
@@ -1961,20 +1961,20 @@ const la = (r) => {
1961
1961
  setItems: i,
1962
1962
  other: a,
1963
1963
  title: l,
1964
- subtitle: h,
1964
+ subtitle: m,
1965
1965
  editable: n = !0,
1966
1966
  draggable: o = !1,
1967
1967
  withImage: f = !1,
1968
- deletable: I = !0,
1969
- addable: p = !0,
1970
- itemsType: _,
1971
- itemsOptions: x
1972
- } = r, [d, w] = g.useState(
1968
+ deletable: N = !0,
1969
+ addable: _ = !0,
1970
+ itemsType: h,
1971
+ itemsOptions: p
1972
+ } = r, [d, C] = g.useState(
1973
1973
  null
1974
- ), [E, y] = g.useState({
1974
+ ), [D, y] = g.useState({
1975
1975
  top: 0,
1976
1976
  left: 0
1977
- }), [L, B] = g.useState(!1), S = $t(
1977
+ }), [L, B] = g.useState(!1), T = $t(
1978
1978
  It(Bt, {
1979
1979
  activationConstraint: {
1980
1980
  distance: 5
@@ -1983,27 +1983,27 @@ const la = (r) => {
1983
1983
  );
1984
1984
  g.useEffect(() => {
1985
1985
  const b = () => {
1986
- w(null), B(!1);
1986
+ C(null), B(!1);
1987
1987
  };
1988
- return document.body.addEventListener("click", b), w(null), B(!1), () => {
1989
- w(null), B(!1), document.body.removeEventListener("click", b);
1988
+ return document.body.addEventListener("click", b), C(null), B(!1), () => {
1989
+ C(null), B(!1), document.body.removeEventListener("click", b);
1990
1990
  };
1991
1991
  }, []), g.useEffect(() => {
1992
1992
  if (d) {
1993
- const b = [...s].map((T) => T.listingId === d.listingId ? d : T);
1993
+ const b = [...s].map((I) => I.listingId === d.listingId ? d : I);
1994
1994
  i(b);
1995
1995
  }
1996
1996
  }, [d]);
1997
- const M = (b, T) => {
1997
+ const x = (b, I) => {
1998
1998
  b.stopPropagation();
1999
- const $ = b.target.getBoundingClientRect(), U = 100, O = window.innerHeight;
2000
- let H = $.top + window.scrollY;
2001
- H + U > O && (H = O - U - 20), B(!0), y({
2002
- top: H - 80,
2003
- left: $.left - 30
2004
- }), w(T);
1999
+ const P = b.target.getBoundingClientRect(), U = 100, q = window.innerHeight;
2000
+ let M = P.top + window.scrollY;
2001
+ M + U > q && (M = q - U - 20), B(!0), y({
2002
+ top: M - 80,
2003
+ left: P.left - 30
2004
+ }), C(I);
2005
2005
  };
2006
- function u(b) {
2006
+ function k(b) {
2007
2007
  if (f)
2008
2008
  return b ? /* @__PURE__ */ t.jsx(
2009
2009
  "img",
@@ -2023,18 +2023,18 @@ const la = (r) => {
2023
2023
  }
2024
2024
  );
2025
2025
  }
2026
- const D = (b) => {
2027
- const { active: T, over: $ } = b;
2028
- if ($ && T.id !== $.id) {
2029
- const U = s.findIndex((H) => String(H.listingId) === T.id), O = s.findIndex((H) => String(H.listingId) === $.id);
2030
- if (U !== -1 && O !== -1) {
2031
- const H = [...s], [Z] = H.splice(U, 1);
2032
- H.splice(O, 0, Z), i(H);
2026
+ const V = (b) => {
2027
+ const { active: I, over: P } = b;
2028
+ if (P && I.id !== P.id) {
2029
+ const U = s.findIndex((M) => String(M.listingId) === I.id), q = s.findIndex((M) => String(M.listingId) === P.id);
2030
+ if (U !== -1 && q !== -1) {
2031
+ const M = [...s], [Z] = M.splice(U, 1);
2032
+ M.splice(q, 0, Z), i(M);
2033
2033
  }
2034
2034
  }
2035
- }, K = (b, T) => {
2036
- const $ = x.find((O) => b.listingId === O.id);
2037
- if (!$) return null;
2035
+ }, K = (b, I) => {
2036
+ const P = p.find((q) => b.listingId === q.id);
2037
+ if (!P) return null;
2038
2038
  const U = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2039
2039
  o && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
2040
2040
  v,
@@ -2045,27 +2045,27 @@ const la = (r) => {
2045
2045
  height: 20
2046
2046
  }
2047
2047
  ) }),
2048
- _ === "select" && /* @__PURE__ */ t.jsx(
2048
+ h === "select" && /* @__PURE__ */ t.jsx(
2049
2049
  et,
2050
2050
  {
2051
- onChange: (O) => {
2052
- const H = [...s], Z = x.find((q) => q.productData.name === O);
2051
+ onChange: (q) => {
2052
+ const M = [...s], Z = p.find((E) => E.productData.name === q);
2053
2053
  if (!Z) return;
2054
2054
  const ct = {
2055
2055
  listingId: Z.id,
2056
2056
  image: Z.productData.images.length > 0 ? Z.productData.images[0].cfId : ""
2057
- }, j = H.map((q) => q.listingId === b.listingId ? ct : q);
2058
- w(ct), i([...j]);
2057
+ }, j = M.map((E) => E.listingId === b.listingId ? ct : E);
2058
+ C(ct), i([...j]);
2059
2059
  },
2060
- value: $.productData.name,
2060
+ value: P.productData.name,
2061
2061
  options: [
2062
- ...x.filter((O) => !s.find((H) => H.listingId === O.id)).map((O) => O.productData.name)
2062
+ ...p.filter((q) => !s.find((M) => M.listingId === q.id)).map((q) => q.productData.name)
2063
2063
  ],
2064
- leftAddon: u(
2065
- b.image || $.productData.images.length > 0 && $.productData.images[0].cfId || ""
2064
+ leftAddon: k(
2065
+ b.image || P.productData.images.length > 0 && P.productData.images[0].cfId || ""
2066
2066
  )
2067
2067
  },
2068
- T
2068
+ I
2069
2069
  ),
2070
2070
  /* @__PURE__ */ t.jsxs("div", { className: W.buttons, children: [
2071
2071
  n && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
@@ -2075,10 +2075,10 @@ const la = (r) => {
2075
2075
  hoverable: !0,
2076
2076
  width: 20,
2077
2077
  height: 20,
2078
- onClick: (O) => M(O, b)
2078
+ onClick: (q) => x(q, b)
2079
2079
  }
2080
2080
  ) }),
2081
- I && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
2081
+ N && /* @__PURE__ */ t.jsx("div", { className: W.deleteButton, children: /* @__PURE__ */ t.jsx(
2082
2082
  v,
2083
2083
  {
2084
2084
  name: "Trash",
@@ -2086,7 +2086,7 @@ const la = (r) => {
2086
2086
  width: 20,
2087
2087
  height: 20,
2088
2088
  fill: "#C12A2A",
2089
- onClick: () => i(s.filter((O) => O !== b))
2089
+ onClick: () => i(s.filter((q) => q !== b))
2090
2090
  }
2091
2091
  ) })
2092
2092
  ] })
@@ -2122,30 +2122,30 @@ const la = (r) => {
2122
2122
  di,
2123
2123
  {
2124
2124
  activeItem: d,
2125
- setActiveItem: w,
2125
+ setActiveItem: C,
2126
2126
  setIsOpenModal: B,
2127
- popupPosition: E,
2128
- itemsOptions: x
2127
+ popupPosition: D,
2128
+ itemsOptions: p
2129
2129
  }
2130
2130
  ),
2131
2131
  /* @__PURE__ */ t.jsxs("div", { className: W.products, children: [
2132
- h && /* @__PURE__ */ t.jsx("h5", { className: W.subtitle, children: h }),
2132
+ m && /* @__PURE__ */ t.jsx("h5", { className: W.subtitle, children: m }),
2133
2133
  o ? /* @__PURE__ */ t.jsx(
2134
2134
  Nt,
2135
2135
  {
2136
- sensors: S,
2137
- onDragEnd: D,
2136
+ sensors: T,
2137
+ onDragEnd: V,
2138
2138
  children: /* @__PURE__ */ t.jsx(
2139
2139
  wt,
2140
2140
  {
2141
2141
  items: s.map((b) => String(b.listingId)),
2142
2142
  strategy: Ct,
2143
- children: s.map((b, T) => K(b, T))
2143
+ children: s.map((b, I) => K(b, I))
2144
2144
  }
2145
2145
  )
2146
2146
  }
2147
- ) : s.map((b, T) => K(b, T)),
2148
- p && /* @__PURE__ */ t.jsx(
2147
+ ) : s.map((b, I) => K(b, I)),
2148
+ _ && /* @__PURE__ */ t.jsx(
2149
2149
  "div",
2150
2150
  {
2151
2151
  style: {
@@ -2161,17 +2161,17 @@ const la = (r) => {
2161
2161
  size: "s",
2162
2162
  onClick: () => {
2163
2163
  const b = [...s];
2164
- for (let T = 0; T < x.length; T++)
2165
- if (!s.find(($) => $.listingId === x[T].id)) {
2164
+ for (let I = 0; I < p.length; I++)
2165
+ if (!s.find((P) => P.listingId === p[I].id)) {
2166
2166
  b.push({
2167
- listingId: x[T].id,
2168
- image: x[T].productData.images.length > 0 ? x[T].productData.images[0].cfId : ""
2167
+ listingId: p[I].id,
2168
+ image: p[I].productData.images.length > 0 ? p[I].productData.images[0].cfId : ""
2169
2169
  });
2170
2170
  break;
2171
2171
  }
2172
2172
  i(b);
2173
2173
  },
2174
- disabled: s.length === x.length,
2174
+ disabled: s.length === p.length,
2175
2175
  style: {
2176
2176
  width: "fit-content"
2177
2177
  },
@@ -2193,7 +2193,7 @@ const la = (r) => {
2193
2193
  ] }),
2194
2194
  a !== void 0 && /* @__PURE__ */ t.jsx(jt, { items: a })
2195
2195
  ] });
2196
- }, mi = "_options_d1lk6_1", hi = "_price_d1lk6_12", _i = "_oldPrice_d1lk6_19", pi = "_newPrice_d1lk6_27", gi = "_animate_d1lk6_34", fi = "_appearAndBounce_d1lk6_1", xi = "_meta_d1lk6_52", bi = "_info_d1lk6_58", ji = "_infoRight_d1lk6_66", vi = "_buttons_d1lk6_73", yi = "_variants_d1lk6_80", ki = "_variant_d1lk6_80", $i = "_stock_d1lk6_98", Ii = "_variantInfo_d1lk6_105", Ni = "_quantity_d1lk6_111", wi = "_count_d1lk6_118", Ci = "_focused_d1lk6_135", Bi = "_button_d1lk6_73", Si = "_activeVariant_d1lk6_161", Ti = "_chargeTypes_d1lk6_165", Pi = "_charge_d1lk6_165", Ai = "_chargeActive_d1lk6_190", Oi = "_title_d1lk6_198", N = {
2196
+ }, mi = "_options_d1lk6_1", hi = "_price_d1lk6_12", _i = "_oldPrice_d1lk6_19", pi = "_newPrice_d1lk6_27", gi = "_animate_d1lk6_34", fi = "_appearAndBounce_d1lk6_1", xi = "_meta_d1lk6_52", bi = "_info_d1lk6_58", ji = "_infoRight_d1lk6_66", vi = "_buttons_d1lk6_73", yi = "_variants_d1lk6_80", ki = "_variant_d1lk6_80", $i = "_stock_d1lk6_98", Ii = "_variantInfo_d1lk6_105", Ni = "_quantity_d1lk6_111", wi = "_count_d1lk6_118", Ci = "_focused_d1lk6_135", Bi = "_button_d1lk6_73", Si = "_activeVariant_d1lk6_161", Ti = "_chargeTypes_d1lk6_165", Pi = "_charge_d1lk6_165", Ai = "_chargeActive_d1lk6_190", Oi = "_title_d1lk6_198", w = {
2197
2197
  options: mi,
2198
2198
  price: hi,
2199
2199
  oldPrice: _i,
@@ -2220,97 +2220,96 @@ const la = (r) => {
2220
2220
  };
2221
2221
  var Mt = /* @__PURE__ */ ((r) => (r.ONE_TIME = "One-Time", r.RECURRING = "Subscribe & Save", r))(Mt || {});
2222
2222
  const ra = (r) => {
2223
- var S, M;
2224
- const { variants: c } = r, [e, s] = g.useState(c[0]), [i, a] = g.useState(e.chargeTypes[0]), l = bt(), [h, n] = g.useState(1), [o, f] = g.useState(!1), { reset: I, addProductToCart: p, getProducts: _, cart: x } = Pt(), [d, w] = g.useState(!1);
2223
+ var B, T;
2224
+ const { variants: c } = r, [e, s] = g.useState(c[0]), [i, a] = g.useState(e.chargeTypes[0]), l = bt(), [m, n] = g.useState(1), [o, f] = g.useState(!1), { reset: N, addProductToCart: _, getProducts: h } = Pt(), [p, d] = g.useState(!1);
2225
2225
  g.useEffect(() => {
2226
- w(!0);
2227
- const u = setTimeout(() => w(!1), 600);
2228
- return () => clearTimeout(u);
2229
- }, [h]);
2230
- async function E() {
2231
- await _(), await p({
2226
+ d(!0);
2227
+ const x = setTimeout(() => d(!1), 600);
2228
+ return () => clearTimeout(x);
2229
+ }, [m]);
2230
+ async function C() {
2231
+ await h(), await _({
2232
2232
  productId: r.id,
2233
2233
  productVariantId: e.id,
2234
- quantity: h
2234
+ quantity: m
2235
2235
  });
2236
2236
  }
2237
- function y() {
2238
- I(), E(), l("/checkout");
2237
+ function D() {
2238
+ N(), C(), l("/checkout");
2239
2239
  }
2240
- console.log(x);
2241
- function L(u) {
2242
- if (u >= 864e5) {
2243
- const $ = Math.floor(u / 864e5);
2244
- return `${$} ${$ === 1 ? "day" : "days"}`;
2245
- } else if (u >= 36e5) {
2246
- const $ = Math.floor(u / 36e5);
2247
- return `${$} ${$ === 1 ? "hour" : "hours"}`;
2248
- } else if (u >= 6e4) {
2249
- const $ = Math.floor(u / 6e4);
2250
- return `${$} ${$ === 1 ? "minute" : "minutes"}`;
2240
+ function y(x) {
2241
+ if (x >= 864e5) {
2242
+ const I = Math.floor(x / 864e5);
2243
+ return `${I} ${I === 1 ? "day" : "days"}`;
2244
+ } else if (x >= 36e5) {
2245
+ const I = Math.floor(x / 36e5);
2246
+ return `${I} ${I === 1 ? "hour" : "hours"}`;
2247
+ } else if (x >= 6e4) {
2248
+ const I = Math.floor(x / 6e4);
2249
+ return `${I} ${I === 1 ? "minute" : "minutes"}`;
2251
2250
  } else {
2252
- const $ = Math.floor(u / 1e3);
2253
- return `${$} ${$ === 1 ? "second" : "seconds"}`;
2251
+ const I = Math.floor(x / 1e3);
2252
+ return `${I} ${I === 1 ? "second" : "seconds"}`;
2254
2253
  }
2255
2254
  }
2256
- function B(u, D) {
2257
- return u.length > D ? u.slice(0, D) + "..." : u;
2255
+ function L(x, k) {
2256
+ return x.length > k ? x.slice(0, k) + "..." : x;
2258
2257
  }
2259
- return /* @__PURE__ */ t.jsxs("div", { className: N.options, children: [
2260
- e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: N.chargeTypes, children: e.chargeTypes.map((u) => /* @__PURE__ */ t.jsx(
2258
+ return /* @__PURE__ */ t.jsxs("div", { className: w.options, children: [
2259
+ e.chargeTypes.length > 1 && /* @__PURE__ */ t.jsx("div", { className: w.chargeTypes, children: e.chargeTypes.map((x) => /* @__PURE__ */ t.jsx(
2261
2260
  "div",
2262
2261
  {
2263
- className: V(N.charge, {
2264
- [N.chargeActive]: i === u
2262
+ className: F(w.charge, {
2263
+ [w.chargeActive]: i === x
2265
2264
  }),
2266
- onClick: () => a(u),
2267
- children: Mt[u]
2265
+ onClick: () => a(x),
2266
+ children: Mt[x]
2268
2267
  },
2269
- u
2268
+ x
2270
2269
  )) }),
2271
- /* @__PURE__ */ t.jsx("div", { className: N.variants, children: c.map((u) => {
2272
- var D;
2270
+ /* @__PURE__ */ t.jsx("div", { className: w.variants, children: c.map((x) => {
2271
+ var k;
2273
2272
  return /* @__PURE__ */ t.jsxs(
2274
2273
  "div",
2275
2274
  {
2276
- className: V(N.variant, {
2277
- [N.activeVariant]: e.id === u.id
2275
+ className: F(w.variant, {
2276
+ [w.activeVariant]: e.id === x.id
2278
2277
  }),
2279
- onClick: () => s(u),
2278
+ onClick: () => s(x),
2280
2279
  children: [
2281
- /* @__PURE__ */ t.jsxs("div", { className: N.variantInfo, children: [
2282
- /* @__PURE__ */ t.jsx("span", { className: N.title, children: B(u.name, 15) }),
2280
+ /* @__PURE__ */ t.jsxs("div", { className: w.variantInfo, children: [
2281
+ /* @__PURE__ */ t.jsx("span", { className: w.title, children: L(x.name, 15) }),
2283
2282
  /* @__PURE__ */ t.jsxs("span", { children: [
2284
2283
  "$",
2285
- i === "ONE_TIME" ? u.price.amount : u.subscriptionSettings ? u.subscriptionSettings.price.amount : "Price Not Found"
2284
+ i === "ONE_TIME" ? x.price.amount : x.subscriptionSettings ? x.subscriptionSettings.price.amount : "Price Not Found"
2286
2285
  ] })
2287
2286
  ] }),
2288
- /* @__PURE__ */ t.jsx("div", { children: i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: N.stock, children: [
2289
- ((D = u.quantity.restrictions) == null ? void 0 : D.max) || u.quantity.available || 0,
2287
+ /* @__PURE__ */ t.jsx("div", { children: i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("span", { className: w.stock, children: [
2288
+ ((k = x.quantity.restrictions) == null ? void 0 : k.max) || x.quantity.available || 0,
2290
2289
  " in stock"
2291
2290
  ] }) })
2292
2291
  ]
2293
2292
  },
2294
- u.id
2293
+ x.id
2295
2294
  );
2296
2295
  }) }),
2297
- i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className: N.quantity, children: [
2296
+ i === "ONE_TIME" && /* @__PURE__ */ t.jsxs("div", { className: w.quantity, children: [
2298
2297
  /* @__PURE__ */ t.jsx(
2299
2298
  "button",
2300
2299
  {
2301
2300
  onClick: () => {
2302
- h > 1 ? n((u) => u - 1) : n(1);
2301
+ m > 1 ? n((x) => x - 1) : n(1);
2303
2302
  },
2304
- className: N.button,
2305
- disabled: e.quantity.restrictions && h <= e.quantity.restrictions.min,
2303
+ className: w.button,
2304
+ disabled: e.quantity.restrictions && m <= e.quantity.restrictions.min,
2306
2305
  children: /* @__PURE__ */ t.jsx(v, { name: "Minus" })
2307
2306
  }
2308
2307
  ),
2309
2308
  /* @__PURE__ */ t.jsx(
2310
2309
  "label",
2311
2310
  {
2312
- className: V(N.count, {
2313
- [N.focused]: o
2311
+ className: F(w.count, {
2312
+ [w.focused]: o
2314
2313
  }),
2315
2314
  onFocus: () => f(!0),
2316
2315
  onBlur: () => f(!1),
@@ -2318,10 +2317,10 @@ const ra = (r) => {
2318
2317
  X,
2319
2318
  {
2320
2319
  type: "number",
2321
- value: String(h),
2322
- onChange: (u) => n(Number(u)),
2323
- max: ((S = e.quantity.restrictions) == null ? void 0 : S.max) || e.quantity.available || 1 / 0,
2324
- min: ((M = e.quantity.restrictions) == null ? void 0 : M.min) || 0,
2320
+ value: String(m),
2321
+ onChange: (x) => n(Number(x)),
2322
+ max: ((B = e.quantity.restrictions) == null ? void 0 : B.max) || e.quantity.available || 1 / 0,
2323
+ min: ((T = e.quantity.restrictions) == null ? void 0 : T.min) || 0,
2325
2324
  style: {
2326
2325
  backgroundColor: "transparent",
2327
2326
  border: "none",
@@ -2335,18 +2334,18 @@ const ra = (r) => {
2335
2334
  "button",
2336
2335
  {
2337
2336
  onClick: () => {
2338
- n((u) => u + 1);
2337
+ n((x) => x + 1);
2339
2338
  },
2340
- className: N.button,
2341
- disabled: !!(e.quantity.restrictions && h >= e.quantity.restrictions.max || e.quantity.available && h >= e.quantity.available),
2339
+ className: w.button,
2340
+ disabled: !!(e.quantity.restrictions && m >= e.quantity.restrictions.max || e.quantity.available && m >= e.quantity.available),
2342
2341
  children: /* @__PURE__ */ t.jsx(v, { name: "Plus" })
2343
2342
  }
2344
2343
  )
2345
2344
  ] }),
2346
- /* @__PURE__ */ t.jsxs("div", { className: N.meta, children: [
2347
- /* @__PURE__ */ t.jsxs("div", { className: N.info, children: [
2345
+ /* @__PURE__ */ t.jsxs("div", { className: w.meta, children: [
2346
+ /* @__PURE__ */ t.jsxs("div", { className: w.info, children: [
2348
2347
  /* @__PURE__ */ t.jsx("span", { children: "Delivery" }),
2349
- /* @__PURE__ */ t.jsxs("div", { className: N.infoRight, children: [
2348
+ /* @__PURE__ */ t.jsxs("div", { className: w.infoRight, children: [
2350
2349
  /* @__PURE__ */ t.jsx(
2351
2350
  v,
2352
2351
  {
@@ -2356,44 +2355,44 @@ const ra = (r) => {
2356
2355
  height: 20
2357
2356
  }
2358
2357
  ),
2359
- /* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" : L(e.deliveryTime) })
2358
+ /* @__PURE__ */ t.jsx("span", { children: !e.deliveryTime || e.deliveryTime === 0 ? "Instant" : y(e.deliveryTime) })
2360
2359
  ] })
2361
2360
  ] }),
2362
- /* @__PURE__ */ t.jsxs("div", { className: N.info, children: [
2361
+ /* @__PURE__ */ t.jsxs("div", { className: w.info, children: [
2363
2362
  /* @__PURE__ */ t.jsx("span", { children: "Price" }),
2364
- /* @__PURE__ */ t.jsx("div", { className: N.infoRight, children: i === "ONE_TIME" ? e.compareAtPrice && (e.compareAtPrice.amount || 0) - (e.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: N.price, children: [
2365
- /* @__PURE__ */ t.jsxs("span", { className: V(N.newPrice, { [N.animate]: d }), children: [
2363
+ /* @__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: [
2364
+ /* @__PURE__ */ t.jsxs("span", { className: F(w.newPrice, { [w.animate]: p }), children: [
2366
2365
  "$ ",
2367
- (e.price.amount || 0) * h
2366
+ (e.price.amount || 0) * m
2368
2367
  ] }),
2369
- /* @__PURE__ */ t.jsxs("span", { className: N.oldPrice, children: [
2368
+ /* @__PURE__ */ t.jsxs("span", { className: w.oldPrice, children: [
2370
2369
  "$ ",
2371
- (e.compareAtPrice.amount || 0) * h
2370
+ (e.compareAtPrice.amount || 0) * m
2372
2371
  ] })
2373
- ] }) : /* @__PURE__ */ t.jsxs("span", { className: V(N.newPrice, { [N.animate]: d }), children: [
2372
+ ] }) : /* @__PURE__ */ t.jsxs("span", { className: F(w.newPrice, { [w.animate]: p }), children: [
2374
2373
  "$ ",
2375
- (e.price.amount || 0) * h
2376
- ] }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: N.price, children: [
2377
- /* @__PURE__ */ t.jsxs("span", { className: V(N.newPrice, { [N.animate]: d }), children: [
2374
+ (e.price.amount || 0) * m
2375
+ ] }) : e.subscriptionSettings && e.subscriptionSettings.compareAtPrice && (e.subscriptionSettings.compareAtPrice.amount || 0) - (e.subscriptionSettings.price.amount || 0) > 0 ? /* @__PURE__ */ t.jsxs("div", { className: w.price, children: [
2376
+ /* @__PURE__ */ t.jsxs("span", { className: F(w.newPrice, { [w.animate]: p }), children: [
2378
2377
  "$ ",
2379
2378
  e.subscriptionSettings.price.amount || 0
2380
2379
  ] }),
2381
- /* @__PURE__ */ t.jsxs("span", { className: N.oldPrice, children: [
2380
+ /* @__PURE__ */ t.jsxs("span", { className: w.oldPrice, children: [
2382
2381
  "$ ",
2383
2382
  e.subscriptionSettings.compareAtPrice.amount || 0
2384
2383
  ] })
2385
- ] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsxs("span", { className: V(N.newPrice, { [N.animate]: d }), children: [
2384
+ ] }) : e.subscriptionSettings && /* @__PURE__ */ t.jsxs("span", { className: F(w.newPrice, { [w.animate]: p }), children: [
2386
2385
  "$ ",
2387
2386
  e.subscriptionSettings.price.amount || 0
2388
2387
  ] }) })
2389
2388
  ] })
2390
2389
  ] }),
2391
- /* @__PURE__ */ t.jsxs("div", { className: N.buttons, children: [
2390
+ /* @__PURE__ */ t.jsxs("div", { className: w.buttons, children: [
2392
2391
  /* @__PURE__ */ t.jsx(
2393
2392
  at,
2394
2393
  {
2395
2394
  type: "Primary",
2396
- onClick: () => y(),
2395
+ onClick: () => D(),
2397
2396
  children: /* @__PURE__ */ t.jsx("span", { children: i === "ONE_TIME" ? "Buy Now" : "Subscribe Now" })
2398
2397
  }
2399
2398
  ),
@@ -2401,13 +2400,13 @@ const ra = (r) => {
2401
2400
  at,
2402
2401
  {
2403
2402
  type: "Secondary",
2404
- onClick: () => E(),
2403
+ onClick: () => C(),
2405
2404
  children: "Add to Cart"
2406
2405
  }
2407
2406
  )
2408
2407
  ] })
2409
2408
  ] });
2410
- }, qi = "_button_oyh2y_1", Ei = "_login_oyh2y_14", Di = "_signUp_oyh2y_18", Li = "_buttons_oyh2y_23", Ri = "_modal_oyh2y_32", Mi = "_closing_oyh2y_61", Hi = "_info_oyh2y_85", zi = "_top_oyh2y_92", Fi = "_title_oyh2y_103", Vi = "_clear_oyh2y_110", Ui = "_activeClear_oyh2y_117", Yi = "_count_oyh2y_121", Gi = "_cart_oyh2y_136", Wi = "_empty_oyh2y_144", Xi = "_product_oyh2y_170", Ji = "_products_oyh2y_179", Qi = "_image_oyh2y_187", Ki = "_productInfo_oyh2y_193", Zi = "_content_oyh2y_200", to = "_name_oyh2y_206", eo = "_price_oyh2y_212", so = "_productButtons_oyh2y_218", no = "_productButton_oyh2y_218", io = "_productCount_oyh2y_238", oo = "_bottom_oyh2y_254", ao = "_subtotal_oyh2y_262", co = "_block_oyh2y_270", lo = "_shoppingCount_oyh2y_277", ro = "_total_oyh2y_297", uo = "_link_oyh2y_303", mo = "_userInfo_oyh2y_310", C = {
2409
+ }, qi = "_button_oyh2y_1", Ei = "_login_oyh2y_14", Di = "_signUp_oyh2y_18", Li = "_buttons_oyh2y_23", Ri = "_modal_oyh2y_32", Mi = "_closing_oyh2y_61", Hi = "_info_oyh2y_85", zi = "_top_oyh2y_92", Fi = "_title_oyh2y_103", Vi = "_clear_oyh2y_110", Ui = "_activeClear_oyh2y_117", Yi = "_count_oyh2y_121", Gi = "_cart_oyh2y_136", Wi = "_empty_oyh2y_144", Xi = "_product_oyh2y_170", Ji = "_products_oyh2y_179", Qi = "_image_oyh2y_187", Ki = "_productInfo_oyh2y_193", Zi = "_content_oyh2y_200", to = "_name_oyh2y_206", eo = "_price_oyh2y_212", so = "_productButtons_oyh2y_218", no = "_productButton_oyh2y_218", io = "_productCount_oyh2y_238", oo = "_bottom_oyh2y_254", ao = "_subtotal_oyh2y_262", co = "_block_oyh2y_270", lo = "_shoppingCount_oyh2y_277", ro = "_total_oyh2y_297", uo = "_link_oyh2y_303", mo = "_userInfo_oyh2y_310", S = {
2411
2410
  button: qi,
2412
2411
  login: Ei,
2413
2412
  signUp: Di,
@@ -2451,17 +2450,17 @@ const ra = (r) => {
2451
2450
  tertiaryHovered: bo,
2452
2451
  content: jo
2453
2452
  }, kt = (r) => {
2454
- const { children: c, onClick: e, style: s, className: i, disabled: a = !1, type: l = "Primary" } = r, { themeSettings: h } = qt();
2453
+ const { children: c, onClick: e, style: s, className: i, disabled: a = !1, type: l = "Primary" } = r, { themeSettings: m } = qt();
2455
2454
  return /* @__PURE__ */ t.jsx(
2456
2455
  "button",
2457
2456
  {
2458
- className: V(nt.button, i, {
2457
+ className: F(nt.button, i, {
2459
2458
  [nt.primary]: l === "Primary",
2460
2459
  [nt.secondary]: l === "Secondary",
2461
2460
  [nt.tertiary]: l === "Tertiary",
2462
- [nt.primaryHovered]: l === "Primary" && !a && h.buttons.primary.hover,
2463
- [nt.secondaryHovered]: l === "Secondary" && !a && h.buttons.secondary.hover,
2464
- [nt.tertiaryHovered]: l === "Tertiary" && !a && h.buttons.tertiary.hover
2461
+ [nt.primaryHovered]: l === "Primary" && !a && m.buttons.primary.hover,
2462
+ [nt.secondaryHovered]: l === "Secondary" && !a && m.buttons.secondary.hover,
2463
+ [nt.tertiaryHovered]: l === "Tertiary" && !a && m.buttons.tertiary.hover
2465
2464
  }),
2466
2465
  onClick: e,
2467
2466
  style: {
@@ -2537,7 +2536,7 @@ const da = (r) => {
2537
2536
  s(l);
2538
2537
  }
2539
2538
  const a = JSON.parse(localStorage.getItem("token") || "{}");
2540
- return /* @__PURE__ */ t.jsxs("div", { className: C.buttons, children: [
2539
+ return /* @__PURE__ */ t.jsxs("div", { className: S.buttons, children: [
2541
2540
  c && /* @__PURE__ */ t.jsx($o, {}),
2542
2541
  !a.data && /* @__PURE__ */ t.jsx(
2543
2542
  kt,
@@ -2565,42 +2564,40 @@ const da = (r) => {
2565
2564
  ] });
2566
2565
  }, $o = () => {
2567
2566
  const [r, c] = g.useState(!1), [e, s] = g.useState([]), { cart: i, getProducts: a } = Pt();
2568
- function l(p) {
2569
- for (let _ = 0; _ < i.parts.length; _++)
2570
- for (let x = 0; x < p.variants.length; x++)
2571
- if (i.parts[_].productVariantId === p.variants[_].id)
2572
- return i.parts[_].productVariantId;
2567
+ function l(_) {
2568
+ for (let h = 0; h < i.parts.length; h++)
2569
+ for (let p = 0; p < _.variants.length; p++)
2570
+ if (i.parts[h].productVariantId === _.variants[h].id)
2571
+ return i.parts[h].productVariantId;
2573
2572
  }
2574
- function h(p) {
2575
- for (let _ = 0; _ < i.parts.length; _++)
2576
- for (let x = 0; x < p.variants.length; x++)
2577
- if (i.parts[_].productVariantId === p.variants[_].id)
2578
- return i.parts[_].quantity;
2573
+ function m(_) {
2574
+ for (let h = 0; h < i.parts.length; h++)
2575
+ for (let p = 0; p < _.variants.length; p++)
2576
+ if (i.parts[h].productVariantId === _.variants[h].id)
2577
+ return i.parts[h].quantity;
2579
2578
  }
2580
2579
  g.useEffect(() => {
2581
2580
  (async () => {
2582
- const _ = i.parts.map((w) => String(w.productId)), d = (await a([..._])).map((w) => ({
2583
- ...w,
2584
- activeVariantId: l(w),
2585
- quantity: h(w)
2581
+ const h = i.parts.map((C) => String(C.productId)), d = (await a([...h])).map((C) => ({
2582
+ ...C,
2583
+ activeVariantId: l(C),
2584
+ quantity: m(C)
2586
2585
  }));
2587
2586
  s(d);
2588
2587
  })();
2589
2588
  }, [i.parts.length]);
2590
- function n(p) {
2591
- var _;
2592
- return !p || !(p != null && p.variants) ? !1 : (_ = p.variants.find((x) => x.id === p.activeVariantId)) == null ? void 0 : _.subscriptionSettings;
2589
+ function n(_) {
2590
+ var h;
2591
+ return !_ || !(_ != null && _.variants) ? !1 : (h = _.variants.find((p) => p.id === _.activeVariantId)) == null ? void 0 : h.subscriptionSettings;
2593
2592
  }
2594
- const o = i.parts.length > 0 && e.length > 0 && !n(e[0]);
2595
- console.log(i.parts.length > 0, e.length > 0, !n(e[0]));
2596
- const [f, I] = g.useState(!1);
2593
+ const o = i.parts.length > 0 && e.length > 0 && !n(e[0]), [f, N] = g.useState(!1);
2597
2594
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2598
2595
  /* @__PURE__ */ t.jsxs(
2599
2596
  "div",
2600
2597
  {
2601
- className: C.button,
2602
- onClick: (p) => {
2603
- p.stopPropagation(), c(!0), I(!0);
2598
+ className: S.button,
2599
+ onClick: (_) => {
2600
+ _.stopPropagation(), c(!0), N(!0);
2604
2601
  },
2605
2602
  children: [
2606
2603
  /* @__PURE__ */ t.jsx(
@@ -2610,7 +2607,7 @@ const da = (r) => {
2610
2607
  fill: "var(--icon-primary)"
2611
2608
  }
2612
2609
  ),
2613
- o && /* @__PURE__ */ t.jsx("div", { className: C.shoppingCount, children: i.parts.length })
2610
+ o && /* @__PURE__ */ t.jsx("div", { className: S.shoppingCount, children: i.parts.length })
2614
2611
  ]
2615
2612
  }
2616
2613
  ),
@@ -2618,7 +2615,7 @@ const da = (r) => {
2618
2615
  Et,
2619
2616
  {
2620
2617
  close: () => {
2621
- I(!1), setTimeout(() => {
2618
+ N(!1), setTimeout(() => {
2622
2619
  c(!1);
2623
2620
  }, 300);
2624
2621
  },
@@ -2634,42 +2631,42 @@ const da = (r) => {
2634
2631
  )
2635
2632
  ] });
2636
2633
  }, Io = (r) => {
2637
- const { activeProducts: c, isCartNotEmpty: e, isOpen: s } = r, { cart: i, reset: a, getTotalAndDiscount: l, updateQuantityOfProduct: h } = Pt(), n = bt();
2638
- function o(p) {
2639
- n(p);
2634
+ const { activeProducts: c, isCartNotEmpty: e, isOpen: s } = r, { cart: i, reset: a, getTotalAndDiscount: l, updateQuantityOfProduct: m } = Pt(), n = bt();
2635
+ function o(_) {
2636
+ n(_);
2640
2637
  }
2641
- function f(p) {
2642
- h({
2643
- productId: p.id,
2644
- productVariantId: p.activeVariantId,
2645
- quantity: p.quantity + 1
2638
+ function f(_) {
2639
+ m({
2640
+ productId: _.id,
2641
+ productVariantId: _.activeVariantId,
2642
+ quantity: _.quantity + 1
2646
2643
  });
2647
2644
  }
2648
- function I(p) {
2649
- h({
2650
- productId: p.id,
2651
- productVariantId: p.activeVariantId,
2652
- quantity: p.quantity - 1
2645
+ function N(_) {
2646
+ m({
2647
+ productId: _.id,
2648
+ productVariantId: _.activeVariantId,
2649
+ quantity: _.quantity - 1
2653
2650
  });
2654
2651
  }
2655
2652
  return /* @__PURE__ */ t.jsxs(
2656
2653
  "div",
2657
2654
  {
2658
- className: V(C.modal, {
2659
- [C.closing]: !s
2655
+ className: F(S.modal, {
2656
+ [S.closing]: !s
2660
2657
  }),
2661
- onClick: (p) => p.stopPropagation(),
2658
+ onClick: (_) => _.stopPropagation(),
2662
2659
  children: [
2663
- /* @__PURE__ */ t.jsxs("div", { className: C.top, children: [
2664
- /* @__PURE__ */ t.jsxs("div", { className: C.info, children: [
2665
- /* @__PURE__ */ t.jsx("span", { className: C.title, children: "Cart" }),
2666
- e && /* @__PURE__ */ t.jsx("div", { className: C.count, children: i.parts.length })
2660
+ /* @__PURE__ */ t.jsxs("div", { className: S.top, children: [
2661
+ /* @__PURE__ */ t.jsxs("div", { className: S.info, children: [
2662
+ /* @__PURE__ */ t.jsx("span", { className: S.title, children: "Cart" }),
2663
+ e && /* @__PURE__ */ t.jsx("div", { className: S.count, children: i.parts.length })
2667
2664
  ] }),
2668
2665
  /* @__PURE__ */ t.jsx(
2669
2666
  "button",
2670
2667
  {
2671
- className: V(C.clear, {
2672
- [C.activeClear]: e
2668
+ className: F(S.clear, {
2669
+ [S.activeClear]: e
2673
2670
  }),
2674
2671
  disabled: !e,
2675
2672
  onClick: a,
@@ -2677,39 +2674,39 @@ const da = (r) => {
2677
2674
  }
2678
2675
  )
2679
2676
  ] }),
2680
- e ? /* @__PURE__ */ t.jsxs("div", { className: C.cart, children: [
2681
- /* @__PURE__ */ t.jsx("div", { className: C.products, children: c.map((p) => /* @__PURE__ */ t.jsxs(
2677
+ e ? /* @__PURE__ */ t.jsxs("div", { className: S.cart, children: [
2678
+ /* @__PURE__ */ t.jsx("div", { className: S.products, children: c.map((_) => /* @__PURE__ */ t.jsxs(
2682
2679
  "div",
2683
2680
  {
2684
- className: C.product,
2681
+ className: S.product,
2685
2682
  children: [
2686
- /* @__PURE__ */ t.jsxs("div", { className: C.productInfo, children: [
2683
+ /* @__PURE__ */ t.jsxs("div", { className: S.productInfo, children: [
2687
2684
  /* @__PURE__ */ t.jsx(
2688
2685
  "img",
2689
2686
  {
2690
- src: `https://imagedelivery.net/${p.images[0].cfId}/w=500`,
2687
+ src: `https://imagedelivery.net/${_.images[0].cfId}/w=500`,
2691
2688
  alt: "image",
2692
2689
  width: "100%",
2693
2690
  height: "100%",
2694
- className: C.image
2691
+ className: S.image
2695
2692
  }
2696
2693
  ),
2697
- /* @__PURE__ */ t.jsxs("div", { className: C.content, children: [
2698
- /* @__PURE__ */ t.jsx("div", { className: C.name, children: p.name }),
2699
- /* @__PURE__ */ t.jsxs("div", { className: C.price, children: [
2694
+ /* @__PURE__ */ t.jsxs("div", { className: S.content, children: [
2695
+ /* @__PURE__ */ t.jsx("div", { className: S.name, children: _.name }),
2696
+ /* @__PURE__ */ t.jsxs("div", { className: S.price, children: [
2700
2697
  "$",
2701
- p.variants.find((_) => _.id === p.activeVariantId).price.amount * ((p == null ? void 0 : p.quantity) || 1)
2698
+ _.variants.find((h) => h.id === _.activeVariantId).price.amount * ((_ == null ? void 0 : _.quantity) || 1)
2702
2699
  ] })
2703
2700
  ] })
2704
2701
  ] }),
2705
- /* @__PURE__ */ t.jsxs("div", { className: C.productButtons, children: [
2702
+ /* @__PURE__ */ t.jsxs("div", { className: S.productButtons, children: [
2706
2703
  /* @__PURE__ */ t.jsx(
2707
2704
  "div",
2708
2705
  {
2709
2706
  onClick: () => {
2710
- p.quantity !== 1 && I(p);
2707
+ _.quantity !== 1 && N(_);
2711
2708
  },
2712
- className: C.productButton,
2709
+ className: S.productButton,
2713
2710
  children: /* @__PURE__ */ t.jsx(
2714
2711
  v,
2715
2712
  {
@@ -2721,12 +2718,12 @@ const da = (r) => {
2721
2718
  )
2722
2719
  }
2723
2720
  ),
2724
- /* @__PURE__ */ t.jsx("div", { className: C.productCount, children: p.quantity }),
2721
+ /* @__PURE__ */ t.jsx("div", { className: S.productCount, children: _.quantity }),
2725
2722
  /* @__PURE__ */ t.jsx(
2726
2723
  "div",
2727
2724
  {
2728
- onClick: () => f(p),
2729
- className: C.productButton,
2725
+ onClick: () => f(_),
2726
+ className: S.productButton,
2730
2727
  children: /* @__PURE__ */ t.jsx(
2731
2728
  v,
2732
2729
  {
@@ -2741,11 +2738,11 @@ const da = (r) => {
2741
2738
  ] })
2742
2739
  ]
2743
2740
  },
2744
- p.id
2741
+ _.id
2745
2742
  )) }),
2746
- /* @__PURE__ */ t.jsxs("div", { className: C.bottom, children: [
2747
- /* @__PURE__ */ t.jsxs("div", { className: C.subtotal, children: [
2748
- /* @__PURE__ */ t.jsxs("div", { className: C.block, children: [
2743
+ /* @__PURE__ */ t.jsxs("div", { className: S.bottom, children: [
2744
+ /* @__PURE__ */ t.jsxs("div", { className: S.subtotal, children: [
2745
+ /* @__PURE__ */ t.jsxs("div", { className: S.block, children: [
2749
2746
  /* @__PURE__ */ t.jsx("span", { children: "Subtotal" }),
2750
2747
  /* @__PURE__ */ t.jsx(
2751
2748
  v,
@@ -2757,7 +2754,7 @@ const da = (r) => {
2757
2754
  }
2758
2755
  )
2759
2756
  ] }),
2760
- /* @__PURE__ */ t.jsxs("div", { className: C.total, children: [
2757
+ /* @__PURE__ */ t.jsxs("div", { className: S.total, children: [
2761
2758
  "$",
2762
2759
  l().total
2763
2760
  ] })
@@ -2768,7 +2765,7 @@ const da = (r) => {
2768
2765
  ]
2769
2766
  }
2770
2767
  );
2771
- }, No = () => /* @__PURE__ */ t.jsxs("div", { className: C.empty, children: [
2768
+ }, No = () => /* @__PURE__ */ t.jsxs("div", { className: S.empty, children: [
2772
2769
  /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
2773
2770
  v,
2774
2771
  {
@@ -2784,7 +2781,7 @@ const da = (r) => {
2784
2781
  "a",
2785
2782
  {
2786
2783
  href: "/products",
2787
- className: C.link,
2784
+ className: S.link,
2788
2785
  children: "view products"
2789
2786
  }
2790
2787
  )
@@ -2803,7 +2800,7 @@ const da = (r) => {
2803
2800
  return /* @__PURE__ */ t.jsx(
2804
2801
  "div",
2805
2802
  {
2806
- className: C.userInfo,
2803
+ className: S.userInfo,
2807
2804
  onClick: () => i("/customer-dash"),
2808
2805
  children: /* @__PURE__ */ t.jsx("div", { children: c || "test-email@gmail.com" })
2809
2806
  }
@@ -2874,7 +2871,7 @@ const da = (r) => {
2874
2871
  /* @__PURE__ */ t.jsx(
2875
2872
  "div",
2876
2873
  {
2877
- className: V(ot.copy, ot.copyText),
2874
+ className: F(ot.copy, ot.copyText),
2878
2875
  onClick: i,
2879
2876
  children: s
2880
2877
  }
@@ -2898,7 +2895,7 @@ const da = (r) => {
2898
2895
  open: Ho,
2899
2896
  content: zo
2900
2897
  }, ma = ({ title: r, content: c }) => {
2901
- const [e, s] = g.useState(!1), [i, a] = g.useState(0), l = g.useRef(null), h = () => {
2898
+ const [e, s] = g.useState(!1), [i, a] = g.useState(0), l = g.useRef(null), m = () => {
2902
2899
  s(!e);
2903
2900
  };
2904
2901
  return g.useEffect(() => {
@@ -2908,10 +2905,10 @@ const da = (r) => {
2908
2905
  "div",
2909
2906
  {
2910
2907
  className: _t.header,
2911
- onClick: h,
2908
+ onClick: m,
2912
2909
  children: [
2913
2910
  /* @__PURE__ */ t.jsx("h5", { id: "h5", children: r }),
2914
- /* @__PURE__ */ t.jsx("div", { className: V(_t.icon, { [_t.open]: e }), children: /* @__PURE__ */ t.jsx(v, { name: "CaretDown" }) })
2911
+ /* @__PURE__ */ t.jsx("div", { className: F(_t.icon, { [_t.open]: e }), children: /* @__PURE__ */ t.jsx(v, { name: "CaretDown" }) })
2915
2912
  ]
2916
2913
  }
2917
2914
  ),
@@ -2942,20 +2939,20 @@ const da = (r) => {
2942
2939
  value: i,
2943
2940
  type: a,
2944
2941
  min: l,
2945
- max: h,
2942
+ max: m,
2946
2943
  placeholder: n,
2947
2944
  disabled: o = !1,
2948
2945
  required: f = !1,
2949
- regex: I,
2950
- paddingless: p = !1,
2951
- borderless: _ = !1,
2952
- editable: x = !1,
2946
+ regex: N,
2947
+ paddingless: _ = !1,
2948
+ borderless: h = !1,
2949
+ editable: p = !1,
2953
2950
  isSearch: d = !1
2954
- } = r, { themeSettings: w } = qt(), { inputs: E } = w, [y, L] = g.useState(!1);
2955
- function B(u, D) {
2956
- if (u.startsWith("#")) {
2957
- let T, $, U;
2958
- return u.length === 7 ? (T = parseInt(u.slice(1, 3), 16), $ = parseInt(u.slice(3, 5), 16), U = parseInt(u.slice(5, 7), 16)) : u.length === 4 && (T = parseInt(u[1] + u[1], 16), $ = parseInt(u[2] + u[2], 16), U = parseInt(u[3] + u[3], 16)), `rgba(${T}, ${$}, ${U}, ${D})`;
2951
+ } = r, { themeSettings: C } = qt(), { inputs: D } = C, [y, L] = g.useState(!1);
2952
+ function B(k, V) {
2953
+ if (k.startsWith("#")) {
2954
+ let I, P, U;
2955
+ return k.length === 7 ? (I = parseInt(k.slice(1, 3), 16), P = parseInt(k.slice(3, 5), 16), U = parseInt(k.slice(5, 7), 16)) : k.length === 4 && (I = parseInt(k[1] + k[1], 16), P = parseInt(k[2] + k[2], 16), U = parseInt(k[3] + k[3], 16)), `rgba(${I}, ${P}, ${U}, ${V})`;
2959
2956
  }
2960
2957
  const b = {
2961
2958
  black: "#000000",
@@ -2964,14 +2961,14 @@ const da = (r) => {
2964
2961
  green: "#00ff00",
2965
2962
  blue: "#0000ff"
2966
2963
  // Можно добавить больше цветов
2967
- }[u.toLowerCase()];
2968
- return b ? B(b, D) : u;
2964
+ }[k.toLowerCase()];
2965
+ return b ? B(b, V) : k;
2969
2966
  }
2970
- function S(u) {
2971
- return Number(u) < 0 ? String(l) : u;
2967
+ function T(k) {
2968
+ return Number(k) < 0 ? String(l) : k;
2972
2969
  }
2973
- function M(u) {
2974
- return !f || !I ? !0 : new RegExp(I).test(u);
2970
+ function x(k) {
2971
+ return !f || !N ? !0 : new RegExp(N).test(k);
2975
2972
  }
2976
2973
  return /* @__PURE__ */ t.jsxs("div", { className: it.wrapper, children: [
2977
2974
  s && /* @__PURE__ */ t.jsx(
@@ -2987,9 +2984,9 @@ const da = (r) => {
2987
2984
  {
2988
2985
  className: it.content,
2989
2986
  style: {
2990
- paddingRight: E.general.height + 15,
2987
+ paddingRight: D.general.height + 15,
2991
2988
  ...e,
2992
- backgroundColor: B(E.field.color, E.field.opacity / 100)
2989
+ backgroundColor: B(D.field.color, D.field.opacity / 100)
2993
2990
  },
2994
2991
  children: [
2995
2992
  /* @__PURE__ */ t.jsx(
@@ -2997,23 +2994,23 @@ const da = (r) => {
2997
2994
  {
2998
2995
  id: s,
2999
2996
  type: a || "text",
3000
- onChange: (u) => {
3001
- if (a === "text") c(u.target.value);
2997
+ onChange: (k) => {
2998
+ if (a === "text") c(k.target.value);
3002
2999
  else {
3003
- const D = S(u.target.value);
3004
- c(D);
3000
+ const V = T(k.target.value);
3001
+ c(V);
3005
3002
  }
3006
3003
  },
3007
3004
  value: i,
3008
3005
  autoComplete: "off",
3009
3006
  placeholder: n || "Type something...",
3010
- className: V(it.input, {
3011
- [it.required]: y && f && !M(i),
3012
- [it.paddingless]: p,
3013
- [it.borderless]: _
3007
+ className: F(it.input, {
3008
+ [it.required]: y && f && !x(i),
3009
+ [it.paddingless]: _,
3010
+ [it.borderless]: h
3014
3011
  }),
3015
3012
  min: a === "number" ? l : void 0,
3016
- max: a === "number" ? h : void 0,
3013
+ max: a === "number" ? m : void 0,
3017
3014
  disabled: o,
3018
3015
  onFocus: () => L(!0)
3019
3016
  }
@@ -3023,11 +3020,11 @@ const da = (r) => {
3023
3020
  {
3024
3021
  name: "MagnifyingGlass",
3025
3022
  fill: "var(--icon-secondary)",
3026
- width: E.general.height,
3027
- height: E.general.height
3023
+ width: D.general.height,
3024
+ height: D.general.height
3028
3025
  }
3029
3026
  ) }),
3030
- x && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
3027
+ p && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
3031
3028
  v,
3032
3029
  {
3033
3030
  name: "Sliders",
@@ -3046,7 +3043,7 @@ const da = (r) => {
3046
3043
  textarea: Zo,
3047
3044
  length: ta
3048
3045
  }, _a = (r) => {
3049
- const { onChange: c, label: e, value: s, maxLength: i, placeholder: a = "Type something..." } = r, [l, h] = g.useState(s.length);
3046
+ const { onChange: c, label: e, value: s, maxLength: i, placeholder: a = "Type something..." } = r, [l, m] = g.useState(s.length);
3050
3047
  return /* @__PURE__ */ t.jsxs("div", { className: xt.wrapper, children: [
3051
3048
  e && /* @__PURE__ */ t.jsx(
3052
3049
  "label",
@@ -3062,7 +3059,7 @@ const da = (r) => {
3062
3059
  id: e,
3063
3060
  defaultValue: s,
3064
3061
  onChange: (n) => {
3065
- h(n.target.value.length), c(n.target.value);
3062
+ m(n.target.value.length), c(n.target.value);
3066
3063
  },
3067
3064
  placeholder: a,
3068
3065
  className: xt.textarea,