@useinsider/guido 3.30.0 → 3.30.1-beta.c6a213b

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.
Files changed (29) hide show
  1. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +11 -16
  2. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -11
  3. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -51
  4. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
  5. package/dist/composables/useExport.js +8 -7
  6. package/dist/composables/useHtmlValidator.js +102 -100
  7. package/dist/composables/useToaster.js +11 -10
  8. package/dist/composables/useVersionHistoryApi.js +22 -21
  9. package/dist/composables/validators/useLiquidValidator.js +26 -24
  10. package/dist/config/migrator/itemsBlockMigrator.js +164 -161
  11. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +148 -141
  12. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +53 -53
  13. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +40 -39
  14. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -26
  15. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +33 -32
  16. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +23 -22
  17. package/dist/extensions/Blocks/Recommendation/templates/utils.js +79 -78
  18. package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +50 -41
  19. package/dist/guido.css +1 -1
  20. package/dist/package.json.js +2 -2
  21. package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +2 -0
  22. package/dist/src/stores/preview.d.ts +3 -0
  23. package/dist/src/utils/ampPreviewSanitizer.d.ts +5 -0
  24. package/dist/src/utils/htmlEscape.d.ts +5 -0
  25. package/dist/stores/preview.js +21 -15
  26. package/dist/utils/ampPreviewSanitizer.js +46 -0
  27. package/dist/utils/htmlEscape.js +5 -1
  28. package/dist/utils/pairProductVariables.js +98 -108
  29. package/package.json +1 -1
@@ -1,7 +1,8 @@
1
+ import { escapeHtml as U } from "../../../../../utils/htmlEscape.js";
1
2
  import { RecommendationBlockId as t } from "../../constants/blockIds.js";
