@useinsider/guido 3.30.0-beta.1360af2 → 3.30.0-beta.16d665a

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