@useinsider/guido 3.18.2-beta.963f84e → 3.18.2-beta.9be830c

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 (89) hide show
  1. package/dist/@types/config/schemas.js +15 -13
  2. package/dist/components/Guido.vue.js +7 -7
  3. package/dist/components/Guido.vue2.js +30 -30
  4. package/dist/components/organisms/AutoSaveController.vue2.js +10 -8
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +11 -13
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -70
  7. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +37 -23
  8. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  9. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +27 -0
  10. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  11. package/dist/components/organisms/header/EditorActions.vue2.js +36 -52
  12. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  13. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +48 -0
  14. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  15. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
  16. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  17. package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
  18. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  19. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  20. package/dist/components/organisms/header/RightSlot.vue.js +9 -8
  21. package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
  22. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  23. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  24. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +24 -0
  25. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  26. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
  27. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +82 -0
  28. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  29. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +54 -38
  30. package/dist/composables/useAccessibilityApi.js +35 -0
  31. package/dist/composables/useCustomInterfaceAppearance.js +45 -52
  32. package/dist/composables/useHtmlValidator.js +82 -87
  33. package/dist/composables/useRecommendation.js +35 -40
  34. package/dist/composables/useStripo.js +30 -30
  35. package/dist/config/i18n/en/labels.json.js +36 -4
  36. package/dist/config/i18n/en/tooltips.json.js +2 -1
  37. package/dist/enums/extensions/recommendationBlock.js +31 -38
  38. package/dist/extensions/Blocks/Recommendation/block.js +39 -43
  39. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
  40. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +35 -40
  41. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -84
  42. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
  43. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +90 -189
  44. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +16 -26
  45. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
  46. package/dist/guido.css +1 -1
  47. package/dist/node_modules/@vueuse/core/index.js +102 -0
  48. package/dist/node_modules/@vueuse/shared/index.js +40 -28
  49. package/dist/sprite.svg +6 -0
  50. package/dist/src/@types/config/schemas.d.ts +4 -0
  51. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +3 -1
  52. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
  53. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -3
  54. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  55. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  56. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  57. package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
  58. package/dist/src/composables/useActionsApi.d.ts +2 -2
  59. package/dist/src/composables/useConfig.d.ts +2 -0
  60. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
  61. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
  62. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  63. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -2
  64. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -9
  65. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -7
  66. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -75
  67. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
  68. package/dist/src/stores/config.d.ts +18 -0
  69. package/dist/src/stores/editor.d.ts +107 -0
  70. package/dist/src/stores/onboarding.d.ts +195 -21
  71. package/dist/src/stores/version-history.d.ts +1 -1
  72. package/dist/src/utils/timeUtil.d.ts +10 -0
  73. package/dist/static/styles/components/accessibility.css.js +282 -0
  74. package/dist/static/styles/components/recommendation-strategy.css.js +4 -34
  75. package/dist/static/styles/variables.css.js +2 -0
  76. package/dist/stores/editor.js +13 -4
  77. package/dist/stores/onboarding.js +66 -50
  78. package/dist/utils/templatePreparation.js +55 -55
  79. package/dist/utils/timeUtil.js +7 -17
  80. package/package.json +1 -1
  81. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  82. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  83. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
  84. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -47
  85. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +0 -24
  86. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +0 -14
  87. package/dist/static/styles/components/skeleton.css.js +0 -23
  88. /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
  89. /package/dist/src/components/organisms/{onboarding/RecommendationStrategyOnboarding.vue.d.ts → header/EditorActionsMenu.vue.d.ts} +0 -0
