@useinsider/guido 3.13.1-beta.695671e → 3.13.1-beta.98d403f
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/extensions/Blocks/Checkbox/controls/blockBackground/index.js +9 -0
- package/dist/extensions/Blocks/Checkbox/extension.js +6 -5
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +13 -12
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +16 -16
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +35 -36
- package/dist/extensions/Blocks/Items/template.js +263 -228
- package/dist/extensions/Blocks/RadioButton/controls/blockBackground/index.js +9 -0
- package/dist/extensions/Blocks/RadioButton/extension.js +5 -4
- package/dist/extensions/Blocks/RadioButton/settingsPanel.js +9 -8
- package/dist/extensions/Blocks/controlFactories.js +117 -115
- package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +15 -0
- package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +15 -0
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +15 -0
- package/dist/utils/pairProductVariables.js +24 -27
- package/package.json +1 -1
- package/dist/extensions/Blocks/Items/utils/nameNode.js +0 -4
- package/dist/src/extensions/Blocks/Items/utils/nameNode.d.ts +0 -9
- package/dist/src/utils/unwrapProductNameLink.d.ts +0 -15
- package/dist/utils/unwrapProductNameLink.js +0 -37
|
@@ -1,136 +1,171 @@
|
|
|
1
|
-
import { escapeHtml as
|
|
2
|
-
import { BlockType as
|
|
3
|
-
import { ItemsBlockId as
|
|
4
|
-
import { productPairs as
|
|
5
|
-
import { ItemInCartOptions as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { deriveItemNumber as
|
|
9
|
-
let [
|
|
10
|
-
const
|
|
11
|
-
const l = new RegExp(`${
|
|
12
|
-
return
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { escapeHtml as A } from "../../../utils/htmlEscape.js";
|
|
2
|
+
import { BlockType as O, BlockAttr as N } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { ItemsBlockId as I } from "./enums/controlEnums.js";
|
|
4
|
+
import { productPairs as R, templateFirstLine as Y } from "./enums/productEnums.js";
|
|
5
|
+
import { ItemInCartOptions as j, SETTINGS_ENUMS as m, DefaultConfigValues as M } from "./enums/settingsEnums.js";
|
|
6
|
+
import q from "./layouts/horizontal.html.js";
|
|
7
|
+
import J from "./layouts/vertical.html.js";
|
|
8
|
+
import { deriveItemNumber as Z, escapeReplacement as X } from "./utils/nodeConfigUtils.js";
|
|
9
|
+
let [V] = R.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [F] = R.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [S] = R.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [L] = R.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [g] = R.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
10
|
+
const k = (a, t) => a.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCase().startsWith(t.toLowerCase())).join("; ").replace(/;\s*$/, ""), D = (a) => k(a, "text-align"), w = (a, t) => {
|
|
11
|
+
const l = new RegExp(`${t}\\s*:\\s*([^;]+)`, "i"), s = a.match(l);
|
|
12
|
+
return s ? s[1].trim() : null;
|
|
13
|
+
}, G = (a, t, l) => new RegExp(`(${t}\\s*:\\s*)[^;]+`, "gi").test(a) ? a.replace(
|
|
14
|
+
new RegExp(`(${t}\\s*:\\s*)[^;]+`, "gi"),
|
|
15
|
+
`$1${l}`
|
|
16
|
+
) : a, x = (a) => `<tr>${a}</tr>`, tt = (a, t, l, s) => {
|
|
17
|
+
const n = l || M.productImageHeight, o = (s == null ? void 0 : s.imageVisible) === !1 ? "display: none; " : "";
|
|
18
|
+
return x(`
|
|
16
19
|
<td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
|
|
17
20
|
align="center"
|
|
18
|
-
esd-extension-block-id="${
|
|
21
|
+
esd-extension-block-id="${I.IMAGE}"
|
|
19
22
|
data-slot-1=""
|
|
20
23
|
product-attr="imageSrc"
|
|
21
|
-
data-type="${
|
|
22
|
-
data-number="${
|
|
23
|
-
style="${
|
|
24
|
+
data-type="${a}"
|
|
25
|
+
data-number="${t}"
|
|
26
|
+
style="${o}font-size: 0px;">
|
|
24
27
|
<a class="document-node-component ng-star-inserted"
|
|
25
28
|
target="_blank"
|
|
26
29
|
href="#!">
|
|
27
30
|
<img class="adapt-img document-node-component ng-star-inserted"
|
|
28
31
|
style="object-fit: contain;"
|
|
29
|
-
src="${
|
|
32
|
+
src="${V}"
|
|
30
33
|
alt="${F}"
|
|
31
|
-
width="${
|
|
32
|
-
height="${
|
|
34
|
+
width="${n}"
|
|
35
|
+
height="${n}">
|
|
33
36
|
</a>
|
|
34
37
|
</td>
|
|
35
38
|
`);
|
|
36
|
-
},
|
|
37
|
-
<${
|
|
38
|
-
${
|
|
39
|
-
${
|
|
40
|
-
${
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
esd-extension-block-id="${
|
|
39
|
+
}, et = (a, t) => `
|
|
40
|
+
<${O.BLOCK_IMAGE}
|
|
41
|
+
${N.BLOCK_IMAGE.src}="${V}"
|
|
42
|
+
${N.BLOCK_IMAGE.alt}="${F}"
|
|
43
|
+
${N.BLOCK_IMAGE.href}="#!"
|
|
44
|
+
${N.BLOCK_IMAGE.width}="${M.productImageWidth}"
|
|
45
|
+
${N.BLOCK_IMAGE.height}="${M.productImageWidth}"
|
|
46
|
+
esd-extension-block-id="${I.IMAGE}"
|
|
44
47
|
data-slot-1
|
|
45
48
|
product-attr="imageSrc"
|
|
46
|
-
data-type="${
|
|
47
|
-
data-number="${
|
|
49
|
+
data-type="${a}"
|
|
50
|
+
data-number="${t}"
|
|
48
51
|
/>
|
|
49
|
-
`,
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
+
`, at = (a, t, l, s) => {
|
|
53
|
+
const n = `
|
|
54
|
+
text-decoration:none;
|
|
55
|
+
font-size: inherit;
|
|
56
|
+
font-weight: inherit;
|
|
57
|
+
line-height: inherit;
|
|
58
|
+
font-family: inherit;
|
|
59
|
+
color: inherit;
|
|
60
|
+
display: block;
|
|
61
|
+
word-wrap:break-word;
|
|
52
62
|
white-space: nowrap;
|
|
63
|
+
width: 100%;
|
|
53
64
|
overflow: hidden;
|
|
54
65
|
text-overflow: ellipsis;
|
|
55
|
-
width: 100%;
|
|
56
|
-
max-width: 100%;
|
|
57
66
|
`;
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
if (t) {
|
|
68
|
+
const o = w(l || "", "text-align") || "center", i = D(l || n), c = w(i, "color"), r = w(i, "font-size"), $ = w(i, "font-family"), e = w(i, "font-weight"), E = w(i, "font-style"), _ = e === "bold" || e === "700", u = E === "italic", b = [
|
|
69
|
+
c ? `color: ${c}` : "",
|
|
70
|
+
r ? `font-size: ${r}` : "",
|
|
71
|
+
$ ? `font-family: ${$}` : ""
|
|
72
|
+
].filter(Boolean).join("; ");
|
|
73
|
+
let p = G(
|
|
74
|
+
G(i, "color", "inherit"),
|
|
75
|
+
"font-size",
|
|
76
|
+
"inherit"
|
|
77
|
+
);
|
|
78
|
+
p = k(p, "font-weight"), p = k(p, "font-style");
|
|
79
|
+
const P = (s == null ? void 0 : s.nameVisible) === !1 ? "display: none;" : "display: table-cell;";
|
|
80
|
+
let d = `<a
|
|
81
|
+
href="#!"
|
|
82
|
+
style="${A(p)}"
|
|
83
|
+
product-attr="name"
|
|
84
|
+
data-slot-2
|
|
85
|
+
width="100%">
|
|
86
|
+
${F}
|
|
87
|
+
</a>`;
|
|
88
|
+
return _ && (d = `<strong>${d}</strong>`), u && (d = `<em>${d}</em>`), x(`
|
|
68
89
|
<td class="esd-block-text es-p10"
|
|
69
|
-
align="${
|
|
90
|
+
align="${o}"
|
|
70
91
|
width="100%"
|
|
71
92
|
colspan="2"
|
|
72
|
-
data-type="${
|
|
73
|
-
esd-extension-block-id="${
|
|
74
|
-
style="${
|
|
75
|
-
<p contenteditable="false"
|
|
76
|
-
|
|
77
|
-
product-attr="name"
|
|
78
|
-
data-slot-2${_}>
|
|
79
|
-
${$}
|
|
93
|
+
data-type="${a}"
|
|
94
|
+
esd-extension-block-id="${I.NAME}"
|
|
95
|
+
style="${P}">
|
|
96
|
+
<p contenteditable="false" path="1"${b ? ` style="${A(b)}"` : ""}>
|
|
97
|
+
${d}
|
|
80
98
|
</p>
|
|
81
99
|
</td>
|
|
82
100
|
`);
|
|
83
101
|
}
|
|
84
|
-
return `<${
|
|
102
|
+
return `<${O.BLOCK_TEXT}
|
|
85
103
|
width="100%"
|
|
86
104
|
align="center"
|
|
87
105
|
colspan="2"
|
|
88
106
|
class="es-p10"
|
|
89
|
-
data-type="${
|
|
90
|
-
esd-extension-block-id="${
|
|
107
|
+
data-type="${a}"
|
|
108
|
+
esd-extension-block-id="${I.NAME}"
|
|
91
109
|
>
|
|
92
|
-
<p contenteditable="false"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
110
|
+
<p contenteditable="false">
|
|
111
|
+
<a
|
|
112
|
+
href="#!"
|
|
113
|
+
style="
|
|
114
|
+
text-decoration:none;
|
|
115
|
+
font-size: inherit;
|
|
116
|
+
font-weight: inherit;
|
|
117
|
+
line-height: inherit;
|
|
118
|
+
font-family: inherit;
|
|
119
|
+
color: inherit;
|
|
120
|
+
display: block;
|
|
121
|
+
word-wrap:break-word;
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
width: 100%;
|
|
124
|
+
overflow: hidden;
|
|
125
|
+
text-overflow: ellipsis;
|
|
126
|
+
"
|
|
127
|
+
product-attr="name"
|
|
128
|
+
data-slot-2
|
|
129
|
+
width="100%">
|
|
130
|
+
${F}
|
|
131
|
+
</a>
|
|
97
132
|
</p>
|
|
98
|
-
</${
|
|
133
|
+
</${O.BLOCK_TEXT}>
|
|
99
134
|
`;
|
|
100
|
-
},
|
|
101
|
-
let
|
|
102
|
-
if (
|
|
103
|
-
const
|
|
104
|
-
|
|
135
|
+
}, st = (a, t, l, s, n, o, i, c, r, $) => {
|
|
136
|
+
let e = S;
|
|
137
|
+
if (s && s.trim()) {
|
|
138
|
+
const d = `${s.trim()}`;
|
|
139
|
+
e = (n || "0") === "1" ? `${S} ${d}` : `${d} ${S}`;
|
|
105
140
|
}
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
const
|
|
109
|
-
return
|
|
110
|
-
<td class="esd-block-text items-block-price${
|
|
141
|
+
const E = n === "1" ? "after" : "before", _ = `data-formated="${l ? "true" : "false"}"`, u = `data-curency="${E}"`, b = s ? `data-currency_symbol="${s}"` : "", p = `data-single_price="${c ? "true" : "false"}"`, T = r === m.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
142
|
+
if (o) {
|
|
143
|
+
const h = D(i || "color: #060606; white-space: nowrap; font-size: 20px;"), y = $ ? "" : ' style="display: none;"';
|
|
144
|
+
return x(`
|
|
145
|
+
<td class="esd-block-text items-block-price${T}"
|
|
111
146
|
align="center"
|
|
112
|
-
esd-extension-block-id="${
|
|
147
|
+
esd-extension-block-id="${I.PRICE}"
|
|
113
148
|
width="100%"
|
|
114
|
-
${
|
|
149
|
+
${y}>
|
|
115
150
|
<p product-attr="price"
|
|
116
151
|
contenteditable="false"
|
|
117
152
|
data-slot-4
|
|
118
|
-
data-type="${
|
|
119
|
-
data-number="${
|
|
120
|
-
${T}
|
|
153
|
+
data-type="${a}"
|
|
154
|
+
data-number="${t}"
|
|
121
155
|
${_}
|
|
122
|
-
${$}
|
|
123
156
|
${u}
|
|
124
|
-
|
|
125
|
-
${
|
|
157
|
+
${b}
|
|
158
|
+
${p}
|
|
159
|
+
style="${A(h)}">
|
|
160
|
+
${e}
|
|
126
161
|
</p>
|
|
127
162
|
</td>
|
|
128
163
|
`);
|
|
129
164
|
}
|
|
130
165
|
return `
|
|
131
|
-
<${
|
|
132
|
-
esd-extension-block-id="${
|
|
133
|
-
class="items-block-price ${
|
|
166
|
+
<${O.BLOCK_TEXT}
|
|
167
|
+
esd-extension-block-id="${I.PRICE}"
|
|
168
|
+
class="items-block-price ${T}"
|
|
134
169
|
width="100%"
|
|
135
170
|
align="center"
|
|
136
171
|
>
|
|
@@ -138,123 +173,123 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
138
173
|
product-attr="price"
|
|
139
174
|
contenteditable="false"
|
|
140
175
|
data-slot-4
|
|
141
|
-
data-type="${
|
|
142
|
-
data-number="${
|
|
143
|
-
${T}
|
|
176
|
+
data-type="${a}"
|
|
177
|
+
data-number="${t}"
|
|
144
178
|
${_}
|
|
145
|
-
${a ? `data-currency_symbol="${a}"` : ""}
|
|
146
179
|
${u}
|
|
180
|
+
${s ? `data-currency_symbol="${s}"` : ""}
|
|
181
|
+
${p}
|
|
147
182
|
>
|
|
148
|
-
${
|
|
183
|
+
${e}
|
|
149
184
|
</p>
|
|
150
|
-
</${
|
|
185
|
+
</${O.BLOCK_TEXT}>
|
|
151
186
|
`;
|
|
152
|
-
},
|
|
153
|
-
let
|
|
154
|
-
if (
|
|
155
|
-
const
|
|
156
|
-
|
|
187
|
+
}, lt = (a, t, l, s, n, o, i = !0, c, r, $) => {
|
|
188
|
+
let e = L;
|
|
189
|
+
if (s && s.trim()) {
|
|
190
|
+
const d = `${s.trim()}`;
|
|
191
|
+
e = (n || "0") === "1" ? `${L} ${d}` : `${d} ${L}`;
|
|
157
192
|
}
|
|
158
|
-
const
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
return
|
|
162
|
-
<td class="esd-block-text items-block-price${
|
|
163
|
-
esd-extension-block-id="${
|
|
193
|
+
const E = n === "1" ? "after" : "before", _ = `data-formated="${l ? "true" : "false"}"`, u = `data-curency="${E}"`, b = i ? "" : ' style="display: none;"', p = `data-single_price="${r ? "true" : "false"}"`, T = $ === m.ORIENTATION.VERTICAL ? " es-p10b es-p10t" : "";
|
|
194
|
+
if (o) {
|
|
195
|
+
const h = D(c || "color: #cc0000; white-space: nowrap; font-size: 19px;");
|
|
196
|
+
return x(`
|
|
197
|
+
<td class="esd-block-text items-block-price${T}"
|
|
198
|
+
esd-extension-block-id="${I.ORIGINAL_PRICE}"
|
|
164
199
|
width="100%"
|
|
165
|
-
align="center"${
|
|
200
|
+
align="center"${b}>
|
|
166
201
|
<p
|
|
167
202
|
product-attr="originalPrice"
|
|
168
203
|
contenteditable="false"
|
|
169
204
|
data-slot-5
|
|
170
|
-
data-type="${
|
|
171
|
-
data-number="${
|
|
172
|
-
${T}
|
|
205
|
+
data-type="${a}"
|
|
206
|
+
data-number="${t}"
|
|
173
207
|
${_}
|
|
174
|
-
${a ? `data-currency_symbol="${a}"` : ""}
|
|
175
208
|
${u}
|
|
176
|
-
|
|
177
|
-
|
|
209
|
+
${s ? `data-currency_symbol="${s}"` : ""}
|
|
210
|
+
${p}
|
|
211
|
+
style="${A(h)}">
|
|
212
|
+
<s>${e}</s>
|
|
178
213
|
</p>
|
|
179
214
|
</td>
|
|
180
215
|
`);
|
|
181
216
|
}
|
|
182
217
|
return `
|
|
183
|
-
<${
|
|
184
|
-
class="items-block-price ${
|
|
185
|
-
esd-extension-block-id="${
|
|
218
|
+
<${O.BLOCK_TEXT}
|
|
219
|
+
class="items-block-price ${T}"
|
|
220
|
+
esd-extension-block-id="${I.ORIGINAL_PRICE}"
|
|
186
221
|
width="100%"
|
|
187
222
|
align="center"
|
|
188
|
-
${
|
|
223
|
+
${i ? "" : 'style="display: none;"'}
|
|
189
224
|
>
|
|
190
225
|
<p
|
|
191
226
|
product-attr="originalPrice"
|
|
192
227
|
contenteditable="false"
|
|
193
228
|
data-slot-5
|
|
194
229
|
style="color: #cc0000"
|
|
195
|
-
data-type="${
|
|
196
|
-
data-number="${
|
|
197
|
-
${T}
|
|
230
|
+
data-type="${a}"
|
|
231
|
+
data-number="${t}"
|
|
198
232
|
${_}
|
|
199
|
-
${a ? `data-currency_symbol="${a}"` : ""}
|
|
200
233
|
${u}
|
|
234
|
+
${s ? `data-currency_symbol="${s}"` : ""}
|
|
235
|
+
${p}
|
|
201
236
|
>
|
|
202
|
-
<s>${
|
|
237
|
+
<s>${e}</s>
|
|
203
238
|
</p>
|
|
204
|
-
</${
|
|
239
|
+
</${O.BLOCK_TEXT}>
|
|
205
240
|
`;
|
|
206
|
-
},
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
const
|
|
210
|
-
return
|
|
241
|
+
}, rt = (a = !0, t, l) => {
|
|
242
|
+
const s = a ? "" : 'style="display: none;"';
|
|
243
|
+
if (t) {
|
|
244
|
+
const n = "font-size: 14px;", o = w(l || "", "text-align") || "center", i = D(l || n);
|
|
245
|
+
return x(`
|
|
211
246
|
<td class="esd-block-text es-p10 document-node-component default-block-component selectable"
|
|
212
|
-
width="100%" align="${
|
|
213
|
-
esd-extension-block-id="${
|
|
214
|
-
${
|
|
247
|
+
width="100%" align="${o}"
|
|
248
|
+
esd-extension-block-id="${I.QUANTITY}"
|
|
249
|
+
${s}>
|
|
215
250
|
<p product-attr="quantity"
|
|
216
251
|
data-slot-3=""
|
|
217
252
|
contenteditable="false"
|
|
218
253
|
width="100%"
|
|
219
254
|
path="1"
|
|
220
|
-
style="${
|
|
221
|
-
${
|
|
255
|
+
style="${A(i)}">
|
|
256
|
+
${g}
|
|
222
257
|
</p>
|
|
223
258
|
</td>
|
|
224
259
|
`);
|
|
225
260
|
}
|
|
226
261
|
return `
|
|
227
|
-
<${
|
|
262
|
+
<${O.BLOCK_TEXT}
|
|
228
263
|
width="100%"
|
|
229
264
|
align="center"
|
|
230
265
|
class="es-p10"
|
|
231
|
-
esd-extension-block-id="${
|
|
232
|
-
${
|
|
266
|
+
esd-extension-block-id="${I.QUANTITY}"
|
|
267
|
+
${a ? "" : 'style="display: none;"'}
|
|
233
268
|
>
|
|
234
269
|
<p
|
|
235
270
|
product-attr="quantity"
|
|
236
271
|
data-slot-3
|
|
237
272
|
contenteditable="false"
|
|
238
273
|
width="100%">
|
|
239
|
-
${
|
|
274
|
+
${g}
|
|
240
275
|
</p>
|
|
241
|
-
</${
|
|
276
|
+
</${O.BLOCK_TEXT}>
|
|
242
277
|
`;
|
|
243
|
-
},
|
|
244
|
-
if (
|
|
245
|
-
const c =
|
|
246
|
-
return
|
|
278
|
+
}, it = (a, t, l = "Buy", s, n, o = !0, i = !0) => {
|
|
279
|
+
if (s) {
|
|
280
|
+
const c = w(n || "", "background") || w(n || "", "background-color"), r = c ? `border-width: 0px; background: ${c};` : "border-width: 0px;", $ = o ? "es-fw" : "es-il", e = (n || "").replace("border-width: 0;", "");
|
|
281
|
+
return x(`
|
|
247
282
|
<td class="esd-block-button ins-button default-block-component selectable"
|
|
248
283
|
align="center" width="100%" name="buy-button" caption="${l}"
|
|
249
|
-
esd-extension-block-id="${
|
|
250
|
-
product-attr="button" data-slot-6="" data-type="${
|
|
251
|
-
${
|
|
252
|
-
<span class="es-button-border ${
|
|
284
|
+
esd-extension-block-id="${I.BUTTON}"
|
|
285
|
+
product-attr="button" data-slot-6="" data-type="${a}" data-number="${t}"
|
|
286
|
+
${i ? "" : ' style="display: none;"'}>
|
|
287
|
+
<span class="es-button-border ${$}" style="${A(r)}">
|
|
253
288
|
<a
|
|
254
289
|
class="es-button"
|
|
255
290
|
href="#!"
|
|
256
291
|
target="_blank"
|
|
257
|
-
style="${
|
|
292
|
+
style="${A(e)} padding: 5px 12px;">
|
|
258
293
|
${l}
|
|
259
294
|
</a>
|
|
260
295
|
</span>
|
|
@@ -262,151 +297,151 @@ const D = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
262
297
|
`);
|
|
263
298
|
}
|
|
264
299
|
return `
|
|
265
|
-
<${
|
|
300
|
+
<${O.BLOCK_BUTTON}
|
|
266
301
|
width="100%"
|
|
267
302
|
class="ins-button"
|
|
268
303
|
name="buy-button"
|
|
269
304
|
caption="${l}"
|
|
270
305
|
align="center"
|
|
271
|
-
esd-extension-block-id="${
|
|
306
|
+
esd-extension-block-id="${I.BUTTON}"
|
|
272
307
|
product-attr="button"
|
|
273
308
|
data-slot-6
|
|
274
|
-
data-type="${
|
|
275
|
-
data-number="${
|
|
309
|
+
data-type="${a}"
|
|
310
|
+
data-number="${t}"
|
|
276
311
|
>${l}
|
|
277
|
-
</${
|
|
312
|
+
</${O.BLOCK_BUTTON}>
|
|
278
313
|
`;
|
|
279
|
-
}, ct = (
|
|
280
|
-
const
|
|
281
|
-
if (
|
|
282
|
-
const c = !
|
|
283
|
-
let
|
|
314
|
+
}, ct = (a, t, l, s = !0, n = !0) => {
|
|
315
|
+
const o = t === m.ORIENTATION.VERTICAL, i = l === "horizontal";
|
|
316
|
+
if (o) {
|
|
317
|
+
const c = !i, r = c || !n ? "100%" : "50%", $ = c || !s ? "100%" : "50%";
|
|
318
|
+
let e = a.replace(
|
|
284
319
|
/<td\s+[^>]*class="([^"]*product-price-class[^"]*)"[^>]*>/gi,
|
|
285
|
-
(
|
|
320
|
+
(E) => E.replace(/width="[^"]*"/gi, `width="${r}"`).replace(/width:\s*[^;]+;/gi, `width: ${r};`)
|
|
286
321
|
);
|
|
287
|
-
return
|
|
322
|
+
return e = e.replace(
|
|
288
323
|
/<td\s+[^>]*class="([^"]*product-original-price-class[^"]*)"[^>]*>/gi,
|
|
289
|
-
(
|
|
290
|
-
),
|
|
324
|
+
(E) => E.replace(/width="[^"]*"/gi, `width="${$}"`).replace(/width:\s*[^;]+;/gi, `width: ${$};`)
|
|
325
|
+
), e;
|
|
291
326
|
}
|
|
292
|
-
return
|
|
327
|
+
return i ? a : a.replace(
|
|
293
328
|
/<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
|
|
294
329
|
(c) => /style\s*=\s*"/i.test(c) ? c.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : c.replace(/>$/, ' style="display: none;">')
|
|
295
330
|
).replace(
|
|
296
331
|
/<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
|
|
297
332
|
(c) => c.replace(/display:\s*none;?/gi, "display: table-cell;")
|
|
298
333
|
);
|
|
299
|
-
},
|
|
334
|
+
}, nt = (a) => a ? `<td align="center"
|
|
300
335
|
esd-extension-block-id="items-block"
|
|
301
|
-
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : Y,
|
|
302
|
-
const
|
|
336
|
+
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : Y, z = (a, t, l, s, n, o, i, c, r, $, e, E, _, u = "horizontal", b, p, P, T) => {
|
|
337
|
+
const y = `${`data-type="${t}" data-number="${l}"`} data-orientation="${s}"`, U = r == null ? void 0 : r["data-product_image_control_image-height"], K = o ? tt(t, l, U, e) : et(t, l), B = (e == null ? void 0 : e.buttonLabel) || "Buy", W = (e == null ? void 0 : e.buttonFullWidth) !== void 0 ? e.buttonFullWidth : !0, Q = t === m.ITEMS_TYPE.BROWSED_ITEMS ? !1 : e == null ? void 0 : e.quantityControlEnabled, C = (e == null ? void 0 : e.buttonVisible) !== void 0 ? e.buttonVisible : (r == null ? void 0 : r["data-product_button_control_enabled"]) !== "false", f = (e == null ? void 0 : e.priceVisible) !== void 0 ? e.priceVisible : (r == null ? void 0 : r["data-product_price_control_enabled"]) !== "false", v = (e == null ? void 0 : e.originalPriceVisible) !== void 0 ? e.originalPriceVisible : (r == null ? void 0 : r["data-product_original_price_control_enabled"]) !== "false", H = a.replace("{-{-TEMPLATE_FIRST_LINE-}-}", nt(o)).replace("{-{-PRODUCT_IMAGE-}-}", K).replace("{-{-PRODUCT_NAME-}-}", at(t, o, E, e)).replaceAll(
|
|
303
338
|
"{-{-PRODUCT_PRICE-}-}",
|
|
304
|
-
|
|
305
|
-
|
|
339
|
+
X(st(
|
|
340
|
+
t,
|
|
306
341
|
l,
|
|
307
|
-
i,
|
|
308
342
|
n,
|
|
343
|
+
i,
|
|
309
344
|
c,
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
345
|
+
o,
|
|
346
|
+
b,
|
|
347
|
+
T,
|
|
348
|
+
s,
|
|
349
|
+
f
|
|
315
350
|
))
|
|
316
351
|
).replaceAll(
|
|
317
352
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
318
|
-
|
|
319
|
-
|
|
353
|
+
X(lt(
|
|
354
|
+
t,
|
|
320
355
|
l,
|
|
321
|
-
i,
|
|
322
356
|
n,
|
|
357
|
+
i,
|
|
323
358
|
c,
|
|
324
|
-
|
|
359
|
+
o,
|
|
325
360
|
v,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
361
|
+
p,
|
|
362
|
+
T,
|
|
363
|
+
s
|
|
329
364
|
))
|
|
330
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}",
|
|
365
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", rt(Q, o, P)).replace(
|
|
331
366
|
"{-{-PRODUCT_BUTTON-}-}",
|
|
332
|
-
|
|
367
|
+
it(t, l, B, o, _, W, C)
|
|
333
368
|
).replace(
|
|
334
369
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
335
|
-
`<td$1 ${
|
|
370
|
+
`<td$1 ${y}>`
|
|
336
371
|
);
|
|
337
372
|
return ct(
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
373
|
+
H,
|
|
374
|
+
s,
|
|
375
|
+
u,
|
|
376
|
+
f,
|
|
342
377
|
v
|
|
343
378
|
);
|
|
344
379
|
};
|
|
345
|
-
function
|
|
346
|
-
orientation:
|
|
347
|
-
itemsType:
|
|
380
|
+
function ht({
|
|
381
|
+
orientation: a,
|
|
382
|
+
itemsType: t = m.ITEMS_TYPE.CART_ITEMS,
|
|
348
383
|
itemId: l,
|
|
349
|
-
currencySymbol:
|
|
350
|
-
currencyLocation:
|
|
351
|
-
migrate:
|
|
352
|
-
formattedPrice:
|
|
384
|
+
currencySymbol: s,
|
|
385
|
+
currencyLocation: n,
|
|
386
|
+
migrate: o = !1,
|
|
387
|
+
formattedPrice: i = !0,
|
|
353
388
|
configBlockAttributes: c,
|
|
354
389
|
nodeConfig: r,
|
|
355
|
-
nameStyles:
|
|
356
|
-
buttonStyles:
|
|
357
|
-
priceStyles:
|
|
358
|
-
originalPriceStyles:
|
|
359
|
-
quantityStyles:
|
|
360
|
-
priceOrientation:
|
|
390
|
+
nameStyles: $,
|
|
391
|
+
buttonStyles: e,
|
|
392
|
+
priceStyles: E,
|
|
393
|
+
originalPriceStyles: _,
|
|
394
|
+
quantityStyles: u,
|
|
395
|
+
priceOrientation: b
|
|
361
396
|
}) {
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
return
|
|
368
|
-
|
|
369
|
-
|
|
397
|
+
const p = j[t].findIndex((U) => U.value === l), P = Z(l, t), T = (r == null ? void 0 : r.priceSinglePrice) ?? (c == null ? void 0 : c["data-product_price_control_single_price"]) === "1" ?? !1;
|
|
398
|
+
V = R.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[p >= 0 ? p : 0], F = R.PAIRS_FOR_EXTENSION.name[t].DEFAULT[p >= 0 ? p : 0];
|
|
399
|
+
const d = R.PAIRS_FOR_EXTENSION.price[t], h = R.PAIRS_FOR_EXTENSION.originalPrice[t];
|
|
400
|
+
T ? (S = i ? d.DEFAULT_SINGLE_PRICE_FORMATTED : d.DEFAULT_SINGLE_PRICE, L = i ? h.DEFAULT_SINGLE_PRICE_FORMATTED : h.DEFAULT_SINGLE_PRICE) : (S = i ? d.DEFAULT_PRICE_FORMATTED : d.DEFAULT_PRICE, L = i ? h.DEFAULT_PRICE_FORMATTED : h.DEFAULT_PRICE), g = R.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT;
|
|
401
|
+
const y = b || (r == null ? void 0 : r.priceOrientation) || "horizontal";
|
|
402
|
+
return a === m.ORIENTATION.VERTICAL ? z(
|
|
403
|
+
J,
|
|
404
|
+
t,
|
|
370
405
|
P,
|
|
371
|
-
s,
|
|
372
|
-
n,
|
|
373
|
-
d,
|
|
374
406
|
a,
|
|
375
407
|
i,
|
|
408
|
+
o,
|
|
409
|
+
s,
|
|
410
|
+
n,
|
|
376
411
|
c,
|
|
377
412
|
void 0,
|
|
378
413
|
// nodup
|
|
379
414
|
r,
|
|
380
|
-
|
|
381
|
-
t,
|
|
382
|
-
A,
|
|
383
|
-
o,
|
|
384
|
-
T,
|
|
385
|
-
_,
|
|
386
|
-
I
|
|
387
|
-
) : K(
|
|
388
|
-
j,
|
|
415
|
+
$,
|
|
389
416
|
e,
|
|
417
|
+
y,
|
|
418
|
+
E,
|
|
419
|
+
_,
|
|
420
|
+
u,
|
|
421
|
+
T
|
|
422
|
+
) : z(
|
|
423
|
+
q,
|
|
424
|
+
t,
|
|
390
425
|
P,
|
|
391
|
-
s,
|
|
392
|
-
n,
|
|
393
|
-
d,
|
|
394
426
|
a,
|
|
395
427
|
i,
|
|
428
|
+
o,
|
|
429
|
+
s,
|
|
430
|
+
n,
|
|
396
431
|
c,
|
|
397
432
|
void 0,
|
|
398
433
|
// nodup
|
|
399
434
|
r,
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
T,
|
|
435
|
+
$,
|
|
436
|
+
e,
|
|
437
|
+
y,
|
|
438
|
+
E,
|
|
405
439
|
_,
|
|
406
|
-
|
|
440
|
+
u,
|
|
441
|
+
T
|
|
407
442
|
);
|
|
408
443
|
}
|
|
409
444
|
export {
|
|
410
|
-
|
|
411
|
-
|
|
445
|
+
ht as getDefaultTemplate,
|
|
446
|
+
x as wrapInTableRow
|
|
412
447
|
};
|