@useinsider/guido 2.0.0-beta.143201d → 2.0.0-beta.1ba7e26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +2 -2
  2. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  3. package/dist/config/migrator/index.js +9 -8
  4. package/dist/config/migrator/itemsBlockMigrator.js +283 -0
  5. package/dist/extensions/Blocks/Items/block.js +39 -40
  6. package/dist/extensions/Blocks/Items/controls/button/link.js +11 -11
  7. package/dist/extensions/Blocks/Items/controls/cardComposition.js +46 -49
  8. package/dist/extensions/Blocks/Items/controls/image/link.js +8 -8
  9. package/dist/extensions/Blocks/Items/controls/name/trimming.js +13 -15
  10. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +1 -1
  11. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +1 -1
  12. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +15 -17
  13. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +15 -15
  14. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +29 -27
  15. package/dist/extensions/Blocks/Items/controls/settingsControl.js +132 -127
  16. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -2
  17. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +58 -48
  18. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +48 -58
  19. package/dist/extensions/Blocks/Items/store/items-block.js +2 -2
  20. package/dist/extensions/Blocks/Items/template.js +312 -125
  21. package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +172 -0
  22. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +11 -20
  23. package/dist/extensions/Blocks/Recommendation/control.js +1 -1
  24. package/dist/extensions/Blocks/common-control.js +64 -53
  25. package/dist/guido.css +1 -1
  26. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +366 -287
  27. package/dist/package.json.js +1 -1
  28. package/dist/src/config/migrator/itemsBlockMigrator.d.ts +6 -0
  29. package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
  30. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -4
  31. package/dist/src/extensions/Blocks/Items/template.d.ts +20 -1
  32. package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +71 -0
  33. package/dist/src/extensions/Blocks/common-control.d.ts +13 -8
  34. package/package.json +3 -3
