@useinsider/guido 3.4.0-beta.5d19726 → 3.4.1-beta.4c96ad0

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,5 +1,5 @@
1
- import { useRecommendation as C } from "../../composables/useRecommendation.js";
2
- import { DUMMY_IMAGE_MAPPINGS as y, REGEX as T, VerticalOrientation as M, CSS as E, ATTRIBUTES as A, CONDITIONS as g, HTML as N } from "../../enums/recommendation.js";
1
+ import { useRecommendation as h } from "../../composables/useRecommendation.js";
2
+ import { DUMMY_IMAGE_MAPPINGS as N, REGEX as T, VerticalOrientation as M, CSS as E, ATTRIBUTES as A, CONDITIONS as y, HTML as C } from "../../enums/recommendation.js";
3
3
  import { prepareRecommendationBlocks as x } from "./utils/recommendationCompilerUtils.js";
4
4
  const w = [
5
5
  {
@@ -8,7 +8,7 @@ const w = [
8
8
  type: "custom",
9
9
  processor: (c) => {
10
10
  let e = c;
11
- return Object.entries(y).forEach(([, l]) => {
11
+ return Object.entries(N).forEach(([, l]) => {
12
12
  Object.entries(l).forEach(([n, s]) => {
13
13
  e = e.replaceAll(s, `{{${n}}}`);
14
14
  });
@@ -25,12 +25,24 @@ const w = [
25
25
  replaceAll: !0,
26
26
  priority: 51
27
27
  },
28
+ {
29
+ id: "rename-legacy-buy-button-class",
30
+ // Templates saved before the buy-button → reco-v3-button rename still
31
+ // carry the old class in their persisted HTML; rewrite on export so the
32
+ // downstream button identification selector keeps working.
33
+ description: "Rename legacy buy-button class to reco-v3-button on product button anchors",
34
+ type: "replace",
35
+ search: "es-button buy-button",
36
+ replacement: "es-button reco-v3-button",
37
+ replaceAll: !0,
38
+ priority: 49
39
+ },
28
40
  {
29
41
  id: "add-recommendation-unresponsive-css",
30
42
  description: "Adding recommendation unresponsive css",
31
43
  type: "custom",
32
44
  processor: (c) => {
33
- const { calculateCardWidth: e, getRecommendationCampaignData: l } = C();
45
+ const { calculateCardWidth: e, getRecommendationCampaignData: l } = h();
34
46
  let n = c;
35
47
  const s = n.match(T.ID);
36
48
  if (s) {
@@ -60,7 +72,7 @@ const w = [
60
72
  type: "custom",
61
73
  processor: (c) => {
62
74
  let e = c;
63
- const l = e.match(T.ATTRIBUTE_PARAGRAPH), { getRecommendationCampaignData: n } = C();
75
+ const l = e.match(T.ATTRIBUTE_PARAGRAPH), { getRecommendationCampaignData: n } = h();
64
76
  return l !== null && l.forEach((s) => {
65
77
  const a = s.match(T.CUSTOM_FIELD);
66
78
  if (!a)
@@ -68,17 +80,17 @@ const w = [
68
80
  const [i] = a, u = i.match(T.CUSTOM_FIELD_INDEXES_PART), _ = i.match(T.CUSTOM_FIELD_NAME_PART), R = s.match(T.ATTRIBUTE_PARAGRAPH_START_TAG);
69
81
  if (!u || !_ || !R)
70
82
  return;
71
- const [S] = u, [b] = _, [d] = R, o = b.substring(1, b.length - 2), r = d.match(T.COMPOSITION) !== null;
83
+ const [b] = u, [I] = _, [d] = R, o = I.substring(1, I.length - 2), r = d.match(T.COMPOSITION) !== null;
72
84
  let t = i;
73
85
  if (r) {
74
- const I = S.substring(2, S.length - 3), m = n(I);
86
+ const S = b.substring(2, b.length - 3), m = n(S);
75
87
  o === A.OMNIBUS_PRICE && (m.priceBeforeTextValue && (t = `${m.priceBeforeTextValue}${t}`), m.priceAfterTextValue && (t = `${t}${m.priceAfterTextValue}`)), o === A.OMNIBUS_DISCOUNT && (m.discountBeforeTextValue && (t = `${m.discountBeforeTextValue}${t}`), m.discountAfterTextValue && (t = `${t}${m.discountAfterTextValue}`));
76
88
  }
77
- const p = S.substring(2);
89
+ const p = b.substring(2);
78
90
  let f = "";
79
- o in g.IF && (f = g.IF[o].replaceAll(`{${A.DISCOUNT}}`, `${p}${A.DISCOUNT}`).replaceAll(`{${A.OMNIBUS_DISCOUNT}}`, `${p}${A.OMNIBUS_DISCOUNT}`).replaceAll(`{${A.OMNIBUS_PRICE}}`, `${p}${A.OMNIBUS_PRICE}`));
80
- const $ = `${d}${t}${N.PARAGRAPH_END_TAG}`, h = `${f}${r ? $ : s}${g.ELSE}${d}${N.PARAGRAPH_END_TAG}${g.END_IF}`;
81
- e = e.replace(s, h);
91
+ o in y.IF && (f = y.IF[o].replaceAll(`{${A.DISCOUNT}}`, `${p}${A.DISCOUNT}`).replaceAll(`{${A.OMNIBUS_DISCOUNT}}`, `${p}${A.OMNIBUS_DISCOUNT}`).replaceAll(`{${A.OMNIBUS_PRICE}}`, `${p}${A.OMNIBUS_PRICE}`));
92
+ const g = `${d}${t}${C.PARAGRAPH_END_TAG}`, $ = `${f}${r ? g : s}${y.ELSE}${d}${C.PARAGRAPH_END_TAG}${y.END_IF}`;
93
+ e = e.replace(s, $);
82
94
  }), e;
83
95
  },
84
96
  priority: 53
@@ -116,7 +128,7 @@ const w = [
116
128
  / class="(?:product-card-segment|attribute-cell|recommendation-attribute-row|product-image|product-name|product-price|product-old-price|product-omnibus-price|product-omnibus-discount|product-button|recommendation-product-row|product-card-wrapper)"/g,
117
129
  ""
118
130
  );
119
- return e = e.replaceAll("es-button buy-button", "es-button"), e = e.replaceAll("ins-recommendation-product-container ", ""), e;
131
+ return e = e.replaceAll("ins-recommendation-product-container ", ""), e;
120
132
  },
121
133
  priority: 56
122
134
  },
@@ -174,10 +186,10 @@ const w = [
174
186
  let o = e;
175
187
  return o = o.replaceAll("<!--REC_START-->", ""), o = o.replaceAll("<!--REC_END-->", ""), o;
176
188
  }
177
- const R = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), S = (o, r) => `${o.slice(0, -1)} ${r}"`, b = /* @__PURE__ */ new Map();
189
+ const R = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), b = (o, r) => `${o.slice(0, -1)} ${r}"`, I = /* @__PURE__ */ new Map();
178
190
  i.forEach((o, r) => {
179
191
  const t = R(r);
180
- b.set(r, {
192
+ I.set(r, {
181
193
  caseA: new RegExp(`(class="[^"]*")((?:[^>]*?)) style="${t}"`, "g"),
182
194
  caseB: new RegExp(` style="${t}"((?:[^>]*?))(class="[^"]*")`, "g")
183
195
  });
@@ -188,13 +200,13 @@ const w = [
188
200
  (o, r) => {
189
201
  let t = r;
190
202
  return i.forEach((p, f) => {
191
- const $ = b.get(f);
203
+ const g = I.get(f);
192
204
  t = t.replace(
193
- $.caseA,
194
- (h, I, m) => S(I, p) + m
205
+ g.caseA,
206
+ ($, S, m) => b(S, p) + m
195
207
  ), t = t.replace(
196
- $.caseB,
197
- (h, I, m) => I + S(m, p)
208
+ g.caseB,
209
+ ($, S, m) => S + b(m, p)
198
210
  ), t = t.replaceAll(` style="${f}"`, ` class="${p}"`);
199
211
  }), t;
200
212
  }
@@ -1,10 +1,10 @@
1
1
  import { RecommendationBlockId as g } from "../../../extensions/Blocks/Recommendation/constants/blockIds.js";
2
- import { CURRENCY_ATTR as R, ATTR_PRODUCT_IMAGE as I, ATTR_PRODUCT_BUTTON as k, ATTR_PRODUCT_NAME as z, ATTR_PRODUCT_PRICE as G, ATTR_PRODUCT_OLD_PRICE as H, ATTR_PRODUCT_OMNIBUS_PRICE as U, ATTR_PRODUCT_OMNIBUS_DISCOUNT as j, ATTR_CUSTOM_PREFIX as E } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
- import { formatPrice as N } from "../../../extensions/Blocks/Recommendation/utils/priceFormatter.js";
2
+ import { CURRENCY_ATTR as R, ATTR_PRODUCT_IMAGE as I, ATTR_PRODUCT_BUTTON as N, CSS_CLASS_RECO_BUTTON as z, ATTR_PRODUCT_NAME as G, ATTR_PRODUCT_PRICE as H, ATTR_PRODUCT_OLD_PRICE as j, ATTR_PRODUCT_OMNIBUS_PRICE as U, ATTR_PRODUCT_OMNIBUS_DISCOUNT as V, ATTR_CUSTOM_PREFIX as E } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
3
+ import { formatPrice as v } from "../../../extensions/Blocks/Recommendation/utils/priceFormatter.js";
4
4
  import { escapeHtml as c } from "../../../utils/htmlEscape.js";
5
5
  import { appendStyle as $ } from "./themeMapper.js";
6
- const V = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png", Y = "attribute-cell", F = "Buy", J = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79)", X = "color: rgb(56, 118, 29); background: rgb(217, 234, 211); font-family: arial, 'helvetica neue', helvetica, sans-serif; font-size: 16px; font-weight: normal; line-height: 120%; mso-border-alt: 10px solid rgb(217, 234, 211); mso-padding-alt: 0", et = "ins-recommendation-product-container ins-recommendation-desktop-container";
7
- function ot(t) {
6
+ const Y = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png", F = "attribute-cell", J = "Buy", X = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79)", K = "color: rgb(56, 118, 29); background: rgb(217, 234, 211); font-family: arial, 'helvetica neue', helvetica, sans-serif; font-size: 16px; font-weight: normal; line-height: 120%; mso-border-alt: 10px solid rgb(217, 234, 211); mso-padding-alt: 0", ot = "ins-recommendation-product-container ins-recommendation-desktop-container";
7
+ function nt(t) {
8
8
  return t.replace(/>\s+</g, "><").trim();
9
9
  }
10
10
  function y(t) {
@@ -19,10 +19,10 @@ function _() {
19
19
  textTrimming: !1
20
20
  };
21
21
  }
22
- function K(t) {
22
+ function q(t) {
23
23
  return t ? { ...t, wrapBold: !0 } : { ..._(), wrapBold: !0 };
24
24
  }
25
- function v(t, o) {
25
+ function k(t, o) {
26
26
  let e = c(t);
27
27
  return o.wrapBold && o.wrapItalic ? e = `<strong><em>${e}</em></strong>` : o.wrapBold ? e = `<strong>${e}</strong>` : o.wrapItalic && (e = `<em>${e}</em>`), e;
28
28
  }
@@ -30,9 +30,9 @@ function b(t) {
30
30
  return t ? ` style="${c(t)}"` : "";
31
31
  }
32
32
  function O(t, o) {
33
- return `<td width="${t}%" class="${Y}" ${o}`;
33
+ return `<td width="${t}%" class="${F}" ${o}`;
34
34
  }
35
- function nt(t, o, e, l) {
35
+ function lt(t, o, e, l) {
36
36
  const s = t.width ? ` width="${t.width}"` : "", n = t.height ? ` height="${t.height}"` : "", i = ["display: block", "max-width: 100%", "height: auto"];
37
37
  t.width && i.push(`width: ${t.width}px`), t.height && i.push(`height: ${t.height}px`);
38
38
  const a = i.join("; "), r = e ? ` style="background-color: ${c(e)}"` : "";
@@ -46,7 +46,7 @@ function nt(t, o, e, l) {
46
46
  class="esd-block-image product-image es-p5"
47
47
  esd-extension-block-id="${g.IMAGE}">
48
48
  <a target="_blank" href="https://example.com/product/${o + 1}">
49
- <img src="${V}" alt="Product Name"
49
+ <img src="${Y}" alt="Product Name"
50
50
  class="adapt-img"${s}${n}
51
51
  style="${a}">
52
52
  </a>
@@ -57,7 +57,7 @@ function nt(t, o, e, l) {
57
57
  </td>
58
58
  `;
59
59
  }
60
- function D(t, o, e, l, s, n, i) {
60
+ function L(t, o, e, l, s, n, i) {
61
61
  const r = `table-layout: fixed${n ? `; background-color: ${c(n)}` : ""}`, d = b(s.tdStyle), p = y(s.align), u = `esd-block-text ${o}`.trim(), m = $(l, s.pStyle);
62
62
  return `
63
63
  ${O(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
@@ -68,7 +68,7 @@ function D(t, o, e, l, s, n, i) {
68
68
  <td${p}
69
69
  class="${u}"
70
70
  esd-extension-block-id="${t}"${d}>
71
- <p contenteditable="false"${b(m)}>${v(e, s)}</p>
71
+ <p contenteditable="false"${b(m)}>${k(e, s)}</p>
72
72
  </td>
73
73
  </tr>
74
74
  </tbody>
@@ -76,7 +76,7 @@ function D(t, o, e, l, s, n, i) {
76
76
  </td>
77
77
  `;
78
78
  }
79
- function lt(t, o, e, l) {
79
+ function st(t, o, e, l) {
80
80
  const s = o ? ` style="background-color: ${c(o)}"` : "", n = b(t.tdStyle), i = y(t.align), r = $("font-size: 14px; color: #999999", t.pStyle);
81
81
  return `
82
82
  ${O(e, 'valign="top" style="padding: 0 5px; height: 100%"')}>
@@ -88,7 +88,7 @@ function lt(t, o, e, l) {
88
88
  class="esd-block-text product-old-price es-p15l es-p15r"
89
89
  esd-extension-block-id="${g.OLD_PRICE}"${n}>
90
90
  <p contenteditable="false"${b(r)}>
91
- <s>${v(l, t)}</s>
91
+ <s>${k(l, t)}</s>
92
92
  </p>
93
93
  </td>
94
94
  </tr>
@@ -97,7 +97,7 @@ function lt(t, o, e, l) {
97
97
  </td>
98
98
  `;
99
99
  }
100
- function L(t, o, e, l, s, n, i) {
100
+ function D(t, o, e, l, s, n, i) {
101
101
  const a = s ? `; background-color: ${c(s)}` : "", r = b(l.tdStyle), d = y(l.align), u = $("font-size: 12px; color: #666666", l.pStyle);
102
102
  return `
103
103
  ${O(i, 'valign="top" style="padding: 0 5px; height: 100%"')}>
@@ -121,8 +121,8 @@ function L(t, o, e, l, s, n, i) {
121
121
  </td>
122
122
  `;
123
123
  }
124
- function st(t, o, e, l) {
125
- const s = e ? ` style="background-color: ${c(e)}"` : "", n = $("padding: 0 5px; height: 100%", o.tdStyle), i = y(o.align), a = o.text || F, r = $(J, o.spanStyle), d = $(X, o.aStyle);
124
+ function it(t, o, e, l) {
125
+ const s = e ? ` style="background-color: ${c(e)}"` : "", n = $("padding: 0 5px; height: 100%", o.tdStyle), i = y(o.align), a = o.text || J, r = $(X, o.spanStyle), d = $(K, o.aStyle);
126
126
  return `
127
127
  ${O(l, `valign="top" style="${c(n)}"`)}>
128
128
  <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0"
@@ -134,7 +134,7 @@ function st(t, o, e, l) {
134
134
  esd-extension-block-id="${g.BUTTON}">
135
135
  <span class="es-button-border" style="${c(r)}">
136
136
  <a href="https://example.com/product/${t + 1}" target="_blank"
137
- class="es-button buy-button"
137
+ class="es-button ${z}"
138
138
  style="${c(d)}">${c(a)}</a>
139
139
  </span>
140
140
  </td>
@@ -144,7 +144,7 @@ function st(t, o, e, l) {
144
144
  </td>
145
145
  `;
146
146
  }
147
- function it(t, o, e, l, s) {
147
+ function ct(t, o, e, l, s) {
148
148
  const n = l ? `; background-color: ${c(l)}` : "", i = b(e.tdStyle), a = y(e.align), d = $("font-size: 12px; color: #666666; margin: 0", e.pStyle), p = o.replace(/_/g, " ").replace(/\b\w/g, (u) => u.toUpperCase());
149
149
  return `
150
150
  ${O(s, 'valign="middle" style="padding: 0 5px; height: 100%"')}>
@@ -163,18 +163,18 @@ function it(t, o, e, l, s) {
163
163
  </td>
164
164
  `;
165
165
  }
166
- function ct(t, o, e, l, s, n, i) {
166
+ function at(t, o, e, l, s, n, i) {
167
167
  const a = o[t], r = a ?? _();
168
168
  switch (t) {
169
169
  case I:
170
- return nt(
170
+ return lt(
171
171
  a ?? {},
172
172
  s,
173
173
  l,
174
174
  n
175
175
  );
176
- case z:
177
- return D(
176
+ case G:
177
+ return L(
178
178
  g.NAME,
179
179
  "product-name es-p10t es-p10b es-p15l es-p15r",
180
180
  "Product Name",
@@ -183,20 +183,20 @@ function ct(t, o, e, l, s, n, i) {
183
183
  l,
184
184
  n
185
185
  );
186
- case G:
187
- return D(
186
+ case H:
187
+ return L(
188
188
  g.PRICE,
189
189
  "product-price es-p15l es-p15r",
190
190
  i.pricePlaceholder,
191
191
  "font-size: 16px; color: #333333",
192
- K(a),
192
+ q(a),
193
193
  l,
194
194
  n
195
195
  );
196
- case H:
197
- return lt(r, l, n, i.oldPricePlaceholder);
196
+ case j:
197
+ return st(r, l, n, i.oldPricePlaceholder);
198
198
  case U:
199
- return L(
199
+ return D(
200
200
  g.OMNIBUS_PRICE,
201
201
  "omnibus-price-value",
202
202
  i.omnibusPricePlaceholder,
@@ -205,8 +205,8 @@ function ct(t, o, e, l, s, n, i) {
205
205
  "product-omnibus-price",
206
206
  n
207
207
  );
208
- case j:
209
- return L(
208
+ case V:
209
+ return D(
210
210
  g.OMNIBUS_DISCOUNT,
211
211
  "omnibus-discount-value",
212
212
  "-10%",
@@ -215,8 +215,8 @@ function ct(t, o, e, l, s, n, i) {
215
215
  "product-omnibus-discount",
216
216
  n
217
217
  );
218
- case k:
219
- return st(
218
+ case N:
219
+ return it(
220
220
  s,
221
221
  a ?? {},
222
222
  l,
@@ -225,25 +225,25 @@ function ct(t, o, e, l, s, n, i) {
225
225
  default:
226
226
  if (t.startsWith(E)) {
227
227
  const d = e[t] ?? t.slice(E.length), p = t.slice(E.length);
228
- return it(d, p, r, l, n);
228
+ return ct(d, p, r, l, n);
229
229
  }
230
230
  return null;
231
231
  }
232
232
  }
233
- const q = `
233
+ const Q = `
234
234
  <tr>
235
235
  <td class="spacer" style="height: 10px"></td>
236
236
  </tr>
237
237
  `;
238
- function at(t) {
238
+ function rt(t) {
239
239
  return {
240
- pricePlaceholder: N({ price: 18, currency: t }),
241
- oldPricePlaceholder: N({ price: 20, currency: t }),
242
- omnibusPricePlaceholder: N({ price: 20, currency: t })
240
+ pricePlaceholder: v({ price: 18, currency: t }),
241
+ oldPricePlaceholder: v({ price: 20, currency: t }),
242
+ omnibusPricePlaceholder: v({ price: 20, currency: t })
243
243
  };
244
244
  }
245
- function rt(t, o, e, l) {
246
- const { composition: s, visibility: n, perElement: i, customAttrValues: a, cardBg: r } = l, d = (100 / e).toFixed(2), p = e - o, u = `<td class="${Y}" style="padding: 0 5px;" width="${d}%"></td>`, m = p > 0 ? u.repeat(p) : "";
245
+ function dt(t, o, e, l) {
246
+ const { composition: s, visibility: n, perElement: i, customAttrValues: a, cardBg: r } = l, d = (100 / e).toFixed(2), p = e - o, u = `<td class="${F}" style="padding: 0 5px;" width="${d}%"></td>`, m = p > 0 ? u.repeat(p) : "";
247
247
  return `
248
248
  <tr class="recommendation-product-row">
249
249
  <td>
@@ -252,7 +252,7 @@ function rt(t, o, e, l) {
252
252
  <tbody>${s.map((T) => {
253
253
  const w = n[T] !== !1, f = w ? "" : ' style="display: none"', C = w ? "1" : "0", S = [];
254
254
  for (let x = 0; x < o; x += 1) {
255
- const A = ct(
255
+ const A = at(
256
256
  T,
257
257
  i,
258
258
  a,
@@ -276,44 +276,44 @@ function rt(t, o, e, l) {
276
276
  </tr>
277
277
  `;
278
278
  }
279
- function dt(t, o, e) {
279
+ function pt(t, o, e) {
280
280
  const l = [];
281
281
  for (let s = 0; s < t; s += o) {
282
282
  const n = Math.min(o, t - s);
283
- s > 0 && l.push(q), l.push(rt(s, n, o, e));
283
+ s > 0 && l.push(Q), l.push(dt(s, n, o, e));
284
284
  }
285
285
  return l.join("");
286
286
  }
287
- function pt(t, o, e, l) {
287
+ function ut(t, o, e, l) {
288
288
  const s = o[t];
289
- if (t === z) {
289
+ if (t === G) {
290
290
  const n = s ?? _(), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), a = y(n.align ?? "left");
291
291
  return `
292
292
  <td class="esd-block-text product-name"
293
293
  esd-extension-block-id="${g.NAME}"${a}${b(n.tdStyle)}>
294
- <p contenteditable="false"${b(i)}>${v("Product Name", n)}</p>
294
+ <p contenteditable="false"${b(i)}>${k("Product Name", n)}</p>
295
295
  </td>
296
296
  `;
297
297
  }
298
- if (t === G) {
299
- const n = K(s), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), a = y(n.align ?? "left");
298
+ if (t === H) {
299
+ const n = q(s), i = $("font-size: 16px; color: #333333; margin: 0", n.pStyle), a = y(n.align ?? "left");
300
300
  return `
301
301
  <td class="esd-block-text product-price"
302
302
  esd-extension-block-id="${g.PRICE}"${a}${b(n.tdStyle)}>
303
- <p contenteditable="false"${b(i)}>${v(l.pricePlaceholder, n)}</p>
303
+ <p contenteditable="false"${b(i)}>${k(l.pricePlaceholder, n)}</p>
304
304
  </td>
305
305
  `;
306
306
  }
307
- if (t === H) {
307
+ if (t === j) {
308
308
  const n = s ?? _(), a = $("font-size: 14px; color: #999999; text-decoration: line-through; margin: 0", n.pStyle), r = y(n.align ?? "left");
309
309
  return `
310
310
  <td class="esd-block-text product-old-price"
311
311
  esd-extension-block-id="${g.OLD_PRICE}"${r}${b(n.tdStyle)}>
312
- <p contenteditable="false"${b(a)}><s>${v(l.oldPricePlaceholder, n)}</s></p>
312
+ <p contenteditable="false"${b(a)}><s>${k(l.oldPricePlaceholder, n)}</s></p>
313
313
  </td>
314
314
  `;
315
315
  }
316
- if (t === U || t === j) {
316
+ if (t === U || t === V) {
317
317
  const n = t === U, i = n ? g.OMNIBUS_PRICE : g.OMNIBUS_DISCOUNT, a = n ? "omnibus-price-value" : "omnibus-discount-value", r = n ? l.omnibusPricePlaceholder : "-10%", d = n ? "product-omnibus-price" : "product-omnibus-discount", p = s ?? _(), u = $("font-size: 12px; color: #666666; margin: 0", p.pStyle), m = y(p.align ?? "left");
318
318
  return `
319
319
  <td class="esd-block-text ${d}"
@@ -339,7 +339,7 @@ function pt(t, o, e, l) {
339
339
  }
340
340
  return null;
341
341
  }
342
- function ut(t, o) {
342
+ function bt(t, o) {
343
343
  const { composition: e, visibility: l, perElement: s, customAttrValues: n, cardBg: i } = o, a = i ? `background-color: ${c(i)}` : "", r = a ? `style="table-layout: fixed; ${a}"` : 'style="table-layout: fixed"', d = s[I] ?? {}, p = l[I] !== !1, u = d.width ? ` width="${d.width}"` : "", m = p ? "" : ' style="display: none"', h = `
344
344
  <td width="120"
345
345
  class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
@@ -348,7 +348,7 @@ function ut(t, o) {
348
348
  data-visibility="${p ? "1" : "0"}"
349
349
  align="center" valign="middle"${m}>
350
350
  <a target="_blank" href="https://example.com/product/${t + 1}">
351
- <img src="${V}" alt="Product Name"
351
+ <img src="${Y}" alt="Product Name"
352
352
  class="adapt-img product-image"${u}
353
353
  style="display: block; max-width: 100%; height: auto">
354
354
  </a>
@@ -357,25 +357,25 @@ function ut(t, o) {
357
357
  <td class="product-info-cell" valign="middle" style="padding: 15px">
358
358
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%"
359
359
  style="table-layout: fixed">
360
- <tbody>${e.filter((P) => P !== I && P !== k).map((P) => {
361
- const B = l[P] !== !1, W = B ? "" : ' style="display: none"', tt = B ? "1" : "0", M = pt(P, s, n, o);
360
+ <tbody>${e.filter((P) => P !== I && P !== N).map((P) => {
361
+ const B = l[P] !== !1, tt = B ? "" : ' style="display: none"', et = B ? "1" : "0", M = ut(P, s, n, o);
362
362
  return M ? `<tr class="recommendation-attribute-row"
363
363
  data-attribute-type="${c(P)}"
364
- data-visibility="${tt}"${W}>${M}</tr>` : "";
364
+ data-visibility="${et}"${tt}>${M}</tr>` : "";
365
365
  }).filter(Boolean).join(`
366
366
  `)}</tbody>
367
367
  </table>
368
368
  </td>
369
- `, f = s[k] ?? {}, C = l[k] !== !1, S = f.text || F, x = $(J, f.spanStyle ?? ""), A = $(X, f.aStyle ?? ""), Q = C ? "" : ' style="display: none"', Z = `
369
+ `, f = s[N] ?? {}, C = l[N] !== !1, S = f.text || J, x = $(X, f.spanStyle ?? ""), A = $(K, f.aStyle ?? ""), Z = C ? "" : ' style="display: none"', W = `
370
370
  <td width="100"
371
371
  class="esd-block-button button-cell recommendation-attribute-row product-button es-p5l es-p5r"
372
372
  esd-extension-block-id="${g.BUTTON}"
373
- data-attribute-type="${k}"
373
+ data-attribute-type="${N}"
374
374
  data-visibility="${C ? "1" : "0"}"
375
- align="${c(f.align ?? "center")}" valign="middle"${Q}>
375
+ align="${c(f.align ?? "center")}" valign="middle"${Z}>
376
376
  <span class="es-button-border" style="${c(x)}">
377
377
  <a href="https://example.com/product/${t + 1}" target="_blank"
378
- class="es-button buy-button"
378
+ class="es-button ${z}"
379
379
  style="${c(A)}">${c(S)}</a>
380
380
  </span>
381
381
  </td>
@@ -386,20 +386,20 @@ function ut(t, o) {
386
386
  <table width="100%" cellpadding="0" cellspacing="0" border="0"
387
387
  class="product-card-wrapper" ${r}>
388
388
  <tbody>
389
- <tr>${h}${w}${Z}</tr>
389
+ <tr>${h}${w}${W}</tr>
390
390
  </tbody>
391
391
  </table>
392
392
  </td>
393
393
  </tr>
394
394
  `;
395
395
  }
396
- function bt(t, o) {
396
+ function gt(t, o) {
397
397
  const e = [];
398
398
  for (let l = 0; l < t; l += 1)
399
- l > 0 && e.push(q), e.push(ut(l, o));
399
+ l > 0 && e.push(Q), e.push(bt(l, o));
400
400
  return e.join("");
401
401
  }
402
- function gt(t, o) {
402
+ function mt(t, o) {
403
403
  var r, d, p, u, m, h;
404
404
  const e = t == null ? void 0 : t.theme, l = [];
405
405
  (r = e == null ? void 0 : e.textStyle) != null && r["font-family"] && l.push(`font-family: ${e.textStyle["font-family"]}`), l.push(`font-size: ${((d = e == null ? void 0 : e.textStyle) == null ? void 0 : d["font-size"]) ?? "28px"}`), l.push(`color: ${((p = e == null ? void 0 : e.textColor) == null ? void 0 : p.color) ?? "#333333"}`), (u = e == null ? void 0 : e.textStyle) != null && u["font-weight"] && l.push(`font-weight: ${e.textStyle["font-weight"]}`), (m = e == null ? void 0 : e.textStyle) != null && m["font-style"] && l.push(`font-style: ${e.textStyle["font-style"]}`);
@@ -410,11 +410,11 @@ function gt(t, o) {
410
410
  </td>
411
411
  `;
412
412
  }
413
- function mt(t) {
413
+ function $t(t) {
414
414
  const o = t.alignment === "before" ? "0" : "1";
415
415
  return ` ${R.CURRENCY}="${c(t.code)}" ${R.SYMBOL}="${c(t.symbol)}" ${R.ALIGNMENT}="${o}" ${R.THOUSAND_SEPARATOR}="${c(t.thousandSeparator)}" ${R.DECIMAL_SEPARATOR}="${c(t.decimalSeparator)}" ${R.DECIMAL_COUNT}="${t.decimalCount}"`;
416
416
  }
417
- function xt(t) {
417
+ function Tt(t) {
418
418
  const {
419
419
  nodeConfig: o,
420
420
  composition: e,
@@ -429,8 +429,8 @@ function xt(t) {
429
429
  perElement: e.perElementStyles,
430
430
  customAttrValues: e.customAttrValues,
431
431
  cardBg: l,
432
- ...at(o.currency)
433
- }, m = o.layout === "list" ? bt(r, u) : dt(r, o.cardsInRow, u), h = gt(e.titleVariable, s), T = e.composition.join(","), w = JSON.stringify(e.customAttributes), f = [
432
+ ...rt(o.currency)
433
+ }, m = o.layout === "list" ? gt(r, u) : pt(r, o.cardsInRow, u), h = mt(e.titleVariable, s), T = e.composition.join(","), w = JSON.stringify(e.customAttributes), f = [
434
434
  "recommendation-block-v2",
435
435
  "esd-block-recommendation-v3-block",
436
436
  `es-p20${p}`,
@@ -443,8 +443,8 @@ function xt(t) {
443
443
  "esd-container-frame",
444
444
  "ins-recommendation-no-mobile-layout",
445
445
  n
446
- ].filter(Boolean).join(" "), C = mt(o.currency), S = ` esd-ext-config="${c(JSON.stringify(o))}"`, x = i ? ` id="${c(i)}"` : "", A = a ? ` bgcolor="${c(a)}"` : "";
447
- return ot(`
446
+ ].filter(Boolean).join(" "), C = $t(o.currency), S = ` esd-ext-config="${c(JSON.stringify(o))}"`, x = i ? ` id="${c(i)}"` : "", A = a ? ` bgcolor="${c(a)}"` : "";
447
+ return nt(`
448
448
  <td align="left"
449
449
  esd-extension-block-id="recommendation-block"
450
450
  width="520"
@@ -477,7 +477,7 @@ function xt(t) {
477
477
  <tr>
478
478
  <td>
479
479
  <table width="100%" cellpadding="0" cellspacing="0" border="0"
480
- class="${et}">${m}
480
+ class="${ot}">${m}
481
481
  </table>
482
482
  </td>
483
483
  </tr>
@@ -492,5 +492,5 @@ function xt(t) {
492
492
  `);
493
493
  }
494
494
  export {
495
- xt as buildBlockHtml
495
+ Tt as buildBlockHtml
496
496
  };
@@ -1,7 +1,7 @@
1
1
  var k = Object.defineProperty;
2
- var _ = (r, n, t) => n in r ? k(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
3
- var g = (r, n, t) => _(r, typeof n != "symbol" ? n + "" : n, t);
4
- import { BlockId as B } from "../../../enums/block.js";
2
+ var B = (r, n, t) => n in r ? k(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
3
+ var g = (r, n, t) => B(r, typeof n != "symbol" ? n + "" : n, t);
4
+ import { BlockId as _ } from "../../../enums/block.js";
5
5
  import { getMigrationBannerHtml as b } from "../../../utils/migrationBannerHtml.js";
6
6
  import { Block as R, BlockCompositionType as y, ModificationDescription as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
7
  import { regenerateMobileProductRows as A } from "./controls/main/utils.js";
@@ -9,9 +9,9 @@ import { ensureMobileCssRulesExist as d, setMobileLayoutOptOut as p, hasMobileLa
9
9
  import { RecommendationConfigService as s } from "./services/configService.js";
10
10
  import { useRecommendationExtensionStore as f } from "./store/recommendation.js";
11
11
  import { getDefaultTemplate as E } from "./templates/grid/template.js";
12
- const h = B.Recommendation, l = "recommendation-block-v2", m = "recommendation-id";
12
+ const h = _.Recommendation, l = "recommendation-block-v2", m = "recommendation-id";
13
13
  let I = !1;
14
- class v extends R {
14
+ class q extends R {
15
15
  constructor() {
16
16
  super();
17
17
  /**
@@ -47,6 +47,9 @@ class v extends R {
47
47
  allowInnerBlocksDND() {
48
48
  return !1;
49
49
  }
50
+ canBeSavedAsModule() {
51
+ return !1;
52
+ }
50
53
  /**
51
54
  * Returns the template HTML for a new recommendation block.
52
55
  * Generates a unique recommendation ID and embeds the instance class
@@ -190,5 +193,5 @@ class v extends R {
190
193
  }
191
194
  export {
192
195
  h as BLOCK_ID,
193
- v as RecommendationBlock
196
+ q as RecommendationBlock
194
197
  };
@@ -1,11 +1,11 @@
1
- const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container", o = ".ins-recommendation-desktop-container", n = ".ins-recommendation-mobile-container", t = ".ins-recommendation-mobile-row", r = {
1
+ const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container", o = ".ins-recommendation-desktop-container", n = ".ins-recommendation-mobile-container", t = ".ins-recommendation-mobile-row", r = "reco-v3-button", _ = {
2
2
  CURRENCY: "currency",
3
3
  SYMBOL: "currency-symbol",
4
4
  ALIGNMENT: "currency-alignment",
5
5
  THOUSAND_SEPARATOR: "currency-thousand-separator",
6
6
  DECIMAL_SEPARATOR: "currency-decimal-separator",
7
7
  DECIMAL_COUNT: "currency-decimal-count"
8
- }, R = "productImage", _ = "productName", e = "productPrice", O = "productOldPrice", s = "productOmnibusPrice", i = "productOmnibusDiscount", E = "productButton", A = "customAttr:", C = "data-custom-attributes", u = "product-attr", m = /* @__PURE__ */ new Set([
8
+ }, R = "productImage", e = "productName", O = "productPrice", s = "productOldPrice", i = "productOmnibusPrice", C = "productOmnibusDiscount", E = "productButton", A = "customAttr:", u = "data-custom-attributes", m = "product-attr", a = /* @__PURE__ */ new Set([
9
9
  "name",
10
10
  // productName
11
11
  "price",
@@ -23,19 +23,20 @@ const T = ".recommendation-block-v2", c = ".ins-recommendation-product-container
23
23
  ]);
24
24
  export {
25
25
  A as ATTR_CUSTOM_PREFIX,
26
- C as ATTR_DATA_CUSTOM_ATTRIBUTES,
27
- u as ATTR_PRODUCT_ATTR,
26
+ u as ATTR_DATA_CUSTOM_ATTRIBUTES,
27
+ m as ATTR_PRODUCT_ATTR,
28
28
  E as ATTR_PRODUCT_BUTTON,
29
29
  R as ATTR_PRODUCT_IMAGE,
30
- _ as ATTR_PRODUCT_NAME,
31
- O as ATTR_PRODUCT_OLD_PRICE,
32
- i as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
33
- s as ATTR_PRODUCT_OMNIBUS_PRICE,
34
- e as ATTR_PRODUCT_PRICE,
30
+ e as ATTR_PRODUCT_NAME,
31
+ s as ATTR_PRODUCT_OLD_PRICE,
32
+ C as ATTR_PRODUCT_OMNIBUS_DISCOUNT,
33
+ i as ATTR_PRODUCT_OMNIBUS_PRICE,
34
+ O as ATTR_PRODUCT_PRICE,
35
35
  T as BLOCK_ROOT_SELECTOR,
36
- m as BUILT_IN_DEFAULT_ATTRIBUTES,
36
+ a as BUILT_IN_DEFAULT_ATTRIBUTES,
37
37
  c as CONTAINER_SELECTOR,
38
- r as CURRENCY_ATTR,
38
+ r as CSS_CLASS_RECO_BUTTON,
39
+ _ as CURRENCY_ATTR,
39
40
  o as DESKTOP_CONTAINER_SELECTOR,
40
41
  n as MOBILE_CONTAINER_SELECTOR,
41
42
  t as MOBILE_ROW_SELECTOR
@@ -1,11 +1,11 @@
1
1
  import { RecommendationBlockId as s } from "../../constants/blockIds.js";
2
- import { ATTR_PRODUCT_ATTR as b, ATTR_PRODUCT_BUTTON as u, ATTR_PRODUCT_OMNIBUS_DISCOUNT as m, ATTR_PRODUCT_OMNIBUS_PRICE as h, ATTR_PRODUCT_OLD_PRICE as y, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as f, ATTR_PRODUCT_IMAGE as x } from "../../constants/selectors.js";
3
- import { useRecommendationExtensionStore as _ } from "../../store/recommendation.js";
4
- import { formatPrice as $ } from "../../utils/priceFormatter.js";
5
- import { CUSTOM_CELL_HTML as C, sanitizeImageUrl as R } from "../utils.js";
2
+ import { ATTR_PRODUCT_ATTR as b, CSS_CLASS_RECO_BUTTON as u, ATTR_PRODUCT_BUTTON as m, ATTR_PRODUCT_OMNIBUS_DISCOUNT as h, ATTR_PRODUCT_OMNIBUS_PRICE as y, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as f, ATTR_PRODUCT_NAME as _, ATTR_PRODUCT_IMAGE as x } from "../../constants/selectors.js";
3
+ import { useRecommendationExtensionStore as $ } from "../../store/recommendation.js";
4
+ import { formatPrice as C } from "../../utils/priceFormatter.js";
5
+ import { CUSTOM_CELL_HTML as R, sanitizeImageUrl as O } from "../utils.js";
6
6
  const a = "0 5px", l = "attribute-cell";
7
7
  function p() {
8
- const t = _(), { currencySettings: e } = t.recommendationConfigs;
8
+ const t = $(), { currencySettings: e } = t.recommendationConfigs;
9
9
  return {
10
10
  code: e.value,
11
11
  symbol: e.symbol,
@@ -17,12 +17,12 @@ function p() {
17
17
  }
18
18
  function i(t, e = "price") {
19
19
  const o = p(), n = t[e], d = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
20
- return $({
20
+ return C({
21
21
  price: d,
22
22
  currency: o
23
23
  });
24
24
  }
25
- const I = {
25
+ const S = {
26
26
  [x]: (t) => `
27
27
  <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
28
28
  <table
@@ -40,7 +40,7 @@ const I = {
40
40
  esd-extension-block-id="${s.IMAGE}">
41
41
  <a target="_blank" href="${t.url}">
42
42
  <img
43
- src="${R(t.image_url)}"
43
+ src="${O(t.image_url)}"
44
44
  alt="${t.name}"
45
45
  style="display: block; max-width: 100%; height: auto;"
46
46
  class="adapt-img">
@@ -51,7 +51,7 @@ const I = {
51
51
  </table>
52
52
  </td>
53
53
  `,
54
- [f]: (t) => `
54
+ [_]: (t) => `
55
55
  <td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
56
56
  <table
57
57
  class="product-card-segment"
@@ -76,7 +76,7 @@ const I = {
76
76
  </table>
77
77
  </td>
78
78
  `,
79
- [T]: (t) => `
79
+ [f]: (t) => `
80
80
  <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
81
81
  <table
82
82
  class="product-card-segment"
@@ -100,7 +100,7 @@ const I = {
100
100
  </table>
101
101
  </td>
102
102
  `,
103
- [y]: (t) => `
103
+ [T]: (t) => `
104
104
  <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
105
105
  <table
106
106
  class="product-card-segment"
@@ -124,7 +124,7 @@ const I = {
124
124
  </table>
125
125
  </td>
126
126
  `,
127
- [h]: (t) => `
127
+ [y]: (t) => `
128
128
  <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
129
129
  <table
130
130
  class="product-card-segment"
@@ -152,7 +152,7 @@ const I = {
152
152
  </table>
153
153
  </td>
154
154
  `,
155
- [m]: (t) => {
155
+ [h]: (t) => {
156
156
  var r, c;
157
157
  const e = p(), o = ((r = t.original_price) == null ? void 0 : r[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, n = ((c = t.price) == null ? void 0 : c[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, d = o > 0 ? Math.round((o - n) / o * 100) : 0, g = d > 0 ? `-${d}%` : "0%";
158
158
  return `
@@ -184,7 +184,7 @@ const I = {
184
184
  </td>
185
185
  `;
186
186
  },
187
- [u]: () => `
187
+ [m]: () => `
188
188
  <td class="${l}" style="padding: ${a}; height: 100%;" valign="top">
189
189
  <table
190
190
  class="product-card-segment"
@@ -208,7 +208,7 @@ const I = {
208
208
  ">
209
209
  <a
210
210
  href="#"
211
- class="es-button buy-button"
211
+ class="es-button ${u}"
212
212
  target="_blank"
213
213
  style="
214
214
  color: rgb(56, 118, 29);
@@ -236,7 +236,7 @@ const I = {
236
236
  * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
237
237
  * @param content - Display content for the cell
238
238
  */
239
- [C]: (t, e) => `
239
+ [R]: (t, e) => `
240
240
  <td class="${l}" style="padding: ${a}; height: 100%;" valign="middle">
241
241
  <table
242
242
  class="product-card-segment"
@@ -264,5 +264,5 @@ const I = {
264
264
  export {
265
265
  l as ATTRIBUTE_CELL_CLASS,
266
266
  a as DEFAULT_CELL_PADDING,
267
- I as gridElementRenderer
267
+ S as gridElementRenderer
268
268
  };
@@ -1,10 +1,10 @@
1
1
  import { RecommendationBlockId as o } from "../../constants/blockIds.js";
2
- import { ATTR_PRODUCT_ATTR as m, ATTR_PRODUCT_BUTTON as c, ATTR_PRODUCT_IMAGE as d, ATTR_PRODUCT_OMNIBUS_DISCOUNT as u, ATTR_PRODUCT_OMNIBUS_PRICE as g, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as x } from "../../constants/selectors.js";
3
- import { useRecommendationExtensionStore as _ } from "../../store/recommendation.js";
2
+ import { ATTR_PRODUCT_ATTR as m, ATTR_PRODUCT_BUTTON as c, CSS_CLASS_RECO_BUTTON as u, ATTR_PRODUCT_IMAGE as d, ATTR_PRODUCT_OMNIBUS_DISCOUNT as g, ATTR_PRODUCT_OMNIBUS_PRICE as f, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as x, ATTR_PRODUCT_NAME as _ } from "../../constants/selectors.js";
3
+ import { useRecommendationExtensionStore as C } from "../../store/recommendation.js";
4
4
  import { formatPrice as R } from "../../utils/priceFormatter.js";
5
- import { CUSTOM_CELL_HTML as y, sanitizeImageUrl as C } from "../utils.js";
5
+ import { CUSTOM_CELL_HTML as O, sanitizeImageUrl as y } from "../utils.js";
6
6
  function p() {
7
- const t = _(), { currencySettings: e } = t.recommendationConfigs;
7
+ const t = C(), { currencySettings: e } = t.recommendationConfigs;
8
8
  return {
9
9
  code: e.value,
10
10
  symbol: e.symbol,
@@ -21,7 +21,7 @@ function s(t, e = "price") {
21
21
  currency: n
22
22
  });
23
23
  }
24
- const U = {
24
+ const I = {
25
25
  /**
26
26
  * Image cell - left column (120px fixed width)
27
27
  * Has recommendation-attribute-row class and data attributes for Card Composition control
@@ -37,7 +37,7 @@ const U = {
37
37
  valign="middle">
38
38
  <a target="_blank" href="${t.url}">
39
39
  <img
40
- src="${C(t.image_url)}"
40
+ src="${y(t.image_url)}"
41
41
  alt="${t.name}"
42
42
  style="display: block; max-width: 100%; height: auto;"
43
43
  class="adapt-img product-image">
@@ -47,7 +47,7 @@ const U = {
47
47
  /**
48
48
  * Name element - row for info cell table
49
49
  */
50
- [x]: (t) => `
50
+ [_]: (t) => `
51
51
  <tr>
52
52
  <td
53
53
  class="esd-block-text product-name"
@@ -62,7 +62,7 @@ const U = {
62
62
  /**
63
63
  * Price element - row for info cell table
64
64
  */
65
- [T]: (t) => `
65
+ [x]: (t) => `
66
66
  <tr>
67
67
  <td
68
68
  class="esd-block-text product-price"
@@ -77,7 +77,7 @@ const U = {
77
77
  /**
78
78
  * Old price element - row for info cell table
79
79
  */
80
- [f]: (t) => `
80
+ [T]: (t) => `
81
81
  <tr>
82
82
  <td
83
83
  class="esd-block-text product-old-price"
@@ -94,7 +94,7 @@ const U = {
94
94
  /**
95
95
  * Omnibus price element - row for info cell table
96
96
  */
97
- [g]: (t) => `
97
+ [f]: (t) => `
98
98
  <tr>
99
99
  <td
100
100
  class="esd-block-text product-omnibus-price"
@@ -113,7 +113,7 @@ const U = {
113
113
  /**
114
114
  * Omnibus discount element - row for info cell table
115
115
  */
116
- [u]: (t) => {
116
+ [g]: (t) => {
117
117
  var i, l;
118
118
  const e = p(), n = ((i = t.original_price) == null ? void 0 : i[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, a = ((l = t.price) == null ? void 0 : l[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = n > 0 ? Math.round((n - a) / n * 100) : 0, b = r > 0 ? `-${r}%` : "0%";
119
119
  return `
@@ -156,7 +156,7 @@ const U = {
156
156
  <a
157
157
  href="${t.url}"
158
158
  target="_blank"
159
- class="es-button buy-button"
159
+ class="es-button ${u}"
160
160
  style="
161
161
  color: rgb(56, 118, 29);
162
162
  background: rgb(217, 234, 211);
@@ -179,7 +179,7 @@ const U = {
179
179
  * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
180
180
  * @param content - Display content for the cell
181
181
  */
182
- [y]: (t, e) => `
182
+ [O]: (t, e) => `
183
183
  <tr>
184
184
  <td
185
185
  ${m}="${t}"
@@ -192,5 +192,5 @@ const U = {
192
192
  `
193
193
  };
194
194
  export {
195
- U as listElementRenderer
195
+ I as listElementRenderer
196
196
  };
@@ -14,7 +14,7 @@ function y(t) {
14
14
  return "";
15
15
  const o = t.sort((r, e) => r.filterNumber - e.filterNumber), u = o.map((r) => {
16
16
  const e = r.operator === l, a = e ? "=" : r.operator, c = e ? f(r.value).join(l) : r.value;
17
- return `[${r.attribute}][${a}][${c}]`;
17
+ return `[${r.attribute}][${encodeURIComponent(a)}][${c}]`;
18
18
  }), [i, ...p] = u;
19
19
  let n = i;
20
20
  for (let r = 0; r < p.length; r++) {
@@ -23,7 +23,7 @@ function y(t) {
23
23
  }
24
24
  return `(${n})`;
25
25
  }
26
- function Q(t) {
26
+ function g(t) {
27
27
  if (!t || t.length === 0)
28
28
  return "";
29
29
  const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), u = Object.keys(o).map(Number).sort((r, e) => r - e), i = u.map((r) => {
@@ -38,7 +38,7 @@ function Q(t) {
38
38
  return s.trim();
39
39
  }
40
40
  export {
41
- Q as generateCompleteFilterQuery,
41
+ g as generateCompleteFilterQuery,
42
42
  f as parseTagList,
43
43
  m as safeDecodeURIComponent
44
44
  };
@@ -1,4 +1,4 @@
1
- const l = [
1
+ const o = [
2
2
  {
3
3
  key: "locale",
4
4
  getValue: (e) => e.language,
@@ -9,9 +9,9 @@ const l = [
9
9
  getValue: (e) => e.currencySettings.value,
10
10
  getAvailableOptions: (e) => e.currencyList.map((n) => n.text)
11
11
  }
12
- ], u = "newsletter.recommendation-fill-required-fields";
13
- function o(e, n) {
14
- return l.filter((t) => {
12
+ ], l = "newsletter.recommendation-fill-required-fields";
13
+ function u(e, n) {
14
+ return o.filter((t) => {
15
15
  var a;
16
16
  if (t.condition && !t.condition(e))
17
17
  return !1;
@@ -19,15 +19,15 @@ function o(e, n) {
19
19
  if (!i)
20
20
  return !0;
21
21
  const r = (a = t.getAvailableOptions) == null ? void 0 : a.call(t, n);
22
- return r === void 0 || r.length === 0 ? !1 : !r.includes(i);
22
+ return r !== void 0 && !r.includes(i);
23
23
  }).map((t) => t.key);
24
24
  }
25
25
  function s(e, n) {
26
- return o(e, n).length === 0;
26
+ return u(e, n).length === 0;
27
27
  }
28
28
  export {
29
- l as REQUIRED_RECOMMENDATION_FIELDS,
30
- u as RecommendationRequiredFieldsKey,
31
- o as getInvalidFields,
29
+ o as REQUIRED_RECOMMENDATION_FIELDS,
30
+ l as RecommendationRequiredFieldsKey,
31
+ u as getInvalidFields,
32
32
  s as isConfigValid
33
33
  };
@@ -23,6 +23,7 @@ export declare class RecommendationBlock extends Block {
23
23
  getDescription(): string;
24
24
  getSettingsPanelTitleHtml(): string;
25
25
  allowInnerBlocksDND(): boolean;
26
+ canBeSavedAsModule(): boolean;
26
27
  /**
27
28
  * Returns the template HTML for a new recommendation block.
28
29
  * Generates a unique recommendation ID and embeds the instance class
@@ -8,6 +8,6 @@
8
8
  */
9
9
  export { RecommendationBlockId } from './blockIds';
10
10
  export { RecommendationControlId } from './controlIds';
11
- export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_CUSTOM_PREFIX, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
11
+ export { BLOCK_ROOT_SELECTOR, CONTAINER_SELECTOR, DESKTOP_CONTAINER_SELECTOR, MOBILE_CONTAINER_SELECTOR, MOBILE_ROW_SELECTOR, CSS_CLASS_RECO_BUTTON, CURRENCY_ATTR, ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON, ATTR_CUSTOM_PREFIX, ATTR_DATA_CUSTOM_ATTRIBUTES, ATTR_PRODUCT_ATTR, BUILT_IN_DEFAULT_ATTRIBUTES, } from './selectors';
12
12
  export { LAYOUT_VALUES, LAYOUT_OPTIONS, DEFAULT_PRODUCTS_PER_ROW, DEFAULT_CARDS_IN_ROW, DEFAULT_MOBILE_CARDS_IN_ROW, MAX_PRODUCT_COUNT, MIN_PRODUCT_COUNT, MAX_PRODUCTS_PER_ROW, MIN_PRODUCTS_PER_ROW, MAX_MOBILE_PRODUCTS_PER_ROW, MIN_MOBILE_PRODUCTS_PER_ROW, DEFAULT_COLUMN_SPACING, DEFAULT_ROW_SPACING, DEFAULT_MOBILE_COLUMN_SPACING, DEFAULT_MOBILE_ROW_SPACING, MIN_SPACING, MAX_SPACING, SPACING_STEP, } from './layout';
13
13
  export { DEFAULT_NODE_CONFIG, DEFAULT_CURRENCY, DEFAULT_COMPOSITION, DEFAULT_VISIBILITY, CURRENT_CONFIG_VERSION, EXCLUDED_ALGORITHM_IDS, } from './defaultConfig';
@@ -17,6 +17,12 @@ export declare const DESKTOP_CONTAINER_SELECTOR = ".ins-recommendation-desktop-c
17
17
  export declare const MOBILE_CONTAINER_SELECTOR = ".ins-recommendation-mobile-container";
18
18
  /** Mobile row wrapper — the <tr> that wraps the mobile container <td>/<table> */
19
19
  export declare const MOBILE_ROW_SELECTOR = ".ins-recommendation-mobile-row";
20
+ /**
21
+ * Stable class on the recommendation product button anchor. Survives export
22
+ * and is the anchor selector the compiler uses to swap `href` with the
23
+ * `{{cId_pIdx_url}}` template variable.
24
+ */
25
+ export declare const CSS_CLASS_RECO_BUTTON = "reco-v3-button";
20
26
  /**
21
27
  * Currency HTML attributes set on the block element
22
28
  * These are read by the HTML compiler at runtime to format prices
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.4.0-beta.5d19726",
3
+ "version": "3.4.1-beta.4c96ad0",
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",