@useinsider/guido 3.10.0-beta.f7505c1 → 3.10.0-beta.f8b4dbb
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/config/compiler/htmlCompilerRules.js +30 -7
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +106 -119
- package/dist/config/i18n/en/labels.json.js +4 -1
- package/dist/enums/defaults.js +7 -4
- package/dist/enums/unsubscribe.js +41 -36
- package/dist/extensions/Blocks/Checkbox/block.js +5 -3
- package/dist/extensions/Blocks/Checkbox/control.js +42 -28
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +1 -1
- package/dist/extensions/Blocks/RadioButton/block.js +9 -7
- package/dist/extensions/Blocks/RadioButton/control.js +64 -50
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +75 -69
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +18 -17
- package/dist/services/blankTemplate.js +34 -0
- package/dist/services/stripoApi.js +13 -18
- package/dist/src/enums/defaults.d.ts +3 -0
- package/dist/src/enums/unsubscribe.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +1 -0
- package/dist/src/services/blankTemplate.d.ts +11 -0
- package/dist/static/styles/components/dropdown-menu.css.js +12 -0
- package/dist/utils/pairProductVariables.js +64 -65
- package/package.json +1 -1
- package/dist/static/templates/empty/index.html.js +0 -74
- package/dist/static/templates/empty/style.css.js +0 -779
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import { getDefaultUnsubscribeGroup as
|
|
6
|
-
import { Control as
|
|
7
|
-
const b = "ui-elements-checkbox",
|
|
8
|
-
class
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var L = (i, n, e) => n in i ? p(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
|
|
3
|
+
var a = (i, n, e) => L(i, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { useHttp as h } from "../../../composables/useHttp.js";
|
|
5
|
+
import { getDefaultUnsubscribeGroup as T, PIXEL_TRACKING_SEND_GRID_ID as C, UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS as I } from "../../../enums/unsubscribe.js";
|
|
6
|
+
import { Control as m, UIElementType as r, UEAttr as t, ModificationDescription as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
const b = "ui-elements-checkbox", E = "select", { get: _ } = h();
|
|
8
|
+
class G extends m {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
a(this, "currentNode");
|
|
12
|
+
a(this, "selectedUnsubGroup");
|
|
13
|
+
a(this, "unsubList", []);
|
|
14
14
|
}
|
|
15
15
|
getId() {
|
|
16
16
|
return b;
|
|
@@ -19,12 +19,12 @@ class I extends p {
|
|
|
19
19
|
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
20
|
const e = this.currentNode.getAttribute("id");
|
|
21
21
|
if (e) {
|
|
22
|
-
const s = e
|
|
22
|
+
const s = I.includes(e) ? e : Number(e);
|
|
23
23
|
s && (this.selectedUnsubGroup = s);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
this.api.updateValues({
|
|
27
|
-
[
|
|
27
|
+
[E]: this.selectedUnsubGroup
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
_getLabel(e, s = `${Math.random()}`) {
|
|
@@ -46,17 +46,19 @@ class I extends p {
|
|
|
46
46
|
return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
|
|
47
47
|
}
|
|
48
48
|
getTemplate() {
|
|
49
|
+
const e = this.api.translate("Unsubscribe & Preference Center Type"), s = this.api.translate("Select Unsubscribe and Preference Type");
|
|
49
50
|
return `
|
|
50
51
|
<div class="checkbox-controls-container">
|
|
51
|
-
<div class="checkbox-select-container container
|
|
52
|
+
<div class="checkbox-select-container container one-column stretch">
|
|
52
53
|
<${r.LABEL}
|
|
53
|
-
${t.LABEL.text}="${
|
|
54
|
+
${t.LABEL.text}="${e}"
|
|
54
55
|
${t.LABEL.name}="${Math.random()}">
|
|
55
56
|
</${r.LABEL}>
|
|
56
57
|
|
|
57
58
|
<${r.SELECTPICKER}
|
|
58
|
-
${t.SELECTPICKER.name}="${
|
|
59
|
-
${t.SELECTPICKER.
|
|
59
|
+
${t.SELECTPICKER.name}="${E}"
|
|
60
|
+
${t.SELECTPICKER.searchable}="true"
|
|
61
|
+
${t.SELECTPICKER.placeholder}="${s}">
|
|
60
62
|
${this._getSelect()}
|
|
61
63
|
</${r.SELECTPICKER}>
|
|
62
64
|
</div>
|
|
@@ -64,30 +66,42 @@ class I extends p {
|
|
|
64
66
|
`;
|
|
65
67
|
}
|
|
66
68
|
_onSelectChange(e) {
|
|
67
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new
|
|
69
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new S(`Updated text to ${e}`));
|
|
68
70
|
}
|
|
69
71
|
_listenToFormUpdates() {
|
|
70
|
-
this.api.onValueChanged(
|
|
72
|
+
this.api.onValueChanged(E, (e) => this._onSelectChange(e));
|
|
71
73
|
}
|
|
72
74
|
onTemplateNodeUpdated(e) {
|
|
73
75
|
this.currentNode = e, this._setFormValues();
|
|
74
76
|
}
|
|
75
77
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
76
78
|
async onRender() {
|
|
77
|
-
const e = await
|
|
79
|
+
const e = await _(
|
|
78
80
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}))
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
), s = {
|
|
82
|
+
name: this.api.translate("Pixel Tracking Opt-in"),
|
|
83
|
+
sendGridId: C
|
|
84
|
+
}, c = [T(), ...e.data], u = (o) => ({
|
|
85
|
+
[t.SELECT_ITEM.text]: o.name,
|
|
86
|
+
[t.SELECT_ITEM.value]: o.sendGridId
|
|
87
|
+
}), l = (o) => ({
|
|
88
|
+
[t.SELECT_ITEM.text]: o,
|
|
89
|
+
[t.SELECT_ITEM.value]: `header:${o}`,
|
|
90
|
+
[t.SELECT_ITEM.disabled]: !0
|
|
91
|
+
}), d = [
|
|
92
|
+
l(this.api.translate("OPT-IN SELECTION")),
|
|
93
|
+
u(s),
|
|
94
|
+
l(this.api.translate("UNSUBSCRIBE GROUPS")),
|
|
95
|
+
...c.map(u)
|
|
96
|
+
];
|
|
97
|
+
this.unsubList = [s, ...c], this.api.setUIEAttribute(
|
|
98
|
+
E,
|
|
85
99
|
t.SELECTPICKER.items,
|
|
86
|
-
|
|
100
|
+
d
|
|
87
101
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
88
102
|
}
|
|
89
103
|
}
|
|
90
104
|
export {
|
|
91
105
|
b as CHECKBOX_CONTROL_BLOCK_ID,
|
|
92
|
-
|
|
106
|
+
G as CheckboxControl
|
|
93
107
|
};
|
|
@@ -53,7 +53,7 @@ class P extends E {
|
|
|
53
53
|
if (!m)
|
|
54
54
|
return;
|
|
55
55
|
const g = m.getInnerHTML().trim() || "", C = m.getInnerText().trim() || "", _ = this._removeCurrencySymbol(C, o), S = this._buildPriceContent(_, n, l), b = g.replace(C, f(S));
|
|
56
|
-
i.modifyHtml(m).setInnerHtml(b);
|
|
56
|
+
i.modifyHtml(m).setInnerHtml(b).setAttribute("data-currency_symbol", n);
|
|
57
57
|
}), i.apply(new B(
|
|
58
58
|
`Updated currency symbol to ${n || "removed"}`
|
|
59
59
|
));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Block as t, BlockCompositionType as
|
|
2
|
-
import { getDefaultTemplate as
|
|
1
|
+
import { Block as t, BlockCompositionType as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { getDefaultTemplate as o } from "./template.js";
|
|
3
3
|
const r = "radio-button-block";
|
|
4
|
-
class
|
|
4
|
+
class i extends t {
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
7
7
|
}
|
|
@@ -12,16 +12,18 @@ class l extends t {
|
|
|
12
12
|
return "radio-button-icon";
|
|
13
13
|
}
|
|
14
14
|
getBlockCompositionType() {
|
|
15
|
-
return
|
|
15
|
+
return e.CONTAINER;
|
|
16
16
|
}
|
|
17
17
|
getName() {
|
|
18
18
|
return this.api.translate("Radio Button Block");
|
|
19
19
|
}
|
|
20
20
|
getDescription() {
|
|
21
|
-
return this.api.translate(
|
|
21
|
+
return this.api.translate(
|
|
22
|
+
"Radio button lets you select Unsubscribe and Preference Type for users to manage their opt-in or opt-out preferences."
|
|
23
|
+
);
|
|
22
24
|
}
|
|
23
25
|
getTemplate() {
|
|
24
|
-
return
|
|
26
|
+
return o();
|
|
25
27
|
}
|
|
26
28
|
allowInnerBlocksDND() {
|
|
27
29
|
return !1;
|
|
@@ -29,5 +31,5 @@ class l extends t {
|
|
|
29
31
|
}
|
|
30
32
|
export {
|
|
31
33
|
r as BLOCK_ID,
|
|
32
|
-
|
|
34
|
+
i as RadioButtonCustomBlock
|
|
33
35
|
};
|
|
@@ -1,93 +1,107 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import { getDefaultUnsubscribeGroup as
|
|
6
|
-
import { Control as
|
|
7
|
-
const b = "ui-elements-radio-button",
|
|
8
|
-
class
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var L = (i, n, e) => n in i ? p(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
|
|
3
|
+
var a = (i, n, e) => L(i, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { useHttp as T } from "../../../composables/useHttp.js";
|
|
5
|
+
import { getDefaultUnsubscribeGroup as h, PIXEL_TRACKING_SEND_GRID_ID as I, UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS as m } from "../../../enums/unsubscribe.js";
|
|
6
|
+
import { Control as C, UIElementType as r, UEAttr as t, ModificationDescription as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
const b = "ui-elements-radio-button", E = "select", { get: _ } = T();
|
|
8
|
+
class G extends C {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
a(this, "currentNode");
|
|
12
|
+
a(this, "selectedUnsubGroup");
|
|
13
|
+
a(this, "unsubList", []);
|
|
14
14
|
}
|
|
15
15
|
getId() {
|
|
16
16
|
return b;
|
|
17
17
|
}
|
|
18
18
|
_setFormValues() {
|
|
19
19
|
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const s =
|
|
20
|
+
const e = this.currentNode.getAttribute("id");
|
|
21
|
+
if (e) {
|
|
22
|
+
const s = m.includes(e) ? e : Number(e);
|
|
23
23
|
s && (this.selectedUnsubGroup = s);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
this.api.updateValues({
|
|
27
|
-
[
|
|
27
|
+
[E]: this.selectedUnsubGroup
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
_getLabel(
|
|
30
|
+
_getLabel(e, s = `${Math.random()}`) {
|
|
31
31
|
return `
|
|
32
|
-
<${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
</${
|
|
32
|
+
<${r.LABEL}
|
|
33
|
+
${t.LABEL.text}="${e}"
|
|
34
|
+
${t.LABEL.name}="${s}">
|
|
35
|
+
</${r.LABEL}>
|
|
36
36
|
`;
|
|
37
37
|
}
|
|
38
|
-
_getSelectItem(
|
|
38
|
+
_getSelectItem(e, s) {
|
|
39
39
|
return `
|
|
40
|
-
<${
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
</${
|
|
40
|
+
<${r.SELECT_ITEM}
|
|
41
|
+
${t.SELECT_ITEM.text}="${e}"
|
|
42
|
+
${t.SELECT_ITEM.value}="${s}">
|
|
43
|
+
</${r.SELECT_ITEM}>`;
|
|
44
44
|
}
|
|
45
45
|
_getSelect() {
|
|
46
|
-
return this.unsubList.map((
|
|
46
|
+
return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
|
|
47
47
|
}
|
|
48
48
|
getTemplate() {
|
|
49
|
+
const e = this.api.translate("Unsubscribe & Preference Center Type"), s = this.api.translate("Select Unsubscribe and Preference Type");
|
|
49
50
|
return `
|
|
50
51
|
<div class="checkbox-controls-container">
|
|
51
|
-
<div class="checkbox-select-container container
|
|
52
|
-
<${
|
|
53
|
-
${
|
|
54
|
-
${
|
|
55
|
-
</${
|
|
52
|
+
<div class="checkbox-select-container container one-column stretch">
|
|
53
|
+
<${r.LABEL}
|
|
54
|
+
${t.LABEL.text}="${e}"
|
|
55
|
+
${t.LABEL.name}="${Math.random()}">
|
|
56
|
+
</${r.LABEL}>
|
|
56
57
|
|
|
57
|
-
<${
|
|
58
|
-
${
|
|
59
|
-
${
|
|
58
|
+
<${r.SELECTPICKER}
|
|
59
|
+
${t.SELECTPICKER.name}="${E}"
|
|
60
|
+
${t.SELECTPICKER.searchable}="true"
|
|
61
|
+
${t.SELECTPICKER.placeholder}="${s}">
|
|
60
62
|
${this._getSelect()}
|
|
61
|
-
</${
|
|
63
|
+
</${r.SELECTPICKER}>
|
|
62
64
|
</div>
|
|
63
65
|
</div>
|
|
64
66
|
`;
|
|
65
67
|
}
|
|
66
|
-
_onSelectChange(
|
|
67
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id",
|
|
68
|
+
_onSelectChange(e) {
|
|
69
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new S(`Updated text to ${e}`));
|
|
68
70
|
}
|
|
69
71
|
_listenToFormUpdates() {
|
|
70
|
-
this.api.onValueChanged(
|
|
72
|
+
this.api.onValueChanged(E, (e) => this._onSelectChange(e));
|
|
71
73
|
}
|
|
72
|
-
onTemplateNodeUpdated(
|
|
73
|
-
this.currentNode =
|
|
74
|
+
onTemplateNodeUpdated(e) {
|
|
75
|
+
this.currentNode = e, this._setFormValues();
|
|
74
76
|
}
|
|
75
77
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
76
78
|
async onRender() {
|
|
77
|
-
const
|
|
79
|
+
const e = await _(
|
|
78
80
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}))
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
), s = {
|
|
82
|
+
name: this.api.translate("Pixel Tracking Opt-in"),
|
|
83
|
+
sendGridId: I
|
|
84
|
+
}, u = [h(), ...e.data], c = (o) => ({
|
|
85
|
+
[t.SELECT_ITEM.text]: o.name,
|
|
86
|
+
[t.SELECT_ITEM.value]: o.sendGridId
|
|
87
|
+
}), d = (o) => ({
|
|
88
|
+
[t.SELECT_ITEM.text]: o,
|
|
89
|
+
[t.SELECT_ITEM.value]: `header:${o}`,
|
|
90
|
+
[t.SELECT_ITEM.disabled]: !0
|
|
91
|
+
}), l = [
|
|
92
|
+
d(this.api.translate("OPT-IN SELECTION")),
|
|
93
|
+
c(s),
|
|
94
|
+
d(this.api.translate("UNSUBSCRIBE GROUPS")),
|
|
95
|
+
...u.map(c)
|
|
96
|
+
];
|
|
97
|
+
this.unsubList = [s, ...u], this.api.setUIEAttribute(
|
|
98
|
+
E,
|
|
99
|
+
t.SELECTPICKER.items,
|
|
100
|
+
l
|
|
87
101
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
88
102
|
}
|
|
89
103
|
}
|
|
90
104
|
export {
|
|
91
105
|
b as CONTROL_BLOCK_ID,
|
|
92
|
-
|
|
106
|
+
G as RadioButtonControl
|
|
93
107
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RecommendationBlockId as c } from "../constants/blockIds.js";
|
|
2
|
-
import { DESKTOP_CONTAINER_SELECTOR as S, ATTR_PRODUCT_NAME as
|
|
2
|
+
import { DESKTOP_CONTAINER_SELECTOR as S, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_PRICE as p, ATTR_PRODUCT_OLD_PRICE as y, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_BUTTON as P, ATTR_PRODUCT_IMAGE as q, ATTR_PRODUCT_ATTR as x } from "../constants/selectors.js";
|
|
3
3
|
import { CSS_CLASS_TEXT_TRIM as B } from "../controls/shared/textTrimCssRules.js";
|
|
4
|
-
import { toCustomCompositionKey as
|
|
5
|
-
import { extractWrapperTags as
|
|
6
|
-
import { hasQuerySelectorAll as
|
|
4
|
+
import { toCustomCompositionKey as v } from "../templates/utils.js";
|
|
5
|
+
import { extractWrapperTags as R } from "./preserveTextStyles.js";
|
|
6
|
+
import { hasQuerySelectorAll as _, hasGetAttribute as l, hasGetStyle as I, hasGetComputedStyle as U } from "./tagName.js";
|
|
7
7
|
const s = [
|
|
8
8
|
"font-size",
|
|
9
9
|
"font-family",
|
|
@@ -39,94 +39,94 @@ const s = [
|
|
|
39
39
|
"border-radius",
|
|
40
40
|
"margin"
|
|
41
41
|
], b = /* @__PURE__ */ new Set(["transparent", "rgba(0, 0, 0, 0)"]), G = [
|
|
42
|
-
{ attrKey:
|
|
43
|
-
{ attrKey:
|
|
44
|
-
{ attrKey:
|
|
45
|
-
{ attrKey:
|
|
46
|
-
{ attrKey:
|
|
42
|
+
{ attrKey: E, blockId: c.NAME, kind: "text" },
|
|
43
|
+
{ attrKey: p, blockId: c.PRICE, kind: "text" },
|
|
44
|
+
{ attrKey: y, blockId: c.OLD_PRICE, kind: "text" },
|
|
45
|
+
{ attrKey: C, blockId: c.OMNIBUS_PRICE, kind: "text" },
|
|
46
|
+
{ attrKey: A, blockId: c.OMNIBUS_DISCOUNT, kind: "text" },
|
|
47
47
|
{ attrKey: P, blockId: c.BUTTON, kind: "button" },
|
|
48
|
-
{ attrKey:
|
|
48
|
+
{ attrKey: q, blockId: c.IMAGE, kind: "image" }
|
|
49
49
|
];
|
|
50
|
-
function
|
|
50
|
+
function O(t) {
|
|
51
51
|
return t && "getInnerHTML" in t && typeof t.getInnerHTML == "function" ? t.getInnerHTML().trim() : "";
|
|
52
52
|
}
|
|
53
53
|
function L(t) {
|
|
54
54
|
return t && "getInnerText" in t && typeof t.getInnerText == "function" ? t.getInnerText().trim() : "";
|
|
55
55
|
}
|
|
56
56
|
function a(t, e, r) {
|
|
57
|
-
!e || !
|
|
58
|
-
const
|
|
59
|
-
|
|
57
|
+
!e || !I(e) || r.forEach((n) => {
|
|
58
|
+
const o = e.getStyle(n);
|
|
59
|
+
o && o !== "inherit" && o !== "initial" && (t[n] = o);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function h(t) {
|
|
63
63
|
return Object.entries(t).map(([e, r]) => `${e}: ${r};`).join(" ");
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
if (!t || !
|
|
65
|
+
function k(t) {
|
|
66
|
+
if (!t || !I(t))
|
|
67
67
|
return;
|
|
68
68
|
const e = t.getStyle("background-color") || t.getStyle("background");
|
|
69
69
|
return e && !b.has(e) ? e : void 0;
|
|
70
70
|
}
|
|
71
71
|
function g(t, e) {
|
|
72
72
|
const r = {};
|
|
73
|
-
return a(r, t, e),
|
|
73
|
+
return a(r, t, e), h(r);
|
|
74
74
|
}
|
|
75
75
|
function w(t) {
|
|
76
76
|
const e = t.querySelector("p"), r = {};
|
|
77
77
|
a(r, t, s), a(r, e, s), a(r, t.querySelector("strong"), s), a(r, t.querySelector("em"), s), a(r, t.querySelector("s"), s);
|
|
78
|
-
const n =
|
|
79
|
-
return !n && !
|
|
78
|
+
const n = h(r), { openTags: o, closeTags: i } = R(O(e));
|
|
79
|
+
return !n && !o ? null : { pStyle: n || void 0, openTags: o, closeTags: i };
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const e = t.querySelector(".es-button-border"), r = t.querySelector("a.es-button") ?? t.querySelector("a"), n = g(e, N),
|
|
83
|
-
return !n && !
|
|
81
|
+
function $(t) {
|
|
82
|
+
const e = t.querySelector(".es-button-border"), r = t.querySelector("a.es-button") ?? t.querySelector("a"), n = g(e, N), o = g(r, M), i = e && "getAttribute" in e ? e.getAttribute("class") ?? "" : "", u = /\bes-fw\b/.test(i), { openTags: T, closeTags: d } = R(O(r)), m = L(r);
|
|
83
|
+
return !n && !o && !u && !T && !m ? null : {
|
|
84
84
|
buttonBorderStyle: n || void 0,
|
|
85
|
-
buttonAnchorStyle:
|
|
85
|
+
buttonAnchorStyle: o || void 0,
|
|
86
86
|
buttonFitToContainer: u || void 0,
|
|
87
|
-
buttonText:
|
|
87
|
+
buttonText: m || void 0,
|
|
88
88
|
openTags: T,
|
|
89
89
|
closeTags: d
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function K(t) {
|
|
93
93
|
const e = g(t.querySelector("img"), D);
|
|
94
94
|
return e ? { imgStyle: e } : null;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
return e === "button" ?
|
|
96
|
+
function H(t, e) {
|
|
97
|
+
return e === "button" ? $(t) : e === "image" ? K(t) : w(t);
|
|
98
98
|
}
|
|
99
99
|
function f(t, e) {
|
|
100
100
|
if (!t || !("querySelector" in t))
|
|
101
101
|
return;
|
|
102
102
|
const r = t.querySelector(S) ?? t;
|
|
103
|
-
if (G.forEach(({ attrKey:
|
|
103
|
+
if (G.forEach(({ attrKey: i, blockId: u, kind: T }) => {
|
|
104
104
|
const d = r.querySelector(`[esd-extension-block-id="${u}"]`);
|
|
105
|
-
d && e(d,
|
|
106
|
-
}), !
|
|
105
|
+
d && e(d, i, T);
|
|
106
|
+
}), !_(r))
|
|
107
107
|
return;
|
|
108
108
|
const n = /* @__PURE__ */ new Set();
|
|
109
109
|
r.querySelectorAll(
|
|
110
110
|
`[esd-extension-block-id="${c.CUSTOM_ATTRIBUTE}"]`
|
|
111
|
-
).forEach((
|
|
112
|
-
const u = l(
|
|
113
|
-
!u || n.has(u) || (n.add(u), e(
|
|
111
|
+
).forEach((i) => {
|
|
112
|
+
const u = l(i) ? i.getAttribute(x) : null;
|
|
113
|
+
!u || n.has(u) || (n.add(u), e(i, v(u), "text"));
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
function F(t) {
|
|
117
117
|
const e = {};
|
|
118
|
-
return f(t, (r, n,
|
|
118
|
+
return f(t, (r, n, o) => {
|
|
119
119
|
if (!("querySelector" in r))
|
|
120
120
|
return;
|
|
121
|
-
const
|
|
122
|
-
|
|
121
|
+
const i = H(r, o);
|
|
122
|
+
i && (e[n] = i);
|
|
123
123
|
}), e;
|
|
124
124
|
}
|
|
125
125
|
function j(t) {
|
|
126
126
|
if (!t || !("querySelector" in t))
|
|
127
127
|
return;
|
|
128
128
|
const e = t.querySelector(S) ?? t, r = e.querySelector(".product-card-segment") ?? e.querySelector(".product-card-wrapper");
|
|
129
|
-
return
|
|
129
|
+
return k(r);
|
|
130
130
|
}
|
|
131
131
|
function X(t) {
|
|
132
132
|
if (!t)
|
|
@@ -134,28 +134,28 @@ function X(t) {
|
|
|
134
134
|
const e = l(t) ? t.getAttribute("bgcolor") : null;
|
|
135
135
|
if (e && !b.has(e))
|
|
136
136
|
return e;
|
|
137
|
-
const r =
|
|
137
|
+
const r = k(t);
|
|
138
138
|
if (r)
|
|
139
139
|
return r;
|
|
140
|
-
const n =
|
|
140
|
+
const n = U(t) ? t.getComputedStyle("background-color") : void 0;
|
|
141
141
|
return n && !b.has(n) ? n : void 0;
|
|
142
142
|
}
|
|
143
143
|
function z(t) {
|
|
144
144
|
const e = {};
|
|
145
|
-
return f(t, (r, n,
|
|
146
|
-
if (
|
|
145
|
+
return f(t, (r, n, o) => {
|
|
146
|
+
if (o !== "text")
|
|
147
147
|
return;
|
|
148
|
-
const
|
|
149
|
-
|
|
148
|
+
const i = X(r);
|
|
149
|
+
i && (e[n] = i);
|
|
150
150
|
}), e;
|
|
151
151
|
}
|
|
152
152
|
function Q(t) {
|
|
153
153
|
const e = {};
|
|
154
|
-
return f(t, (r, n,
|
|
155
|
-
if (
|
|
154
|
+
return f(t, (r, n, o) => {
|
|
155
|
+
if (o === "image")
|
|
156
156
|
return;
|
|
157
|
-
const
|
|
158
|
-
|
|
157
|
+
const i = l(r) ? r.getAttribute("align") : null;
|
|
158
|
+
i && (e[n] = i);
|
|
159
159
|
}), e;
|
|
160
160
|
}
|
|
161
161
|
const V = /^es-[pm]\d+[trbl]?$/;
|
|
@@ -167,44 +167,50 @@ function W(t) {
|
|
|
167
167
|
return r.length ? r.join(" ") : void 0;
|
|
168
168
|
}
|
|
169
169
|
function Y(t) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
if (!t || !("querySelector" in t))
|
|
171
|
+
return !1;
|
|
172
|
+
const e = t.querySelector(S) ?? t, r = (n) => !!(n && "querySelector" in n && n.querySelector(".product-price") && n.querySelector(".product-old-price"));
|
|
173
|
+
return r(e.querySelector(`[data-attribute-type="${p}"]`)) || r(e.querySelector(`[data-attribute-type="${y}"]`));
|
|
174
|
+
}
|
|
175
|
+
function J(t) {
|
|
176
|
+
const e = {}, r = Y(t);
|
|
177
|
+
return f(t, (n, o, i) => {
|
|
178
|
+
if (i === "image" || r && (o === p || o === y))
|
|
173
179
|
return;
|
|
174
|
-
const
|
|
175
|
-
|
|
180
|
+
const u = W(n);
|
|
181
|
+
u && (e[o] = u);
|
|
176
182
|
}), e;
|
|
177
183
|
}
|
|
178
|
-
function
|
|
184
|
+
function Z(t) {
|
|
179
185
|
const e = {};
|
|
180
186
|
return f(t, (r, n) => {
|
|
181
|
-
if (n !==
|
|
187
|
+
if (n !== C && n !== A || !l(r))
|
|
182
188
|
return;
|
|
183
|
-
const
|
|
184
|
-
(
|
|
189
|
+
const o = r.getAttribute("data-text-before"), i = r.getAttribute("data-text-after");
|
|
190
|
+
(o != null || i != null) && (e[n] = { before: o ?? void 0, after: i ?? void 0 });
|
|
185
191
|
}), e;
|
|
186
192
|
}
|
|
187
|
-
function
|
|
193
|
+
function tt(t) {
|
|
188
194
|
const e = {};
|
|
189
195
|
if (!t || !("querySelector" in t))
|
|
190
196
|
return e;
|
|
191
197
|
const r = t.querySelector(S) ?? t;
|
|
192
|
-
return
|
|
198
|
+
return _(r) && r.querySelectorAll(".recommendation-attribute-row").forEach((n) => {
|
|
193
199
|
if (!l(n))
|
|
194
200
|
return;
|
|
195
|
-
const
|
|
196
|
-
|
|
201
|
+
const o = n.getAttribute("data-attribute-type"), i = n.getAttribute("data-visibility");
|
|
202
|
+
o && i != null && (e[o] = i !== "0");
|
|
197
203
|
}), e;
|
|
198
204
|
}
|
|
199
|
-
function
|
|
205
|
+
function ct(t) {
|
|
200
206
|
return {
|
|
201
207
|
styleTemplates: F(t),
|
|
202
208
|
cardBackgroundColor: j(t),
|
|
203
209
|
cellBackgroundColors: z(t),
|
|
204
210
|
cellAlignments: Q(t),
|
|
205
|
-
cellClasses:
|
|
206
|
-
omnibusTexts:
|
|
207
|
-
visibility:
|
|
211
|
+
cellClasses: J(t),
|
|
212
|
+
omnibusTexts: Z(t),
|
|
213
|
+
visibility: tt(t)
|
|
208
214
|
};
|
|
209
215
|
}
|
|
210
216
|
export {
|
|
@@ -212,8 +218,8 @@ export {
|
|
|
212
218
|
j as captureCardBackgroundColor,
|
|
213
219
|
Q as captureCellAlignments,
|
|
214
220
|
z as captureCellBackgroundColors,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
221
|
+
J as captureCellClasses,
|
|
222
|
+
Z as captureOmnibusTexts,
|
|
223
|
+
ct as captureStyles,
|
|
224
|
+
tt as captureVisibility
|
|
219
225
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const l = [
|
|
2
2
|
{
|
|
3
3
|
key: "locale",
|
|
4
4
|
getValue: (e) => e.language,
|
|
@@ -7,27 +7,28 @@ const u = [
|
|
|
7
7
|
{
|
|
8
8
|
key: "currency",
|
|
9
9
|
getValue: (e) => e.currencySettings.value,
|
|
10
|
-
getAvailableOptions: (e) => e.currencyList.map((n) => n.text)
|
|
10
|
+
getAvailableOptions: (e) => e.currencyList.map((n) => n.text),
|
|
11
|
+
canBeEmpty: !0
|
|
11
12
|
}
|
|
12
|
-
],
|
|
13
|
-
function
|
|
14
|
-
return
|
|
15
|
-
var
|
|
13
|
+
], o = "newsletter.recommendation-fill-required-fields";
|
|
14
|
+
function c(e, n, i = l) {
|
|
15
|
+
return i.filter((t) => {
|
|
16
|
+
var u;
|
|
16
17
|
if (t.condition && !t.condition(e))
|
|
17
18
|
return !1;
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
return !
|
|
21
|
-
const
|
|
22
|
-
return r !== void 0 && !r.includes(
|
|
19
|
+
const r = (u = t.getAvailableOptions) == null ? void 0 : u.call(t, n);
|
|
20
|
+
if (t.canBeEmpty && (r == null ? void 0 : r.length) === 0)
|
|
21
|
+
return !1;
|
|
22
|
+
const a = t.getValue(e);
|
|
23
|
+
return a ? r !== void 0 && !r.includes(a) : !0;
|
|
23
24
|
}).map((t) => t.key);
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
26
|
+
function s(e, n) {
|
|
27
|
+
return c(e, n).length === 0;
|
|
27
28
|
}
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
l as REQUIRED_RECOMMENDATION_FIELDS,
|
|
31
|
+
o as RecommendationRequiredFieldsKey,
|
|
32
|
+
c as getInvalidFields,
|
|
33
|
+
s as isConfigValid
|
|
33
34
|
};
|