@useinsider/guido 3.17.0-beta.ddd4dde → 3.17.0-beta.e324492

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 (95) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +7 -6
  3. package/dist/components/Guido.vue.js +10 -10
  4. package/dist/components/Guido.vue2.js +82 -76
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
  7. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  8. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  9. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  10. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  11. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  12. package/dist/composables/useRecommendation.js +41 -34
  13. package/dist/composables/useStripo.js +14 -14
  14. package/dist/config/i18n/en/labels.json.js +1 -1
  15. package/dist/config/migrator/index.js +9 -8
  16. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  17. package/dist/config/migrator/recommendation/extractors.js +29 -24
  18. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  19. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  20. package/dist/config/migrator/recommendationMigrator.js +31 -25
  21. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  22. package/dist/enums/academy.js +2 -1
  23. package/dist/enums/date.js +5 -3
  24. package/dist/enums/extensions/recommendationBlock.js +3 -1
  25. package/dist/extensions/Blocks/Items/block.js +49 -98
  26. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +24 -25
  27. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +11 -12
  28. package/dist/extensions/Blocks/Items/template.js +152 -153
  29. package/dist/extensions/Blocks/Recommendation/block.js +35 -29
  30. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  31. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  32. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
  33. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
  34. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
  35. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +247 -180
  36. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
  37. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  38. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  39. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  40. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  41. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  42. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +177 -80
  43. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  44. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  45. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  46. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  47. package/dist/extensions/Blocks/common-control.js +22 -19
  48. package/dist/guido.css +1 -1
  49. package/dist/services/recommendationApi.js +69 -30
  50. package/dist/src/@types/config/schemas.d.ts +2 -0
  51. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  52. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  53. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  54. package/dist/src/composables/useConfig.d.ts +2 -0
  55. package/dist/src/composables/useRecommendation.d.ts +1 -0
  56. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  57. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  58. package/dist/src/enums/academy.d.ts +1 -0
  59. package/dist/src/enums/date.d.ts +1 -0
  60. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  61. package/dist/src/extensions/Blocks/Items/block.d.ts +0 -21
  62. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  63. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  64. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
  65. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  66. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
  67. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  68. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  69. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +48 -8
  70. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
  71. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  72. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  73. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  74. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +188 -10
  75. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  76. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
  77. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  78. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  79. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  80. package/dist/src/services/recommendationApi.d.ts +4 -1
  81. package/dist/src/stores/config.d.ts +18 -0
  82. package/dist/src/stores/save-as-template.d.ts +4 -3
  83. package/dist/src/utils/genericUtil.d.ts +5 -0
  84. package/dist/static/assets/icons/line-change.svg.js +5 -0
  85. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  86. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  87. package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
  88. package/dist/static/styles/customEditorStyle.css.js +3 -1
  89. package/dist/utils/dateUtil.js +23 -10
  90. package/dist/utils/genericUtil.js +28 -27
  91. package/dist/utils/pairProductVariables.js +59 -60
  92. package/dist/utils/templatePreparation.js +47 -45
  93. package/package.json +2 -1
  94. package/dist/extensions/Blocks/Items/constants/currency.js +0 -11
  95. package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +0 -19