@@ -1,20 +1,14 @@
1
- import { useTranslations as n } from "../../composables/useTranslations.js";
2
- const o = {
1
+ import { useTranslations as r } from "../../composables/useTranslations.js";
2
+ const l = {
3
3
  RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com",
4
4
  // Relative path → same-origin as the embedding inone dashboard.
5
5
  PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
6
6
  RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
7
- RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies",
8
- // Smart Recommender hides the Email channel unless the URL asks for it, so a strategy created
9
- // without this flag can never be Email-suitable and would never reach the editor's list.
10
- RECOMMENDATION_STRATEGY_CREATE_PATH: "/discovery/recommendation-strategies/create?isEmail=true"
11
- }, d = (e) => {
12
- const { RECOMMENDATION_STRATEGIES_PANEL_PATH: r } = o;
13
- return `${r}/${e}/edit?isEmail=true`;
14
- }, m = {
7
+ RECOMMENDATION_STRATEGIES_PANEL_PATH: "/discovery/recommendation-strategies"
8
+ }, c = {
15
9
  CLIENT_ID: "clientId"
16
- }, p = () => {
17
- const e = n();
10
+ }, d = () => {
11
+ const e = r();
18
12
  return [
19
13
  {
20
14
  id: 11,
@@ -77,14 +71,14 @@ const o = {
77
71
  path: "top-sellers"
78
72
  }
79
73
  ];
80
- }, v = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], h = [
74
+ }, m = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], p = [
81
75
  { text: "before the amount", value: "0" },
82
76
  { text: "after the amount", value: "1" }
83
- ], x = [
77
+ ], v = [
84
78
  { text: "dot(.)", value: "." },
85
79
  { text: "comma(,)", value: "," },
86
80
  { text: "space( )", value: " " }
87
- ], E = [
81
+ ], h = [
88
82
  { text: "0", value: "0" },
89
83
  { text: "1", value: "1" },
90
84
  { text: "2", value: "2" },
@@ -96,55 +90,54 @@ const o = {
96
90
  { text: "contains", value: "~" },
97
91
  { text: "does not contain", value: "!~" },
98
92
  { text: "any of", value: a }
99
- ], s = [
93
+ ], n = [
100
94
  { text: "is exactly", value: "=" },
101
95
  { text: "is not exactly", value: "!==" },
102
96
  { text: "contains", value: "~" },
103
97
  { text: "does not contain", value: "!~" },
104
98
  { text: "any of", value: a }
105
- ], i = [
99
+ ], o = [
106
100
  { text: "is equal to", value: "=" },
107
101
  { text: "is greater than", value: ">" },
108
102
  { text: "is less than", value: "<" }
109
- ], u = [
103
+ ], s = [
110
104
  { text: "is equal to", value: "=" },
111
105
  { text: "after", value: ">" },
112
106
  { text: "before", value: "<" }
113
- ], c = [
107
+ ], i = [
114
108
  { text: "true", value: "==" },
115
109
  { text: "false", value: "!=" }
116
- ], b = (e) => {
110
+ ], x = (e) => {
117
111
  if (!e)
118
112
  return t;
119
113
  switch (e) {
120
114
  case "Boolean":
121
- return c;
115
+ return i;
122
116
  case "Date":
123
- return u;
117
+ return s;
124
118
  case "Number":
125
- return i;
119
+ return o;
126
120
  case "String":
127
121
  return t;
128
122
  case "Strings":
129
- return s;
123
+ return n;
130
124
  default:
131
125
  return t;
132
126
  }
133
127
  };
134
128
  export {
135
129
  a as OP_ANY_OF,
136
- v as PriceAttributes,
137
- m as QUERY_PARAMS,
138
- o as URLS,
139
- E as currencyDecimalCounts,
140
- h as currencyLocationMaps,
141
- x as currencyOperators,
142
- b as getOperatorOptions,
143
- p as getRecommendationFeedSourceMaps,
144
- s as operatorOptionsForArrayOfStrings,
145
- c as operatorOptionsForBooleans,
146
- u as operatorOptionsForDates,
147
- i as operatorOptionsForNumbers,
148
- t as operatorOptionsForStrings,
149
- d as strategyEditPath
130
+ m as PriceAttributes,
131
+ c as QUERY_PARAMS,
132
+ l as URLS,
133
+ h as currencyDecimalCounts,
134
+ p as currencyLocationMaps,
135
+ v as currencyOperators,
136
+ x as getOperatorOptions,
137
+ d as getRecommendationFeedSourceMaps,
138
+ n as operatorOptionsForArrayOfStrings,
139
+ i as operatorOptionsForBooleans,
140
+ s as operatorOptionsForDates,
141
+ o as operatorOptionsForNumbers,
142
+ t as operatorOptionsForStrings
150
143
  };
@@ -1,37 +1,37 @@
1
- var D = Object.defineProperty;
2
- var y = (l, c, t) => c in l ? D(l, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[c] = t;
3
- var f = (l, c, t) => y(l, typeof c != "symbol" ? c + "" : c, t);
4
- import { useConfig as C } from "../../../composables/useConfig.js";
5
- import { BlockId as b } from "../../../enums/block.js";
6
- import { getMigrationBannerHtml as A } from "../../../utils/migrationBannerHtml.js";
7
- import { Block as E, BlockCompositionType as S, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
8
- import { CURRENT_CONFIG_VERSION as N, PRE_RRS_CONFIG_VERSION as O } from "./constants/defaultConfig.js";
1
+ var R = Object.defineProperty;
2
+ var B = (a, c, t) => c in a ? R(a, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[c] = t;
3
+ var p = (a, c, t) => B(a, typeof c != "symbol" ? c + "" : c, t);
4
+ import { useConfig as D } from "../../../composables/useConfig.js";
5
+ import { BlockId as y } from "../../../enums/block.js";
6
+ import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
7
+ import { Block as b, BlockCompositionType as A, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
8
+ import { CURRENT_CONFIG_VERSION as E, PRE_RRS_CONFIG_VERSION as S } from "./constants/defaultConfig.js";
9
9
  import { RECOMMENDATION_ID_ATTR as m } from "./constants/selectors.js";
10
- import { regenerateMobileProductRows as M } from "./controls/main/utils.js";
11
- import { ensureMobileCssRulesExist as _, setMobileLayoutOptOut as I, hasMobileLayoutOptOut as w } from "./controls/mobileLayout/cssRules.js";
10
+ import { regenerateMobileProductRows as N } from "./controls/main/utils.js";
11
+ import { ensureMobileCssRulesExist as h, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as O } from "./controls/mobileLayout/cssRules.js";
12
12
  import { RecommendationConfigService as s } from "./services/configService.js";
13
13
  import { useRecommendationExtensionStore as d } from "./store/recommendation.js";
14
- import { getDefaultTemplate as x } from "./templates/grid/template.js";
15
- import { useRecommendationBlockWarning as H } from "./useRecommendationBlockWarning.js";
16
- const k = b.Recommendation, u = "recommendation-block-v2", R = "hide-price";
17
- let B = !1;
18
- class j extends E {
14
+ import { getDefaultTemplate as M } from "./templates/grid/template.js";
15
+ import { useRecommendationBlockWarning as w } from "./useRecommendationBlockWarning.js";
16
+ const _ = y.Recommendation, u = "recommendation-block-v2", I = "hide-price";
17
+ let k = !1;
18
+ class W extends b {
19
19
  constructor() {
20
20
  super();
21
21
  /**
22
22
  * Stores the ID generated in getTemplate() so onCreated() can reuse it.
23
23
  * This avoids generating a new (different) ID in onCreated().
24
24
  */
25
- f(this, "_pendingBlockId", null);
25
+ p(this, "_pendingBlockId", null);
26
26
  }
27
27
  getId() {
28
- return k;
28
+ return _;
29
29
  }
30
30
  getIcon() {
31
31
  return "recommendation-icon";
32
32
  }
33
33
  getBlockCompositionType() {
34
- return S.CONTAINER;
34
+ return A.CONTAINER;
35
35
  }
36
36
  getName() {
37
37
  return this.api.translate("Recommendation Block");
@@ -42,8 +42,8 @@ class j extends E {
42
42
  );
43
43
  }
44
44
  getSettingsPanelTitleHtml() {
45
- return A(
46
- k,
45
+ return C(
46
+ _,
47
47
  this.api.translate("Recommendation Block"),
48
48
  this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
49
49
  );
@@ -66,7 +66,7 @@ class j extends E {
66
66
  */
67
67
  getTemplate() {
68
68
  const t = this._generateNextId();
69
- return this._pendingBlockId = t, x(t);
69
+ return this._pendingBlockId = t, M(t);
70
70
  }
71
71
  /**
72
72
  * Called when a new block is dropped into the template
@@ -89,27 +89,23 @@ class j extends E {
89
89
  }
90
90
  const i = this._pendingBlockId ?? this._generateNextId();
91
91
  this._pendingBlockId = null, this._assignRecommendationId(t, i);
92
- const n = C().isFeatureEnabled("reusableRecommendationStrategy"), o = n && !s.hasConfig(t), { config: r, wasFreshDrop: a } = s.initializeConfig(
92
+ const { config: n, wasFreshDrop: o } = s.initializeConfig(
93
93
  this.api,
94
94
  t,
95
95
  {
96
96
  recommendationId: i,
97
- configVersion: n ? N : O,
98
- // An RRS block picks a strategy, not an algorithm, and its algorithm control is
99
- // hidden. Keeping the `mostPopular` default would bake a most-popular feed URL
100
- // at save for a block the user never configured.
101
- ...o ? { strategy: "" } : {}
97
+ configVersion: D().isFeatureEnabled("reusableRecommendationStrategy") ? E : S
102
98
  }
103
- ), p = d();
104
- if (p.setCurrentBlock(i), this._stampHidePrice(t, r.priceHideIfSameAsDiscounted), a) {
105
- _(this.api);
106
- const h = this._getBlockElement(t);
107
- h && (I(this.api, h, !0), M({
99
+ ), r = d();
100
+ if (r.setCurrentBlock(i), this._stampHidePrice(t, n.priceHideIfSameAsDiscounted), o) {
101
+ h(this.api);
102
+ const l = this._getBlockElement(t);
103
+ l && (f(this.api, l, !0), N({
108
104
  currentNode: t,
109
105
  documentModifier: this.api.getDocumentModifier()
110
106
  }));
111
107
  }
112
- p.patchCurrentBlockConfig({ language: r.language }, { triggerRefetch: !1 }), this._warnIfMultipleBlocks();
108
+ r.patchCurrentBlockConfig({ language: n.language }, { triggerRefetch: !1 }), this._warnIfMultipleBlocks();
113
109
  }
114
110
  /**
115
111
  * Called when the document changes or template is loaded
@@ -131,11 +127,11 @@ class j extends E {
131
127
  }
132
128
  this._healLingeringDuplicate(t), s.needsMigration(t) && this._migrateFromLegacy(t), this._healHidePriceAttr(t);
133
129
  try {
134
- B || (_(this.api), B = !0);
130
+ k || (h(this.api), k = !0);
135
131
  const e = s.getConfig(t), i = this._getBlockElement(t);
136
132
  if (i) {
137
133
  const n = !e.mobileLayoutEnabled;
138
- w(i) !== n && I(this.api, i, n);
134
+ O(i) !== n && f(this.api, i, n);
139
135
  }
140
136
  } catch {
141
137
  }
@@ -165,7 +161,7 @@ class j extends E {
165
161
  */
166
162
  _warnIfMultipleBlocks() {
167
163
  try {
168
- H().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
164
+ w().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
169
165
  } catch {
170
166
  }
171
167
  }
@@ -215,9 +211,9 @@ class j extends E {
215
211
  if (!o)
216
212
  return;
217
213
  let r = -1;
218
- for (let a = 0; a < n.length; a++)
219
- if (n[a] === o) {
220
- r = a;
214
+ for (let l = 0; l < n.length; l++)
215
+ if (n[l] === o) {
216
+ r = l;
221
217
  break;
222
218
  }
223
219
  if (r <= 0)
@@ -297,7 +293,7 @@ class j extends E {
297
293
  */
298
294
  _stampHidePrice(t, e) {
299
295
  const i = this._getBlockElement(t);
300
- i && this.api.getDocumentModifier().modifyHtml(i).setAttribute(R, String(e)).apply(new g("Stamp hide-price"));
296
+ i && this.api.getDocumentModifier().modifyHtml(i).setAttribute(I, String(e)).apply(new g("Stamp hide-price"));
301
297
  }
302
298
  /**
303
299
  * Stamps `hide-price` from config only when the block lacks the attribute —
@@ -305,7 +301,7 @@ class j extends E {
305
301
  */
306
302
  _healHidePriceAttr(t) {
307
303
  const e = this._getBlockElement(t);
308
- if (!e || !("getAttribute" in e) || e.getAttribute(R) !== null)
304
+ if (!e || !("getAttribute" in e) || e.getAttribute(I) !== null)
309
305
  return;
310
306
  const { priceHideIfSameAsDiscounted: i } = s.getConfig(t);
311
307
  this._stampHidePrice(t, i);
@@ -342,6 +338,6 @@ class j extends E {
342
338
  }
343
339
  }
344
340
  export {
345
- k as BLOCK_ID,
346
- j as RecommendationBlock
341
+ _ as BLOCK_ID,
342
+ W as RecommendationBlock
347
343
  };
@@ -1,13 +1,13 @@
1
- import { DEFAULT_COLUMN_SPACING as i, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as n, DEFAULT_MOBILE_COLUMN_SPACING as O, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
2
- import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as I, ATTR_PRODUCT_OMNIBUS_DISCOUNT as R, ATTR_PRODUCT_BUTTON as r, ATTR_RECOMMENDATION_TITLE as E } from "./selectors.js";
3
- const U = 1, u = 2, m = 2, A = {
1
+ import { DEFAULT_COLUMN_SPACING as R, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as n, DEFAULT_MOBILE_COLUMN_SPACING as O, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
2
+ import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as I, ATTR_PRODUCT_BUTTON as i, ATTR_RECOMMENDATION_TITLE as U } from "./selectors.js";
3
+ const A = 1, u = 2, D = {
4
4
  code: "USD",
5
5
  symbol: "USD",
6
6
  alignment: "after",
7
7
  decimalCount: 2,
8
8
  decimalSeparator: ".",
9
9
  thousandSeparator: ","
10
- }, D = {
10
+ }, E = {
11
11
  textBefore: "",
12
12
  textAfter: ""
13
13
  }, a = {
@@ -18,26 +18,26 @@ const U = 1, u = 2, m = 2, A = {
18
18
  t,
19
19
  _,
20
20
  T,
21
+ r,
21
22
  I,
22
- R,
23
- r
23
+ i
24
24
  ], N = {
25
- [E]: !0,
25
+ [U]: !0,
26
26
  [o]: !0,
27
27
  [t]: !0,
28
28
  [T]: !0,
29
29
  [_]: !0,
30
+ [r]: !1,
30
31
  [I]: !1,
31
- [R]: !1,
32
- [r]: !0
33
- }, L = {
32
+ [i]: !0
33
+ }, m = {
34
34
  // Settings
35
35
  strategy: "mostPopular",
36
36
  productIds: [],
37
37
  size: "6",
38
38
  shuffleProducts: !1,
39
39
  language: "en_US",
40
- currency: A,
40
+ currency: D,
41
41
  filters: [],
42
42
  strategyId: "",
43
43
  // Layout
@@ -46,7 +46,7 @@ const U = 1, u = 2, m = 2, A = {
46
46
  mobileCardsInRow: e,
47
47
  mobileLayoutEnabled: !1,
48
48
  previousMobileCardsInRow: e,
49
- columnSpacing: i,
49
+ columnSpacing: R,
50
50
  rowSpacing: s,
51
51
  mobileColumnSpacing: O,
52
52
  mobileRowSpacing: n,
@@ -55,7 +55,7 @@ const U = 1, u = 2, m = 2, A = {
55
55
  visibility: N,
56
56
  previousTitleHtml: "",
57
57
  // Element settings
58
- omnibusPrice: D,
58
+ omnibusPrice: E,
59
59
  omnibusDiscount: a,
60
60
  textTrimming: !1,
61
61
  // Price placement (block-level, affects all cards)
@@ -66,18 +66,17 @@ const U = 1, u = 2, m = 2, A = {
66
66
  // of "false" (the actual hiding happens server-side at send).
67
67
  priceHideIfSameAsDiscounted: !1,
68
68
  // Meta
69
- configVersion: U,
69
+ configVersion: A,
70
70
  recommendationId: 0
71
- }, P = [11, 12];
71
+ }, L = [11, 12];
72
72
  export {
73
73
  u as CURRENT_CONFIG_VERSION,
74
74
  c as DEFAULT_COMPOSITION,
75
- A as DEFAULT_CURRENCY,
76
- L as DEFAULT_NODE_CONFIG,
75
+ D as DEFAULT_CURRENCY,
76
+ m as DEFAULT_NODE_CONFIG,
77
77
  a as DEFAULT_OMNIBUS_DISCOUNT,
78
- D as DEFAULT_OMNIBUS_PRICE,
78
+ E as DEFAULT_OMNIBUS_PRICE,
79
79
  N as DEFAULT_VISIBILITY,
80
- P as EXCLUDED_ALGORITHM_IDS,
81
- U as PRE_RRS_CONFIG_VERSION,
82
- m as RRS_CONFIG_VERSION
80
+ L as EXCLUDED_ALGORITHM_IDS,
81
+ A as PRE_RRS_CONFIG_VERSION
83
82
  };
@@ -1,27 +1,27 @@
1
1
  var m = Object.defineProperty;
2
- var C = (g, c, t) => c in g ? m(g, c, { enumerable: !0, configurable: !0, writable: !0, value: t }) : g[c] = t;
3
- var n = (g, c, t) => C(g, typeof c != "symbol" ? c + "" : c, t);
2
+ var C = (h, l, t) => l in h ? m(h, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[l] = t;
3
+ var n = (h, l, t) => C(h, typeof l != "symbol" ? l + "" : l, t);
4
4
  import { useConfig as p } from "../../../../../composables/useConfig.js";
5
5
  import { ModificationDescription as y } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
6
  import { CommonControl as N } from "../../../common-control.js";
7
- import { RRS_CONFIG_VERSION as _, DEFAULT_NODE_CONFIG as a } from "../../constants/defaultConfig.js";
7
+ import { CURRENT_CONFIG_VERSION as _, DEFAULT_NODE_CONFIG as a } from "../../constants/defaultConfig.js";
8
8
  import { RECOMMENDATION_ID_ATTR as I } from "../../constants/selectors.js";
9
- import { RecommendationConfigService as l } from "../../services/configService.js";
9
+ import { RecommendationConfigService as c } from "../../services/configService.js";
10
10
  import { useRecommendationExtensionStore as R } from "../../store/recommendation.js";
11
11
  import { registerNodeConfigWriter as b } from "../../utils/nodeConfigWriter.js";
12
12
  import { AlgorithmControl as T } from "./algorithm.js";
13
13
  import { ALGORITHM_CONTROL_ID as ut } from "./algorithm.js";
14
14
  import { CurrencyControl as P } from "./currency.js";
15
- import { CURRENCY_CONTROL_ID as gt } from "./currency.js";
15
+ import { CURRENCY_CONTROL_ID as ht } from "./currency.js";
16
16
  import { FiltersControl as S } from "./filters.js";
17
- import { FILTERS_CONTROL_ID as ft } from "./filters.js";
17
+ import { FILTERS_CONTROL_ID as gt } from "./filters.js";
18
18
  import { LayoutOrientationControl as O } from "./layoutOrientation.js";
19
19
  import { LAYOUT_ORIENTATION_CONTROL_ID as Ct } from "./layoutOrientation.js";
20
20
  import { LocaleControl as L } from "./locale.js";
21
21
  import { LOCALE_CONTROL_ID as yt } from "./locale.js";
22
- import { PricePlacementControl as k } from "./pricePlacement.js";
22
+ import { PricePlacementControl as E } from "./pricePlacement.js";
23
23
  import { PRICE_PLACEMENT_CONTROL_ID as _t } from "./pricePlacement.js";
24
- import { ProductCountControl as E } from "./productCount.js";
24
+ import { ProductCountControl as k } from "./productCount.js";
25
25
  import { PRODUCT_COUNT_CONTROL_ID as Rt } from "./productCount.js";
26
26
  import { ProductLayoutControl as F } from "./productLayout.js";
27
27
  import { PRODUCT_LAYOUT_CONTROL_ID as Tt } from "./productLayout.js";
@@ -30,9 +30,9 @@ import { SHUFFLE_CONTROL_ID as St } from "./shuffle.js";
30
30
  import { StrategyControl as w } from "./strategy.js";
31
31
  import { STRATEGY_CONTROL_ID as Lt } from "./strategy.js";
32
32
  import { setCurrencyAttributes as A, getBlockElement as v, isPartnerManagedBlock as x, updateProductContentInPlace as B, regenerateProductRowsWithStyles as U } from "./utils.js";
33
- import { adjustProductsToSize as Et, formatProductPrice as Ft, getCardComposition as Dt, getCurrentLayout as wt, getMainContainerTbody as At, regenerateMobileProductRows as vt, updatePricesInPlace as xt, updateSingleProductContent as Bt } from "./utils.js";
34
- import { useDebounceFn as h } from "../../../../../node_modules/@vueuse/shared/index.js";
35
- const W = "ui-elements-recommendation-block";
33
+ import { adjustProductsToSize as kt, formatProductPrice as Ft, getCardComposition as Dt, getCurrentLayout as wt, getMainContainerTbody as At, regenerateMobileProductRows as vt, updatePricesInPlace as xt, updateSingleProductContent as Bt } from "./utils.js";
34
+ import { useDebounceFn as f } from "../../../../../node_modules/@vueuse/shared/index.js";
35
+ const $ = "ui-elements-recommendation-block";
36
36
  class at extends N {
37
37
  constructor() {
38
38
  super(...arguments);
@@ -58,7 +58,7 @@ class at extends N {
58
58
  /**
59
59
  * Debounced product fetch to prevent rapid API calls during config changes
60
60
  */
61
- n(this, "_debouncedFetchProducts", h(async () => {
61
+ n(this, "_debouncedFetchProducts", f(async () => {
62
62
  try {
63
63
  await this.store.fetchRecommendationProducts();
64
64
  } finally {
@@ -76,7 +76,7 @@ class at extends N {
76
76
  * count. The store pads products to the configured size, so in-place only
77
77
  * fails when the size actually changed.
78
78
  */
79
- n(this, "_debouncedRegenerateWithProducts", h(() => {
79
+ n(this, "_debouncedRegenerateWithProducts", f(() => {
80
80
  const t = this.store.recommendationProducts;
81
81
  if (!this.currentNode || !this.api)
82
82
  return;
@@ -97,7 +97,7 @@ class at extends N {
97
97
  }, 100));
98
98
  }
99
99
  getId() {
100
- return W;
100
+ return $;
101
101
  }
102
102
  get _subControls() {
103
103
  return [
@@ -118,7 +118,7 @@ class at extends N {
118
118
  return this.rrsEnabled = p().isFeatureEnabled("reusableRecommendationStrategy"), this._subControls.forEach((e) => {
119
119
  var o;
120
120
  return (o = e == null ? void 0 : e.onDestroy) == null ? void 0 : o.call(e);
121
- }), this.algorithmControl = new T(), this.localeControl = new L(), this.currencyControl = new P(), this.productCountControl = new E(), this.productLayoutControl = new F(), this.filtersControl = new S(), this.shuffleControl = new D(), this.pricePlacementControl = new k(), this.layoutOrientationControl = new O(), this.strategyControl = this.rrsEnabled ? new w() : null, this._subControls.forEach((e) => {
121
+ }), this.algorithmControl = new T(), this.localeControl = new L(), this.currencyControl = new P(), this.productCountControl = new k(), this.productLayoutControl = new F(), this.filtersControl = new S(), this.shuffleControl = new D(), this.pricePlacementControl = new E(), this.layoutOrientationControl = new O(), this.strategyControl = this.rrsEnabled ? new w() : null, this._subControls.forEach((e) => {
122
122
  e && (e.api = this.api);
123
123
  }), `
124
124
  <div class="recommendation-controls-container">
@@ -140,14 +140,14 @@ class at extends N {
140
140
  const e = (i = this.getContainer()) == null ? void 0 : i.querySelector(".recommendation-controls-container");
141
141
  if (!e)
142
142
  return;
143
- const o = this._getRecommendationIdFromNode(t) === null ? null : l.getConfig(t), r = this.rrsEnabled && !!o && (!!(o != null && o.strategyId) || ((o == null ? void 0 : o.configVersion) ?? 0) >= _);
143
+ const o = this._getRecommendationIdFromNode(t) === null ? null : c.getConfig(t), r = this.rrsEnabled && !!o && (!!(o != null && o.strategyId) || ((o == null ? void 0 : o.configVersion) ?? 0) >= _);
144
144
  e.classList.toggle("strategy-block", r);
145
145
  }
146
146
  async onRender() {
147
147
  var o;
148
148
  b(this.api);
149
149
  const t = this._getRecommendationIdFromNode(this.currentNode), e = t ?? this.store.currentRecommendationId;
150
- if (e !== null && this.store.setCurrentBlock(e), t !== null && this._syncNodeConfigIfChanged(t), this._listenStateUpdates(), this._showControlsForBlock(this.currentNode), t !== null && this.strategyControl && (this.strategyControl.api = this.api, this.strategyControl.currentNode = this.currentNode, this.strategyControl.onRender()), e !== null && ((o = this.store.blockStates[e]) != null && o.isInitialized)) {
150
+ if (e !== null && this.store.setCurrentBlock(e), t !== null && this._syncNodeConfigIfChanged(t), this._listenStateUpdates(), this._showControlsForBlock(this.currentNode), e !== null && ((o = this.store.blockStates[e]) != null && o.isInitialized)) {
151
151
  this._initializeSubControls();
152
152
  return;
153
153
  }
@@ -209,23 +209,18 @@ class at extends N {
209
209
  const e = this.store.blockStates[t];
210
210
  if (!e)
211
211
  return;
212
- const o = JSON.stringify(l.getConfig(this.currentNode)), r = e.syncedConfigFingerprint;
212
+ const o = JSON.stringify(c.getConfig(this.currentNode)), r = e.syncedConfigFingerprint;
213
213
  e.syncedConfigFingerprint = o, r !== o && (this.pendingNodeConfigWrite || this._syncNodeConfigToStore());
214
214
  }
215
- /** Whether the deferred write would move the node's strategyId — see the caller (SD-149916). */
216
- _isPendingStrategyIdChange() {
217
- const t = this.pendingNodeConfigWrite;
218
- return t ? l.getConfig(this.currentNode).strategyId !== t.updates.strategyId : !1;
219
- }
220
215
  _capturePendingNodeConfigWrite() {
221
216
  const t = this.store.currentRecommendationId;
222
217
  if (!this.currentNode || !this.api || t === null)
223
218
  return;
224
- const { filters: e, strategy: o, strategyId: r, size: i } = this.store.recommendationConfigs;
219
+ const { filters: e, strategyId: o, size: r } = this.store.recommendationConfigs;
225
220
  this.pendingNodeConfigWrite = {
226
221
  blockId: t,
227
222
  node: this.currentNode,
228
- updates: { filters: e, strategy: o, strategyId: r, size: i }
223
+ updates: { filters: e, strategyId: o, size: r }
229
224
  };
230
225
  }
231
226
  /**
@@ -240,7 +235,7 @@ class at extends N {
240
235
  */
241
236
  _stagePendingNodeConfig(t) {
242
237
  const e = this.pendingNodeConfigWrite;
243
- return !e || !this.currentNode ? !1 : (l.stageConfig(t, this.currentNode, e.updates), !0);
238
+ return !e || !this.currentNode ? !1 : (c.stageConfig(t, this.currentNode, e.updates), !0);
244
239
  }
245
240
  /**
246
241
  * Arms the guaranteed fallback write, once the product fetch has settled. The
@@ -264,12 +259,12 @@ class at extends N {
264
259
  const t = this.pendingNodeConfigWrite;
265
260
  if (this.pendingNodeConfigWrite = null, this._clearConfigFlush(), !t || !this.api)
266
261
  return;
267
- const e = t.blockId === this.store.currentRecommendationId && this.currentNode ? this.currentNode : t.node, o = l.getConfig(e);
268
- JSON.stringify(o.filters) === JSON.stringify(t.updates.filters) && o.strategy === t.updates.strategy && o.strategyId === t.updates.strategyId && o.size === t.updates.size || l.updateConfig(this.api, e, t.updates, "Update recommendation filters");
262
+ const e = t.blockId === this.store.currentRecommendationId && this.currentNode ? this.currentNode : t.node, o = c.getConfig(e);
263
+ JSON.stringify(o.filters) === JSON.stringify(t.updates.filters) && o.strategyId === t.updates.strategyId && o.size === t.updates.size || c.updateConfig(this.api, e, t.updates, "Update recommendation filters");
269
264
  }
270
265
  _syncNodeConfigToStore() {
271
266
  var r;
272
- const t = l.getConfig(this.currentNode), e = this.store.currentRecommendationId, o = e !== null && ((r = this.store.blockStates[e]) == null ? void 0 : r.isInitialized);
267
+ const t = c.getConfig(this.currentNode), e = this.store.currentRecommendationId, o = e !== null && ((r = this.store.blockStates[e]) == null ? void 0 : r.isInitialized);
273
268
  this.store.patchCurrentBlockConfig({
274
269
  strategy: t.strategy,
275
270
  strategyId: t.strategyId,
@@ -333,7 +328,7 @@ class at extends N {
333
328
  _applySmartDefaults() {
334
329
  if (!this.currentNode || !this.api)
335
330
  return;
336
- const t = l.getConfig(this.currentNode), e = {};
331
+ const t = c.getConfig(this.currentNode), e = {};
337
332
  let o = null, r = null, i = null;
338
333
  if (t.currency.code === a.currency.code) {
339
334
  const { currencyList: s } = this.store;
@@ -357,7 +352,7 @@ class at extends N {
357
352
  (d) => d.value === a.language
358
353
  ) || (i = s[0].value, e.language = i));
359
354
  }
360
- !o && !r && !i || (l.updateConfig(
355
+ !o && !r && !i || (c.updateConfig(
361
356
  this.api,
362
357
  this.currentNode,
363
358
  e,
@@ -418,19 +413,19 @@ class at extends N {
418
413
  return;
419
414
  }
420
415
  const s = t.$state.configVersion;
421
- s !== o && (o = s, this._capturePendingNodeConfigWrite(), this._isPendingStrategyIdChange() && this._flushPendingNodeConfig(), this._debouncedFetchProducts());
422
- const u = t.recommendationProducts, d = u !== e, f = Array.isArray(u) && u.length > 0;
423
- d && f && (e = u, this._debouncedRegenerateWithProducts());
416
+ s !== o && (o = s, this._capturePendingNodeConfigWrite(), this._debouncedFetchProducts());
417
+ const u = t.recommendationProducts, d = u !== e, g = Array.isArray(u) && u.length > 0;
418
+ d && g && (e = u, this._debouncedRegenerateWithProducts());
424
419
  });
425
420
  }
426
421
  }
427
422
  export {
428
423
  ut as ALGORITHM_CONTROL_ID,
429
424
  T as AlgorithmControl,
430
- W as CONTROL_BLOCK_ID,
431
- gt as CURRENCY_CONTROL_ID,
425
+ $ as CONTROL_BLOCK_ID,
426
+ ht as CURRENCY_CONTROL_ID,
432
427
  P as CurrencyControl,
433
- ft as FILTERS_CONTROL_ID,
428
+ gt as FILTERS_CONTROL_ID,
434
429
  S as FiltersControl,
435
430
  Ct as LAYOUT_ORIENTATION_CONTROL_ID,
436
431
  yt as LOCALE_CONTROL_ID,
@@ -439,15 +434,15 @@ export {
439
434
  _t as PRICE_PLACEMENT_CONTROL_ID,
440
435
  Rt as PRODUCT_COUNT_CONTROL_ID,
441
436
  Tt as PRODUCT_LAYOUT_CONTROL_ID,
442
- k as PricePlacementControl,
443
- E as ProductCountControl,
437
+ E as PricePlacementControl,
438
+ k as ProductCountControl,
444
439
  F as ProductLayoutControl,
445
440
  at as RecommendationBlockControl,
446
441
  St as SHUFFLE_CONTROL_ID,
447
442
  Lt as STRATEGY_CONTROL_ID,
448
443
  D as ShuffleControl,
449
444
  w as StrategyControl,
450
- Et as adjustProductsToSize,
445
+ kt as adjustProductsToSize,
451
446
  Ft as formatProductPrice,
452
447
  v as getBlockElement,
453
448
  Dt as getCardComposition,