@useinsider/guido 3.30.0-beta.64ede62 → 3.30.0-beta.6972d4f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +16 -11
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -51
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
- package/dist/composables/useAutoSave.js +13 -13
- package/dist/composables/useExport.js +7 -8
- package/dist/composables/useHtmlValidator.js +100 -102
- package/dist/composables/useToaster.js +10 -11
- package/dist/composables/useVersionHistoryApi.js +21 -22
- package/dist/composables/validators/useLiquidValidator.js +24 -26
- package/dist/config/migrator/itemsBlockMigrator.js +164 -161
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +59 -64
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +39 -40
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +32 -33
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +78 -79
- package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +41 -50
- package/dist/guido.css +1 -1
- package/dist/package.json.js +4 -4
- package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +0 -2
- package/dist/src/stores/preview.d.ts +0 -3
- package/dist/stores/preview.js +15 -21
- package/dist/utils/pairProductVariables.js +98 -108
- package/package.json +1 -1
- package/dist/src/utils/ampPreviewSanitizer.d.ts +0 -5
- 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
|
|
4
|
-
import { formatProductPrice as
|
|
5
|
-
const
|
|
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
|
|
15
|
-
const c =
|
|
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}${
|
|
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>`,
|
|
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}${
|
|
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 ?
|
|
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
|
|
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
|
-
[
|
|
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="${
|
|
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="${
|
|
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
|
-
[
|
|
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
|
-
[
|
|
91
|
+
[L]: (a, e) => {
|
|
93
92
|
const l = T(
|
|
94
|
-
|
|
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
|
-
[
|
|
111
|
+
[I]: (a, e) => {
|
|
113
112
|
const l = T(
|
|
114
|
-
|
|
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="${
|
|
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
|
-
[
|
|
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">${
|
|
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
|
-
[
|
|
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 =
|
|
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="${
|
|
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">${
|
|
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) ??
|
|
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="${
|
|
189
|
+
<span class="${M(l)}" style="${r}">
|
|
191
190
|
<a
|
|
192
191
|
href="${a.url}"
|
|
193
192
|
target="_blank"
|
|
194
|
-
class="es-button ${
|
|
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
|
-
[
|
|
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
|
-
${
|
|
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
|
-
|
|
229
|
-
|
|
227
|
+
J as listElementRenderer,
|
|
228
|
+
q as renderInlineListPriceRow
|
|
230
229
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
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 =
|
|
20
|
-
return
|
|
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
|
|
24
|
+
function q(t) {
|
|
26
25
|
return g(t, "price") === g(t, "original_price");
|
|
27
26
|
}
|
|
28
|
-
function
|
|
27
|
+
function w(t) {
|
|
29
28
|
return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
30
29
|
}
|
|
31
|
-
function
|
|
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
|
|
37
|
+
function F(t, e) {
|
|
39
38
|
var o;
|
|
40
|
-
return ((o =
|
|
39
|
+
return ((o = $(t, e)) == null ? void 0 : o.type) === "defaultAttribute";
|
|
41
40
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
41
|
+
function M(t, e) {
|
|
42
|
+
return F(t, e) ? t : `${I}${t}`;
|
|
44
43
|
}
|
|
45
|
-
function
|
|
44
|
+
function J(t) {
|
|
46
45
|
return R(t);
|
|
47
46
|
}
|
|
48
|
-
const
|
|
49
|
-
function
|
|
50
|
-
const n = t[
|
|
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(
|
|
55
|
-
const i =
|
|
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 =
|
|
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
|
|
64
|
-
const n = t.startsWith(
|
|
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
|
|
74
|
+
const tt = {
|
|
76
75
|
TITLE: "You May Also Like!"
|
|
77
|
-
},
|
|
78
|
-
|
|
76
|
+
}, et = [
|
|
77
|
+
m,
|
|
79
78
|
T,
|
|
80
79
|
b,
|
|
81
80
|
_,
|
|
82
81
|
C,
|
|
83
82
|
A,
|
|
84
|
-
|
|
85
|
-
],
|
|
86
|
-
[
|
|
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
|
-
[
|
|
91
|
+
[y]: !0
|
|
93
92
|
}, W = 10;
|
|
94
|
-
function
|
|
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
|
|
100
|
+
function H(t, e) {
|
|
102
101
|
return e ? e.pStyle ?? "" : t;
|
|
103
102
|
}
|
|
104
|
-
function
|
|
105
|
-
const n =
|
|
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
|
|
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
|
|
111
|
+
function V(t) {
|
|
113
112
|
return t ? ` background-color: ${t};` : "";
|
|
114
113
|
}
|
|
115
|
-
function
|
|
116
|
-
const e =
|
|
114
|
+
function it(t) {
|
|
115
|
+
const e = V(t);
|
|
117
116
|
return e ? ` style="${e.trim()}"` : "";
|
|
118
117
|
}
|
|
119
|
-
function
|
|
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
|
|
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
|
|
127
|
+
function at(t) {
|
|
129
128
|
return t != null && t.buttonFitToContainer ? "es-button-border es-fw" : "es-button-border";
|
|
130
129
|
}
|
|
131
|
-
const
|
|
132
|
-
function
|
|
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
|
|
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
|
|
149
|
+
function mt(t = 6) {
|
|
151
150
|
return Array.from(
|
|
152
151
|
{ length: t },
|
|
153
|
-
(e, o) =>
|
|
152
|
+
(e, o) => Y(String(o + 1))
|
|
154
153
|
);
|
|
155
154
|
}
|
|
156
|
-
function
|
|
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
|
-
${
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
};
|
|
@@ -1,107 +1,98 @@
|
|
|
1
|
-
import { ATTR_CUSTOM_PREFIX as o, ATTR_PRODUCT_PRICE as
|
|
1
|
+
import { ATTR_CUSTOM_PREFIX as o, ATTR_PRODUCT_PRICE as g, ATTR_PRODUCT_OLD_PRICE as d, PRODUCT_ATTRIBUTE_PREFIX as a, ATTR_DATA_ATTRIBUTE_TYPE as f, ATTR_PRODUCT_ATTR as c, SELECTOR_ATTRIBUTE_ROW as y } from "../constants/selectors.js";
|
|
2
2
|
function q(t) {
|
|
3
|
-
return !t.startsWith(
|
|
3
|
+
return !t.startsWith(a);
|
|
4
4
|
}
|
|
5
5
|
function $(t) {
|
|
6
|
-
return t.startsWith(
|
|
6
|
+
return t.startsWith(a) ? t.substring(a.length) : t;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function A(t) {
|
|
9
9
|
return t.startsWith(o) ? t.substring(o.length) : t;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function T(t) {
|
|
12
12
|
return `${o}${t}`;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return !g.test(t);
|
|
17
|
-
}
|
|
18
|
-
function O(t) {
|
|
19
|
-
return t.filter((r) => !r.startsWith(o) || m(T(r)));
|
|
14
|
+
function C(t) {
|
|
15
|
+
return t.type === "defaultAttribute" ? t.attributeName : `${a}${t.attributeName}`;
|
|
20
16
|
}
|
|
21
|
-
function h(t) {
|
|
22
|
-
return t.type === "defaultAttribute" ? t.attributeName : `${f}${t.attributeName}`;
|
|
23
|
-
}
|
|
24
|
-
function S(t, r) {
|
|
17
|
+
function h(t, r) {
|
|
25
18
|
const n = Object.values(r).filter((e) => e.attributeName === t);
|
|
26
19
|
return n.find((e) => e.type === "defaultAttribute") ?? n[0];
|
|
27
20
|
}
|
|
28
21
|
function l(t, r) {
|
|
29
22
|
return t && "getAttribute" in t ? t.getAttribute(r) : null;
|
|
30
23
|
}
|
|
31
|
-
function
|
|
24
|
+
function S(t, r, n = {}) {
|
|
32
25
|
const e = `${o}${t}`, u = r == null ? void 0 : r.querySelector(
|
|
33
|
-
`${y}[${
|
|
26
|
+
`${y}[${f}="${e}"]`
|
|
34
27
|
), i = l(u, c) ?? l(u == null ? void 0 : u.querySelector(`[${c}]`), c);
|
|
35
28
|
if (i)
|
|
36
29
|
return i;
|
|
37
|
-
const s =
|
|
38
|
-
return s ?
|
|
30
|
+
const s = h(t, n);
|
|
31
|
+
return s ? C(s) : t;
|
|
39
32
|
}
|
|
40
33
|
function P(t, r, n = {}) {
|
|
41
|
-
return t.startsWith(
|
|
34
|
+
return t.startsWith(a) ? t : S(t, r, n);
|
|
42
35
|
}
|
|
43
|
-
function
|
|
36
|
+
function O(t, r, n = {}) {
|
|
44
37
|
return t.map((e) => {
|
|
45
38
|
if (!e.startsWith(o))
|
|
46
39
|
return e;
|
|
47
|
-
const u =
|
|
48
|
-
return
|
|
40
|
+
const u = A(e);
|
|
41
|
+
return T(P(u, r, n));
|
|
49
42
|
});
|
|
50
43
|
}
|
|
51
|
-
function
|
|
44
|
+
function p(t, r, n = {}) {
|
|
52
45
|
return t.map((e) => P(e, r, n));
|
|
53
46
|
}
|
|
54
47
|
function b(t) {
|
|
55
|
-
const r = l(t,
|
|
48
|
+
const r = l(t, f);
|
|
56
49
|
if (!(r != null && r.startsWith(o)))
|
|
57
50
|
return r;
|
|
58
51
|
const n = "querySelector" in t ? t.querySelector(`[${c}]`) : void 0, e = l(n, c);
|
|
59
|
-
return e ?
|
|
52
|
+
return e ? T(e) : r;
|
|
60
53
|
}
|
|
61
|
-
function
|
|
54
|
+
function m(t) {
|
|
62
55
|
return !!(t && "querySelector" in t && t.querySelector(".product-price") && t.querySelector(".product-old-price"));
|
|
63
56
|
}
|
|
64
|
-
function
|
|
57
|
+
function D(t) {
|
|
65
58
|
const r = b(t);
|
|
66
|
-
return r ?
|
|
59
|
+
return r ? m(t) ? [g, d] : [r] : [];
|
|
67
60
|
}
|
|
68
61
|
function R(t, r, n) {
|
|
69
62
|
const e = l(t, c), u = l(t.querySelector(`[${c}]`), c), i = e ?? u;
|
|
70
63
|
return i === null ? n : i === r;
|
|
71
64
|
}
|
|
72
|
-
function
|
|
73
|
-
const n = (
|
|
74
|
-
`${y}[${
|
|
65
|
+
function I(t, r) {
|
|
66
|
+
const n = (_) => t.querySelector(
|
|
67
|
+
`${y}[${f}="${_}"]`
|
|
75
68
|
);
|
|
76
69
|
if (!r.startsWith(o))
|
|
77
70
|
return n(r) ?? null;
|
|
78
|
-
const e =
|
|
71
|
+
const e = A(r), u = n(r);
|
|
79
72
|
if (u && R(u, e, !0))
|
|
80
73
|
return u;
|
|
81
|
-
const i =
|
|
74
|
+
const i = T($(e)), s = i === r ? void 0 : n(i);
|
|
82
75
|
return s && R(s, e, !1) ? s : null;
|
|
83
76
|
}
|
|
84
|
-
function
|
|
85
|
-
const n =
|
|
77
|
+
function U(t, r) {
|
|
78
|
+
const n = A(r), e = T($(n));
|
|
86
79
|
return e === r ? t : t.replace(
|
|
87
|
-
`${
|
|
88
|
-
`${
|
|
80
|
+
`${f}="${e}"`,
|
|
81
|
+
`${f}="${r}"`
|
|
89
82
|
);
|
|
90
83
|
}
|
|
91
84
|
export {
|
|
92
85
|
$ as bareAttributeName,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
S as findFilterByBareName,
|
|
86
|
+
A as compositionKeyToProductAttr,
|
|
87
|
+
C as filterToProductAttrValue,
|
|
88
|
+
I as findAttributeRow,
|
|
89
|
+
h as findFilterByBareName,
|
|
98
90
|
q as isDefaultProductAttr,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
A as productAttrToCompositionKey,
|
|
91
|
+
m as isMergedInlinePriceRow,
|
|
92
|
+
O as normalizeCompositionKeys,
|
|
93
|
+
p as normalizeCustomAttrValues,
|
|
94
|
+
T as productAttrToCompositionKey,
|
|
104
95
|
b as resolveRowCompositionKey,
|
|
105
|
-
|
|
106
|
-
|
|
96
|
+
D as resolveRowVisibilityKeys,
|
|
97
|
+
U as rewriteLegacyRowKeyHtml
|
|
107
98
|
};
|