@@ -0,0 +1,5 @@
1
+ const a = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 5a1 1 0 0 0-1 1v5H6a1 1 0 1 0 0 2h5v5a1 1 0 1 0 2 0v-5h5a1 1 0 1 0 0-2h-5V6a1 1 0 0 0-1-1z"></path></svg>
2
+ `;
3
+ export {
4
+ a as default
5
+ };
@@ -0,0 +1,155 @@
1
+ const n = `.strategy-control-header {
2
+ padding: 16px 16px 0;
3
+ }
4
+
5
+ .strategy-control-title {
6
+ margin: 0;
7
+ color: var(--guido-color-gray-800);
8
+ font-size: 16px;
9
+ font-weight: 600;
10
+ line-height: 24px;
11
+ }
12
+
13
+ .strategy-control-description-row {
14
+ padding: 8px 16px 16px;
15
+ }
16
+
17
+ .strategy-control-description {
18
+ margin: 0;
19
+ color: var(--guido-color-gray-600);
20
+ font-size: 13px;
21
+ line-height: 16px;
22
+ }
23
+
24
+ .strategy-control-description a {
25
+ color: var(--guido-color-primary-500);
26
+ text-decoration: underline;
27
+ }
28
+
29
+ .recommendation-controls-container .container.strategy-control-cta-row {
30
+ grid-template-columns: repeat(2, minmax(0, 180px));
31
+ justify-content: start;
32
+ gap: 16px;
33
+ padding: 0 16px 16px;
34
+ }
35
+
36
+ .strategy-control-cta {
37
+ width: 100%;
38
+ }
39
+
40
+ .strategy-control-cta > .button {
41
+ display: flex;
42
+ gap: 8px;
43
+ justify-content: center;
44
+ width: 100%;
45
+ border: none;
46
+ font-size: 15px;
47
+ font-weight: 400;
48
+ line-height: 24px;
49
+ white-space: nowrap;
50
+ }
51
+
52
+ .strategy-control-cta.primary > .button:disabled,
53
+ .strategy-control-cta.primary > .button.disabled {
54
+ opacity: 1;
55
+ color: var(--guido-color-gray-800);
56
+ cursor: default;
57
+ }
58
+
59
+ .strategy-control-name-band {
60
+ display: flex;
61
+ align-items: center;
62
+ min-height: 48px;
63
+ padding: 0 16px;
64
+ background-color: var(--guido-color-gray-0);
65
+ }
66
+
67
+ .strategy-control-name {
68
+ color: var(--guido-color-gray-800);
69
+ font-size: 15px;
70
+ font-weight: 600;
71
+ line-height: 24px;
72
+ }
73
+
74
+ .strategy-control-actions {
75
+ display: flex;
76
+ align-items: center;
77
+ padding: 16px;
78
+ }
79
+
80
+ .strategy-control-action {
81
+ display: inline-flex;
82
+ align-items: center;
83
+ padding: 0;
84
+ border: none;
85
+ background: none;
86
+ font-size: 15px;
87
+ font-weight: 400;
88
+ line-height: 24px;
89
+ cursor: pointer;
90
+ }
91
+
92
+ .strategy-control-action > span {
93
+ padding: 0 8px;
94
+ }
95
+
96
+ .strategy-control-action::before,
97
+ .strategy-control-cta.on > .button::before {
98
+ content: '';
99
+ flex: none;
100
+ width: 24px;
101
+ height: 24px;
102
+ background-color: currentcolor;
103
+ mask-repeat: no-repeat;
104
+ mask-position: center;
105
+ mask-size: 24px 24px;
106
+ }
107
+
108
+ .strategy-control-action--change::before {
109
+ mask-image: var(--guido-icon-line-change);
110
+ }
111
+
112
+ .strategy-control-action--remove::before {
113
+ mask-image: var(--guido-icon-line-delete);
114
+ }
115
+
116
+ .strategy-control-cta.on > .button::before {
117
+ mask-image: var(--guido-icon-line-plus);
118
+ }
119
+
120
+ .strategy-control-action--change {
121
+ color: var(--guido-color-primary-500);
122
+ }
123
+
124
+ .strategy-control-action--remove {
125
+ color: var(--guido-color-danger-500);
126
+ }
127
+
128
+ .strategy-control-action:hover {
129
+ text-decoration: underline;
130
+ }
131
+
132
+ .recommendation-controls-container:not(.strategy-block) .strategy-control-container,
133
+ .recommendation-controls-container.strategy-block .product-count-control-container,
134
+ .recommendation-controls-container.strategy-block .algorithm-control-container,
135
+ .recommendation-controls-container.strategy-block .filters-control-container,
136
+ .recommendation-controls-container.strategy-block .shuffle-control-container {
137
+ display: none;
138
+ }
139
+
140
+ .recommendation-controls-container.strategy-block {
141
+ display: flex;
142
+ flex-direction: column;
143
+ }
144
+
145
+ .recommendation-controls-container.strategy-block .price-placement-control-container {
146
+ order: 1;
147
+ }
148
+
149
+ .recommendation-controls-container.strategy-block .product-layout-control-container {
150
+ order: 2;
151
+ }
152
+ `;
153
+ export {
154
+ n as default
155
+ };
@@ -43,7 +43,9 @@ const n = `.esd-x,
43
43
  .recommendation-block-v2 .product-omnibus-discount ue-node-actions,
