@useinsider/guido 3.21.0-beta.78e343a → 3.21.0-beta.8a9421f
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/README.md +34 -4
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +118 -108
- package/dist/composables/useEditorOpenMetrics.js +164 -0
- package/dist/composables/useStripo.js +94 -82
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +53 -55
- package/dist/extensions/Blocks/Recommendation/block.js +211 -148
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +16 -60
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +15 -16
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +52 -31
- package/dist/guido.css +1 -1
- package/dist/library.js +12 -10
- package/dist/package.json.js +6 -4
- package/dist/public/prefetchRuntime.js +4 -0
- package/dist/src/composables/useEditorOpenMetrics.d.ts +27 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +23 -8
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +17 -30
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +11 -0
- package/dist/src/library.d.ts +1 -0
- package/dist/src/public/prefetchRuntime.d.ts +1 -0
- package/dist/src/utils/runtimePrefetch.d.ts +4 -0
- package/dist/src/utils/stripoRuntime.d.ts +2 -0
- package/dist/static/stripo-runtime-manifest.json.js +9 -0
- package/dist/utils/runtimePrefetch.js +26 -0
- package/dist/utils/stripoRuntime.js +9 -0
- package/package.json +6 -1
|
@@ -1,44 +1,55 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { useActionsApi as H } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as N } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as j } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as _ } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useEditorOpenMetrics as z } from "./useEditorOpenMetrics.js";
|
|
6
|
+
import { useFullStoryBridge as $ } from "./useFullStoryBridge.js";
|
|
7
|
+
import { useModuleRepair as G } from "./useModuleRepair.js";
|
|
8
|
+
import { useStripoEventHandler as X } from "./useStripoEventHandler.js";
|
|
9
|
+
import { useStripoNotifications as J } from "./useStripoNotifications.js";
|
|
10
|
+
import { useToaster as K } from "./useToaster.js";
|
|
11
|
+
import { localePatch as Q } from "../config/i18n/index.js";
|
|
12
|
+
import { en as B } from "../config/i18n/en/index.js";
|
|
13
|
+
import { ToasterTypeOptions as W } from "../enums/toaster.js";
|
|
14
|
+
import { useStripoApi as Y } from "../services/stripoApi.js";
|
|
15
|
+
import Z from "../static/styles/customEditorStyle.css.js";
|
|
16
|
+
import { useEditorStore as M } from "../stores/editor.js";
|
|
17
|
+
import { buildMergeTagEntries as ee, flattenDynamicContentList as te } from "../utils/genericUtil.js";
|
|
18
|
+
import { getStripoRuntimeBaseUrl as oe } from "../utils/stripoRuntime.js";
|
|
19
|
+
let d = null, v = !1;
|
|
20
|
+
const be = () => {
|
|
21
|
+
const { features: u, template: m, isFeatureEnabled: p } = j(), { handleError: f, showToaster: T } = K(), { getToken: F, getCustomFonts: A, getSyncModulesStatus: P } = Y(), { handleEvent: R } = X(), { handleModuleAdd: U } = G(), { getStripoBlocksConfig: V } = N(), { getStripoNotifications: D } = J(), e = z(), g = () => d || (d = new Promise((s, a) => {
|
|
22
22
|
if (document.getElementById("UiEditorScript")) {
|
|
23
|
-
|
|
23
|
+
s();
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
const i = oe();
|
|
27
|
+
if (!i) {
|
|
28
|
+
a(
|
|
29
|
+
new Error("guido.stripo.version is not set in package.json. Please configure the Stripo version.")
|
|
30
|
+
);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const n = `${i}UIEditor.js`, t = document.createElement("script");
|
|
34
|
+
t.id = "UiEditorScript", t.type = "module", t.src = n, t.onload = () => {
|
|
35
|
+
v = !0, s();
|
|
36
|
+
}, t.onerror = () => {
|
|
37
|
+
t.remove(), a(new Error(`Failed to load Stripo UIEditor script from S3: ${n}`));
|
|
38
|
+
}, document.body.appendChild(t);
|
|
39
|
+
}), d.catch(() => {
|
|
40
|
+
d = null;
|
|
41
|
+
}), d), I = async (s, a, i, n = [], t = !1) => {
|
|
42
|
+
var C, w, k, b;
|
|
43
|
+
const o = M(), { html: c, css: S } = s, { baseBlocks: y, extensions: L } = await V();
|
|
44
|
+
e.mark("blocks_config_ready");
|
|
45
|
+
const E = ((C = u.value) == null ? void 0 : C.displayConditions) ?? !0, O = ((w = u.value) == null ? void 0 : w.modulesDisabled) ?? !1, h = !!c || (((k = m.value) == null ? void 0 : k.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
46
|
+
e.setTemplate({ html: c, css: S, forceRecreate: h }), _().importCss(), e.mark("init_editor"), await window.UIEditor.initEditor(
|
|
36
47
|
document.querySelector("#guido-editor"),
|
|
37
48
|
{
|
|
38
|
-
metadata:
|
|
39
|
-
html:
|
|
40
|
-
css:
|
|
41
|
-
forceRecreate:
|
|
49
|
+
metadata: a,
|
|
50
|
+
html: c,
|
|
51
|
+
css: S,
|
|
52
|
+
forceRecreate: h,
|
|
42
53
|
locale: "en",
|
|
43
54
|
undoButtonSelector: "#guido__undo-button",
|
|
44
55
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -48,12 +59,12 @@ const he = () => {
|
|
|
48
59
|
customAppearanceMergetags: !p("liquidSyntax"),
|
|
49
60
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
50
61
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
51
|
-
customViewStyles:
|
|
52
|
-
conditionsEnabled:
|
|
53
|
-
customConditionsEnabled:
|
|
62
|
+
customViewStyles: Z,
|
|
63
|
+
conditionsEnabled: E,
|
|
64
|
+
customConditionsEnabled: E,
|
|
54
65
|
enableXSSSecurity: !0,
|
|
55
|
-
modulesDisabled:
|
|
56
|
-
syncModulesEnabled:
|
|
66
|
+
modulesDisabled: O,
|
|
67
|
+
syncModulesEnabled: t,
|
|
57
68
|
messageSettingsEnabled: !0,
|
|
58
69
|
displayGmailAnnotations: !0,
|
|
59
70
|
displayHiddenPreheader: !1,
|
|
@@ -64,54 +75,55 @@ const he = () => {
|
|
|
64
75
|
selectElementAfterDrop: !0,
|
|
65
76
|
sameFontSizeForOutlook: !0,
|
|
66
77
|
allowedScriptSourceDomains: q,
|
|
67
|
-
...
|
|
78
|
+
...y ? { baseBlocks: y } : {},
|
|
68
79
|
editorFonts: {
|
|
69
80
|
showDefaultStandardFonts: !0,
|
|
70
81
|
showDefaultNotStandardFonts: !0,
|
|
71
|
-
customFonts:
|
|
82
|
+
customFonts: n
|
|
72
83
|
},
|
|
73
84
|
mergeTags: [
|
|
74
85
|
{
|
|
75
|
-
entries:
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
entries: ee(
|
|
87
|
+
i.preselectedDynamicContentList,
|
|
88
|
+
te((b = m.value) == null ? void 0 : b.dynamicContentList),
|
|
78
89
|
p("liquidSyntax")
|
|
79
90
|
)
|
|
80
91
|
}
|
|
81
92
|
],
|
|
82
|
-
async onTokenRefreshRequest(
|
|
93
|
+
async onTokenRefreshRequest(r) {
|
|
83
94
|
try {
|
|
84
|
-
|
|
85
|
-
|
|
95
|
+
e.mark("token_start");
|
|
96
|
+
const l = await F();
|
|
97
|
+
e.mark("token_end"), r(l);
|
|
86
98
|
} catch (l) {
|
|
87
|
-
|
|
99
|
+
f(l, "Failed to refresh token");
|
|
88
100
|
}
|
|
89
101
|
},
|
|
90
102
|
onTemplateLoaded() {
|
|
91
103
|
try {
|
|
92
|
-
const { activateCustomViewStyles:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}, 1e3);
|
|
96
|
-
} catch (
|
|
97
|
-
|
|
104
|
+
const { activateCustomViewStyles: r, updateTimerInClonedTemplate: l } = H(), { injectFullStory: x } = $();
|
|
105
|
+
_().importCss(), r(), x(), l(), i.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
|
|
106
|
+
o.hasChanges = !1;
|
|
107
|
+
}, 1e3), e.markReady();
|
|
108
|
+
} catch (r) {
|
|
109
|
+
f(r, "Failed to load custom interface appearance");
|
|
98
110
|
}
|
|
99
111
|
},
|
|
100
|
-
onCodeEditorVisibilityChanged(
|
|
101
|
-
|
|
112
|
+
onCodeEditorVisibilityChanged(r) {
|
|
113
|
+
o.isCodeEditorOpen = r;
|
|
102
114
|
},
|
|
103
|
-
onEditorVisualModeChanged(
|
|
104
|
-
|
|
115
|
+
onEditorVisualModeChanged(r) {
|
|
116
|
+
o.editorVisualMode = r.toLowerCase();
|
|
105
117
|
},
|
|
106
|
-
onVersionHistoryVisibilityChanged(
|
|
107
|
-
|
|
118
|
+
onVersionHistoryVisibilityChanged(r) {
|
|
119
|
+
o.isVersionHistoryOpen = r;
|
|
108
120
|
},
|
|
109
121
|
onDataChanged() {
|
|
110
|
-
|
|
122
|
+
o.hasChanges = !0, o.changeSeq += 1;
|
|
111
123
|
},
|
|
112
|
-
onEvent:
|
|
113
|
-
onModuleAdd:
|
|
114
|
-
notifications:
|
|
124
|
+
onEvent: R,
|
|
125
|
+
onModuleAdd: U,
|
|
126
|
+
notifications: D(),
|
|
115
127
|
// Stripo deselects the block on any click outside the canvas, so every surface
|
|
116
128
|
// that belongs to the block's own flow has to be listed here (SD-153273).
|
|
117
129
|
ignoreClickOutsideSelectors: [
|
|
@@ -121,35 +133,35 @@ const he = () => {
|
|
|
121
133
|
".in-modal-v2-wrapper",
|
|
122
134
|
".in-toasts-wrapper"
|
|
123
135
|
],
|
|
124
|
-
extensions:
|
|
125
|
-
localePatch:
|
|
136
|
+
extensions: L,
|
|
137
|
+
localePatch: Q
|
|
126
138
|
}
|
|
127
139
|
);
|
|
128
140
|
};
|
|
129
|
-
return { initPlugin: async (
|
|
130
|
-
const
|
|
141
|
+
return { initPlugin: async (s, a, i) => {
|
|
142
|
+
const n = M();
|
|
131
143
|
try {
|
|
132
|
-
await
|
|
133
|
-
const [
|
|
134
|
-
|
|
135
|
-
|
|
144
|
+
e.mark("plugin_start"), e.setScriptPreloaded(v), await g(), e.mark("script_ready");
|
|
145
|
+
const [t, o] = await Promise.all([
|
|
146
|
+
A(),
|
|
147
|
+
P()
|
|
136
148
|
]);
|
|
137
|
-
|
|
149
|
+
e.mark("fonts_sync_ready"), n.syncModulesEnabled = o, await I(s, a, i, t, o);
|
|
138
150
|
} catch {
|
|
139
|
-
|
|
140
|
-
type:
|
|
141
|
-
message:
|
|
151
|
+
n.loadingStatus = !1, T({
|
|
152
|
+
type: W.Error,
|
|
153
|
+
message: B["An error has occurred. Please report the error code to support."],
|
|
142
154
|
actionButton: {
|
|
143
|
-
text:
|
|
155
|
+
text: B["Reload page"],
|
|
144
156
|
onClick: () => window.location.reload()
|
|
145
157
|
}
|
|
146
|
-
});
|
|
158
|
+
}), e.markFailed();
|
|
147
159
|
}
|
|
148
160
|
}, preloadRuntime: () => {
|
|
149
|
-
|
|
161
|
+
g().catch(() => {
|
|
150
162
|
});
|
|
151
163
|
} };
|
|
152
164
|
};
|
|
153
165
|
export {
|
|
154
|
-
|
|
166
|
+
be as useStripo
|
|
155
167
|
};
|
|
@@ -7,13 +7,13 @@ function L(t, r, e, o, c = "") {
|
|
|
7
7
|
const i = `{{${c}${t}_${r}_${e}}}`, n = `{{${c}${t}_${r}_currency}}`;
|
|
8
8
|
return o === "before" ? `${n} ${i}` : `${i} ${n}`;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function _(t) {
|
|
11
11
|
let r = t;
|
|
12
12
|
for (; r.children.length === 1; )
|
|
13
13
|
[r] = r.children;
|
|
14
14
|
return r;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function A(t, r, e, o, c, i) {
|
|
17
17
|
switch (r) {
|
|
18
18
|
case "productImage": {
|
|
19
19
|
const n = t.querySelector("img");
|
|
@@ -24,7 +24,7 @@ function y(t, r, e, o, c, i) {
|
|
|
24
24
|
}
|
|
25
25
|
case "productName": {
|
|
26
26
|
const n = t.querySelector("p");
|
|
27
|
-
n && (
|
|
27
|
+
n && (_(n).textContent = `{{${i}${e}_${o}_name}}`);
|
|
28
28
|
break;
|
|
29
29
|
}
|
|
30
30
|
// Inline mode ("Move to next line" OFF) merges BOTH prices into one row
|
|
@@ -32,16 +32,16 @@ function y(t, r, e, o, c, i) {
|
|
|
32
32
|
// substitute by cell content, not by the row's anchor (SD-145161).
|
|
33
33
|
case "productPrice":
|
|
34
34
|
case "productOldPrice": {
|
|
35
|
-
const n = (
|
|
36
|
-
|
|
35
|
+
const n = (l, d) => {
|
|
36
|
+
l && (_(l).textContent = L(
|
|
37
37
|
e,
|
|
38
38
|
o,
|
|
39
|
-
|
|
39
|
+
d,
|
|
40
40
|
c,
|
|
41
41
|
i
|
|
42
42
|
));
|
|
43
|
-
}, s = t.querySelector(".product-price p"),
|
|
44
|
-
n(s ?? (r === "productPrice" ? u : null), "price"), n(
|
|
43
|
+
}, s = t.querySelector(".product-price p"), a = t.querySelector(".product-old-price p"), u = !s && !a ? t.querySelector("p") : null;
|
|
44
|
+
n(s ?? (r === "productPrice" ? u : null), "price"), n(a ?? (r === "productOldPrice" ? u : null), "original_price");
|
|
45
45
|
break;
|
|
46
46
|
}
|
|
47
47
|
case "productButton": {
|
|
@@ -70,8 +70,8 @@ function y(t, r, e, o, c, i) {
|
|
|
70
70
|
default: {
|
|
71
71
|
const n = t.getAttribute("product-attr") ? t : t.querySelector("[product-attr]");
|
|
72
72
|
if (n) {
|
|
73
|
-
const s = n.getAttribute("product-attr"),
|
|
74
|
-
|
|
73
|
+
const s = n.getAttribute("product-attr"), a = n.querySelector("p");
|
|
74
|
+
a && (_(a).textContent = `{{${i}${e}_${o}_${s}}}`);
|
|
75
75
|
}
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
@@ -88,54 +88,54 @@ function b(t, r, e, o) {
|
|
|
88
88
|
function R(t, r, e) {
|
|
89
89
|
return b(t, r, 0, e);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function D(t, r, e, o) {
|
|
92
92
|
if (!t.innerHTML.includes("{{"))
|
|
93
93
|
return;
|
|
94
94
|
const { open: c, close: i } = b(t.ownerDocument, r, e, o);
|
|
95
95
|
t.insertBefore(c, t.firstChild), t.appendChild(i);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function w(t, r, e, o) {
|
|
98
98
|
var n, s;
|
|
99
99
|
if (!t.innerHTML.includes("{{"))
|
|
100
100
|
return;
|
|
101
101
|
const { open: c, close: i } = b(t.ownerDocument, r, e, o);
|
|
102
102
|
(n = t.parentNode) == null || n.insertBefore(c, t), (s = t.parentNode) == null || s.insertBefore(i, t.nextSibling);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function W(t, r, e, o) {
|
|
105
105
|
t.querySelectorAll(".recommendation-product-row").forEach((i, n) => {
|
|
106
|
-
i.querySelectorAll("[data-attribute-type]").forEach((
|
|
107
|
-
const u =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}) :
|
|
111
|
-
}),
|
|
106
|
+
i.querySelectorAll("[data-attribute-type]").forEach((a) => {
|
|
107
|
+
const u = a.getAttribute("data-attribute-type") || "", l = a.querySelectorAll(".attribute-cell");
|
|
108
|
+
l.length > 0 ? l.forEach((d) => {
|
|
109
|
+
A(d, u, r, n, e, o);
|
|
110
|
+
}) : A(a, u, r, n, e, o);
|
|
111
|
+
}), w(i, r, n, o);
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function v(t, r, e, o) {
|
|
115
115
|
const c = t.querySelectorAll(".recommendation-product-row");
|
|
116
116
|
if (!c.length)
|
|
117
117
|
return;
|
|
118
118
|
const [i] = c, n = i.querySelector("[data-attribute-type]"), s = n ? n.querySelectorAll(".attribute-cell").length : 1;
|
|
119
|
-
c.forEach((
|
|
120
|
-
|
|
121
|
-
const p =
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
119
|
+
c.forEach((a, u) => {
|
|
120
|
+
a.querySelectorAll("[data-attribute-type]").forEach((d) => {
|
|
121
|
+
const p = d.getAttribute("data-attribute-type") || "";
|
|
122
|
+
d.querySelectorAll(".attribute-cell").forEach((f, m) => {
|
|
123
|
+
const h = u * s + m;
|
|
124
|
+
A(f, p, r, h, e, o), D(f, r, h, o);
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function H(t, r, e, o) {
|
|
130
130
|
t.querySelectorAll(".ins-recommendation-product-container").forEach((i) => {
|
|
131
|
-
|
|
131
|
+
v(i, r, e, o);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
function F(t, r, e) {
|
|
135
135
|
const o = t.getAttribute("data-layout") || "grid", c = t.getAttribute("currency-alignment") || "after";
|
|
136
|
-
o === "list" ?
|
|
136
|
+
o === "list" ? W(t, r, c, e) : H(t, r, c, e);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function y(t, r, e) {
|
|
139
139
|
const o = new RegExp(`${r}\\s*:\\s*(\\d+)\\s*px`, "i"), c = t.match(o);
|
|
140
140
|
return c ? parseInt(c[1]) : e;
|
|
141
141
|
}
|
|
@@ -150,7 +150,7 @@ function C(t) {
|
|
|
150
150
|
const e = (t.getAttribute("style") || "").match(/(?:^|[;\s])width\s*:\s*(\d+(?:\.\d+)?(?:px|%))/i);
|
|
151
151
|
return e && $(e[1]) ? e[1] : null;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function G(t, r) {
|
|
154
154
|
let e = t.parentElement;
|
|
155
155
|
for (; e && e !== r; ) {
|
|
156
156
|
if (e.tagName === "TD" && C(e))
|
|
@@ -159,37 +159,35 @@ function x(t, r) {
|
|
|
159
159
|
}
|
|
160
160
|
return null;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
const r = t.getAttribute("style") || "", e =
|
|
162
|
+
function V(t) {
|
|
163
|
+
const r = t.getAttribute("style") || "", e = y(r, "width", 600), o = y(r, "padding", 0) * 2, c = Math.max(0, e - o);
|
|
164
164
|
c !== 0 && t.querySelectorAll("img.adapt-img").forEach((i) => {
|
|
165
165
|
if (i.hasAttribute("width"))
|
|
166
166
|
return;
|
|
167
|
-
const n =
|
|
167
|
+
const n = G(i, t);
|
|
168
168
|
if (!n)
|
|
169
169
|
return;
|
|
170
|
-
const s = C(n),
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
const m = l && !l.trim().endsWith(";") ? "; " : "";
|
|
177
|
-
i.setAttribute("style", `${l}${m}width: ${a}px`);
|
|
170
|
+
const s = C(n), a = y(n.getAttribute("style") || "", "padding", 0) * 2, u = s.endsWith("%") ? Math.floor(c * parseFloat(s) / 100) : parseInt(s), l = Math.max(1, u - a);
|
|
171
|
+
i.setAttribute("width", String(l));
|
|
172
|
+
const d = i.getAttribute("style") || "";
|
|
173
|
+
if (!/\bwidth\s*:\s*\d/i.test(d)) {
|
|
174
|
+
const p = d && !d.trim().endsWith(";") ? "; " : "";
|
|
175
|
+
i.setAttribute("style", `${d}${p}width: ${l}px`);
|
|
178
176
|
}
|
|
179
177
|
});
|
|
180
178
|
}
|
|
181
|
-
const E = "MSO_MOBILE_HIDE_START",
|
|
182
|
-
function
|
|
179
|
+
const E = "MSO_MOBILE_HIDE_START", U = "MSO_MOBILE_HIDE_END";
|
|
180
|
+
function X(t, r) {
|
|
183
181
|
t.querySelectorAll(q).forEach((e) => {
|
|
184
182
|
var i, n;
|
|
185
183
|
const o = e.querySelector(M);
|
|
186
184
|
if (!o || o.children.length === 0)
|
|
187
185
|
return;
|
|
188
186
|
const c = e.previousSibling;
|
|
189
|
-
(c == null ? void 0 : c.nodeType) === Node.COMMENT_NODE && c.data === E || ((i = e.parentNode) == null || i.insertBefore(r.createComment(E), e), (n = e.parentNode) == null || n.insertBefore(r.createComment(
|
|
187
|
+
(c == null ? void 0 : c.nodeType) === Node.COMMENT_NODE && c.data === E || ((i = e.parentNode) == null || i.insertBefore(r.createComment(E), e), (n = e.parentNode) == null || n.insertBefore(r.createComment(U), e.nextSibling));
|
|
190
188
|
});
|
|
191
189
|
}
|
|
192
|
-
function
|
|
190
|
+
function j(t, r) {
|
|
193
191
|
const e = t.match(/<!DOCTYPE[^>]*>/i);
|
|
194
192
|
return (e ? `${e[0]}
|
|
195
193
|
` : "") + r.documentElement.outerHTML;
|
|
@@ -202,17 +200,17 @@ function Q(t) {
|
|
|
202
200
|
i.recommendationCampaignUrls = {};
|
|
203
201
|
const { isFeatureEnabled: n } = g(), s = n("liquidSyntax") ? "reco_" : "";
|
|
204
202
|
return o.forEach((u) => {
|
|
205
|
-
var
|
|
206
|
-
const
|
|
207
|
-
if (
|
|
208
|
-
if ((
|
|
209
|
-
F(u,
|
|
210
|
-
const { open:
|
|
211
|
-
(
|
|
203
|
+
var d, p, S, f;
|
|
204
|
+
const l = u.getAttribute("recommendation-id");
|
|
205
|
+
if (l) {
|
|
206
|
+
if ((d = u.parentNode) == null || d.insertBefore(e.createComment("REC_START"), u), (p = u.parentNode) == null || p.insertBefore(e.createComment("REC_END"), u.nextSibling), u.querySelectorAll('[data-visibility="0"]').forEach((m) => m.remove()), c(l), X(u, e), !T(u)) {
|
|
207
|
+
F(u, l, s);
|
|
208
|
+
const { open: m, close: h } = R(e, l, s);
|
|
209
|
+
(S = u.parentNode) == null || S.insertBefore(m, u), (f = u.parentNode) == null || f.insertBefore(h, u.nextSibling);
|
|
212
210
|
}
|
|
213
|
-
|
|
211
|
+
V(u);
|
|
214
212
|
}
|
|
215
|
-
}),
|
|
213
|
+
}), j(r, e).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
216
214
|
}
|
|
217
215
|
export {
|
|
218
216
|
L as formatPriceVariable,
|