@mypixia/simplex-designer 2.1.2 → 2.1.4

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/index.es.js CHANGED
@@ -57,7 +57,7 @@ function Ze() {
57
57
  return "Fragment";
58
58
  case E:
59
59
  return "Profiler";
60
- case z:
60
+ case B:
61
61
  return "StrictMode";
62
62
  case W:
63
63
  return "Suspense";
@@ -76,7 +76,7 @@ function Ze() {
76
76
  return (u.displayName || "Context") + ".Provider";
77
77
  case S:
78
78
  return (u._context.displayName || "Context") + ".Consumer";
79
- case B:
79
+ case z:
80
80
  var A = u.render;
81
81
  return u = u.displayName, u || (u = A.displayName || A.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
82
82
  case U:
@@ -238,7 +238,7 @@ React keys must be passed directly to JSX without using spread:
238
238
  function C(u) {
239
239
  typeof u == "object" && u !== null && u.$$typeof === I && u._store && (u._store.validated = 1);
240
240
  }
241
- var p = _e, I = Symbol.for("react.transitional.element"), T = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), z = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), S = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), B = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), at = Symbol.for("react.suspense_list"), U = Symbol.for("react.memo"), ft = Symbol.for("react.lazy"), q = Symbol.for("react.activity"), rt = Symbol.for("react.client.reference"), Y = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, J = Array.isArray, st = console.createTask ? console.createTask : function() {
241
+ var p = _e, I = Symbol.for("react.transitional.element"), T = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), B = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), S = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), z = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), at = Symbol.for("react.suspense_list"), U = Symbol.for("react.memo"), ft = Symbol.for("react.lazy"), q = Symbol.for("react.activity"), rt = Symbol.for("react.client.reference"), Y = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, J = Array.isArray, st = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
244
  p = {
@@ -472,9 +472,9 @@ const Ut = {
472
472
  light: "#FFFFFF"
473
473
  }
474
474
  };
475
- Xe.toDataURL(s, w, (z, E) => {
476
- if (z) {
477
- console.error("QR Code generation error:", z);
475
+ Xe.toDataURL(s, w, (B, E) => {
476
+ if (B) {
477
+ console.error("QR Code generation error:", B);
478
478
  return;
479
479
  }
480
480
  c(E);
@@ -586,7 +586,7 @@ const Ut = {
586
586
  ] })
587
587
  ] }) }) : null;