44
44
  .recommendation-block-v2 .product-omnibus-discount ue-node-panel,
45
45
  .recommendation-block-v2 .product-button ue-node-actions,
46
- .recommendation-block-v2 .product-button ue-node-panel {
46
+ .recommendation-block-v2 .product-button ue-node-panel,
47
+ .recommendation-block-v2 .ins-recommendation-title ue-node-actions,
48
+ .recommendation-block-v2 .ins-recommendation-title ue-node-panel {
47
49
  display: none !important;
48
50
  }
49
51
 
@@ -1,10 +1,19 @@
1
- import { DEFAULT_LOCALE as r, DEFAULT as o } from "../enums/date.js";
2
- const c = () => {
1
+ import { DEFAULT_LOCALE as n, DEFAULT as a, DEFAULT_TZ as c } from "../enums/date.js";
2
+ const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 && !Number.isNaN(Number(t)) ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), s = () => {
3
3
  const t = window.l10n;
4
- return (t == null ? void 0 : t.locale) === o ? r : (t == null ? void 0 : t.locale) || r;
5
- };
6
- new Intl.DateTimeFormat().resolvedOptions().timeZone;
7
- const i = (t) => {
4
+ return (t == null ? void 0 : t.locale) === a ? n : (t == null ? void 0 : t.locale) || n;
5
+ }, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => {
6
+ const t = window.l10n;
7
+ return (t == null ? void 0 : t.timezone) || u || c;
8
+ }, D = (t, e = s(), r = f()) => {
9
+ const o = {
10
+ year: "numeric",
11
+ month: "2-digit",
12
+ day: "2-digit",
13
+ timeZone: r
14
+ }, i = m(t);
15
+ return new Intl.DateTimeFormat(e, o).format(i);
16
+ }, T = (t) => {
8
17
  if (!t)
9
18
  return "";
10
19
  const e = new Date(t);
@@ -16,9 +25,13 @@ const i = (t) => {
16
25
  second: "2-digit",
17
26
  hour12: !1
18
27
  }).format(e);
19
- }, m = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
28
+ }, h = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
20
29
  export {
21
- i as formatPatchDate,
22
- m as isAfterDate,
23
- c as locale
30
+ m as convertToDateObject,
31
+ T as formatPatchDate,
32
+ D as formatShortDate,
33
+ h as isAfterDate,
34
+ u as localTz,
35
+ s as locale,
36
+ f as timezone
24
37
  };
