@useinsider/guido 3.20.0 → 3.20.1-beta.07e0277
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/@types/config/schemas.js +11 -10
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +114 -103
- package/dist/components/organisms/AutoSaveController.vue2.js +19 -9
- package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
- package/dist/components/organisms/header/AutoSaveStatus.vue2.js +25 -0
- package/dist/components/organisms/header/EditorActions.vue.js +13 -13
- package/dist/components/organisms/header/EditorActions.vue2.js +57 -72
- package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
- package/dist/components/organisms/header/EditorActionsMenu.vue2.js +98 -0
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
- package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
- package/dist/components/organisms/header/RightSlot.vue.js +11 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +22 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +90 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +60 -35
- package/dist/composables/useAccessibilityApi.js +51 -0
- package/dist/composables/useCustomInterfaceAppearance.js +42 -41
- package/dist/composables/useLegacyStrategyConversion.js +16 -16
- package/dist/composables/useStripo.js +4 -3
- package/dist/config/compiler/itemsCompilerRules.js +21 -5
- package/dist/config/compiler/utils/itemsCompilerUtils.js +64 -17
- package/dist/config/i18n/en/labels.json.js +36 -4
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/config/migrator/itemsBlockMigrator.js +112 -108
- package/dist/extensions/Blocks/Items/block.js +76 -64
- package/dist/extensions/Blocks/Items/constants/cardWidth.js +20 -0
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +1 -1
- package/dist/extensions/Blocks/Recommendation/block.js +51 -44
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +103 -91
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +308 -218
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +209 -203
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +232 -186
- package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +19 -0
- package/dist/extensions/Blocks/Recommendation/utils/blockUrlConfig.js +25 -0
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +72 -70
- package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +69 -60
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +63 -27
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +39 -20
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +271 -192
- package/dist/package.json.js +1 -1
- package/dist/sprite.svg +10 -0
- package/dist/src/@types/config/schemas.d.ts +2 -0
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +19 -1
- package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -19
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -19
- package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
- package/dist/src/composables/useActionsApi.d.ts +2 -2
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/config/compiler/utils/itemsCompilerUtils.d.ts +10 -0
- package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +5 -0
- package/dist/src/extensions/Blocks/Items/constants/cardWidth.d.ts +12 -0
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
- package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +20 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +26 -6
- package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +17 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/blockUrlConfig.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +4 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +10 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +7 -0
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
- package/dist/src/stores/autosave.d.ts +73 -1
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/stores/editor.d.ts +109 -0
- package/dist/src/stores/onboarding.d.ts +966 -35
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/liquidProtection.d.ts +3 -0
- package/dist/src/utils/timeUtil.d.ts +5 -8
- package/dist/static/styles/components/accessibility.css.js +234 -0
- package/dist/static/styles/components/button.css.js +5 -0
- package/dist/static/styles/variables.css.js +2 -0
- package/dist/stores/autosave.js +12 -7
- package/dist/stores/editor.js +8 -3
- package/dist/stores/onboarding.js +48 -22
- package/dist/utils/liquidProtection.js +5 -0
- package/dist/utils/templatePreparation.js +61 -85
- package/dist/utils/timeUtil.js +6 -17
- package/package.json +3 -3
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
- /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
|
@@ -1,23 +1,29 @@
|
|
|
1
|
-
import { useToaster as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { getRecommendationFeedSourceMaps as F, strategyEditPath as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import { useRecommendationApi as
|
|
1
|
+
import { useToaster as L } from "../../../../composables/useToaster.js";
|
|
2
|
+
import { useTranslations as U } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { getRecommendationFeedSourceMaps as F, strategyEditPath as z, strategyCreatePath as B, getOperatorOptions as M, PriceAttributes as N } from "../../../../enums/extensions/recommendationBlock.js";
|
|
4
|
+
import { ToasterTypeOptions as E } from "../../../../enums/toaster.js";
|
|
5
|
+
import { useRecommendationApi as O } from "../../../../services/recommendationApi.js";
|
|
6
6
|
import { useConfigStore as R } from "../../../../stores/config.js";
|
|
7
|
-
import { defineStore as
|
|
7
|
+
import { defineStore as V } from "pinia";
|
|
8
8
|
import "../constants/selectors.js";
|
|
9
|
-
import { DEFAULT_MOBILE_CARDS_IN_ROW as
|
|
10
|
-
import { CURRENT_CONFIG_VERSION as C, DEFAULT_NODE_CONFIG as T, EXCLUDED_ALGORITHM_IDS as
|
|
9
|
+
import { DEFAULT_MOBILE_CARDS_IN_ROW as A, DEFAULT_CARDS_IN_ROW as x } from "../constants/layout.js";
|
|
10
|
+
import { CURRENT_CONFIG_VERSION as C, DEFAULT_NODE_CONFIG as T, EXCLUDED_ALGORITHM_IDS as j } from "../constants/defaultConfig.js";
|
|
11
11
|
import { getDefaultProducts as w } from "../templates/utils.js";
|
|
12
12
|
import { generateCompleteFilterQuery as P } from "../utils/filterUtil.js";
|
|
13
|
-
import { isLegacyStrategyConfig as
|
|
14
|
-
import { getPartnerRecommendationParams as
|
|
15
|
-
import { sanitizeProductIds as
|
|
16
|
-
import { isFilterValid as
|
|
17
|
-
import { getInvalidFields as
|
|
18
|
-
const m =
|
|
19
|
-
let
|
|
20
|
-
const
|
|
13
|
+
import { isLegacyStrategyConfig as $ } from "../utils/legacyStrategyMigration.js";
|
|
14
|
+
import { getPartnerRecommendationParams as q } from "../utils/partnerCustomizations.js";
|
|
15
|
+
import { sanitizeProductIds as K } from "../utils/productIds.js";
|
|
16
|
+
import { isFilterValid as H } from "../validation/filterSchema.js";
|
|
17
|
+
import { getInvalidFields as J, isConfigValid as Q } from "../validation/requiredFields.js";
|
|
18
|
+
const m = O();
|
|
19
|
+
let p = null, y = null;
|
|
20
|
+
const I = /* @__PURE__ */ new Map();
|
|
21
|
+
let k = null, b = 0;
|
|
22
|
+
const u = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
|
|
23
|
+
function W(t) {
|
|
24
|
+
const e = _.get(t);
|
|
25
|
+
return e && e.token === u.get(t) ? e.outcome : !1;
|
|
26
|
+
}
|
|
21
27
|
let l = null;
|
|
22
28
|
function D() {
|
|
23
29
|
return {
|
|
@@ -35,7 +41,7 @@ function D() {
|
|
|
35
41
|
productIds: [],
|
|
36
42
|
id: 1,
|
|
37
43
|
language: "en_US",
|
|
38
|
-
mobileCardsInRow:
|
|
44
|
+
mobileCardsInRow: A,
|
|
39
45
|
mobileLayoutEnabled: !1,
|
|
40
46
|
orientation: "grid",
|
|
41
47
|
recommendedProducts: [],
|
|
@@ -69,10 +75,12 @@ function G() {
|
|
|
69
75
|
isInitialized: !1,
|
|
70
76
|
filterSnapshot: null,
|
|
71
77
|
syncedConfigFingerprint: null,
|
|
72
|
-
legacyConversionLoading: !1
|
|
78
|
+
legacyConversionLoading: !1,
|
|
79
|
+
configVersion: 0,
|
|
80
|
+
adoptedSizeVersion: 0
|
|
73
81
|
};
|
|
74
82
|
}
|
|
75
|
-
const
|
|
83
|
+
const X = () => ({
|
|
76
84
|
recommendationCampaignUrls: {},
|
|
77
85
|
activePredictiveAlgorithms: [],
|
|
78
86
|
languages: {},
|
|
@@ -87,8 +95,8 @@ const Q = () => ({
|
|
|
87
95
|
currentRecommendationId: null,
|
|
88
96
|
strategyPanelOpen: !1,
|
|
89
97
|
configVersion: 0
|
|
90
|
-
}),
|
|
91
|
-
state: () =>
|
|
98
|
+
}), ht = V("guidoRecommendationExtension", {
|
|
99
|
+
state: () => X(),
|
|
92
100
|
getters: {
|
|
93
101
|
// ====================================================================
|
|
94
102
|
// Proxy Getters — Backward Compatible Access to Current Block State
|
|
@@ -119,7 +127,7 @@ const Q = () => ({
|
|
|
119
127
|
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].removeStrategyModalStatus : !1;
|
|
120
128
|
},
|
|
121
129
|
isLegacyStrategyBlock() {
|
|
122
|
-
return R().isFeatureEnabled("reusableRecommendationStrategy") &&
|
|
130
|
+
return R().isFeatureEnabled("reusableRecommendationStrategy") && $(this.recommendationConfigs);
|
|
123
131
|
},
|
|
124
132
|
legacyConversionLoading(t) {
|
|
125
133
|
return t.currentRecommendationId !== null && t.blockStates[t.currentRecommendationId] ? t.blockStates[t.currentRecommendationId].legacyConversionLoading ?? !1 : !1;
|
|
@@ -129,7 +137,7 @@ const Q = () => ({
|
|
|
129
137
|
},
|
|
130
138
|
assignedStrategy(t) {
|
|
131
139
|
const { strategyId: e } = this.recommendationConfigs;
|
|
132
|
-
return e ? t.strategies.find((
|
|
140
|
+
return e ? t.strategies.find((n) => String(n.strategy_id) === e) ?? null : null;
|
|
133
141
|
},
|
|
134
142
|
/**
|
|
135
143
|
* Proxy getter: delegates to blockStates[currentRecommendationId].filterStatus
|
|
@@ -159,19 +167,19 @@ const Q = () => ({
|
|
|
159
167
|
},
|
|
160
168
|
getUniqueFilterGroups() {
|
|
161
169
|
const { filters: t } = this.recommendationConfigs;
|
|
162
|
-
return [...new Set(t.map((e) => e.filterGroup))].sort((e,
|
|
170
|
+
return [...new Set(t.map((e) => e.filterGroup))].sort((e, n) => e - n);
|
|
163
171
|
},
|
|
164
172
|
getActivePredictiveAlgorithms: (t) => {
|
|
165
|
-
const e = F(),
|
|
166
|
-
return t.activePredictiveAlgorithms.filter((
|
|
167
|
-
|
|
168
|
-
}),
|
|
169
|
-
text:
|
|
170
|
-
value:
|
|
173
|
+
const e = F(), n = [];
|
|
174
|
+
return t.activePredictiveAlgorithms.filter((r) => !j.includes(r)).forEach((r) => {
|
|
175
|
+
n.push(...e.filter((o) => o.id === r));
|
|
176
|
+
}), n.map((r) => ({
|
|
177
|
+
text: r.name,
|
|
178
|
+
value: r.key
|
|
171
179
|
}));
|
|
172
180
|
},
|
|
173
|
-
getLanguages: (t) => Object.entries(t.languages).map(([e,
|
|
174
|
-
text:
|
|
181
|
+
getLanguages: (t) => Object.entries(t.languages).map(([e, n]) => ({
|
|
182
|
+
text: n,
|
|
175
183
|
value: e
|
|
176
184
|
})),
|
|
177
185
|
getCurrencySymbolList: (t) => t.currencyList.map((e) => ({
|
|
@@ -181,7 +189,7 @@ const Q = () => ({
|
|
|
181
189
|
getFilterList() {
|
|
182
190
|
return Object.values(this.filterList).filter((t) => t.isFilterable !== 0 && t.isFilterable !== !1).map((t) => {
|
|
183
191
|
let e;
|
|
184
|
-
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` :
|
|
192
|
+
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : N.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
185
193
|
text: t.displayName,
|
|
186
194
|
value: e,
|
|
187
195
|
type: t.attributeType
|
|
@@ -213,13 +221,13 @@ const Q = () => ({
|
|
|
213
221
|
removeBlockState(t) {
|
|
214
222
|
const e = t.toString();
|
|
215
223
|
if (this.recommendationCampaignUrls[e]) {
|
|
216
|
-
const
|
|
217
|
-
delete
|
|
224
|
+
const r = { ...this.recommendationCampaignUrls };
|
|
225
|
+
delete r[e], this.recommendationCampaignUrls = r;
|
|
218
226
|
}
|
|
219
|
-
const
|
|
220
|
-
if (delete
|
|
221
|
-
const
|
|
222
|
-
this.currentRecommendationId =
|
|
227
|
+
const n = { ...this.blockStates };
|
|
228
|
+
if (delete n[t], this.blockStates = n, this.currentRecommendationId === t) {
|
|
229
|
+
const r = Object.keys(this.blockStates).map(Number);
|
|
230
|
+
this.currentRecommendationId = r.length > 0 ? r[0] : null;
|
|
223
231
|
}
|
|
224
232
|
},
|
|
225
233
|
/**
|
|
@@ -231,18 +239,18 @@ const Q = () => ({
|
|
|
231
239
|
* (SD-149916).
|
|
232
240
|
*/
|
|
233
241
|
cloneBlockState(t, e) {
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
236
|
-
const
|
|
237
|
-
|
|
242
|
+
const n = this.blockStates[t];
|
|
243
|
+
if (n) {
|
|
244
|
+
const s = structuredClone(n);
|
|
245
|
+
s.recommendationConfigs.id = e, s.recommendationConfigs.strategyId && R().isFeatureEnabled("reusableRecommendationStrategy") && (s.isInitialized = !1, s.syncedConfigFingerprint = null), this.blockStates = {
|
|
238
246
|
...this.blockStates,
|
|
239
|
-
[e]:
|
|
247
|
+
[e]: s
|
|
240
248
|
};
|
|
241
249
|
}
|
|
242
|
-
const
|
|
250
|
+
const r = t.toString(), o = e.toString(), i = this.recommendationCampaignUrls[r];
|
|
243
251
|
i && (this.recommendationCampaignUrls = {
|
|
244
252
|
...this.recommendationCampaignUrls,
|
|
245
|
-
[
|
|
253
|
+
[o]: i
|
|
246
254
|
});
|
|
247
255
|
},
|
|
248
256
|
/**
|
|
@@ -267,15 +275,15 @@ const Q = () => ({
|
|
|
267
275
|
* `isInitialized`) alone.
|
|
268
276
|
*/
|
|
269
277
|
seedBlockUrlConfig(t, e) {
|
|
270
|
-
const
|
|
278
|
+
const n = (s, a) => s === "." || s === "," || s === " " ? s : a, r = {
|
|
271
279
|
name: e.currencyCode,
|
|
272
280
|
value: e.currencyCode,
|
|
273
281
|
symbol: e.currencySymbol,
|
|
274
282
|
alignment: e.currencyAlignment === "before" ? "0" : "1",
|
|
275
283
|
decimalCount: String(e.currencyDecimalCount),
|
|
276
|
-
decimalSeparator:
|
|
277
|
-
thousandSeparator:
|
|
278
|
-
},
|
|
284
|
+
decimalSeparator: n(e.currencyDecimalSeparator, ","),
|
|
285
|
+
thousandSeparator: n(e.currencyThousandSeparator, ".")
|
|
286
|
+
}, o = !this.blockStates[t], i = o ? G() : this.blockStates[t];
|
|
279
287
|
i.recommendationConfigs = {
|
|
280
288
|
...i.recommendationConfigs,
|
|
281
289
|
strategy: e.strategy,
|
|
@@ -285,8 +293,8 @@ const Q = () => ({
|
|
|
285
293
|
productIds: e.productIds,
|
|
286
294
|
filters: e.filters,
|
|
287
295
|
shuffleProducts: e.shuffleProducts,
|
|
288
|
-
currencySettings:
|
|
289
|
-
},
|
|
296
|
+
currencySettings: r
|
|
297
|
+
}, o && (this.blockStates = {
|
|
290
298
|
...this.blockStates,
|
|
291
299
|
[t]: i
|
|
292
300
|
});
|
|
@@ -298,27 +306,27 @@ const Q = () => ({
|
|
|
298
306
|
patchCurrentBlockConfig(t, e = {}) {
|
|
299
307
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
300
308
|
return;
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
...
|
|
309
|
+
const n = this.blockStates[this.currentRecommendationId];
|
|
310
|
+
n.recommendationConfigs = {
|
|
311
|
+
...n.recommendationConfigs,
|
|
304
312
|
...t,
|
|
305
313
|
currencySettings: {
|
|
306
|
-
...
|
|
314
|
+
...n.recommendationConfigs.currencySettings,
|
|
307
315
|
...t.currencySettings || {}
|
|
308
316
|
}
|
|
309
317
|
};
|
|
310
|
-
const { triggerRefetch:
|
|
311
|
-
|
|
318
|
+
const { triggerRefetch: r = !0 } = e;
|
|
319
|
+
r && (n.configVersion++, this.configVersion++);
|
|
312
320
|
},
|
|
313
321
|
/**
|
|
314
322
|
* Creates a filter with the first available attribute and operator pre-selected.
|
|
315
323
|
*/
|
|
316
324
|
createDefaultFilter(t, e) {
|
|
317
|
-
const [
|
|
325
|
+
const [n] = this.getFilterList, [r] = M(n == null ? void 0 : n.type);
|
|
318
326
|
return {
|
|
319
327
|
type: "standardFilter",
|
|
320
|
-
attribute: (
|
|
321
|
-
operator: (
|
|
328
|
+
attribute: (n == null ? void 0 : n.value) ?? "",
|
|
329
|
+
operator: (r == null ? void 0 : r.value) ?? "",
|
|
322
330
|
innerGroupOperator: "*",
|
|
323
331
|
outerGroupOperator: "*",
|
|
324
332
|
filterNumber: e,
|
|
@@ -390,10 +398,10 @@ const Q = () => ({
|
|
|
390
398
|
const t = b, e = (async () => {
|
|
391
399
|
this.strategiesLoading = !0;
|
|
392
400
|
try {
|
|
393
|
-
const
|
|
401
|
+
const n = await m.fetchRecommendationStrategies();
|
|
394
402
|
if (t !== b)
|
|
395
403
|
return;
|
|
396
|
-
this.strategies =
|
|
404
|
+
this.strategies = n, this.strategiesFetched = !0;
|
|
397
405
|
} finally {
|
|
398
406
|
this.strategiesLoading = !1, t === b && (this.strategiesSettled = !0);
|
|
399
407
|
}
|
|
@@ -434,20 +442,20 @@ const Q = () => ({
|
|
|
434
442
|
_armStrategyPageReturn(t) {
|
|
435
443
|
const e = window.open(t, "_blank");
|
|
436
444
|
if (!e)
|
|
437
|
-
return
|
|
438
|
-
type:
|
|
439
|
-
message:
|
|
445
|
+
return L().showToaster({
|
|
446
|
+
type: E.Error,
|
|
447
|
+
message: U()("discovery-strategy.error-description")
|
|
440
448
|
}), !1;
|
|
441
449
|
e.opener = null, l == null || l();
|
|
442
|
-
let
|
|
443
|
-
const
|
|
444
|
-
document.hidden ||
|
|
450
|
+
let n = !1;
|
|
451
|
+
const r = () => {
|
|
452
|
+
document.hidden || n || (e != null && e.closed && (l == null || l()), n = !0, this.invalidateStrategies(), this.fetchStrategies().then(() => this._refreshAssignedStrategyProducts()).catch(() => {
|
|
445
453
|
}).finally(() => {
|
|
446
|
-
|
|
454
|
+
n = !1;
|
|
447
455
|
}));
|
|
448
456
|
};
|
|
449
|
-
return document.addEventListener("visibilitychange",
|
|
450
|
-
document.removeEventListener("visibilitychange",
|
|
457
|
+
return document.addEventListener("visibilitychange", r), l = () => {
|
|
458
|
+
document.removeEventListener("visibilitychange", r), l = null;
|
|
451
459
|
}, !0;
|
|
452
460
|
},
|
|
453
461
|
/**
|
|
@@ -471,23 +479,23 @@ const Q = () => ({
|
|
|
471
479
|
* new strategy is offered; the user picks it themselves.
|
|
472
480
|
*/
|
|
473
481
|
openStrategyCreation() {
|
|
474
|
-
return this._armStrategyPageReturn(
|
|
482
|
+
return this._armStrategyPageReturn(B());
|
|
475
483
|
},
|
|
476
484
|
/**
|
|
477
485
|
* Opens the strategy's edit page. Every return refreshes the list so the block reflects the
|
|
478
486
|
* edited configuration.
|
|
479
487
|
*/
|
|
480
488
|
openStrategyEdit(t) {
|
|
481
|
-
return this._armStrategyPageReturn(
|
|
489
|
+
return this._armStrategyPageReturn(z(t));
|
|
482
490
|
},
|
|
483
491
|
async resolveStrategyUrlTemplate(t, e) {
|
|
484
|
-
const
|
|
485
|
-
if (
|
|
486
|
-
return
|
|
492
|
+
const n = typeof t.updated_at == "string" ? t.updated_at : "", r = n ? `${t.strategy_id}:${n}:${e}` : "", o = r ? this.strategyUrlTemplates[r] : void 0;
|
|
493
|
+
if (o)
|
|
494
|
+
return o;
|
|
487
495
|
const { full_path: i = "" } = await m.generateStrategyEndpoint(t, e) ?? {};
|
|
488
|
-
return
|
|
496
|
+
return r && i && (this.strategyUrlTemplates = {
|
|
489
497
|
...this.strategyUrlTemplates,
|
|
490
|
-
[
|
|
498
|
+
[r]: i
|
|
491
499
|
}), i;
|
|
492
500
|
},
|
|
493
501
|
assignStrategy(t) {
|
|
@@ -497,27 +505,27 @@ const Q = () => ({
|
|
|
497
505
|
});
|
|
498
506
|
},
|
|
499
507
|
async convertLegacyStrategy(t, e = { scope: "campaign" }) {
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
508
|
+
const n = this.currentRecommendationId;
|
|
509
|
+
if (n === null || !this.blockStates[n])
|
|
502
510
|
throw new Error("[Guido] convertLegacyStrategy called without an active block");
|
|
503
|
-
this.blockStates[
|
|
511
|
+
this.blockStates[n].legacyConversionLoading = !0;
|
|
504
512
|
try {
|
|
505
|
-
const
|
|
513
|
+
const r = await m.migrateLegacyStrategy(t, e);
|
|
506
514
|
this.invalidateStrategies();
|
|
507
515
|
try {
|
|
508
516
|
await this.fetchStrategies();
|
|
509
|
-
} catch (
|
|
510
|
-
console.error("[Guido] strategy listing refresh after conversion failed",
|
|
517
|
+
} catch (s) {
|
|
518
|
+
console.error("[Guido] strategy listing refresh after conversion failed", s);
|
|
511
519
|
}
|
|
512
|
-
const
|
|
520
|
+
const o = this.strategies.find((s) => String(s.strategy_id) === r), i = this.blockStates[n];
|
|
513
521
|
return i && (i.recommendationConfigs = {
|
|
514
522
|
...i.recommendationConfigs,
|
|
515
|
-
strategyId:
|
|
523
|
+
strategyId: r,
|
|
516
524
|
nodeConfigVersion: C,
|
|
517
|
-
...(
|
|
518
|
-
}), this.currentRecommendationId ===
|
|
525
|
+
...(o == null ? void 0 : o.size) !== void 0 ? { size: String(o.size) } : {}
|
|
526
|
+
}, i.configVersion++), this.currentRecommendationId === n && this.configVersion++, r;
|
|
519
527
|
} finally {
|
|
520
|
-
this.blockStates[
|
|
528
|
+
this.blockStates[n] && (this.blockStates[n].legacyConversionLoading = !1);
|
|
521
529
|
}
|
|
522
530
|
},
|
|
523
531
|
/**
|
|
@@ -526,8 +534,8 @@ const Q = () => ({
|
|
|
526
534
|
* the document never received.
|
|
527
535
|
*/
|
|
528
536
|
revertLegacyConversion(t, e) {
|
|
529
|
-
const
|
|
530
|
-
|
|
537
|
+
const n = this.blockStates[t];
|
|
538
|
+
n && (n.recommendationConfigs = { ...n.recommendationConfigs, ...e }, n.configVersion++, this.currentRecommendationId === t && this.configVersion++);
|
|
531
539
|
},
|
|
532
540
|
removeStrategy() {
|
|
533
541
|
this.patchCurrentBlockConfig({
|
|
@@ -542,43 +550,43 @@ const Q = () => ({
|
|
|
542
550
|
// ====================================================================
|
|
543
551
|
async fetchRecommendationCreateData() {
|
|
544
552
|
if (!this.activePredictiveAlgorithms.length) {
|
|
545
|
-
if (
|
|
546
|
-
await
|
|
553
|
+
if (p) {
|
|
554
|
+
await p;
|
|
547
555
|
return;
|
|
548
556
|
}
|
|
549
|
-
|
|
557
|
+
p = (async () => {
|
|
550
558
|
const {
|
|
551
559
|
activePredictiveAlgorithms: t,
|
|
552
560
|
languages: e,
|
|
553
|
-
currencies:
|
|
561
|
+
currencies: n
|
|
554
562
|
} = await m.fetchRecommendationCreateData();
|
|
555
563
|
if (this.activePredictiveAlgorithms = t, this.languages = e, this.currentRecommendationId !== null && this.blockStates[this.currentRecommendationId]) {
|
|
556
|
-
const
|
|
557
|
-
|
|
564
|
+
const r = this.blockStates[this.currentRecommendationId];
|
|
565
|
+
r.filterStatus = !!r.recommendationConfigs.filters.length;
|
|
558
566
|
}
|
|
559
|
-
this.currencyList =
|
|
567
|
+
this.currencyList = n;
|
|
560
568
|
})();
|
|
561
569
|
try {
|
|
562
|
-
await
|
|
570
|
+
await p;
|
|
563
571
|
} finally {
|
|
564
|
-
|
|
572
|
+
p = null;
|
|
565
573
|
}
|
|
566
574
|
}
|
|
567
575
|
},
|
|
568
576
|
async fetchRecommendationFilters() {
|
|
569
577
|
if (!Object.keys(this.filterList).length) {
|
|
570
|
-
if (
|
|
571
|
-
await
|
|
578
|
+
if (y) {
|
|
579
|
+
await y;
|
|
572
580
|
return;
|
|
573
581
|
}
|
|
574
|
-
|
|
582
|
+
y = (async () => {
|
|
575
583
|
const t = await m.fetchRecommendationFilters();
|
|
576
584
|
this.filterList = t;
|
|
577
585
|
})();
|
|
578
586
|
try {
|
|
579
|
-
await
|
|
587
|
+
await y;
|
|
580
588
|
} finally {
|
|
581
|
-
|
|
589
|
+
y = null;
|
|
582
590
|
}
|
|
583
591
|
}
|
|
584
592
|
},
|
|
@@ -593,56 +601,56 @@ const Q = () => ({
|
|
|
593
601
|
deleteFilterGroup(t) {
|
|
594
602
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
595
603
|
return;
|
|
596
|
-
const e = this.blockStates[this.currentRecommendationId],
|
|
597
|
-
e.recommendationConfigs.filters =
|
|
604
|
+
const e = this.blockStates[this.currentRecommendationId], n = e.recommendationConfigs.filters.filter((i) => i.filterGroup !== t), r = [...new Set(n.map((i) => i.filterGroup))].sort((i, s) => i - s), o = new Map(r.map((i, s) => [i, s + 1]));
|
|
605
|
+
e.recommendationConfigs.filters = n.map((i) => ({
|
|
598
606
|
...i,
|
|
599
|
-
filterGroup:
|
|
607
|
+
filterGroup: o.get(i.filterGroup) ?? i.filterGroup
|
|
600
608
|
}));
|
|
601
609
|
},
|
|
602
610
|
updateFilter(t) {
|
|
603
611
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
604
612
|
return;
|
|
605
|
-
const e = this.blockStates[this.currentRecommendationId],
|
|
606
|
-
if (
|
|
607
|
-
const
|
|
608
|
-
n
|
|
613
|
+
const e = this.blockStates[this.currentRecommendationId], n = e.recommendationConfigs.filters.findIndex((r) => r.filterNumber === t.filterNumber && r.filterGroup === t.filterGroup);
|
|
614
|
+
if (n !== -1) {
|
|
615
|
+
const r = [...e.recommendationConfigs.filters];
|
|
616
|
+
r[n] = {
|
|
609
617
|
...t,
|
|
610
|
-
isValid:
|
|
611
|
-
}, e.recommendationConfigs.filters =
|
|
618
|
+
isValid: H(t)
|
|
619
|
+
}, e.recommendationConfigs.filters = r;
|
|
612
620
|
}
|
|
613
621
|
},
|
|
614
622
|
deleteFilter(t) {
|
|
615
623
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
616
624
|
return;
|
|
617
|
-
const e = this.blockStates[this.currentRecommendationId],
|
|
618
|
-
if (
|
|
619
|
-
let
|
|
620
|
-
if (
|
|
625
|
+
const e = this.blockStates[this.currentRecommendationId], n = [...e.recommendationConfigs.filters].findIndex((r) => r.filterNumber === t.filterNumber && r.filterGroup === t.filterGroup);
|
|
626
|
+
if (n !== -1) {
|
|
627
|
+
let r = [...e.recommendationConfigs.filters];
|
|
628
|
+
if (r.splice(n, 1), r.some((i) => i.filterGroup === t.filterGroup)) {
|
|
621
629
|
let i = 1;
|
|
622
|
-
|
|
630
|
+
r = r.map((s) => s.filterGroup === t.filterGroup ? { ...s, filterNumber: i++ } : s);
|
|
623
631
|
} else {
|
|
624
|
-
const i = [...new Set(
|
|
625
|
-
|
|
632
|
+
const i = [...new Set(r.map((a) => a.filterGroup))].sort((a, d) => a - d), s = new Map(i.map((a, d) => [a, d + 1]));
|
|
633
|
+
r = r.map((a) => ({
|
|
626
634
|
...a,
|
|
627
|
-
filterGroup:
|
|
635
|
+
filterGroup: s.get(a.filterGroup) ?? a.filterGroup
|
|
628
636
|
}));
|
|
629
637
|
}
|
|
630
|
-
e.recommendationConfigs.filters =
|
|
638
|
+
e.recommendationConfigs.filters = r;
|
|
631
639
|
}
|
|
632
640
|
},
|
|
633
641
|
addFilter(t) {
|
|
634
642
|
if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
|
|
635
643
|
return;
|
|
636
|
-
const e = this.blockStates[this.currentRecommendationId],
|
|
637
|
-
(
|
|
638
|
-
).length + 1, i =
|
|
639
|
-
i !== -1 ?
|
|
644
|
+
const e = this.blockStates[this.currentRecommendationId], n = [...e.recommendationConfigs.filters], o = n.filter(
|
|
645
|
+
(s) => s.filterGroup === t.filterGroup
|
|
646
|
+
).length + 1, i = n.findLastIndex((s) => s.filterGroup === t.filterGroup);
|
|
647
|
+
i !== -1 ? n.splice(i + 1, 0, {
|
|
640
648
|
...t,
|
|
641
|
-
filterNumber:
|
|
642
|
-
}) :
|
|
649
|
+
filterNumber: o
|
|
650
|
+
}) : n.push({
|
|
643
651
|
...t,
|
|
644
|
-
filterNumber:
|
|
645
|
-
}), e.recommendationConfigs.filters =
|
|
652
|
+
filterNumber: o
|
|
653
|
+
}), e.recommendationConfigs.filters = n;
|
|
646
654
|
},
|
|
647
655
|
generateFilterQuery() {
|
|
648
656
|
return P(this.recommendationConfigs.filters);
|
|
@@ -653,111 +661,149 @@ const Q = () => ({
|
|
|
653
661
|
* every block's recommendationConfigs across user edits.
|
|
654
662
|
*/
|
|
655
663
|
hasInvalidBlock() {
|
|
656
|
-
return Object.values(this.blockStates).some((t) => !
|
|
664
|
+
return Object.values(this.blockStates).some((t) => !Q(t.recommendationConfigs, this));
|
|
657
665
|
},
|
|
658
666
|
/**
|
|
659
667
|
* Which required fields are missing across the design's blocks, so the save
|
|
660
668
|
* toaster can name the cause instead of always showing the generic message.
|
|
661
669
|
*/
|
|
662
670
|
invalidBlockFields() {
|
|
663
|
-
return Object.values(this.blockStates).flatMap((t) =>
|
|
671
|
+
return Object.values(this.blockStates).flatMap((t) => J(t.recommendationConfigs, this));
|
|
664
672
|
},
|
|
665
673
|
// ====================================================================
|
|
666
674
|
// Per-Block Product Fetching
|
|
667
675
|
// ====================================================================
|
|
668
676
|
async fetchRecommendationProducts() {
|
|
669
|
-
|
|
677
|
+
this.currentRecommendationId !== null && await this.fetchRecommendationProductsForBlock(this.currentRecommendationId);
|
|
678
|
+
},
|
|
679
|
+
/**
|
|
680
|
+
* Fetches one block's products whether or not it is selected: the panel teardown and the
|
|
681
|
+
* strategy drawer refresh the block they were handed after the user may have moved on.
|
|
682
|
+
*/
|
|
683
|
+
async fetchRecommendationProductsForBlock(t) {
|
|
684
|
+
var i;
|
|
685
|
+
const e = this.blockStates[t];
|
|
686
|
+
if (!e)
|
|
670
687
|
return;
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
b
|
|
675
|
-
].join(":");
|
|
676
|
-
if (y && I === t) {
|
|
677
|
-
await y;
|
|
688
|
+
const n = [e.configVersion, e.adoptedSizeVersion, b].join(":"), r = I.get(t);
|
|
689
|
+
if ((r == null ? void 0 : r.key) === n) {
|
|
690
|
+
await r.promise;
|
|
678
691
|
return;
|
|
679
692
|
}
|
|
680
|
-
|
|
693
|
+
const o = this._doFetchProducts(t);
|
|
694
|
+
I.set(t, { key: n, promise: o });
|
|
681
695
|
try {
|
|
682
|
-
await
|
|
696
|
+
await o;
|
|
683
697
|
} finally {
|
|
684
|
-
|
|
698
|
+
((i = I.get(t)) == null ? void 0 : i.promise) === o && I.delete(t);
|
|
685
699
|
}
|
|
686
700
|
},
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
701
|
+
// Captures the block ID up front so the write lands on it even if the user switches.
|
|
702
|
+
async _doFetchProducts(t) {
|
|
703
|
+
var S;
|
|
704
|
+
const e = t ?? this.currentRecommendationId, n = this.blockStates[e], { recommendationConfigs: r } = n, o = R();
|
|
705
|
+
if (r.strategyId && o.isFeatureEnabled("reusableRecommendationStrategy")) {
|
|
706
|
+
await this._doFetchStrategyProducts(e);
|
|
692
707
|
return;
|
|
693
708
|
}
|
|
694
|
-
const
|
|
695
|
-
|
|
696
|
-
const
|
|
709
|
+
const i = (u.get(e) ?? 0) + 1;
|
|
710
|
+
u.set(e, i);
|
|
711
|
+
const s = parseInt(r.size) || 6;
|
|
697
712
|
if (!r.strategy) {
|
|
698
|
-
this._setBlockProducts(
|
|
713
|
+
this._setBlockProducts(e, [], s);
|
|
699
714
|
return;
|
|
700
715
|
}
|
|
701
|
-
const
|
|
716
|
+
const a = r.filters.filter((h) => h.isValid), d = P(a), f = ((S = F().find((h) => h.key === r.strategy)) == null ? void 0 : S.path) || "", c = {
|
|
702
717
|
locale: r.language,
|
|
703
718
|
currency: r.currencySettings.value,
|
|
704
|
-
partnerName:
|
|
719
|
+
partnerName: o.partnerName,
|
|
705
720
|
size: r.size,
|
|
706
721
|
details: !0,
|
|
707
|
-
campaignId:
|
|
722
|
+
campaignId: o.variationId
|
|
708
723
|
};
|
|
709
|
-
r.strategy === "manualMerchandising" ? c.productId =
|
|
724
|
+
r.strategy === "manualMerchandising" ? c.productId = K(r.productIds) : r.strategy === "similarViewed" && (c.productId = "{itemId}"), r.strategy === "userBased" && (c.userId = "{user_id}"), d && (c.filter = d), r.shuffleProducts && (c.shuffle = !0), Object.assign(
|
|
710
725
|
c,
|
|
711
|
-
|
|
726
|
+
q(o.partnerName, r.strategy)
|
|
712
727
|
);
|
|
713
|
-
let
|
|
728
|
+
let g;
|
|
714
729
|
try {
|
|
715
|
-
|
|
730
|
+
g = await m.fetchRecommendationProducts(f, c);
|
|
716
731
|
} catch {
|
|
717
|
-
|
|
732
|
+
g = [];
|
|
718
733
|
}
|
|
719
|
-
|
|
734
|
+
u.get(e) === i && this._setBlockProducts(e, g, s);
|
|
720
735
|
},
|
|
721
736
|
/**
|
|
722
|
-
* Block-scoped counterpart of `fetchRecommendationProducts`, which only
|
|
723
|
-
*
|
|
724
|
-
*
|
|
737
|
+
* Block-scoped counterpart of `fetchRecommendationProducts`, which only serves the selected block:
|
|
738
|
+
* the legacy conversion and the duplicate refresh must reach a block that may no longer be selected.
|
|
739
|
+
* @returns whether real products arrived
|
|
725
740
|
*/
|
|
726
|
-
async fetchStrategyProductsForBlock(t) {
|
|
727
|
-
var
|
|
728
|
-
(
|
|
741
|
+
async fetchStrategyProductsForBlock(t, e = {}) {
|
|
742
|
+
var n;
|
|
743
|
+
return (n = this.blockStates[t]) != null && n.recommendationConfigs.strategyId ? this._doFetchStrategyProducts(t, e) : !1;
|
|
744
|
+
},
|
|
745
|
+
/**
|
|
746
|
+
* Reloads a block's products and adopts its strategy's current size, which may have
|
|
747
|
+
* moved since the block was assigned.
|
|
748
|
+
* @returns whether a fresh listing holds the strategy and its products arrived
|
|
749
|
+
*/
|
|
750
|
+
async refreshStrategyBlock(t) {
|
|
751
|
+
var o;
|
|
752
|
+
const e = (o = this.blockStates[t]) == null ? void 0 : o.recommendationConfigs.strategyId;
|
|
753
|
+
if (!e)
|
|
754
|
+
return !1;
|
|
755
|
+
try {
|
|
756
|
+
await this.fetchStrategies();
|
|
757
|
+
} catch {
|
|
758
|
+
return !1;
|
|
759
|
+
}
|
|
760
|
+
const n = this.strategiesFetched ? this.strategies.find((i) => String(i.strategy_id) === e) : void 0;
|
|
761
|
+
if (!n || !await this.fetchStrategyProductsForBlock(t, { keepOnFailure: !0 }))
|
|
762
|
+
return !1;
|
|
763
|
+
const r = this.blockStates[t];
|
|
764
|
+
if ((r == null ? void 0 : r.recommendationConfigs.strategyId) !== e)
|
|
765
|
+
return !1;
|
|
766
|
+
if (n.size !== void 0) {
|
|
767
|
+
const i = String(n.size);
|
|
768
|
+
r.recommendationConfigs.size !== i && r.adoptedSizeVersion++, r.recommendationConfigs = { ...r.recommendationConfigs, size: i };
|
|
769
|
+
}
|
|
770
|
+
return !0;
|
|
771
|
+
},
|
|
772
|
+
_doFetchStrategyProducts(t, e = {}) {
|
|
773
|
+
const n = (u.get(t) ?? 0) + 1;
|
|
774
|
+
u.set(t, n);
|
|
775
|
+
const r = this._loadStrategyProducts(t, n, e);
|
|
776
|
+
return _.set(t, { token: n, outcome: r }), r;
|
|
729
777
|
},
|
|
730
|
-
async
|
|
731
|
-
const e = (g.get(t) ?? 0) + 1;
|
|
732
|
-
g.set(t, e);
|
|
778
|
+
async _loadStrategyProducts(t, e, { keepOnFailure: n = !1 }) {
|
|
733
779
|
const { recommendationConfigs: r } = this.blockStates[t];
|
|
734
|
-
let
|
|
780
|
+
let o = [], i = parseInt(r.size) || 6;
|
|
735
781
|
try {
|
|
736
782
|
await this.fetchStrategies();
|
|
737
|
-
const
|
|
738
|
-
(
|
|
783
|
+
const s = this.strategies.find(
|
|
784
|
+
(a) => String(a.strategy_id) === r.strategyId
|
|
739
785
|
);
|
|
740
|
-
if (
|
|
741
|
-
|
|
742
|
-
const
|
|
743
|
-
|
|
786
|
+
if (s) {
|
|
787
|
+
i = parseInt(String(s.size ?? "")) || i;
|
|
788
|
+
const a = r.currencySettings.value, f = (await this.resolveStrategyUrlTemplate(s, a)).replaceAll("{locale}", r.language).replaceAll("{currency}", a), c = f.indexOf("?"), g = c === -1 ? f : f.slice(0, c), S = (c === -1 ? "" : f.slice(c + 1)).split("&").filter((v) => v && !v.startsWith("user_id=")), h = S.length ? `${g}?${S.join("&")}` : g;
|
|
789
|
+
h && (o = await m.fetchRecommendationProductsByUrl(h));
|
|
744
790
|
}
|
|
745
791
|
} catch {
|
|
746
|
-
|
|
792
|
+
o = [];
|
|
747
793
|
}
|
|
748
|
-
|
|
794
|
+
return u.get(t) !== e ? W(t) : !o.length && n ? !1 : (this._setBlockProducts(t, o, i), o.length > 0);
|
|
749
795
|
},
|
|
750
|
-
_setBlockProducts(t, e,
|
|
796
|
+
_setBlockProducts(t, e, n) {
|
|
751
797
|
if (!this.blockStates[t])
|
|
752
798
|
return;
|
|
753
|
-
const
|
|
799
|
+
const r = e.length > 0 ? e : w(n);
|
|
754
800
|
this.blockStates[t].recommendationProducts = [
|
|
755
|
-
...
|
|
756
|
-
...w(Math.max(0,
|
|
801
|
+
...r.slice(0, n),
|
|
802
|
+
...w(Math.max(0, n - r.length))
|
|
757
803
|
];
|
|
758
804
|
}
|
|
759
805
|
}
|
|
760
806
|
});
|
|
761
807
|
export {
|
|
762
|
-
|
|
808
|
+
ht as useRecommendationExtensionStore
|
|
763
809
|
};
|