@useinsider/guido 3.15.0-beta.e9014b0 → 3.15.0-beta.f5247a0

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.
@@ -1,12 +1,12 @@
1
- import { BlockId as g } from "../../../enums/block.js";
2
- import { useOnboardingStore as y } from "../../../stores/onboarding.js";
3
- import { getMigrationBannerHtml as I } from "../../../utils/migrationBannerHtml.js";
4
- import { Block as C, BlockCompositionType as b, ModificationDescription as c } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { SETTINGS_ENUMS as l, DefaultConfigValues as d } from "./enums/settingsEnums.js";
6
- import { getDefaultTemplate as h } from "./template.js";
7
- import { getItemsBlockContainer as u, getItemsBlockConfig as f, deriveItemNumber as D, getDefaultItemsBlockConfig as N } from "./utils/nodeConfigUtils.js";
8
- const p = g.Items;
9
- class E extends C {
1
+ import { BlockId as f } from "../../../enums/block.js";
2
+ import { useOnboardingStore as g } from "../../../stores/onboarding.js";
3
+ import { getMigrationBannerHtml as y } from "../../../utils/migrationBannerHtml.js";
4
+ import { Block as I, BlockCompositionType as C, ModificationDescription as c } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { SETTINGS_ENUMS as d, DefaultConfigValues as m } from "./enums/settingsEnums.js";
6
+ import { getDefaultTemplate as b } from "./template.js";
7
+ import { getItemsBlockContainer as l, getItemsBlockConfig as u, deriveItemNumber as h, getDefaultItemsBlockConfig as N } from "./utils/nodeConfigUtils.js";
8
+ const p = f.Items;
9
+ class O extends I {
10
10
  getId() {
11
11
  return p;
12
12
  }
@@ -14,7 +14,7 @@ class E extends C {
14
14
  return "items-icon";
15
15
  }
16
16
  getBlockCompositionType() {
17
- return b.CONTAINER;
17
+ return C.CONTAINER;
18
18
  }
19
19
  getName() {
20
20
  return this.api.translate("Items");
@@ -23,20 +23,20 @@ class E extends C {
23
23
  return this.api.translate("Items lets you display personalized products based on user behavior.");
24
24
  }
25
25
  getSettingsPanelTitleHtml() {
26
- return I(
26
+ return y(
27
27
  p,
28
28
  this.api.translate("Items"),
29
29
  this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.")
30
30
  );
31
31
  }
32
32
  getTemplate() {
33
- return h({
34
- orientation: l.ORIENTATION.VERTICAL,
35
- itemsType: l.ITEMS_TYPE.CART_ITEMS,
33
+ return b({
34
+ orientation: d.ORIENTATION.VERTICAL,
35
+ itemsType: d.ITEMS_TYPE.CART_ITEMS,
36
36
  itemId: "{{Abandoned Cart Item (1) Url}}",
37
- currencySymbol: d.productPriceCurrencySymbolControlValue,
38
- currencyLocation: d.productPriceCurrencyLocationControlValue,
39
- formattedPrice: d.productPriceFormattedControlValue === "1"
37
+ currencySymbol: m.productPriceCurrencySymbolControlValue,
38
+ currencyLocation: m.productPriceCurrencyLocationControlValue,
39
+ formattedPrice: m.productPriceFormattedControlValue === "1"
40
40
  });
41
41
  }
42
42
  allowInnerBlocksDND() {
@@ -45,23 +45,23 @@ class E extends C {
45
45
  canBeSavedAsModule() {
46
46
  return !0;
47
47
  }
48
- onCreated(n) {
49
- const t = this.api.getDocumentModifier(), a = this.api.getDocumentRootCssNode();
50
- a.querySelector('[product-attr="imageSrc"] img') || t.modifyCss(a).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
51
- const e = u(n);
52
- if (!e)
48
+ onCreated(e) {
49
+ const t = this.api.getDocumentModifier(), o = this.api.getDocumentRootCssNode();
50
+ o.querySelector('[product-attr="imageSrc"] img') || t.modifyCss(o).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
51
+ const i = l(e);
52
+ if (!i)
53
53
  return;
54
- const o = e.getNodeConfig(), r = o && Object.keys(o).length > 0, i = f(n);
55
- if (i != null && i.initialized)
56
- if (r)
57
- i.blockInstanceId || this.api.getDocumentModifier().modifyHtml(e).setNodeConfig({ ...i, blockInstanceId: String(Date.now()) }).apply(new c("Assign block instance ID to block"));
54
+ const r = i.getNodeConfig(), s = r && Object.keys(r).length > 0, n = u(e);
55
+ if (n != null && n.initialized)
56
+ if (s)
57
+ n.blockInstanceId || this.api.getDocumentModifier().modifyHtml(i).setNodeConfig({ ...n, blockInstanceId: String(Date.now()) }).apply(new c("Assign block instance ID to block"));
58
58
  else {
59
- const s = this.api.getDocumentModifier();
60
- s.modifyHtml(e).setNodeConfig(i), this._stampProductTdDomAttributes(e, i, s), s.apply(new c("Migrate legacy config to nodeConfig"));
59
+ const a = this.api.getDocumentModifier();
60
+ a.modifyHtml(i).setNodeConfig(n), this._stampProductTdDomAttributes(i, n, a), a.apply(new c("Migrate legacy config to nodeConfig"));
61
61
  }
62
62
  else {
63
- const s = N(), m = this.api.getDocumentModifier();
64
- m.modifyHtml(e).setNodeConfig(s), this._stampProductTdDomAttributes(e, s, m, !0), m.apply(new c("Initialize Items block with default configuration")), y().startOnboarding("itemsOnboarding");
63
+ const a = N();
64
+ this.api.getDocumentModifier().modifyHtml(i).setNodeConfig(a).apply(new c("Initialize Items block with default configuration")), g().startOnboarding("itemsOnboarding");
65
65
  }
66
66
  }
67
67
  /**
@@ -70,18 +70,18 @@ class E extends C {
70
70
  * into nodeConfig, so without this a reused module would reset to defaults.
71
71
  * Guarded to the nodeConfig-empty case so it runs once and never loops.
72
72
  */
73
- onDocumentChanged(n) {
74
- const t = u(n);
73
+ onDocumentChanged(e) {
74
+ const t = l(e);
75
75
  if (!t)
76
76
  return;
77
- const a = t.getNodeConfig();
78
- if (a && Object.keys(a).length > 0)
77
+ const o = t.getNodeConfig();
78
+ if (o && Object.keys(o).length > 0)
79
79
  return;
80
- const o = f(n);
81
- if (!(o != null && o.initialized))
80
+ const r = u(e);
81
+ if (!(r != null && r.initialized))
82
82
  return;
83
- const r = this.api.getDocumentModifier();
84
- r.modifyHtml(t).setNodeConfig(o), this._stampProductTdDomAttributes(t, o, r), r.apply(new c("Recover Items block config from saved module"));
83
+ const s = this.api.getDocumentModifier();
84
+ s.modifyHtml(t).setNodeConfig(r), this._stampProductTdDomAttributes(t, r, s), s.apply(new c("Recover Items block config from saved module"));
85
85
  }
86
86
  /**
87
87
  * Bakes the compiler-read DOM attributes (`data-type`, `data-number`, `data-nodup`) onto the
@@ -91,14 +91,12 @@ class E extends C {
91
91
  * restored before export. The name `<a>` carries no data-type/data-number of its own and
92
92
  * relies on this td-level fallback in pairProductVariables.
93
93
  */
94
- _stampProductTdDomAttributes(n, t, a, e = !1) {
95
- const o = D(t.itemsSelectValue, t.type), r = (i, s) => {
96
- e && n.getAttribute(i) || a.modifyHtml(n).setAttribute(i, s);
97
- };
98
- r("data-type", t.type), r("data-number", o), r("data-nodup", String(t.priceHideDiscount));
94
+ _stampProductTdDomAttributes(e, t, o) {
95
+ const i = h(t.itemsSelectValue, t.type);
96
+ o.modifyHtml(e).setAttribute("data-type", t.type), o.modifyHtml(e).setAttribute("data-number", i), o.modifyHtml(e).setAttribute("data-nodup", String(t.priceHideDiscount));
99
97
  }
100
98
  }
101
99
  export {
102
100
  p as BLOCK_ID,
103
- E as ItemsBlock
101
+ O as ItemsBlock
104
102
  };
@@ -1,17 +1,17 @@
1
1
  import { escapeHtml as m } from "../../../utils/htmlEscape.js";
2
2
  import { BlockType as R, BlockAttr as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
3
  import { ItemsBlockId as O } from "./enums/controlEnums.js";
4
- import { productPairs as h, templateFirstLine as q } from "./enums/productEnums.js";
5
- import { ItemInCartOptions as j, SETTINGS_ENUMS as N, DefaultConfigValues as M } from "./enums/settingsEnums.js";
6
- import C from "./layouts/horizontal.html.js";
7
- import J from "./layouts/vertical.html.js";
8
- import { deriveItemNumber as Z, escapeReplacement as g } from "./utils/nodeConfigUtils.js";
9
- let [v] = h.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [F] = h.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [x] = h.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [L] = h.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [X] = h.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
10
- const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), k = (s) => U(s, "text-align"), y = (s, e) => {
11
- const r = new RegExp(`${e}\\s*:\\s*([^;]+)`, "i"), a = s.match(r);
4
+ import { productPairs as h, templateFirstLine as Y } from "./enums/productEnums.js";
5
+ import { ItemInCartOptions as q, SETTINGS_ENUMS as N, DefaultConfigValues as k } from "./enums/settingsEnums.js";
6
+ import j from "./layouts/horizontal.html.js";
7
+ import f from "./layouts/vertical.html.js";
8
+ import { deriveItemNumber as J, escapeReplacement as G } from "./utils/nodeConfigUtils.js";
9
+ let [X] = h.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [F] = h.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [x] = h.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [L] = h.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [V] = h.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
10
+ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), U = (s) => D(s, "text-align"), y = (s, e) => {
11
+ const l = new RegExp(`${e}\\s*:\\s*([^;]+)`, "i"), a = s.match(l);
12
12
  return a ? a[1].trim() : null;
13
- }, w = (s) => `<tr>${s}</tr>`, f = (s, e, r, a) => {
14
- const i = r || M.productImageHeight, d = (a == null ? void 0 : a.imageVisible) === !1 ? "display: none; " : "";
13
+ }, w = (s) => `<tr>${s}</tr>`, Z = (s, e, l, a) => {
14
+ const i = l || k.productImageHeight, d = (a == null ? void 0 : a.imageVisible) === !1 ? "display: none; " : "";
15
15
  return w(`
16
16
  <td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
17
17
  align="center"
@@ -26,7 +26,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
26
26
  href="#!">
27
27
  <img class="adapt-img document-node-component ng-star-inserted"
28
28
  style="object-fit: contain;"
29
- src="${v}"
29
+ src="${X}"
30
30
  alt="${F}"
31
31
  width="${i}"
32
32
  height="${i}">
@@ -35,18 +35,18 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
35
35
  `);
36
36
  }, tt = (s, e) => `
37
37
  <${R.BLOCK_IMAGE}
38
- ${S.BLOCK_IMAGE.src}="${v}"
38
+ ${S.BLOCK_IMAGE.src}="${X}"
39
39
  ${S.BLOCK_IMAGE.alt}="${F}"
40
40
  ${S.BLOCK_IMAGE.href}="#!"
41
- ${S.BLOCK_IMAGE.width}="${M.productImageWidth}"
42
- ${S.BLOCK_IMAGE.height}="${M.productImageWidth}"
41
+ ${S.BLOCK_IMAGE.width}="${k.productImageWidth}"
42
+ ${S.BLOCK_IMAGE.height}="${k.productImageWidth}"
43
43
  esd-extension-block-id="${O.IMAGE}"
44
44
  data-slot-1
45
45
  product-attr="imageSrc"
46
46
  data-type="${s}"
47
47
  data-number="${e}"
48
48
  />
49
- `, et = (s, e, r, a) => {
49
+ `, et = (s, e, l, a) => {
50
50
  const i = `
51
51
  word-wrap: break-word;
52
52
  white-space: nowrap;
@@ -56,15 +56,15 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
56
56
  max-width: 100%;
57
57
  `;
58
58
  if (e) {
59
- const d = y(r || "", "text-align") || "center", n = k(r || i), c = y(n, "font-weight"), l = y(n, "font-style"), o = c === "bold" || c === "700", t = l === "italic", p = U(
60
- U(
61
- U(n, "font-weight"),
59
+ const d = y(l || "", "text-align") || "center", n = U(l || i), c = y(n, "font-weight"), r = y(n, "font-style"), p = c === "bold" || c === "700", t = r === "italic", o = D(
60
+ D(
61
+ D(n, "font-weight"),
62
62
  "font-style"
63
63
  ),
64
64
  "text-decoration"
65
- ), T = (a == null ? void 0 : a.nameVisible) === !1 ? "display: none;" : "display: table-cell;", _ = p ? ` style="${m(p)}"` : "";
66
- let E = F;
67
- return o && (E = `<strong>${E}</strong>`), t && (E = `<em>${E}</em>`), w(`
65
+ ), T = (a == null ? void 0 : a.nameVisible) === !1 ? "display: none;" : "display: table-cell;", _ = o ? ` style="${m(o)}"` : "";
66
+ let $ = F;
67
+ return p && ($ = `<strong>${$}</strong>`), t && ($ = `<em>${$}</em>`), w(`
68
68
  <td class="esd-block-text es-p10"
69
69
  align="${d}"
70
70
  width="100%"
@@ -76,7 +76,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
76
76
  path="1"
77
77
  product-attr="name"
78
78
  data-slot-2${_}>
79
- ${E}
79
+ ${$}
80
80
  </p>
81
81
  </td>
82
82
  `);
@@ -97,15 +97,15 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
97
97
  </p>
98
98
  </${R.BLOCK_TEXT}>
99
99
  `;
100
- }, at = (s, e, r, a, i, d, n, c, l, o) => {
100
+ }, at = (s, e, l, a, i, d, n, c, r, p) => {
101
101
  let t = x;
102
102
  if (a && a.trim()) {
103
- const $ = `${a.trim()}`;
104
- t = (i || "0") === "1" ? `${x}&nbsp;${$}` : `${$}&nbsp;${x}`;
103
+ const E = `${a.trim()}`;
104
+ t = (i || "0") === "1" ? `${x}&nbsp;${E}` : `${E}&nbsp;${x}`;
105
105
  }
106
- const p = i === "1" ? "after" : "before", T = `data-formated="${r ? "true" : "false"}"`, _ = `data-curency="${p}"`, E = a ? `data-currency_symbol="${a}"` : "", u = `data-single_price="${c ? "true" : "false"}"`, I = l === N.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
106
+ const o = i === "1" ? "after" : "before", T = `data-formated="${l ? "true" : "false"}"`, _ = `data-curency="${o}"`, $ = a ? `data-currency_symbol="${a}"` : "", u = `data-single_price="${c ? "true" : "false"}"`, I = r === N.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
107
107
  if (d) {
108
- const b = k(n || "color: #060606; white-space: nowrap; font-size: 20px;"), A = o ? "" : ' style="display: none;"';
108
+ const b = U(n || "color: #060606; white-space: nowrap; font-size: 20px;"), A = p ? "" : ' style="display: none;"';
109
109
  return w(`
110
110
  <td class="esd-block-text items-block-price${I}"
111
111
  align="center"
@@ -119,7 +119,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
119
119
  data-number="${e}"
120
120
  ${T}
121
121
  ${_}
122
- ${E}
122
+ ${$}
123
123
  ${u}
124
124
  style="${m(b)}">
125
125
  ${t}
@@ -149,20 +149,20 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
149
149
  </p>
150
150
  </${R.BLOCK_TEXT}>
151
151
  `;
152
- }, st = (s, e, r, a, i, d, n = !0, c, l, o) => {
152
+ }, st = (s, e, l, a, i, d, n = !0, c, r, p) => {
153
153
  let t = L;
154
154
  if (a && a.trim()) {
155
- const $ = `${a.trim()}`;
156
- t = (i || "0") === "1" ? `${L}&nbsp;${$}` : `${$}&nbsp;${L}`;
155
+ const E = `${a.trim()}`;
156
+ t = (i || "0") === "1" ? `${L}&nbsp;${E}` : `${E}&nbsp;${L}`;
157
157
  }
158
- const p = i === "1" ? "after" : "before", T = `data-formated="${r ? "true" : "false"}"`, _ = `data-curency="${p}"`, E = n ? "" : ' style="display: none;"', u = `data-single_price="${l ? "true" : "false"}"`, I = o === N.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
158
+ const o = i === "1" ? "after" : "before", T = `data-formated="${l ? "true" : "false"}"`, _ = `data-curency="${o}"`, $ = n ? "" : ' style="display: none;"', u = `data-single_price="${r ? "true" : "false"}"`, I = p === N.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
159
159
  if (d) {
160
- const b = k(c || "color: #cc0000; white-space: nowrap; font-size: 19px;");
160
+ const b = U(c || "color: #cc0000; white-space: nowrap; font-size: 19px;");
161
161
  return w(`
162
162
  <td class="esd-block-text items-block-price${I}"
163
163
  esd-extension-block-id="${O.ORIGINAL_PRICE}"
164
164
  width="100%"
165
- align="center"${E}>
165
+ align="center"${$}>
166
166
  <p
167
167
  product-attr="originalPrice"
168
168
  contenteditable="false"
@@ -203,10 +203,10 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
203
203
  </p>
204
204
  </${R.BLOCK_TEXT}>
205
205
  `;
206
- }, lt = (s = !0, e, r) => {
206
+ }, lt = (s = !0, e, l) => {
207
207
  const a = s ? "" : 'style="display: none;"';
208
208
  if (e) {
209
- const i = "font-size: 14px;", d = y(r || "", "text-align") || "center", n = k(r || i);
209
+ const i = "font-size: 14px;", d = y(l || "", "text-align") || "center", n = U(l || i);
210
210
  return w(`
211
211
  <td class="esd-block-text es-p10 document-node-component default-block-component selectable"
212
212
  width="100%" align="${d}"
@@ -218,7 +218,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
218
218
  width="100%"
219
219
  path="1"
220
220
  style="${m(n)}">
221
- ${X}
221
+ ${V}
222
222
  </p>
223
223
  </td>
224
224
  `);
@@ -236,26 +236,26 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
236
236
  data-slot-3
237
237
  contenteditable="false"
238
238
  width="100%">
239
- ${X}
239
+ ${V}
240
240
  </p>
241
241
  </${R.BLOCK_TEXT}>
242
242
  `;
243
- }, rt = (s, e, r = "Buy", a, i, d = !0, n = !0) => {
243
+ }, rt = (s, e, l = "Buy", a, i, d = !0, n = !0) => {
244
244
  if (a) {
245
- const c = y(i || "", "background") || y(i || "", "background-color"), l = c ? `border-width: 0px; background: ${c};` : "border-width: 0px;", o = d ? "es-fw" : "es-il", t = (i || "").replace("border-width: 0;", "");
245
+ const c = y(i || "", "background") || y(i || "", "background-color"), r = c ? `border-width: 0px; background: ${c};` : "border-width: 0px;", p = d ? "es-fw" : "es-il", t = (i || "").replace("border-width: 0;", "");
246
246
  return w(`
247
247
  <td class="esd-block-button ins-button default-block-component selectable"
248
- align="center" width="100%" name="buy-button" caption="${r}"
248
+ align="center" width="100%" name="buy-button" caption="${l}"
249
249
  esd-extension-block-id="${O.BUTTON}"
250
250
  product-attr="button" data-slot-6="" data-type="${s}" data-number="${e}"
251
251
  ${n ? "" : ' style="display: none;"'}>
252
- <span class="es-button-border ${o}" style="${m(l)}">
252
+ <span class="es-button-border ${p}" style="${m(r)}">
253
253
  <a
254
254
  class="es-button"
255
255
  href="#!"
256
256
  target="_blank"
257
257
  style="${m(t)} padding: 5px 12px;">
258
- ${r}
258
+ ${l}
259
259
  </a>
260
260
  </span>
261
261
  </td>
@@ -266,27 +266,27 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
266
266
  width="100%"
267
267
  class="ins-button"
268
268
  name="buy-button"
269
- caption="${r}"
269
+ caption="${l}"
270
270
  align="center"
271
271
  esd-extension-block-id="${O.BUTTON}"
272
272
  product-attr="button"
273
273
  data-slot-6
274
274
  data-type="${s}"
275
275
  data-number="${e}"
276
- >${r}
276
+ >${l}
277
277
  </${R.BLOCK_BUTTON}>
278
278
  `;
279
- }, ct = (s, e, r, a = !0, i = !0) => {
280
- const d = e === N.ORIENTATION.VERTICAL, n = r === "horizontal";
279
+ }, ct = (s, e, l, a = !0, i = !0) => {
280
+ const d = e === N.ORIENTATION.VERTICAL, n = l === "horizontal";
281
281
  if (d) {
282
- const c = !n, l = c || !i ? "100%" : "50%", o = c || !a ? "100%" : "50%";
282
+ const c = !n, r = c || !i ? "100%" : "50%", p = c || !a ? "100%" : "50%";
283
283
  let t = s.replace(
284
284
  /<td\s+[^>]*class="([^"]*product-price-class[^"]*)"[^>]*>/gi,
285
- (p) => p.replace(/width="[^"]*"/gi, `width="${l}"`).replace(/width:\s*[^;]+;/gi, `width: ${l};`)
285
+ (o) => o.replace(/width="[^"]*"/gi, `width="${r}"`).replace(/width:\s*[^;]+;/gi, `width: ${r};`)
286
286
  );
287
287
  return t = t.replace(
288
288
  /<td\s+[^>]*class="([^"]*product-original-price-class[^"]*)"[^>]*>/gi,
289
- (p) => p.replace(/width="[^"]*"/gi, `width="${o}"`).replace(/width:\s*[^;]+;/gi, `width: ${o};`)
289
+ (o) => o.replace(/width="[^"]*"/gi, `width="${p}"`).replace(/width:\s*[^;]+;/gi, `width: ${p};`)
290
290
  ), t;
291
291
  }
292
292
  return n ? s : s.replace(
@@ -298,74 +298,74 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
298
298
  );
299
299
  }, it = (s) => s ? `<td align="center"
300
300
  esd-extension-block-id="items-block"
301
- class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : q, B = (s, e, r, a, i, d, n, c, l, o, t, p, T, _ = "horizontal", E, u, P, I) => {
302
- const $ = o !== void 0 ? ` data-nodup="${o}"` : "", A = `${`data-type="${e}" data-number="${r}"`} data-orientation="${a}"${$}`, D = l == null ? void 0 : l["data-product_image_control_image-height"], V = d ? f(e, r, D, t) : tt(e, r), W = (t == null ? void 0 : t.buttonLabel) || "Buy", z = (t == null ? void 0 : t.buttonFullWidth) !== void 0 ? t.buttonFullWidth : !0, H = e === N.ITEMS_TYPE.BROWSED_ITEMS ? !1 : t == null ? void 0 : t.quantityControlEnabled, Q = (t == null ? void 0 : t.buttonVisible) !== void 0 ? t.buttonVisible : (l == null ? void 0 : l["data-product_button_control_enabled"]) !== "false", G = (t == null ? void 0 : t.priceVisible) !== void 0 ? t.priceVisible : (l == null ? void 0 : l["data-product_price_control_enabled"]) !== "false", K = (t == null ? void 0 : t.originalPriceVisible) !== void 0 ? t.originalPriceVisible : (l == null ? void 0 : l["data-product_original_price_control_enabled"]) !== "false", Y = s.replace("{-{-TEMPLATE_FIRST_LINE-}-}", it(d)).replace("{-{-PRODUCT_IMAGE-}-}", V).replace("{-{-PRODUCT_NAME-}-}", et(e, d, p, t)).replaceAll(
301
+ class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : Y, K = (s, e, l, a, i, d, n, c, r, p, t, o, T, _ = "horizontal", $, u, P, I) => {
302
+ const A = `${`data-type="${e}" data-number="${l}"`} data-orientation="${a}"`, M = r == null ? void 0 : r["data-product_image_control_image-height"], B = d ? Z(e, l, M, t) : tt(e, l), W = (t == null ? void 0 : t.buttonLabel) || "Buy", z = (t == null ? void 0 : t.buttonFullWidth) !== void 0 ? t.buttonFullWidth : !0, Q = e === N.ITEMS_TYPE.BROWSED_ITEMS ? !1 : t == null ? void 0 : t.quantityControlEnabled, H = (t == null ? void 0 : t.buttonVisible) !== void 0 ? t.buttonVisible : (r == null ? void 0 : r["data-product_button_control_enabled"]) !== "false", g = (t == null ? void 0 : t.priceVisible) !== void 0 ? t.priceVisible : (r == null ? void 0 : r["data-product_price_control_enabled"]) !== "false", v = (t == null ? void 0 : t.originalPriceVisible) !== void 0 ? t.originalPriceVisible : (r == null ? void 0 : r["data-product_original_price_control_enabled"]) !== "false", C = s.replace("{-{-TEMPLATE_FIRST_LINE-}-}", it(d)).replace("{-{-PRODUCT_IMAGE-}-}", B).replace("{-{-PRODUCT_NAME-}-}", et(e, d, o, t)).replaceAll(
303
303
  "{-{-PRODUCT_PRICE-}-}",
304
- g(at(
304
+ G(at(
305
305
  e,
306
- r,
306
+ l,
307
307
  i,
308
308
  n,
309
309
  c,
310
310
  d,
311
- E,
311
+ $,
312
312
  I,
313
313
  a,
314
- G
314
+ g
315
315
  ))
316
316
  ).replaceAll(
317
317
  "{-{-PRODUCT_ORIGINAL_PRICE-}-}",
318
- g(st(
318
+ G(st(
319
319
  e,
320
- r,
320
+ l,
321
321
  i,
322
322
  n,
323
323
  c,
324
324
  d,
325
- K,
325
+ v,
326
326
  u,
327
327
  I,
328
328
  a
329
329
  ))
330
- ).replace("{-{-PRODUCT_QUANTITY-}-}", lt(H, d, P)).replace(
330
+ ).replace("{-{-PRODUCT_QUANTITY-}-}", lt(Q, d, P)).replace(
331
331
  "{-{-PRODUCT_BUTTON-}-}",
332
- rt(e, r, W, d, T, z, Q)
332
+ rt(e, l, W, d, T, z, H)
333
333
  ).replace(
334
334
  /<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
335
335
  `<td$1 ${A}>`
336
336
  );
337
337
  return ct(
338
- Y,
338
+ C,
339
339
  a,
340
340
  _,
341
- G,
342
- K
341
+ g,
342
+ v
343
343
  );
344
344
  };
345
345
  function It({
346
346
  orientation: s,
347
347
  itemsType: e = N.ITEMS_TYPE.CART_ITEMS,
348
- itemId: r,
348
+ itemId: l,
349
349
  currencySymbol: a,
350
350
  currencyLocation: i,
351
351
  migrate: d = !1,
352
352
  formattedPrice: n = !0,
353
353
  configBlockAttributes: c,
354
- nodeConfig: l,
355
- nameStyles: o,
354
+ nodeConfig: r,
355
+ nameStyles: p,
356
356
  buttonStyles: t,
357
- priceStyles: p,
357
+ priceStyles: o,
358
358
  originalPriceStyles: T,
359
359
  quantityStyles: _,
360
- priceOrientation: E
360
+ priceOrientation: $
361
361
  }) {
362
- const u = j[e].findIndex((V) => V.value === r), P = Z(r, e), I = (l == null ? void 0 : l.priceSinglePrice) ?? (c == null ? void 0 : c["data-product_price_control_single_price"]) === "1" ?? !1;
363
- v = h.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[u >= 0 ? u : 0], F = h.PAIRS_FOR_EXTENSION.name[e].DEFAULT[u >= 0 ? u : 0];
364
- const $ = h.PAIRS_FOR_EXTENSION.price[e], b = h.PAIRS_FOR_EXTENSION.originalPrice[e];
365
- I ? (x = n ? $.DEFAULT_SINGLE_PRICE_FORMATTED : $.DEFAULT_SINGLE_PRICE, L = n ? b.DEFAULT_SINGLE_PRICE_FORMATTED : b.DEFAULT_SINGLE_PRICE) : (x = n ? $.DEFAULT_PRICE_FORMATTED : $.DEFAULT_PRICE, L = n ? b.DEFAULT_PRICE_FORMATTED : b.DEFAULT_PRICE), X = h.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
366
- const A = E || (l == null ? void 0 : l.priceOrientation) || "horizontal", D = (l == null ? void 0 : l.priceHideDiscount) ?? M.productPriceHideDiscountControlValue === "1";
367
- return s === N.ORIENTATION.VERTICAL ? B(
368
- J,
362
+ const u = q[e].findIndex((M) => M.value === l), P = J(l, e), I = (r == null ? void 0 : r.priceSinglePrice) ?? (c == null ? void 0 : c["data-product_price_control_single_price"]) === "1" ?? !1;
363
+ X = h.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[u >= 0 ? u : 0], F = h.PAIRS_FOR_EXTENSION.name[e].DEFAULT[u >= 0 ? u : 0];
364
+ const E = h.PAIRS_FOR_EXTENSION.price[e], b = h.PAIRS_FOR_EXTENSION.originalPrice[e];
365
+ I ? (x = n ? E.DEFAULT_SINGLE_PRICE_FORMATTED : E.DEFAULT_SINGLE_PRICE, L = n ? b.DEFAULT_SINGLE_PRICE_FORMATTED : b.DEFAULT_SINGLE_PRICE) : (x = n ? E.DEFAULT_PRICE_FORMATTED : E.DEFAULT_PRICE, L = n ? b.DEFAULT_PRICE_FORMATTED : b.DEFAULT_PRICE), V = h.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
366
+ const A = $ || (r == null ? void 0 : r.priceOrientation) || "horizontal";
367
+ return s === N.ORIENTATION.VERTICAL ? K(
368
+ f,
369
369
  e,
370
370
  P,
371
371
  s,
@@ -374,18 +374,18 @@ function It({
374
374
  a,
375
375
  i,
376
376
  c,
377
- String(D),
377
+ void 0,
378
378
  // nodup
379
- l,
380
- o,
379
+ r,
380
+ p,
381
381
  t,
382
382
  A,
383
- p,
383
+ o,
384
384
  T,
385
385
  _,
386
386
  I
387
- ) : B(
388
- C,
387
+ ) : K(
388
+ j,
389
389
  e,
390
390
  P,
391
391
  s,
@@ -394,13 +394,13 @@ function It({
394
394
  a,
395
395
  i,
396
396
  c,
397
- String(D),
397
+ void 0,
398
398
  // nodup
399
- l,
400
- o,
399
+ r,
400
+ p,
401
401
  t,
402
402
  A,
403
- p,
403
+ o,
404
404
  T,
405
405
  _,
406
406
  I
@@ -1,7 +1,7 @@
1
1
  import { ModificationDescription as d } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { CommonControl as s } from "../../../common-control.js";
3
3
  import { getCurrentLayout as l } from "../main/utils.js";
4
- const i = "recommendation-card-background-color-control", e = {
4
+ const u = "recommendation-card-background-color-control", e = {
5
5
  CARD_BACKGROUND_COLOR: "cardBackgroundColor"
6
6
  }, a = {
7
7
  GRID: ".product-card-segment",
@@ -9,17 +9,13 @@ const i = "recommendation-card-background-color-control", e = {
9
9
  };
10
10
  class _ extends s {
11
11
  getId() {
12
- return i;
12
+ return u;
13
13
  }
14
14
  getTemplate() {
15
- return `
16
- <div class="card-bg-control-container">
17
- ${this._GuTwoColumns([
15
+ return this._GuTwoColumns([
18
16
  this._GuLabel({ text: this.api.translate("Card Background Color") }),
19
17
  this._GuColorPicker(e.CARD_BACKGROUND_COLOR)
20
- ])}
21
- </div>
22
- `;
18
+ ]);
23
19
  }
24
20
  onRender() {
25
21
  this._setFormValues(), this._listenToFormUpdates();
@@ -75,6 +71,6 @@ class _ extends s {
75
71
  }
76
72
  }
77
73
  export {
78
- i as CARD_BACKGROUND_COLOR_CONTROL_ID,
74
+ u as CARD_BACKGROUND_COLOR_CONTROL_ID,
79
75
  _ as CardBackgroundColorControl
80
76
  };
@@ -1,16 +1,16 @@
1
- var G = Object.defineProperty;
2
- var P = (u, s, t) => s in u ? G(u, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[s] = t;
3
- var C = (u, s, t) => P(u, typeof s != "symbol" ? s + "" : s, t);
4
- import { ModificationDescription as m } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as R } from "../../../common-control.js";
6
- import { DESKTOP_CONTAINER_SELECTOR as S, MOBILE_CONTAINER_SELECTOR as M } from "../../constants/selectors.js";
7
- import { SPACING_STEP as _, MAX_SPACING as N, MIN_SPACING as b, DEFAULT_COLUMN_SPACING as g, DEFAULT_ROW_SPACING as E } from "../../constants/layout.js";
1
+ var y = Object.defineProperty;
2
+ var M = (u, s, t) => s in u ? y(u, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[s] = t;
3
+ var g = (u, s, t) => M(u, typeof s != "symbol" ? s + "" : s, t);
4
+ import { ModificationDescription as S } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as E } from "../../../common-control.js";
6
+ import { DESKTOP_CONTAINER_SELECTOR as m, MOBILE_CONTAINER_SELECTOR as L } from "../../constants/selectors.js";
7
+ import { SPACING_STEP as P, MAX_SPACING as G, MIN_SPACING as R, DEFAULT_COLUMN_SPACING as C, DEFAULT_ROW_SPACING as I } from "../../constants/layout.js";
8
8
  import { RecommendationConfigService as p } from "../../services/configService.js";
9
9
  import { useRecommendationExtensionStore as w } from "../../store/recommendation.js";
10
- import { safeGetStyle as L, safeGetParent as V } from "../../utils/tagName.js";
11
- import { getCurrentLayout as f, getBlockElement as B } from "../main/utils.js";
12
- import { useDebounceFn as O } from "../../../../../node_modules/@vueuse/shared/index.js";
13
- const U = "recommendation-spacing-control", n = {
10
+ import { safeGetStyle as f, safeGetParent as B } from "../../utils/tagName.js";
11
+ import { getCurrentLayout as _, getBlockElement as U } from "../main/utils.js";
12
+ import { useDebounceFn as N } from "../../../../../node_modules/@vueuse/shared/index.js";
13
+ const V = "recommendation-spacing-control", o = {
14
14
  COLUMN_SPACING: "columnSpacing",
15
15
  COLUMN_SPACING_LABEL: "columnSpacingLabel",
16
16
  ROW_SPACING: "rowSpacing",
@@ -19,97 +19,67 @@ const U = "recommendation-spacing-control", n = {
19
19
  MOBILE_COLUMN_SPACING_LABEL: "mobileColumnSpacingLabel",
20
20
  MOBILE_ROW_SPACING: "mobileRowSpacing",
21
21
  MOBILE_ROW_SPACING_LABEL: "mobileRowSpacingLabel"
22
- }, A = {
22
+ }, b = {
23
23
  COLUMN_SPACING: "data-column-spacing",
24
24
  ROW_SPACING: "data-row-spacing",
25
25
  MOBILE_COLUMN_SPACING: "data-mobile-column-spacing",
26
26
  MOBILE_ROW_SPACING: "data-mobile-row-spacing"
27
27
  };
28
- function I(u, s) {
28
+ function O(u, s) {
29
29
  if (!u)
30
30
  return s;
31
31
  const t = parseFloat(u);
32
32
  return Number.isNaN(t) ? s : t;
33
33
  }
34
- class j extends R {
34
+ class j extends E {
35
35
  constructor() {
36
36
  super(...arguments);
37
- C(this, "store", w());
38
- C(this, "unsubscribeOrientation", null);
37
+ g(this, "store", w());
38
+ g(this, "unsubscribeOrientation", null);
39
39
  /**
40
40
  * Debounced version of _onColumnSpacingChange
41
41
  * Prevents excessive DOM updates when user rapidly adjusts the counter
42
42
  */
43
- C(this, "_debouncedOnColumnSpacingChange", O((t) => {
43
+ g(this, "_debouncedOnColumnSpacingChange", N((t) => {
44
44
  this._onColumnSpacingChange(t);
45
45
  }, 300));
46
46
  /**
47
47
  * Debounced version of _onRowSpacingChange
48
48
  */
49
- C(this, "_debouncedOnRowSpacingChange", O((t) => {
49
+ g(this, "_debouncedOnRowSpacingChange", N((t) => {
50
50
  this._onRowSpacingChange(t);
51
51
  }, 300));
52
52
  /**
53
53
  * Debounced version of _onMobileColumnSpacingChange
54
54
  */
55
- C(this, "_debouncedOnMobileColumnSpacingChange", O((t) => {
55
+ g(this, "_debouncedOnMobileColumnSpacingChange", N((t) => {
56
56
  this._onMobileColumnSpacingChange(t);
57
57
  }, 300));
58
58
  /**
59
59
  * Debounced version of _onMobileRowSpacingChange
60
60
  */
61
- C(this, "_debouncedOnMobileRowSpacingChange", O((t) => {
61
+ g(this, "_debouncedOnMobileRowSpacingChange", N((t) => {
62
62
  this._onMobileRowSpacingChange(t);
63
63
  }, 300));
64
64
  }
65
65
  getId() {
66
- return U;
66
+ return V;
67
67
  }
68
68
  getTemplate() {
69
69
  return `
70
70
  <div class="spacing-control-container">
71
- ${this._GuTwoColumns([
72
- this._GuLabel({
73
- text: this.api.translate("Column Spacing (px)"),
74
- name: n.COLUMN_SPACING_LABEL
75
- }),
76
- this._GuCounter({
77
- name: n.COLUMN_SPACING,
78
- minValue: b,
79
- maxValue: N,
80
- step: _
81
- }),
82
- this._GuLabel({
83
- text: this.api.translate("Row Spacing (px)"),
84
- name: n.ROW_SPACING_LABEL
85
- }),
86
- this._GuCounter({
87
- name: n.ROW_SPACING,
88
- minValue: b,
89
- maxValue: N,
90
- step: _
91
- }),
92
- this._GuLabel({
93
- text: this.api.translate("Column Spacing on Mobile (px)"),
94
- name: n.MOBILE_COLUMN_SPACING_LABEL
95
- }),
96
- this._GuCounter({
97
- name: n.MOBILE_COLUMN_SPACING,
98
- minValue: b,
99
- maxValue: N,
100
- step: _
101
- }),
102
- this._GuLabel({
103
- text: this.api.translate("Row Spacing on Mobile (px)"),
104
- name: n.MOBILE_ROW_SPACING_LABEL
105
- }),
106
- this._GuCounter({
107
- name: n.MOBILE_ROW_SPACING,
108
- minValue: b,
109
- maxValue: N,
110
- step: _
111
- })
112
- ])}
71
+ ${this._spacingRow("Column Spacing (px)", o.COLUMN_SPACING_LABEL, o.COLUMN_SPACING)}
72
+ ${this._spacingRow("Row Spacing (px)", o.ROW_SPACING_LABEL, o.ROW_SPACING)}
73
+ ${this._spacingRow(
74
+ "Column Spacing on Mobile (px)",
75
+ o.MOBILE_COLUMN_SPACING_LABEL,
76
+ o.MOBILE_COLUMN_SPACING
77
+ )}
78
+ ${this._spacingRow(
79
+ "Row Spacing on Mobile (px)",
80
+ o.MOBILE_ROW_SPACING_LABEL,
81
+ o.MOBILE_ROW_SPACING
82
+ )}
113
83
  </div>
114
84
  `;
115
85
  }
@@ -122,6 +92,21 @@ class j extends R {
122
92
  onDestroy() {
123
93
  this.unsubscribeOrientation && (this.unsubscribeOrientation(), this.unsubscribeOrientation = null);
124
94
  }
95
+ /**
96
+ * One label + counter per two-column row, so every spacing field gets the same
97
+ * 16px-padded row the color controls already render instead of sharing one grid.
98
+ */
99
+ _spacingRow(t, e, n) {
100
+ return this._GuTwoColumns([
101
+ this._GuLabel({ text: this.api.translate(t), name: e }),
102
+ this._GuCounter({
103
+ name: n,
104
+ minValue: R,
105
+ maxValue: G,
106
+ step: P
107
+ })
108
+ ]);
109
+ }
125
110
  /**
126
111
  * Updates spacing control visibility based on layout orientation and mobileLayoutEnabled.
127
112
  * - List layout: hide column spacing (products are full-width), hide ALL mobile
@@ -132,14 +117,14 @@ class j extends R {
132
117
  _updateSpacingVisibility() {
133
118
  if (!this.api)
134
119
  return;
135
- const t = p.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, i = (t.layout || e || f(this.currentNode)) === "grid", { mobileLayoutEnabled: a } = t, r = t.cardsInRow > 1, c = t.mobileCardsInRow > 1;
136
- this.api.setVisibility(n.COLUMN_SPACING, i && r), this.api.setVisibility(n.COLUMN_SPACING_LABEL, i && r), this.api.setVisibility(n.ROW_SPACING, !0), this.api.setVisibility(n.ROW_SPACING_LABEL, !0), this.api.setVisibility(
137
- n.MOBILE_COLUMN_SPACING,
120
+ const t = p.getConfig(this.currentNode), e = this.store.recommendationConfigs.orientation, i = (t.layout || e || _(this.currentNode)) === "grid", { mobileLayoutEnabled: a } = t, r = t.cardsInRow > 1, c = t.mobileCardsInRow > 1;
121
+ this.api.setVisibility(o.COLUMN_SPACING, i && r), this.api.setVisibility(o.COLUMN_SPACING_LABEL, i && r), this.api.setVisibility(o.ROW_SPACING, !0), this.api.setVisibility(o.ROW_SPACING_LABEL, !0), this.api.setVisibility(
122
+ o.MOBILE_COLUMN_SPACING,
138
123
  i && a && c
139
124
  ), this.api.setVisibility(
140
- n.MOBILE_COLUMN_SPACING_LABEL,
125
+ o.MOBILE_COLUMN_SPACING_LABEL,
141
126
  i && a && c
142
- ), this.api.setVisibility(n.MOBILE_ROW_SPACING, i && a), this.api.setVisibility(n.MOBILE_ROW_SPACING_LABEL, i && a);
127
+ ), this.api.setVisibility(o.MOBILE_ROW_SPACING, i && a), this.api.setVisibility(o.MOBILE_ROW_SPACING_LABEL, i && a);
143
128
  }
144
129
  /**
145
130
  * Reads spacing values from node config first, falls back to DOM styles.
@@ -148,12 +133,12 @@ class j extends R {
148
133
  _setFormValues() {
149
134
  if (!this.api)
150
135
  return;
151
- const t = p.hasConfig(this.currentNode), e = p.getConfig(this.currentNode), o = t ? e.columnSpacing : this._getStoredColumnSpacing(), i = t ? e.rowSpacing : this._getStoredRowSpacing();
136
+ const t = p.hasConfig(this.currentNode), e = p.getConfig(this.currentNode), n = t ? e.columnSpacing : this._getStoredColumnSpacing(), i = t ? e.rowSpacing : this._getStoredRowSpacing();
152
137
  this.api.updateValues({
153
- [n.COLUMN_SPACING]: o,
154
- [n.ROW_SPACING]: i,
155
- [n.MOBILE_COLUMN_SPACING]: e.mobileColumnSpacing,
156
- [n.MOBILE_ROW_SPACING]: e.mobileRowSpacing
138
+ [o.COLUMN_SPACING]: n,
139
+ [o.ROW_SPACING]: i,
140
+ [o.MOBILE_COLUMN_SPACING]: e.mobileColumnSpacing,
141
+ [o.MOBILE_ROW_SPACING]: e.mobileRowSpacing
157
142
  });
158
143
  }
159
144
  /**
@@ -165,20 +150,20 @@ class j extends R {
165
150
  */
166
151
  _getStoredColumnSpacing() {
167
152
  if (!this.currentNode)
168
- return g;
169
- const t = this.currentNode.querySelector(S) ?? this.currentNode;
170
- if (f(this.currentNode) === "grid") {
171
- const h = t.querySelector(".recommendation-attribute-row"), l = (h == null ? void 0 : h.querySelector("td")) ?? null, d = L(l, "padding");
153
+ return C;
154
+ const t = this.currentNode.querySelector(m) ?? this.currentNode;
155
+ if (_(this.currentNode) === "grid") {
156
+ const h = t.querySelector(".recommendation-attribute-row"), l = (h == null ? void 0 : h.querySelector("td")) ?? null, d = f(l, "padding");
172
157
  if (!d)
173
- return g;
174
- const y = d.trim().split(/\s+/);
175
- return y.length < 2 ? g : I(y[1], g / 2) * 2;
158
+ return C;
159
+ const A = d.trim().split(/\s+/);
160
+ return A.length < 2 ? C : O(A[1], C / 2) * 2;
176
161
  }
177
- const o = t.querySelector(".product-card-wrapper") ?? null, i = V(o), a = L(i, "padding");
162
+ const n = t.querySelector(".product-card-wrapper") ?? null, i = B(n), a = f(i, "padding");
178
163
  if (!a)
179
- return g;
164
+ return C;
180
165
  const r = a.trim().split(/\s+/);
181
- return r.length < 2 ? g : I(r[1], g / 2) * 2;
166
+ return r.length < 2 ? C : O(r[1], C / 2) * 2;
182
167
  }
183
168
  /**
184
169
  * Gets stored row spacing from the first spacer element's height style
@@ -186,9 +171,9 @@ class j extends R {
186
171
  */
187
172
  _getStoredRowSpacing() {
188
173
  if (!this.currentNode)
189
- return E;
190
- const e = (this.currentNode.querySelector(S) ?? this.currentNode).querySelector(".spacer") ?? null, o = L(e, "height");
191
- return I(o, E);
174
+ return I;
175
+ const e = (this.currentNode.querySelector(m) ?? this.currentNode).querySelector(".spacer") ?? null, n = f(e, "height");
176
+ return O(n, I);
192
177
  }
193
178
  // ========================================================================
194
179
  // Desktop Spacing Handlers
@@ -205,9 +190,9 @@ class j extends R {
205
190
  this.currentNode,
206
191
  { columnSpacing: t },
207
192
  `Changed column spacing to ${t}px`
208
- ), this._storeDataAttribute(A.COLUMN_SPACING, t);
209
- const o = p.getConfig(this.currentNode).layout || f(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(S);
210
- c && (o === "grid" ? Array.from(
193
+ ), this._storeDataAttribute(b.COLUMN_SPACING, t);
194
+ const n = p.getConfig(this.currentNode).layout || _(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(m);
195
+ c && (n === "grid" ? Array.from(
211
196
  c.querySelectorAll(".attribute-cell")
212
197
  ).forEach((l) => {
213
198
  i.modifyHtml(l).setStyle("padding", r);
@@ -216,7 +201,7 @@ class j extends R {
216
201
  ).forEach((l) => {
217
202
  const d = "parent" in l ? l.parent() : void 0;
218
203
  d && i.modifyHtml(d).setStyle("padding", r);
219
- }), i.apply(new m(`Update column spacing to ${t}px`)));
204
+ }), i.apply(new S(`Update column spacing to ${t}px`)));
220
205
  }
221
206
  /**
222
207
  * Handles row spacing changes for desktop.
@@ -230,19 +215,19 @@ class j extends R {
230
215
  this.currentNode,
231
216
  { rowSpacing: t },
232
217
  `Changed row spacing to ${t}px`
233
- ), this._storeDataAttribute(A.ROW_SPACING, t);
234
- const e = this.currentNode.querySelector(S);
218
+ ), this._storeDataAttribute(b.ROW_SPACING, t);
219
+ const e = this.currentNode.querySelector(m);
235
220
  if (!e)
236
221
  return;
237
- const o = Array.from(
222
+ const n = Array.from(
238
223
  e.querySelectorAll(".spacer")
239
224
  );
240
- if (!o.length)
225
+ if (!n.length)
241
226
  return;
242
227
  const i = this.api.getDocumentModifier(), a = `${t}px`;
243
- o.forEach((r) => {
228
+ n.forEach((r) => {
244
229
  i.modifyHtml(r).setStyle("height", a);
245
- }), i.apply(new m(`Update row spacing to ${t}px`));
230
+ }), i.apply(new S(`Update row spacing to ${t}px`));
246
231
  }
247
232
  // ========================================================================
248
233
  // Mobile Spacing Handlers
@@ -259,9 +244,9 @@ class j extends R {
259
244
  this.currentNode,
260
245
  { mobileColumnSpacing: t },
261
246
  `Changed mobile column spacing to ${t}px`
262
- ), this._storeDataAttribute(A.MOBILE_COLUMN_SPACING, t);
263
- const o = p.getConfig(this.currentNode).layout || f(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(M);
264
- c && (o === "grid" ? Array.from(
247
+ ), this._storeDataAttribute(b.MOBILE_COLUMN_SPACING, t);
248
+ const n = p.getConfig(this.currentNode).layout || _(this.currentNode), i = this.api.getDocumentModifier(), r = `0 ${t / 2}px`, c = this.currentNode.querySelector(L);
249
+ c && (n === "grid" ? Array.from(
265
250
  c.querySelectorAll(".attribute-cell")
266
251
  ).forEach((l) => {
267
252
  i.modifyHtml(l).setStyle("padding", r);
@@ -270,7 +255,7 @@ class j extends R {
270
255
  ).forEach((l) => {
271
256
  const d = "parent" in l ? l.parent() : void 0;
272
257
  d && i.modifyHtml(d).setStyle("padding", r);
273
- }), i.apply(new m(`Update mobile column spacing to ${t}px`)));
258
+ }), i.apply(new S(`Update mobile column spacing to ${t}px`)));
274
259
  }
275
260
  /**
276
261
  * Handles row spacing changes for mobile.
@@ -284,19 +269,19 @@ class j extends R {
284
269
  this.currentNode,
285
270
  { mobileRowSpacing: t },
286
271
  `Changed mobile row spacing to ${t}px`
287
- ), this._storeDataAttribute(A.MOBILE_ROW_SPACING, t);
288
- const e = this.currentNode.querySelector(M);
272
+ ), this._storeDataAttribute(b.MOBILE_ROW_SPACING, t);
273
+ const e = this.currentNode.querySelector(L);
289
274
  if (!e)
290
275
  return;
291
- const o = Array.from(
276
+ const n = Array.from(
292
277
  e.querySelectorAll(".spacer")
293
278
  );
294
- if (!o.length)
279
+ if (!n.length)
295
280
  return;
296
281
  const i = this.api.getDocumentModifier(), a = `${t}px`;
297
- o.forEach((r) => {
282
+ n.forEach((r) => {
298
283
  i.modifyHtml(r).setStyle("height", a);
299
- }), i.apply(new m(`Update mobile row spacing to ${t}px`));
284
+ }), i.apply(new S(`Update mobile row spacing to ${t}px`));
300
285
  }
301
286
  // ========================================================================
302
287
  // Data Attribute Storage
@@ -305,23 +290,23 @@ class j extends R {
305
290
  * Stores a spacing value as a data attribute on the block root element
306
291
  */
307
292
  _storeDataAttribute(t, e) {
308
- const o = B(this.currentNode);
309
- o && this.api.getDocumentModifier().modifyHtml(o).setAttribute(t, e.toString()).apply(new m(`Store ${t}`));
293
+ const n = U(this.currentNode);
294
+ n && this.api.getDocumentModifier().modifyHtml(n).setAttribute(t, e.toString()).apply(new S(`Store ${t}`));
310
295
  }
311
296
  // ========================================================================
312
297
  // Event Listeners
313
298
  // ========================================================================
314
299
  _listenToFormUpdates() {
315
- this.api.onValueChanged(n.COLUMN_SPACING, (t) => {
300
+ this.api.onValueChanged(o.COLUMN_SPACING, (t) => {
316
301
  const e = parseInt(t);
317
302
  Number.isNaN(e) || this._debouncedOnColumnSpacingChange(e);
318
- }), this.api.onValueChanged(n.ROW_SPACING, (t) => {
303
+ }), this.api.onValueChanged(o.ROW_SPACING, (t) => {
319
304
  const e = parseInt(t);
320
305
  Number.isNaN(e) || this._debouncedOnRowSpacingChange(e);
321
- }), this.api.onValueChanged(n.MOBILE_COLUMN_SPACING, (t) => {
306
+ }), this.api.onValueChanged(o.MOBILE_COLUMN_SPACING, (t) => {
322
307
  const e = parseInt(t);
323
308
  Number.isNaN(e) || this._debouncedOnMobileColumnSpacingChange(e);
324
- }), this.api.onValueChanged(n.MOBILE_ROW_SPACING, (t) => {
309
+ }), this.api.onValueChanged(o.MOBILE_ROW_SPACING, (t) => {
325
310
  const e = parseInt(t);
326
311
  Number.isNaN(e) || this._debouncedOnMobileRowSpacingChange(e);
327
312
  });
@@ -337,6 +322,6 @@ class j extends R {
337
322
  }
338
323
  }
339
324
  export {
340
- U as SPACING_CONTROL_ID,
325
+ V as SPACING_CONTROL_ID,
341
326
  j as SpacingControl
342
327
  };
@@ -25,6 +25,27 @@ const n = `/* Utils */
25
25
  border-top: none;
26
26
  }
27
27
 
28
+ /* The editor's row-separator rule only reaches \`.container\`s that are direct
29
+ children of \`.container-wrapper\`; the spacing rows sit one level deeper, so the
30
+ first one loses its line. Restore it with the editor's own border token. */
31
+ .spacing-control-container > .container {
32
+ border-top: var(--ue-border-width-1, 1px) solid var(--ue-panels-border-color, rgba(0, 0, 0, 0.07));
33
+ }
34
+
35
+ /* A spacing field that doesn't apply (mobile rows, column spacing in list layout) is
36
+ removed from its row and leaves the wrapper behind — collapse it so it can't
37
+ render as an empty separator-topped strip. */
38
+ .spacing-control-container > .container:not(:has(ue-counter)) {
39
+ display: none;
40
+ }
41
+
42
+ /* The block background row stacks the editor's "inherits background color" banner
43
+ above its field, separated by the editor's default 10px gap — match the tab's 16px.
44
+ Scoped via the spacing control so other blocks keep the default. */
45
+ .ue-scrollable-content:has(.spacing-control-container) .e2e-block-bg-color {
46
+ row-gap: 16px;
47
+ }
48
+
28
49
  /* Right-align the mobile layout toggle within the two-column grid */
29
50
  .product-layout-control-container ue-switcher {
30
51
  justify-self: end;
@@ -30,6 +30,11 @@ export declare class SpacingControl extends CommonControl {
30
30
  onRender(): void;
31
31
  onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
32
32
  onDestroy(): void;
33
+ /**
34
+ * One label + counter per two-column row, so every spacing field gets the same
35
+ * 16px-padded row the color controls already render instead of sharing one grid.
36
+ */
37
+ _spacingRow(label: string, labelName: string, counterName: string): string;
33
38
  /**
34
39
  * Updates spacing control visibility based on layout orientation and mobileLayoutEnabled.
35
40
  * - List layout: hide column spacing (products are full-width), hide ALL mobile
@@ -1,108 +1,88 @@
1
- import { productPairs as w } from "../extensions/Blocks/Items/enums/productEnums.js";
2
- import { DefaultConfigValues as G } from "../extensions/Blocks/Items/enums/settingsEnums.js";
3
- import { escapeReplacement as N } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
4
- import { preserveTextStyles as I } from "./preserveTextStyles.js";
5
- import { unwrapProductNameLinks as v } from "./unwrapProductNameLink.js";
6
- const O = {
7
- CART_ITEMS: "ins_apr",
8
- BROWSED_ITEMS: "browsed_item",
9
- PURCHASED_ITEMS: "purchased_item"
10
- }, q = (h) => h.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
11
- function X(h, g, _) {
12
- let E = h.indexOf(g);
13
- if (E === -1)
14
- return !1;
15
- for (; E !== -1; ) {
16
- let b = E;
17
- for (; b > 0 && /\s/.test(h[b - 1]); )
18
- b -= 1;
19
- if (!_.some((P) => h.endsWith(P, b)))
20
- return !1;
21
- E = h.indexOf(g, E + g.length);
22
- }
23
- return !0;
24
- }
25
- function J(h) {
26
- const g = q(h), _ = new DOMParser().parseFromString(g, "text/html");
27
- v(_);
28
- const E = w.PAIRS_FOR_EXTENSION;
29
- Object.entries(E).forEach(([r, l]) => {
30
- _.querySelectorAll(".ins-product-td").forEach((f) => {
31
- const p = f.getAttribute("data-number") || "1", R = f.getAttribute("data-type") || "CART_ITEMS";
32
- f.querySelectorAll(`[product-attr="${r}"]`).forEach((t) => {
33
- var k, D, x;
34
- const S = t.getAttribute("data-type") || R, u = t.getAttribute("data-number") || p, A = l[S];
35
- if (A)
1
+ import { productPairs as q } from "../extensions/Blocks/Items/enums/productEnums.js";
2
+ import { DefaultConfigValues as O } from "../extensions/Blocks/Items/enums/settingsEnums.js";
3
+ import { preserveTextStyles as C } from "./preserveTextStyles.js";
4
+ import { unwrapProductNameLinks as U } from "./unwrapProductNameLink.js";
5
+ function Y(L) {
6
+ const H = L.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), b = new DOMParser().parseFromString(H, "text/html");
7
+ U(b);
8
+ const R = q.PAIRS_FOR_EXTENSION;
9
+ Object.entries(R).forEach(([r, u]) => {
10
+ b.querySelectorAll(".ins-product-td").forEach((l) => {
11
+ const h = l.getAttribute("data-number") || "1", $ = l.getAttribute("data-type") || "CART_ITEMS";
12
+ l.querySelectorAll(`[product-attr="${r}"]`).forEach((t) => {
13
+ var F, I, w;
14
+ const T = t.getAttribute("data-type") || $, f = t.getAttribute("data-number") || h, d = u[T];
15
+ if (d)
36
16
  switch (r) {
37
17
  case "imageSrc": {
38
18
  let e = null, c = null;
39
19
  if (t.tagName === "IMG" ? (e = t, c = e.closest("a")) : (e = t.querySelector("img"), c = t.querySelector("a") || t.closest("a")), !e)
40
20
  break;
41
- const i = A.DEFAULT, s = A.ATTR;
21
+ const i = d.DEFAULT, a = d.ATTR;
42
22
  if (i && e.src) {
43
23
  const o = e.src;
44
- i.some((T) => {
45
- const a = T.split("/").pop() || "", C = o.split("/").pop() || "";
46
- return o.includes(T) || o.includes(a) || C === a;
47
- }) && (e.src = `{{${s}_${u}}}`);
24
+ i.some((E) => {
25
+ const s = E.split("/").pop() || "", g = o.split("/").pop() || "";
26
+ return o.includes(E) || o.includes(s) || g === s;
27
+ }) && (e.src = `{{${a}_${f}}}`);
48
28
  }
49
- const n = (D = (k = E.name) == null ? void 0 : k[S]) == null ? void 0 : D.ATTR;
50
- if (n && e.setAttribute("alt", `{{${n}_${u}}}`), c) {
51
- const o = (x = E.itemLink) == null ? void 0 : x[S];
29
+ const n = (I = (F = R.name) == null ? void 0 : F[T]) == null ? void 0 : I.ATTR;
30
+ if (n && e.setAttribute("alt", `{{${n}_${f}}}`), c) {
31
+ const o = (w = R.itemLink) == null ? void 0 : w[T];
52
32
  if (o) {
53
- const $ = o.HREF, T = o.DEFAULT_HREF || "#!", a = c.href;
54
- (a === "#" || a === "" || a.endsWith("#!") || a.endsWith(T) || a === `${window.location.href}${T}` || !a || a === window.location.href) && (c.href = `{{${$}_${u}}}`);
33
+ const A = o.HREF, E = o.DEFAULT_HREF || "#!", s = c.href;
34
+ (s === "#" || s === "" || s.endsWith("#!") || s.endsWith(E) || s === `${window.location.href}${E}` || !s || s === window.location.href) && (c.href = `{{${A}_${f}}}`);
55
35
  }
56
36
  }
57
37
  break;
58
38
  }
59
39
  case "name": {
60
- const e = A, c = e.ATTR, i = e.DEFAULT_HREF || "#!", s = e.HREF;
61
- t.textContent && (t.innerHTML = I(t, `{{${c}_${u}}}`));
40
+ const e = d, c = e.ATTR, i = e.DEFAULT_HREF || "#!", a = e.HREF;
41
+ t.textContent && (t.innerHTML = C(t, `{{${c}_${f}}}`));
62
42
  const n = t.closest("a") || (t.tagName === "A" ? t : null);
63
- if (n && s) {
64
- const o = n.href, $ = `${window.location.href}${i}`;
65
- (o === $ || o.endsWith(i)) && (n.href = `{{${s}_${u}}}`);
43
+ if (n && a) {
44
+ const o = n.href, A = `${window.location.href}${i}`;
45
+ (o === A || o.endsWith(i)) && (n.href = `{{${a}_${f}}}`);
66
46
  }
67
47
  break;
68
48
  }
69
49
  case "price":
70
50
  case "originalPrice": {
71
- const e = A, c = t.getAttribute("data-formated"), i = t.getAttribute("data-single_price"), s = c === "true", n = i === "true", o = t.getAttribute("data-curency") || "before";
72
- let $;
73
- n ? $ = s ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : $ = s ? e.PRICE_FORMATTED : e.PRICE;
74
- const T = e.CURRENCY;
75
- let a = `{{${$}_${u}}}`;
76
- const C = (t.getAttribute("data-currency_symbol") || "").trim(), W = C !== "" && C !== G.productPriceCurrencySymbolControlValue;
77
- let H = "";
78
- W ? H = C : T && (H = `{{${T}_${u}}}`), H && (a = o === "after" ? `${a} ${H}` : `${H} ${a}`), t.innerHTML = I(t, a);
51
+ const e = d, c = t.getAttribute("data-formated"), i = t.getAttribute("data-single_price"), a = c === "true", n = i === "true", o = t.getAttribute("data-curency") || "before";
52
+ let A;
53
+ n ? A = a ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : A = a ? e.PRICE_FORMATTED : e.PRICE;
54
+ const E = e.CURRENCY;
55
+ let s = `{{${A}_${f}}}`;
56
+ const g = (t.getAttribute("data-currency_symbol") || "").trim(), N = g !== "" && g !== O.productPriceCurrencySymbolControlValue;
57
+ let m = "";
58
+ N ? m = g : E && (m = `{{${E}_${f}}}`), m && (s = o === "after" ? `${s} ${m}` : `${m} ${s}`), t.innerHTML = C(t, s);
79
59
  break;
80
60
  }
81
61
  case "quantity": {
82
- const e = A, c = e.ATTR, i = e.DEFAULT;
83
- t.textContent && t.textContent.trim() === i && (t.innerHTML = I(t, `{{${c}_${u}}}`));
62
+ const e = d, c = e.ATTR, i = e.DEFAULT;
63
+ t.textContent && t.textContent.trim() === i && (t.innerHTML = C(t, `{{${c}_${f}}}`));
84
64
  break;
85
65
  }
86
66
  case "button": {
87
- const e = A, c = e.HREF, i = e.DEFAULT_HREF || "#!", s = t.tagName === "A" ? t : t.querySelector("a");
88
- if (s) {
89
- const n = s.href || "", o = `${window.location.href}${i}`;
90
- (n === "" || n === "#" || n === o || n.endsWith(i) || n.endsWith("#!") || n === window.location.href) && (s.href = `{{${c}_${u}}}`);
67
+ const e = d, c = e.HREF, i = e.DEFAULT_HREF || "#!", a = t.tagName === "A" ? t : t.querySelector("a");
68
+ if (a) {
69
+ const n = a.href || "", o = `${window.location.href}${i}`;
70
+ (n === "" || n === "#" || n === o || n.endsWith(i) || n.endsWith("#!") || n === window.location.href) && (a.href = `{{${c}_${f}}}`);
91
71
  }
92
72
  break;
93
73
  }
94
74
  case "itemLink": {
95
- const e = A, c = e.HREF, i = e.DEFAULT_HREF || "#!", s = t;
96
- if (s.href) {
97
- const n = s.href, o = `${window.location.href}${i}`;
98
- (n === o || n.endsWith(i)) && (s.href = `{{${c}_${u}}}`);
75
+ const e = d, c = e.HREF, i = e.DEFAULT_HREF || "#!", a = t;
76
+ if (a.href) {
77
+ const n = a.href, o = `${window.location.href}${i}`;
78
+ (n === o || n.endsWith(i)) && (a.href = `{{${c}_${f}}}`);
99
79
  }
100
80
  break;
101
81
  }
102
82
  default: {
103
- if ("ATTR" in A) {
104
- const e = A.ATTR;
105
- t.textContent && (t.innerHTML = I(t, `{{${e}_${u}}}`));
83
+ if ("ATTR" in d) {
84
+ const e = d.ATTR;
85
+ t.textContent && (t.innerHTML = C(t, `{{${e}_${f}}}`));
106
86
  }
107
87
  break;
108
88
  }
@@ -110,53 +90,55 @@ function J(h) {
110
90
  });
111
91
  });
112
92
  });
113
- const b = g.match(/<!DOCTYPE[^>]*>/i), P = b ? `${b[0]}
114
- ` : "", U = _.querySelectorAll(".ins-product-td"), L = [];
115
- U.forEach((r) => {
116
- const l = r.getAttribute("data-type") || "CART_ITEMS", d = r.getAttribute("data-number") || "1", f = r.outerHTML;
117
- L.push({
93
+ const k = H.match(/<!DOCTYPE[^>]*>/i), P = k ? `${k[0]}
94
+ ` : "", D = b.querySelectorAll(".ins-product-td"), M = [];
95
+ D.forEach((r) => {
96
+ const u = r.getAttribute("data-type") || "CART_ITEMS", p = r.getAttribute("data-number") || "1", l = r.outerHTML;
97
+ M.push({
118
98
  element: r,
119
- outerHtml: f,
120
- type: l,
121
- number: d
99
+ outerHtml: l,
100
+ type: u,
101
+ number: p
122
102
  });
123
103
  });
124
- let y = P + _.documentElement.outerHTML;
125
- L.reverse().forEach(({ outerHtml: r, type: l, number: d }) => {
126
- const f = O[l], p = f ? `${f}_total_product_kind` : "";
127
- if (p) {
128
- const m = parseInt(d) - 1, u = `${`{% if ${p} > ${m} %}`}${r}{% endif %}`;
129
- y = y.replace(r, N(u));
104
+ let _ = P + b.documentElement.outerHTML;
105
+ M.reverse().forEach(({ outerHtml: r, type: u, number: p }) => {
106
+ let l = "";
107
+ switch (u) {
108
+ case "CART_ITEMS":
109
+ l = "ins_apr_total_product_kind";
110
+ break;
111
+ case "BROWSED_ITEMS":
112
+ l = "browsed_item_total_product_kind";
113
+ break;
114
+ case "PURCHASED_ITEMS":
115
+ l = "purchased_item_total_product_kind";
116
+ break;
117
+ }
118
+ if (l) {
119
+ const $ = parseInt(p) - 1, T = `${`{% if ${l} > ${$} %}`}${r}{% endif %}`;
120
+ _ = _.replace(r, T);
130
121
  }
131
122
  });
132
- const V = _.querySelectorAll('[product-attr="originalPrice"][data-type]'), F = [], M = /* @__PURE__ */ new Set();
133
- return V.forEach((r) => {
134
- var t;
135
- const l = r.getAttribute("data-number"), d = r.getAttribute("data-type");
136
- if (!l || !O[d])
137
- return;
138
- const f = r.closest(".product-original-price-class");
139
- if (!f)
140
- return;
141
- const p = f.outerHTML;
142
- if (((t = r.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup")) === "false") {
143
- M.add(p);
123
+ const x = b.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), S = [];
124
+ return x.forEach((r) => {
125
+ var $;
126
+ const u = r.getAttribute("data-number"), p = r.getAttribute("data-type");
127
+ if (!u || p !== "CART_ITEMS" || (($ = r.closest(".ins-product-td")) == null ? void 0 : $.getAttribute("data-nodup")) === "false")
144
128
  return;
129
+ const h = r.closest(".product-original-price-class");
130
+ if (h) {
131
+ const y = h.outerHTML;
132
+ S.some((T) => T.tdOuterHtml === y) || S.push({ tdOuterHtml: y, number: u });
145
133
  }
146
- F.some((S) => S.tdOuterHtml === p) || F.push({ tdOuterHtml: p, number: l, type: d });
147
- }), F.forEach(({ tdOuterHtml: r, number: l, type: d }) => {
148
- if (M.has(r))
149
- return;
150
- const f = w.PAIRS_FOR_EXTENSION.price[d].PRICE, p = w.PAIRS_FOR_EXTENSION.originalPrice[d].PRICE, R = `{% if ${f}_${l} != ${p}_${l} %}`, m = X(y, r, [
151
- R,
152
- q(R)
153
- ]);
154
- r.includes("{% if") || m || (y = y.replaceAll(
155
- r,
156
- N(`${R}${r}{% endif %}`)
157
- ));
158
- }), y.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
134
+ }), S.reverse().forEach(({ tdOuterHtml: r, number: u }) => {
135
+ const p = `{% if ins_apr_price_${u} != ins_apr_originalprice_${u} %}`;
136
+ if (!_.includes(p) && !r.includes("{% if")) {
137
+ const h = `${p}${r}{% endif %}`;
138
+ _ = _.replace(r, h);
139
+ }
140
+ }), _.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
159
141
  }
160
142
  export {
161
- J as pairProductVariables
143
+ Y as pairProductVariables
162
144
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.15.0-beta.e9014b0",
3
+ "version": "3.15.0-beta.f5247a0",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",