@@ -1,26 +1,26 @@
1
- const o = (l) => {
2
- const a = l.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((t) => t.trim()), [c] = a, r = {
3
- text: l.label,
4
- value: c || ""
1
+ const o = (t) => {
2
+ const a = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [s] = a, r = {
3
+ text: t.label,
4
+ value: s || ""
5
5
  };
6
6
  if (a.length >= 2) {
7
- const [, t, e] = a;
8
- if (t.startsWith("default:")) {
9
- let n = t.slice(8).trim();
7
+ const [, l, e] = a;
8
+ if (l.startsWith("default:")) {
9
+ let n = l.slice(8).trim();
10
10
  n.startsWith('"') && n.endsWith('"') && (n = n.slice(1, -1)), r.fallback = n;
11
11
  } else {
12
- const n = t.includes("=") ? { key: t.split("=")[0].trim(), value: t.split("=")[1].trim() } : null;
13
- n ? r.format = n : e || (r.fallback = t), e && (r.fallback = e);
12
+ const n = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
13
+ n ? r.format = n : e || (r.fallback = l), e && (r.fallback = e);
14
14
  }
15
15
  }
16
16
  return r;
17
- }, f = (l, s = !1) => l.map((a) => {
17
+ }, f = (t, c = !1) => t.map((a) => {
18
18
  if (a.format)
19
19
  return {
20
20
  label: `${a.text} | ${a.format.key}=${a.format.value}`,
21
21
  value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
22
22
  };
23
- if (s) {
23
+ if (c) {
24
24
  if (!a.fallback)
25
25
  return {
26
26
  label: a.text,
@@ -36,33 +36,34 @@ const o = (l) => {
36
36
  label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
37
37
  value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
38
38
  };
39
- }), b = (l) => {
40
- const s = [], a = /* @__PURE__ */ new Set(), c = (t) => {
41
- Array.isArray(t) && t.forEach((e) => {
39
+ }), b = (t) => {
40
+ const c = [], a = /* @__PURE__ */ new Set(), s = (l) => {
41
+ Array.isArray(l) && l.forEach((e) => {
42
42
  const n = [...e.children ?? [], ...e.select_items ?? []];
43
43
  if (n.length > 0) {
44
- c(n);
44
+ s(n);
45
45
  return;
46
46
  }
47
47
  const u = e.text || e.tag_text;
48
- u && e.value && !a.has(e.value) && (a.add(e.value), s.push({ text: u, value: e.value }));
48
+ u && e.value && !a.has(e.value) && (a.add(e.value), c.push({ text: u, value: e.value }));
49
49
  });
50
- }, [r] = Object.values(l ?? {});
51
- return c(r), s;
52
- }, v = (l, s, a = !1) => {
53
- const c = new Set(l.map((t) => t.value)), r = s.filter((t) => c.has(t.value) ? !1 : (c.add(t.value), !0));
50
+ }, [r] = Object.values(t ?? {});
51
+ return s(r), c;
52
+ }, i = (t, c, a = !1) => {
53
+ const s = new Set(t.map((l) => l.value)), r = c.filter((l) => s.has(l.value) ? !1 : (s.add(l.value), !0));
54
54
  return [
55
- ...f(l, a),
55
+ ...f(t, a),
56
56
  ...f(r, a)
57
57
  ];
58
- }, i = () => {
59
- var l;
60
- return ((l = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : l.getAttribute("content")) ?? "";
61
- };
58
+ }, v = () => {
59
+ var t;
60
+ return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
61
+ }, k = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "";
62
62
  export {
63
- v as buildMergeTagEntries,
63
+ k as asText,
64
+ i as buildMergeTagEntries,
64
65
  f as dynamicContentToMergeTags,
65
66
  b as flattenDynamicContentList,
66
- i as getCsrfToken,
67
+ v as getCsrfToken,
67
68
  o as mergeTagToDynamicContent
68
69
  };
@@ -1,83 +1,82 @@
1
- import { ITEMS_CURRENCY_ATTR as N } from "../extensions/Blocks/Items/constants/currency.js";
2
1
  import { productPairs as L } from "../extensions/Blocks/Items/enums/productEnums.js";
3
- import { DefaultConfigValues as G } from "../extensions/Blocks/Items/enums/settingsEnums.js";
4
- import { escapeReplacement as X } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
2
+ import { DefaultConfigValues as V } from "../extensions/Blocks/Items/enums/settingsEnums.js";
3
+ import { escapeReplacement as G } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
5
4
  import { preserveTextStyles as F } from "./preserveTextStyles.js";
6
- import { unwrapProductNameLinks as Y } from "./unwrapProductNameLink.js";
5
+ import { unwrapProductNameLinks as X } from "./unwrapProductNameLink.js";
7
6
  const x = {
8
7
  CART_ITEMS: "ins_apr",
9
8
  BROWSED_ITEMS: "browsed_item",
10
9
  PURCHASED_ITEMS: "purchased_item"
11
- }, O = (S) => S.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
12
- function v(S, I, b) {
13
- let h = I;
14
- for (; h > 0 && /\s/.test(S[h - 1]); )
15
- h -= 1;
16
- return b.some((P) => S.endsWith(P, h));
10
+ }, N = (S) => S.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
11
+ function v(S, H, g) {
12
+ let $ = H;
13
+ for (; $ > 0 && /\s/.test(S[$ - 1]); )
14
+ $ -= 1;
15
+ return g.some((I) => S.endsWith(I, $));
17
16
  }
18
- function Z(S) {
19
- const I = O(S), b = new DOMParser().parseFromString(I, "text/html");
20
- Y(b);
21
- const h = L.PAIRS_FOR_EXTENSION;
22
- Object.entries(h).forEach(([n, d]) => {
23
- b.querySelectorAll(".ins-product-td").forEach((r) => {
17
+ function J(S) {
18
+ const H = N(S), g = new DOMParser().parseFromString(H, "text/html");
19
+ X(g);
20
+ const $ = L.PAIRS_FOR_EXTENSION;
21
+ Object.entries($).forEach(([n, d]) => {
22
+ g.querySelectorAll(".ins-product-td").forEach((r) => {
24
23
  const E = r.getAttribute("data-number") || "1", m = r.getAttribute("data-type") || "CART_ITEMS";
25
24
  r.querySelectorAll(`[product-attr="${n}"]`).forEach((t) => {
26
- var $, H, D;
27
- const g = t.getAttribute("data-type") || m, o = t.getAttribute("data-number") || E, u = d[g];
28
- if (u)
25
+ var T, P, D;
26
+ const R = t.getAttribute("data-type") || m, o = t.getAttribute("data-number") || E, f = d[R];
27
+ if (f)
29
28
  switch (n) {
30
29
  case "imageSrc": {
31
30
  let e = null, s = null;
32
31
  if (t.tagName === "IMG" ? (e = t, s = e.closest("a")) : (e = t.querySelector("img"), s = t.querySelector("a") || t.closest("a")), !e)
33
32
  break;
34
- const a = u.DEFAULT, l = u.ATTR;
33
+ const a = f.DEFAULT, l = f.ATTR;
35
34
  if (a && e.src) {
36
35
  const i = e.src;
37
- a.some((_) => {
38
- const f = _.split("/").pop() || "", C = i.split("/").pop() || "";
39
- return i.includes(_) || i.includes(f) || C === f;
36
+ a.some((b) => {
37
+ const u = b.split("/").pop() || "", y = i.split("/").pop() || "";
38
+ return i.includes(b) || i.includes(u) || y === u;
40
39
  }) && (e.src = `{{${l}_${o}}}`);
41
40
  }
42
- const c = (H = ($ = h.name) == null ? void 0 : $[g]) == null ? void 0 : H.ATTR;
41
+ const c = (P = (T = $.name) == null ? void 0 : T[R]) == null ? void 0 : P.ATTR;
43
42
  if (c && e.setAttribute("alt", `{{${c}_${o}}}`), s) {
44
- const i = (D = h.itemLink) == null ? void 0 : D[g];
43
+ const i = (D = $.itemLink) == null ? void 0 : D[R];
45
44
  if (i) {
46
- const R = i.HREF, _ = i.DEFAULT_HREF || "#!", f = s.href;
47
- (f === "#" || f === "" || f.endsWith("#!") || f.endsWith(_) || f === `${window.location.href}${_}` || !f || f === window.location.href) && (s.href = `{{${R}_${o}}}`);
45
+ const _ = i.HREF, b = i.DEFAULT_HREF || "#!", u = s.href;
46
+ (u === "#" || u === "" || u.endsWith("#!") || u.endsWith(b) || u === `${window.location.href}${b}` || !u || u === window.location.href) && (s.href = `{{${_}_${o}}}`);
48
47
  }
49
48
  }
50
49
  break;
51
50
  }
52
51
  case "name": {
53
- const e = u, s = e.ATTR, a = e.DEFAULT_HREF || "#!", l = e.HREF;
52
+ const e = f, s = e.ATTR, a = e.DEFAULT_HREF || "#!", l = e.HREF;
54
53
  t.textContent && (t.innerHTML = F(t, `{{${s}_${o}}}`));
55
54
  const c = t.closest("a") || (t.tagName === "A" ? t : null);
56
55
  if (c && l) {
57
- const i = c.href, R = `${window.location.href}${a}`;
58
- (i === R || i.endsWith(a)) && (c.href = `{{${l}_${o}}}`);
56
+ const i = c.href, _ = `${window.location.href}${a}`;
57
+ (i === _ || i.endsWith(a)) && (c.href = `{{${l}_${o}}}`);
59
58
  }
60
59
  break;
61
60
  }
62
61
  case "price":
63
62
  case "originalPrice": {
64
- const e = u, s = t.getAttribute("data-formated"), a = t.getAttribute("data-single_price"), l = s === "true", c = a === "true", i = t.getAttribute(N.POSITION) || "before";
65
- let R;
66
- c ? R = l ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : R = l ? e.PRICE_FORMATTED : e.PRICE;
67
- const _ = e.CURRENCY;
68
- let f = `{{${R}_${o}}}`;
69
- const C = (t.getAttribute(N.SYMBOL) || "").trim(), V = C !== "" && C !== G.productPriceCurrencySymbolControlValue;
70
- let y = "";
71
- V ? y = C : _ && (y = `{{${_}_${o}}}`), y && (f = i === "after" ? `${f} ${y}` : `${y} ${f}`), t.innerHTML = F(t, f);
63
+ const e = f, s = t.getAttribute("data-formated"), a = t.getAttribute("data-single_price"), l = s === "true", c = a === "true", i = t.getAttribute("data-curency") || "before";
64
+ let _;
65
+ c ? _ = l ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : _ = l ? e.PRICE_FORMATTED : e.PRICE;
66
+ const b = e.CURRENCY;
67
+ let u = `{{${_}_${o}}}`;
68
+ const y = (t.getAttribute("data-currency_symbol") || "").trim(), W = y !== "" && y !== V.productPriceCurrencySymbolControlValue;
69
+ let C = "";
70
+ W ? C = y : b && (C = `{{${b}_${o}}}`), C && (u = i === "after" ? `${u} ${C}` : `${C} ${u}`), t.innerHTML = F(t, u);
72
71
  break;
73
72
  }
74
73
  case "quantity": {
75
- const e = u, s = e.ATTR, a = e.DEFAULT;
74
+ const e = f, s = e.ATTR, a = e.DEFAULT;
76
75
  t.textContent && t.textContent.trim() === a && (t.innerHTML = F(t, `{{${s}_${o}}}`));
77
76
  break;
78
77
  }
79
78
  case "button": {
80
- const e = u, s = e.HREF, a = e.DEFAULT_HREF || "#!", l = t.tagName === "A" ? t : t.querySelector("a");
79
+ const e = f, s = e.HREF, a = e.DEFAULT_HREF || "#!", l = t.tagName === "A" ? t : t.querySelector("a");
81
80
  if (l) {
82
81
  const c = l.href || "", i = `${window.location.href}${a}`;
83
82
  (c === "" || c === "#" || c === i || c.endsWith(a) || c.endsWith("#!") || c === window.location.href) && (l.href = `{{${s}_${o}}}`);
@@ -85,7 +84,7 @@ function Z(S) {
85
84
  break;
86
85
  }
87
86
  case "itemLink": {
88
- const e = u, s = e.HREF, a = e.DEFAULT_HREF || "#!", l = t;
87
+ const e = f, s = e.HREF, a = e.DEFAULT_HREF || "#!", l = t;
89
88
  if (l.href) {
90
89
  const c = l.href, i = `${window.location.href}${a}`;
91
90
  (c === i || c.endsWith(a)) && (l.href = `{{${s}_${o}}}`);
@@ -93,8 +92,8 @@ function Z(S) {
93
92
  break;
94
93
  }
95
94
  default: {
96
- if ("ATTR" in u) {
97
- const e = u.ATTR;
95
+ if ("ATTR" in f) {
96
+ const e = f.ATTR;
98
97
  t.textContent && (t.innerHTML = F(t, `{{${e}_${o}}}`));
99
98
  }
100
99
  break;
@@ -103,9 +102,9 @@ function Z(S) {
103
102
  });
104
103
  });
105
104
  });
106
- const P = I.match(/<!DOCTYPE[^>]*>/i), q = P ? `${P[0]}
107
- ` : "", U = b.querySelectorAll(".ins-product-td"), M = [];
108
- U.forEach((n) => {
105
+ const I = H.match(/<!DOCTYPE[^>]*>/i), O = I ? `${I[0]}
106
+ ` : "", q = g.querySelectorAll(".ins-product-td"), M = [];
107
+ q.forEach((n) => {
109
108
  const d = n.getAttribute("data-type") || "CART_ITEMS", p = n.getAttribute("data-number") || "1", r = n.outerHTML;
110
109
  M.push({
111
110
  element: n,
@@ -114,16 +113,16 @@ function Z(S) {
114
113
  number: p
115
114
  });
116
115
  });
117
- let A = q + b.documentElement.outerHTML;
116
+ let A = O + g.documentElement.outerHTML;
118
117
  M.reverse().forEach(({ outerHtml: n, type: d, number: p }) => {
119
118
  const r = x[d], E = r ? `${r}_total_product_kind` : "";
120
119
  if (E) {
121
- const T = parseInt(p) - 1, o = `${`{% if ${E} > ${T} %}`}${n}{% endif %}`;
122
- A = A.replace(n, X(o));
120
+ const h = parseInt(p) - 1, o = `${`{% if ${E} > ${h} %}`}${n}{% endif %}`;
121
+ A = A.replace(n, G(o));
123
122
  }
124
123
  });
125
- const W = b.querySelectorAll('[product-attr="originalPrice"][data-type]'), w = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Set();
126
- return W.forEach((n) => {
124
+ const U = g.querySelectorAll('[product-attr="originalPrice"][data-type]'), w = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Set();
125
+ return U.forEach((n) => {
127
126
  var t;
128
127
  const d = n.getAttribute("data-number"), p = n.getAttribute("data-type");
129
128
  if (!d || !x[p])
@@ -132,20 +131,20 @@ function Z(S) {
132
131
  if (!r || k.has(r))
133
132
  return;
134
133
  k.add(r);
135
- const E = r.outerHTML, m = (t = n.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), T = w.get(E) ?? { number: d, type: p, wrap: [] };
136
- T.wrap.push(m !== "false"), w.set(E, T);
134
+ const E = r.outerHTML, m = (t = n.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), h = w.get(E) ?? { number: d, type: p, wrap: [] };
135
+ h.wrap.push(m !== "false"), w.set(E, h);
137
136
  }), w.forEach(({ number: n, type: d, wrap: p }, r) => {
138
137
  if (r.includes("{% if") || !p.some(Boolean))
139
138
  return;
140
- const E = L.PAIRS_FOR_EXTENSION.price[d].PRICE, m = L.PAIRS_FOR_EXTENSION.originalPrice[d].PRICE, T = `{% if ${E}_${n} != ${m}_${n} %}`, t = [T, O(T)];
141
- let g = "", o = 0, u = 0, $ = A.indexOf(r);
142
- for (; $ !== -1; ) {
143
- const H = p[u] === !0 && !v(A, $, t);
144
- g += A.slice(o, $) + (H ? `${T}${r}{% endif %}` : r), o = $ + r.length, u += 1, $ = A.indexOf(r, o);
139
+ const E = L.PAIRS_FOR_EXTENSION.price[d].PRICE, m = L.PAIRS_FOR_EXTENSION.originalPrice[d].PRICE, h = `{% if ${E}_${n} != ${m}_${n} %}`, t = [h, N(h)];
140
+ let R = "", o = 0, f = 0, T = A.indexOf(r);
141
+ for (; T !== -1; ) {
142
+ const P = p[f] === !0 && !v(A, T, t);
143
+ R += A.slice(o, T) + (P ? `${h}${r}{% endif %}` : r), o = T + r.length, f += 1, T = A.indexOf(r, o);
145
144
  }
146
- A = g + A.slice(o);
145
+ A = R + A.slice(o);
147
146
  }), A.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
148
147
  }
149
148
  export {
150
- Z as pairProductVariables
149
+ J as pairProductVariables
151
150
  };