588
588
  }, ri = ({ isOpen: d, onClose: o, onAddBarcode: a, theme: l }) => {
589
- const [s, f] = N(""), [x, c] = N("CODE128"), [y, g] = N(null), [F, C] = N(2), [p, I] = N(100), [T, w] = N(20), [z, E] = N("center"), [S, $] = N("bottom"), [B, W] = N(10), at = dt(null), U = [
589
+ const [s, f] = N(""), [x, c] = N("CODE128"), [y, g] = N(null), [F, C] = N(2), [p, I] = N(100), [T, w] = N(20), [B, E] = N("center"), [S, $] = N("bottom"), [z, W] = N(10), at = dt(null), U = [
590
590
  { value: "CODE128", label: "CODE128 (Most Common)" },
591
591
  { value: "EAN13", label: "EAN-13 (European Article Number)" },
592
592
  { value: "EAN8", label: "EAN-8 (Short EAN)" },
@@ -607,9 +607,9 @@ const Ut = {
607
607
  width: F,
608
608
  height: p,
609
609
  fontSize: T,
610
- textAlign: z,
610
+ textAlign: B,
611
611
  textPosition: S,
612
- margin: B,
612
+ margin: z,
613
613
  background: "#ffffff",
614
614
  lineColor: "#000000"
615
615
  }
@@ -865,9 +865,9 @@ const Ut = {
865
865
  }
866
866
  ` })
867
867
  ] }), si = ({ isOpen: d, onClose: o, onAddSticker: a, theme: l, apiKey: s, apiEndpoint: f }) => {
868
- const [x, c] = N([]), [y, g] = N(!1), [F, C] = N(null), [p, I] = N(""), [T, w] = N(""), [z, E] = N({});
868
+ const [x, c] = N([]), [y, g] = N(!1), [F, C] = N(null), [p, I] = N(""), [T, w] = N(""), [B, E] = N({});
869
869
  dt(null);
870
- const [S, $] = N(!1), [B, W] = N(!1), [at, U] = N(!1), ft = `${f}/api/v1/designer`;
870
+ const [S, $] = N(!1), [z, W] = N(!1), [at, U] = N(!1), ft = `${f}/api/v1/designer`;
871
871
  et(() => {
872
872
  d && s && q();
873
873
  }, [d, s]);
@@ -935,7 +935,7 @@ const Ut = {
935
935
  });
936
936
  }), G;
937
937
  }, K = (M, G = "", j = 0) => /* @__PURE__ */ i.jsx("div", { className: "sticker-tree-level", style: { paddingLeft: `${j * 15}px` }, children: Object.keys(M).map((u) => {
938
- const A = `${G}/${u}`, Q = z[A];
938
+ const A = `${G}/${u}`, Q = B[A];
939
939
  return M[u].type === "image" ? !T || u.toLowerCase().includes(T.toLowerCase()) ? /* @__PURE__ */ i.jsx(
940
940
  "div",
941
941
  {
@@ -986,8 +986,8 @@ const Ut = {
986
986
  ] }),
987
987
  /* @__PURE__ */ i.jsxs("div", { className: "sticker-modal-body", children: [
988
988
  at && /* @__PURE__ */ i.jsx(de, {}),
989
- !S && !at && B && /* @__PURE__ */ i.jsx(ai, { theme: l }),
990
- S && B && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
989
+ !S && !at && z && /* @__PURE__ */ i.jsx(ai, { theme: l }),
990
+ S && z && /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
991
991
  /* @__PURE__ */ i.jsx("div", { className: "sticker-modal-controls", children: /* @__PURE__ */ i.jsx("div", { className: "search-container", children: /* @__PURE__ */ i.jsx(
992
992
  "input",
993
993
  {
@@ -2560,32 +2560,32 @@ const Ut = {
2560
2560
  description: "Complex mandala flower pattern"
2561
2561
  }
2562
2562
  ], ni = ({ isOpen: d, onClose: o, onAddEmbroidery: a, theme: l, apiKey: s, apiEndpoint: f }) => {
2563
- const [x, c] = N([]), [y, g] = N(!1), [F, C] = N(null), [p, I] = N(""), [T, w] = N("All"), z = dt(null), E = ["All", "Floral", "Nature", "Geometric", "Traditional", "Sports", "Hobbies", "Food", "Symbols", "Holiday", "Text"];
2563
+ const [x, c] = N([]), [y, g] = N(!1), [F, C] = N(null), [p, I] = N(""), [T, w] = N("All"), B = dt(null), E = ["All", "Floral", "Nature", "Geometric", "Traditional", "Sports", "Hobbies", "Food", "Symbols", "Holiday", "Text"];
2564
2564
  et(() => {
2565
2565
  d && c(li);
2566
2566
  }, [d]);
2567
- const S = (B) => {
2567
+ const S = (z) => {
2568
2568
  a({
2569
2569
  type: "embroidery",
2570
- src: B.url,
2571
- name: B.name,
2572
- description: B.description,
2573
- category: B.category,
2570
+ src: z.url,
2571
+ name: z.name,
2572
+ description: z.description,
2573
+ category: z.category,
2574
2574
  width: 120,
2575
2575
  height: 120,
2576
2576
  x: 100,
2577
2577
  y: 100
2578
2578
  }), o();
2579
- }, $ = x.filter((B) => {
2580
- const W = !p || B.name.toLowerCase().includes(p.toLowerCase()) || B.description.toLowerCase().includes(p.toLowerCase()), at = T === "All" || B.category === T;
2579
+ }, $ = x.filter((z) => {
2580
+ const W = !p || z.name.toLowerCase().includes(p.toLowerCase()) || z.description.toLowerCase().includes(p.toLowerCase()), at = T === "All" || z.category === T;
2581
2581
  return W && at;
2582
2582
  });
2583
2583
  return d ? /* @__PURE__ */ i.jsx("div", { className: "embroidery-modal-overlay", onClick: o, children: /* @__PURE__ */ i.jsxs(
2584
2584
  "div",
2585
2585
  {
2586
2586
  className: "embroidery-modal-content",
2587
- onClick: (B) => B.stopPropagation(),
2588
- ref: z,
2587
+ onClick: (z) => z.stopPropagation(),
2588
+ ref: B,
2589
2589
  children: [
2590
2590
  /* @__PURE__ */ i.jsxs("div", { className: "embroidery-modal-header", children: [
2591
2591
  /* @__PURE__ */ i.jsx("h3", { children: "Choose an Embroidery Design" }),
@@ -2606,7 +2606,7 @@ const Ut = {
2606
2606
  type: "text",
2607
2607
  placeholder: "Search embroidery designs...",
2608
2608
  value: p,
2609
- onChange: (B) => I(B.target.value),
2609
+ onChange: (z) => I(z.target.value),
2610
2610
  className: "embroidery-search"
2611
2611
  }
2612
2612
  ) }),
@@ -2616,9 +2616,9 @@ const Ut = {
2616
2616
  "select",
2617
2617
  {
2618
2618
  value: T,
2619
- onChange: (B) => w(B.target.value),
2619
+ onChange: (z) => w(z.target.value),
2620
2620
  className: "category-select",
2621
- children: E.map((B) => /* @__PURE__ */ i.jsx("option", { value: B, children: B }, B))
2621
+ children: E.map((z) => /* @__PURE__ */ i.jsx("option", { value: z, children: z }, z))
2622
2622
  }
2623
2623
  )
2624
2624
  ] })
@@ -2629,31 +2629,31 @@ const Ut = {
2629
2629
  /* @__PURE__ */ i.jsx("p", { children: "Loading embroidery designs..." })
2630
2630
  ] }),
2631
2631
  F && /* @__PURE__ */ i.jsx("div", { className: "embroidery-error", children: /* @__PURE__ */ i.jsx("p", { children: F }) }),
2632
- !y && !F && /* @__PURE__ */ i.jsx("div", { className: "embroidery-grid", children: $.map((B) => /* @__PURE__ */ i.jsxs(
2632
+ !y && !F && /* @__PURE__ */ i.jsx("div", { className: "embroidery-grid", children: $.map((z) => /* @__PURE__ */ i.jsxs(
2633
2633
  "div",
2634
2634
  {
2635
2635
  className: "embroidery-item",
2636
- onClick: () => S(B),
2637
- title: B.description,
2636
+ onClick: () => S(z),
2637
+ title: z.description,
2638
2638
  children: [
2639
2639
  /* @__PURE__ */ i.jsx("div", { className: "embroidery-preview", children: /* @__PURE__ */ i.jsx(
2640
2640
  "img",
2641
2641
  {
2642
- src: B.url,
2643
- alt: B.name,
2642
+ src: z.url,
2643
+ alt: z.name,
2644
2644
  loading: "lazy",
2645
2645
  onError: (W) => {
2646
- console.error("Failed to load embroidery image:", B.url), W.target.style.display = "none";
2646
+ console.error("Failed to load embroidery image:", z.url), W.target.style.display = "none";
2647
2647
  }
2648
2648
  }
2649
2649
  ) }),
2650
2650
  /* @__PURE__ */ i.jsxs("div", { className: "embroidery-info", children: [
2651
- /* @__PURE__ */ i.jsx("div", { className: "embroidery-name", children: B.name }),
2652
- /* @__PURE__ */ i.jsx("div", { className: "embroidery-category", children: B.category })
2651
+ /* @__PURE__ */ i.jsx("div", { className: "embroidery-name", children: z.name }),
2652
+ /* @__PURE__ */ i.jsx("div", { className: "embroidery-category", children: z.category })
2653
2653
  ] })
2654
2654
  ]
2655
2655
  },
2656
- B.id
2656
+ z.id
2657
2657
  )) }),
2658
2658
  !y && !F && $.length === 0 && /* @__PURE__ */ i.jsx("div", { className: "no-embroideries", children: /* @__PURE__ */ i.jsx("p", { children: "No embroidery designs found matching your search." }) })
2659
2659
  ] }),
@@ -4724,11 +4724,11 @@ const Ut = {
4724
4724
  snapToGrid: I,
4725
4725
  selectedElement: T,
4726
4726
  theme: w,
4727
- readOnly: z,
4727
+ readOnly: B,
4728
4728
  apiKey: E,
4729
4729
  apiEndpoint: S
4730
4730
  }) => {
4731
- const [$, B] = N(!1), [W, at] = N(!1), [U, ft] = N(!1), [q, rt] = N(!1), [Y, O] = N(!1), [J, st] = N(!1), [K, it] = N(!1), M = (P) => {
4731
+ const [$, z] = N(!1), [W, at] = N(!1), [U, ft] = N(!1), [q, rt] = N(!1), [Y, O] = N(!1), [J, st] = N(!1), [K, it] = N(!1), M = (P) => {
4732
4732
  const nt = P.target.files[0];
4733
4733
  nt && nt.type.startsWith("image/") && y(nt), P.target.value = "";
4734
4734
  }, G = (P) => {
@@ -4766,7 +4766,7 @@ const Ut = {
4766
4766
  {
4767
4767
  className: "toolbar-btn compact",
4768
4768
  onClick: l,
4769
- disabled: !g || z,
4769
+ disabled: !g || B,
4770
4770
  title: "Undo (Ctrl+Z)",
4771
4771
  children: [
4772
4772
  /* @__PURE__ */ i.jsx("span", { className: "icon", children: "↶" }),
@@ -4779,7 +4779,7 @@ const Ut = {
4779
4779
  {
4780
4780
  className: "toolbar-btn compact",
4781
4781
  onClick: s,
4782
- disabled: !F || z,
4782
+ disabled: !F || B,
4783
4783
  title: "Redo (Ctrl+Y)",
4784
4784
  children: [
4785
4785
  /* @__PURE__ */ i.jsx("span", { className: "icon", children: "↷" }),
@@ -4795,7 +4795,7 @@ const Ut = {
4795
4795
  "button",
4796
4796
  {
4797
4797
  className: "toolbar-btn compact dropdown-trigger",
4798
- disabled: z,
4798
+ disabled: B,
4799
4799
  title: "Add Text",
4800
4800
  onClick: Z,
4801
4801
  children: [
@@ -4821,7 +4821,7 @@ const Ut = {
4821
4821
  "button",
4822
4822
  {
4823
4823
  className: "toolbar-btn compact dropdown-trigger",
4824
- disabled: z,
4824
+ disabled: B,
4825
4825
  onClick: V,
4826
4826
  children: [
4827
4827
  /* @__PURE__ */ i.jsx("span", { className: "icon", children: "◩" }),
@@ -4882,7 +4882,7 @@ const Ut = {
4882
4882
  ] })
4883
4883
  ] }),
4884
4884
  /* @__PURE__ */ i.jsx("div", { className: "toolbar-separator" }),
4885
- /* @__PURE__ */ i.jsxs("label", { className: "toolbar-btn compact file-upload", style: { cursor: z ? "not-allowed" : "pointer" }, children: [
4885
+ /* @__PURE__ */ i.jsxs("label", { className: "toolbar-btn compact file-upload", style: { cursor: B ? "not-allowed" : "pointer" }, children: [
4886
4886
  /* @__PURE__ */ i.jsx("span", { className: "icon", children: "☁️" }),
4887
4887
  /* @__PURE__ */ i.jsx("span", { className: "label", children: "Upload" }),
4888
4888
  /* @__PURE__ */ i.jsx(
@@ -4891,18 +4891,18 @@ const Ut = {
4891
4891
  type: "file",
4892
4892
  accept: "image/*",
4893
4893
  onChange: M,
4894
- disabled: z
4894
+ disabled: B
4895
4895
  }
4896
4896
  )
4897
4897
  ] }),
4898
4898
  /* @__PURE__ */ i.jsx("div", { className: "toolbar-separator" }),
4899
- /* @__PURE__ */ i.jsx(ii, { onSelectIcon: G, theme: w, disabled: z }),
4899
+ /* @__PURE__ */ i.jsx(ii, { onSelectIcon: G, theme: w, disabled: B }),
4900
4900
  /* @__PURE__ */ i.jsxs(
4901
4901
  "button",
4902
4902
  {
4903
4903
  className: "toolbar-btn compact",
4904
4904
  onClick: () => ft(!0),
4905
- disabled: z,
4905
+ disabled: B,
4906
4906
  title: "Add Sticker",
4907
4907
  children: [
4908
4908
  /* @__PURE__ */ i.jsx("span", { className: "icon", children: "🎨" }),
@@ -4915,8 +4915,8 @@ const Ut = {
4915
4915
  "button",
4916
4916
  {
4917
4917
  className: "toolbar-btn compact",
4918
- onClick: () => B(!0),
4919
- disabled: z,
4918
+ onClick: () => z(!0),
4919
+ disabled: B,
4920
4920
  title: "Add QR Code",
4921
4921
  children: [
4922
4922
  /* @__PURE__ */ i.jsx("span", { className: "icon", children: "▦" }),
@@ -4929,7 +4929,7 @@ const Ut = {
4929
4929
  {
4930
4930
  className: "toolbar-btn compact",
4931
4931
  onClick: () => at(!0),
4932
- disabled: z,
4932
+ disabled: B,
4933
4933
  title: "Add Barcode",
4934
4934
  children: [
4935
4935
  /* @__PURE__ */ i.jsx("span", { className: "icon", children: "▤" }),
@@ -4944,7 +4944,7 @@ const Ut = {
4944
4944
  {
4945
4945
  className: "toolbar-btn compact",
4946
4946
  onClick: () => rt(!0),
4947
- disabled: z,
4947
+ disabled: B,
4948
4948
  title: "Add Embroidery Design",
4949
4949
  children: [
4950
4950
  /* @__PURE__ */ i.jsx("span", { className: "icon", children: "🧵" }),
@@ -4960,7 +4960,7 @@ const Ut = {
4960
4960
  {
4961
4961
  className: "toolbar-btn compact success",
4962
4962
  onClick: a,
4963
- disabled: z,
4963
+ disabled: B,
4964
4964
  title: "Duplicate Element (Ctrl+D)",
4965
4965
  children: [
4966
4966
  /* @__PURE__ */ i.jsx("span", { className: "icon", children: "⧉" }),
@@ -4973,7 +4973,7 @@ const Ut = {
4973
4973
  {
4974
4974
  className: "toolbar-btn compact danger",
4975
4975
  onClick: o,
4976
- disabled: z,
4976
+ disabled: B,
4977
4977
  title: "Delete Element (Delete)",
4978
4978
  children: [
4979
4979
  /* @__PURE__ */ i.jsx("span", { className: "icon", children: "🗑️" }),
@@ -5027,7 +5027,7 @@ const Ut = {
5027
5027
  oi,
5028
5028
  {
5029
5029
  isOpen: $,
5030
- onClose: () => B(!1),
5030
+ onClose: () => z(!1),
5031
5031
  onAddQRCode: j,
5032
5032
  theme: w
5033
5033
  }
@@ -5086,10 +5086,10 @@ const Ut = {
5086
5086
  /* @__PURE__ */ i.jsx("h3", { children: "Properties" }),
5087
5087
  /* @__PURE__ */ i.jsx("p", { className: "no-selection", children: "Select an element to edit its properties" })
5088
5088
  ] });
5089
- const c = (w, z) => {
5090
- o(d.id, { [w]: z });
5089
+ const c = (w, B) => {
5090
+ o(d.id, { [w]: B });
5091
5091
  }, y = () => {
5092
- var w, z, E;
5092
+ var w, B, E;
5093
5093
  return /* @__PURE__ */ i.jsxs("div", { className: "property-group", children: [
5094
5094
  /* @__PURE__ */ i.jsx("h4", { children: "Text Content" }),
5095
5095
  /* @__PURE__ */ i.jsxs("div", { className: "property-row", children: [
@@ -5193,7 +5193,7 @@ const Ut = {
5193
5193
  {
5194
5194
  className: (w = d.textDecoration) != null && w.includes("underline") ? "active" : "",
5195
5195
  onClick: () => {
5196
- const S = d.textDecoration || "", $ = S.split(" ").filter((B) => B && B !== "underline");
5196
+ const S = d.textDecoration || "", $ = S.split(" ").filter((z) => z && z !== "underline");
5197
5197
  S.includes("underline") || $.push("underline"), c("textDecoration", $.join(" ").trim());
5198
5198
  },
5199
5199
  title: "Underline",
@@ -5203,9 +5203,9 @@ const Ut = {
5203
5203
  /* @__PURE__ */ i.jsx(
5204
5204
  "button",
5205
5205
  {
5206
- className: (z = d.textDecoration) != null && z.includes("overline") ? "active" : "",
5206
+ className: (B = d.textDecoration) != null && B.includes("overline") ? "active" : "",
5207
5207
  onClick: () => {
5208
- const S = d.textDecoration || "", $ = S.split(" ").filter((B) => B && B !== "overline");
5208
+ const S = d.textDecoration || "", $ = S.split(" ").filter((z) => z && z !== "overline");
5209
5209
  S.includes("overline") || $.push("overline"), c("textDecoration", $.join(" ").trim());
5210
5210
  },
5211
5211
  title: "Overline",
@@ -5217,7 +5217,7 @@ const Ut = {
5217
5217
  {
5218
5218
  className: (E = d.textDecoration) != null && E.includes("line-through") ? "active" : "",
5219
5219
  onClick: () => {
5220
- const S = d.textDecoration || "", $ = S.split(" ").filter((B) => B && B !== "line-through");
5220
+ const S = d.textDecoration || "", $ = S.split(" ").filter((z) => z && z !== "line-through");
5221
5221
  S.includes("line-through") || $.push("line-through"), c("textDecoration", $.join(" ").trim());
5222
5222
  },
5223
5223
  title: "Strikethrough",
@@ -5728,8 +5728,8 @@ const Ut = {
5728
5728
  type: "number",
5729
5729
  value: d.strokeWidth || d.height || 2,
5730
5730
  onChange: (w) => {
5731
- const z = parseInt(w.target.value);
5732
- c("strokeWidth", z), c("height", z);
5731
+ const B = parseInt(w.target.value);
5732
+ c("strokeWidth", B), c("height", B);
5733
5733
  },
5734
5734
  min: "1",
5735
5735
  max: "50"
@@ -6325,28 +6325,28 @@ class gi {
6325
6325
  var p, I;
6326
6326
  const c = [], y = [], g = {};
6327
6327
  for (const T of a) {
6328
- const w = T.sectionName, z = o[w];
6329
- if (!z || !z.elements || z.elements.length === 0) {
6328
+ const w = T.sectionName, B = o[w];
6329
+ if (!B || !B.elements || B.elements.length === 0) {
6330
6330
  console.log(`Skipping section ${w} - no elements`);
6331
6331
  continue;
6332
6332
  }
6333
6333
  let E = T.image || T.sectionImage;
6334
6334
  x && x.sectionImage && (T.sectionName === "Front" || x.sections && Object.keys(x.sections).includes(T.sectionName)) && (E = x.sectionImage);
6335
6335
  const S = {
6336
- ...z,
6336
+ ...B,
6337
6337
  // Include background information using the determined image
6338
6338
  backgroundImage: E,
6339
6339
  sectionImage: E,
6340
6340
  sectionName: w,
6341
6341
  // Ensure we have the selected color
6342
- selectedColor: z.selectedColor || "#FFFFFF",
6342
+ selectedColor: B.selectedColor || "#FFFFFF",
6343
6343
  // Include canvas dimensions
6344
6344
  canvasWidth: l,
6345
6345
  canvasHeight: s
6346
6346
  };
6347
6347
  g[w] = S;
6348
6348
  const $ = await this.exportSectionAsBlob(
6349
- z,
6349
+ B,
6350
6350
  T,
6351
6351
  l,
6352
6352
  s,
@@ -6366,8 +6366,8 @@ class gi {
6366
6366
  sectionImage: W
6367
6367
  });
6368
6368
  }
6369
- const B = await this.exportSectionAsBlob(
6370
- z,
6369
+ const z = await this.exportSectionAsBlob(
6370
+ B,
6371
6371
  T,
6372
6372
  l,
6373
6373
  s,
@@ -6376,9 +6376,9 @@ class gi {
6376
6376
  x
6377
6377
  // Pass initData to exportSectionAsBlob
6378
6378
  );
6379
- if (B) {
6379
+ if (z) {
6380
6380
  const W = await this.blobToFile(
6381
- B,
6381
+ z,
6382
6382
  `${w}-print.${f}`,
6383
6383
  `image/${f}`
6384
6384
  );
@@ -6479,14 +6479,14 @@ class gi {
6479
6479
  // Pass initData to exportSectionAsBlob
6480
6480
  );
6481
6481
  if (F) {
6482
- const z = await this.blobToFile(
6482
+ const B = await this.blobToFile(
6483
6483
  F,
6484
6484
  `${s}-full.${a}`,
6485
6485
  `image/${a}`
6486
6486
  );
6487
6487
  y.push({
6488
6488
  sectionName: s,
6489
- sectionImage: z
6489
+ sectionImage: B
6490
6490
  });
6491
6491
  }
6492
6492
  const C = await this.exportSectionAsBlob(
@@ -6500,14 +6500,14 @@ class gi {
6500
6500
  // Pass initData to exportSectionAsBlob
6501
6501
  );
6502
6502
  if (C) {
6503
- const z = await this.blobToFile(
6503
+ const B = await this.blobToFile(
6504
6504
  C,
6505
6505
  `${s}-print.${a}`,
6506
6506
  `image/${a}`
6507
6507
  );
6508
6508
  g.push({
6509
6509
  sectionName: s,
6510
- sectionImage: z
6510
+ sectionImage: B
6511
6511
  });
6512
6512
  }
6513
6513
  const p = {
@@ -6765,7 +6765,7 @@ const yi = Ye((d, o) => {
6765
6765
  },
6766
6766
  initFile: f,
6767
6767
  initDesignContent: x
6768
- } = d, [c, y] = N([]), [g, F] = N(null), [C, p] = N(!1), [I, T] = N(!1), [w, z] = N(!1), [E, S] = N({ x: 0, y: 0 }), [$, B] = N(null), [W, at] = N(800), [U, ft] = N(600), [q, rt] = N(1), [Y, O] = N(s.colorSettings[0]), [J, st] = N(!1), [K, it] = N(!0), [M, G] = N(!0), [j, u] = N(s.sections[0]), [A, Q] = N(!1), [_, Z] = N({}), [V, ht] = N([]), [H, P] = N(-1), [nt] = N(new xi("localStorage")), gt = dt(null), Et = dt(null), kt = dt(null), wt = dt(null), Ot = dt(null), Bt = dt(new gi()), zt = dt(!1), [yt, Qt] = N(null), lt = ot(() => {
6768
+ } = d, [c, y] = N([]), [g, F] = N(null), [C, p] = N(!1), [I, T] = N(!1), [w, B] = N(!1), [E, S] = N({ x: 0, y: 0 }), [$, z] = N(null), [W, at] = N(600), [U, ft] = N(600), [q, rt] = N(1), [Y, O] = N(s.colorSettings[0]), [J, st] = N(!1), [K, it] = N(!0), [M, G] = N(!0), [j, u] = N(s.sections[0]), [A, Q] = N(!1), [_, Z] = N({}), [V, ht] = N([]), [H, P] = N(-1), [nt] = N(new xi("localStorage")), gt = dt(null), Et = dt(null), kt = dt(null), wt = dt(null), Ot = dt(null), zt = dt(new gi()), Bt = dt(!1), [yt, Qt] = N(null), lt = ot(() => {
6769
6769
  const e = {
6770
6770
  elements: JSON.parse(JSON.stringify(c)),
6771
6771
  selectedElement: g ? { ...g } : null,
@@ -6857,7 +6857,7 @@ const yi = Ye((d, o) => {
6857
6857
  }, [f, x, s.colorSettings, s.sections]);
6858
6858
  const Wt = ot((e = "png", t = !0) => {
6859
6859
  const r = St();
6860
- return s.sections, Bt.current.exportAllSections(
6860
+ return s.sections, zt.current.exportAllSections(
6861
6861
  { [(j == null ? void 0 : j.sectionName) || "main"]: r },
6862
6862
  [{
6863
6863
  id: (j == null ? void 0 : j.sectionName) || "main",
@@ -7105,13 +7105,13 @@ const yi = Ye((d, o) => {
7105
7105
  pe(e, t);
7106
7106
  break;
7107
7107
  case "sticker":
7108
- Be(e, t);
7108
+ ze(e, t);
7109
7109
  break;
7110
7110
  case "horizontalLine":
7111
7111
  De(e, t);
7112
7112
  break;
7113
7113
  case "embroidery":
7114
- ze(e, t);
7114
+ Be(e, t);
7115
7115
  break;
7116
7116
  }
7117
7117
  e.restore();
@@ -7133,8 +7133,8 @@ const yi = Ye((d, o) => {
7133
7133
  (h) => h.id === t.id ? { ...h, imageLoading: !1 } : h
7134
7134
  )
7135
7135
  );
7136
- }, r.src = t.src, e.fillStyle = "#f0f0f0", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = "#ccc", e.strokeRect(0, 0, t.width, t.height), e.fillStyle = "#666", e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText("Loading...", t.width / 2, t.height / 2);
7137
- } else t.imageLoading ? (e.fillStyle = "#f0f0f0", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = "#ccc", e.strokeRect(0, 0, t.width, t.height), e.fillStyle = "#666", e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText("Loading...", t.width / 2, t.height / 2)) : (e.fillStyle = "#f0f0f0", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = "#ccc", e.strokeRect(0, 0, t.width, t.height), e.fillStyle = "#666", e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText("No Barcode", t.width / 2, t.height / 2));
7136
+ }, r.src = t.src, e.fillStyle = "#f0f0f0", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = "#ccc", e.strokeRect(0, 0, t.width, t.height), e.fillStyle = "#666", e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText("Your customization", t.width / 2, t.height / 2);
7137
+ } else t.imageLoading ? (e.fillStyle = "#f0f0f0", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = "#ccc", e.strokeRect(0, 0, t.width, t.height), e.fillStyle = "#666", e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText("Your customization", t.width / 2, t.height / 2)) : (e.fillStyle = "#f0f0f0", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = "#ccc", e.strokeRect(0, 0, t.width, t.height), e.fillStyle = "#666", e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText("No Barcode", t.width / 2, t.height / 2));
7138
7138
  }, we = (e, t) => {
7139
7139
  if (t.imageObject)
7140
7140
  e.drawImage(t.imageObject, 0, 0, t.width, t.height);
@@ -7318,13 +7318,13 @@ const yi = Ye((d, o) => {
7318
7318
  return;
7319
7319
  }
7320
7320
  }
7321
- e.fillStyle = "#f0f0f0", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = "#ccc", e.lineWidth = 1, e.strokeRect(0, 0, t.width, t.height), e.fillStyle = "#666", e.font = "14px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText("Loading...", t.width / 2, t.height / 2);
7321
+ e.fillStyle = "#f0f0f0", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = "#ccc", e.lineWidth = 1, e.strokeRect(0, 0, t.width, t.height), e.fillStyle = "#666", e.font = "14px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText("Your customization", t.width / 2, t.height / 2);
7322
7322
  } catch (n) {
7323
7323
  console.error("Error drawing image:", n), e.fillStyle = "#ffebee", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = "#f44336", e.lineWidth = 2, e.strokeRect(0, 0, t.width, t.height), e.fillStyle = "#f44336", e.font = "14px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText("Error loading image", t.width / 2, t.height / 2);
7324
7324
  }
7325
7325
  else
7326
7326
  e.fillStyle = "#f8f8f8", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = "#ddd", e.lineWidth = 1, e.strokeRect(0, 0, t.width, t.height), e.fillStyle = "#999", e.font = "14px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText("No Image", t.width / 2, t.height / 2);
7327
- }, Be = (e, t) => {
7327
+ }, ze = (e, t) => {
7328
7328
  const r = t.src;
7329
7329
  if (r)
7330
7330
  try {
@@ -7347,7 +7347,7 @@ const yi = Ye((d, o) => {
7347
7347
  return;
7348
7348
  }
7349
7349
  }
7350
- Rt(e, t, "Loading...");
7350
+ Rt(e, t, "Your customization");
7351
7351
  } catch (n) {
7352
7352
  console.error("Error drawing sticker:", n), Rt(e, t, "Error", !0);
7353
7353
  }
@@ -7355,7 +7355,7 @@ const yi = Ye((d, o) => {
7355
7355
  Rt(e, t, "No Sticker");
7356
7356
  }, Rt = (e, t, r, n = !1) => {
7357
7357
  e.fillStyle = n ? "#ffebee" : "#f8f9fa", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = n ? "#f44336" : "#dee2e6", e.lineWidth = 2, e.strokeRect(0, 0, t.width, t.height), e.fillStyle = n ? "#f44336" : "#6c757d", e.font = "12px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText(r, t.width / 2, t.height / 2);
7358
- }, ze = (e, t) => {
7358
+ }, Be = (e, t) => {
7359
7359
  if (t.imageObject && t.imageObject.complete && t.imageObject.naturalHeight !== 0)
7360
7360
  try {
7361
7361
  e.drawImage(t.imageObject, 0, 0, t.width, t.height);
@@ -7369,8 +7369,8 @@ const yi = Ye((d, o) => {
7369
7369
  r.complete && r.naturalHeight !== 0 ? (t.imageObject = r, t.imageLoading = !1, X()) : (t.imageLoading = !1, console.error("Image loaded but is invalid:", t.src));
7370
7370
  }, r.onerror = () => {
7371
7371
  t.imageLoading = !1, console.error("Failed to load embroidery image:", t.src), Ct(e, t, "Failed to load");
7372
- }, r.src = t.src, Ct(e, t, "Loading...");
7373
- } else t.imageLoading ? Ct(e, t, "Loading...") : Ct(e, t);
7372
+ }, r.src = t.src, Ct(e, t, "Your customization");
7373
+ } else t.imageLoading ? Ct(e, t, "Your customization") : Ct(e, t);
7374
7374
  }, Ct = (e, t, r = "Embroidery") => {
7375
7375
  e.fillStyle = "#f9f9f9", e.fillRect(0, 0, t.width, t.height), e.strokeStyle = "#ddd", e.lineWidth = 2, e.strokeRect(0, 0, t.width, t.height), e.fillStyle = "#999", e.font = "24px Arial", e.textAlign = "center", e.textBaseline = "middle", e.fillText("🧵", t.width / 2, t.height / 2 - 10), e.fillStyle = "#666", e.font = "12px Arial", e.fillText(r, t.width / 2, t.height / 2 + 15);
7376
7376
  }, _t = (e, t, r) => {
@@ -7378,7 +7378,7 @@ const yi = Ye((d, o) => {
7378
7378
  const n = r.x + r.width / 2, h = r.y + r.height / 2, m = e - n, b = t - h, k = -(r.rotation || 0) * Math.PI / 180, v = Math.cos(k), R = Math.sin(k), D = m * v - b * R, L = m * R + b * v, tt = r.width / 2, xt = r.height / 2;
7379
7379
  return D >= -tt && D <= tt && L >= -xt && L <= xt;
7380
7380
  }, We = ot(() => {
7381
- (C || I || w) && lt(), p(!1), T(!1), z(!1), B(null);
7381
+ (C || I || w) && lt(), p(!1), T(!1), B(!1), z(null);
7382
7382
  const e = gt.current;
7383
7383
  e && (e.style.cursor = "default");
7384
7384
  }, [C, I, w, lt]);
@@ -7537,7 +7537,7 @@ const yi = Ye((d, o) => {
7537
7537
  image: j == null ? void 0 : j.sectionImage,
7538
7538
  sectionImage: j == null ? void 0 : j.sectionImage
7539
7539
  }];
7540
- return await Bt.current.exportAllSectionsAsJSON(
7540
+ return await zt.current.exportAllSectionsAsJSON(
7541
7541
  h,
7542
7542
  m,
7543
7543
  W,
@@ -7552,7 +7552,7 @@ const yi = Ye((d, o) => {
7552
7552
  exportCurrentSectionAsJSON: async (e = "png") => {
7553
7553
  try {
7554
7554
  const t = St();
7555
- return await Bt.current.exportCurrentSectionAsJSON(t, e, yt);
7555
+ return await zt.current.exportCurrentSectionAsJSON(t, e, yt);
7556
7556
  } catch (t) {
7557
7557
  throw console.error("Export current section as JSON failed:", t), t;
7558
7558
  }
@@ -7591,7 +7591,7 @@ const yi = Ye((d, o) => {
7591
7591
  const b = Gt(n, h, g);
7592
7592
  if (b) {
7593
7593
  if (b === "rotate") {
7594
- z(!0);
7594
+ B(!0);
7595
7595
  const k = g.x + g.width / 2, v = g.y + g.height / 2, R = Math.atan2(h - v, n - k) * 180 / Math.PI;
7596
7596
  S({
7597
7597
  x: n,
@@ -7600,7 +7600,7 @@ const yi = Ye((d, o) => {
7600
7600
  initialRotation: g.rotation || 0
7601
7601
  });
7602
7602
  } else
7603
- T(!0), B(b), S({
7603
+ T(!0), z(b), S({
7604
7604
  x: n,
7605
7605
  y: h,
7606
7606
  initialWidth: g.width,
@@ -7760,7 +7760,7 @@ const yi = Ye((d, o) => {
7760
7760
  [X]
7761
7761
  );
7762
7762
  et(() => {
7763
- zt.current || Jt();
7763
+ Bt.current || Jt();
7764
7764
  }, [c, g, J, Jt]);
7765
7765
  function $e(e, t) {
7766
7766
  let r;
@@ -7781,7 +7781,7 @@ const yi = Ye((d, o) => {
7781
7781
  r.width = W, r.height = U, n.clearRect(0, 0, W, U), n.drawImage(e, 0, 0, W, U);
7782
7782
  const h = n.getImageData(0, 0, W, U), m = h.data, b = ye(t);
7783
7783
  if (!b) {
7784
- zt.current = !1;
7784
+ Bt.current = !1;
7785
7785
  return;
7786
7786
  }
7787
7787
  const { r: k, g: v, b: R } = b;
@@ -7793,7 +7793,7 @@ const yi = Ye((d, o) => {
7793
7793
  n.putImageData(h, 0, 0);
7794
7794
  const D = new Image();
7795
7795
  D.onload = () => {
7796
- wt.current = s.plainColor === "Y" ? D : e, zt.current = !1, X();
7796
+ wt.current = s.plainColor === "Y" ? D : e, Bt.current = !1, X();
7797
7797
  }, D.src = r.toDataURL("image/png");
7798
7798
  }, [W, U, X]), Zt = (e) => {
7799
7799
  if (!K) return { horizontal: [], vertical: [] };