@@ -1,65 +1,55 @@
1
1
  const t = `{-{-TEMPLATE_FIRST_LINE-}-}
2
- <table class="es-left ins-product-wrapper ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
2
+ <table class="es-left ins-product-wrapper" cellspacing="0" cellpadding="0" align="left" width="100%">
3
3
  {-{-CONFIG_BLOCK-}-}
4
4
  <tbody>
5
5
  <tr>
6
- <td style="padding: 16px 9px;">
7
- <table class="es-left esdev-disable-select" cellspacing="0" cellpadding="0" align="left" width="100%">
8
- <tbody>
9
- <tr>
10
- <td class="product-image-class" data-slot-1>
11
- {-{-PRODUCT_IMAGE-}-}
12
- </td>
13
- <td class="product-name-class" data-slot-2>
14
- <table>
15
- <tbody>
16
- {-{-PRODUCT_NAME-}-}
17
- </tbody>
18
- </table>
19
- </td>
20
- <td class="product-quantity-class" data-slot-3>
21
- <table width="100%">
22
- <tbody>
23
- {-{-PRODUCT_QUANTITY-}-}
24
- </tbody>
25
- </table>
26
- </td>
27
- <td class="product-price-class horizontal-price" data-slot-4>
28
- <table width="100%">
29
- <tbody>
30
- {-{-PRODUCT_PRICE-}-}
31
- </tbody>
32
- </table>
33
- </td>
34
- <td class="product-original-price-class horizontal-price" data-slot-5>
35
- <table width="100%">
36
- <tbody>
37
- {-{-PRODUCT_ORIGINAL_PRICE-}-}
38
- </tbody>
39
- </table>
40
- </td>
41
- <td class="product-price-container vertical-price" data-slot-4 style="display: none;">
42
- <table class="product-price-class" width="100%" data-slot-4>
43
- <tbody>
44
- {-{-PRODUCT_PRICE-}-}
45
- </tbody>
46
- </table>
47
- <table class="product-original-price-class product-original-price-container"
48
- width="100%" data-slot-5>
49
- <tbody>
50
- {-{-PRODUCT_ORIGINAL_PRICE-}-}
51
- </tbody>
52
- </table>
53
- </td>
54
- <td class="product-button-class" data-slot-6>
55
- <table width="100%">
56
- <tbody>
57
- {-{-PRODUCT_BUTTON-}-}
58
- </tbody>
59
- </table>
60
- </td>
61
- </tr>
62
- </tbody>
6
+ <td class="es-p20b es-p10r es-p10l es-m-p20b es-p10t" width="100%" align="center">
7
+ <table class="ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
8
+ <tr style="vertical-align: top">
9
+ <td colspan="2" width="100%" align="center" data-slot-1>
10
+ <table width="100%">
11
+ <tbody>
12
+ {-{-PRODUCT_IMAGE-}-}
13
+ </tbody>
14
+ </table>
15
+ </td>
16
+ </tr>
17
+ {-{-PRODUCT_NAME-}-}
18
+ <tr>
19
+ <td width="50%" style=" width: 50%;display: block;float: left;" class="product-price-class">
20
+ <table width="100%">
21
+ <tbody>
22
+ {-{-PRODUCT_PRICE-}-}
23
+ </tbody>
24
+ </table>
25
+ </td>
26
+ <td width="50%" style=" width: 50%;display: block;float: left;"
27
+ class="product-original-price-class">
28
+ <table width="100%">
29
+ <tbody>
30
+ {-{-PRODUCT_ORIGINAL_PRICE-}-}
31
+ </tbody>
32
+ </table>
33
+ </td>
34
+ </tr>
35
+ <tr>
36
+ <td width="100%" class="product-quantity-class" data-slot-3>
37
+ <table width="100%">
38
+ <tbody>
39
+ {-{-PRODUCT_QUANTITY-}-}
40
+ </tbody>
41
+ </table>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td width="100%" class="product-button-class" data-slot-6>
46
+ <table width="100%">
47
+ <tbody>
48
+ {-{-PRODUCT_BUTTON-}-}
49
+ </tbody>
50
+ </table>
51
+ </td>
52
+ </tr>
63
53
  </table>
64
54
  </td>
65
55
  </tr>
@@ -9,11 +9,11 @@ const n = (t) => t.replace(/Url\}/, "Image}"), o = (t) => t.replace(/Image\}/, "
9
9
  buttonLink: o(t),
10
10
  orientation: e.cardOrientationControlValue,
11
11
  nameTrimming: !0,
12
- hideDiscount: !1,
12
+ hideDiscount: !0,
13
13
  currencySymbol: "USD",
14
14
  currencyLocation: "0",
15
15
  formattedPrice: !0,
16
- priceOrientation: "horizontal",
16
+ priceOrientation: "vertical",
17
17
  templateData: {
18
18
  imageSrc: "",
19
19
  name: "",
@@ -1,29 +1,100 @@
1
- import { BlockType as l, BlockAttr as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { ItemsBlockId as T } from "./enums/controlEnums.js";
3
- import { productPairs as i, templateFirstLine as N } from "./enums/productEnums.js";
4
- import { ItemInCartOptions as f, SETTINGS_ENUMS as O, DefaultConfigValues as P } from "./enums/settingsEnums.js";
5
- import B from "./layouts/horizontal.html.js";
6
- import g from "./layouts/vertical.html.js";
7
- let [C] = i.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [A] = i.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [p] = i.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [I] = i.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [u] = i.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
8
- const h = (a, t) => `
9
- <${l.BLOCK_IMAGE}
10
- ${_.BLOCK_IMAGE.src}="${C}"
11
- ${_.BLOCK_IMAGE.alt}="${A}"
12
- ${_.BLOCK_IMAGE.href}="#!"
13
- ${_.BLOCK_IMAGE.width}=${P.productImageWidth}
14
- esd-extension-block-id="${T.IMAGE}"
1
+ import { BlockType as u, BlockAttr as R } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { ItemsBlockId as O } from "./enums/controlEnums.js";
3
+ import { productPairs as d, templateFirstLine as z } from "./enums/productEnums.js";
4
+ import { ItemInCartOptions as K, SETTINGS_ENUMS as g, DefaultConfigValues as m } from "./enums/settingsEnums.js";
5
+ import G from "./layouts/horizontal.html.js";
6
+ import Q from "./layouts/vertical.html.js";
7
+ let [k] = d.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [A] = d.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [f] = d.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [y] = d.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [P] = d.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
8
+ const V = (t, e) => t.split(";").map((n) => n.trim()).filter((n) => !n.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), x = (t) => V(t, "text-align"), S = (t, e) => {
9
+ const n = new RegExp(`${e}\\s*:\\s*([^;]+)`, "i"), a = t.match(n);
10
+ return a ? a[1].trim() : null;
11
+ }, N = (t, e, n) => new RegExp(`(${e}\\s*:\\s*)[^;]+`, "gi").test(t) ? t.replace(
12
+ new RegExp(`(${e}\\s*:\\s*)[^;]+`, "gi"),
13
+ `$1${n}`
14
+ ) : t, W = (t, e, n) => {
15
+ const a = n || m.productImageWidth;
16
+ return `
17
+ <td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
18
+ align="center"
19
+ esd-extension-block-id="items-block-image"
20
+ data-slot-1=""
21
+ product-attr="imageSrc"
22
+ data-type="${t}"
23
+ data-number="${e}"
24
+ style="font-size: 0px;">
25
+ <a class="document-node-component ng-star-inserted"
26
+ target="_blank"
27
+ href="#!">
28
+ <img class="adapt-img document-node-component ng-star-inserted"
29
+ src="${k}"
30
+ alt="${A}"
31
+ width="${a}">
32
+ </a>
33
+ </td>
34
+ `;
35
+ }, q = (t, e) => `
36
+ <${u.BLOCK_IMAGE}
37
+ ${R.BLOCK_IMAGE.src}="${k}"
38
+ ${R.BLOCK_IMAGE.alt}="${A}"
39
+ ${R.BLOCK_IMAGE.href}="#!"
40
+ ${R.BLOCK_IMAGE.width}="${m.productImageWidth}"
41
+ ${R.BLOCK_IMAGE.height}="${m.productImageWidth}"
42
+ esd-extension-block-id="${O.IMAGE}"
15
43
  data-slot-1
16
44
  product-attr="imageSrc"
17
- data-type="${a}"
18
- data-number="${t}"
45
+ data-type="${t}"
46
+ data-number="${e}"
19
47
  />
20
- `, F = (a) => `
21
- <${l.BLOCK_TEXT}
48
+ `, j = (t, e, n, a) => {
49
+ const l = `
50
+ text-decoration:none;
51
+ font-size: inherit;
52
+ font-weight: inherit;
53
+ line-height: inherit;
54
+ font-family: inherit;
55
+ color: inherit;
56
+ display: block;
57
+ word-wrap:break-word;
58
+ white-space: nowrap;
59
+ width: ${n === g.ORIENTATION.HORIZONTAL ? "130px" : "520px"};
60
+ overflow: hidden;
61
+ text-overflow: ellipsis;
62
+ `;
63
+ if (e) {
64
+ const o = x(a || l), c = S(o, "color"), s = S(o, "font-size"), p = [
65
+ c ? `color: ${c}` : "",
66
+ s ? `font-size: ${s}` : ""
67
+ ].filter(Boolean).join("; "), i = N(
68
+ N(o, "color", "inherit"),
69
+ "font-size",
70
+ "inherit"
71
+ );
72
+ return `
73
+ <td class="esd-block-text es-p10"
74
+ align="center"
75
+ width="100%"
76
+ data-type="${t}"
77
+ esd-extension-block-id="${O.NAME}"
78
+ style="display: table-cell;">
79
+ <p contenteditable="false" path="1"${p ? ` style="${p}"` : ""}>
80
+ <a
81
+ href="#!"
82
+ style="${i}"
83
+ product-attr="name"
84
+ data-slot-2
85
+ width="100%">
86
+ ${A}
87
+ </a>
88
+ </p>
89
+ </td>
90
+ `;
91
+ }
92
+ return `<${u.BLOCK_TEXT}
22
93
  width="100%"
23
94
  align="center"
24
95
  class="es-p10"
25
- data-type="${a}"
26
- esd-extension-block-id="${T.NAME}"
96
+ data-type="${t}"
97
+ esd-extension-block-id="${O.NAME}"
27
98
  >
28
99
  <p contenteditable="false">
29
100
  <a
@@ -48,148 +119,264 @@ const h = (a, t) => `
48
119
  ${A}
49
120
  </a>
50
121
  </p>
51
- </${l.BLOCK_TEXT}>
52
- `, S = (a, t, o, e, c) => {
53
- let n = p;
54
- if (e && e.trim()) {
55
- const E = `&nbsp;${e.trim()}&nbsp;`;
56
- n = (c || "0") === "1" ? `${p}${E}` : `${E}${p}`;
122
+ </${u.BLOCK_TEXT}>
123
+ `;
124
+ }, H = (t, e, n, a, r, l, o) => {
125
+ let c = f;
126
+ if (a && a.trim()) {
127
+ const E = `&nbsp;${a.trim()}&nbsp;`;
128
+ c = (r || "0") === "1" ? `${f}${E}` : `${E}${f}`;
129
+ }
130
+ const s = r === "1" ? "after" : "before", p = `data-formated="${n ? "true" : "false"}"`, i = `data-curency="${s}"`, T = a ? `data-currency_symbol="${a}"` : "";
131
+ if (l) {
132
+ const $ = x(o || "color: #060606; white-space: nowrap; font-size: 20px;");
133
+ return `
134
+ <td class="esd-block-text items-block-price"
135
+ align="center"
136
+ esd-extension-block-id="items-block-price"
137
+ width="100%">
138
+ <p product-attr="price"
139
+ contenteditable="false"
140
+ data-slot-4
141
+ data-type="${t}"
142
+ data-number="${e}"
143
+ ${p}
144
+ ${i}
145
+ ${T}
146
+ style="${$}">
147
+ ${c}
148
+ </p>
149
+ </td>`;
57
150
  }
58
- const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
59
151
  return `
60
- <${l.BLOCK_TEXT}
61
- esd-extension-block-id="${T.PRICE}"
152
+ <${u.BLOCK_TEXT}
153
+ esd-extension-block-id="${O.PRICE}"
62
154
  class="items-block-price"
63
- width="100%"
64
- align="center"
155
+ width="100%"
156
+ align="center"
65
157
  >
66
- <p
158
+ <p
67
159
  product-attr="price"
68
160
  contenteditable="false"
69
161
  data-slot-4
70
- data-type="${a}"
71
- data-number="${t}"
72
- ${d}
73
- ${s}
74
- ${e ? `data-currency_symbol="${e}"` : ""}
162
+ data-type="${t}"
163
+ data-number="${e}"
164
+ ${p}
165
+ ${i}
166
+ ${a ? `data-currency_symbol="${a}"` : ""}
75
167
  >
76
- ${n}
168
+ ${c}
77
169
  </p>
78
- </${l.BLOCK_TEXT}>
170
+ </${u.BLOCK_TEXT}>
79
171
  `;
80
- }, L = (a, t, o, e, c) => {
81
- let n = I;
82
- if (e && e.trim()) {
83
- const E = `&nbsp;${e.trim()}&nbsp;`;
84
- n = (c || "0") === "1" ? `${I}${E}` : `${E}${I}`;
172
+ }, Y = (t, e, n, a, r, l, o = !0, c) => {
173
+ let s = y;
174
+ if (a && a.trim()) {
175
+ const $ = `&nbsp;${a.trim()}&nbsp;`;
176
+ s = (r || "0") === "1" ? `${y}${$}` : `${$}${y}`;
177
+ }
178
+ const p = r === "1" ? "after" : "before", i = `data-formated="${n ? "true" : "false"}"`, T = `data-curency="${p}"`, E = o ? "" : ' style="display: none;"';
179
+ if (l) {
180
+ const b = x(c || "color: #cc0000; white-space: nowrap; font-size: 19px;");
181
+ return `
182
+ <td class="esd-block-text items-block-price"
183
+ esd-extension-block-id="items-block-original-price"
184
+ width="100%"
185
+ align="center"${E}>
186
+ <p
187
+ product-attr="originalPrice"
188
+ contenteditable="false"
189
+ data-slot-5
190
+ data-type="${t}"
191
+ data-number="${e}"
192
+ ${i}
193
+ ${T}
194
+ ${a ? `data-currency_symbol="${a}"` : ""}
195
+ style="${b}">
196
+ <s>${s}</s>
197
+ </p>
198
+ </td>`;
85
199
  }
86
- const r = c === "1" ? "after" : "before", d = `data-formated="${o ? "true" : "false"}"`, s = `data-curency="${r}"`;
87
200
  return `
88
- <${l.BLOCK_TEXT}
201
+ <${u.BLOCK_TEXT}
89
202
  class="items-block-price"
90
- esd-extension-block-id="${T.ORIGINAL_PRICE}"
91
- width="100%"
92
- align="center"
203
+ esd-extension-block-id="${O.ORIGINAL_PRICE}"
204
+ width="100%"
205
+ align="center"
206
+ ${o ? "" : 'style="display: none;"'}
93
207
  >
94
208
  <p
95
209
  product-attr="originalPrice"
96
- contenteditable="false"
210
+ contenteditable="false"
97
211
  data-slot-5
98
212
  style="color: #cc0000"
99
- data-type="${a}"
100
- data-number="${t}"
101
- ${d}
102
- ${s}
103
- ${e ? `data-currency_symbol="${e}"` : ""}
213
+ data-type="${t}"
214
+ data-number="${e}"
215
+ ${i}
216
+ ${T}
217
+ ${a ? `data-currency_symbol="${a}"` : ""}
104
218
  >
105
- <s>${n}</s>
219
+ <s>${s}</s>
106
220
  </p>
107
- </${l.BLOCK_TEXT}>
221
+ </${u.BLOCK_TEXT}>
108
222
  `;
109
- }, b = () => `
110
- <${l.BLOCK_TEXT}
111
- width="100%"
112
- align="center"
113
- class="es-p10"
114
- esd-extension-block-id="${T.QUANTITY}"
115
- >
116
- <p
117
- product-attr="quantity"
118
- data-slot-3
119
- contenteditable="false"
120
- width="100%">
121
- ${u}
122
- </p>
123
- </${l.BLOCK_TEXT}>
124
- `, U = (a, t) => `
125
- <${l.BLOCK_BUTTON}
126
- width="100%"
127
- class="ins-button"
128
- name="buy-button"
129
- caption="Buy"
130
- align="center"
131
- esd-extension-block-id="${T.BUTTON}"
132
- product-attr="button"
133
- data-slot-6
134
- data-type="${a}"
135
- data-number="${t}"
136
- >Buy
137
- </${l.BLOCK_BUTTON}>
138
- `, D = () => `
139
- <esd-config-block style="display: none;"></esd-config-block>
140
- `, R = (a, t, o, e, c, n, r, d) => {
141
- const $ = `${`data-type="${t}" data-number="${o}"`} data-orientation="${e}"`;
142
- return a.replace(
223
+ }, Z = (t = !0, e, n) => {
224
+ const a = t ? "" : 'style="display: none;"';
225
+ return e ? `
226
+ <td class="esd-block-text es-p10 document-node-component default-block-component selectable"
227
+ width="100%" align="center" esd-extension-block-id="items-block-quantity" ${a}>
228
+ <div class="service-element text-block-input-area text-block-preview-area"
229
+ style="outline: none;" contenteditable="">
230
+ <p product-attr="quantity" data-slot-3="" contenteditable="false" width="100%" path="1"
231
+ style="${n || "text-align: center; font-size: 14px;"}">
232
+ ${P}
233
+ </p>
234
+ </div>
235
+ </td>` : `
236
+ <${u.BLOCK_TEXT}
237
+ width="100%"
238
+ align="center"
239
+ class="es-p10"
240
+ esd-extension-block-id="${O.QUANTITY}"
241
+ ${t ? "" : 'style="display: none;"'}
242
+ >
243
+ <p
244
+ product-attr="quantity"
245
+ data-slot-3
246
+ contenteditable="false"
247
+ width="100%">
248
+ ${P}
249
+ </p>
250
+ </${u.BLOCK_TEXT}>
251
+ `;
252
+ }, J = (t, e, n = "Buy", a, r) => a ? `
253
+ <td class="esd-block-button ins-button default-block-component selectable"
254
+ align="center" width="100%" name="buy-button" caption="${n}"
255
+ esd-extension-block-id="items-block-button"
256
+ product-attr="button" data-slot-6="" data-type="${t}" data-number="${e}">
257
+ <span class="es-button-border" style="border-width: 0px;">
258
+ <a class="es-button" href="#!" target="_blank" style="${r || ""}">
259
+ ${n}
260
+ </a>
261
+ </span>
262
+ </td>` : `
263
+ <${u.BLOCK_BUTTON}
264
+ width="100%"
265
+ class="ins-button"
266
+ name="buy-button"
267
+ caption="${n}"
268
+ align="center"
269
+ esd-extension-block-id="${O.BUTTON}"
270
+ product-attr="button"
271
+ data-slot-6
272
+ data-type="${t}"
273
+ data-number="${e}"
274
+ >${n}
275
+ </${u.BLOCK_BUTTON}>
276
+ `, tt = (t) => !t || Object.keys(t).length === 0 ? '<esd-config-block style="display: none;"></esd-config-block>' : `<esd-config-block style="display: none;" ${Object.entries(t).map(([n, a]) => `${n}="${a}"`).join(" ")}></esd-config-block>`, et = (t, e, n) => {
277
+ const a = e === g.ORIENTATION.VERTICAL, r = n === "horizontal";
278
+ return a ? r ? t : t.replace(
279
+ /<td\s+[^>]*class="[^"]*product-(?:original-)?price-class[^"]*"[^>]*>/gi,
280
+ (l) => l.replace(/width="50%"/gi, 'width="100%"').replace(/width:\s*50%;/gi, "width: 100%;")
281
+ ) : r ? t : t.replace(
282
+ /<td\s+[^>]*class="[^"]*horizontal-price[^"]*"[^>]*>/gi,
283
+ (l) => /style\s*=\s*"/i.test(l) ? l.replace(/style\s*=\s*"([^"]*)"/i, 'style="display: none; $1"') : l.replace(/>$/, ' style="display: none;">')
284
+ ).replace(
285
+ /<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
286
+ (l) => l.replace(/display:\s*none;?/gi, "display: table-cell;")
287
+ );
288
+ }, at = (t) => t ? `<td align="center"
289
+ esd-extension-block-id="items-block" width="560"
290
+ data-number="4"
291
+ class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : z, L = (t, e, n, a, r, l, o, c, s, p, i, T, E, $ = "horizontal", b, _, I) => {
292
+ const F = `${`data-type="${e}" data-number="${n}"`} data-orientation="${a}"`, C = t.replace(
143
293
  /<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
144
- `<td$1 ${$}>`
145
- ).replace("{-{-TEMPLATE_FIRST_LINE-}-}", N).replace("{-{-PRODUCT_IMAGE-}-}", h(t, o)).replace("{-{-PRODUCT_NAME-}-}", F(t)).replaceAll(
294
+ `<td$1 ${F}>`
295
+ ), M = s == null ? void 0 : s["data-product_image_control_image-width"], U = l ? W(e, n, M) : q(e, n), B = (i == null ? void 0 : i.buttonLabel) || "Buy", D = (i == null ? void 0 : i.quantityControlEnabled) !== void 0 ? i.quantityControlEnabled : !0, X = (i == null ? void 0 : i.originalPriceVisible) !== void 0 ? i.originalPriceVisible : (s == null ? void 0 : s["data-product_original_price_control_enabled"]) !== "false", v = C.replace("{-{-TEMPLATE_FIRST_LINE-}-}", at(l)).replace("{-{-PRODUCT_IMAGE-}-}", U).replace("{-{-PRODUCT_NAME-}-}", j(e, l, a, T)).replaceAll(
146
296
  "{-{-PRODUCT_PRICE-}-}",
147
- S(t, o, c, n, r)
297
+ H(e, n, r, o, c, l, b)
148
298
  ).replaceAll(
149
299
  "{-{-PRODUCT_ORIGINAL_PRICE-}-}",
150
- L(
151
- t,
300
+ Y(
301
+ e,
302
+ n,
303
+ r,
152
304
  o,
153
305
  c,
154
- n,
155
- r
306
+ l,
307
+ X,
308
+ _
156
309
  )
157
- ).replace("{-{-PRODUCT_QUANTITY-}-}", b()).replace("{-{-PRODUCT_BUTTON-}-}", U(t, o)).replace("{-{-CONFIG_BLOCK-}-}", D());
310
+ ).replace("{-{-PRODUCT_QUANTITY-}-}", Z(D, l, I)).replace("{-{-PRODUCT_BUTTON-}-}", J(e, n, B, l, E)).replace("{-{-CONFIG_BLOCK-}-}", tt(s));
311
+ return et(v, a, $);
158
312
  };
159
- function G({
160
- orientation: a,
161
- itemsType: t = O.ITEMS_TYPE.CART_ITEMS,
162
- itemId: o,
163
- currencySymbol: e,
164
- currencyLocation: c,
165
- formattedPrice: n = !0
313
+ function ct({
314
+ orientation: t,
315
+ itemsType: e = g.ITEMS_TYPE.CART_ITEMS,
316
+ itemId: n,
317
+ currencySymbol: a,
318
+ currencyLocation: r,
319
+ migrate: l = !1,
320
+ formattedPrice: o = !0,
321
+ configBlockAttributes: c,
322
+ nodeConfig: s,
323
+ nameStyles: p,
324
+ buttonStyles: i,
325
+ priceStyles: T,
326
+ originalPriceStyles: E,
327
+ quantityStyles: $,
328
+ priceOrientation: b
166
329
  }) {
167
- const r = f[t].findIndex((s) => s.value === o);
168
- let d = "1";
169
- if (r >= 0)
170
- d = String(r + 1);
171
- else if (o) {
172
- const s = o.match(/\((\d+)\)/);
173
- s && s[1] && ([, d] = s);
330
+ const _ = K[e].findIndex((h) => h.value === n);
331
+ let I = "1";
332
+ if (_ >= 0)
333
+ I = String(_ + 1);
334
+ else if (n) {
335
+ const h = n.match(/\((\d+)\)/);
336
+ h && h[1] && ([, I] = h);
174
337
  }
175
- return C = i.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[r >= 0 ? r : 0], A = i.PAIRS_FOR_EXTENSION.name[t].DEFAULT[r >= 0 ? r : 0], p = n ? i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, I = n ? i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, u = i.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT, a === O.ORIENTATION.VERTICAL ? R(
176
- g,
338
+ k = d.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[_ >= 0 ? _ : 0], A = d.PAIRS_FOR_EXTENSION.name[e].DEFAULT[_ >= 0 ? _ : 0], f = o ? d.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE_FORMATTED : d.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE, y = o ? d.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE_FORMATTED : d.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE, P = d.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
339
+ const w = b || (s == null ? void 0 : s.priceOrientation) || "horizontal";
340
+ return t === g.ORIENTATION.VERTICAL ? L(
341
+ Q,
342
+ e,
343
+ I,
177
344
  t,
178
- d,
345
+ o,
346
+ l,
179
347
  a,
180
- n,
348
+ r,
349
+ c,
350
+ void 0,
351
+ // nodup
352
+ s,
353
+ p,
354
+ i,
355
+ w,
356
+ T,
357
+ E,
358
+ $
359
+ ) : L(
360
+ G,
181
361
  e,
182
- c
183
- ) : R(
184
- B,
362
+ I,
185
363
  t,
186
- d,
364
+ o,
365
+ l,
187
366
  a,
188
- n,
189
- e,
190
- c
367
+ r,
368
+ c,
369
+ void 0,
370
+ // nodup
371
+ s,
372
+ p,
373
+ i,
374
+ w,
375
+ T,
376
+ E,
377
+ $
191
378
  );
192
379
  }
193
380
  export {
194
- G as getDefaultTemplate
381
+ ct as getDefaultTemplate
195
382
  };