2
- import { ATTR_PRODUCT_ATTR as U, ATTR_PRODUCT_BUTTON as x, CSS_CLASS_RECO_BUTTON as y, ATTR_PRODUCT_OMNIBUS_DISCOUNT as E, ATTR_PRODUCT_OMNIBUS_PRICE as B, ATTR_PRODUCT_OLD_PRICE as I, ATTR_PRODUCT_PRICE as L, ATTR_PRODUCT_NAME as D, ATTR_PRODUCT_IMAGE as R } from "../../constants/selectors.js";
3
- import { formatProductPrice as m, bgColorFragment as f, renderStyledParagraph as T, CUSTOM_CELL_HTML as P, cellBgStyleAttr as $, DEFAULT_BUTTON_BORDER_STYLE as h, renderButtonLabel as N, DEFAULT_BUTTON_ANCHOR_STYLE as v, resolveButtonBorderClass as M, resolvePStyle as A, getCurrentCurrencyConfig as w, resolveOmnibusText as S, isSamePrice as z, DEFAULT_IMG_STYLE as F, sanitizeImageUrl as G } from "../utils.js";
4
- const H = `${v} padding: 5px 30px;`, k = {
3
+ import { ATTR_PRODUCT_ATTR as E, ATTR_PRODUCT_BUTTON as x, CSS_CLASS_RECO_BUTTON as f, ATTR_PRODUCT_OMNIBUS_DISCOUNT as B, ATTR_PRODUCT_OMNIBUS_PRICE as I, ATTR_PRODUCT_OLD_PRICE as L, ATTR_PRODUCT_PRICE as D, ATTR_PRODUCT_NAME as P, ATTR_PRODUCT_IMAGE as y } from "../../constants/selectors.js";
4
+ import { formatProductPrice as u, bgColorFragment as R, renderStyledParagraph as T, CUSTOM_CELL_HTML as h, cellBgStyleAttr as $, DEFAULT_BUTTON_BORDER_STYLE as N, renderButtonLabel as v, DEFAULT_BUTTON_ANCHOR_STYLE as M, resolveButtonBorderClass as w, resolvePStyle as A, getCurrentCurrencyConfig as z, resolveOmnibusText as S, isSamePrice as H, DEFAULT_IMG_STYLE as F, sanitizeImageUrl as G } from "../utils.js";
5
+ const O = `${M} padding: 5px 30px;`, k = {
5
6
  pStyle: "font-size: 16px; color: #333333; font-weight: bold; margin: 0;",
6
7
  openTags: "<strong>",
7
8
  closeTags: "</strong>"
@@ -10,23 +11,23 @@ const H = `${v} padding: 5px 30px;`, k = {
10
11
  openTags: "<s><strong>",
11
12
  closeTags: "</strong></s>"
12
13
  };
13
- function q(a, e = !0, l, r) {
14
- const c = m(a, "price"), d = m(a, "original_price"), b = c === d, s = (g) => `<td
14
+ function K(a, e = !0, l, r) {
15
+ const c = u(a, "price"), d = u(a, "original_price"), b = c === d, s = (g) => `<td
15
16
  class="esd-block-text product-price"
16
17
  esd-extension-block-id="${t.PRICE}"
17
18
  align="${(l == null ? void 0 : l.cellAlignment) ?? "left"}"
18
19
  valign="middle"
19
- style="width: auto;${g}${f(l == null ? void 0 : l.cellBackgroundColor)}">
20
+ style="width: auto;${g}${R(l == null ? void 0 : l.cellBackgroundColor)}">
20
21
  ${T(c, k, l == null ? void 0 : l.styleTemplate)}
21
- </td>`, u = (g) => `<td
22
+ </td>`, m = (g) => `<td
22
23
  class="esd-block-text product-old-price"
23
24
  esd-extension-block-id="${t.OLD_PRICE}"
24
25
  data-same-price="${b}"
25
26
  align="${(r == null ? void 0 : r.cellAlignment) ?? "left"}"
26
27
  valign="middle"
27
- style="width: auto;${g}${f(r == null ? void 0 : r.cellBackgroundColor)}">
28
+ style="width: auto;${g}${R(r == null ? void 0 : r.cellBackgroundColor)}">
28
29
  ${T(d, n, r == null ? void 0 : r.styleTemplate)}
29
- </td>`, C = e ? u(" padding-right: 8px;") : s(" padding-right: 8px;"), _ = e ? s("") : u("");
30
+ </td>`, C = e ? m(" padding-right: 8px;") : s(" padding-right: 8px;"), _ = e ? s("") : m("");
30
31
  return `
31
32
  <tr>
32
33
  ${C}
@@ -34,12 +35,12 @@ function q(a, e = !0, l, r) {
34
35
  </tr>
35
36
  `;
36
37
  }
37
- const J = {
38
+ const Q = {
38
39
  /**
39
40
  * Image cell - left column (120px fixed width)
40
41
  * Has recommendation-attribute-row class and data attributes for Card Composition control
41
42
  */
42
- [R]: (a, e) => {
43
+ [y]: (a, e) => {
43
44
  var r;
44
45
  const l = ((r = e == null ? void 0 : e.styleTemplate) == null ? void 0 : r.imgStyle) ?? F;
45
46
  return `
@@ -47,11 +48,11 @@ const J = {
47
48
  width="120"
48
49
  class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
49
50
  esd-extension-block-id="${t.IMAGE}"
50
- data-attribute-type="${R}"
51
+ data-attribute-type="${y}"
51
52
  data-visibility="1"
52
53
  align="center"
53
54
  valign="middle">
54
- <a target="_blank" href="${a.url}" class="${y}">
55
+ <a target="_blank" href="${a.url}" class="${f}">
55
56
  <img
56
57
  src="${G(a.image_url)}"
57
58
  alt="${a.name}"
@@ -64,7 +65,7 @@ const J = {
64
65
  /**
65
66
  * Name element - row for info cell table
66
67
  */
67
- [D]: (a, e) => {
68
+ [P]: (a, e) => {
68
69
  const l = T(
69
70
  a.name,
70
71
  {
@@ -88,9 +89,9 @@ const J = {
88
89
  /**
89
90
  * Price element - row for info cell table
90
91
  */
91
- [L]: (a, e) => {
92
+ [D]: (a, e) => {
92
93
  const l = T(
93
- m(a, "price"),
94
+ u(a, "price"),
94
95
  k,
95
96
  e == null ? void 0 : e.styleTemplate
96
97
  );
@@ -108,9 +109,9 @@ const J = {
108
109
  /**
109
110
  * Old price element - row for info cell table
110
111
  */
111
- [I]: (a, e) => {
112
+ [L]: (a, e) => {
112
113
  const l = T(
113
- m(a, "original_price"),
114
+ u(a, "original_price"),
114
115
  n,
115
116
  e == null ? void 0 : e.styleTemplate
116
117
  );
@@ -119,7 +120,7 @@ const J = {
119
120
  <td
120
121
  class="esd-block-text product-old-price${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
121
122
  esd-extension-block-id="${t.OLD_PRICE}"
122
- data-same-price="${z(a)}"${$(e == null ? void 0 : e.cellBackgroundColor)}
123
+ data-same-price="${H(a)}"${$(e == null ? void 0 : e.cellBackgroundColor)}
123
124
  align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
124
125
  ${l}
125
126
  </td>
@@ -129,7 +130,7 @@ const J = {
129
130
  /**
130
131
  * Omnibus price element - row for info cell table
131
132
  */
132
- [B]: (a, e) => {
133
+ [I]: (a, e) => {
133
134
  const l = A("font-size: 12px; color: #666666; margin: 0;", e == null ? void 0 : e.styleTemplate), { before: r, after: c } = S(e == null ? void 0 : e.omnibusText, "Lowest 30-day price: ");
134
135
  return `
135
136
  <tr>
@@ -141,7 +142,7 @@ const J = {
141
142
  align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
142
143
  <p contenteditable="false" style="${l}">
143
144
  <span class="omnibus-text-before">${r}</span>
144
- <span class="omnibus-price-value">${m(a, "original_price")}</span>
145
+ <span class="omnibus-price-value">${u(a, "original_price")}</span>
145
146
  <span class="omnibus-text-after">${c}</span>
146
147
  </p>
147
148
  </td>
@@ -151,19 +152,19 @@ const J = {
151
152
  /**
152
153
  * Omnibus discount element - row for info cell table
153
154
  */
154
- [E]: (a, e) => {
155
+ [B]: (a, e) => {
155
156
  var _, g;
156
- const l = A("font-size: 12px; color: #666666; margin: 0;", e == null ? void 0 : e.styleTemplate), r = w(), c = ((_ = a.original_price) == null ? void 0 : _[r.code]) ?? Object.values(a.original_price ?? {})[0] ?? 0, d = ((g = a.price) == null ? void 0 : g[r.code]) ?? Object.values(a.price ?? {})[0] ?? 0, b = c > 0 ? Math.round((c - d) / c * 100) : 0, s = b > 0 ? `-${b}%` : "0%", { before: u, after: C } = S(e == null ? void 0 : e.omnibusText);
157
+ const l = A("font-size: 12px; color: #666666; margin: 0;", e == null ? void 0 : e.styleTemplate), r = z(), c = ((_ = a.original_price) == null ? void 0 : _[r.code]) ?? Object.values(a.original_price ?? {})[0] ?? 0, d = ((g = a.price) == null ? void 0 : g[r.code]) ?? Object.values(a.price ?? {})[0] ?? 0, b = c > 0 ? Math.round((c - d) / c * 100) : 0, s = b > 0 ? `-${b}%` : "0%", { before: m, after: C } = S(e == null ? void 0 : e.omnibusText);
157
158
  return `
158
159
  <tr>
159
160
  <td
160
161
  class="esd-block-text product-omnibus-discount${e != null && e.cellClasses ? ` ${e.cellClasses}` : ""}"
161
- data-text-before="${u}"
162
+ data-text-before="${m}"
162
163
  data-text-after="${C}"
163
164
  esd-extension-block-id="${t.OMNIBUS_DISCOUNT}"${$(e == null ? void 0 : e.cellBackgroundColor)}
164
165
  align="${(e == null ? void 0 : e.cellAlignment) ?? "left"}">
165
166
  <p contenteditable="false" style="${l}">
166
- <span class="omnibus-text-before">${u}</span>
167
+ <span class="omnibus-text-before">${m}</span>
167
168
  <span class="omnibus-discount-value">${s}</span>
168
169
  <span class="omnibus-text-after">${C}</span>
169
170
  </p>
@@ -176,7 +177,7 @@ const J = {
176
177
  * Has recommendation-attribute-row class and data attributes for Card Composition control
177
178
  */
178
179
  [x]: (a, e) => {
179
- const l = e == null ? void 0 : e.styleTemplate, r = (l == null ? void 0 : l.buttonBorderStyle) ?? h, c = (l == null ? void 0 : l.buttonAnchorStyle) ?? H, d = N((l == null ? void 0 : l.buttonText) ?? "Buy", l);
180
+ const l = e == null ? void 0 : e.styleTemplate, r = (l == null ? void 0 : l.buttonBorderStyle) ?? N, c = (l == null ? void 0 : l.buttonAnchorStyle) ?? O, d = v((l == null ? void 0 : l.buttonText) ?? "Buy", l);
180
181
  return `
181
182
  <td
182
183
  width="100"
@@ -186,11 +187,11 @@ const J = {
186
187
  data-visibility="1"
187
188
  align="${(e == null ? void 0 : e.cellAlignment) ?? "center"}"
188
189
  valign="middle">
189
- <span class="${M(l)}" style="${r}">
190
+ <span class="${w(l)}" style="${r}">
190
191
  <a
191
192
  href="${a.url}"
192
193
  target="_blank"
193
- class="es-button ${y}"
194
+ class="es-button ${f}"
194
195
  style="${c}">
195
196
  ${d}
196
197
  </a>
@@ -204,7 +205,7 @@ const J = {
204
205
  * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
205
206
  * @param content - Display content for the cell
206
207
  */
207
- [P]: (a, e, l) => {
208
+ [h]: (a, e, l) => {
208
209
  const r = T(
209
210
  e,
210
211
  { pStyle: "font-size: 12px; color: #666666; margin: 0;", openTags: "", closeTags: "" },
@@ -213,7 +214,7 @@ const J = {
213
214
  return `
214
215
  <tr>
215
216
  <td
216
- ${U}="${a}"
217
+ ${E}="${U(a)}"
217
218
  class="esd-block-text product-custom-attribute${l != null && l.cellClasses ? ` ${l.cellClasses}` : ""}"
218
219
  esd-extension-block-id="${t.CUSTOM_ATTRIBUTE}"${$(l == null ? void 0 : l.cellBackgroundColor)}
219
220
  align="${(l == null ? void 0 : l.cellAlignment) ?? "left"}">
@@ -224,6 +225,6 @@ const J = {
224
225
  }
225
226
  };
226
227
  export {
227
- J as listElementRenderer,
228
- q as renderInlineListPriceRow
228
+ Q as listElementRenderer,
229
+ K as renderInlineListPriceRow
229
230
  };
@@ -1,16 +1,17 @@
1
- import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as m } from "../../constants/selectors.js";
2
- import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as i, DEFAULT_CARD_VISIBILITY as w } from "../utils.js";
3
- import { listElementRenderer as y, renderInlineListPriceRow as L } from "./elementRenderer.js";
4
- import { resolveInlinePriceOrder as O } from "../../utils/inlinePriceOrder.js";
5
- const S = "0 5px";
6
- function U(l, r, n) {
1
+ import { escapeHtml as m } from "../../../../../utils/htmlEscape.js";
2
+ import { ATTR_PRODUCT_IMAGE as R, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as I } from "../../constants/selectors.js";
3
+ import { buildSpacer as g, DEFAULT_CARD_COMPOSITION as E, buildElementRenderer as w, buildCellOptions as i, DEFAULT_CARD_VISIBILITY as y } from "../utils.js";
4
+ import { listElementRenderer as L, renderInlineListPriceRow as O } from "./elementRenderer.js";
5
+ import { resolveInlinePriceOrder as S } from "../../utils/inlinePriceOrder.js";
6
+ const U = "0 5px";
7
+ function N(l, r, n) {
7
8
  const e = n ? "" : ' style="display: none;"', o = l.replace(/<tr>/, "").replace(/<\/tr>/, "");
8
9
  return `<tr
9
10
  class="recommendation-attribute-row"
10
- data-attribute-type="${r}"
11
+ data-attribute-type="${m(r)}"
11
12
  data-visibility="${n ? "1" : "0"}"${e}>${o}</tr>`;
12
13
  }
13
- const N = `
14
+ const x = `
14
15
  <tr class="recommendation-product-row">
15
16
  <td style="padding: {-{-CARD_PADDING-}-};">
16
17
  <table
@@ -28,40 +29,40 @@ const N = `
28
29
  </td>
29
30
  </tr>
30
31
  `;
31
- function x(l, r = g, n = {}, e = {}) {
32
+ function $(l, r = E, n = {}, e = {}) {
32
33
  const {
33
- cellPadding: o = S,
34
+ cellPadding: o = U,
34
35
  cardBackgroundColor: d,
35
36
  visibility: c,
36
37
  priceInline: a = !1
37
- } = e, u = d ? ` style="table-layout: fixed; background-color: ${d};"` : ' style="table-layout: fixed;"', s = E(y, r, n), P = s[p](l, i(p, e)), R = O(r), T = `
38
+ } = e, u = d ? ` style="table-layout: fixed; background-color: ${d};"` : ' style="table-layout: fixed;"', s = w(L, r, n), P = s[R](l, i(R, e)), p = S(r), T = `
38
39
  <td class="product-info-cell" valign="middle" style="padding: 15px;">
39
40
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
40
41
  <tbody>
41
- ${r.filter((t) => t !== p && t !== C).filter((t) => !(a && t === R.skip)).filter((t) => s[t]).map((t) => {
42
- const b = (c == null ? void 0 : c[t]) ?? w[t] ?? !0, f = a && t === R.anchor ? L(
42
+ ${r.filter((t) => t !== R && t !== C).filter((t) => !(a && t === p.skip)).filter((t) => s[t]).map((t) => {
43
+ const b = (c == null ? void 0 : c[t]) ?? y[t] ?? !0, f = a && t === p.anchor ? O(
43
44
  l,
44
- R.originalFirst,
45
- i(m, e),
45
+ p.originalFirst,
46
+ i(I, e),
46
47
  i(A, e)
47
48
  ) : s[t](l, i(t, e, r));
48
- return U(f, t, b);
49
+ return N(f, t, b);
49
50
  }).join(`
50
51
  `)}
51
52
  </tbody>
52
53
  </table>
53
54
  </td>
54
55
  `, _ = s[C](l, i(C, e)), D = P + T + _;
55
- return N.replace("{-{-CARD_PADDING-}-}", o).replace("{-{-WRAPPER_STYLE-}-}", u).replace("{-{-PRODUCT_CONTENT-}-}", D);
56
+ return x.replace("{-{-CARD_PADDING-}-}", o).replace("{-{-WRAPPER_STYLE-}-}", u).replace("{-{-PRODUCT_CONTENT-}-}", D);
56
57
  }
57
- function k(l, r, n = {}, e = {}) {
58
- const o = I(e.rowSpacingPx);
58
+ function H(l, r, n = {}, e = {}) {
59
+ const o = g(e.rowSpacingPx);
59
60
  return l.map((d, c) => {
60
- const a = x(d, r, n, e);
61
+ const a = $(d, r, n, e);
61
62
  return c > 0 ? o + a : a;
62
63
  }).join("");
63
64
  }
64
65
  export {
65
- x as getListProductCard,
66
- k as prepareProductRows
66
+ $ as getListProductCard,
67
+ H as prepareProductRows
67
68
  };
@@ -1,10 +1,11 @@
1
- import { ATTR_CUSTOM_PREFIX as f, ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as T, ATTR_PRODUCT_OLD_PRICE as b, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_BUTTON as y, PRODUCT_ATTRIBUTE_PREFIX as I } from "../constants/selectors.js";
2
- import { useRecommendationExtensionStore as L } from "../store/recommendation.js";
3
- import { compositionKeyToProductAttr as p, isDefaultProductAttr as d, bareAttributeName as S, findFilterByBareName as $, productAttrToCompositionKey as R } from "../utils/compositionKeys.js";
4
- import { formatPrice as B } from "../utils/priceFormatter.js";
5
- import { buildTitleRows as k } from "./titleRows.js";
6
- function N() {
7
- const t = L(), { currencySettings: e } = t.recommendationConfigs;
1
+ import { escapeHtml as I } from "../../../../utils/htmlEscape.js";
2
+ import { ATTR_CUSTOM_PREFIX as m, ATTR_PRODUCT_IMAGE as f, ATTR_PRODUCT_NAME as T, ATTR_PRODUCT_OLD_PRICE as b, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_BUTTON as p, PRODUCT_ATTRIBUTE_PREFIX as L } from "../constants/selectors.js";
3
+ import { useRecommendationExtensionStore as $ } from "../store/recommendation.js";
4
+ import { compositionKeyToProductAttr as y, isDefaultProductAttr as d, bareAttributeName as S, findFilterByBareName as B, productAttrToCompositionKey as R } from "../utils/compositionKeys.js";
5
+ import { formatPrice as k } from "../utils/priceFormatter.js";
6
+ import { buildTitleRows as N } from "./titleRows.js";
7
+ function w() {
8
+ const t = $(), { currencySettings: e } = t.recommendationConfigs;
8
9
  return {
9
10
  code: e.value,
10
11
  symbol: e.symbol,
@@ -15,52 +16,52 @@ function N() {
15
16
  };
16
17
  }
17
18
  function g(t, e = "price") {
18
- const o = N(), n = t[e], c = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
19
- return B({
19
+ const o = w(), n = t[e], c = (n == null ? void 0 : n[o.code]) ?? Object.values(n ?? {})[0] ?? 0;
20
+ return k({
20
21
  price: c,
21
22
  currency: o
22
23
  });
23
24
  }
24
- function q(t) {
25
+ function Q(t) {
25
26
  return g(t, "price") === g(t, "original_price");
26
27
  }
27
- function w(t) {
28
+ function x(t) {
28
29
  return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
29
30
  }
30
- function x(t) {
31
+ function F(t) {
31
32
  const e = Array.isArray(t) ? t[t.length - 1] : t;
32
33
  if (typeof e == "string")
33
34
  return e;
34
35
  if (typeof e == "number")
35
36
  return String(e);
36
37
  }
37
- function F(t, e) {
38
+ function M(t, e) {
38
39
  var o;
39
- return ((o = $(t, e)) == null ? void 0 : o.type) === "defaultAttribute";
40
+ return ((o = B(t, e)) == null ? void 0 : o.type) === "defaultAttribute";
40
41
  }
41
- function M(t, e) {
42
- return F(t, e) ? t : `${I}${t}`;
42
+ function v(t, e) {
43
+ return M(t, e) ? t : `${L}${t}`;
43
44
  }
44
- function J(t) {
45
+ function Z(t) {
45
46
  return R(t);
46
47
  }
47
- const v = Symbol("customCellHtml");
48
- function Q(t, e, o = {}) {
49
- const n = t[v];
48
+ const H = Symbol("customCellHtml");
49
+ function tt(t, e, o = {}) {
50
+ const n = t[H];
50
51
  if (!n)
51
52
  return { ...t };
52
53
  const c = { ...t };
53
- return e.filter((s) => s.startsWith(f) && !c[s]).forEach((s) => {
54
- const i = p(s), r = d(i) ? M(i, o) : i, l = S(r), h = w(l), D = d(r);
54
+ return e.filter((s) => s.startsWith(m) && !c[s]).forEach((s) => {
55
+ const i = y(s), r = d(i) ? v(i, o) : i, l = S(r), h = x(l), D = d(r);
55
56
  c[s] = (a, U) => {
56
57
  var u;
57
- const E = D ? a[l] : (u = a.product_attributes) == null ? void 0 : u[l], O = x(E) ?? h;
58
+ const E = D ? a[l] : (u = a.product_attributes) == null ? void 0 : u[l], O = I(F(E) ?? h);
58
59
  return n(r, O, U);
59
60
  };
60
61
  }), c;
61
62
  }
62
- function Z(t, e, o = []) {
63
- const n = t.startsWith(f) ? R(S(p(t))) : t, s = n !== t && !o.includes(n) ? n : t, i = (r) => (r == null ? void 0 : r[t]) ?? (r == null ? void 0 : r[s]);
63
+ function et(t, e, o = []) {
64
+ const n = t.startsWith(m) ? R(S(y(t))) : t, s = n !== t && !o.includes(n) ? n : t, i = (r) => (r == null ? void 0 : r[t]) ?? (r == null ? void 0 : r[s]);
64
65
  return {
65
66
  cellPadding: e.cellPadding,
66
67
  cardBackgroundColor: e.cardBackgroundColor,
@@ -71,67 +72,67 @@ function Z(t, e, o = []) {
71
72
  styleTemplate: i(e.styleTemplates)
72
73
  };
73
74
  }
74
- const tt = {
75
+ const ot = {
75
76
  TITLE: "You May Also Like!"
76
- }, et = [
77
- m,
77
+ }, nt = [
78
+ f,
78
79
  T,
79
80
  b,
80
81
  _,
81
82
  C,
82
83
  A,
83
- y
84
- ], ot = {
85
- [m]: !0,
84
+ p
85
+ ], rt = {
86
+ [f]: !0,
86
87
  [T]: !0,
87
88
  [_]: !0,
88
89
  [b]: !0,
89
90
  [C]: !1,
90
91
  [A]: !1,
91
- [y]: !0
92
+ [p]: !0
92
93
  }, W = 10;
93
- function nt(t = W) {
94
+ function st(t = W) {
94
95
  return `
95
96
  <tr>
96
97
  <td class="spacer" style="height: ${t}px;"></td>
97
98
  </tr>
98
99
  `;
99
100
  }
100
- function H(t, e) {
101
+ function V(t, e) {
101
102
  return e ? e.pStyle ?? "" : t;
102
103
  }
103
- function rt(t, e, o) {
104
- const n = H(e.pStyle, o), c = o ? o.openTags ?? "" : e.openTags, s = o ? o.closeTags ?? "" : e.closeTags;
104
+ function it(t, e, o) {
105
+ const n = V(e.pStyle, o), c = o ? o.openTags ?? "" : e.openTags, s = o ? o.closeTags ?? "" : e.closeTags;
105
106
  return `<p contenteditable="false" style="${n}">${c}${t}${s}</p>`;
106
107
  }
107
- function st(t, e) {
108
+ function ct(t, e) {
108
109
  const o = [];
109
110
  return t && o.push(t), e && o.push(`background-color: ${e};`), o.join(" ");
110
111
  }
111
- function V(t) {
112
+ function Y(t) {
112
113
  return t ? ` background-color: ${t};` : "";
113
114
  }
114
- function it(t) {
115
- const e = V(t);
115
+ function lt(t) {
116
+ const e = Y(t);
116
117
  return e ? ` style="${e.trim()}"` : "";
117
118
  }
118
- function ct(t, e = "") {
119
+ function at(t, e = "") {
119
120
  return {
120
121
  before: (t == null ? void 0 : t.before) ?? e,
121
122
  after: (t == null ? void 0 : t.after) ?? ""
122
123
  };
123
124
  }
124
- function lt(t, e) {
125
+ function ut(t, e) {
125
126
  return `${(e == null ? void 0 : e.openTags) ?? ""}${t}${(e == null ? void 0 : e.closeTags) ?? ""}`;
126
127
  }
127
- function at(t) {
128
+ function dt(t) {
128
129
  return t != null && t.buttonFitToContainer ? "es-button-border es-fw" : "es-button-border";
129
130
  }
130
- const ut = "display: block; max-width: 100%; height: auto;", dt = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79);", gt = "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;", P = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
131
- function ft(t) {
131
+ const gt = "display: block; max-width: 100%; height: auto;", mt = "border-width: 1px; background: rgb(217, 234, 211); border-color: rgb(106, 168, 79);", ft = "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;", P = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
132
+ function Tt(t) {
132
133
  return !t || typeof t != "string" || t.trim() === "" ? P : t.startsWith("http://") ? t.replace("http://", "https://") : t;
133
134
  }
134
- function Y(t) {
135
+ function G(t) {
135
136
  return {
136
137
  name: "Product Name",
137
138
  image_url: P,
@@ -146,13 +147,13 @@ function Y(t) {
146
147
  category: []
147
148
  };
148
149
  }
149
- function mt(t = 6) {
150
+ function bt(t = 6) {
150
151
  return Array.from(
151
152
  { length: t },
152
- (e, o) => Y(String(o + 1))
153
+ (e, o) => G(String(o + 1))
153
154
  );
154
155
  }
155
- function Tt(t = "grid", e) {
156
+ function _t(t = "grid", e) {
156
157
  const o = t === "list" ? `
157
158
  data-layout="list"` : "", n = e ? ` ${e}` : "", s = `recommendation-block-v2 esd-block-recommendation-v3-block es-p20${t === "list" ? " es-m-p0 ins-recommendation-list-layout" : ""}${n}`, i = t === "list" ? "" : `
158
159
  {-{-MOBILE_PRODUCT_ROWS-}-}`, r = t === "list" ? ' style="display: none;"' : "";
@@ -170,7 +171,7 @@ function Tt(t = "grid", e) {
170
171
  cellspacing="0"
171
172
  border="0">
172
173
  <tbody>
173
- ${k()}
174
+ ${N()}
174
175
  <tr>
175
176
  <td>
176
177
  <table
@@ -208,35 +209,35 @@ function Tt(t = "grid", e) {
208
209
  `;
209
210
  }
210
211
  export {
211
- v as CUSTOM_CELL_HTML,
212
- tt as DEFAULTS,
213
- gt as DEFAULT_BUTTON_ANCHOR_STYLE,
214
- dt as DEFAULT_BUTTON_BORDER_STYLE,
215
- et as DEFAULT_CARD_COMPOSITION,
216
- ot as DEFAULT_CARD_VISIBILITY,
217
- ut as DEFAULT_IMG_STYLE,
212
+ H as CUSTOM_CELL_HTML,
213
+ ot as DEFAULTS,
214
+ ft as DEFAULT_BUTTON_ANCHOR_STYLE,
215
+ mt as DEFAULT_BUTTON_BORDER_STYLE,
216
+ nt as DEFAULT_CARD_COMPOSITION,
217
+ rt as DEFAULT_CARD_VISIBILITY,
218
+ gt as DEFAULT_IMG_STYLE,
218
219
  W as DEFAULT_ROW_SPACING_PX,
219
220
  P as PLACEHOLDER_IMAGE,
220
- V as bgColorFragment,
221
- Z as buildCellOptions,
222
- Q as buildElementRenderer,
223
- nt as buildSpacer,
224
- it as cellBgStyleAttr,
225
- Tt as createBlockTemplate,
221
+ Y as bgColorFragment,
222
+ et as buildCellOptions,
223
+ tt as buildElementRenderer,
224
+ st as buildSpacer,
225
+ lt as cellBgStyleAttr,
226
+ _t as createBlockTemplate,
226
227
  g as formatProductPrice,
227
- N as getCurrentCurrencyConfig,
228
- mt as getDefaultProducts,
229
- F as isDefaultAttribute,
230
- q as isSamePrice,
231
- lt as renderButtonLabel,
232
- rt as renderStyledParagraph,
233
- at as resolveButtonBorderClass,
234
- ct as resolveOmnibusText,
235
- H as resolvePStyle,
236
- M as resolveProductAttrValue,
237
- st as resolveSegmentBgStyle,
238
- ft as sanitizeImageUrl,
239
- J as toCustomCompositionKey,
240
- w as toDisplayName,
241
- x as toDisplayableAttributeValue
228
+ w as getCurrentCurrencyConfig,
229
+ bt as getDefaultProducts,
230
+ M as isDefaultAttribute,
231
+ Q as isSamePrice,
232
+ ut as renderButtonLabel,
233
+ it as renderStyledParagraph,
234
+ dt as resolveButtonBorderClass,
235
+ at as resolveOmnibusText,
236
+ V as resolvePStyle,
237
+ v as resolveProductAttrValue,
238
+ ct as resolveSegmentBgStyle,
239
+ Tt as sanitizeImageUrl,
240
+ Z as toCustomCompositionKey,
241
+ x as toDisplayName,
242
+ F as toDisplayableAttributeValue
242
243
  };